Browse Source

add:提防v2

release-sy-tdsql
“lyd” 1 month ago
parent
commit
7f026ad0da
  1. 2
      shuili-system/src/main/java/com/kms/yxgh/common/dto/DocV2Dto.java
  2. 10
      shuili-system/src/main/java/com/kms/yxgh/common/enums/ProjectCharEnum.java
  3. 15
      shuili-system/src/main/java/com/kms/yxgh/df/domain/DfCheckingProblemV2.java
  4. 2
      shuili-system/src/main/java/com/kms/yxgh/df/domain/DfCheckingRecord.java
  5. 10
      shuili-system/src/main/java/com/kms/yxgh/df/domain/DfYhV2.java
  6. 33
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfProblemV2Dto.java
  7. 12
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordDetailV2Dto.java
  8. 7
      shuili-system/src/main/java/com/kms/yxgh/df/dto/v2/DfRecordSearchV2Dto.java
  9. 6
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingProblemV2Service.java
  10. 58
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingRecordV2Service.java
  11. 8
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfCheckingV2Service.java
  12. 2
      shuili-system/src/main/java/com/kms/yxgh/df/service/DfYhV2Service.java
  13. 10
      sql/zj/v5.0.0/增量更新/v1.sql

2
shuili-system/src/main/java/com/kms/yxgh/common/dto/DocV2Dto.java

@ -20,7 +20,7 @@ public class DocV2Dto {
private List<Item> docs = Collections.emptyList();
@Data
private static class Item {
public static class Item {
private String name;
private String url;
}

10
shuili-system/src/main/java/com/kms/yxgh/common/enums/ProjectCharEnum.java

@ -13,12 +13,20 @@ import java.util.stream.Stream;
@Getter
public enum ProjectCharEnum {
C_14("缺陷养护对比分析", Arrays.asList(StaticIndexEnum.DF_YH_SUM, StaticIndexEnum.DF_QX_SUM), "问题个数", Collections.emptyList()),
C_14("缺陷记录分析", Arrays.asList(StaticIndexEnum.DF_YH_SUM, StaticIndexEnum.DF_QX_SUM), "数量", Collections.emptyList()),
C_15("巡查缺陷分析", Arrays.asList(StaticIndexEnum.DF_YH_SUM, StaticIndexEnum.DF_QX_SUM), "数量", Collections.emptyList()),
C_16("缺陷问题等级分析", Arrays.asList(StaticIndexEnum.DF_YH_SUM, StaticIndexEnum.DF_QX_SUM), "数量", Collections.emptyList()),
C_17("缺陷养护对比分析", Arrays.asList(StaticIndexEnum.DF_YH_SUM, StaticIndexEnum.DF_QX_SUM), "数量", Collections.emptyList()),
C_1("工程分布", Collections.singletonList(StaticIndexEnum.DF_PROJECT_ADCD_SUM), "数量", Collections.emptyList()),
C_2("巡查分析", Arrays.asList(StaticIndexEnum.DF_CHECKING_ADCD_SUM, StaticIndexEnum.DF_JD_ADCD_SUM), "数量", Collections.emptyList()),
C_3("缺陷和养护对比", Arrays.asList(StaticIndexEnum.DF_QX_ADCD_SUM, StaticIndexEnum.DF_YH_ADCD_SUM), "数量", Collections.emptyList()),
;
private final String title;
private final List<StaticIndexEnum> leftElements;
private final String leftName;

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

@ -21,6 +21,11 @@ public class DfCheckingProblemV2 extends SyBaseEntity {
private static final long serialVersionUID = 1L;
/**
* 问题位置
*/
@ApiModelProperty("部位")
private String parts;
@ApiModelProperty("问题等级")
@ -49,10 +54,10 @@ public class DfCheckingProblemV2 extends SyBaseEntity {
/**
* name
* 巡查项目名称
*/
@ApiModelProperty("name")
private String name;
@ApiModelProperty("巡查项目名称")
private String checkingName;
@ -110,13 +115,11 @@ public class DfCheckingProblemV2 extends SyBaseEntity {
private Date endDate;
/**
* 描述
*/
@ApiModelProperty("描述")
private String describe;
private String depict;
/**

2
shuili-system/src/main/java/com/kms/yxgh/df/domain/DfCheckingRecord.java

@ -69,7 +69,7 @@ public class DfCheckingRecord extends SyBaseEntity {
* 项目名称
*/
@ApiModelProperty("项目名称")
private String name;
private String checkingName;
/**
* 巡查类型 字典patrol_maintenance_type

10
shuili-system/src/main/java/com/kms/yxgh/df/domain/DfYhV2.java

@ -25,7 +25,7 @@ public class DfYhV2 extends SyBaseEntity {
* 巡查项目id
*/
@ApiModelProperty("巡查项目id")
private String projectId;
private String checkingId;
/**
* 缺陷id
*/
@ -54,7 +54,7 @@ public class DfYhV2 extends SyBaseEntity {
* 描述
*/
@ApiModelProperty("描述")
private String details;
private String depict;
/**
@ -121,12 +121,6 @@ public class DfYhV2 extends SyBaseEntity {
@ApiModelProperty("维养结束时间")
private Date endDate;
/**
* 描述
*/
@ApiModelProperty("描述")
private String describe;
/**
* 问题位置

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

@ -3,6 +3,7 @@ package com.kms.yxgh.df.dto.v2;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kms.yxgh.base.AddGroup;
import com.kms.yxgh.base.UpdateGroup;
import com.kms.yxgh.common.dto.DocV2Dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -14,9 +15,41 @@ import java.util.Date;
@ApiModel("堤防巡查问题v2")
public class DfProblemV2Dto {
/**
* id
*/
@ApiModelProperty("id")
private String id;
/**
* 问题位置
*/
@ApiModelProperty("问题位置")
private String position;
/**
* 文档
*/
@ApiModelProperty("文档")
private String doc;
/**
* 问题位置
*/
@ApiModelProperty("部位")
private String parts;
@ApiModelProperty("问题等级")
private String problemLevel;
@ApiModelProperty("问题Id")
private String problemId;
@ApiModelProperty("描述")
private String depict;
@ApiModelProperty("巡查项目ID")
private String checkingId;

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

@ -74,6 +74,10 @@ public class DfRecordDetailV2Dto {
@ApiModelProperty("创建者名称")
private String createName;
@ApiModelProperty("描述")
private String depict;
@ApiModelProperty("巡查详情")
private List<DfRecordItemDetailV2Dto> problems = Collections.emptyList();
@ -85,7 +89,7 @@ public class DfRecordDetailV2Dto {
private String id;
@ApiModelProperty("检查部位")
private List<String> parts;
private List<String> parts=Collections.emptyList();;
@ApiModelProperty("位置")
private String position;
@ -94,20 +98,20 @@ public class DfRecordDetailV2Dto {
private String content;
@ApiModelProperty("描述")
private String describe;
private String depict;
@ApiModelProperty("问题等级")
private String problemLevel;
@ApiModelProperty("状态")
private String status;
//
@ApiModelProperty("问题图片")
private List<String> problemImages = Collections.emptyList();
}
@ApiModelProperty("检查项")
private List<DfCheckingDetailDto.DfCheckingItemDto> items;
private List<DfCheckingDetailDto.DfCheckingItemDto> items=Collections.emptyList();;
}

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

@ -28,6 +28,13 @@ public class DfRecordSearchV2Dto {
@ApiModelProperty("状态")
private String status;
/**
* 问题位置
*/
@ApiModelProperty("部位")
private String parts;
@ApiModelProperty("记录id")
private String recordId;

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

@ -36,19 +36,19 @@ public class DfCheckingProblemV2Service extends BaseService<DfCheckingProblemV2M
DfRecordSearchV2Dto data = sp.getData();
// 构建查询条件
LambdaQueryWrapper<DfCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<>();
LambdaQueryWrapper<DfCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<DfCheckingProblemV2>();
if (!ObjectUtils.isEmpty(data)) {
Optional.ofNullable(data.getCategory())
.filter(StringUtils::isNotBlank)
.ifPresent(category -> queryWrapper.eq(DfCheckingProblemV2::getCategory, category));
Optional.ofNullable(data.getType())
.filter(com.baomidou.mybatisplus.core.toolkit.StringUtils::isNotBlank)
.filter(StringUtils::isNotBlank)
.ifPresent(type -> queryWrapper.eq(DfCheckingProblemV2::getType, type));
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfCheckingProblemV2::getName, name));
.ifPresent(name -> queryWrapper.like(DfCheckingProblemV2::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)

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

@ -1,5 +1,8 @@
package com.kms.yxgh.df.service;
import com.alibaba.druid.sql.visitor.functions.If;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@ -7,6 +10,7 @@ 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.extension.plugins.pagination.Page;
import com.kms.yxgh.common.dto.DocV2Dto;
import com.kms.yxgh.common.enums.DfYhV2StatusEnum;
import com.kms.yxgh.df.domain.*;
import com.kms.yxgh.df.dto.DfCheckingDetailDto;
@ -59,7 +63,7 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
Optional.ofNullable(data.getName())
.filter(StringUtils::isNotBlank)
.ifPresent(name -> queryWrapper.like(DfCheckingRecord::getName, name));
.ifPresent(name -> queryWrapper.like(DfCheckingRecord::getCheckingName, name));
Optional.ofNullable(data.getDutyHolder())
.filter(StringUtils::isNotBlank)
@ -128,8 +132,22 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
IPage<DfProblemV2Dto> list = dfCheckingProblemV2Service.list(sp);
if (null != list) {
List<DfProblemV2Dto> records = list.getRecords();
List<DfRecordDetailV2Dto.DfRecordItemDetailV2Dto> dtoList =
ListUtil.copyListToResultList(records, DfRecordDetailV2Dto.DfRecordItemDetailV2Dto.class);
List<DfRecordDetailV2Dto.DfRecordItemDetailV2Dto> dtoList = new ArrayList<>();
for (DfProblemV2Dto record : records) {
DfRecordDetailV2Dto.DfRecordItemDetailV2Dto detailV2Dto=new DfRecordDetailV2Dto.DfRecordItemDetailV2Dto();
if (null!=record.getParts()) {
detailV2Dto.setParts(DfCheckingV2Service.getStringList(record.getParts().split(",")));
}
if (null!=record.getDoc()){
detailV2Dto.setProblemImages(DfCheckingV2Service.getStringList(record.getDoc().split(",")));
}
detailV2Dto.setDepict(record.getDepict());
detailV2Dto.setPosition(record.getPosition());
detailV2Dto.setProblemLevel(record.getProblemLevel());
detailV2Dto.setProblemImages(DfCheckingV2Service.getStringList(record.getParts().split(",")));
detailV2Dto.setStatus(record.getStatus());
dtoList.add(detailV2Dto);
}
dto.setProblems(dtoList);
}
return dto;
@ -150,16 +168,16 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
// 提交时缺陷无数据就是无缺陷
dfCheckingRecord.setStatus(DfYhV2StatusEnum.NO_DEFECTS.getValue());
}
updateById(dfCheckingRecord);
dfCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(dfRecord.getProblems()));
saveOrUpdate(dfCheckingRecord);
dfCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(dfRecord));
return dfRecord;
}else {
DfCheckingRecord dfCheckingRecord=new DfCheckingRecord();
BeanUtils.copyProperties(dfRecord, dfCheckingRecord);
// 未提交维巡查中
dfCheckingRecord.setStatus(DfYhV2StatusEnum.DURING_INSPECTION.getValue());
save(dfCheckingRecord);
dfCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(dfRecord.getProblems()));
saveOrUpdate(dfCheckingRecord);
dfCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(dfRecord));
return dfRecord;
}
}
@ -174,12 +192,32 @@ public class DfCheckingRecordV2Service extends BaseService<DfCheckingRecordV2Map
}
}
public static List<DfCheckingProblemV2> convertToImages(List<DfRecordDetailV2Dto.DfRecordItemDetailV2Dto> dtoList) {
public static List<DfCheckingProblemV2> convertToImages(DfRecordDetailV2Dto dfRecord) {
List<DfCheckingProblemV2> dfCheckingProblemV2s = new ArrayList<>();
dtoList.forEach(e->{
dfRecord.getProblems().forEach(e->{
DfCheckingProblemV2 dfCheckingProblemV2=new DfCheckingProblemV2();
BeanUtils.copyProperties(e,dfCheckingProblemV2);
dfCheckingProblemV2.setDoc(String.join(",", e.getProblemImages()));
dfCheckingProblemV2.setCheckingId(dfRecord.getCheckingId());
dfCheckingProblemV2.setRecordId(dfRecord.getId());
dfCheckingProblemV2.setCheckingName(dfRecord.getCheckingName());
dfCheckingProblemV2.setDikeCode(dfRecord.getDikeCode());
dfCheckingProblemV2.setDikeName(dfRecord.getDikeName());
dfCheckingProblemV2.setDutyHolderName(dfRecord.getCreateName());
dfCheckingProblemV2.setDutyHolderId(dfRecord.getCreateUid());
dfCheckingProblemV2.setStartDate(dfRecord.getStartDate());
dfCheckingProblemV2.setEndDate(dfRecord.getEndDate());
dfCheckingProblemV2.setDepict(dfRecord.getDepict());
dfCheckingProblemV2.setType(dfRecord.getType());
dfCheckingProblemV2.setCategory(dfRecord.getCategory());
if (null!= e.getParts()) {
dfCheckingProblemV2.setParts(e.getParts().stream().collect(Collectors.joining(",")));
}
if (null!= e.getProblemImages()){
dfCheckingProblemV2.setDoc(e.getProblemImages().stream().collect(Collectors.joining(",")));
}
dfCheckingProblemV2.setDepict(e.getDepict());
dfCheckingProblemV2s.add(dfCheckingProblemV2);
});
return dfCheckingProblemV2s;
}

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

@ -229,6 +229,14 @@ public class DfCheckingV2Service extends BaseService<DfCheckingV2Mapper, DfCheck
.map(Integer::valueOf)
.collect(Collectors.toList());
}
public static List<String> getStringList(String[] ids) {
if (ids == null) {
return new ArrayList<>();
}
return Arrays.stream(ids)
.collect(Collectors.toList());
}
}

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

@ -150,7 +150,7 @@ public class DfYhV2Service extends DefaultApprovalBusinessService<DfYhV2Mapper,
}
}
private String getDocStrJson(DocV2Dto dto) {
private static String getDocStrJson(DocV2Dto dto) {
if (dto == null) {
return null;
}

10
sql/zj/v5.0.0/增量更新/v1.sql

@ -21,8 +21,6 @@ ALTER TABLE `sgc_yg`.`att_dike_base`
CREATE TABLE `bs_sgc_df_xmgl` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '巡查项名称',
@ -68,11 +66,14 @@ CREATE TABLE `bs_sgc_df_xsxcjl` (
`end_date` datetime DEFAULT NULL COMMENT '巡查结束时间',
`scope` varchar(50) NOT NULL DEFAULT '' COMMENT '巡查范围',
`create_uid` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人id',
`create_name` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人名称',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '最近修改时间',
`update_uid` varchar(50) NOT NULL DEFAULT '0'COMMENT '修改人id',
`remark` text COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='堤防巡视记录管理表';
CREATE TABLE `bs_sgc_df_xcqx` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`checking_id` int NOT NULL DEFAULT '0' COMMENT '巡查项目id',
@ -124,5 +125,4 @@ CREATE TABLE `bs_sgc_df_xcyj` (
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '最近修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='堤防巡视养护管理表';
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='堤防巡视养护管理表';
Loading…
Cancel
Save