Browse Source

add:巡查养护改造

release-sy-v1.0.0
“lyd” 1 week ago
parent
commit
0be7221ed9
  1. 9
      shuili-system/src/main/java/com/kms/common/utils/UserUtils.java
  2. 2
      shuili-system/src/main/java/com/kms/yg/df/service/BsSgcDfSpPlayService.java
  3. 4
      shuili-system/src/main/java/com/kms/yxgh/df/domain/DfCheckingProblemV2.java
  4. 13
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfProReceiveFeedbackV2Dto.java
  5. 4
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfProblemV2Dto.java
  6. 9
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordDetailV2Dto.java
  7. 2
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordSearchV2Dto.java
  8. 1
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfV2CheckingDto.java
  9. 4
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfV2CheckingSearchDto.java
  10. 14
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingRecordV2Service.java
  11. 34
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingV2Service.java
  12. 4
      shuili-system/src/main/java/com/kms/yxgh/dw/domain/DwCheckingProblemV2.java
  13. 13
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwProReceiveFeedbackV2Dto.java
  14. 4
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwProblemV2Dto.java
  15. 13
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwRecordDetailV2Dto.java
  16. 3
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwRecordSearchV2Dto.java
  17. 4
      shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwV2CheckingSearchDto.java
  18. 16
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingRecordV2Service.java
  19. 12
      shuili-system/src/main/java/com/kms/yxgh/dw/service/DwCheckingV2Service.java
  20. 4
      shuili-system/src/main/java/com/kms/yxgh/sz/domain/SzCheckingProblemV2.java
  21. 13
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzProReceiveFeedbackV2Dto.java
  22. 4
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzProblemV2Dto.java
  23. 10
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzRecordDetailV2Dto.java
  24. 3
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzRecordSearchV2Dto.java
  25. 4
      shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzV2CheckingSearchDto.java
  26. 13
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingRecordV2Service.java
  27. 10
      shuili-system/src/main/java/com/kms/yxgh/sz/service/SzCheckingV2Service.java
  28. 16
      shuili-system/src/main/java/com/kms/yxgh/util/StreamUtils.java
  29. 15
      shuili-system/src/main/resources/mapper/yxgh/DfCheckingV2Mapper.xml
  30. 8
      shuili-system/src/main/resources/mapper/yxgh/DfRecordV2Mapper.xml
  31. 15
      shuili-system/src/main/resources/mapper/yxgh/DwCheckingV2Mapper.xml
  32. 8
      shuili-system/src/main/resources/mapper/yxgh/DwRecordV2Mapper.xml
  33. 14
      shuili-system/src/main/resources/mapper/yxgh/SzCheckingV2Mapper.xml
  34. 7
      shuili-system/src/main/resources/mapper/yxgh/SzYhRecordV2Mapper.xml
  35. 66
      sql/sy/v1.6.0/增量脚本/v1.6.3-update.sql

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

@ -20,6 +20,7 @@ import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@ -129,6 +130,14 @@ public class UserUtils {
return null;
}
public static String getUserId () {
SysUser user = getUser();
if (Objects.isNull(user)) {
return null;
}
return user.getId();
}
public static Set<String> getPermissions() {
SysUser user = getUser();
return sysPermissionService.getMenuPermission(user);

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

@ -121,7 +121,7 @@ public class BsSgcDfSpPlayService {
DfSpPlayQueDto dfSpPlayQueDto = new DfSpPlayQueDto();
dfSpPlayQueDto.setCameraId(cameraId);
DfSpPlayDto play = play(dfSpPlayQueDto);
if (null != play) {
if (null != play && null != play.getUrlsMap()) {
dfSpPlayGridDto.getUrlsMapList().add(play.getUrlsMap());
}
} catch (Exception e) {

4
shuili-system/src/main/java/com/kms/yxgh/df/domain/DfCheckingProblemV2.java

@ -32,8 +32,8 @@ public class DfCheckingProblemV2 extends SyBaseEntity {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
@ApiModelProperty("问题等级")
private String problemLevel;

13
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfProReceiveFeedbackV2Dto.java

@ -7,17 +7,20 @@ import lombok.Data;
import java.util.Collections;
import java.util.List;
/**
* @author s2y23
*/
@Data
@ApiModel("团队管理关联信息对象")
public class DfProReceiveFeedbackV2Dto {
@ApiModelProperty("项目下拉")
private List<DfProjectDropDownItemV2Dto> dropDownList = Collections.EMPTY_LIST;
private List<DfProjectDropDownItemV2Dto> dropDownList;
@ApiModelProperty("单位下拉")
private List<DfTeamUnitV2Dto> unitList = Collections.EMPTY_LIST;
private List<DfTeamUnitV2Dto> unitList;
@Data
public class DfProjectDropDownItemV2Dto {
public static class DfProjectDropDownItemV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")
@ -34,10 +37,12 @@ public class DfProReceiveFeedbackV2Dto {
private String category;
@ApiModelProperty("创建者名称")
private String personName;
@ApiModelProperty("创建者id")
private String createUid;
}
@Data
public class DfTeamUnitV2Dto {
public static class DfTeamUnitV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")

4
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfProblemV2Dto.java

@ -17,8 +17,8 @@ public class DfProblemV2Dto {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
/**
* id
*/

9
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordDetailV2Dto.java

@ -19,6 +19,15 @@ import java.util.List;
@ApiModel("堤防巡视检查记录详情v2")
public class DfRecordDetailV2Dto {
@ApiModelProperty("巡检负责单位")
private String responsibleUnit;
@ApiModelProperty("巡检负责单位id")
private String responsibleUnitId;
@ApiModelProperty("巡查责任人")
private String dutyHolderName;
@ApiModelProperty("巡查责任人id")
private String dutyHolderId;
@ApiModelProperty("问题统计数量")
private int problemCount;

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

@ -16,6 +16,8 @@ public class DfRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty(value = "巡查项目id")
private String checkingId;
@ApiModelProperty("堤防名称")
private String dikeName;

1
shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfV2CheckingDto.java

@ -14,6 +14,7 @@ import java.util.List;
@Data
public class DfV2CheckingDto {
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("巡检负责单位")

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

@ -23,6 +23,10 @@ public class DfV2CheckingSearchDto implements IAdcdDeptRole {
private String type;
@ApiModelProperty("巡查类别")
private String category;
@ApiModelProperty(value = "任务名称")
private String taskName;
@ApiModelProperty(value = "堤防名称")
private String dikeName;
public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) {

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

@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.df.domain.DfCheckingProblemV2;
import com.kms.yxgh.df.domain.DfCheckingRecord;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectItem;
import com.kms.yxgh.df.domain.DfYhV2;
import com.kms.yxgh.df.domain.*;
import com.kms.yxgh.df.dto.v2.DfRecordDetailV2Dto;
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto;
import com.kms.yxgh.df.mapper.DfCheckingRecordV2Mapper;
@ -23,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -41,6 +39,9 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
private final DfCheckingProblemV2Service dfCheckingProblemV2Service;
private final DfCheckingV2Service dfCheckingV2Service;
public IPage<DfRecordDetailV2Dto> list(SearchParam<DfRecordSearchV2Dto> sp) {
// 分页参数
Page<DfCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
@ -62,6 +63,11 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
dto.setProblemCount(dfCheckingProblemV2Service
.count(new LambdaQueryWrapper<DfCheckingProblemV2>()
.eq(StringUtils.isNotBlank(record.getId()), DfCheckingProblemV2::getRecordId, record.getId())));
DfCheckingV2ProjectManage manage = dfCheckingV2Service.getOne(new LambdaQueryWrapper<DfCheckingV2ProjectManage>().eq(DfCheckingV2ProjectManage::getId, record.getCheckingId()));
if (!Objects.isNull(manage)) {
dto.setResponsibleUnit(manage.getResponsibleUnit());
dto.setResponsibleUnitId(manage.getResponsibleUnitId());
}
return dto;
})
.collect(Collectors.toList());

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

@ -17,6 +17,7 @@ import com.kms.yxgh.df.dto.v2.DfV2CheckingDto;
import com.kms.yxgh.df.dto.v2.DfV2CheckingSearchDto;
import com.kms.yxgh.df.mapper.DfCheckingV2Mapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.kms.yxgh.util.StreamUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
@ -25,13 +26,9 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
* 项目管理
*
@ -76,6 +73,7 @@ public class DfCheckingV2Service extends BaseService<DfCheckingV2Mapper, DfCheck
if (CollectionUtils.isEmpty(ids)) {
return dtoPage;
}
List<DfCheckingV2ProjectItem> items = dfCheckingV2ProjectItemV2Service.list(
Wrappers.<DfCheckingV2ProjectItem>lambdaQuery()
.in(DfCheckingV2ProjectItem::getCheckingId, ids)
@ -219,34 +217,38 @@ public class DfCheckingV2Service extends BaseService<DfCheckingV2Mapper, DfCheck
public DfProReceiveFeedbackV2Dto projectReceiveFeedback() {
DfProReceiveFeedbackV2Dto receiveV2Dto = new DfProReceiveFeedbackV2Dto();
SysUser user = UserUtils.getUser();
if (Objects.isNull(UserUtils.getUser())) {
String userId = UserUtils.getUserId();
if (null == userId) {
return receiveV2Dto;
}
String userId = user.getId();
List<BsSgcDfManateam> list = bsSgcDfManateamService.list(new LambdaQueryWrapper<BsSgcDfManateam>()
.apply(" distinct dike_code ")
.eq(BsSgcDfManateam::getCreateUid, userId));
.eq(BsSgcDfManateam::getCreateUid, userId)
);
list = StreamUtils.distinctByKeyFast(list, BsSgcDfManateam::getDikeCode);
if (CollectionUtils.isEmpty(list)) {
return receiveV2Dto;
}
receiveV2Dto.setUnitList(BeanCopyUtils.copyList(list, DfProReceiveFeedbackV2Dto.DfTeamUnitV2Dto.class));
List<DfCheckingV2ProjectManage> manageList =
this.baseMapper.selectList(new LambdaQueryWrapper<DfCheckingV2ProjectManage>()
.apply(" distinct dike_code ")
.in(DfCheckingV2ProjectManage::getDikeCode, list.stream()
.map(BsSgcDfManateam::getDikeCode)
.collect(Collectors.toList())));
.in(DfCheckingV2ProjectManage::getDikeCode, list.stream()
.map(BsSgcDfManateam::getDikeCode)
.collect(Collectors.toList()))
);
manageList = StreamUtils.distinctByKeyFast(manageList, DfCheckingV2ProjectManage::getDikeCode);
Map<String, String> personNameList = list.stream()
.collect(Collectors.toMap(BsSgcDfManateam::getDikeCode, BsSgcDfManateam::getPersonName));
receiveV2Dto.setDropDownList(manageList.stream().map(e -> {
DfProReceiveFeedbackV2Dto.DfProjectDropDownItemV2Dto copy =
BeanCopyUtils.copy(e, DfProReceiveFeedbackV2Dto.DfProjectDropDownItemV2Dto.class);
copy.setPersonName(personNameList.getOrDefault(copy.getDikeCode(), StringUtils.EMPTY));
if (!Objects.isNull(copy)) {
copy.setPersonName(personNameList.getOrDefault(copy.getDikeCode(), StringUtils.EMPTY));
}
return copy;
}).collect(Collectors.toList()));
return receiveV2Dto;
}
}

4
shuili-system/src/main/java/com/kms/yxgh/dw/domain/DwCheckingProblemV2.java

@ -27,8 +27,8 @@ public class DwCheckingProblemV2 extends SyBaseEntity {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
/**
* 问题位置

13
shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwProReceiveFeedbackV2Dto.java

@ -7,17 +7,20 @@ import lombok.Data;
import java.util.Collections;
import java.util.List;
/**
* @author s2y23
*/
@Data
@ApiModel("团队管理关联信息对象")
public class DwProReceiveFeedbackV2Dto {
@ApiModelProperty("项目下拉")
private List<DwProjectDropDownItemV2Dto> dropDownList = Collections.EMPTY_LIST;
private List<DwProjectDropDownItemV2Dto> dropDownList ;
@ApiModelProperty("单位下拉")
private List<DwTeamUnitV2Dto> unitList = Collections.EMPTY_LIST;
private List<DwTeamUnitV2Dto> unitList;
@Data
public class DwProjectDropDownItemV2Dto {
public static class DwProjectDropDownItemV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")
@ -34,10 +37,12 @@ public class DwProReceiveFeedbackV2Dto {
private String category;
@ApiModelProperty("创建者名称")
private String personName;
@ApiModelProperty("创建者id")
private String createUid;
}
@Data
public class DwTeamUnitV2Dto {
public static class DwTeamUnitV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")

4
shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwProblemV2Dto.java

@ -17,8 +17,8 @@ public class DwProblemV2Dto {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
@ApiModelProperty("工程编码")
private String dikeCode;

13
shuili-system/src/main/java/com/kms/yxgh/dw/dto/DwRecordDetailV2Dto.java

@ -14,10 +14,23 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
* @author s2y23
*/
@Data
@ApiModel("堤防巡视检查记录详情v2")
public class DwRecordDetailV2Dto {
@ApiModelProperty("巡查责任人")
private String dutyHolderName;
@ApiModelProperty("巡查责任人id")
private String dutyHolderId;
@ApiModelProperty("巡检负责单位")
private String responsibleUnit;
@ApiModelProperty("巡检负责单位id")
private String responsibleUnitId;
@ApiModelProperty("问题统计数量")
private int problemCount;

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

@ -13,7 +13,8 @@ import java.util.Date;
@Data
@ApiModel("工程巡视检查记录检索条件v2")
public class DwRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty("项目id")
private String checkingId;
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;

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

@ -19,6 +19,10 @@ public class DwV2CheckingSearchDto implements IAdcdDeptRole {
private String type;
@ApiModelProperty("巡查类别")
private String category;
@ApiModelProperty(value = "任务名称")
private String taskName;
@ApiModelProperty(value = "堤防名称")
private String dikeName;
public String getDikeCode() {
if (StringUtils.isEmpty(this.dikeCode)) {

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

@ -7,10 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.dw.domain.DwCheckingProblemV2;
import com.kms.yxgh.dw.domain.DwCheckingRecord;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectItem;
import com.kms.yxgh.dw.domain.DwYhV2;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.dw.domain.*;
import com.kms.yxgh.dw.dto.DwRecordDetailV2Dto;
import com.kms.yxgh.dw.dto.DwRecordSearchV2Dto;
import com.kms.yxgh.dw.enums.DwYhV2StatusEnum;
@ -24,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -43,6 +42,10 @@ public class DwCheckingRecordV2Service extends BaseService<DwCheckingRecordV2Map
private final DwCheckingProblemV2Service dwCheckingProblemV2Service;
private final DwCheckingV2Service dwCheckingV2Service;
public IPage<DwRecordDetailV2Dto> list(SearchParam<DwRecordSearchV2Dto> sp) {
// 分页参数
Page<DwCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize());
@ -64,6 +67,11 @@ public class DwCheckingRecordV2Service extends BaseService<DwCheckingRecordV2Map
dto.setProblemCount(dwCheckingProblemV2Service
.count(new LambdaQueryWrapper<DwCheckingProblemV2>()
.eq(StringUtils.isNotBlank(record.getId()), DwCheckingProblemV2::getRecordId, record.getId())));
DwCheckingV2ProjectManage manage = dwCheckingV2Service.getOne(new LambdaQueryWrapper<DwCheckingV2ProjectManage>().eq(DwCheckingV2ProjectManage::getId, record.getCheckingId()));
if (!Objects.isNull(manage)) {
dto.setResponsibleUnit(manage.getResponsibleUnit());
dto.setResponsibleUnitId(manage.getResponsibleUnitId());
}
return dto;
})
.collect(Collectors.toList());

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

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.common.utils.UserUtils;
import com.kms.yg.df.domain.BsSgcDfManateam;
import com.kms.yg.df.service.BsSgcDfManateamService;
import com.kms.yxgh.df.domain.DfCheckingV2ProjectManage;
import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectItem;
import com.kms.yxgh.dw.domain.DwCheckingV2ProjectManage;
@ -17,6 +18,7 @@ import com.kms.yxgh.dw.dto.DwV2CheckingDto;
import com.kms.yxgh.dw.dto.DwV2CheckingSearchDto;
import com.kms.yxgh.dw.mapper.DwCheckingV2Mapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.kms.yxgh.util.StreamUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
@ -26,11 +28,7 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -234,8 +232,8 @@ public class DwCheckingV2Service extends BaseService<DwCheckingV2Mapper, DwCheck
}
String userId = user.getId();
List<BsSgcDfManateam> list = bsSgcDfManateamService.list(new LambdaQueryWrapper<BsSgcDfManateam>()
.apply(" distinct dike_code ")
.eq(BsSgcDfManateam::getCreateUid, userId));
list = StreamUtils.distinctByKeyFast(list, BsSgcDfManateam::getDikeCode);
if (CollectionUtils.isEmpty(list)) {
return receiveV2Dto;
}
@ -246,11 +244,13 @@ public class DwCheckingV2Service extends BaseService<DwCheckingV2Mapper, DwCheck
.in(DwCheckingV2ProjectManage::getDikeCode, list.stream()
.map(BsSgcDfManateam::getDikeCode)
.collect(Collectors.toList())));
manageList = StreamUtils.distinctByKeyFast(manageList, DwCheckingV2ProjectManage::getDikeCode);
Map<String, String> personNameList = list.stream()
.collect(Collectors.toMap(BsSgcDfManateam::getDikeCode, BsSgcDfManateam::getPersonName));
receiveV2Dto.setDropDownList(manageList.stream().map(e -> {
DwProReceiveFeedbackV2Dto.DwProjectDropDownItemV2Dto copy =
BeanCopyUtils.copy(e, DwProReceiveFeedbackV2Dto.DwProjectDropDownItemV2Dto.class);
assert copy != null;
copy.setPersonName(personNameList.getOrDefault(copy.getDikeCode(), com.baomidou.mybatisplus.core.toolkit.StringUtils.EMPTY));
return copy;
}).collect(Collectors.toList()));

4
shuili-system/src/main/java/com/kms/yxgh/sz/domain/SzCheckingProblemV2.java

@ -26,8 +26,8 @@ public class SzCheckingProblemV2 extends SyBaseEntity {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
/**
* 问题位置

13
shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzProReceiveFeedbackV2Dto.java

@ -7,17 +7,20 @@ import lombok.Data;
import java.util.Collections;
import java.util.List;
/**
* @author s2y23
*/
@Data
@ApiModel("团队管理关联信息对象")
public class SzProReceiveFeedbackV2Dto {
@ApiModelProperty("项目下拉")
private List<SzProjectDropDownItemV2Dto> dropDownList = Collections.EMPTY_LIST;
private List<SzProjectDropDownItemV2Dto> dropDownList;
@ApiModelProperty("单位下拉")
private List<SzTeamUnitV2Dto> unitList = Collections.EMPTY_LIST;
private List<SzTeamUnitV2Dto> unitList ;
@Data
public class SzProjectDropDownItemV2Dto {
public static class SzProjectDropDownItemV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")
@ -34,10 +37,12 @@ public class SzProReceiveFeedbackV2Dto {
private String category;
@ApiModelProperty("创建者名称")
private String personName;
@ApiModelProperty("创建者id")
private String createUid;
}
@Data
public class SzTeamUnitV2Dto {
public static class SzTeamUnitV2Dto {
@ApiModelProperty("堤防代码")
private String id;
@ApiModelProperty("项目名称")

4
shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzProblemV2Dto.java

@ -17,8 +17,8 @@ public class SzProblemV2Dto {
@ApiModelProperty("工程损坏单位数值")
private String damageUnit;
@ApiModelProperty("工程损坏单位id")
private String damageUnitId;
@ApiModelProperty("工程损坏单位")
private String damageValue;
/**
* 是否可以领单 1是 0否

10
shuili-system/src/main/java/com/kms/yxgh/sz/dto/v2/SzRecordDetailV2Dto.java

@ -18,6 +18,16 @@ import java.util.List;
@ApiModel("水闸巡视检查记录详情v2")
public class SzRecordDetailV2Dto {
@ApiModelProperty("巡查责任人")
private String dutyHolderName;
@ApiModelProperty("巡查责任人id")
private String dutyHolderId;
@ApiModelProperty("巡检负责单位")
private String responsibleUnit;
@ApiModelProperty("巡检负责单位id")
private String responsibleUnitId;
@ApiModelProperty("问题统计数量")
private int problemCount;
@ApiModelProperty("文档")

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

@ -16,7 +16,8 @@ public class SzRecordSearchV2Dto implements IAdcdDeptRole {
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty("项目id")
private String checkingId;
@ApiModelProperty("水闸名称")
private String wagaName;
@ApiModelProperty("水闸类型")

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

@ -19,6 +19,10 @@ public class SzV2CheckingSearchDto implements IAdcdDeptRole {
private String category;
@ApiModelProperty(value = "行政区划")
private String adcd;
@ApiModelProperty(value = "任务名称")
private String taskName;
@ApiModelProperty(value = "水闸名称")
private String wagaName;
public String getDikeCode() {
if (StringUtils.isEmpty(this.wagaCode)) {

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

@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.df.service.DfCheckingV2Service;
import com.kms.yxgh.sz.domain.SzCheckingProblemV2;
import com.kms.yxgh.sz.domain.SzCheckingRecord;
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem;
import com.kms.yxgh.sz.domain.SzYhV2;
import com.kms.yxgh.sz.domain.*;
import com.kms.yxgh.sz.dto.v2.SzRecordDetailV2Dto;
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto;
import com.kms.yxgh.sz.mapper.SzCheckingRecordV2Mapper;
@ -23,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -37,6 +35,7 @@ public class SzCheckingRecordV2Service extends BaseService<SzCheckingRecordV2Map
private final SzYhV2Service szYhV2Service;
private final SzCheckingV2Service szCheckingV2Service;
private final SzCheckingV2ProjectItemV2Service szCheckingV2ProjectItemV2Service;
@ -62,6 +61,12 @@ public class SzCheckingRecordV2Service extends BaseService<SzCheckingRecordV2Map
dto.setProblemCount(szCheckingProblemV2Service
.count(new LambdaQueryWrapper<SzCheckingProblemV2>()
.eq(StringUtils.isNotBlank(record.getId()), SzCheckingProblemV2::getRecordId, record.getId())));
SzCheckingV2ProjectManage manage = szCheckingV2Service.getOne(new LambdaQueryWrapper<SzCheckingV2ProjectManage>().eq(SzCheckingV2ProjectManage::getId, record.getCheckingId()));
if (!Objects.isNull(manage)) {
dto.setResponsibleUnit(manage.getResponsibleUnit());
dto.setResponsibleUnitId(manage.getResponsibleUnitId());
}
return dto;
})
.collect(Collectors.toList());

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

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kms.common.utils.UserUtils;
import com.kms.yg.df.domain.BsSgcDfManateam;
import com.kms.yg.sz.domain.BsSgcSzManateam;
import com.kms.yg.sz.service.BsSgcSzManateamService;
import com.kms.yxgh.df.service.DfCheckingV2Service;
@ -17,6 +18,7 @@ import com.kms.yxgh.sz.dto.v2.SzV2CheckingDto;
import com.kms.yxgh.sz.dto.v2.SzV2CheckingSearchDto;
import com.kms.yxgh.sz.mapper.SzCheckingV2Mapper;
import com.kms.yxgh.util.BeanCopyUtils;
import com.kms.yxgh.util.StreamUtils;
import com.shuili.common.core.domain.SearchParam;
import com.shuili.common.core.domain.entity.SysUser;
import com.shuili.common.core.service.BaseService;
@ -227,24 +229,26 @@ public class SzCheckingV2Service extends BaseService<SzCheckingV2Mapper, SzCheck
}
String userId = user.getId();
List<BsSgcSzManateam> list = bsSgcSzManateamService.list(new LambdaQueryWrapper<BsSgcSzManateam>()
.apply(" distinct dike_code ")
.eq(BsSgcSzManateam::getCreateUid, userId));
list = StreamUtils.distinctByKeyFast(list, BsSgcSzManateam::getWagaCode);
if (CollectionUtils.isEmpty(list)) {
return receiveV2Dto;
}
receiveV2Dto.setUnitList(BeanCopyUtils.copyList(list, SzProReceiveFeedbackV2Dto.SzTeamUnitV2Dto.class));
List<SzCheckingV2ProjectManage> manageList =
this.baseMapper.selectList(new LambdaQueryWrapper<SzCheckingV2ProjectManage>()
.apply(" distinct waga_code ")
.in(SzCheckingV2ProjectManage::getWagaCode, list.stream()
.map(BsSgcSzManateam::getWagaCode)
.collect(Collectors.toList())));
manageList = StreamUtils.distinctByKeyFast(manageList, SzCheckingV2ProjectManage::getWagaCode);
Map<String, String> personNameList = list.stream()
.collect(Collectors.toMap(BsSgcSzManateam::getWagaCode, BsSgcSzManateam::getPersonName));
receiveV2Dto.setDropDownList(manageList.stream().map(e -> {
SzProReceiveFeedbackV2Dto.SzProjectDropDownItemV2Dto copy =
BeanCopyUtils.copy(e, SzProReceiveFeedbackV2Dto.SzProjectDropDownItemV2Dto.class);
copy.setPersonName(personNameList.getOrDefault(copy.getWagaCode(), StringUtils.EMPTY));
if (!Objects.isNull(copy)) {
copy.setPersonName(personNameList.getOrDefault(copy.getWagaCode(), StringUtils.EMPTY));
}
return copy;
}).collect(Collectors.toList()));
return receiveV2Dto;

16
shuili-system/src/main/java/com/kms/yxgh/util/StreamUtils.java

@ -7,6 +7,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
@ -20,6 +21,21 @@ import java.util.stream.Collectors;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class StreamUtils {
/**
* 高性能去重基于ConcurrentHashMap
*/
public static <T, R> List<T> distinctByKeyFast(List<T> list, Function<T, R> keyExtractor) {
return list.stream()
.filter(new Predicate<T>() {
final Set<R> seen = ConcurrentHashMap.newKeySet();
@Override
public boolean test(T t) {
return seen.add(keyExtractor.apply(t));
}
})
.collect(Collectors.toList());
}
/**
* 将collection过滤
*

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

@ -12,6 +12,11 @@
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="cycle" column="create_name"/>
<result property="responsibleUnit" column="responsible_unit"/>
<result property="responsibleUnitId" column="responsible_unit_id"/>
<result property="taskName" column="task_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -23,6 +28,10 @@
xmgl.create_time,
xmgl.category ,
xmgl.create_uid,
xmgl.cycle,
xmgl.responsible_unit,
xmgl.responsible_unit_id,
xmgl.task_name,
xmgl.create_name
from
bs_sgc_df_xmgl xmgl
@ -40,6 +49,12 @@
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.taskName != null and data.taskName != ''">
and xmgl.task_name = #{data.taskName}
</if>
<if test="data.dikeName != null and data.dikeName != ''">
and xmgl.dike_name = #{data.dikeName}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>

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

@ -16,6 +16,9 @@
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -31,6 +34,8 @@
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.duty_holder_name,
jl.duty_holder_id,
jl.create_name
from bs_sgc_df_xsxcjl jl
left join att_dike_base base on base.dike_code=jl.dike_code
@ -53,6 +58,9 @@
<if test="data.status != null and data.status != ''">
and jl.status = #{data.status}
</if>
<if test="data.checkingId != null and data.checkingId != ''">
and jl.checking_id = #{data.checkingId}
</if>
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>

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

@ -12,6 +12,11 @@
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="cycle" column="create_name"/>
<result property="responsibleUnit" column="responsible_unit"/>
<result property="responsibleUnitId" column="responsible_unit_id"/>
<result property="taskName" column="task_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -23,6 +28,10 @@
xmgl.create_time ,
xmgl.category ,
xmgl.create_uid ,
xmgl.cycle,
xmgl.responsible_unit,
xmgl.responsible_unit_id,
xmgl.task_name,
xmgl.create_name
from
bs_sgc_dw_xmgl xmgl
@ -40,6 +49,12 @@
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.taskName != null and data.taskName != ''">
and xmgl.task_name = #{data.taskName}
</if>
<if test="data.dikeName != null and data.dikeName != ''">
and xmgl.dike_name = #{data.dikeName}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>

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

@ -16,6 +16,9 @@
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -31,6 +34,8 @@
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.duty_holder_name,
jl.duty_holder_id,
jl.create_name
from bs_sgc_dw_xsxcjl jl
left join att_dike_base base on base.dike_code=jl.dike_code
@ -56,6 +61,9 @@
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>
<if test="data.checkingId != null and data.checkingId != ''">
and jl.checking_id = #{data.checkingId}
</if>
<if test="data.name != null and data.name != ''">
and jl.checking_name like concat('%',#{data.name}, '%')
</if>

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

@ -12,6 +12,10 @@
<result property="category" column="category"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="cycle" column="create_name"/>
<result property="responsibleUnit" column="responsible_unit"/>
<result property="responsibleUnitId" column="responsible_unit_id"/>
<result property="taskName" column="task_name"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -23,6 +27,10 @@
xmgl.create_time ,
xmgl.category ,
xmgl.create_uid ,
xmgl.cycle,
xmgl.responsible_unit,
xmgl.responsible_unit_id,
xmgl.task_name,
xmgl.create_name
from
bs_sgc_sz_xmgl xmgl
@ -40,6 +48,12 @@
<if test="data.type != null and data.type != ''">
and xmgl.type = #{data.type}
</if>
<if test="data.taskName != null and data.taskName != ''">
and xmgl.task_name = #{data.taskName}
</if>
<if test="data.wagaName != null and data.wagaName != ''">
and xmgl.waga_name = #{data.wagaName}
</if>
<if test="data.name != null and data.name != ''">
and xmgl.name like concat('%',#{data.name}, '%')
</if>

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

@ -16,6 +16,8 @@
<result property="scope" column="scope"/>
<result property="createUid" column="create_uid"/>
<result property="createName" column="create_name"/>
<result property="dutyHolderName" column="duty_holder_name"/>
<result property="dutyHolderId" column="duty_holder_id"/>
</resultMap>
<select id="page" resultMap="pageMap">
select
@ -31,6 +33,8 @@
jl.end_date ,
jl.scope ,
jl.create_uid ,
jl.duty_holder_name,
jl.duty_holder_id,
jl.create_name
from bs_sgc_sz_xsxcjl jl
left join att_waga_base base on base.waga_code=jl.waga_code
@ -53,6 +57,9 @@
<if test="data.status != null and data.status != ''">
and jl.status = #{data.status}
</if>
<if test="data.checkingId != null and data.checkingId != ''">
and jl.checking_id = #{data.checkingId}
</if>
<if test="data.type != null and data.type != ''">
and jl.type = #{data.type}
</if>

66
sql/sy/v1.6.0/增量脚本/v1.6.3-update.sql

@ -0,0 +1,66 @@
-- 堤防项目管理表新增
-- 任务名称
alter table bs_sgc_df_xmgl add column task_name varchar(50) not null default '' COMMENT '任务名称';
-- 巡检负责单位
alter table bs_sgc_df_xmgl add column responsible_unit varchar(50) not null default '' COMMENT '巡检负责单位';
alter table bs_sgc_df_xmgl add column responsible_unit_id varchar(50) NOT NULL DEFAULT '' COMMENT '巡检负责单位id';
-- 巡查周期
alter table bs_sgc_df_xmgl add column cycle int NOT NULL DEFAULT '0' COMMENT '巡查周期 字典 patrol_maintenance_cycle';
-- 任务时间
alter table bs_sgc_df_xmgl add column `start_date` datetime DEFAULT NULL COMMENT '巡查开始时间';
alter table bs_sgc_df_xmgl add column `end_date` datetime DEFAULT NULL COMMENT '巡查结束时间';
-- 任务范围
alter table bs_sgc_df_xmgl add column scope varchar(50) NOT NULL DEFAULT '' COMMENT '巡查范围';
-- 项目创始人
alter table bs_sgc_df_xmgl add column pro_founding_person varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人';
alter table bs_sgc_df_xmgl add column pro_founding_person_id varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人id';
-- 水闸项目管理表新增
-- 任务名称
alter table bs_sgc_sz_xmgl add column task_name varchar(50) not null default '' COMMENT '任务名称';
-- 巡检负责单位
alter table bs_sgc_sz_xmgl add column responsible_unit varchar(50) not null default '' COMMENT '巡检负责单位';
alter table bs_sgc_sz_xmgl add column responsible_unit_id int NOT NULL DEFAULT '0' COMMENT '巡检负责单位id';
-- 巡查周期
alter table bs_sgc_sz_xmgl add column cycle int NOT NULL DEFAULT '0' COMMENT '巡查周期 字典 patrol_maintenance_cycle';
-- 任务时间
alter table bs_sgc_sz_xmgl add column `start_date` datetime DEFAULT NULL COMMENT '巡查开始时间';
alter table bs_sgc_sz_xmgl add column `end_date` datetime DEFAULT NULL COMMENT '巡查结束时间';
-- 任务范围
alter table bs_sgc_sz_xmgl add column scope varchar(50) NOT NULL DEFAULT '' COMMENT '巡查范围';
-- 项目创始人
alter table bs_sgc_sz_xmgl add column pro_founding_person varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人';
alter table bs_sgc_sz_xmgl add column pro_founding_person_id varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人id';
-- 动物项目管理表新增
-- 任务名称
alter table bs_sgc_dw_xmgl add column task_name varchar(50) not null default '' COMMENT '任务名称';
-- 巡检负责单位
alter table bs_sgc_dw_xmgl add column responsible_unit varchar(50) not null default '' COMMENT '巡检负责单位';
alter table bs_sgc_dw_xmgl add column responsible_unit_id int NOT NULL DEFAULT '0' COMMENT '巡检负责单位id';
-- 巡查周期
alter table bs_sgc_dw_xmgl add column cycle int NOT NULL DEFAULT '0' COMMENT '巡查周期 字典 patrol_maintenance_cycle';
-- 任务时间
alter table bs_sgc_dw_xmgl add column `start_date` datetime DEFAULT NULL COMMENT '巡查开始时间';
alter table bs_sgc_dw_xmgl add column `end_date` datetime DEFAULT NULL COMMENT '巡查结束时间';
-- 任务范围
alter table bs_sgc_dw_xmgl add column scope varchar(50) NOT NULL DEFAULT '' COMMENT '巡查范围';
-- 项目创始人
alter table bs_sgc_dw_xmgl add column pro_founding_person varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人';
alter table bs_sgc_dw_xmgl add column pro_founding_person_id varchar(50) NOT NULL DEFAULT '' COMMENT '项目创始人id';
-- 堤防缺陷列表
alter table bs_sgc_df_xcqx add column damage_unit int NOT NULL DEFAULT '0' COMMENT '工程损坏单位 字典patrol_maintenance_damage_unit';
alter table bs_sgc_df_xcqx add column damage_value int NOT NULL DEFAULT '0' COMMENT '工程损坏数值';
-- 水闸缺陷列表
alter table bs_sgc_sz_xcqx add column damage_unit int NOT NULL DEFAULT '0' COMMENT '工程损坏单位 字典patrol_maintenance_damage_unit';
alter table bs_sgc_sz_xcqx add column damage_value int NOT NULL DEFAULT '0' COMMENT '工程损坏数值';
-- 动物缺陷列表
alter table bs_sgc_dw_xcqx add column damage_unit int NOT NULL DEFAULT '0' COMMENT '工程损坏单位 字典patrol_maintenance_damage_unit';
alter table bs_sgc_dw_xcqx add column damage_value int NOT NULL DEFAULT '0' COMMENT '工程损坏数值';
select * from bs_sgc_df_manateam
select * from bs_sgc_df_xsxcjl
Loading…
Cancel
Save