From 8749db96edc44e76a9b2ecaf0332e8c0f34fbb5b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 08 八月 2023 14:58:59 +0800
Subject: [PATCH] 优化代码

---
 service-fee/src/main/java/com/java110/fee/api/FeePrintSpecApi.java |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/api/FeePrintSpecApi.java b/service-fee/src/main/java/com/java110/fee/api/FeePrintSpecApi.java
old mode 100644
new mode 100755
index 4e4af5a..8f732dd
--- a/service-fee/src/main/java/com/java110/fee/api/FeePrintSpecApi.java
+++ b/service-fee/src/main/java/com/java110/fee/api/FeePrintSpecApi.java
@@ -1,18 +1,21 @@
 package com.java110.fee.api;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.dto.feePrintSpec.FeePrintSpecDto;
+import com.java110.dto.fee.FeePrintSpecDto;
 import com.java110.fee.bmo.feePrintSpec.IDeleteFeePrintSpecBMO;
 import com.java110.fee.bmo.feePrintSpec.IGetFeePrintSpecBMO;
 import com.java110.fee.bmo.feePrintSpec.ISaveFeePrintSpecBMO;
 import com.java110.fee.bmo.feePrintSpec.IUpdateFeePrintSpecBMO;
-import com.java110.po.feePrintSpec.FeePrintSpecPo;
+import com.java110.po.fee.feePrintSpec.FeePrintSpecPo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 @RequestMapping(value = "/feePrintSpec")
@@ -20,8 +23,10 @@
 
     @Autowired
     private ISaveFeePrintSpecBMO saveFeePrintSpecBMOImpl;
+
     @Autowired
     private IUpdateFeePrintSpecBMO updateFeePrintSpecBMOImpl;
+
     @Autowired
     private IDeleteFeePrintSpecBMO deleteFeePrintSpecBMOImpl;
 
@@ -38,12 +43,8 @@
      */
     @RequestMapping(value = "/saveFeePrintSpec", method = RequestMethod.POST)
     public ResponseEntity<String> saveFeePrintSpec(@RequestBody JSONObject reqJson) {
-
         Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈communityId");
-        Assert.hasKeyAndValue(reqJson, "content", "璇锋眰鎶ユ枃涓湭鍖呭惈content");
         Assert.hasKeyAndValue(reqJson, "specCd", "璇锋眰鎶ユ枃涓湭鍖呭惈specCd");
-
-
         FeePrintSpecPo feePrintSpecPo = BeanConvertUtil.covertBean(reqJson, FeePrintSpecPo.class);
         return saveFeePrintSpecBMOImpl.save(feePrintSpecPo);
     }
@@ -58,13 +59,9 @@
      */
     @RequestMapping(value = "/updateFeePrintSpec", method = RequestMethod.POST)
     public ResponseEntity<String> updateFeePrintSpec(@RequestBody JSONObject reqJson) {
-
         Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈communityId");
-        Assert.hasKeyAndValue(reqJson, "content", "璇锋眰鎶ユ枃涓湭鍖呭惈content");
         Assert.hasKeyAndValue(reqJson, "specCd", "璇锋眰鎶ユ枃涓湭鍖呭惈specCd");
         Assert.hasKeyAndValue(reqJson, "printId", "printId涓嶈兘涓虹┖");
-
-
         FeePrintSpecPo feePrintSpecPo = BeanConvertUtil.covertBean(reqJson, FeePrintSpecPo.class);
         return updateFeePrintSpecBMOImpl.update(feePrintSpecPo);
     }
@@ -80,10 +77,7 @@
     @RequestMapping(value = "/deleteFeePrintSpec", method = RequestMethod.POST)
     public ResponseEntity<String> deleteFeePrintSpec(@RequestBody JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "communityId", "灏忓尯ID涓嶈兘涓虹┖");
-
         Assert.hasKeyAndValue(reqJson, "printId", "printId涓嶈兘涓虹┖");
-
-
         FeePrintSpecPo feePrintSpecPo = BeanConvertUtil.covertBean(reqJson, FeePrintSpecPo.class);
         return deleteFeePrintSpecBMOImpl.delete(feePrintSpecPo);
     }
@@ -98,12 +92,14 @@
      */
     @RequestMapping(value = "/queryFeePrintSpec", method = RequestMethod.GET)
     public ResponseEntity<String> queryFeePrintSpec(@RequestParam(value = "communityId") String communityId,
+                                                    @RequestParam(value = "specCd", required = false) String specCd,
                                                     @RequestParam(value = "page") int page,
                                                     @RequestParam(value = "row") int row) {
         FeePrintSpecDto feePrintSpecDto = new FeePrintSpecDto();
         feePrintSpecDto.setPage(page);
         feePrintSpecDto.setRow(row);
         feePrintSpecDto.setCommunityId(communityId);
+        feePrintSpecDto.setSpecCd(specCd);
         return getFeePrintSpecBMOImpl.get(feePrintSpecDto);
     }
 }

--
Gitblit v1.8.0