工作流参数调整

This commit is contained in:
2024-07-18 10:40:50 +08:00
parent be8edfd4cf
commit 23e7288609
3 changed files with 65 additions and 4 deletions

View File

@@ -66,6 +66,16 @@ public class WarningLeafletController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/allPageData")
@ApiOperation("分页查询告警单全部数据")
@ApiImplicitParam(name = "warningLeafletQueryParam", value = "参数", required = true)
public HttpResult<Page<WarningLeafletVO>> allPageData(@RequestBody @Validated WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
String methodDescribe = getMethodDescribe("alarmPageData");
Page<WarningLeafletVO> out = warningLeafletService.allPageData(warningLeafletQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addLineOverLimitData")
@ApiOperation("监测点超标预警单/告警单新增")

View File

@@ -47,5 +47,11 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
String cancelWarningLeaflet(BpmProcessInstanceCancelParam cancelReqVO);
/**
* 查询告警单信息,包含预警单和告警单
* @param warningLeafletQueryParam
* @return
*/
Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
}

View File

@@ -48,10 +48,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -347,6 +344,54 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
return warningLeaflet.getId();
}
@Override
public Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper = new QueryWrapper<>();
if (Objects.nonNull(warningLeafletQueryParam)) {
//添加上时间范围
warningLeafletVOQueryWrapper.between("supervision_warning_leaflet.Create_Time",
DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
}
//筛选负责单位
if (StrUtil.isNotBlank(warningLeafletQueryParam.getDeptIndex())) {
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(warningLeafletQueryParam.getDeptIndex()).getData();
warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.dept_id", deptIds);
}
warningLeafletVOQueryWrapper
.eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode())
.in("supervision_warning_leaflet.status", Arrays.asList(3,4,5))
.orderByDesc("supervision_warning_leaflet.Update_Time");
Page<WarningLeafletVO> warningLeafletVOPage = this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper);
//目前仅知道现场测试超标会有附件
List<WarningLeafletVO> records = warningLeafletVOPage.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
List<String> deptIds = records.stream().distinct().map(WarningLeafletVO::getDutyOrgId).collect(Collectors.toList());
Map<String, String> deptMap = new HashMap<>();
if (CollUtil.isNotEmpty(deptIds)) {
List<Dept> data = deptFeignClient.getDeptInfoListByIds(deptIds).getData();
deptMap.putAll(data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName)));
}
for (WarningLeafletVO record : records) {
if (record.getProblemType().equals(ProblemTypeEnum.SITE_TEST.getCode()) && StrUtil.isNotBlank(record.getProblemId())) {
//查询到现场测试超标附件地址
TempLineRunTestWarning byId = lineRunTestWarningService.getById(record.getProblemId());
if(Objects.nonNull(byId)){
record.setProblemPath(byId.getTestRunReport());
}
}
if (deptMap.containsKey(record.getDutyOrgId())) {
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
}
if (!Objects.isNull(record.getFilePath())){
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
}
}
}
return warningLeafletVOPage;
}
private String assembleOverLimitInfo(RMpPartHarmonicDetailDTO rMpPartHarmonicDetailDTO) {
String info = "";