From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能
---
service-fee/src/main/java/com/java110/fee/api/FeeApi.java | 54 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 43 insertions(+), 11 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 b86862a..e811673
--- a/service-fee/src/main/java/com/java110/fee/api/FeeApi.java
+++ b/service-fee/src/main/java/com/java110/fee/api/FeeApi.java
@@ -4,6 +4,7 @@
import com.java110.core.base.controller.BaseController;
import com.java110.core.context.BusinessServiceDataFlow;
import com.java110.core.factory.DataTransactionFactory;
+import com.java110.core.log.LoggerFactory;
import com.java110.dto.fee.FeeAttrDto;
import com.java110.dto.fee.FeeDto;
import com.java110.fee.bmo.*;
@@ -12,8 +13,8 @@
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;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -83,8 +84,8 @@
responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow, ResponseConstant.RESULT_CODE_ERROR, e.getMessage() + e,
null);
} finally {
- return responseJson.toJSONString();
}
+ return responseJson.toJSONString();
}
/**
@@ -171,12 +172,18 @@
*/
@RequestMapping(value = "/listOweFees", method = RequestMethod.GET)
public ResponseEntity<String> listOweFees(
- @RequestParam(value = "payObjId") String payObjId,
- @RequestParam(value = "payObjType") String payObjType,
+ @RequestParam(value = "payObjId", required = false) String payObjId,
+ @RequestParam(value = "payObjType", required = false) String payObjType,
+ @RequestParam(value = "ownerId", required = false) String ownerId,
@RequestParam(value = "communityId") String communityId) {
+
+ if (StringUtil.isEmpty(payObjId) && StringUtil.isEmpty(ownerId)) {
+ throw new IllegalArgumentException("璐圭敤瀵硅薄鎴栬�呬笟涓讳笉鑳介兘涓虹┖");
+ }
FeeDto feeDto = new FeeDto();
feeDto.setPayerObjId(payObjId);
feeDto.setPayerObjType(payObjType);
+ feeDto.setOwnerId(ownerId);
feeDto.setCommunityId(communityId);
return queryOweFeeImpl.query(feeDto);
}
@@ -184,19 +191,20 @@
/**
* 鏌ヨ娆犺垂璐圭敤
*
- * @param feeId 璐圭敤ID
+ * @param roomId 鎴垮眿ID
* @param communityId 灏忓尯ID
* @return
- * @path /app/feeApi/listFeeObj
+ * @path /app/feeApi/listAllRoomOweFees
*/
- @RequestMapping(value = "/listFeeObj", method = RequestMethod.GET)
- public ResponseEntity<String> listFeeObj(
- @RequestParam(value = "feeId") String feeId,
+ @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.setFeeId(feeId);
+ feeDto.setPayerObjId(roomId);
+ feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
feeDto.setCommunityId(communityId);
- return queryOweFeeImpl.listFeeObj(feeDto);
+ return queryOweFeeImpl.querys(feeDto);
}
@@ -267,6 +275,7 @@
Assert.hasKeyAndValue(reqJson, "feeTypeCd", "鏈寘鍚垂鐢ㄧ被鍨�");
Assert.hasKeyAndValue(reqJson, "storeId", "鏈寘鍚晢鎴蜂俊鎭�");
Assert.hasKeyAndValue(reqJson, "userId", "鏈寘鍚敤鎴蜂俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "batchId", "鏈寘鍚敤鎴蜂俊鎭�");
return importRoomFeeImpl.importFee(reqJson);
}
@@ -275,6 +284,7 @@
* 杞﹁締璐圭敤瀵煎叆
* /feeApi/importCarFees
* path /app/feeApi/importCarFees
+ *
* @param reqString
* @return
*/
@@ -286,8 +296,30 @@
Assert.hasKeyAndValue(reqJson, "feeTypeCd", "鏈寘鍚垂鐢ㄧ被鍨�");
Assert.hasKeyAndValue(reqJson, "storeId", "鏈寘鍚晢鎴蜂俊鎭�");
Assert.hasKeyAndValue(reqJson, "userId", "鏈寘鍚敤鎴蜂俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "batchId", "鏈寘鍚壒娆′俊鎭�");
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", "鏈寘鍚敤鎴蜂俊鎭�");
+ Assert.hasKeyAndValue(reqJson, "batchId", "鏈寘鍚壒娆′俊鎭�");
+
+ return importRoomFeeImpl.importContractFees(reqJson);
+ }
+
}
--
Gitblit v1.8.0