Xiaojh 4 anni fa
parent
commit
131df35c33
15 ha cambiato i file con 199 aggiunte e 120 eliminazioni
  1. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/AmountWaterUsedAmountController.java
  2. 79 75
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayFeeController.java
  3. 3 3
      smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/archives/PayBaseCustomerandmeterrelaController.java
  4. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/AmountWaterUsedAmountMapper.java
  5. 9 2
      smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/BaseWaterPropertyFormDto.java
  6. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeAccountInfoDto.java
  7. 11 0
      smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeDetaileBill.java
  8. 2 2
      smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/AmountWaterUsedAmount.java
  9. 2 0
      smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayBaseCustomerandmeterrela.java
  10. 4 0
      smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/BaseWaterPropertyServiceImpl.java
  11. 1 1
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/PayBaseCustomerandmeterrelaService.java
  12. 47 15
      smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java
  13. 18 15
      smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml
  14. 14 4
      smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml
  15. 4 2
      smart-city-platform/src/main/resources/mapper/pay/payFeeMapper.xml

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/AmountWaterUsedAmountController.java

@@ -40,7 +40,7 @@ public class AmountWaterUsedAmountController {
     @GetMapping("/pageList")
     @ApiOperation(value = "获取设备分页")
     public AjaxMessage<Pagination<AmountWaterUsedAmountDto>> propertyPageList(
-            @ApiParam(value = "查询条件:客户编号/客户名称/水表档案号/安装地址") @RequestParam(required = false) String condition,
+            @ApiParam(value = "查询条件:客户编号/水表档案号/水表电子号") @RequestParam(required = false) String condition,
             //@ApiParam(value = "客户编号") @RequestParam(required = false) String accountNumber,
             //@ApiParam(value = "客户名称") @RequestParam(required = false) String accountName,
             //@ApiParam(value = "水表档案号") @RequestParam(required = false) String meterCode,

+ 79 - 75
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayFeeController.java

@@ -49,7 +49,7 @@ public class PayFeeController {
 
 
     @PostMapping("/payFee")
-    @ApiOperation(value="冲账接口,客户名称、客户编码、应收id不能同时为空")
+    @ApiOperation(value = "冲账接口,客户名称、客户编码、应收id不能同时为空")
     public AjaxMessage<String> payFee(
             @ApiParam(value = "客户编码", required = false) @RequestParam(required = false) String accountnumber,
             @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String metercode,
@@ -60,152 +60,156 @@ public class PayFeeController {
             @ApiParam(value = "站点ID", required = false) @RequestParam(required = false) String siteId,
             @ApiParam(value = "水司ID", required = false) @RequestParam(required = false) String customerId,
             @ApiParam(value = "用户ID", required = false) @RequestParam(required = false) String userId
-    ){
+    ) {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
-        List<BigInteger> arrayList= null;
-        if(StringUtils.isNotBlank(receivableIds)){
-            arrayList=  Arrays.asList(receivableIds.split(",")).stream().map(BigInteger::new).collect(Collectors.toList());
+        List<BigInteger> arrayList = null;
+        if (StringUtils.isNotBlank(receivableIds)) {
+            arrayList = Arrays.asList(receivableIds.split(",")).stream().map(BigInteger::new).collect(Collectors.toList());
         }
 
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.payFee(accountnumber,
-                                                                            metercode,
-                                                                            BigDecimal.valueOf(Double.parseDouble(transAmount)),
-                                                                            Integer.valueOf(paytype),
-                                                                            transTime != null? LocalDateTime.parse(transTime,df): null,
-                                                                            arrayList,
-                                                                            siteId != null?Integer.parseInt(siteId):null,
-                                                                            customerId != null?Integer.parseInt(customerId):null,
-                                                                            userId != null?Integer.parseInt(userId):null)
-                );
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFee(accountnumber,
+                metercode,
+                BigDecimal.valueOf(Double.parseDouble(transAmount)),
+                Integer.valueOf(paytype),
+                transTime != null ? LocalDateTime.parse(transTime, df) : null,
+                arrayList,
+                siteId != null ? Integer.parseInt(siteId) : null,
+                customerId != null ? Integer.parseInt(customerId) : null,
+                userId != null ? Integer.parseInt(userId) : null)
+        );
     }
 
 
     @PostMapping("/payFeeCounter")
-    @ApiOperation(value="柜台缴费接口")
+    @ApiOperation(value = "柜台缴费接口")
     public AjaxMessage<PayfeeResult> payFeeCounter(
-            @ApiParam(value = "客户id", required = true) @RequestParam(required = true)String accountId,
-            @ApiParam(value = "欠费金额", required = false) @RequestParam(required = false)String debt,
-            @ApiParam(value = "预存金额", required = false) @RequestParam(required = false)String remaining,
-            @ApiParam(value = "购水量", required = false) @RequestParam(required = false)String amount,
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) String accountId,
+            @ApiParam(value = "欠费金额", required = false) @RequestParam(required = false) String debt,
+            @ApiParam(value = "预存金额", required = false) @RequestParam(required = false) String remaining,
+            @ApiParam(value = "购水量", required = false) @RequestParam(required = false) String amount,
             /*@ApiParam(value = "购水金额", required = false) @RequestParam(required = false)String waterAmount,*/
-            @ApiParam(value = "单价", required = false) @RequestParam(required = false)String price,
-            @ApiParam(value = "实收金额", required = true) @RequestParam(required = true)String transAmount,
-            @ApiParam(value = "支付方式", required = true) @RequestParam(required = true)Integer payway,
-            @ApiParam(value = "是否转预存,0否 1是", required = true) @RequestParam(required = true)Integer balancetype
+            @ApiParam(value = "单价", required = false) @RequestParam(required = false) String price,
+            @ApiParam(value = "实收金额", required = true) @RequestParam(required = true) String transAmount,
+            @ApiParam(value = "支付方式", required = true) @RequestParam(required = true) Integer payway,
+            @ApiParam(value = "是否转预存,0否 1是", required = true) @RequestParam(required = true) Integer balancetype
 
-    ){
+    ) {
         //暂时先默认柜台支付为现金支付,后期区分
-     return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFeeCounter(accountId,4,new BigDecimal(transAmount),balancetype,
-             new BigDecimal(debt),new BigDecimal(remaining),Integer.valueOf(amount),new BigDecimal(price)));
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.payFeeCounter(accountId, 4, new BigDecimal(transAmount), balancetype,
+                new BigDecimal(debt), new BigDecimal(remaining), Integer.valueOf(amount), new BigDecimal(price)));
     }
 
     @GetMapping("/findPayfeeAccountInfo")
-    @ApiOperation(value="收费界面查询客户信息,客户id是在查询出多用户时,选择某个用户")
+    @ApiOperation(value = "收费界面查询客户信息,客户id是在查询出多用户时,选择某个用户")
     public AjaxMessage<List<PayfeeAccountInfoDto>> findPayfeeAccountInfo(
-            @ApiParam(value = "开户id,查询多用户时,再次查询用id查询") @RequestParam(required = false)BigInteger id,
-            @ApiParam(value = "查询内容,户编、户名、手机、地址") @RequestParam(required = false)String condition ){
+            @ApiParam(value = "开户id,查询多用户时,再次查询用id查询") @RequestParam(required = false) BigInteger id,
+            @ApiParam(value = "查询内容,户编、户名、手机、地址") @RequestParam(required = false) String condition) {
 
-        return new AjaxMessage<>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id , condition ));
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.findPayfeeAccountInfo(id, condition));
     }
 
     @GetMapping("/getPayfeeDetaileBill")
-    @ApiOperation(value="查询账单详情")
+    @ApiOperation(value = "查询账单详情")
     public AjaxMessage<PayfeeDetaileBill> getPayfeeDetaileBill(
-            @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId){
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId) {
         //根据客户id查找用水性质ID
         BigInteger propertyId = payFeeService.getWaterPropertyId(accountId);
         BaseWaterPropertyFormDto baseWaterPropertyFormDto = new BaseWaterPropertyFormDto();
-        if(propertyId != null){
+        if (propertyId != null) {
             //根据用水性质ID去查找对应的用水性质
             baseWaterPropertyFormDto = baseWaterPropertyService.getEditPage(propertyId);
-        }else{
+        } else {
             baseWaterPropertyFormDto = new BaseWaterPropertyFormDto();
         }
         PayfeeDetaileBill bill = payFeeService.getPayfeeDetaileBill(accountId);
+        bill.setSumPrice1(baseWaterPropertyFormDto.getSumPrice1());//一阶单价合计
+        bill.setSumPrice2(baseWaterPropertyFormDto.getSumPrice2());//二阶单价合计
+        bill.setSumPrice3(baseWaterPropertyFormDto.getSumPrice3());//三阶单价合计
+        bill.setSumPrice4(baseWaterPropertyFormDto.getSumPrice4());//四阶单价合计
         bill.setProp1(baseWaterPropertyFormDto.getProp1());//一阶用水性质
         bill.setProp2(baseWaterPropertyFormDto.getProp2());//二阶用水性质
         bill.setProp3(baseWaterPropertyFormDto.getProp3());//三阶用水性质
         bill.setProp4(baseWaterPropertyFormDto.getProp4());//四阶用水性质
-        return new AjaxMessage<>(ResultStatus.OK,bill);
+        return new AjaxMessage<>(ResultStatus.OK, bill);
 
     }
 
     @GetMapping("/getPayfeeDetailed")
-    @ApiOperation(value="查询本账期欠费明细")
+    @ApiOperation(value = "查询本账期欠费明细")
     public AjaxMessage<PayfeeDetailed> getPayfeeDetailed(
-            @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayfeeDetailed(accountId));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayfeeDetailed(accountId));
     }
 
     @GetMapping("/getPayreceiveDebt")
-    @ApiOperation(value="收费页面————欠费信息")
+    @ApiOperation(value = "收费页面————欠费信息")
     public AjaxMessage<List<PayfeeReceivableInfo>> getPayreceiveDebt(
-            @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceiveDebt(accountId,year));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceiveDebt(accountId, year));
     }
 
     @GetMapping("/getPayreceiveDebtDetailed")
-    @ApiOperation(value="收费页面————欠费信息详情")
+    @ApiOperation(value = "收费页面————欠费信息详情")
     public AjaxMessage<List<PayfeeReceivableInfo>> getPayreceiveDebtDetailed(
-            @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year,
-            @ApiParam(value = "账期月",required = true) @RequestParam(required = true)Integer month
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceiveDebtDetailed(accountId,year,month));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year,
+            @ApiParam(value = "账期月", required = true) @RequestParam(required = true) Integer month
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceiveDebtDetailed(accountId, year, month));
     }
 
     @GetMapping("/getPayreceived")
-    @ApiOperation(value="收费页面————实收信息")
+    @ApiOperation(value = "收费页面————实收信息")
     public AjaxMessage<List<PayfeeReceivedInfo>> getPayreceived(
-            @ApiParam(value = "客户id",required = true) @RequestParam(required = true)BigInteger accountId ,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceived(accountId,year));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceived(accountId, year));
     }
 
     @GetMapping("/getPayreceivedDetailed")
-    @ApiOperation(value="收费页面————实收信息详情")
+    @ApiOperation(value = "收费页面————实收信息详情")
     public AjaxMessage<List<PayfeeReceivedInfo>> getPayreceivedDetailed(
-            @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger accountId,
-            @ApiParam(value = "交易流水号" ,required = true) @RequestParam(required = true)String payseriesno,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year,
-            @ApiParam(value = "账期月",required = true) @RequestParam(required = true)Integer month
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayreceivedDetailed(accountId,payseriesno,year,month));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
+            @ApiParam(value = "交易流水号", required = true) @RequestParam(required = true) String payseriesno,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year,
+            @ApiParam(value = "账期月", required = true) @RequestParam(required = true) Integer month
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayreceivedDetailed(accountId, payseriesno, year, month));
     }
 
 
     @GetMapping("/getTransDetailed")
-    @ApiOperation(value="收费页面————交易明细详情")
+    @ApiOperation(value = "收费页面————交易明细详情")
     public AjaxMessage<List<PayTransactiondetailsDto>> getListByYear(
             @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger accountId,
             @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
-    ){
+    ) {
 
-        PayTransactiondetailsDto payTransactiondetailsDto =new PayTransactiondetailsDto();
+        PayTransactiondetailsDto payTransactiondetailsDto = new PayTransactiondetailsDto();
         payTransactiondetailsDto.setAccountId(accountId);
         payTransactiondetailsDto.setYear(year);
         return new AjaxMessage<>(ResultStatus.OK, payTransactiondetailsService.selectTransactionList(payTransactiondetailsDto));
     }
 
     @GetMapping("/getWaterusedamount")
-    @ApiOperation(value="收费页面————水量信息")
+    @ApiOperation(value = "收费页面————水量信息")
     public AjaxMessage<List<PayfeeWaterusedamount>> getWaterusedamount(
-            @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger id,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getWaterusedamount(id,year));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger id,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getWaterusedamount(id, year));
     }
 
     @GetMapping("/getPayinvoiceInfo")
-    @ApiOperation(value="收费页面————收据信息")
+    @ApiOperation(value = "收费页面————收据信息")
     public AjaxMessage<List<PayInvoiceDto>> getPayinvoiceInfo(
-            @ApiParam(value = "客户id" ,required = true) @RequestParam(required = true)BigInteger id,
-            @ApiParam(value = "账期年",required = true) @RequestParam(required = true)Integer year
-    ){
-        return new AjaxMessage<>(ResultStatus.OK,payFeeService.getPayinvoiceInfo(id,year));
+            @ApiParam(value = "客户id", required = true) @RequestParam(required = true) BigInteger id,
+            @ApiParam(value = "账期年", required = true) @RequestParam(required = true) Integer year
+    ) {
+        return new AjaxMessage<>(ResultStatus.OK, payFeeService.getPayinvoiceInfo(id, year));
     }
 }
 

+ 3 - 3
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/archives/PayBaseCustomerandmeterrelaController.java

@@ -149,12 +149,12 @@ public class PayBaseCustomerandmeterrelaController {
     @PostMapping("/edit")
     @ApiOperation(value = "计费系统-编辑开户信息")
     public AjaxMessage update(@ApiParam(value = "编辑开户信息",required = true) @RequestBody(required = true) @Validated PaySaveCustomerDto paySaveCustomerDto){
-        int result = 0;
+        String result = "";
         result = payBaseCustomerandmeterrelaService.edit(paySaveCustomerDto);
-        if(result == 1){
+        if(result.equals("修改成功")){
             return new AjaxMessage<>(ResultStatus.OK, result);
         }else{
-            return new AjaxMessage(ResultStatus.ERROR);
+            return new AjaxMessage(ResultStatus.ERROR,result);
         }
 
     }

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/AmountWaterUsedAmountMapper.java

@@ -75,4 +75,6 @@ public interface AmountWaterUsedAmountMapper {
     @MapKey("deviceId")
     HashMap<BigInteger, ReplaceMeterCountDto> getRepalceRecordCount(@Param("stTime")LocalDateTime stTime, @Param("etTime")LocalDateTime etTime, @Param("list")List<BigInteger> list,@Param("siteId")Integer siteId,@Param("customerId")Integer customerId);
 
+    Integer getwaterUserdAmount(@Param("year")Integer year,@Param("month")Integer month,@Param("siteId")Integer siteId,
+         @Param("customerId")Integer customerId, @Param("id")BigInteger id);
 }

+ 9 - 2
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/BaseWaterPropertyFormDto.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Date;
@@ -32,12 +33,18 @@ public class BaseWaterPropertyFormDto  {
     private Integer laddertype;
     @ApiModelProperty(value = "用水价格数组1",example="[\"id1,price1,Ladderlimit1\",\"id2,price2,Ladderlimit2\"]" ,position = 1)
     private String[] prop1;
+    @ApiModelProperty(value = "一阶用水合计','", position = 1)
+    private BigDecimal sumPrice1;
     @ApiModelProperty(value = "用水价格数组2','",example="[1,1,100]", position = 1)
     private String[] prop2;
+    @ApiModelProperty(value = "二阶用水合计','", position = 1)
+    private BigDecimal sumPrice2;
     @ApiModelProperty(value = "用水价格数组3','", position = 1)
     private String[] prop3;
+    @ApiModelProperty(value = "三阶用水合计','", position = 1)
+    private BigDecimal sumPrice3;
     @ApiModelProperty(value = "用水价格数组4','", position = 1)
     private String[] prop4;
-
-
+    @ApiModelProperty(value = "四阶用水合计','", position = 1)
+    private BigDecimal sumPrice4;
 }

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeAccountInfoDto.java

@@ -52,6 +52,8 @@ public class PayfeeAccountInfoDto {
     private BigInteger waterPropertyId;
     @ApiModelProperty(value = "用水性质名称" )
     private String waterPropertyName;
+    @ApiModelProperty(value = "水表电子号" )
+    private String metereleno;
 
 
 }

+ 11 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PayfeeDetaileBill.java

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * @description 缴费界面账单详情
  * @auto wangli
@@ -32,4 +34,13 @@ public class PayfeeDetaileBill {
     private String[] prop3;
     @ApiModelProperty(value = "用水价格数组4','", position = 1)
     private String[] prop4;
+
+    @ApiModelProperty(value = "一阶单价合计','", position = 1)
+    private BigDecimal sumPrice1;
+    @ApiModelProperty(value = "二阶单价合计','", position = 1)
+    private BigDecimal sumPrice2;
+    @ApiModelProperty(value = "三阶单价合计','", position = 1)
+    private BigDecimal sumPrice3;
+    @ApiModelProperty(value = "四阶单价合计','", position = 1)
+    private BigDecimal sumPrice4;
 }

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/AmountWaterUsedAmount.java

@@ -115,8 +115,8 @@ public class AmountWaterUsedAmount {
     private BigInteger siteId;
     @ApiModelProperty(value = "水司ID", hidden = true)
     private BigInteger customerId;
-
-
+    @ApiModelProperty(value = "水表电子号")
+    private String metereleno;
 
 
 }

+ 2 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayBaseCustomerandmeterrela.java

@@ -99,5 +99,7 @@ public class PayBaseCustomerandmeterrela {
     public String condition;//组合查询
     @ApiModelProperty(value = "权限项",  hidden = true)
     private List<ProgramItem> programItems;
+    @ApiModelProperty(value = "水表电子号", position = 33)
+    public String metereleno;
 
 }

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/BaseWaterPropertyServiceImpl.java

@@ -221,6 +221,10 @@ public class BaseWaterPropertyServiceImpl implements BaseWaterPropertyService {
         baseWaterPropertyFormDto.setCategoryId(baseWaterProperty.getCategoryId());
         baseWaterPropertyFormDto.setEffectivedate(baseWaterProperty.getEffectivedate());
 
+        baseWaterPropertyFormDto.setSumPrice1(baseWaterProperty.getTotalpriceL1());
+        baseWaterPropertyFormDto.setSumPrice2(baseWaterProperty.getTotalpriceL2());
+        baseWaterPropertyFormDto.setSumPrice3(baseWaterProperty.getTotalpriceL3());
+        baseWaterPropertyFormDto.setSumPrice4(baseWaterProperty.getTotalpriceL4());
         for (int i = 1; i <5; i++) {
             List<PayBaseWaterprice>  waterprices =   baseWaterPropertyMapper.getFeeInfo(id,i,loginUser.getCustomerId(),loginUser.getSiteId());
             if(waterprices!=null&&waterprices.size()>0){

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/PayBaseCustomerandmeterrelaService.java

@@ -52,7 +52,7 @@ public interface PayBaseCustomerandmeterrelaService {
     public  Pagination<PayCustomerDto>getAll (String condition, BigInteger waterPropertyId, Integer businessstate, Integer calculateway, String sortColumn, String sortOrder, int pageNum, int pageSize);
 
 
-    int edit (PaySaveCustomerDto paySaveCustomerDto);
+    String edit (PaySaveCustomerDto paySaveCustomerDto);
 
     //public List<CustomerListInfo> selectAccountnumberList(String accountnumber);
     public Pagination<CustomerListInfo> selectAccountnumberList(String accountnumber,int pageNum, int pageSize);

+ 47 - 15
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/archives/impl/PayBaseCustomerandmeterrelaServiceImpl.java

@@ -85,6 +85,11 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
     @Resource
     private OrganizationMapper organizationMapper;
 
+    @Resource
+    private AmountWaterUsedAmountMapper amountWaterUsedAmountMapper;
+    @Resource
+    private BaseClosingAccountInfoMapper baseClosingAccountInfoMapper;
+
     @Value("${files.path}")
     private String filesPath;
 
@@ -668,7 +673,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public int edit (PaySaveCustomerDto payBaseCustomerandmeterrela){
+    public String edit (PaySaveCustomerDto payBaseCustomerandmeterrela){
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         //根据客户编码寻找客户id
@@ -678,6 +683,29 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         if(accounts != null){
             //修改客户信息
             PayBaseAccount saveAccount  = payBaseAccountMapper.get(accounts.getId());
+            PayBaseCustomerandmeterrela cus = new PayBaseCustomerandmeterrela();
+            cus.setId(payBaseCustomerandmeterrela.getId());
+            cus.setSiteId(BigInteger.valueOf(loginUser.getSiteId()));
+            cus.setCustomerId(BigInteger.valueOf(loginUser.getCustomerId()));
+            List<PayBaseCustomerandmeterrela> cusList = payBaseCustomerandmeterrelaMapper.findList(cus);
+            if(cusList == null && cusList.size() ==0){
+                return "修改失败,开户信息有误。";
+            }
+            BigInteger newWaterPropertyId = payBaseCustomerandmeterrela.getWaterPropertyId();
+            if(newWaterPropertyId == null){
+                return "修改失败,用水性质不能为空。";
+            }
+            BigInteger oldWaterPropertyId = cusList.get(0).getWaterPropertyId();
+
+            if(!oldWaterPropertyId.equals(newWaterPropertyId)){
+                //如果有更换用水性质则需要先判断本账期是否审核水量
+                //根据客户查找是否有本账期未审核的水量信息
+                BaseClosingAccountInfoDto baseClosingAccountInfoDto= baseClosingAccountInfoMapper.getLastClosingAccount(loginUser.getSiteId(),loginUser.getCustomerId());
+                Integer state = amountWaterUsedAmountMapper.getwaterUserdAmount(baseClosingAccountInfoDto.getYear(),baseClosingAccountInfoDto.getMonth(),loginUser.getSiteId(),loginUser.getCurrentSiteId(),saveAccount.getId());
+                if(state != null && state == 1){
+                    return "修改失败,本账期有未审核的水量。";
+                }
+            }
             saveAccount.setName(payBaseCustomerandmeterrela.getAccountname());
             saveAccount.setIdtype(payBaseCustomerandmeterrela.getIdtype());
             saveAccount.setIdcardno(payBaseCustomerandmeterrela.getIdcardno());
@@ -689,6 +717,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             saveAccount.setUpdateBy(new BigInteger(String.valueOf(loginUser.getId())));
             saveAccount.setUpdateDate(LocalDateTime.now());
             saveAccount.setEmail(payBaseCustomerandmeterrela.getEmail()); //邮箱
+            saveAccount.setWaterpropertyId(newWaterPropertyId);
             payBaseAccountService.edit(saveAccount);
 
             //修改预存账户名称
@@ -719,12 +748,13 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             customer.setUpdateDate(LocalDateTime.now());
             customer.setId(payBaseCustomerandmeterrela.getId());
             customer.setVatno(payBaseCustomerandmeterrela.getVatno());
+            customer.setWaterPropertyId(newWaterPropertyId);
             payBaseCustomerandmeterrelaMapper.update(customer);
 
             //编辑开户修改其它地方客户名称
             this.updateAccountnameInfo(payBaseCustomerandmeterrela.getAccountname(),accounts.getId());
 
-            return 1;
+            return "修改成功";
         }else{
             throw new ServiceException(-900, "客户信息有误");
         }
@@ -1134,7 +1164,7 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
         LoginUser loginUser = UserUtil.getCurrentUser();
         String title = "开户信息列表";
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        String[] rowsName = new String[]{"序号","客户编号","客户名称","手机号","水表档案号","用水性质","安装地址","开户时间","状态","结算方式"};
+        String[] rowsName = new String[]{"序号","客户编号","客户名称","手机号","水表电子号","水表档案号","用水性质","结算方式","安装地址","开户时间","状态"};
         List<PayBaseCustomerandmeterrela> customerList = payBaseCustomerandmeterrelaMapper.getList(condition,waterPropertyId,businessstate,calculateway,loginUser.getSiteId(),loginUser.getCustomerId());
         List<Object[]> dataList = newArrayList();
         Object[] objs = null;
@@ -1142,21 +1172,23 @@ public class PayBaseCustomerandmeterrelaServiceImpl implements PayBaseCustomeran
             PayBaseCustomerandmeterrela customer = customerList.get(i);
             objs = new Object[rowsName.length];
             objs[0] = i;
-            objs[1] = customer.getAccountnumber() != null ? customer.getAccountnumber() : "";
-            objs[2] = customer.getAccountname() != null ? customer.getAccountname() : "";
-            objs[3] = customer.getTelephone() != null ? customer.getTelephone() : "";
-            objs[4] = customer.getMetercode() != null ? customer.getMetercode() : "";
-            objs[5] = customer.getPropertyName() != null ? customer.getPropertyName() : "";
-            objs[6] = customer.getAddress() != null ? customer.getAddress() : "";
-            objs[7] = customer.getOpendate() != null ? df.format(customer.getOpendate()) : "";
-            Integer customerState = customer.getBusinessstate() != null ? customer.getBusinessstate() : 10;
-            String businessName = paySysDictService.getDiceLabel(customerState,"开户状态",new BigInteger(String.valueOf(loginUser.getSiteId())),
-                new BigInteger(String.valueOf(loginUser.getCustomerId())));
-            objs[8] = businessName;
+            objs[1] = customer.getAccountnumber() != null ? customer.getAccountnumber() : "";//客户编号
+            objs[2] = customer.getAccountname() != null ? customer.getAccountname() : "";//客户名称
+            objs[3] = customer.getTelephone() != null ? customer.getTelephone() : "";//手机号
+            objs[4] = customer.getMetereleno() != null ? customer.getMetereleno() :"";//水表电子号
+            objs[5] = customer.getMetercode() != null ? customer.getMetercode() : "";//水表档案号
+            objs[6] = customer.getPropertyName() != null ? customer.getPropertyName() : "";//用水性质
             Integer calcuState = customer.getCalculateway() != null ? customer.getCalculateway() : 10;
             String calcuName = paySysDictService.getDiceLabel(calcuState,"结算方式",new BigInteger(String.valueOf(loginUser.getSiteId())),
+                    new BigInteger(String.valueOf(loginUser.getCustomerId())));
+            objs[7] = calcuName;//结算方式
+            objs[8] = customer.getAddress() != null ? customer.getAddress() : "";//安装地址
+            objs[9] = customer.getOpendate() != null ? df.format(customer.getOpendate()) : "";//开户时间
+            Integer customerState = customer.getBusinessstate() != null ? customer.getBusinessstate() : 10;
+            String businessName = paySysDictService.getDiceLabel(customerState,"开户状态",new BigInteger(String.valueOf(loginUser.getSiteId())),
                 new BigInteger(String.valueOf(loginUser.getCustomerId())));
-            objs[9] = calcuName;
+            objs[10] = businessName;//开户状态
+
             dataList.add(objs);
         }
         ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);

+ 18 - 15
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -35,7 +35,8 @@
         account.address as "address",
         customer.opendate as "opendate",
         customer.businessstate as "businessstate",
-        customer.calculateway as "calculateway"
+        customer.calculateway as "calculateway",
+        pro.id as "waterPropertyId"
         from pay_base_customerandmeterrela customer
         left join pay_base_account account on customer.account_id = account.id
         left join pay_base_waterproperty pro on pro.id = customer.waterproperty_id
@@ -306,15 +307,16 @@
 
     <select id="getList" resultType="com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela">
         select
-        account.accountnumber as "accountnumber",
-        account.name as "accountname",
-        account.telephone as "telephone",
-        customer.metercode as "metercode",
-        property.name as "propertyName",
-        device.loc_desc as "address",
-        customer.opendate as "opendate",
-        customer.businessstate as "businessstate",
-        customer.calculateway as "calculateway"
+            account.accountnumber as "accountnumber",
+            account.name as "accountname",
+            account.telephone as "telephone",
+            customer.metercode as "metercode",
+            property.name as "propertyName",
+            device.loc_desc as "address",
+            customer.opendate as "opendate",
+            customer.businessstate as "businessstate",
+            customer.calculateway as "calculateway",
+            device.water_meter_no as "metereleno"
         from pay_base_customerandmeterrela customer
         left join pay_base_account account on account.id = customer.account_id
         left join pay_base_waterproperty property on property.id = customer.waterproperty_id
@@ -329,11 +331,12 @@
             <if test="condition != null">
                 and
                 (
-                account.accountnumber like concat('%',#{condition},'%')
-                or account.name like concat('%',#{condition},'%')
-                or customer.metercode like  concat('%',#{condition},'%')
-                or account.address  like concat('%',#{condition},'%')
-                or account.telephone like concat('%',#{condition},'%')
+                    account.accountnumber like concat('%',#{condition},'%')
+                    or account.name like concat('%',#{condition},'%')
+                    or customer.metercode like  concat('%',#{condition},'%')
+                    or account.address  like concat('%',#{condition},'%')
+                    or account.telephone like concat('%',#{condition},'%')
+                    or device.water_meter_no like concat('%',#{condition},'%')
                 )
             </if>
             <if test="waterPropertyId != null">

+ 14 - 4
smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml

@@ -38,7 +38,8 @@
 		a.site_id as "siteId",
 		a.customer_id as "customerId",
 		c.label as stateName,
-		CONCAT(a.`year`,'年',LPAD(a.month, 2, 0),'月') as closingName
+		CONCAT(a.`year`,'年',LPAD(a.month, 2, 0),'月') as closingName,
+		d.water_meter_no as "metereleno"
 	</sql>
 
     <sql id="amountWaterusedamountJoins">
@@ -68,13 +69,16 @@
 
 			<choose>
 				<when test="condition != null and condition !=''">
-					and (a.accountname like concat('%',#{condition} ,'%') or a.accountnumber like concat('%',#{condition} ,'%') or a.metercode like concat('%',#{condition} ,'%') or a.address like concat('%',#{condition} ,'%'))
+					and
+					(
+						a.accountnumber like concat('%',#{condition} ,'%')
+						or a.metercode like concat('%',#{condition} ,'%')
+						or d.water_meter_no like concat('%',#{condition} ,'%')
+					)
 				</when>
 				<otherwise>
-					<if test="accountname!= null and accountname !=''" > and a.accountname = #{accountname} </if>
 					<if test="accountnumber!= null and accountnumber !=''" > and a.accountnumber = #{accountnumber} </if>
 					<if test="metercode!= null and metercode !=''" > and a.metercode = #{metercode} </if>
-					<if test="address!= null and address !=''" > and a.address = #{address} </if>
 
 				</otherwise>
 			</choose>
@@ -567,4 +571,10 @@
 		</where>
 
 	</select>
+
+	<select id="getwaterUserdAmount" resultType="java.lang.Integer">
+		select
+			amount.state from pay_amount_waterusedamount amount
+		where amount.account_id =#{id} and amount.year =#{year} and amount.month =#{month}
+	</select>
 </mapper>

+ 4 - 2
smart-city-platform/src/main/resources/mapper/pay/payFeeMapper.xml

@@ -110,12 +110,13 @@
             and customer_id=#{customerId}) as "housetype",
             (select label from pay_sys_dict where type='结算方式' and `value`=c.calculateway and  site_id=#{siteId}
             and customer_id=#{customerId}) as "calculateway",
-
             p.id as "waterPropertyId",
-            p.name as "waterPropertyName"
+            p.name as "waterPropertyName",
+            device.water_meter_no as "metereleno"
         from pay_base_customerandmeterrela c
         left join pay_base_account a on c.account_id=a.id
         left join pay_base_waterproperty p on c.waterProperty_id=p.id
+        inner join sc_device device on device.metercode = c.metercode
         <where>
             c.businessstate=1 and c.site_id=#{siteId} and c.customer_id=#{customerId}
             <if test="id != null and id != ''">
@@ -126,6 +127,7 @@
                     or c.accountnumber like concat('%',#{condition},'%')
                     or a.mobilephone like concat('%',#{condition},'%')
                     or a.address like concat('%',#{condition},'%')
+                    or device.water_meter_no like concat('%',#{condition},'%')
                     )
             </if>
             <if test="programItems != null and programItems.size() != 0">