Browse Source

add:权限完善

release-sy-v1.0.0
“lyd” 4 weeks ago
parent
commit
078988866e
  1. 11
      shuili-admin/src/main/java/com/kms/web/controller/system/SysXzqhController.java
  2. 18
      shuili-system/src/main/java/com/kms/common/utils/UserUtils.java
  3. 12
      shuili-system/src/main/java/com/kms/system/service/SysXzqhService.java
  4. 1
      shuili-system/src/main/java/com/kms/yg/df/service/BsSgcDfSpPlayService.java
  5. 14
      shuili-system/src/main/java/com/kms/yxgh/common/dto/ApprovalDetailDto.java
  6. 4
      shuili-system/src/main/java/com/kms/yxgh/common/dto/ApprovalSearchDto.java
  7. 32
      shuili-system/src/main/java/com/kms/yxgh/common/dto/IAdcdDeptRole.java
  8. 2
      shuili-system/src/main/java/com/kms/yxgh/common/enums/StaticIndexEnum.java
  9. 11
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordSearchV2Dto.java
  10. 18
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfV2CheckingSearchDto.java
  11. 9
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingProblemV2Mapper.java
  12. 6
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingRecordV2Mapper.java
  13. 7
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingV2Mapper.java
  14. 2
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhV2Mapper.java
  15. 28
      shuili-system/src/main/java/com/kms/yxgh/df/service/AuthorityDikeCodeService.java
  16. 48
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingProblemV2Service.java
  17. 44
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingRecordV2Service.java
  18. 34
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingV2Service.java
  19. 56
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhV2Service.java
  20. 12
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwRecordSearchV2Dto.java
  21. 16
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwV2CheckingSearchDto.java
  22. 7
      shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingProblemV2Mapper.java
  23. 5
      shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingRecordV2Mapper.java
  24. 7
      shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingV2Mapper.java
  25. 4
      shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwYhV2Mapper.java
  26. 55
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingProblemV2Service.java
  27. 45
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingRecordV2Service.java
  28. 30
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingV2Service.java
  29. 56
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwYhV2Service.java
  30. 8
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzRecordSearchV2Dto.java
  31. 17
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzV2CheckingSearchDto.java
  32. 9
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingProblemV2Mapper.java
  33. 7
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingRecordV2Mapper.java
  34. 7
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingV2Mapper.java
  35. 3
      shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhV2Mapper.java
  36. 44
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingProblemV2Service.java
  37. 46
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingRecordV2Service.java
  38. 26
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingV2Service.java
  39. 54
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhV2Service.java
  40. 49
      shuili-system/src/main/resources/mapper/yxgh/DfCheckingV2Mapper.xml
  41. 85
      shuili-system/src/main/resources/mapper/yxgh/DfProblemV2Mapper.xml
  42. 68
      shuili-system/src/main/resources/mapper/yxgh/DfRecordV2Mapper.xml
  43. 70
      shuili-system/src/main/resources/mapper/yxgh/DfYhV2Mapper.xml
  44. 49
      shuili-system/src/main/resources/mapper/yxgh/DwCheckingV2Mapper.xml
  45. 85
      shuili-system/src/main/resources/mapper/yxgh/DwProblemV2Mapper.xml
  46. 68
      shuili-system/src/main/resources/mapper/yxgh/DwRecordV2Mapper.xml
  47. 69
      shuili-system/src/main/resources/mapper/yxgh/DwYhV2Mapper.xml
  48. 49
      shuili-system/src/main/resources/mapper/yxgh/SzCheckingV2Mapper.xml
  49. 85
      shuili-system/src/main/resources/mapper/yxgh/SzProblemV2Mapper.xml
  50. 68
      shuili-system/src/main/resources/mapper/yxgh/SzYhRecordV2Mapper.xml
  51. 67
      shuili-system/src/main/resources/mapper/yxgh/SzYhV2Mapper.xml

11
shuili-admin/src/main/java/com/kms/web/controller/system/SysXzqhController.java

@ -97,19 +97,16 @@ public class SysXzqhController extends BaseController {
// } else { // } else {
// return AjaxResult.success(xzqh); // return AjaxResult.success(xzqh);
// } // }
// }RoleJudgeDto roleDeptDistrictCode = SysXzqhService.getRoleDeptDistrictCode(); // }
@GetMapping("/common") @GetMapping("/common")
@ApiOperation("通用行政区划") @ApiOperation("通用行政区划")
public AjaxResult common(@RequestParam(value = "xzqhdm", required = false) String xzqhdm) { public AjaxResult common(@RequestParam(value = "xzqhdm", required = false) String xzqhdm) {
if (StringUtils.isEmpty(xzqhdm)) { if (StringUtils.isEmpty(xzqhdm)) {
SysDept sysDept = sysDeptService.getById(Objects.requireNonNull(UserUtils.getUser()).getDeptId()); SysUser user = UserUtils.getUser();
RoleJudgeDto roleDeptDistrictCode = AuthorityDikeCodeService.getRoleDeptDistrictCode(); String deptId = user.getDeptId();
SysDept sysDept = sysDeptService.getById(deptId);
String xzqhId = sysDept.getXzqhId(); String xzqhId = sysDept.getXzqhId();
// 权限切入
if (!StringUtils.isEmpty(roleDeptDistrictCode.getXzqhId())) {
xzqhId=roleDeptDistrictCode.getXzqhId();
}
SysXzqh xzqh = sysXzqhService.getById(xzqhId); SysXzqh xzqh = sysXzqhService.getById(xzqhId);
QueryWrapper<SysXzqh> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysXzqh> queryWrapper = new QueryWrapper<>();
queryWrapper.likeRight("XZQHDM", getQuery(xzqh.getXzqhdm())) queryWrapper.likeRight("XZQHDM", getQuery(xzqh.getXzqhdm()))

18
shuili-system/src/main/java/com/kms/common/utils/UserUtils.java

@ -3,25 +3,20 @@ package com.kms.common.utils;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import com.kms.framework.web.service.SysPermissionService; import com.kms.framework.web.service.SysPermissionService;
import com.kms.system.domain.SysXzqh; import com.kms.system.domain.SysXzqh;
import com.kms.system.mapper.SysDeptMapper;
import com.kms.system.service.SysDeptService; import com.kms.system.service.SysDeptService;
import com.kms.system.service.SysUserService; import com.kms.system.service.SysUserService;
import com.kms.system.service.SysXzqhService; import com.kms.system.service.SysXzqhService;
import com.kms.yg.df.domain.dto.RoleJudgeDto;
import com.kms.yxgh.df.service.AuthorityDikeCodeService; import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.df.service.DfCheckingProblemV2Service;
import com.shuili.common.core.domain.entity.SysDept; import com.shuili.common.core.domain.entity.SysDept;
import com.shuili.common.core.domain.entity.SysUser; import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.utils.SpringUtils; import com.shuili.common.utils.SpringUtils;
import com.shuili.common.utils.StringUtils; import com.shuili.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Set; import java.util.Set;
public class UserUtils { public class UserUtils {
private static SysUserService userService = null; private static SysUserService userService = null;
private static SysPermissionService sysPermissionService = null; private static SysPermissionService sysPermissionService = null;
@ -73,13 +68,18 @@ public class UserUtils {
cicd = xzqh.getXzqhdm(); cicd = xzqh.getXzqhdm();
} }
} }
RoleJudgeDto roleDeptDistrictCode = AuthorityDikeCodeService.getRoleDeptDistrictCode();
if (!StringUtils.isEmpty(roleDeptDistrictCode.getXzqhId())) {
cicd = roleDeptDistrictCode.getXzqhId();
}
return cicd; return cicd;
} }
public static String getAdcdDeptRole() {
SysUser user = getUser();
if (user == null) {
return "";
}
return AuthorityDikeCodeService.getAuthorityXzqhCode();
}
public static SysUser getUser() { public static SysUser getUser() {
try { try {

12
shuili-system/src/main/java/com/kms/system/service/SysXzqhService.java

@ -1,27 +1,15 @@
package com.kms.system.service; package com.kms.system.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kms.common.utils.UserUtils; import com.kms.common.utils.UserUtils;
import com.kms.system.domain.SysRoleDept;
import com.kms.system.domain.SysUserRole;
import com.kms.system.domain.SysXzqh; import com.kms.system.domain.SysXzqh;
import com.kms.system.mapper.*; import com.kms.system.mapper.*;
import com.kms.yg.df.domain.BsSgcDfManateam;
import com.kms.yg.df.domain.dto.RoleJudgeDto;
import com.kms.yg.df.service.BsSgcDfManateamService;
import com.shuili.common.core.domain.entity.SysDept; import com.shuili.common.core.domain.entity.SysDept;
import com.shuili.common.core.domain.entity.SysRole;
import com.shuili.common.core.domain.entity.SysUser; import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService; import com.shuili.common.core.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;

1
shuili-system/src/main/java/com/kms/yg/df/service/BsSgcDfSpPlayService.java

@ -52,7 +52,6 @@ public class BsSgcDfSpPlayService {
static final String SP_PLAY_URL = "/vsap-opp-service/resourceSharing/startTransform"; static final String SP_PLAY_URL = "/vsap-opp-service/resourceSharing/startTransform";
public ReservoirListDto reservoirList(ReservoirListDto dto) { public ReservoirListDto reservoirList(ReservoirListDto dto) {
ReservoirListDto listDto = new ReservoirListDto();
// 1. 获取水库信息 // 1. 获取水库信息
String uri = paths.get(BELONG_URL); String uri = paths.get(BELONG_URL);
if (StringUtils.isEmpty(uri) || StringUtils.isEmpty(dataSyncUrl)) { if (StringUtils.isEmpty(uri) || StringUtils.isEmpty(dataSyncUrl)) {

14
shuili-system/src/main/java/com/kms/yxgh/common/dto/ApprovalDetailDto.java

@ -8,7 +8,6 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.Date; import java.util.Date;
import java.util.List;
@ApiModel("审批详情") @ApiModel("审批详情")
@Data @Data
@ -16,6 +15,19 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
public class ApprovalDetailDto<T> { public class ApprovalDetailDto<T> {
/**
* id
*/
@ApiModelProperty("水闸代码")
private String wagaCode;
/**
* id
*/
@ApiModelProperty("水闸名称")
private String wagaName;
/** /**
* id * id
*/ */

4
shuili-system/src/main/java/com/kms/yxgh/common/dto/ApprovalSearchDto.java

@ -28,7 +28,7 @@ public class ApprovalSearchDto<T> {
public String getDikeCode() { public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) { if (StringUtils.isEmpty(this.dikeCode)) {
return AuthorityDikeCodeService.getAuthorityDikeCode(); this.dikeCode =AuthorityDikeCodeService.getAuthorityDikeCode();
} }
return this.dikeCode; return this.dikeCode;
} }
@ -38,7 +38,7 @@ public class ApprovalSearchDto<T> {
public String getWagaCode() { public String getWagaCode() {
if (StringUtils.isEmpty(this.wagaCode)) { if (StringUtils.isEmpty(this.wagaCode)) {
return AuthorityDikeCodeService.getAuthorityDikeCode(); this.wagaCode = AuthorityDikeCodeService.getAuthorityDikeCode();
} }
return this.wagaCode; return this.wagaCode;
} }

32
shuili-system/src/main/java/com/kms/yxgh/common/dto/IAdcdDeptRole.java

@ -0,0 +1,32 @@
package com.kms.yxgh.common.dto;
import com.kms.common.utils.UserUtils;
public interface IAdcdDeptRole {
String getAdcd();
default String getAdcdQx() {
String userAdcd = UserUtils.getAdcdDeptRole();
String adcd = getAdcd();
if (adcd == null) {
adcd = userAdcd;
}
if (adcd == null) {
return null;
}
int index = adcd.length() - 1;
while (index >= 0 && adcd.charAt(index) == '0') {
index--;
}
if (index < 0) {
return adcd;
}
if (index > 5) {
return adcd.replaceAll("000(000)?$", "");
} else {
return adcd.substring(0, 6).replaceAll("00(00)?$", "");
}
}
}

2
shuili-system/src/main/java/com/kms/yxgh/common/enums/StaticIndexEnum.java

@ -502,8 +502,6 @@ public enum StaticIndexEnum {
.ge(!Objects.isNull(sp.getStartTime()), BsSgcSzSzrw::getCreateTime, sp.getStartTime()) .ge(!Objects.isNull(sp.getStartTime()), BsSgcSzSzrw::getCreateTime, sp.getStartTime())
.le(!Objects.isNull(sp.getEndTime()), BsSgcSzSzrw::getCreateTime, sp.getEndTime()) .le(!Objects.isNull(sp.getEndTime()), BsSgcSzSzrw::getCreateTime, sp.getEndTime())
); );
BsSgcDfDfrwService dfService = SpringUtils.getBean(BsSgcDfDfrwService.class); BsSgcDfDfrwService dfService = SpringUtils.getBean(BsSgcDfDfrwService.class);
int df = dfService.count(new LambdaQueryWrapper<BsSgcDfDfrw>() int df = dfService.count(new LambdaQueryWrapper<BsSgcDfDfrw>()
// 待鉴定 // 待鉴定

11
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordSearchV2Dto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.df.dto.v2; package com.kms.yxgh.df.dto.v2;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService; import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -11,7 +12,10 @@ import java.util.Date;
@Data @Data
@ApiModel("堤防巡视检查记录检索条件v2") @ApiModel("堤防巡视检查记录检索条件v2")
public class DfRecordSearchV2Dto { public class DfRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty("堤防名称") @ApiModelProperty("堤防名称")
private String dikeName; private String dikeName;
@ -55,9 +59,8 @@ public class DfRecordSearchV2Dto {
public String getDikeCode() { public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) { if (StringUtils.isEmpty(this.dikeCode)) {
return AuthorityDikeCodeService.getAuthorityDikeCode(); this.dikeCode =AuthorityDikeCodeService.getAuthorityDikeCode();
} }
return null; return this.dikeCode;
} }
} }

18
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfV2CheckingSearchDto.java

@ -1,13 +1,20 @@
package com.kms.yxgh.df.dto.v2; package com.kms.yxgh.df.dto.v2;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.util.StringUtils;
/**
* @author lyd
*/
@Data @Data
@ApiModel(value = "堤防巡查项目查询v2") @ApiModel(value = "堤防巡查项目查询v2")
public class DfV2CheckingSearchDto { public class DfV2CheckingSearchDto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty(value = "堤防编号") @ApiModelProperty(value = "堤防编号")
private String dikeCode; private String dikeCode;
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
@ -16,4 +23,11 @@ public class DfV2CheckingSearchDto {
private String type; private String type;
@ApiModelProperty("巡查类别") @ApiModelProperty("巡查类别")
private String category; private String category;
public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) {
this.dikeCode = AuthorityDikeCodeService.getAuthorityDikeCode();
}
return this.dikeCode;
}
} }

9
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingProblemV2Mapper.java

@ -1,9 +1,15 @@
package com.kms.yxgh.df.mapper; package com.kms.yxgh.df.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.*; import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.df.domain.DfCheckingProblemV2; import com.kms.yxgh.df.domain.DfCheckingProblemV2;
import com.kms.yxgh.df.dto.v2.DfProblemV2Dto;
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto;
import com.kms.yxgh.df.dto.v2.DfYhApproveDto;
import com.shuili.common.core.domain.SearchParam;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -19,6 +25,9 @@ import java.util.List;
@Repository @Repository
public interface DfCheckingProblemV2Mapper extends BaseMapper<DfCheckingProblemV2> { public interface DfCheckingProblemV2Mapper extends BaseMapper<DfCheckingProblemV2> {
IPage<DfProblemV2Dto> page(Page<DfCheckingProblemV2> page, @Param("data") DfRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_df_xcqx xm " + "from bs_sgc_df_xcqx xm " +

6
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingRecordV2Mapper.java

@ -1,11 +1,15 @@
package com.kms.yxgh.df.mapper; package com.kms.yxgh.df.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDateDto; import com.kms.yxgh.common.dto.CountDateDto;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.df.domain.DfCheckingRecord; import com.kms.yxgh.df.domain.DfCheckingRecord;
import com.kms.yxgh.df.dto.v2.DfRecordDetailV2Dto;
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -21,6 +25,8 @@ import java.util.List;
@Repository @Repository
public interface DfCheckingRecordV2Mapper extends BaseMapper<DfCheckingRecord> { public interface DfCheckingRecordV2Mapper extends BaseMapper<DfCheckingRecord> {
IPage<DfRecordDetailV2Dto> page(Page<DfCheckingRecord> page, @Param("data") DfRecordSearchV2Dto dto);
@Select("<script>" + @Select("<script>" +
"SELECT count(DISTINCT(jl.DIKE_CODE)) "+ "SELECT count(DISTINCT(jl.DIKE_CODE)) "+

7
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfCheckingV2Mapper.java

@ -1,9 +1,13 @@
package com.kms.yxgh.df.mapper; package com.kms.yxgh.df.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage; import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.df.dto.v2.DfV2CheckingDto;
import com.kms.yxgh.df.dto.v2.DfV2CheckingSearchDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -19,6 +23,9 @@ import java.util.List;
@Repository @Repository
public interface DfCheckingV2Mapper extends BaseMapper<DfCheckingV2ProjectManage> { public interface DfCheckingV2Mapper extends BaseMapper<DfCheckingV2ProjectManage> {
IPage<DfV2CheckingDto> page(Page<DfCheckingV2ProjectManage> page, @Param("data") DfV2CheckingSearchDto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_df_xmgl xm " + "from bs_sgc_df_xmgl xm " +

2
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhV2Mapper.java

@ -7,6 +7,7 @@ import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.df.domain.DfYhV2; import com.kms.yxgh.df.domain.DfYhV2;
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto; import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto;
import com.kms.yxgh.df.dto.v2.DfYhApproveDto; import com.kms.yxgh.df.dto.v2.DfYhApproveDto;
import com.kms.yxgh.df.dto.v2.DfYhListV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -24,6 +25,7 @@ public interface DfYhV2Mapper extends BaseMapper<DfYhV2> {
IPage<ApprovalDetailDto<DfYhApproveDto>> approvalSearchPage(Page<DfRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<DfRecordSearchV2Dto> data); IPage<ApprovalDetailDto<DfYhApproveDto>> approvalSearchPage(Page<DfRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<DfRecordSearchV2Dto> data);
IPage<DfYhListV2Dto> page(Page<DfYhV2> page, @Param("data") DfRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +

28
shuili-system/src/main/java/com/kms/yxgh/df/service/AuthorityDikeCodeService.java

@ -29,16 +29,17 @@ public class AuthorityDikeCodeService {
/** /**
* 获取当前用户部门所属行政区划 * 获取当前用户部门所属行政区划
* 如果当前登录用户角色编码属于(YW00143YW00129YW00164)则返回当前用户部门的行政区划代码 * 如果当前登录用户角色编码属于(YW00143YW00129YW00164)则返回当前用户部门的行政区划代码 implements IAdcd 本身已经实现
*如果当前登录用户角色编码属于YW00352/YW00402则通过当前用户手机号去BS_SGC_DF_MANATEAM数据库表找到他在工程对象代码进行数据过滤 *如果当前登录用户角色编码属于YW00352/YW00402则通过当前用户手机号去BS_SGC_DF_MANATEAM数据库表找到他在工程对象代码进行数据过滤
* @return String * @return String
*/ */
public static RoleJudgeDto getRoleDeptDistrictCode() { public static RoleJudgeDto getRoleDeptDistrictCode() {
SysDeptService sysDeptService = SpringUtils.getBean(SysDeptService.class);
SysRoleService sysRoleService = SpringUtils.getBean(SysRoleService.class); SysRoleService sysRoleService = SpringUtils.getBean(SysRoleService.class);
DfSysUserRoleMapper dfSysUserRoleMapper = SpringUtils.getBean(DfSysUserRoleMapper.class); DfSysUserRoleMapper dfSysUserRoleMapper = SpringUtils.getBean(DfSysUserRoleMapper.class);
BsSgcDfManateamService bsSgcDfManateamService = SpringUtils.getBean(BsSgcDfManateamService.class); BsSgcDfManateamService bsSgcDfManateamService = SpringUtils.getBean(BsSgcDfManateamService.class);
SysDeptService sysDeptService = SpringUtils.getBean(SysDeptService.class);
RoleJudgeDto dto=new RoleJudgeDto(); RoleJudgeDto dto=new RoleJudgeDto();
SysUser user = UserUtils.getUser(); SysUser user = UserUtils.getUser();
@ -62,24 +63,27 @@ public class AuthorityDikeCodeService {
if (roleCodes.contains("YW00143") if (roleCodes.contains("YW00143")
|| roleCodes.contains("YW00129") || roleCodes.contains("YW00129")
|| roleCodes.contains("YW00164")) { || roleCodes.contains("YW00164")) {
SysDept sysDept = sysDeptService.getById(user.getDeptId()); SysDept sysDept = sysDeptService.getOne(
new LambdaQueryWrapper<SysDept>()
.eq(!StringUtils.isEmpty(user.getDeptId()),SysDept::getId, user.getDeptId())
.orderByDesc(SysDept::getCreateTime)
.last(" limit 1 ")
);
if (!Objects.isNull(sysDept)) { if (!Objects.isNull(sysDept)) {
dto.setXzqhId(StringUtils.isEmpty(sysDept.getXzqhId()) dto.setXzqhId(sysDept.getXzqhId());
? null:sysDept.getXzqhId());
return dto; return dto;
} }
} }
if (roleCodes.contains("YW00352") if (roleCodes.contains("YW00352")
|| roleCodes.contains("YW00402")) { || roleCodes.contains("YW00402")) {
BsSgcDfManateam bsSgcDfManateam = bsSgcDfManateamService BsSgcDfManateam bsSgcDfManateam = bsSgcDfManateamService
.getById(new LambdaQueryWrapper<BsSgcDfManateam>() .getOne(new LambdaQueryWrapper<BsSgcDfManateam>()
.eq(!StringUtils.isEmpty(user.getPhonenumber()),BsSgcDfManateam::getPhone, user.getPhonenumber()) .eq(!StringUtils.isEmpty(user.getPhonenumber()),BsSgcDfManateam::getPhone, user.getPhonenumber())
.orderByDesc(BsSgcDfManateam::getCreateTime) .orderByDesc(BsSgcDfManateam::getCreateTime)
.last(" limit 1 ") .last(" limit 1 ")
); );
if (!Objects.isNull(bsSgcDfManateam)) { if (!Objects.isNull(bsSgcDfManateam)) {
dto.setDikeCode(StringUtils.isEmpty(bsSgcDfManateam.getDikeCode()) dto.setDikeCode(bsSgcDfManateam.getDikeCode());
? null:bsSgcDfManateam.getDikeCode());
return dto; return dto;
} }
} }
@ -91,9 +95,11 @@ public class AuthorityDikeCodeService {
public static String getAuthorityDikeCode() { public static String getAuthorityDikeCode() {
RoleJudgeDto roleDeptDistrictCode = getRoleDeptDistrictCode(); return getRoleDeptDistrictCode().getDikeCode();
return StringUtils.isEmpty(roleDeptDistrictCode.getDikeCode()) }
? null : roleDeptDistrictCode.getDikeCode();
public static String getAuthorityXzqhCode() {
return getRoleDeptDistrictCode().getXzqhId();
} }
} }

48
shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingProblemV2Service.java

@ -14,6 +14,7 @@ import com.kms.system.service.SysXzqhService;
import com.kms.yg.df.domain.BsSgcDfManateam; import com.kms.yg.df.domain.BsSgcDfManateam;
import com.kms.yg.df.domain.dto.RoleJudgeDto; import com.kms.yg.df.domain.dto.RoleJudgeDto;
import com.kms.yg.df.service.BsSgcDfManateamService; import com.kms.yg.df.service.BsSgcDfManateamService;
import com.kms.yxgh.common.dto.ApprovalDetailDto;
import com.kms.yxgh.df.domain.DfCheckingProblemV2; import com.kms.yxgh.df.domain.DfCheckingProblemV2;
import com.kms.yxgh.df.domain.DfSysUserRole; import com.kms.yxgh.df.domain.DfSysUserRole;
import com.kms.yxgh.df.domain.DfYhV2; import com.kms.yxgh.df.domain.DfYhV2;
@ -60,59 +61,14 @@ public class DfCheckingProblemV2Service extends BaseService<DfCheckingProblemV2M
} }
// 分页参数 // 分页参数
Page<DfCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DfCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
// 构建查询条件
LambdaQueryWrapper<DfCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<DfCheckingProblemV2>();
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DfCheckingProblemV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DfCheckingProblemV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfCheckingProblemV2::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DfCheckingProblemV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DfCheckingProblemV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DfCheckingProblemV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DfCheckingProblemV2::getEndDate, data.getEndDate());
}
Optional.ofNullable(data.getProblemLevel())
.filter(StringUtils::isNotBlank)
.ifPresent(problemLevel -> queryWrapper.eq(DfCheckingProblemV2::getProblemLevel, problemLevel));
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(DfCheckingProblemV2::getRecordId, recordId));
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode()),DfCheckingProblemV2::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.ne(DfCheckingProblemV2::getStatus, DURING_INSPECTION.getValue());
queryWrapper.orderByDesc(DfCheckingProblemV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DfCheckingProblemV2> queryPage = page(page, queryWrapper); IPage<DfProblemV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
// 转换为 DTO 分页对象 // 转换为 DTO 分页对象
Page<DfProblemV2Dto> dtoPage = new Page<>(); Page<DfProblemV2Dto> dtoPage = new Page<>();
BeanUtils.copyProperties(queryPage, dtoPage); BeanUtils.copyProperties(queryPage, dtoPage);
// 处理查询结果 // 处理查询结果
List<DfProblemV2Dto> vos = queryPage.getRecords().stream() List<DfProblemV2Dto> vos = queryPage.getRecords().stream()
.map(record -> { .map(record -> {

44
shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingRecordV2Service.java

@ -3,7 +3,6 @@ package com.kms.yxgh.df.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -24,8 +23,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -47,47 +44,8 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
public IPage<DfRecordDetailV2Dto> list(SearchParam<DfRecordSearchV2Dto> sp) { public IPage<DfRecordDetailV2Dto> list(SearchParam<DfRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<DfCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DfCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DfRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DfCheckingRecord> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DfCheckingRecord::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DfCheckingRecord::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfCheckingRecord::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DfCheckingRecord::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DfCheckingRecord::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DfCheckingRecord::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DfCheckingRecord::getEndDate, data.getEndDate());
}
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
,DfCheckingRecord::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DfCheckingRecord::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DfCheckingRecord> queryPage = page(page, queryWrapper); IPage<DfRecordDetailV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

34
shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingV2Service.java

@ -3,11 +3,9 @@ package com.kms.yxgh.df.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.df.domain.DfCheckingRecord;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectItem; import com.kms.yxgh.df.domain.DfCheckingV2ProjectItem;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage; import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.df.dto.DfCheckingDetailDto; import com.kms.yxgh.df.dto.DfCheckingDetailDto;
@ -36,42 +34,16 @@ public class DfCheckingV2Service extends BaseService<DfCheckingV2Mapper, DfCheck
private final DfCheckingV2ProjectItemV2Service dfCheckingV2ProjectItemV2Service; private final DfCheckingV2ProjectItemV2Service dfCheckingV2ProjectItemV2Service;
private final DfCheckingProblemV2Service dfCheckingProblemV2Service;
public IPage<DfV2CheckingDto> list(SearchParam<DfV2CheckingSearchDto> sp) { public IPage<DfV2CheckingDto> list(SearchParam<DfV2CheckingSearchDto> sp) {
// 分页参数 // 分页参数
Page<DfCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DfCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DfV2CheckingSearchDto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DfCheckingV2ProjectManage> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DfCheckingV2ProjectManage::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DfCheckingV2ProjectManage::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfCheckingV2ProjectManage::getName, name));
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
,DfCheckingV2ProjectManage::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DfCheckingV2ProjectManage::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DfCheckingV2ProjectManage> queryPage = page(page, queryWrapper); IPage<DfV2CheckingDto> queryPage =this.baseMapper.page(page,sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
// 转换为 DTO 分页对象 // 转换为 DTO 分页对象
Page<DfV2CheckingDto> dtoPage = new Page<>(); IPage<DfV2CheckingDto> dtoPage = new Page<>();
BeanUtils.copyProperties(queryPage, dtoPage); BeanUtils.copyProperties(queryPage, dtoPage);
// 处理查询结果 // 处理查询结果
@ -91,8 +63,6 @@ public class DfCheckingV2Service extends BaseService<DfCheckingV2Mapper, DfCheck
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return dtoPage; return dtoPage;
} }
List<DfCheckingV2ProjectItem> items = dfCheckingV2ProjectItemV2Service.list( List<DfCheckingV2ProjectItem> items = dfCheckingV2ProjectItemV2Service.list(
Wrappers.<DfCheckingV2ProjectItem>lambdaQuery() Wrappers.<DfCheckingV2ProjectItem>lambdaQuery()
.in(DfCheckingV2ProjectItem::getCheckingId, ids) .in(DfCheckingV2ProjectItem::getCheckingId, ids)

56
shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhV2Service.java

@ -4,9 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.ApprovalStatusEnum; import com.kms.yxgh.common.ApprovalStatusEnum;
@ -19,7 +16,6 @@ import com.kms.yxgh.common.service.ApprovalService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService; import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.df.domain.DfCheckingProblemV2; import com.kms.yxgh.df.domain.DfCheckingProblemV2;
import com.kms.yxgh.df.domain.DfCheckingRecord; import com.kms.yxgh.df.domain.DfCheckingRecord;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.df.domain.DfYhV2; import com.kms.yxgh.df.domain.DfYhV2;
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto; import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto;
import com.kms.yxgh.df.dto.v2.DfYhApproveDto; import com.kms.yxgh.df.dto.v2.DfYhApproveDto;
@ -35,7 +31,6 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -61,63 +56,14 @@ public class DfYhV2Service extends DefaultApprovalBusinessService<DfYhV2Mapper,
public IPage<DfYhListV2Dto> list(SearchParam<DfRecordSearchV2Dto> sp) { public IPage<DfYhListV2Dto> list(SearchParam<DfRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<DfYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DfYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DfRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DfYhV2> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DfYhV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DfYhV2::getType, type));
Optional.ofNullable(data.getName())
.filter(com.baomidou.mybatisplus.core.toolkit.StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfYhV2::getName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DfYhV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DfYhV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DfYhV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DfYhV2::getEndDate, data.getEndDate());
}
if (StringUtils.isNotBlank(data.getProblemLevel())) {
queryWrapper.eq(DfYhV2::getProblemLevel, data.getProblemLevel());
}
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(DfYhV2::getRecordId, recordId));
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, DfYhV2::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DfYhV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DfYhV2> queryPage = page(page, queryWrapper); IPage<DfYhListV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
// 转换为 DTO 分页对象 // 转换为 DTO 分页对象
Page<DfYhListV2Dto> dtoPage = new Page<>(); Page<DfYhListV2Dto> dtoPage = new Page<>();
BeanUtils.copyProperties(queryPage, dtoPage); BeanUtils.copyProperties(queryPage, dtoPage);
// 处理查询结果 // 处理查询结果
List<DfYhListV2Dto> vos = queryPage.getRecords().stream() List<DfYhListV2Dto> vos = queryPage.getRecords().stream()
.map(record -> { .map(record -> {

12
shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwRecordSearchV2Dto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.dw.dto; package com.kms.yxgh.dw.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService; import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -11,7 +12,7 @@ import java.util.Date;
@Data @Data
@ApiModel("工程巡视检查记录检索条件v2") @ApiModel("工程巡视检查记录检索条件v2")
public class DwRecordSearchV2Dto { public class DwRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty("工程名称") @ApiModelProperty("工程名称")
private String dikeName; private String dikeName;
@ -53,10 +54,13 @@ public class DwRecordSearchV2Dto {
@ApiModelProperty(value = "堤防编码") @ApiModelProperty(value = "堤防编码")
private String dikeCode; private String dikeCode;
public String getCode() { @ApiModelProperty(value = "行政区划")
private String adcd;
public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) { if (StringUtils.isEmpty(this.dikeCode)) {
return AuthorityDikeCodeService.getAuthorityDikeCode(); this.dikeCode =AuthorityDikeCodeService.getAuthorityDikeCode();
} }
return null; return this.dikeCode;
} }
} }

16
shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwV2CheckingSearchDto.java

@ -1,13 +1,16 @@
package com.kms.yxgh.dw.dto; package com.kms.yxgh.dw.dto;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.util.StringUtils;
@Data @Data
@ApiModel(value = "工程巡查项目查询v2") @ApiModel(value = "工程巡查项目查询v2")
public class DwV2CheckingSearchDto { public class DwV2CheckingSearchDto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty(value = "工程编号") @ApiModelProperty(value = "工程编号")
private String dikeCode; private String dikeCode;
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
@ -16,4 +19,11 @@ public class DwV2CheckingSearchDto {
private String type; private String type;
@ApiModelProperty("巡查类别") @ApiModelProperty("巡查类别")
private String category; private String category;
public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) {
this.dikeCode = AuthorityDikeCodeService.getAuthorityDikeCode();
}
return this.dikeCode;
}
} }

7
shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingProblemV2Mapper.java

@ -1,11 +1,15 @@
package com.kms.yxgh.dw.mapper; package com.kms.yxgh.dw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDateDto; import com.kms.yxgh.common.dto.CountDateDto;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.dw.domain.DwCheckingProblemV2; import com.kms.yxgh.dw.domain.DwCheckingProblemV2;
import com.kms.yxgh.dw.dto.DwProblemV2Dto;
import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -21,6 +25,9 @@ import java.util.List;
@Repository @Repository
public interface DwCheckingProblemV2Mapper extends BaseMapper<DwCheckingProblemV2> { public interface DwCheckingProblemV2Mapper extends BaseMapper<DwCheckingProblemV2> {
IPage<DwProblemV2Dto> page(Page<DwCheckingProblemV2> page, @Param("data") DwRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_dw_xcqx xm " + "from bs_sgc_dw_xcqx xm " +

5
shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingRecordV2Mapper.java

@ -1,11 +1,15 @@
package com.kms.yxgh.dw.mapper; package com.kms.yxgh.dw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDateDto; import com.kms.yxgh.common.dto.CountDateDto;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.dw.domain.DwCheckingRecord; import com.kms.yxgh.dw.domain.DwCheckingRecord;
import com.kms.yxgh.dw.dto.DwRecordDetailV2Dto;
import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -20,6 +24,7 @@ import java.util.List;
*/ */
@Repository @Repository
public interface DwCheckingRecordV2Mapper extends BaseMapper<DwCheckingRecord> { public interface DwCheckingRecordV2Mapper extends BaseMapper<DwCheckingRecord> {
IPage<DwRecordDetailV2Dto> page(Page<DwCheckingRecord> page, @Param("data") DwRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +

7
shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwCheckingV2Mapper.java

@ -1,10 +1,13 @@
package com.kms.yxgh.dw.mapper; package com.kms.yxgh.dw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage; import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage;
import com.kms.yxgh.dw.dto.DwV2CheckingDto;
import com.kms.yxgh.dw.dto.DwV2CheckingSearchDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -20,6 +23,8 @@ import java.util.List;
@Repository @Repository
public interface DwCheckingV2Mapper extends BaseMapper<DwCheckingV2ProjectManage> { public interface DwCheckingV2Mapper extends BaseMapper<DwCheckingV2ProjectManage> {
IPage<DwV2CheckingDto> page(Page<DwCheckingV2ProjectManage> page, @Param("data") DwV2CheckingSearchDto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_dw_xmgl xm " + "from bs_sgc_dw_xmgl xm " +

4
shuili-system/src/main/java/com/kms/yxgh/dw/mapper/DwYhV2Mapper.java

@ -1,5 +1,4 @@
package com.kms.yxgh.dw.mapper; package com.kms.yxgh.dw.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -7,6 +6,7 @@ import com.kms.yxgh.common.dto.*;
import com.kms.yxgh.dw.domain.DwYhV2; import com.kms.yxgh.dw.domain.DwYhV2;
import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto; import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto;
import com.kms.yxgh.dw.dto.DwYhApproveDto; import com.kms.yxgh.dw.dto.DwYhApproveDto;
import com.kms.yxgh.dw.dto.DwYhListV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -24,6 +24,8 @@ public interface DwYhV2Mapper extends BaseMapper<DwYhV2> {
IPage<ApprovalDetailDto<DwYhApproveDto>> approvalSearchPage(Page<DwRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<DwRecordSearchV2Dto> data); IPage<ApprovalDetailDto<DwYhApproveDto>> approvalSearchPage(Page<DwRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<DwRecordSearchV2Dto> data);
IPage<DwYhListV2Dto> page(Page<DwYhV2> page, @Param("data") DwRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +

55
shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingProblemV2Service.java

@ -5,9 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.df.domain.DfYhV2;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.dw.domain.DwCheckingProblemV2; import com.kms.yxgh.dw.domain.DwCheckingProblemV2;
import com.kms.yxgh.dw.domain.DwYhV2; import com.kms.yxgh.dw.domain.DwYhV2;
import com.kms.yxgh.dw.dto.DwProblemV2Dto; import com.kms.yxgh.dw.dto.DwProblemV2Dto;
@ -20,14 +17,9 @@ import com.shuili.common.core.service.BaseService;
import com.shuili.common.utils.BeanUtils; import com.shuili.common.utils.BeanUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.kms.yxgh.common.enums.DfYhV2StatusEnum.DURING_INSPECTION;
/** /**
* 项目管理记录 * 项目管理记录
* *
@ -48,53 +40,8 @@ public class DwCheckingProblemV2Service extends BaseService<DwCheckingProblemV2M
} }
// 分页参数 // 分页参数
Page<DwCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DwCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
// 构建查询条件
LambdaQueryWrapper<DwCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<DwCheckingProblemV2>();
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DwCheckingProblemV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DwCheckingProblemV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DwCheckingProblemV2::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DwCheckingProblemV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DwCheckingProblemV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DwCheckingProblemV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DwCheckingProblemV2::getEndDate, data.getEndDate());
}
Optional.ofNullable(data.getProblemLevel())
.filter(StringUtils::isNotBlank)
.ifPresent(problemLevel -> queryWrapper.eq(DwCheckingProblemV2::getProblemLevel, problemLevel));
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(DwCheckingProblemV2::getRecordId, recordId));
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, DwCheckingProblemV2::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.ne(DwCheckingProblemV2::getStatus, DURING_INSPECTION.getValue());
queryWrapper.orderByDesc(DwCheckingProblemV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DwCheckingProblemV2> queryPage = page(page, queryWrapper); IPage<DwProblemV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

45
shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingRecordV2Service.java

@ -3,12 +3,10 @@ package com.kms.yxgh.dw.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.dw.domain.*; import com.kms.yxgh.dw.domain.*;
import com.kms.yxgh.dw.domain.DwCheckingRecord; import com.kms.yxgh.dw.domain.DwCheckingRecord;
import com.kms.yxgh.dw.dto.DwRecordDetailV2Dto; import com.kms.yxgh.dw.dto.DwRecordDetailV2Dto;
@ -21,11 +19,8 @@ import com.shuili.common.utils.BeanUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -48,46 +43,8 @@ public class DwCheckingRecordV2Service extends BaseService<DwCheckingRecordV2Map
public IPage<DwRecordDetailV2Dto> list(SearchParam<DwRecordSearchV2Dto> sp) { public IPage<DwRecordDetailV2Dto> list(SearchParam<DwRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<DwCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DwCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DwRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DwCheckingRecord> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DwCheckingRecord::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DwCheckingRecord::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DwCheckingRecord::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DwCheckingRecord::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DwCheckingRecord::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DwCheckingRecord::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DwCheckingRecord::getEndDate, data.getEndDate());
}
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, DwCheckingRecord::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DwCheckingRecord::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DwCheckingRecord> queryPage = page(page, queryWrapper); IPage<DwRecordDetailV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

30
shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingV2Service.java

@ -3,15 +3,11 @@ package com.kms.yxgh.dw.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.df.service.DfCheckingV2Service; import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.dw.domain.DwCheckingRecord;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectItem; import com.kms.yxgh.dw.domain.DwCheckingV2ProjectItem;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage; import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage;
import com.kms.yxgh.dw.dto.DwCheckingDetailDto; import com.kms.yxgh.dw.dto.DwCheckingDetailDto;
import com.kms.yxgh.dw.dto.DwV2CheckingDto; import com.kms.yxgh.dw.dto.DwV2CheckingDto;
import com.kms.yxgh.dw.dto.DwV2CheckingSearchDto; import com.kms.yxgh.dw.dto.DwV2CheckingSearchDto;
@ -42,30 +38,8 @@ public class DwCheckingV2Service extends BaseService<DwCheckingV2Mapper, DwCheck
public IPage<DwV2CheckingDto> list(SearchParam<DwV2CheckingSearchDto> sp) { public IPage<DwV2CheckingDto> list(SearchParam<DwV2CheckingSearchDto> sp) {
// 分页参数 // 分页参数
Page<DwCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DwCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DwV2CheckingSearchDto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DwCheckingV2ProjectManage> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DwCheckingV2ProjectManage::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DwCheckingV2ProjectManage::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DwCheckingV2ProjectManage::getName, name));
}
queryWrapper.eq(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, DwCheckingV2ProjectManage::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DwCheckingV2ProjectManage::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DwCheckingV2ProjectManage> queryPage = page(page, queryWrapper); IPage<DwV2CheckingDto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
@ -91,8 +65,6 @@ public class DwCheckingV2Service extends BaseService<DwCheckingV2Mapper, DwCheck
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return dtoPage; return dtoPage;
} }
List<DwCheckingV2ProjectItem> items = dwCheckingV2ProjectItemV2Service.list( List<DwCheckingV2ProjectItem> items = dwCheckingV2ProjectItemV2Service.list(
Wrappers.<DwCheckingV2ProjectItem>lambdaQuery() Wrappers.<DwCheckingV2ProjectItem>lambdaQuery()
.in(DwCheckingV2ProjectItem::getCheckingId, ids) .in(DwCheckingV2ProjectItem::getCheckingId, ids)

56
shuili-system/src/main/java/com/kms/yxgh/dw/service/DwYhV2Service.java

@ -3,9 +3,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.ApprovalStatusEnum; import com.kms.yxgh.common.ApprovalStatusEnum;
@ -16,10 +13,8 @@ import com.kms.yxgh.common.dto.DocV2Dto;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.common.service.ApprovalService; import com.kms.yxgh.common.service.ApprovalService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService; import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.dw.domain.DwCheckingProblemV2; import com.kms.yxgh.dw.domain.DwCheckingProblemV2;
import com.kms.yxgh.dw.domain.DwCheckingRecord; import com.kms.yxgh.dw.domain.DwCheckingRecord;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage;
import com.kms.yxgh.dw.domain.DwYhV2; import com.kms.yxgh.dw.domain.DwYhV2;
import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto; import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto;
import com.kms.yxgh.dw.dto.DwYhApproveDto; import com.kms.yxgh.dw.dto.DwYhApproveDto;
@ -59,55 +54,8 @@ public class DwYhV2Service extends DefaultApprovalBusinessService<DwYhV2Mapper,
public IPage<DwYhListV2Dto> list(SearchParam<DwRecordSearchV2Dto> sp) { public IPage<DwYhListV2Dto> list(SearchParam<DwRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<DwYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<DwYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
DwRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DwYhV2> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DwYhV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DwYhV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DwYhV2::getName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(DwYhV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(DwYhV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(DwYhV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(DwYhV2::getEndDate, data.getEndDate());
}
if (StringUtils.isNotBlank(data.getProblemLevel())) {
queryWrapper.eq(DwYhV2::getProblemLevel, data.getProblemLevel());
}
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(DwYhV2::getRecordId, recordId));
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, DwYhV2::getDikeCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(DwYhV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<DwYhV2> queryPage = page(page, queryWrapper); IPage<DwYhListV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
@ -129,7 +77,6 @@ public class DwYhV2Service extends DefaultApprovalBusinessService<DwYhV2Mapper,
return dtoPage; return dtoPage;
} }
public DwYhDetailV2Dto getInfo(String id) { public DwYhDetailV2Dto getInfo(String id) {
DwYhDetailV2Dto dto = new DwYhDetailV2Dto(); DwYhDetailV2Dto dto = new DwYhDetailV2Dto();
DwYhV2 dfYhV2 = getById(id); DwYhV2 dfYhV2 = getById(id);
@ -140,7 +87,6 @@ public class DwYhV2Service extends DefaultApprovalBusinessService<DwYhV2Mapper,
return dto; return dto;
} }
public Boolean myRemove(String[] ids) { public Boolean myRemove(String[] ids) {
if (null != ids && ids.length > 0) { if (null != ids && ids.length > 0) {
return remove(new LambdaQueryWrapper<DwYhV2>() return remove(new LambdaQueryWrapper<DwYhV2>()

8
shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzRecordSearchV2Dto.java

@ -1,6 +1,7 @@
package com.kms.yxgh.sz.dto.v2; package com.kms.yxgh.sz.dto.v2;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService; import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -11,7 +12,10 @@ import java.util.Date;
@Data @Data
@ApiModel("水闸巡视检查记录检索条件v2") @ApiModel("水闸巡视检查记录检索条件v2")
public class SzRecordSearchV2Dto { public class SzRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty("水闸名称") @ApiModelProperty("水闸名称")
private String wagaName; private String wagaName;
@ -55,7 +59,7 @@ public class SzRecordSearchV2Dto {
public String getWagaCode() { public String getWagaCode() {
if (StringUtils.isEmpty(this.wagaCode)) { if (StringUtils.isEmpty(this.wagaCode)) {
return AuthorityDikeCodeService.getAuthorityDikeCode(); this.wagaCode = AuthorityDikeCodeService.getAuthorityDikeCode();
} }
return this.wagaCode; return this.wagaCode;
} }

17
shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzV2CheckingSearchDto.java

@ -1,12 +1,13 @@
package com.kms.yxgh.sz.dto.v2; package com.kms.yxgh.sz.dto.v2;
import com.kms.yxgh.common.dto.IAdcdDeptRole;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.util.StringUtils;
@Data @Data
@ApiModel(value = "水闸巡查项目查询v2") @ApiModel(value = "水闸巡查项目查询v2")
public class SzV2CheckingSearchDto { public class SzV2CheckingSearchDto implements IAdcdDeptRole {
@ApiModelProperty(value = "水闸编号") @ApiModelProperty(value = "水闸编号")
private String wagaCode; private String wagaCode;
@ -16,4 +17,14 @@ public class SzV2CheckingSearchDto {
private String type; private String type;
@ApiModelProperty("类别") @ApiModelProperty("类别")
private String category; private String category;
@ApiModelProperty(value = "行政区划")
private String adcd;
public String getDikeCode() {
if (StringUtils.isEmpty(this.wagaCode)) {
this.wagaCode = AuthorityDikeCodeService.getAuthorityDikeCode();
}
return this.wagaCode;
}
} }

9
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingProblemV2Mapper.java

@ -1,11 +1,16 @@
package com.kms.yxgh.sz.mapper; package com.kms.yxgh.sz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDateDto; import com.kms.yxgh.common.dto.CountDateDto;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; import com.kms.yxgh.sz.domain.SzCheckingProblemV2;
import com.kms.yxgh.sz.dto.v2.SzProblemV2Dto;
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto;
import com.shuili.common.core.domain.SearchParam;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -21,6 +26,10 @@ import java.util.List;
@Repository @Repository
public interface SzCheckingProblemV2Mapper extends BaseMapper<SzCheckingProblemV2> { public interface SzCheckingProblemV2Mapper extends BaseMapper<SzCheckingProblemV2> {
IPage<SzProblemV2Dto> page(Page<SzCheckingProblemV2> page, @Param("data") SzRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_sz_xcqx xm " + "from bs_sgc_sz_xcqx xm " +

7
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingRecordV2Mapper.java

@ -1,11 +1,15 @@
package com.kms.yxgh.sz.mapper; package com.kms.yxgh.sz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDateDto; import com.kms.yxgh.common.dto.CountDateDto;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; import com.kms.yxgh.common.enums.PatrolMaintenanceCategory;
import com.kms.yxgh.sz.domain.SzCheckingRecord; import com.kms.yxgh.sz.domain.SzCheckingRecord;
import com.kms.yxgh.sz.dto.v2.SzRecordDetailV2Dto;
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -21,6 +25,9 @@ import java.util.List;
@Repository @Repository
public interface SzCheckingRecordV2Mapper extends BaseMapper<SzCheckingRecord> { public interface SzCheckingRecordV2Mapper extends BaseMapper<SzCheckingRecord> {
IPage<SzRecordDetailV2Dto> page(Page<SzCheckingRecord> page, @Param("data") SzRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_sz_xsxcjl xm " + "from bs_sgc_sz_xsxcjl xm " +

7
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzCheckingV2Mapper.java

@ -1,9 +1,13 @@
package com.kms.yxgh.sz.mapper; package com.kms.yxgh.sz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.CountDto; import com.kms.yxgh.common.dto.CountDto;
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage; import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage;
import com.kms.yxgh.sz.dto.v2.SzV2CheckingDto;
import com.kms.yxgh.sz.dto.v2.SzV2CheckingSearchDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -19,6 +23,9 @@ import java.util.List;
@Repository @Repository
public interface SzCheckingV2Mapper extends BaseMapper<SzCheckingV2ProjectManage> { public interface SzCheckingV2Mapper extends BaseMapper<SzCheckingV2ProjectManage> {
IPage<SzV2CheckingDto> page(Page<SzCheckingV2ProjectManage> page, @Param("data") SzV2CheckingSearchDto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +
"from bs_sgc_sz_xmgl xm " + "from bs_sgc_sz_xmgl xm " +

3
shuili-system/src/main/java/com/kms/yxgh/sz/mapper/SzYhV2Mapper.java

@ -11,6 +11,7 @@ import com.kms.yxgh.common.dto.ObjectStatisticQueDto;
import com.kms.yxgh.sz.domain.SzYhV2; import com.kms.yxgh.sz.domain.SzYhV2;
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto;
import com.kms.yxgh.sz.dto.v2.SzYhApproveDto; import com.kms.yxgh.sz.dto.v2.SzYhApproveDto;
import com.kms.yxgh.sz.dto.v2.SzYhListV2Dto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -28,6 +29,8 @@ public interface SzYhV2Mapper extends BaseMapper<SzYhV2> {
IPage<ApprovalDetailDto<SzYhApproveDto>> approvalSearchPage(Page<SzRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<SzRecordSearchV2Dto> data); IPage<ApprovalDetailDto<SzYhApproveDto>> approvalSearchPage(Page<SzRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<SzRecordSearchV2Dto> data);
IPage<SzYhListV2Dto> page(Page<SzYhV2> page, @Param("data") SzRecordSearchV2Dto dto);
@Select("<script> " + @Select("<script> " +
"select base.adcd code ,count(1) sum " + "select base.adcd code ,count(1) sum " +

44
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingProblemV2Service.java

@ -50,50 +50,8 @@ public class SzCheckingProblemV2Service extends BaseService<SzCheckingProblemV2M
} }
// 分页参数 // 分页参数
Page<SzCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<SzCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
// 构建查询条件
LambdaQueryWrapper<SzCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<SzCheckingProblemV2>();
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(SzCheckingProblemV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(SzCheckingProblemV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(SzCheckingProblemV2::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(SzCheckingProblemV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(SzCheckingProblemV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(SzCheckingProblemV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(SzCheckingProblemV2::getEndDate, data.getEndDate());
}
Optional.ofNullable(data.getProblemLevel())
.filter(StringUtils::isNotBlank)
.ifPresent(problemLevel -> queryWrapper.eq(SzCheckingProblemV2::getProblemLevel, problemLevel));
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(SzCheckingProblemV2::getProblemLevel, recordId));
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, SzCheckingProblemV2::getWagaCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.ne(SzCheckingProblemV2::getStatus, DURING_INSPECTION.getValue());
queryWrapper.orderByDesc(SzCheckingProblemV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<SzCheckingProblemV2> queryPage = page(page, queryWrapper); IPage<SzProblemV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

46
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingRecordV2Service.java

@ -3,11 +3,9 @@ package com.kms.yxgh.sz.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.df.service.DfCheckingV2Service; import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; import com.kms.yxgh.sz.domain.SzCheckingProblemV2;
import com.kms.yxgh.sz.domain.SzCheckingRecord; import com.kms.yxgh.sz.domain.SzCheckingRecord;
@ -22,11 +20,8 @@ import com.shuili.common.utils.BeanUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -49,51 +44,12 @@ public class SzCheckingRecordV2Service extends BaseService<SzCheckingRecordV2Map
public IPage<SzRecordDetailV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) { public IPage<SzRecordDetailV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<SzCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<SzCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
SzRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<SzCheckingRecord> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(SzCheckingRecord::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(SzCheckingRecord::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(SzCheckingRecord::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(SzCheckingRecord::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(SzCheckingRecord::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(SzCheckingRecord::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(SzCheckingRecord::getEndDate, data.getEndDate());
}
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, SzCheckingRecord::getWagaCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(SzCheckingRecord::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<SzCheckingRecord> queryPage = page(page, queryWrapper); IPage<SzRecordDetailV2Dto> queryPage = this.baseMapper.page(page,sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }
// 转换为 DTO 分页对象
Page<SzRecordDetailV2Dto> dtoPage = new Page<>(); Page<SzRecordDetailV2Dto> dtoPage = new Page<>();
BeanUtils.copyProperties(queryPage, dtoPage); BeanUtils.copyProperties(queryPage, dtoPage);

26
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingV2Service.java

@ -2,12 +2,9 @@ package com.kms.yxgh.sz.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.df.service.DfCheckingV2Service; import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.sz.domain.SzCheckingRecord;
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem; import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem;
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage; import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage;
import com.kms.yxgh.sz.dto.v2.SzCheckingDetailDto; import com.kms.yxgh.sz.dto.v2.SzCheckingDetailDto;
@ -37,29 +34,8 @@ public class SzCheckingV2Service extends BaseService<SzCheckingV2Mapper, SzCheck
public IPage<SzV2CheckingDto> list(SearchParam<SzV2CheckingSearchDto> sp) { public IPage<SzV2CheckingDto> list(SearchParam<SzV2CheckingSearchDto> sp) {
// 分页参数 // 分页参数
Page<SzCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<SzCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize());
SzV2CheckingSearchDto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<SzCheckingV2ProjectManage> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(SzCheckingV2ProjectManage::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(SzCheckingV2ProjectManage::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(SzCheckingV2ProjectManage::getName, name));
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, SzCheckingV2ProjectManage::getWagaCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(SzCheckingV2ProjectManage::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<SzCheckingV2ProjectManage> queryPage = page(page, queryWrapper); IPage<SzV2CheckingDto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

54
shuili-system/src/main/java/com/kms/yxgh/sz/service/SzYhV2Service.java

@ -3,9 +3,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.ApprovalStatusEnum; import com.kms.yxgh.common.ApprovalStatusEnum;
@ -16,11 +13,9 @@ import com.kms.yxgh.common.dto.DocV2Dto;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.common.service.ApprovalService; import com.kms.yxgh.common.service.ApprovalService;
import com.kms.yxgh.common.service.DefaultApprovalBusinessService; import com.kms.yxgh.common.service.DefaultApprovalBusinessService;
import com.kms.yxgh.df.service.AuthorityDikeCodeService;
import com.kms.yxgh.df.service.DfCheckingV2Service; import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; import com.kms.yxgh.sz.domain.SzCheckingProblemV2;
import com.kms.yxgh.sz.domain.SzCheckingRecord; import com.kms.yxgh.sz.domain.SzCheckingRecord;
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage;
import com.kms.yxgh.sz.domain.SzYhV2; import com.kms.yxgh.sz.domain.SzYhV2;
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto;
import com.kms.yxgh.sz.dto.v2.SzYhApproveDto; import com.kms.yxgh.sz.dto.v2.SzYhApproveDto;
@ -35,7 +30,6 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -62,54 +56,8 @@ public class SzYhV2Service extends DefaultApprovalBusinessService<SzYhV2Mapper,
public IPage<SzYhListV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) { public IPage<SzYhListV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) {
// 分页参数 // 分页参数
Page<SzYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); Page<SzYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize());
SzRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<SzYhV2> queryWrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(SzYhV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(SzYhV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(SzYhV2::getName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
.ifPresent(dutyHolder -> queryWrapper.like(SzYhV2::getDutyHolderName, dutyHolder));
Optional.ofNullable(data.getStatus())
.filter(StringUtils::isNotBlank)
.ifPresent(status -> queryWrapper.like(SzYhV2::getStatus, status));
if (!Objects.isNull(data.getStartDate())) {
queryWrapper.ge(SzYhV2::getStartDate, data.getStartDate());
}
if (!Objects.isNull(data.getEndDate())) {
queryWrapper.le(SzYhV2::getEndDate, data.getEndDate());
}
Optional.ofNullable(data.getProblemLevel())
.filter(StringUtils::isNotBlank)
.ifPresent(problemLevel -> queryWrapper.eq(SzYhV2::getProblemLevel, problemLevel));
Optional.ofNullable(data.getRecordId())
.filter(StringUtils::isBlank)
.ifPresent(recordId -> queryWrapper.eq(SzYhV2::getRecordId, recordId));
}
queryWrapper.eq(StringUtils.isNotBlank(AuthorityDikeCodeService.getAuthorityDikeCode())
, SzYhV2::getWagaCode
, AuthorityDikeCodeService.getAuthorityDikeCode());
queryWrapper.orderByDesc(SzYhV2::getCreateTime);
// 查询分页数据 // 查询分页数据
Page<SzYhV2> queryPage = page(page, queryWrapper); IPage<SzYhListV2Dto> queryPage = this.baseMapper.page(page, sp.getData());
if (queryPage == null) { if (queryPage == null) {
return new Page<>(); return new Page<>();
} }

49
shuili-system/src/main/resources/mapper/yxgh/DfCheckingV2Mapper.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.df.mapper.DfCheckingV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.df.dto.v2.DfV2CheckingDto">
<id property="id" column="id"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
<result property="createTime" column="create_time"/>
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
xmgl.id,
xmgl.dike_code ,
xmgl.dike_name ,
xmgl.type,
xmgl.name,
xmgl.create_time,
xmgl.category ,
xmgl.create_uid,
xmgl.create_name
from
bs_sgc_df_xmgl xmgl
left join att_dike_base base on base.dike_code=xmgl.dike_code
where 1=1
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and xmgl.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and xmgl.dike_code = #{data.dikeCode}
</if>
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>
order by xmgl.create_time desc
</select>
</mapper>

85
shuili-system/src/main/resources/mapper/yxgh/DfProblemV2Mapper.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.df.mapper.DfCheckingProblemV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.df.dto.v2.DfProblemV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="recordId" column="record_id"/>
<result property="parts" column="parts"/>
<result property="status" column="status"/>
<result property="checkingName" column="checking_name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="content" column="content"/>
<result property="position" column="position"/>
<result property="problemLevel" column="problem_level"/>
<result property="doc" column="doc"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
qx.id ,
qx.checking_id ,
qx.record_id ,
qx.parts ,
qx.status ,
qx.checking_name ,
qx.type ,
qx.category ,
qx.duty_holder_name ,
qx.duty_holder_id ,
qx.dike_code ,
qx.dike_name ,
qx.start_date ,
qx.end_date ,
qx.content ,
qx.position ,
qx.problem_level ,
qx.doc
from bs_sgc_df_xcqx qx
left join att_dike_base base on base.dike_code=qx.dike_code
where 1=1
and qx.status != '1'
<if test="data.startDate != null">
and qx.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and qx.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and qx.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and qx.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and qx.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and qx.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and qx.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and qx.problem_level = #{data.problemLevel}
</if>
<if test="data.recordId != null and data.recordId != ''">
and qx.record_id = #{data.recordId}
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and qx.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by qx.create_time desc
</select>
</mapper>

68
shuili-system/src/main/resources/mapper/yxgh/DfRecordV2Mapper.xml

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.df.mapper.DfCheckingRecordV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.df.dto.v2.DfRecordDetailV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="checkingName" column="checking_name"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
jl.id ,
jl.checking_id ,
jl.checking_name ,
jl.dike_code ,
jl.dike_name ,
jl.status ,
jl.type ,
jl.category ,
jl.start_date ,
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.create_name
from bs_sgc_df_xsxcjl jl
left join att_dike_base base on base.dike_code=jl.dike_code
where 1=1
<if test="data.startDate != null">
and jl.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and jl.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and jl.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and jl.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and jl.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and jl.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and jl.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by jl.create_time desc
</select>
</mapper>

70
shuili-system/src/main/resources/mapper/yxgh/DfYhV2Mapper.xml

@ -27,8 +27,10 @@
</association> </association>
</resultMap> </resultMap>
<select id="approvalSearchPage" resultMap="approvalMap"> <select id="approvalSearchPage" resultMap="approvalMap">
SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status status, SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc, ts.operator operator, ts.comment comment, ts.doc ts_doc,
jl.id , jl.name ,jl.dike_code , jl.dike_name , jl.type type, jl.category , jl.id , jl.name ,jl.dike_code , jl.dike_name , jl.type type, jl.category ,
jl.problem_level , jl.duty_holder_id , jl.duty_holder_name, jl.problem_id , jl.record_id, jl.status yh_status jl.problem_level , jl.duty_holder_id , jl.duty_holder_name, jl.problem_id , jl.record_id, jl.status yh_status
@ -71,4 +73,70 @@
</select> </select>
<resultMap id="pageMap" type="com.kms.yxgh.df.dto.v2.DfYhListV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="problemId" column="problem_id"/>
<result property="status" column="status"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="startDate" column="start_date"/>
<result property="problemLevel" column="problem_level"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="recordId" column="record_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
yh.id ,
yh.checking_id ,
yh.problem_id ,
yh.status ,
yh.name ,
yh.type ,
yh.category ,
yh.dike_code ,
yh.dike_name ,
yh.start_date ,
yh.problem_level ,
yh.duty_holder_name ,
yh.record_id
from bs_sgc_df_xcyj yh
left join att_dike_base base on base.dike_code=yh.dike_code
where 1=1
<if test="data.startDate != null">
and yh.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and yh.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and yh.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and yh.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and yh.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and yh.type = #{data.type}
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and yh.problem_level = #{data.problemLevel}
</if>
<if test="data.name != null and data.name != ''">
and yh.name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and yh.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by yh.create_time desc
</select>
</mapper> </mapper>

49
shuili-system/src/main/resources/mapper/yxgh/DwCheckingV2Mapper.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.dw.mapper.DwCheckingV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.dw.dto.DwV2CheckingDto">
<id property="id" column="id"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
<result property="createTime" column="create_time"/>
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
xmgl.id,
xmgl.dike_code ,
xmgl.dike_name ,
xmgl.type ,
xmgl.name ,
xmgl.create_time ,
xmgl.category ,
xmgl.create_uid ,
xmgl.create_name
from
bs_sgc_dw_xmgl xmgl
left join att_dike_base base on base.dike_code=xmgl.dike_code
where 1=1
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and xmgl.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and xmgl.dike_code = #{data.dikeCode}
</if>
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>
order by xmgl.create_time desc
</select>
</mapper>

85
shuili-system/src/main/resources/mapper/yxgh/DwProblemV2Mapper.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.dw.mapper.DwCheckingProblemV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.dw.dto.DwProblemV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="recordId" column="record_id"/>
<result property="parts" column="parts"/>
<result property="status" column="status"/>
<result property="checkingName" column="checking_name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="content" column="content"/>
<result property="position" column="position"/>
<result property="problemLevel" column="problem_level"/>
<result property="doc" column="doc"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
qx.id ,
qx.checking_id ,
qx.record_id ,
qx.parts ,
qx.status ,
qx.checking_name ,
qx.type ,
qx.category ,
qx.duty_holder_name ,
qx.duty_holder_id ,
qx.dike_code ,
qx.dike_name ,
qx.start_date ,
qx.end_date ,
qx.content ,
qx.position ,
qx.problem_level ,
qx.doc
from bs_sgc_dw_xcqx qx
left join att_dike_base base on base.dike_code=qx.dike_code
where 1=1
and qx.status != '1'
<if test="data.startDate != null">
and qx.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and qx.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and qx.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and qx.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and qx.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and qx.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and qx.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and qx.problem_level = #{data.problemLevel}
</if>
<if test="data.recordId != null and data.recordId != ''">
and qx.record_id = #{data.recordId}
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and qx.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by qx.create_time desc
</select>
</mapper>

68
shuili-system/src/main/resources/mapper/yxgh/DwRecordV2Mapper.xml

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.dw.mapper.DwCheckingRecordV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.dw.dto.DwRecordDetailV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="checkingName" column="checking_name"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
jl.id ,
jl.checking_id ,
jl.checking_name ,
jl.dike_code ,
jl.dike_name ,
jl.status ,
jl.type ,
jl.category ,
jl.start_date ,
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.create_name
from bs_sgc_dw_xsxcjl jl
left join att_dike_base base on base.dike_code=jl.dike_code
where 1=1
<if test="data.startDate != null">
and jl.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and jl.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and jl.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and jl.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and jl.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and jl.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and jl.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by jl.create_time desc
</select>
</mapper>

69
shuili-system/src/main/resources/mapper/yxgh/DwYhV2Mapper.xml

@ -71,4 +71,73 @@
</select> </select>
<resultMap id="pageMap" type="com.kms.yxgh.dw.dto.DwYhListV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="problemId" column="problem_id"/>
<result property="status" column="status"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="startDate" column="start_date"/>
<result property="problemLevel" column="problem_level"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="recordId" column="record_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
yh.id ,
yh.checking_id ,
yh.problem_id ,
yh.status ,
yh.name ,
yh.type ,
yh.category ,
yh.dike_code ,
yh.dike_name ,
yh.start_date ,
yh.problem_level ,
yh.duty_holder_name ,
yh.record_id
from bs_sgc_dw_xcyj yh
left join att_dike_base base on base.dike_code=yh.dike_code
where 1=1
<if test="data.startDate != null">
and yh.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and yh.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and yh.category = #{data.category}
</if>
<if test="data.dikeCode != null and data.dikeCode != ''">
and yh.dike_code = #{data.dikeCode}
</if>
<if test="data.status != null and data.status != ''">
and yh.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and yh.type = #{data.type}
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and yh.problem_level = #{data.problemLevel}
</if>
<if test="data.name != null and data.name != ''">
and yh.name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and yh.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by yh.create_time desc
</select>
</mapper> </mapper>

49
shuili-system/src/main/resources/mapper/yxgh/SzCheckingV2Mapper.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.sz.mapper.SzCheckingV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.sz.dto.v2.SzV2CheckingDto">
<id property="id" column="id"/>
<result property="wagaCode" column="waga_code"/>
<result property="wagaName" column="waga_name"/>
<result property="type" column="type"/>
<result property="name" column="name"/>
<result property="createTime" column="create_time"/>
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
xmgl.id,
xmgl.waga_code ,
xmgl.waga_name ,
xmgl.type ,
xmgl.name ,
xmgl.create_time ,
xmgl.category ,
xmgl.create_uid ,
xmgl.create_name
from
bs_sgc_sz_xmgl xmgl
left join att_waga_base base on base.waga_code=xmgl.waga_code
where 1=1
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and xmgl.category = #{data.category}
</if>
<if test="data.wagaCode != null and data.wagaCode != ''">
and xmgl.waga_code = #{data.wagaCode}
</if>
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>
order by xmgl.create_time desc
</select>
</mapper>

85
shuili-system/src/main/resources/mapper/yxgh/SzProblemV2Mapper.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.sz.mapper.SzCheckingProblemV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.sz.dto.v2.SzProblemV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="recordId" column="record_id"/>
<result property="parts" column="parts"/>
<result property="status" column="status"/>
<result property="checkingName" column="checking_name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
<result property="wagaCode" column="waga_code"/>
<result property="wagaName" column="waga_name"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="content" column="content"/>
<result property="position" column="position"/>
<result property="problemLevel" column="problem_level"/>
<result property="doc" column="doc"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
qx.id ,
qx.checking_id ,
qx.record_id ,
qx.parts ,
qx.status ,
qx.checking_name ,
qx.type ,
qx.category ,
qx.duty_holder_name ,
qx.duty_holder_id ,
qx.waga_code ,
qx.waga_name ,
qx.start_date ,
qx.end_date ,
qx.content ,
qx.position ,
qx.problem_level ,
qx.doc
from bs_sgc_sz_xcqx qx
left join att_waga_base base on base.waga_code=qx.waga_code
where 1=1
and qx.status != '1'
<if test="data.startDate != null">
and qx.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and qx.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and qx.category = #{data.category}
</if>
<if test="data.wagaCode != null and data.wagaCode != ''">
and qx.waga_code = #{data.wagaCode}
</if>
<if test="data.status != null and data.status != ''">
and qx.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and qx.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and qx.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and qx.problem_level = #{data.problemLevel}
</if>
<if test="data.recordId != null and data.recordId != ''">
and qx.record_id = #{data.recordId}
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and qx.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by qx.create_time desc
</select>
</mapper>

68
shuili-system/src/main/resources/mapper/yxgh/SzYhRecordV2Mapper.xml

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.kms.yxgh.sz.mapper.SzCheckingRecordV2Mapper">
<resultMap id="pageMap" type="com.kms.yxgh.sz.dto.v2.SzRecordDetailV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="checkingName" column="checking_name"/>
<result property="wagaCode" column="waga_code"/>
<result property="wagaName" column="waga_name"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
jl.id ,
jl.checking_id ,
jl.checking_name ,
jl.waga_code ,
jl.waga_name ,
jl.status ,
jl.type ,
jl.category ,
jl.start_date ,
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.create_name
from bs_sgc_sz_xsxcjl jl
left join att_waga_base base on base.waga_code=jl.waga_code
where 1=1
<if test="data.startDate != null">
and jl.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and jl.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and jl.category = #{data.category}
</if>
<if test="data.wagaCode != null and data.wagaCode != ''">
and jl.waga_code = #{data.wagaCode}
</if>
<if test="data.status != null and data.status != ''">
and jl.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>
<if test="data.name != null and data.name != ''">
and jl.checking_name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and jl.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by jl.create_time desc
</select>
</mapper>

67
shuili-system/src/main/resources/mapper/yxgh/SzYhV2Mapper.xml

@ -8,6 +8,8 @@
<result property="submitTime" column="submit_time"/> <result property="submitTime" column="submit_time"/>
<result property="approvalTime" column="approval_time"/> <result property="approvalTime" column="approval_time"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="wagaName" column="waga_name"/>
<result property="wagaCode" column="waga_code"/>
<result property="comment" column="comment"/> <result property="comment" column="comment"/>
<result property="operator" column="operator" typeHandler="com.kms.yxgh.common.mapper.handler.OperatorHandler"/> <result property="operator" column="operator" typeHandler="com.kms.yxgh.common.mapper.handler.OperatorHandler"/>
<result property="doc" column="ts_doc" typeHandler="com.kms.yxgh.common.mapper.handler.DocHandler"/> <result property="doc" column="ts_doc" typeHandler="com.kms.yxgh.common.mapper.handler.DocHandler"/>
@ -71,4 +73,69 @@
</select> </select>
<resultMap id="pageMap" type="com.kms.yxgh.sz.dto.v2.SzYhListV2Dto">
<id property="id" column="id"/>
<result property="checkingId" column="checking_id"/>
<result property="problemId" column="problem_id"/>
<result property="status" column="status"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="category" column="category"/>
<result property="wagaCode" column="waga_code"/>
<result property="wagaName" column="waga_name"/>
<result property="startDate" column="start_date"/>
<result property="problemLevel" column="problem_level"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="recordId" column="record_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
yh.id ,
yh.checking_id ,
yh.problem_id ,
yh.status ,
yh.name ,
yh.type ,
yh.category ,
yh.waga_code ,
yh.waga_name ,
yh.start_date ,
yh.problem_level ,
yh.duty_holder_name ,
yh.record_id
from bs_sgc_sz_xcyj yh
left join att_waga_base base on base.waga_code=yh.waga_code
where 1=1
<if test="data.startDate != null">
and yh.start_date &gt;= #{data.startDate}
</if>
<if test="data.endDate != null">
and yh.end_date &lt;= #{data.endDate}
</if>
<if test="data.adcdQx != null and data.adcdQx != ''">
and base.adcd like concat(#{data.adcdQx}, '%')
</if>
<if test="data.category != null and data.category != ''">
and yh.category = #{data.category}
</if>
<if test="data.wagaCode != null and data.wagaCode != ''">
and yh.waga_code = #{data.wagaCode}
</if>
<if test="data.status != null and data.status != ''">
and yh.status = #{data.status}
</if>
<if test="data.type != null and data.type != ''">
and yh.type = #{data.type}
</if>
<if test="data.problemLevel != null and data.problemLevel != ''">
and yh.problem_level = #{data.problemLevel}
</if>
<if test="data.name != null and data.name != ''">
and yh.name like concat('%',#{data.name}, '%')
</if>
<if test="data.dutyHolder != null and data.dutyHolder != ''">
and yh.duty_holder_name like concat('%',#{data.dutyHolder}, '%')
</if>
order by yh.create_time desc
</select>
</mapper> </mapper>
Loading…
Cancel
Save