Commit b3d7dc54 authored by suhuiguang's avatar suhuiguang

1.安全追溯详情接口开发,自测bug修改

parent d9286d5e
package com.yeejoin.amos.boot.module.statistics.api.dto; package com.yeejoin.amos.boot.module.statistics.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -25,6 +22,21 @@ public class SafetyProblemTracingDto extends DPFilterParamForDetailDto { ...@@ -25,6 +22,21 @@ public class SafetyProblemTracingDto extends DPFilterParamForDetailDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "更新时间")
protected Date recDate;
@ApiModelProperty(value = "更新人id")
protected String recUserId;
@ApiModelProperty(value = "更新人")
protected String recUserName;
@ApiModelProperty(value = "问题编号") @ApiModelProperty(value = "问题编号")
private String problemNum; private String problemNum;
......
...@@ -1093,8 +1093,8 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -1093,8 +1093,8 @@ public class AQZSDPStatisticsServiceImpl {
dto.setStrValue("0"); dto.setStrValue("0");
} else { } else {
List<CountDto> dtoList = statisticsMapper.selectByOrgAndMainBody(orgCode, null, sourceTypeCode); List<CountDto> dtoList = statisticsMapper.selectByOrgAndMainBody(orgCode, null, sourceTypeCode);
Long allProblemNum = dtoList.stream().filter(c -> c.getKeyStr().equals(sourceTypeCode)).mapToLong(CountDto::getLongValue).sum(); Long allProblemNum = dtoList.stream().mapToLong(CountDto::getLongValue).sum();
Long handledProblemNum = dtoList.stream().filter(c -> c.getKeyStr().equals(sourceTypeCode) && c.getLabel().equals(SafetyProblemStatusEnum.HANDLED.getCode())).mapToLong(CountDto::getLongValue).sum(); Long handledProblemNum = dtoList.stream().filter(c -> c.getLabel().equals(SafetyProblemStatusEnum.HANDLED.getCode())).mapToLong(CountDto::getLongValue).sum();
dto.setStrValue(calPercent(allProblemNum, handledProblemNum)); dto.setStrValue(calPercent(allProblemNum, handledProblemNum));
} }
return dto; return dto;
...@@ -1115,34 +1115,36 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -1115,34 +1115,36 @@ public class AQZSDPStatisticsServiceImpl {
public Page<SafetyProblemTracingDto> getProblemRecords(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel) { public Page<SafetyProblemTracingDto> getProblemRecords(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel) {
String orgCode = stCommonService.getAndSetOrgCode(problemModel.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(problemModel.getCityCode());
if (orgCode == null){ if (orgCode == null) {
return new Page<>(); return new Page<>();
} }
problemModel.setGoverningBodyOrgCode(orgCode); problemModel.setGoverningBodyOrgCode(orgCode);
// 使用orgCode过滤 // 使用orgCode过滤
problemModel.setRegionCode(null); problemModel.setRegionCode(null);
// 将单位类型从code转化为value // 将单位类型从code转化为value
if (!ValidationUtil.isEmpty(problemModel.getPrincipalUnitType())){ if (!ValidationUtil.isEmpty(problemModel.getPrincipalUnitType())) {
Collection<DataDictionary> unitTypeList = dataDictionaryMapper.selectList(new QueryWrapper<DataDictionary>() Collection<DataDictionary> unitTypeList = dataDictionaryMapper.selectList(new QueryWrapper<DataDictionary>()
.eq("type", "UNIT_TYPE_NEW") .eq("type", "UNIT_TYPE_NEW")
.eq("is_delete", false) .eq("is_delete", false)
.orderByAsc("sort_num")); .orderByAsc("sort_num"));
Map<String, String> unitTypeMap = unitTypeList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getName)); Map<String, String> unitTypeMap = unitTypeList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getName));
problemModel.setPrincipalUnitType(unitTypeMap.getOrDefault(problemModel.getPrincipalUnitType(),null)); problemModel.setPrincipalUnitType(unitTypeMap.getOrDefault(problemModel.getPrincipalUnitType(), null));
} }
if(problemModel.getTimeSearchOne() != null){ if (problemModel.getTimeSearchOne() != null) {
problemModel.setProblemTimeStart(problemModel.getTimeSearchOne().getBeginDate()); problemModel.setProblemTimeStart(problemModel.getTimeSearchOne().getBeginDate());
problemModel.setProblemTimeEnd(problemModel.getTimeSearchOne().getEndDate()); problemModel.setProblemTimeEnd(problemModel.getTimeSearchOne().getEndDate());
} }
// 前端详情固定给的treeValue,后端进行进行字段转换
problemModel.setSourceTypeCode(problemModel.getTreeValue());
return statisticsMapper.queryForSafetyProblemTracingPage(page, problemModel); return statisticsMapper.queryForSafetyProblemTracingPage(page, problemModel);
} }
public List<Map<String,Object>> getYhType() { public List<Map<String, Object>> getYhType() {
List<DataDictionary> dictionaries = dataDictionaryMapper.selectList(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getType, "ISSUE_TYPE")); List<DataDictionary> dictionaries = dataDictionaryMapper.selectList(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getType, "ISSUE_TYPE"));
return dictionaries.stream().map(d->{ return dictionaries.stream().map(d -> {
Map<String,Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("value",d.getCode()); item.put("value", d.getCode());
item.put("label",d.getName()); item.put("label", d.getName());
return item; return item;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment