Przeglądaj źródła

优化租赁费用功能

java110 5 lat temu
rodzic
commit
f0885243d2

+ 44 - 0
service-fee/src/main/java/com/java110/fee/api/RentingFeeApi.java

@@ -0,0 +1,44 @@
+package com.java110.fee.api;
+
+import com.java110.dto.fee.FeeDto;
+import com.java110.fee.bmo.rentingFee.IQueryRentingFee;
+import com.java110.intf.fee.IFeeInnerServiceSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+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 = "/rentingFee")
+public class RentingFeeApi {
+
+    @Autowired
+    private IQueryRentingFee queryRentingFeeImpl;
+
+
+    /**
+     * 查询租赁费
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /rentingFee/queryFee
+     * @path /app/rentingFee/queryFee
+     */
+    @RequestMapping(value = "/queryFee", method = RequestMethod.GET)
+    public ResponseEntity<String> queryFee(@RequestParam(value = "communityId") String communityId,
+                                           @RequestParam(value = "rentingId", required = false) String rentingId,
+                                           @RequestParam(value = "page") int page,
+                                           @RequestParam(value = "row") int row) {
+        FeeDto feeDto = new FeeDto();
+        feeDto.setPage(page);
+        feeDto.setRow(row);
+        feeDto.setCommunityId(communityId);
+        feeDto.setPayerObjId(rentingId);
+        feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_RENTING);
+        return queryRentingFeeImpl.queryFees(feeDto);
+    }
+
+
+}

+ 16 - 0
service-fee/src/main/java/com/java110/fee/bmo/rentingFee/IQueryRentingFee.java

@@ -0,0 +1,16 @@
+package com.java110.fee.bmo.rentingFee;
+
+import com.java110.dto.fee.FeeDto;
+import org.springframework.http.ResponseEntity;
+
+import java.util.List;
+
+public interface IQueryRentingFee {
+
+    /**
+     * 查询租赁费用
+     * @param feeDto
+     * @return
+     */
+    ResponseEntity<String> queryFees(FeeDto feeDto);
+}

+ 32 - 0
service-fee/src/main/java/com/java110/fee/bmo/rentingFee/impl/QueryRentingFeeImpl.java

@@ -0,0 +1,32 @@
+package com.java110.fee.bmo.rentingFee.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.java110.dto.fee.FeeDto;
+import com.java110.fee.bmo.rentingFee.IQueryRentingFee;
+import com.java110.intf.fee.IFeeInnerServiceSMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service("queryRentingFeeImpl")
+public class QueryRentingFeeImpl implements IQueryRentingFee {
+
+    @Autowired
+    private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
+
+    @Override
+    public ResponseEntity<String> queryFees(FeeDto feeDto) {
+
+        List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
+
+        if (feeDtos == null || feeDtos.size() < 1) {
+            return ResultVo.createResponseEntity(new JSONArray());
+        }
+
+        return ResultVo.createResponseEntity(feeDtos);
+    }
+}