双重预防项目-国泰新华二开定制版
16639036659
2023-11-08 303223dc45f41cdfb14364a7aa7b643f91421b76
src/main/java/com/ruoyi/project/tr/hiddenDangerCheck/controller/DangerBaseController.java
@@ -3,6 +3,8 @@
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.doublePrevention.entity.PreventRiskDangerCheckAndMeasure;
import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerCheckAndMeasureService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
@@ -39,7 +41,8 @@
    @Autowired
    private IHiddenDangerCheckPointService hiddenDangerCheckPointService;
    @Autowired
    private PreventRiskDangerCheckAndMeasureService riskDangerCheckAndMeasureService;
    /**
     * 查询风险单元的检查点列表
@@ -126,15 +129,21 @@
    /**
     * 根据隐患排查checkId获取基础清单下的检查点,并合并检查内容相同的行
     * 根据隐患排查checkId获取基础清单下的检查点,并合并检查内容相同的行  todo
     */
    @PostMapping("/selectBaseCheckPointListByCheckIdAndMergeSamePoint")
    @ResponseBody
    public TableDataInfo selectBaseCheckPointListByCheckIdAndMergeSamePoint(BaseCheckPointDTO baseCheckPointDTO) {
        List<BaseCheckPointDTO> list = hiddenDangerCheckPointService.selectBaseCheckPointListByCheckId(baseCheckPointDTO);
        List<PreventRiskDangerCheckAndMeasure> riskDangerCheckAndMeasures = riskDangerCheckAndMeasureService.getByCheckId(baseCheckPointDTO.getCheckId());
        List<BaseCheckPointDTO> listLast = new ArrayList<>();
        Set<Long> checkPointIds = new HashSet<Long>();
        for (int i = 0; i < list.size(); i++) {
            for (PreventRiskDangerCheckAndMeasure riskDangerCheckAndMeasure : riskDangerCheckAndMeasures) {
                if (riskDangerCheckAndMeasure.getDangerCheckPointId().equals(list.get(i).getId())){
                    list.get(i).setCheckDesc(riskDangerCheckAndMeasure.getCheckDesc());
                }
            }
            if ("0".equals(list.get(i).getWhetherDanger())) {
                listLast.add(list.get(i));
                checkPointIds.add(list.get(i).getCheckPointId());