Browse Source

调整换表模块字段名调整换表模块字段名

sxb 10 months ago
parent
commit
2bff9f6620

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

@@ -113,7 +113,6 @@ public class YhBtLogController {
       return ResultRespone.success(yhBtLogService.getById(bh));
     }
 
-    @ToFlyAppLog(title = "新增用户报停记录")
     @ApiOperation(value = "新增用户报停记录")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "yzqf", value = "是否验证欠费(1:需验证;0:不验证)", required = false, dataType = "String")
@@ -121,15 +120,12 @@ public class YhBtLogController {
     @PostMapping
     @Transactional(rollbackFor = Exception.class) //声明式事务管理
     public ResultRespone save(@RequestBody YhBtLog daBtLog, @RequestParam(required = false) String yzqf) {
-        ResultRespone<Object> rest = new ResultRespone<>();
         if (StringUtils.isNotBlank(daBtLog.getYhbh())) {
             if (yzqf.equals("1")) {
                 //判断用户是否存在欠费
                int count= yyQfmxMapper.selectExistQf(daBtLog.getYhbh());
                 if (count > 0) {
-                    rest.setCode(-1);
-                    rest.setMessage("操作失败,用户存在欠费:" + count + "笔");
-                    return rest;
+                    return ResultRespone.failed(false, "操作失败,用户存在欠费:" + count + "笔");
                 }
             }
            // int bh= yhBtLogMapper.selectMaxId()+1;
@@ -144,21 +140,16 @@ public class YhBtLogController {
                 yhKhjbxx.setSscbb(String.valueOf(yhKhjbxx2.getSscbb()));
                 yhKhjbxx.setSscbpq(String.valueOf(yhKhjbxx2.getSscbpq()));
                 if (yhKhjbxxService.updateById(yhKhjbxx)) {
-                    rest.setCode(1);
-                    rest.setMessage("操作成功");
+                    return ResultRespone.success(true, "操作成功");
                 } else {
-                    rest.setCode(-1);
-                    rest.setMessage("操作失败");
+                    return ResultRespone.failed(false, "操作失败");
                 }
             } else {
-                rest.setCode(-1);
-                rest.setMessage("操作失败");
+                return ResultRespone.failed(false, "操作失败");
             }
         } else {
-            rest.setCode(-1);
-            rest.setMessage("操作失败,用户编号不存在");
+            return ResultRespone.failed(false, "操作失败,用户编号不存在");
         }
-        return rest;
     }
 
 
@@ -169,7 +160,6 @@ public class YhBtLogController {
      * @param yhBtLog 用户报停记录
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="修改用户报停记录" )
     @ApiOperation(value = "修改用户报停记录")
     @PutMapping
     public ResultRespone updateById(@RequestBody YhBtLog yhBtLog) {
@@ -181,7 +171,6 @@ public class YhBtLogController {
      * @param bh id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id删除用户报停记录" )
     @ApiOperation(value = "通过ID删除用户报停记录")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "bh", value = "ID", required = true, dataType = "String")
@@ -196,7 +185,6 @@ public class YhBtLogController {
      * @param ids id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id批量删除用户报停记录" )
     @ApiOperation(value = "通过ID批量删除用户报停记录")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "批量删除,多个id以逗号隔开", required = true, dataType = "String")

+ 0 - 4
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhFfgxController.java

@@ -65,7 +65,6 @@ public class YhFfgxController {
      * @param yhFfgx 付费关系
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="新增付费关系" )
     @ApiOperation(value = "新增付费关系")
     @PostMapping
     public ResultRespone save(@RequestBody YhFfgx yhFfgx) {
@@ -77,7 +76,6 @@ public class YhFfgxController {
      * @param yhFfgx 付费关系
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="修改付费关系" )
     @ApiOperation(value = "修改付费关系")
     @PutMapping
     public ResultRespone updateById(@RequestBody YhFfgx yhFfgx) {
@@ -89,7 +87,6 @@ public class YhFfgxController {
      * @param id id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id删除付费关系" )
     @ApiOperation(value = "通过ID删除付费关系")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String")
@@ -104,7 +101,6 @@ public class YhFfgxController {
      * @param ids id
      * @return ResultRespone
      */
-    @ToFlyAppLog(title="通过id批量删除付费关系" )
     @ApiOperation(value = "通过ID批量删除付费关系")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "批量删除,多个id以逗号隔开", required = true, dataType = "String")

+ 5 - 14
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/yhgl/controller/YhGhLogController.java

@@ -59,7 +59,6 @@ public class YhGhLogController {
     /**
     * 分页查询
     * @param page 分页对象
-    * @param YhGhLog 用户过户日志
     * @return
     */
     @GetMapping("/page")
@@ -105,7 +104,6 @@ public class YhGhLogController {
      * @param yhGhLog 用户过户日志
      * @return ResultRespone
      */
-    @ToFlyAppLog(title = "新增用户过户日志")
     @ApiOperation(value = "新增用户过户日志")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "yzqf", value = "是否验证欠费(1:需验证;0:不验证)", required = false, dataType = "String")
@@ -119,9 +117,7 @@ public class YhGhLogController {
                 //判断用户是否存在欠费
               int count = yyQfmxMapper.selectExistQf(yhGhLog.getYhbh());
                 if (count > 0) {
-                    rest.setCode(-1);
-                    rest.setMessage("操作失败,用户存在欠费:" + count + "笔");
-                    return rest;
+                    return  ResultRespone.failed(false,"操作失败,用户存在欠费:" + count + "笔");
                 }
             }
 
@@ -148,22 +144,17 @@ public class YhGhLogController {
                 }
 
                 if (yhKhjbxxService.updateById(yhKhjbxx)) {
-                    rest.setCode(1);
-                    rest.setMessage("操作成功");
+                    return  ResultRespone.success(true,"操作成功");
                 } else {
-                    rest.setCode(-1);
-                    rest.setMessage("操作失败");
+                    return  ResultRespone.failed(false,"操作失败");
                 }
             } else {
-                rest.setCode(-1);
-                rest.setMessage("操作失败");
+                return  ResultRespone.failed(false,"操作失败");
             }
 
         } else {
-            rest.setCode(-1);
-            rest.setMessage("操作失败,用户编号不能为空");
+            return  ResultRespone.failed(false,"操作失败,用户编号不能为空");
         }
-        return rest;
     }
 
 

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

@@ -202,44 +202,34 @@ public class YhKhjbxxController {
                     for (YhkhjbxxExcel user : userList) {
                         //数据校验
                         if (StringUtils.isEmpty(user.getYhbh())) {
-                            rest.setCode(-1);
-                            rest.setMessage("用户编号不能为空");
+                            return ResultRespone.failed(false, "用户编号不能为空");
                         }
                         if (StringUtils.isEmpty(user.getYhxm())) {
-                            rest.setCode(-1);
-                            rest.setMessage("用户名不能为空");
+                            return ResultRespone.failed(false, "用户名不能为空");
                         }
                         if (StringUtils.isEmpty(user.getYhdz())) {
-                            rest.setCode(-1);
-                            rest.setMessage("用户地址不能为空");
+                            return ResultRespone.failed(false, "用户地址不能为空");
                         }
                         if (StringUtils.isEmpty(user.getLxdh())) {
-                            rest.setCode(-1);
-                            rest.setMessage("用户电话不能为空");
+                            return ResultRespone.failed(false, "用户电话不能为空");
                         }
                         if (StringUtils.isEmpty(user.getZjhm())) {
-                            rest.setCode(-1);
-                            rest.setMessage("证件号码不能为空");
+                            return ResultRespone.failed(false, "证件号码不能为空");
                         }
                         if (StringUtils.isEmpty(user.getSbbh())) {
-                            rest.setCode(-1);
-                            rest.setMessage("表号不能为空");
+                            return ResultRespone.failed(false, "表号不能为空");
                         }
                         if (StringUtils.isEmpty(user.getSbkj())) {
-                            rest.setCode(-1);
-                            rest.setMessage("口径不能为空");
+                            return ResultRespone.failed(false, "口径不能为空");
                         }
                         if (StringUtils.isEmpty(user.getSbqs())) {
-                            rest.setCode(-1);
-                            rest.setMessage("表起度不能为空");
+                            return ResultRespone.failed(false, "表起度不能为空");
                         }
                         if (StringUtils.isEmpty(user.getSqrq())) {
-                            rest.setCode(-1);
-                            rest.setMessage("申请日期不能为空");
+                            return ResultRespone.failed(false, "申请日期不能为空");
                         }
                         if (StringUtils.isEmpty(user.getSbccrq())) {
-                            rest.setCode(-1);
-                            rest.setMessage("水表出厂日期不能为空");
+                            return ResultRespone.failed(false, "水表出厂日期不能为空");
                         }
                         SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd");
                         Date currentDate = new Date();
@@ -345,7 +335,6 @@ public class YhKhjbxxController {
                                     bwMeterReadPlan.setYhbh(String.valueOf(user.getYhbh()));//用户编号
                                     bwMeterReadPlan.setCbkh("1");//抄表卡号
                                     bwMeterReadPlan.setCbkid(user.getYhbh() + "1");//抄表卡ID
-
                                     Map<String, Object> mapcwrq = yhKhjbxxMapper.selectCwrq();//获取财务日期
                                     String strcwrq = mapcwrq.get("cwrq").toString();//202305
                                     bwMeterReadPlan.setCwrq(strcwrq);//财务日期
@@ -360,52 +349,6 @@ public class YhKhjbxxController {
                                     //同步智能表档案
                                     if (sblb.equals("2") || sblb.equals("3")) {
                                         znbYhdaService.savaZnbYhda(daCustomer, daMeter,  czyUserDetails);
-//                                        ZnbYhda znbYhda = new ZnbYhda();
-//
-//                                        znbYhda.setYhbh(user.getYhbh());//用户编号
-//                                        znbYhda.setYhxm(user.getYhxm());//用户姓名
-//                                        znbYhda.setYhdz(user.getYhdz());//用户地址
-//                                        znbYhda.setLxdh(user.getLxdh());//联系电话
-//                                        znbYhda.setSsgs(ssgs);//所属公司
-//                                        znbYhda.setSspq(sscbpq);//片区
-//                                        znbYhda.setSscbb(sscbb);//抄表本
-//
-//                                        znbYhda.setJgbm(sjbm);//价格编码
-//                                        znbYhda.setBjcj(sbsccj);//厂家
-//                                        znbYhda.setBjbh(user.getSbbh());//表具编号
-//                                        znbYhda.setBjxh(sbxh);//表具型号
-//                                        znbYhda.setBjlb(sblb);//水表类型
-//                                        znbYhda.setBjwz(bjwz);//位置
-//                                        znbYhda.setBjkj(user.getSbkj());//口径
-//                                        znbYhda.setBjlc(sblc);//表具量程
-//                                        znbYhda.setCbpl(cbpl);//抄表频率
-//                                        znbYhda.setBjqd(BigDecimal.valueOf(Long.valueOf(user.getSbqs())));//表具起度
-//                                        znbYhda.setBjzd(BigDecimal.valueOf(Long.valueOf(user.getSbqs())));//表具止度
-//                                        znbYhda.setBjbh(user.getSbbh());//水表编号
-//                                        znbYhda.setJdrq(new Date());//建档日期
-//                                        znbYhda.setJdpch(strplbh);//建档批次号
-//                                        znbYhda.setCzry(czrybm);//操作人员编码
-//                                        znbYhda.setCzrq(new Date());//操作日期
-//                                        znbYhda.setYhzt(daCustomer.getYhzt().getValue().toString());//用户状态
-//                                        znbYhda.setFmzt("1");//阀门状态0关阀1开阀
-//                                        znbYhda.setBjzt("1");//表具状态0异常1正常
-//                                        znbYhda.setJdlx("0");//建档类型(0:建档;1:变更;2:换表)
-//                                        znbYhdaService.save(znbYhda);
-//                                        //添加智能表档案日志
-//                                        ZnbZlLog znbZlLog = new ZnbZlLog();
-//                                        znbZlLog.setYhbh(user.getYhbh());
-//                                        znbZlLog.setCbkh(bwMeterReadPlan.getCbkh());
-//                                        znbZlLog.setCbkid(bwMeterReadPlan.getCbkid());
-//                                        znbZlLog.setPch(strplbh);
-//                                        znbZlLog.setSccj(sbsccj);
-//                                        znbZlLog.setSsgs(ssgs);
-//                                        znbZlLog.setCzry(czrybm);
-//                                        znbZlLog.setCzsj(LocalDateTime.now());
-//                                        znbZlLog.setClLock("0");
-//                                        znbZlLog.setClCljg("0");
-//                                        znbZlLog.setZltype("1");
-//                                        iZnbZlLogService.save(znbZlLog);
-//                                        //znbDaLogService.addznbDaLog(znbYhda);
                                     }
                                 }
                             }
@@ -427,56 +370,52 @@ public class YhKhjbxxController {
         return ResultRespone.success(rest.getCode(), rest.getMessage());
     }
 
+
     public ResultRespone<Object> checkImportExcel(String ssgs, String sscbpq, String sscbb, String sblb, String sbsccj, String sbxh, String sjbm, String wsfbz, String ljfbz, String czrybm, String czrymc) {
         ResultRespone<Object> rest = new ResultRespone<>();
         rest.setCode(1);
         rest.setMessage("操作成功");
+
         if (StringUtils.isEmpty(ssgs)) {
-            rest.setCode(-1);
-            rest.setMessage("所属公司不能为空");
+            return createErrorResponse(rest, -1, "所属公司不能为空");
         }
         if (StringUtils.isEmpty(sscbpq)) {
-            rest.setCode(-1);
-            rest.setMessage("所属片区参数不能为空");
+            return createErrorResponse(rest, -1, "所属片区参数不能为空");
         }
         if (StringUtils.isEmpty(sscbb)) {
-            rest.setCode(-1);
-            rest.setMessage("所属抄表本参数不能为空");
+            return createErrorResponse(rest, -1, "所属抄表本参数不能为空");
         }
         if (StringUtils.isEmpty(sblb)) {
-            rest.setCode(-1);
-            rest.setMessage("水表类别参数不能为空");
+            return createErrorResponse(rest, -1, "水表类别参数不能为空");
         }
         if (StringUtils.isEmpty(sbsccj)) {
-            rest.setCode(-1);
-            rest.setMessage("水表厂家参数不能为空");
+            return createErrorResponse(rest, -1, "水表厂家参数不能为空");
         }
         if (StringUtils.isEmpty(sbxh)) {
-            rest.setCode(-1);
-            rest.setMessage("水表型号参数不能为空");
+            return createErrorResponse(rest, -1, "水表型号参数不能为空");
         }
-
         if (StringUtils.isEmpty(sjbm)) {
-            rest.setCode(-1);
-            rest.setMessage("水价参数不能为空");
+            return createErrorResponse(rest, -1, "水价参数不能为空");
         }
-
         if (StringUtils.isEmpty(wsfbz)) {
-            rest.setCode(-1);
-            rest.setMessage("是否污水费参数不能为空");
+            return createErrorResponse(rest, -1, "是否污水费参数不能为空");
         }
         if (StringUtils.isEmpty(ljfbz)) {
-            rest.setCode(-1);
-            rest.setMessage("是否垃圾费参数不能为空");
+            return createErrorResponse(rest, -1, "是否垃圾费参数不能为空");
         }
         if (StringUtils.isEmpty(czrybm)) {
-            rest.setCode(-1);
-            rest.setMessage("创建人员编码参数不能为空");
+            return createErrorResponse(rest, -1, "创建人员编码参数不能为空");
         }
         if (StringUtils.isEmpty(czrymc)) {
-            rest.setCode(-1);
-            rest.setMessage("创建人员名称参数不能为空");
+            return createErrorResponse(rest, -1, "创建人员名称参数不能为空");
         }
+
+        return rest;
+    }
+
+    private ResultRespone<Object> createErrorResponse(ResultRespone<Object> rest, int code, String message) {
+        rest.setCode(code);
+        rest.setMessage(message);
         return rest;
     }