Browse Source

恢复状态

sxb 10 months ago
parent
commit
c26facc199

+ 13 - 1
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/bjgl/controller/YhCbkxxController.java

@@ -299,13 +299,25 @@ public class YhCbkxxController {
     }
 
     @ApiOperationSupport(order = 28)
-    @ApiOperation(value = "批量设置水价", tags = "批量设置水价")
+    @ApiOperation(value = "批量设置水价禁用", tags = "批量设置水价禁用")
     @PutMapping("/sj")
     public ResultRespone<Boolean> updateSj(@RequestBody YhCbkxxSjUpdate update,
                                            @ApiIgnore @AuthenticationPrincipal CzyUserDetails czyUserDetails) {
         return ResultRespone.success(yhCbkxxService.updateSj(update, czyUserDetails));
     }
 
+    @ApiOperationSupport(order = 29)
+    @ApiOperation(value = "批量设置水价", tags = "批量设置水价")
+    @PutMapping("/plsz_sj")
+    public ResultRespone<Boolean> updatePlSzSj(@RequestBody YhCbkxxSjUpdate update,
+                                           @ApiIgnore @AuthenticationPrincipal CzyUserDetails czyUserDetails) {
+        for (String yhbh : update.getYhbhs()) {
+
+
+        }
+        return ResultRespone.success(yhCbkxxService.updateSj(update, czyUserDetails));
+    }
+
     @ApiOperationSupport(order = 30)
     @ApiOperation(value = "用户换表", tags = "用户换表")
     @PutMapping("/hb")

+ 2 - 1
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/bjgl/entity/YhCbkxx.java

@@ -1,5 +1,6 @@
 package com.tofly.feesapi.bjgl.entity;
 
+import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.annotation.*;
 
 import java.io.Serializable;
@@ -167,7 +168,7 @@ public class YhCbkxx implements Serializable {
     @ApiModelProperty("操作时间")
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime czsj;
+    private Date czsj;
 
     @ApiModelProperty("最新抄表日期")
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")

+ 2 - 2
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/bjgl/service/impl/YhCbkxxServiceImpl.java

@@ -98,7 +98,7 @@ public class YhCbkxxServiceImpl extends ServiceImpl<YhCbkxxMapper, YhCbkxx> impl
         BeanUtils.copyProperties(insert.getYhCbkxx(), cbkxx);
         String czrybm = insert.getCzrybm();
         String czryxm = insert.getCzryxm();
-        LocalDateTime czsj = insert.getCzsj();
+        Date czsj = insert.getCzsj();
         cbkxx.setYhbh(yhbh);//用户编号
         cbkxx.setCzrybm(czrybm);
         cbkxx.setCzryxm(czryxm);
@@ -306,7 +306,7 @@ public class YhCbkxxServiceImpl extends ServiceImpl<YhCbkxxMapper, YhCbkxx> impl
         if (czyUserDetails != null) {
             yhCbkxx.setCzrybm(czyUserDetails.getUsername());
         }
-        yhCbkxx.setCzsj(LocalDateTime.now());
+        yhCbkxx.setCzsj(new Date());
         this.updateById(yhCbkxx);
         if (yhCbkxx.getSblb().equals("2") || yhCbkxx.getSblb().equals("3")) {
             YhKhjbxx yhKhjbxx = yhKhjbxxService.getById(yhbh);

+ 17 - 1
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhBtLogController.java

@@ -7,6 +7,10 @@ package com.tofly.feesapi.yhgl.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.tofly.feesapi.bjgl.entity.YhCbkxx;
+import com.tofly.feesapi.bjgl.service.YhCbkxxService;
+import com.tofly.feesapi.cbgl.entity.YyCblr;
+import com.tofly.feesapi.cbgl.service.YyCblrService;
 import com.tofly.feesapi.common.Excel.ExcleFileUtil;
 import com.tofly.feesapi.common.constant.YhztEnum;
 import com.tofly.common.core.entity.ResultRespone;
@@ -56,6 +60,9 @@ public class YhBtLogController {
 
     private  final YhKhjbxxService yhKhjbxxService;
     private final YhKhjbxxMapper yhKhjbxxMapper;
+    private final YhCbkxxService yhCbkxxService;
+
+    private final YyCblrService yyCblrService;
 
     private  final YyQfmxMapper yyQfmxMapper;
 
@@ -139,7 +146,16 @@ public class YhBtLogController {
                 yhKhjbxx.setSsgs(String.valueOf(yhKhjbxx2.getSsgs()));
                 yhKhjbxx.setSscbb(String.valueOf(yhKhjbxx2.getSscbb()));
                 yhKhjbxx.setSscbpq(String.valueOf(yhKhjbxx2.getSscbpq()));
-                if (yhKhjbxxService.updateById(yhKhjbxx)) {
+                //抄表卡信息
+                YhCbkxx yhCbkxx=new YhCbkxx();
+                yhCbkxx.setYhbh(daBtLog.getYhbh());
+                yhCbkxx.setJfzt("2");//1正常2停用
+                //抄表计划添加
+                YyCblr yyCblr = new YyCblr();
+                yyCblr.setJfzt("2");
+                yyCblr.setYhbh(daBtLog.getYhbh());
+
+                if (yhKhjbxxService.updateById(yhKhjbxx)&&yhCbkxxService.updateById(yhCbkxx)&&yyCblrService.updateById(yyCblr)) {
                     return ResultRespone.success(true, "操作成功");
                 } else {
                     return ResultRespone.failed(false, "操作失败");

+ 19 - 1
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhHfysLogController.java

@@ -8,6 +8,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.tofly.feesapi.bjgl.entity.YhCbkxx;
+import com.tofly.feesapi.bjgl.service.YhCbkxxService;
+import com.tofly.feesapi.cbgl.entity.YyCblr;
+import com.tofly.feesapi.cbgl.service.YyCblrService;
 import com.tofly.feesapi.common.Excel.ExcleFileUtil;
 import com.tofly.feesapi.common.constant.YhztEnum;
 import com.tofly.common.core.entity.ResultRespone;
@@ -57,6 +61,10 @@ public class YhHfysLogController {
     private final YhHfysLogMapper yhHfysLogMapper;
     private final YhKhjbxxMapper yhKhjbxxMapper;
     private final YhKhjbxxService yhKhjbxxService;
+
+    private final YhCbkxxService yhCbkxxService;
+
+    private final YyCblrService yyCblrService;
     private  final YyQfmxMapper yyQfmxMapper;
     @GetMapping("/page")
     @ApiOperation(value = "page分页查询")
@@ -126,13 +134,23 @@ public class YhHfysLogController {
             yhHfysLog.setCzrq(new Date()); //操作时间
             if (yhHfysLogService.save(yhHfysLog)) {
                 Yhkhjbxx2 yhKhjbxx2=yhKhjbxxMapper.selectYhDa(yhHfysLog.getYhbh());
+                YhCbkxx yhCbkxx=new YhCbkxx();
+                yhCbkxx.setJfzt("1");//1正常2停用
+                yhCbkxx.setYhbh(yhHfysLog.getYhbh());
+
+                //抄表录入
+                //抄表计划添加
+                YyCblr yyCblr = new YyCblr();
+                yyCblr.setJfzt("1");
+                yyCblr.setYhbh(yhHfysLog.getYhbh());
+
                 YhKhjbxx yhKhjbxx = new YhKhjbxx();
                 yhKhjbxx.setYhbh(yhHfysLog.getYhbh());//用户编号
                 yhKhjbxx.setYhzt(YhztEnum.正式用户);//用户状态
                 yhKhjbxx.setSsgs(String.valueOf(yhKhjbxx2.getSsgs()));
                 yhKhjbxx.setSscbb(String.valueOf(yhKhjbxx2.getSscbb()));
                 yhKhjbxx.setSscbpq(String.valueOf(yhKhjbxx2.getSscbpq()));
-                if (yhKhjbxxService.updateById(yhKhjbxx)) {
+                if (yhKhjbxxService.updateById(yhKhjbxx)&& yhCbkxxService.updateById(yhCbkxx)&&yyCblrService.updateById(yyCblr)) {
                     rest.setCode(1);
                     rest.setMessage("操作成功");
                 } else {

+ 92 - 29
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhKhjbxxController.java

@@ -89,27 +89,27 @@ public class YhKhjbxxController {
 
     private final IZnbZlLogService iZnbZlLogService;
 
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/yhbh")
-    @ApiOperation(value = "获取用户编号")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "cbbbm", value = "抄表本(册)编码", required = true)
-    })
-    public ResultRespone<String> getYhbh(@RequestParam String cbbbm) {
-        return ResultRespone.success(yhKhjbxxService.getYhbh(cbbbm));
-    }
+//    @ApiOperationSupport(order = 1)
+//    @GetMapping("/yhbh")
+//    @ApiOperation(value = "获取用户编号")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "cbbbm", value = "抄表本(册)编码", required = true)
+//    })
+//    public ResultRespone<String> getYhbh(@RequestParam String cbbbm) {
+//        return ResultRespone.success(yhKhjbxxService.getYhbh(cbbbm));
+//    }
 
     /**
      * 新增用户档案
      */
-    @ApiOperationSupport(order = 2)
-    @ToFlyAppLog(title = "新增")
-    @ApiOperation(value = "新增")
-    @PostMapping
-    public ResultRespone<Boolean> save(@RequestBody YhKhjbxxInsert insert,
-                                       @ApiIgnore @AuthenticationPrincipal CzyUserDetails czyUserDetails) {
-        return ResultRespone.success(yhKhjbxxService.save(insert, czyUserDetails));
-    }
+//    @ApiOperationSupport(order = 2)
+//    @ToFlyAppLog(title = "新增")
+//    @ApiOperation(value = "新增")
+//    @PostMapping
+//    public ResultRespone<Boolean> save(@RequestBody YhKhjbxxInsert insert,
+//                                       @ApiIgnore @AuthenticationPrincipal CzyUserDetails czyUserDetails) {
+//        return ResultRespone.success(yhKhjbxxService.save(insert, czyUserDetails));
+//    }
 
 
     @ApiOperationSupport(order = 3)
@@ -296,7 +296,7 @@ public class YhKhjbxxController {
                                 daMeter.setYhbh(user.getYhbh());//用户编号
                                 daMeter.setCzrybm(czrybm); //创建人员编码
                                 daMeter.setCzryxm(czrymc); //创建人员名称
-                                daMeter.setCzsj(LocalDateTime.now());//操作时间
+                                daMeter.setCzsj(new Date());//操作时间
 
                                 daMeter.setLjffs(ljffs); //垃圾费收取方式
                                 daMeter.setLjfje(new BigDecimal(ljfje));
@@ -429,7 +429,7 @@ public class YhKhjbxxController {
         BeanUtils.copyProperties(importDto.getYhCbkxx(), yhCbkxx);
         BeanUtils.copyProperties(e, yhCbkxx);
         if (insert.getCzsj() == null) {
-            insert.setCzsj(now);
+            insert.setCzsj(new Date());
         }
         return insert;
     }
@@ -634,7 +634,55 @@ public class YhKhjbxxController {
     ) throws Exception {
 
         //参数校验
-        ResultRespone<Object> rest = checkYhjbxx_cbkxx(operationType, daCustomerAndMeter);
+        ResultRespone<Object> rest = new ResultRespone<>();
+      //  ResultRespone<Object> rest = checkYhjbxx_cbkxx(operationType, daCustomerAndMeter);
+        if (StringUtils.isEmpty(operationType)) {
+           return ResultRespone.failed(false,"操作类型不能为空");
+        }
+        if (!operationType.equals("save") && !operationType.equals("saveUpdate")) {
+            return ResultRespone.failed(false,"操作类型参数不等于save或saveUpdate");
+        }
+
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhKhjbxx().getSsgs())) {
+            return ResultRespone.failed(false,"所属公司不能为空");
+        }
+
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhKhjbxx().getSscbpq())) {
+            return ResultRespone.failed(false,"片区不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhKhjbxx().getSscbb())) {
+
+            return ResultRespone.failed(false,"抄表本不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhKhjbxx().getYhxm().toString())) {
+            return ResultRespone.failed(false,"用户姓名不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhKhjbxx().getYhdz().toString())) {
+            return ResultRespone.failed(false,"用户地址不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getSbbh().toString())) {
+                return ResultRespone.failed(false,"水表编号不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getSblb().toString())) {
+            return ResultRespone.failed(false,"水表类别不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getSbsccj().toString())) {
+            return ResultRespone.failed(false,"水表厂家不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getSbxh())) {
+                return ResultRespone.failed(false,"水表型号不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getSbkj())) {
+        return ResultRespone.failed(false,"水表口径不能为空");
+           }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getCzrybm())) {
+            return ResultRespone.failed(false,"操作人员编码不能为空");
+        }
+        if (StringUtils.isEmpty(daCustomerAndMeter.getYhCbkxx().getCzryxm())) {
+            return ResultRespone.failed(false,"操作人员姓名不能为空");
+        }
+
+
         //用户档案基础信息添加
         YhKhjbxx yhKhjbxx = daCustomerAndMeter.getYhKhjbxx();
         //水表档案基础信息添加
@@ -642,11 +690,21 @@ public class YhKhjbxxController {
         String inputDate = "1999-01-01 00:00:00";
         SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Date date = inputFormat.parse(inputDate);
-        if (yhKhjbxx.getTsbz().equals("0")) {
+        if (yhKhjbxx.getTsbz().equals("0")||StringUtils.isEmpty(yhKhjbxx.getTsbz())) {
             yhKhjbxx.setTsrq(date);
+            yhKhjbxx.setTsbz("0");
         }
-        if (yhKhjbxx.getHtqd().equals("0")) {
+        if (yhKhjbxx.getHtqd().equals("0")||StringUtils.isEmpty(yhKhjbxx.getHtqd())) {
             yhKhjbxx.setHtqdrq(date);
+            yhKhjbxx.setHtqd("0");
+        }
+        if (StringUtils.isEmpty(yhKhjbxx.getZjlb())) {
+            yhKhjbxx.setZjlb("1");
+            yhKhjbxx.setZjhm("0");
+        }
+        if(StringUtils.isEmpty(yhKhjbxx.getFffs()))
+        {
+            yhKhjbxx.setFffs("1");
         }
         //抄表计划添加
         YyCblr yyCblr = new YyCblr();
@@ -676,22 +734,26 @@ public class YhKhjbxxController {
             yyCblr.setJfzt("2");//正常状态(1正常,2停用)
         }
 
-
-        if (rest.getCode() != -1) {
             if (operationType.equals("save")) {
                 //获取用户编号
                 int maxyhbh = yhKhjbxxMapper.selectMaxYhbh() + 1;
                 //用户档案
                 yhKhjbxx.setYhbh(String.valueOf(maxyhbh)); //用户编号
                 yhKhjbxx.setYkhbh(String.valueOf(maxyhbh));//旧用户编号
+                yhKhjbxx.setJdrybm(daCustomerAndMeter.getYhKhjbxx().getCzrybm());
+                yhKhjbxx.setJdryxm(daCustomerAndMeter.getYhKhjbxx().getCzryxm());
 
-
+                yhKhjbxx.setJdrq(new Date());//建档日期
+                yhKhjbxx.setCzsj(new Date());//操作时间
                 //水表档案
                 yhCbkxx.setYhbh(String.valueOf(maxyhbh));//用户编号
                 yhCbkxx.setCbkh("1");//抄表卡号
                 String strcbkh = String.valueOf(maxyhbh) + 1;
                 yhCbkxx.setCbkid(strcbkh);//抄表卡ID
-
+                yhCbkxx.setFmzt(FmztEnum.开阀);
+                yhCbkxx.setCzryxm(daCustomerAndMeter.getYhCbkxx().getCzryxm());
+                yhCbkxx.setCzrybm(daCustomerAndMeter.getYhCbkxx().getCzrybm());
+                yhCbkxx.setCzsj(new Date());//操作时间
                 //抄表计划
                 yyCblr.setYhbh(String.valueOf(maxyhbh));//用户编号
                 yyCblr.setCbkh("1");//抄表卡号
@@ -751,8 +813,6 @@ public class YhKhjbxxController {
                 yhCbkxx.setIckid(daCustomerAndMeter.getYhCbkxx().getIckid());//iCKID
                 yhCbkxx.setYhbh(daCustomerAndMeter.getYhCbkxx().getYhbh());
                 yyCblr.setCbkid(daCustomerAndMeter.getYhCbkxx().getCbkid());
-
-
                 //用户档案修改执行成功
                 if (yhKhjbxxService.updateById(yhKhjbxx)) {
                     //用户水表档案执行功
@@ -775,9 +835,10 @@ public class YhKhjbxxController {
                     }
                 }
             }
-        }
+
         rest = addDaCustomerAndMeterLog(daCustomerAndMeter, operationType);//操作日志添加
         return rest;
+
     }
 
     private ResultRespone<Object> checkYhjbxx_cbkxx(@RequestParam String operationType, DaCustomerAndMeter daCustomerAndMeter) {
@@ -832,11 +893,13 @@ public class YhKhjbxxController {
                 rest.setCode(-1);
                 rest.setMessage("水表口径不能为空");
             }
+
         }
 
         return rest;
     }
 
+
     /**
      * 用户档案水表档案日志添加
      */

+ 2 - 1
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/entity/dto/YhKhjbxxInsert.java

@@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Date;
 
 
 /**
@@ -106,7 +107,7 @@ public class YhKhjbxxInsert {
     @ApiModelProperty(value = "操作时间(yyyy-MM-dd HH:mm:ss)", position = 32, example = "2024-02-06 13:37:13")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime czsj;
+    private Date czsj;
 
     @Data
     @ApiModel("水表档案添加DTO")