|
@@ -1,5 +1,6 @@
|
|
|
package com.tofly.feesapi.bjgl.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -23,6 +24,8 @@ import com.tofly.feesapi.common.entity.vo.PageResult;
|
|
|
import com.tofly.feesapi.common.util.SysConfigUtils;
|
|
|
import com.tofly.feesapi.security.model.CzyUserDetails;
|
|
|
import com.tofly.feesapi.yhgl.entity.YhKhjbxx;
|
|
|
+import com.tofly.feesapi.yhgl.entity.YhhLog;
|
|
|
+import com.tofly.feesapi.yhgl.mapper.YhKhjbxxMapper;
|
|
|
import com.tofly.feesapi.yhgl.service.YhKhjbxxService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -38,6 +41,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
@@ -50,6 +54,8 @@ public class YhCbkxxController {
|
|
|
|
|
|
private final YhKhjbxxService yhKhjbxxService;
|
|
|
|
|
|
+ private final YhKhjbxxMapper yhKhjbxxMapper;
|
|
|
+
|
|
|
private final YyCblrService yyCblrService;
|
|
|
|
|
|
|
|
@@ -133,6 +139,11 @@ public class YhCbkxxController {
|
|
|
|
|
|
YhKhjbxx yhKhjbxx = yhKhjbxxService.getById(yhCbkxx.getYhbh());
|
|
|
|
|
|
+ int count=yhKhjbxxMapper.selectExistCbkxx(yhCbkxx.getYhbh());
|
|
|
+ if(count>0){
|
|
|
+ return ResultRespone.failed("禁止添加多只水表");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
YyCblr yyCblr = new YyCblr();
|
|
@@ -142,8 +153,11 @@ public class YhCbkxxController {
|
|
|
yyCblr.setCbkid(yhCbkxx.getCbkid());
|
|
|
|
|
|
|
|
|
- String strYearMonth = SysConfigUtils.getBillYearMonth("1");
|
|
|
- yyCblr.setCwrq(strYearMonth);
|
|
|
+ Map<String, Object> mapcwrq = yhKhjbxxMapper.selectCwrq();
|
|
|
+ String strcwrq = mapcwrq.get("cwrq").toString();
|
|
|
+
|
|
|
+
|
|
|
+ yyCblr.setCwrq(strcwrq);
|
|
|
|
|
|
yyCblr.setJsbz(JsbzEnum.未算费);
|
|
|
yyCblr.setJfzt("1");
|
|
@@ -169,9 +183,19 @@ public class YhCbkxxController {
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "修改水表档案")
|
|
|
@PutMapping
|
|
|
- public ResultRespone<Boolean> update(@RequestBody YhCbkxxUpdate update,
|
|
|
- @ApiIgnore @AuthenticationPrincipal CzyUserDetails czyUserDetails) {
|
|
|
- return ResultRespone.success(yhCbkxxService.update(update, czyUserDetails));
|
|
|
+ public ResultRespone<Boolean> update(@RequestBody YhCbkxx yhCbkxx) {
|
|
|
+ QueryWrapper<YhCbkxx> queryWrapper = new QueryWrapper<>();
|
|
|
+ if(StringUtils.isBlank(yhCbkxx.getCbkh()) || StringUtils.isBlank(yhCbkxx.getYhbh()))
|
|
|
+ {
|
|
|
+ return ResultRespone.failed("修改失败,cbkh或yhbh不能为空!");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ queryWrapper.eq("yhbh", yhCbkxx.getYhbh()).and(i->i.eq("cbkh",yhCbkxx.getCbkh()));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return ResultRespone.success(yhCbkxxService.update(yhCbkxx,queryWrapper ));
|
|
|
}
|
|
|
|
|
|
@ApiOperationSupport(order = 8)
|