bug修复
This commit is contained in:
parent
fbf14e2502
commit
ffe6fe38a9
@ -118,9 +118,6 @@ public class QualityRegion implements Serializable {
|
||||
@ApiModelProperty(value = "安全风险排查责任人s")
|
||||
private java.lang.String securityRiskAssessors;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<QualityRegion> children;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "最外面的设置的责任单位")
|
||||
private List<EnterpriseInfo> enterpriseInfos;
|
||||
|
||||
@ -1,30 +1,33 @@
|
||||
package com.zhgd.xmgl.modules.quality.entity.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QualityRegionVo extends QualityRegion {
|
||||
/**
|
||||
* 责任单位名称s
|
||||
* 安全责任单位名称s
|
||||
*/
|
||||
@ApiModelProperty(value = "责任单位名称s")
|
||||
@ApiModelProperty(value = "安全责任单位名称s")
|
||||
private java.lang.String enterpriseNames;
|
||||
/**
|
||||
* 整改人名称s
|
||||
* 安全整改人名称s
|
||||
*/
|
||||
@ApiModelProperty(value = "整改人名称s")
|
||||
@ApiModelProperty(value = "安全整改人名称s")
|
||||
private java.lang.String dutyNames;
|
||||
/**
|
||||
* 复查人名称s
|
||||
* 安全复查人名称s
|
||||
*/
|
||||
@ApiModelProperty(value = "复查人名称s")
|
||||
@ApiModelProperty(value = "安全复查人名称s")
|
||||
private java.lang.String reviewNames;
|
||||
/**
|
||||
* 风险排查责任人名称s
|
||||
* 安全风险排查责任人名称s
|
||||
*/
|
||||
@ApiModelProperty(value = "风险排查责任人名称s")
|
||||
@ApiModelProperty(value = "安全风险排查责任人名称s")
|
||||
private java.lang.String riskAssessorNames;
|
||||
/**
|
||||
* 全路径名(/划分)
|
||||
@ -42,4 +45,6 @@ public class QualityRegionVo extends QualityRegion {
|
||||
@ApiModelProperty(value = "管控清单风险点我的待办数量(落实或隐患都共用)")
|
||||
private java.lang.Integer riskListPointTodoNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<QualityRegionVo> children;
|
||||
}
|
||||
|
||||
@ -200,25 +200,6 @@ public class QualityRegionServiceImpl extends ServiceImpl<QualityRegionMapper, Q
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<QualityRegion> groupList(List<QualityRegion> list, List<QualityRegion> childList) {
|
||||
for (QualityRegion map1 : list) {
|
||||
List<QualityRegion> tempList = new ArrayList<>();
|
||||
List<QualityRegion> list2 = new ArrayList<>();
|
||||
for (QualityRegion map2 : childList) {
|
||||
if (map1.getId().equals(map2.getParentRegion())) {
|
||||
tempList.add(map2);
|
||||
} else {
|
||||
list2.add(map2);
|
||||
}
|
||||
}
|
||||
if (list2.size() > 0) {
|
||||
tempList = groupList(tempList, list2);
|
||||
}
|
||||
map1.setChildren(tempList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addQualityRegion(QualityRegion qualityRegion) {
|
||||
if (qualityRegion.getParentRegion() == null) {
|
||||
|
||||
@ -43,6 +43,7 @@ import org.simpleframework.xml.core.Validate;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ -335,4 +336,18 @@ public class RiskListPointController {
|
||||
return Result.success(vo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量从月度清单移除管控清单风险点", notes = "批量从月度清单移除管控清单风险点", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "ids", value = "管控清单风险点ID字符串(多个以,分割)", paramType = "body", required = true, dataType = "String")
|
||||
@PostMapping(value = "/delFromMonthlyBatch")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result delFromMonthlyBatch(@ApiIgnore @RequestBody HashMap<String, Object> param) {
|
||||
String ids = MapUtils.getString(param, "ids");
|
||||
if (StrUtil.isNotBlank(ids)) {
|
||||
// riskListSourceService.update(new LambdaUpdateWrapper<RiskListSource>()
|
||||
// .set(RiskListSource::get,)
|
||||
// .in(RiskListSource::getPointId, StrUtil.split(ids, ",")));
|
||||
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -505,7 +504,7 @@ public class RiskListSourceDataCenterController {
|
||||
return null;
|
||||
}
|
||||
Map<String, Map<Integer, Optional<RiskListSourceVo>>> collect = sourceVos.stream()
|
||||
.peek(vo -> vo.setRiskVal(getRiskVal(vo)))
|
||||
.peek(vo -> vo.setRiskVal(riskListSourceService.calRiskVal(vo)))
|
||||
.collect(Collectors.groupingBy(
|
||||
RiskListSourceVo::getListLibraryName,
|
||||
Collectors.groupingBy(
|
||||
@ -561,37 +560,6 @@ public class RiskListSourceDataCenterController {
|
||||
return Result.success(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取风险值
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
private BigDecimal getRiskVal(RiskListSourceVo vo) {
|
||||
if (vo.getRiskAssessmentCalculator() == null) {
|
||||
return null;
|
||||
}
|
||||
BigDecimal decimal = null;
|
||||
JSONObject jsonObject;
|
||||
switch (vo.getRiskAssessmentCalculator()) {
|
||||
case 1:
|
||||
jsonObject = JSON.parseObject(vo.getLecdData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("eNumber"), jsonObject.getDouble("cNumber"));
|
||||
break;
|
||||
case 2:
|
||||
decimal = Convert.toBigDecimal(vo.getDirectDeterminationMethodData());
|
||||
break;
|
||||
case 3:
|
||||
jsonObject = JSON.parseObject(vo.getLcdData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("cNumber"), 1);
|
||||
break;
|
||||
case 4:
|
||||
jsonObject = JSON.parseObject(vo.getLsrData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("sNumber"), 1);
|
||||
break;
|
||||
}
|
||||
return decimal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -121,14 +121,19 @@ public class RiskListPoint implements Serializable {
|
||||
@ApiModelProperty(value = "1动态风险2静态风险")
|
||||
private java.lang.Integer dynamicType;
|
||||
@ApiModelProperty(value = "设备设施属性")
|
||||
private java.lang.String equipmentFacilityAttribute;
|
||||
@ApiModelProperty(value = "所在位置")
|
||||
private java.lang.String location;
|
||||
@ApiModelProperty(value = "型号")
|
||||
private java.lang.String model;
|
||||
/**
|
||||
* 月度清单id
|
||||
*/
|
||||
@ApiModelProperty(value = "月度清单id")
|
||||
private java.lang.Long monthlyId;
|
||||
private java.lang.String equipmentFacilityAttribute;
|
||||
@ApiModelProperty(value = "所在位置")
|
||||
private java.lang.String location;
|
||||
@ApiModelProperty(value = "型号")
|
||||
private java.lang.String model;
|
||||
/**
|
||||
* 月度清单id
|
||||
*/
|
||||
@ApiModelProperty(value = "月度清单id")
|
||||
private java.lang.Long monthlyId;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private java.lang.String specificationsModel;
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ public class RiskListPointVo extends RiskListPoint {
|
||||
@ApiModelProperty(value = "危险源数")
|
||||
private java.lang.Integer hazardSourceNumber;
|
||||
/**
|
||||
* 我的待办的危险源数
|
||||
* 我的待办的危险源数(未排查)
|
||||
*/
|
||||
@ApiModelProperty(value = "我的待办的危险源数")
|
||||
@ApiModelProperty(value = "我的待办的危险源数(未排查)")
|
||||
private java.lang.Integer hazardSourceNumberTodo;
|
||||
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ public class RiskListSourceVo extends RiskListSource {
|
||||
/**
|
||||
* 风险值
|
||||
*/
|
||||
@JsonIgnore
|
||||
@ApiModelProperty(value = "风险值")
|
||||
private BigDecimal riskVal;
|
||||
/**
|
||||
* 应排查数量
|
||||
|
||||
@ -9,6 +9,7 @@ import com.zhgd.xmgl.modules.risk.entity.vo.CountRisksByLevelVo;
|
||||
import com.zhgd.xmgl.modules.risk.entity.vo.RiskListSourceVo;
|
||||
import com.zhgd.xmgl.modules.risk.entity.vo.RiskUndoneVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@ -77,4 +78,11 @@ public interface IRiskListSourceService extends IService<RiskListSource> {
|
||||
|
||||
List<SectorOneVo> countRisksByLibrary(HashMap<String, Object> map);
|
||||
|
||||
/**
|
||||
* 计算风险值
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
BigDecimal calRiskVal(RiskListSourceVo vo);
|
||||
}
|
||||
|
||||
@ -3,7 +3,10 @@ package com.zhgd.xmgl.modules.risk.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@ -130,9 +134,12 @@ public class RiskListSourceServiceImpl extends ServiceImpl<RiskListSourceMapper,
|
||||
param.put("regionIdList", StrUtil.split(regionIds, ","));
|
||||
}
|
||||
Integer isMySourceToDo = MapUtils.getInteger(param, "isMySourceToDo");
|
||||
String today = DateUtil.today() + " 00:00:00";
|
||||
if (Objects.equals(isMySourceToDo, 1)) {
|
||||
param.put("checkWorkerId", SecurityUtils.getUser().getUserId());
|
||||
param.put("allowGenerateTask", 1);
|
||||
param.put("effectiveTimeBegin_end", today);
|
||||
param.put("effectiveTimeEnd_begin", today);
|
||||
}
|
||||
Integer isMySourceToDoForWorkable = MapUtils.getInteger(param, "isMySourceToDoForWorkable");
|
||||
if (Objects.equals(isMySourceToDoForWorkable, 1)) {
|
||||
@ -186,6 +193,7 @@ public class RiskListSourceServiceImpl extends ServiceImpl<RiskListSourceMapper,
|
||||
}
|
||||
sourceVo.setUnWorkableAreaIdList(unWorkableAreaIdList);
|
||||
sourceVo.setUnCheckAreaIdList(getUnCheckAreaIdList(securityList, unbuilts, sourceVo));
|
||||
sourceVo.setRiskVal(this.calRiskVal(sourceVo));
|
||||
}
|
||||
Integer isMySourceToDo = MapUtils.getInteger(param, "isMySourceToDo");
|
||||
Integer isMySourceToDoForWorkable = MapUtils.getInteger(param, "isMySourceToDoForWorkable");
|
||||
@ -443,4 +451,30 @@ public class RiskListSourceServiceImpl extends ServiceImpl<RiskListSourceMapper,
|
||||
return baseMapper.countRisksByLibrary(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal calRiskVal(RiskListSourceVo vo) {
|
||||
if (vo.getRiskAssessmentCalculator() == null) {
|
||||
return null;
|
||||
}
|
||||
BigDecimal decimal = null;
|
||||
JSONObject jsonObject;
|
||||
switch (vo.getRiskAssessmentCalculator()) {
|
||||
case 1:
|
||||
jsonObject = JSON.parseObject(vo.getLecdData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("eNumber"), jsonObject.getDouble("cNumber"));
|
||||
break;
|
||||
case 2:
|
||||
decimal = Convert.toBigDecimal(vo.getDirectDeterminationMethodData());
|
||||
break;
|
||||
case 3:
|
||||
jsonObject = JSON.parseObject(vo.getLcdData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("cNumber"), 1);
|
||||
break;
|
||||
case 4:
|
||||
jsonObject = JSON.parseObject(vo.getLsrData());
|
||||
decimal = NumberUtil.mul(jsonObject.getDouble("lNumber"), jsonObject.getDouble("sNumber"), 1);
|
||||
break;
|
||||
}
|
||||
return decimal;
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@ -186,6 +185,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
@ApiImplicitParam(name = "month", value = "月份yyyy-MM", paramType = "query", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间yyyy-MM-dd", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间yyyy-MM-dd", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "containEnterpriseId", value = "包含下级的单位的人员的单位id", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/countDailyAttendanceByDateRange")
|
||||
public Result<IPage<StatisticsListVo>> countDailyAttendanceByDateRange(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
@ -419,7 +419,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
workbook.getSheetAt(0).addMergedRegion(new CellRangeAddress(0, 0, 0, 4 + listVoList.get(0).getDailyHourMap().size()));
|
||||
workbook.getSheetAt(0).addMergedRegion(new CellRangeAddress(1, 1, 0, 4 + listVoList.get(0).getDailyHourMap().size()));
|
||||
ExcelUtils.downLoadExcel("考勤工时统计表.xlsx", response, workbook);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
throw new OpenAlertException("系统错误");
|
||||
} finally {
|
||||
@ -479,7 +479,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
params.setColForEach(true);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
||||
ExcelUtils.downLoadExcel("考勤异常工时统计表.xlsx", response, workbook);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
throw new OpenAlertException("系统错误");
|
||||
} finally {
|
||||
@ -756,7 +756,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(root, params);
|
||||
//设置下拉
|
||||
ExcelUtils.downLoadExcel(tempSheetName, response, workbook);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
throw new OpenAlertException("系统错误");
|
||||
} finally {
|
||||
@ -1184,7 +1184,7 @@ public class WorkerDailyAttendanceStatisticsV2Controller {
|
||||
}
|
||||
ExcelUtils.downLoadExcel(tempSheetName, response, workbook);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
throw new OpenAlertException("系统错误");
|
||||
} finally {
|
||||
|
||||
@ -48,9 +48,9 @@
|
||||
and create_time>=current_date group by person_sn ) wa on wa.person_sn = a.person_sn
|
||||
</if>
|
||||
WHERE 1 = 1
|
||||
<if test="param.workerTypeId != null and param.workerTypeId != ''">
|
||||
and b.worker_type_id = #{param.workerTypeId}
|
||||
</if>
|
||||
<if test="param.workerTypeId != null and param.workerTypeId != ''">
|
||||
and b.worker_type_id = #{param.workerTypeId}
|
||||
</if>
|
||||
<if test="param.attendanceGroupV2Id != null and param.attendanceGroupV2Id != ''">
|
||||
and a.attendance_group_v2_id = #{param.attendanceGroupV2Id}
|
||||
</if>
|
||||
|
||||
@ -587,7 +587,7 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl<Wo
|
||||
.eq(ProjectEnterprise::getProjectSn, projectSn);
|
||||
List<Long> eids = projectEnterpriseService.list(peWrap).stream().filter(projectEnterprise -> {
|
||||
if (Objects.nonNull(parentEnterpriseId)) {
|
||||
return Objects.equals(parentEnterpriseId, projectEnterprise.getEnterpriseId());
|
||||
return Objects.equals(parentEnterpriseId, projectEnterprise.getParentEnterpriseId());
|
||||
}
|
||||
if (Objects.equals(isSecondLevel, 1)) {
|
||||
return StrUtil.split(projectEnterprise.getAncestors(), ",").size() == 2;
|
||||
@ -600,8 +600,9 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl<Wo
|
||||
List<EnterpriseInfo> enterpriseInfos = enterpriseInfoService.list(queryWrapper);
|
||||
List<CountByEnterpriseVo> vos = baseMapper.countNumByEnterprise(param);
|
||||
return enterpriseInfos.stream().map(ei -> {
|
||||
int workerCount = vos.stream().filter(v -> Objects.nonNull(v.getAncestors()) && v.getAncestors().contains(ei.getId() + "")).mapToInt(CountByEnterpriseVo::getWorkerCount).sum();
|
||||
int workerCount = vos.stream().filter(v -> Objects.equals(ei.getId(), v.getEnterpriseId()) || (Objects.nonNull(v.getAncestors()) && v.getAncestors().contains(ei.getId() + ""))).mapToInt(CountByEnterpriseVo::getWorkerCount).sum();
|
||||
CountByEnterpriseVo vo = new CountByEnterpriseVo();
|
||||
vo.setEnterpriseId(ei.getId());
|
||||
vo.setEnterpriseName(ei.getEnterpriseName());
|
||||
vo.setWorkerCount(workerCount);
|
||||
return vo;
|
||||
|
||||
@ -12,15 +12,16 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.DictionaryConstant;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryItemService;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecord;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerTypeRecordCollect;
|
||||
import com.zhgd.xmgl.modules.xz.security.entity.vo.TopProjectClassifyTypeRecordTreeVo;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerItemRecordService;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordCollectService;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityDangerTypeRecordService;
|
||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityProjectDangerTypeDisableService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.ListUtils;
|
||||
import com.zhgd.xmgl.util.MapBuilder;
|
||||
import com.zhgd.xmgl.util.MapUtil;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -46,10 +47,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@ -75,6 +73,9 @@ public class XzSecurityDangerTypeRecordController {
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IXzSecurityProjectDangerTypeDisableService xzSecurityProjectDangerTypeDisableService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IXzSecurityDangerItemRecordService dangerItemRecordService;
|
||||
|
||||
/**
|
||||
@ -184,8 +185,25 @@ public class XzSecurityDangerTypeRecordController {
|
||||
@ApiImplicitParam(name = "recordStatus", value = "记录状态,0 启用,1禁用", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/updateDangerTypeRecordUsable")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result updateDangerTypeRecordUsable(@RequestBody Map<String, Object> map) {
|
||||
dangerTypeRecordService.updateDangerTypeRecordUsable(map);
|
||||
List<DictionaryItem> projectTypeList = dictionaryItemService.getDictList(DictionaryConstant.RISK_LIST_PROJECT_TYPE, null);
|
||||
String id = MapUtils.getString(map, "id");
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
Optional<DictionaryItem> first = projectTypeList.stream().filter(item -> Objects.equals(item.getData(), id)).findFirst();
|
||||
if (first.isPresent()) {
|
||||
List<XzSecurityDangerTypeRecord> typeRecords = dangerTypeRecordService.getEnableList(projectSn);
|
||||
String projectClassify = first.get().getData();
|
||||
typeRecords.stream().filter(r -> Objects.equals(r.getParentId(), 0L) && Objects.equals(r.getProjectClassify(), projectClassify)).forEach(record -> {
|
||||
dangerTypeRecordService.updateDangerTypeRecordUsable(new MapBuilder<String, Object>()
|
||||
.put("id", record.getId())
|
||||
.put("projectSn", projectSn)
|
||||
.put("recordStatus", map.get("recordStatus"))
|
||||
.build());
|
||||
});
|
||||
} else {
|
||||
dangerTypeRecordService.updateDangerTypeRecordUsable(map);
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ -267,7 +285,7 @@ public class XzSecurityDangerTypeRecordController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", value = "总公司企业sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectClassify", value = "工程类别(字典值)", paramType = "body", required = false, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "name", value = "名称", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "name", value = "名称", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/getTopProjectClassifyTypeRecordTree")
|
||||
public Result<List<TopProjectClassifyTypeRecordTreeVo>> getTopProjectClassifyTypeRecordTree(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
@ -304,73 +322,45 @@ public class XzSecurityDangerTypeRecordController {
|
||||
@ApiOperation(value = "树形列表查询项目的安全库大项子项(工程类别(字典值)顶级)", notes = "树形列表查询项目的安全库大项子项(工程类别(字典值)顶级)", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目唯一标识", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "content", value = "安全问题库子项内容", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/getTopProjectClassifyTypeRecordDetailTree")
|
||||
public Result<List<TopProjectClassifyTypeRecordTreeVo>> getTopProjectClassifyTypeRecordDetailTree(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
String itemRecordContent = MapUtils.getString(param, "itemRecordContent");
|
||||
List<TopProjectClassifyTypeRecordTreeVo> records;
|
||||
if (StrUtil.isNotBlank(itemRecordContent)) {
|
||||
records = dangerItemRecordService.selectDangerItemRecordList(param).stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
|
||||
vo.setId(r.getId());
|
||||
vo.setParentId(r.getDangerTypeId());
|
||||
vo.setName(r.getPriorityName());
|
||||
vo.setLevel(r.getLevel());
|
||||
vo.setPriorityName(r.getPriorityName());
|
||||
vo.setChangeLimit(r.getChangeLimit());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
String projectClassify = MapUtils.getString(param, "projectClassify");
|
||||
String projectSn = MapUtils.getString(param, "projectSn");
|
||||
List<DictionaryItem> projectTypeList = dictionaryItemService.getDictList(DictionaryConstant.RISK_LIST_PROJECT_TYPE, null);
|
||||
if (StrUtil.isNotBlank(projectClassify)) {
|
||||
projectTypeList = projectTypeList.stream().filter(dictionaryItem -> Objects.equals(dictionaryItem.getData(), projectClassify)).collect(Collectors.toList());
|
||||
String projectClassify = MapUtils.getString(param, "projectClassify");
|
||||
String projectSn = MapUtils.getString(param, "projectSn");
|
||||
List<TopProjectClassifyTypeRecordTreeVo> records = new ArrayList<>();
|
||||
List<XzSecurityDangerTypeRecord> typeRecords = dangerTypeRecordService.getEnableList(projectSn);
|
||||
Map<String, List<XzSecurityDangerTypeRecord>> pcMap = typeRecords.stream().filter(r -> Objects.equals(r.getParentId(), 0L)).collect(Collectors.groupingBy(XzSecurityDangerTypeRecord::getProjectClassify));
|
||||
List<DictionaryItem> projectTypeList = dictionaryItemService.getDictList(DictionaryConstant.RISK_LIST_PROJECT_TYPE, null);
|
||||
List<TopProjectClassifyTypeRecordTreeVo> items = projectTypeList.stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
|
||||
vo.setId(Long.valueOf(r.getData()));
|
||||
vo.setParentId(0L);
|
||||
vo.setName(r.getName());
|
||||
vo.setProjectClassify(r.getData());
|
||||
vo.setRecordStatus(Optional.ofNullable(pcMap.get(r.getData())).map(m -> m.stream().allMatch(r1 -> Objects.equals(r1.getRecordStatus(), 1)) ? 1 : 0).orElse(0));
|
||||
vo.setOrderSort(0);
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
records.addAll(items);
|
||||
List<TopProjectClassifyTypeRecordTreeVo> recordVos = typeRecords.stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = BeanUtil.toBean(r, TopProjectClassifyTypeRecordTreeVo.class);
|
||||
vo.setName(r.getDangerName());
|
||||
if (vo.getParentId() == 0L) {
|
||||
vo.setParentId(Convert.toLong(r.getProjectClassify()));
|
||||
}
|
||||
List<TopProjectClassifyTypeRecordTreeVo> items = projectTypeList.stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
|
||||
vo.setId(Long.valueOf(r.getData()));
|
||||
vo.setParentId(0L);
|
||||
vo.setName(r.getName());
|
||||
vo.setProjectClassify(r.getData());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
records = dangerTypeRecordService.getEnableList(projectSn).stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = BeanUtil.toBean(r, TopProjectClassifyTypeRecordTreeVo.class);
|
||||
vo.setName(r.getDangerName());
|
||||
if (vo.getParentId() == 0L) {
|
||||
vo.setParentId(Convert.toLong(r.getProjectClassify()));
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
records.addAll(items);
|
||||
List<Long> typeIds = records.stream().map(TopProjectClassifyTypeRecordTreeVo::getId).collect(Collectors.toList());
|
||||
typeIds.add(0L);
|
||||
List<TopProjectClassifyTypeRecordTreeVo> itemRecords = dangerItemRecordService.list(new LambdaQueryWrapper<XzSecurityDangerItemRecord>()
|
||||
.in(XzSecurityDangerItemRecord::getDangerTypeId, typeIds)
|
||||
).stream().map(r -> {
|
||||
TopProjectClassifyTypeRecordTreeVo vo = new TopProjectClassifyTypeRecordTreeVo();
|
||||
vo.setId(r.getId());
|
||||
vo.setParentId(r.getDangerTypeId());
|
||||
vo.setName(r.getContent());
|
||||
vo.setLevel(r.getLevel());
|
||||
vo.setPriorityName(r.getPriorityName());
|
||||
vo.setChangeLimit(r.getChangeLimit());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
records.addAll(itemRecords);
|
||||
vo.setRecordStatus(r.getRecordStatus());
|
||||
vo.setOrderSort(r.getOrderSort());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
records.addAll(recordVos);
|
||||
if (StrUtil.isNotBlank(projectClassify)) {
|
||||
records = records.stream().filter(r -> Objects.equals(r.getProjectClassify(), projectClassify)).collect(Collectors.toList());
|
||||
}
|
||||
records = records.stream().sorted(Comparator.comparing(TopProjectClassifyTypeRecordTreeVo::getId)).collect(Collectors.toList());
|
||||
List<TopProjectClassifyTypeRecordTreeVo> vos = BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(records)), "id", "parentId", "children"), TopProjectClassifyTypeRecordTreeVo.class);
|
||||
return Result.success(vos);
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "查询我收藏的安全库(工程类别(字典值)顶级)", notes = "查询我收藏的安全库(工程类别(字典值)顶级)", httpMethod = "GET")
|
||||
// @GetMapping(value = "/getMyCollectProjectClassifyTypeRecords")
|
||||
// public Result<List<Long>> getMyCollectProjectClassifyTypeRecords(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
// return Result.success(null);
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "收藏安全库", notes = "收藏安全库")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "idList", value = "安全库(工程类别(字典值)idList", paramType = "body", required = true, dataType = "String"),
|
||||
|
||||
@ -30,4 +30,15 @@ public class TopProjectClassifyTypeRecordTreeVo {
|
||||
*/
|
||||
@ApiModelProperty(value = "整改时限(天)")
|
||||
private Integer changeLimit;
|
||||
/**
|
||||
* 项目:记录状态,0 启用,1禁用
|
||||
*/
|
||||
@ApiModelProperty(value = "项目:记录状态,0 启用,1禁用")
|
||||
private java.lang.Integer recordStatus;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "排序")
|
||||
@Deprecated
|
||||
private Integer orderSort;
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
a.parent_id,
|
||||
a.remark,
|
||||
IFNULL(b.record_status, 0) record_status
|
||||
,a.project_classify
|
||||
from xz_security_danger_type_record a
|
||||
INNER JOIN company p1 ON a.sn = p1.headquarters_sn
|
||||
INNER JOIN project p2 ON p2.company_sn = p1.company_sn
|
||||
|
||||
@ -66,7 +66,7 @@ public class XzSecurityDangerFieldServiceImpl extends ServiceImpl<XzSecurityDang
|
||||
|
||||
private QueryWrapper<XzSecurityDangerFieldVo> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<XzSecurityDangerFieldVo> queryWrapper = QueryGenerator.initPageQueryWrapper(XzSecurityDangerFieldVo.class, param, true);
|
||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(XzSecurityDangerFieldVo::getId));
|
||||
queryWrapper.orderByAsc(RefUtil.fieldNameUlc(XzSecurityDangerFieldVo::getSort));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user