From 1d4e7dc07b0ef56d852a02ffc6f02df0d28d4549 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 23 八月 2021 16:58:31 +0800
Subject: [PATCH] 优化代码
---
service-fee/src/main/java/com/java110/fee/api/FeeApi.java | 95 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 89 insertions(+), 6 deletions(-)
diff --git a/service-fee/src/main/java/com/java110/fee/api/FeeApi.java b/service-fee/src/main/java/com/java110/fee/api/FeeApi.java
old mode 100644
new mode 100755
index 991a8eb..953e486
--- a/service-fee/src/main/java/com/java110/fee/api/FeeApi.java
+++ b/service-fee/src/main/java/com/java110/fee/api/FeeApi.java
@@ -12,6 +12,7 @@
import com.java110.utils.exception.InitConfigDataException;
import com.java110.utils.exception.InitDataFlowContextException;
import com.java110.utils.util.Assert;
+import com.java110.utils.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -83,8 +84,8 @@
responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow, ResponseConstant.RESULT_CODE_ERROR, e.getMessage() + e,
null);
} finally {
- return responseJson.toJSONString();
}
+ return responseJson.toJSONString();
}
/**
@@ -181,26 +182,68 @@
return queryOweFeeImpl.query(feeDto);
}
+ /**
+ * 鏌ヨ娆犺垂璐圭敤
+ *
+ * @param roomId 鎴垮眿ID
+ * @param communityId 灏忓尯ID
+ * @return
+ * @path /app/feeApi/listAllRoomOweFees
+ */
+ @RequestMapping(value = "/listAllRoomOweFees", method = RequestMethod.GET)
+ public ResponseEntity<String> listAllRoomOweFees(
+ @RequestParam(value = "roomId", required = false) String roomId,
+ @RequestParam(value = "communityId") String communityId) {
+ FeeDto feeDto = new FeeDto();
+ feeDto.setPayerObjId(roomId);
+ feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
+ feeDto.setCommunityId(communityId);
+ return queryOweFeeImpl.querys(feeDto);
+ }
+
+ /**
+ * 鏌ヨ娆犺垂璐圭敤
+ *
+ * @param feeId 璐圭敤ID
+ * @param communityId 灏忓尯ID
+ * @param cycle 鍛ㄦ湡
+ * @return
+ * @path /app/feeApi/listFeeObj
+ */
+ @RequestMapping(value = "/listFeeObj", method = RequestMethod.GET)
+ public ResponseEntity<String> listFeeObj(
+ @RequestParam(value = "feeId") String feeId,
+ @RequestParam(value = "cycle", required = false) String cycle,
+ @RequestParam(value = "communityId") String communityId) {
+ FeeDto feeDto = new FeeDto();
+ feeDto.setFeeId(feeId);
+ feeDto.setCommunityId(communityId);
+ if (!StringUtil.isEmpty(cycle)) {
+ feeDto.setCycle(cycle);
+ }
+ return queryOweFeeImpl.listFeeObj(feeDto);
+ }
+
/**
* 鏌ヨ娆犺垂璐圭敤(鎵归噺鏌ヨ)
*
- * @param payObjId 浠樿垂鏂笽D
+ * @param num 鍋滆溅浣嶆垨鎴垮眿缂栧彿
* @param communityId 灏忓尯ID
* @return
- * @path /app/feeApi/listOweFees
+ * @path /app/feeApi/getOweFees
*/
@RequestMapping(value = "/getOweFees", method = RequestMethod.GET)
public ResponseEntity<String> getOweFees(
- @RequestParam(value = "payObjId") String payObjId,
@RequestParam(value = "payObjType") String payObjType,
@RequestParam(value = "communityId") String communityId,
@RequestParam(value = "billType") String billType,
@RequestParam(value = "row") int row,
- @RequestParam(value = "page") int page
+ @RequestParam(value = "page") int page,
+ @RequestParam(value = "num", required = false) String num
) {
FeeDto feeDto = new FeeDto();
- feeDto.setPayerObjId(payObjId);
+ feeDto.setPayerObjId(num);
feeDto.setPayerObjType(payObjType);
feeDto.setCommunityId(communityId);
feeDto.setBillType(billType);
@@ -253,4 +296,44 @@
return importRoomFeeImpl.importFee(reqJson);
}
+ /**
+ * 杞﹁締璐圭敤瀵煎叆
+ * /feeApi/importCarFees
+ * path /app/feeApi/importCarFees
+ *
+ * @param reqString
+ * @return
+ */
+ @RequestMapping(value = "/importCarFees", method = RequestMethod.POST)
+ public ResponseEntity<String> importCarFees(@RequestBody String reqString) {
+
+ JSONObject reqJson = JSONObject.parseObject(reqString);
+ Assert.hasKeyAndValue(reqJson, "communityId", "鏈寘鍚皬鍖轰俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "feeTypeCd", "鏈寘鍚垂鐢ㄧ被鍨�");
+ Assert.hasKeyAndValue(reqJson, "storeId", "鏈寘鍚晢鎴蜂俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "userId", "鏈寘鍚敤鎴蜂俊鎭�");
+
+ return importRoomFeeImpl.importCarFee(reqJson);
+ }
+
+ /**
+ * 鍚堝悓璐圭敤瀵煎叆
+ * /feeApi/importContractFees
+ * path /app/feeApi/importContractFees
+ *
+ * @param reqString
+ * @return
+ */
+ @RequestMapping(value = "/importContractFees", method = RequestMethod.POST)
+ public ResponseEntity<String> importContractFees(@RequestBody String reqString) {
+
+ JSONObject reqJson = JSONObject.parseObject(reqString);
+ Assert.hasKeyAndValue(reqJson, "communityId", "鏈寘鍚皬鍖轰俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "feeTypeCd", "鏈寘鍚垂鐢ㄧ被鍨�");
+ Assert.hasKeyAndValue(reqJson, "storeId", "鏈寘鍚晢鎴蜂俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "userId", "鏈寘鍚敤鎴蜂俊鎭�");
+
+ return importRoomFeeImpl.importContractFees(reqJson);
+ }
+
}
--
Gitblit v1.8.0