From eaef38fc055356635ee8069bcce3fa3b36da17cc Mon Sep 17 00:00:00 2001 From: 16639036659 <577530412@qq.com> Date: 星期二, 25 四月 2023 15:41:30 +0800 Subject: [PATCH] 临时提交 --- src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskDangerCheckLogRepository.java | 2 src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoDTO.java | 123 ++++++++++++ src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoRespDTO.java | 25 ++ src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskDangerCheckLogServiceImpl.java | 5 src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml | 50 +++++ src/main/java/com/ruoyi/doublePrevention/entity/RiskAndPeopleInfo.java | 160 ++++++++++++++++ src/main/java/com/ruoyi/doublePrevention/controller/RiskAndPeopleInfoController.java | 39 +++ src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/IHiddenDangerCheckJobLogService.java | 2 src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java | 96 +++++++++ src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/mapper/HiddenDangerCheckJobLogMapper.java | 2 src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/controller/RiskEvaluationController.java | 9 src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/HiddenDangerCheckJobLogServiceImpl.java | 5 src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/domain/dto/RiskEvaluationDTO.java | 8 src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml | 5 src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskDangerCheckLogService.java | 2 src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java | 12 + src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportConfigLogRepository.java | 2 src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java | 15 + src/main/resources/mybatis/tr/HiddenDangerCheckJobLogMapper.xml | 11 + src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java | 12 + 20 files changed, 577 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/ruoyi/doublePrevention/controller/RiskAndPeopleInfoController.java b/src/main/java/com/ruoyi/doublePrevention/controller/RiskAndPeopleInfoController.java new file mode 100644 index 0000000..c035254 --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/controller/RiskAndPeopleInfoController.java @@ -0,0 +1,39 @@ +package com.ruoyi.doublePrevention.controller; + +import com.ruoyi.doublePrevention.entity.dto.req.RiskAndPeopleInfoReqBO; +import com.ruoyi.doublePrevention.entity.dto.resp.RiskAndPeopleInfoRespDTO; +import com.ruoyi.doublePrevention.service.baseService.RiskAndPeopleInfoService; +import com.ruoyi.doublePrevention.vo.ResultVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/riskAndPeople") +public class RiskAndPeopleInfoController { + + @Autowired + private RiskAndPeopleInfoService riskAndPeopleInfoService; + + /** + * 查看包保责任制信息 及统计信息 + */ + @PostMapping("/select/listPage") + public ResultVO<RiskAndPeopleInfoRespDTO> listRiskAndPeoplePage(@RequestBody RiskAndPeopleInfoReqBO reqBO){ + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + ResultVO<RiskAndPeopleInfoRespDTO> result = riskAndPeopleInfoService.listRiskAndPeoplePage(reqBO); + + resultVO.setPageSize(result.getPageSize()); + resultVO.setPageNum(result.getPageNum()); + resultVO.setCount(result.getCount()); + resultVO.setData(result.getData()); + + return resultVO; + } +} diff --git a/src/main/java/com/ruoyi/doublePrevention/entity/RiskAndPeopleInfo.java b/src/main/java/com/ruoyi/doublePrevention/entity/RiskAndPeopleInfo.java new file mode 100644 index 0000000..0c40994 --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/entity/RiskAndPeopleInfo.java @@ -0,0 +1,160 @@ +package com.ruoyi.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 包保责任制 + */ +@Data +@TableName("risk_and_people_info") +public class RiskAndPeopleInfo implements Serializable { + private static final long serialVersionUID = -61793617513430361L; + + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * 行政区划 + */ + private String areaCode; + /** + * 公司名称 + */ + private String companyName; + /** + * 企业类型 + */ + private String companyNature; + /** + * 企业类型名称 + */ + private String companyNatureName; + /** + * + */ + private String hazardId; + /** + * 危险源编码 + */ + private String hazardCode; + /** + * 危险源名称 + */ + private String hazardName; + /** + * 风险等级(数字) + */ + private String hazardRank; + /** + * 风险等级(汉字) + */ + private String hazardRankName; + /** + * 园区名称 + */ + private String parkName; + + /** + *主要责任人id + */ + private Long mainLiabilityPersonId; + /** + * 主要责任人姓名 + */ + private String mainLiabilityPersonName; + /** + * 主要责任人类型 + */ + private String mainLiabilityPersonType; + /** + * 主要责任人电话 + */ + private Long mainLiabilityPersonPhone; + /** + * 主要责任人职务 + */ + private String mainLiabilityPersonJob; + /** + * 主要责任人任务 + */ + private String mainLiabilityPersonWork; + + /** + *技术责任人id + */ + private Long technologyLiabilityPersonId; + /** + * 技术责任人姓名 + */ + private String technologyLiabilityPersonName; + /** + * 技术责任人类型 + */ + private String technologyLiabilityPersonType; + /** + * 技术责任人电话 + */ + private Long technologyLiabilityPersonPhone; + /** + * 技术责任人职务 + */ + private String technologyLiabilityPersonJob; + /** + * 技术责任人任务 + */ + private String technologyLiabilityPersonWork; + + /** + *操作责任人id + */ + private Long handleLiabilityPersonId; + /** + * 操作责任人姓名 + */ + private String handleLiabilityPersonName; + /** + * 操作责任人类型 + */ + private String handleLiabilityPersonType; + /** + * 操作责任人电话 + */ + private Long handleLiabilityPersonPhone; + /** + * 操作责任人职务 + */ + private String handleLiabilityPersonJob; + /** + * 操作责任人任务 + */ + private String handleLiabilityPersonWork; + + + + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; +} + diff --git a/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java b/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java new file mode 100644 index 0000000..d30ca4e --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/entity/dto/req/RiskAndPeopleInfoReqBO.java @@ -0,0 +1,12 @@ +package com.ruoyi.doublePrevention.entity.dto.req; + +import lombok.Data; + +@Data +public class RiskAndPeopleInfoReqBO { + + private Integer pageNum; + + private Integer pageSize; + +} diff --git a/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoDTO.java b/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoDTO.java new file mode 100644 index 0000000..b9d91b5 --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoDTO.java @@ -0,0 +1,123 @@ +package com.ruoyi.doublePrevention.entity.dto.resp; + +import lombok.Data; + +import java.util.Date; + +@Data +public class RiskAndPeopleInfoDTO { + + private Long id; + + private String areaCode; + + private String companyName; + + private String companyNature; + + private String companyNatureName; + + private String hazardId; + + private String hazardCode; + + private String hazardName; + + private String hazardRank; + + private String hazardRankName; + + private String parkName; + + /** + *主要责任人id + */ + private Long mainLiabilityPersonId; + /** + * 主要责任人姓名 + */ + private String mainLiabilityPersonName; + /** + * 主要责任人类型 + */ + private String mainLiabilityPersonType; + /** + * 主要责任人电话 + */ + private Long mainLiabilityPersonPhone; + /** + * 主要责任人职务 + */ + private String mainLiabilityPersonJob; + /** + * 主要责任人任务 + */ + private String mainLiabilityPersonWork; + + /** + *技术责任人id + */ + private Long technologyLiabilityPersonId; + /** + * 技术责任人姓名 + */ + private String technologyLiabilityPersonName; + /** + * 技术责任人类型 + */ + private String technologyLiabilityPersonType; + /** + * 技术责任人电话 + */ + private Long technologyLiabilityPersonPhone; + /** + * 技术责任人职务 + */ + private String technologyLiabilityPersonJob; + /** + * 技术责任人任务 + */ + private String technologyLiabilityPersonWork; + + /** + *操作责任人id + */ + private Long handleLiabilityPersonId; + /** + * 操作责任人姓名 + */ + private String handleLiabilityPersonName; + /** + * 操作责任人类型 + */ + private String handleLiabilityPersonType; + /** + * 操作责任人电话 + */ + private Long handleLiabilityPersonPhone; + /** + * 操作责任人职务 + */ + private String handleLiabilityPersonJob; + /** + * 操作责任人任务 + */ + private String handleLiabilityPersonWork; + + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; +} diff --git a/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoRespDTO.java b/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoRespDTO.java new file mode 100644 index 0000000..b41a0ae --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/entity/dto/resp/RiskAndPeopleInfoRespDTO.java @@ -0,0 +1,25 @@ +package com.ruoyi.doublePrevention.entity.dto.resp; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + + +@Data +public class RiskAndPeopleInfoRespDTO { + /** + * 责任人所有的任务 + * */ + private Integer count; + /** + * 责任人所有完成的任务 + * */ + private Integer complete; + /** + * 任务完成率 + * */ + private BigDecimal completeRatio; + + private List<RiskAndPeopleInfoDTO> riskAndPeopleInfoDTO; +} diff --git a/src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportConfigLogRepository.java b/src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportConfigLogRepository.java index 628c259..e6d078a 100644 --- a/src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportConfigLogRepository.java +++ b/src/main/java/com/ruoyi/doublePrevention/repository/PreventCJReportConfigLogRepository.java @@ -7,7 +7,7 @@ @Repository public interface PreventCJReportConfigLogRepository extends BaseMapper<PreventCJReportConfigLog> { // -// /** +// /** extends BaseMapper<> // * 数据上报配置历史记录-查询 // */ // IPage<PreventCJReportConfigLog> getReportConfigLogPage(Page<Object> page, PreventReportConfigLogQueryReqDTO queryReqDTO); diff --git a/src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskDangerCheckLogRepository.java b/src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskDangerCheckLogRepository.java index ddf0c83..ce9c346 100644 --- a/src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskDangerCheckLogRepository.java +++ b/src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskDangerCheckLogRepository.java @@ -32,4 +32,6 @@ * 查询by checkId * */ PreventRiskDangerCheckLog getByDangerCheckByCheckId(Long checkId); + + PreventRiskDangerCheckLog getByDangerCheckByJobId(Long jobId); } diff --git a/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java b/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java new file mode 100644 index 0000000..ed176ca --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/repository/RiskAndPeopleInfoRepository.java @@ -0,0 +1,15 @@ +package com.ruoyi.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.doublePrevention.entity.RiskAndPeopleInfo; +import com.ruoyi.doublePrevention.entity.dto.req.RiskAndPeopleInfoReqBO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface RiskAndPeopleInfoRepository extends BaseMapper<RiskAndPeopleInfo> { + + List<RiskAndPeopleInfo> listRiskAndPeoplePage(@Param("queryReqDTO") RiskAndPeopleInfoReqBO reqBO); +} diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskDangerCheckLogService.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskDangerCheckLogService.java index 7f1e6e4..eab8183 100644 --- a/src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskDangerCheckLogService.java +++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskDangerCheckLogService.java @@ -29,4 +29,6 @@ * 查询by checkId * */ PreventRiskDangerCheckLog getByDangerCheckByCheckId(Long checkId); + + PreventRiskDangerCheckLog getByDangerCheckByJobId(Long jobId); } diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java new file mode 100644 index 0000000..9f242cb --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/RiskAndPeopleInfoService.java @@ -0,0 +1,12 @@ +package com.ruoyi.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.doublePrevention.entity.RiskAndPeopleInfo; +import com.ruoyi.doublePrevention.entity.dto.req.RiskAndPeopleInfoReqBO; +import com.ruoyi.doublePrevention.entity.dto.resp.RiskAndPeopleInfoRespDTO; +import com.ruoyi.doublePrevention.vo.ResultVO; + +public interface RiskAndPeopleInfoService extends IService<RiskAndPeopleInfo> { + + ResultVO<RiskAndPeopleInfoRespDTO> listRiskAndPeoplePage(RiskAndPeopleInfoReqBO reqBO); +} diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskDangerCheckLogServiceImpl.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskDangerCheckLogServiceImpl.java index d7494af..95c6e6f 100644 --- a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskDangerCheckLogServiceImpl.java +++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskDangerCheckLogServiceImpl.java @@ -58,4 +58,9 @@ public PreventRiskDangerCheckLog getByDangerCheckByCheckId(Long checkId) { return preventRiskDangerCheckLogRepository.getByDangerCheckByCheckId(checkId); } + + @Override + public PreventRiskDangerCheckLog getByDangerCheckByJobId(Long jobId) { + return preventRiskDangerCheckLogRepository.getByDangerCheckByJobId(jobId); + } } diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java new file mode 100644 index 0000000..6c69be9 --- /dev/null +++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/RiskAndPeopleInfoServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.ruoyi.common.exception.BusinessException; +import com.ruoyi.common.utils.BeanCopyUtils; +import com.ruoyi.doublePrevention.entity.PreventRiskDangerCheckLog; +import com.ruoyi.doublePrevention.entity.RiskAndPeopleInfo; +import com.ruoyi.doublePrevention.entity.dto.req.RiskAndPeopleInfoReqBO; +import com.ruoyi.doublePrevention.entity.dto.resp.RiskAndPeopleInfoDTO; +import com.ruoyi.doublePrevention.entity.dto.resp.RiskAndPeopleInfoRespDTO; +import com.ruoyi.doublePrevention.repository.RiskAndPeopleInfoRepository; +import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerCheckLogService; +import com.ruoyi.doublePrevention.service.baseService.RiskAndPeopleInfoService; +import com.ruoyi.doublePrevention.vo.ResultVO; +import com.ruoyi.project.tr.HiddenDangerCheckJob.domain.HiddenDangerCheckJobLog; +import com.ruoyi.project.tr.HiddenDangerCheckJob.service.IHiddenDangerCheckJobLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.RequestBody; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Service("RiskAndPeopleInfoService") +public class RiskAndPeopleInfoServiceImpl extends ServiceImpl<RiskAndPeopleInfoRepository, RiskAndPeopleInfo> implements RiskAndPeopleInfoService { + + @Autowired + private RiskAndPeopleInfoRepository repository; + + @Autowired + private IHiddenDangerCheckJobLogService hiddenDangerCheckJobLogService; + + @Autowired + private PreventRiskDangerCheckLogService preventRiskDangerCheckLogService; + + @Override + public ResultVO<RiskAndPeopleInfoRespDTO> listRiskAndPeoplePage(RiskAndPeopleInfoReqBO reqBO) { + + ResultVO resultVO = new ResultVO<>(); + + RiskAndPeopleInfoRespDTO respDTO = new RiskAndPeopleInfoRespDTO(); + + if (ObjectUtils.isEmpty(reqBO.getPageSize())){ + throw new BusinessException("分页信息不能为空"); + } + if (ObjectUtils.isEmpty(reqBO.getPageNum())){ + throw new BusinessException("分页信息不能为空"); + } + + Integer pageIndex = reqBO.getPageNum(); + Integer pageSize = reqBO.getPageSize(); + + Page<RiskAndPeopleInfo> page = PageHelper.startPage(pageIndex, pageSize); + List<RiskAndPeopleInfo> riskOldInfo = repository.listRiskAndPeoplePage(reqBO); + + List<HiddenDangerCheckJobLog> allCheckJobLogList = new ArrayList<>(); + List<HiddenDangerCheckJobLog> completeCheckJobLogList = new ArrayList<>(); + for (RiskAndPeopleInfo riskAndPeopleInfo : riskOldInfo) { + //取出操作人的id,依此为依据,查询所有的任务记录 check_user_id + List<HiddenDangerCheckJobLog> jobLogLists = hiddenDangerCheckJobLogService.getJobLogByCheckUserId(riskAndPeopleInfo.getHandleLiabilityPersonId()); + if (jobLogLists.size() > 0){ + for (HiddenDangerCheckJobLog jobLog : jobLogLists) { + PreventRiskDangerCheckLog preventRiskDangerCheckLog = preventRiskDangerCheckLogService.getByDangerCheckByJobId(jobLog.getJobId()); + if (preventRiskDangerCheckLog.getCheckStatus() != 3){ + completeCheckJobLogList.add(jobLog); + } + allCheckJobLogList.add(jobLog); + } + } + } + + List<RiskAndPeopleInfoDTO> riskAndPeopleList = BeanCopyUtils.copyBeanList(riskOldInfo, RiskAndPeopleInfoDTO.class); + + int completeRatio = 0; + if (allCheckJobLogList.size() > 0){ + completeRatio = completeCheckJobLogList.size() / allCheckJobLogList.size(); + } + respDTO.setRiskAndPeopleInfoDTO(riskAndPeopleList); + respDTO.setCount(allCheckJobLogList.size()); + respDTO.setComplete(completeCheckJobLogList.size()); + respDTO.setCompleteRatio(BigDecimal.valueOf(completeRatio)); + + resultVO.setPageSize(pageSize); + resultVO.setPageNum(pageIndex); + resultVO.setCount(riskAndPeopleList.size()); + resultVO.setData(respDTO); + + + + return resultVO; + } +} diff --git a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/mapper/HiddenDangerCheckJobLogMapper.java b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/mapper/HiddenDangerCheckJobLogMapper.java index d832ca5..ca372b6 100644 --- a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/mapper/HiddenDangerCheckJobLogMapper.java +++ b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/mapper/HiddenDangerCheckJobLogMapper.java @@ -62,4 +62,6 @@ * 清空任务日志 */ void cleanJobLog(); + + List<HiddenDangerCheckJobLog> getJobLogByCheckUserId(Long handleLiabilityPersonId); } diff --git a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/HiddenDangerCheckJobLogServiceImpl.java b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/HiddenDangerCheckJobLogServiceImpl.java index a24f439..6f69c91 100644 --- a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/HiddenDangerCheckJobLogServiceImpl.java +++ b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/HiddenDangerCheckJobLogServiceImpl.java @@ -85,4 +85,9 @@ { jobLogMapper.cleanJobLog(); } + + @Override + public List<HiddenDangerCheckJobLog> getJobLogByCheckUserId(Long handleLiabilityPersonId) { + return jobLogMapper.getJobLogByCheckUserId(handleLiabilityPersonId); + } } diff --git a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/IHiddenDangerCheckJobLogService.java b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/IHiddenDangerCheckJobLogService.java index 8ed0ddd..da8b502 100644 --- a/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/IHiddenDangerCheckJobLogService.java +++ b/src/main/java/com/ruoyi/project/tr/HiddenDangerCheckJob/service/IHiddenDangerCheckJobLogService.java @@ -54,4 +54,6 @@ * 清空任务日志 */ void cleanJobLog(); + + List<HiddenDangerCheckJobLog> getJobLogByCheckUserId(Long handleLiabilityPersonId); } diff --git a/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/controller/RiskEvaluationController.java b/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/controller/RiskEvaluationController.java index 3e60c40..b146c5a 100644 --- a/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/controller/RiskEvaluationController.java +++ b/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/controller/RiskEvaluationController.java @@ -266,6 +266,7 @@ List<RiskEvaluationDTO> deviceList = util.importExcel(file.getInputStream()); RiskList risk = new RiskList(); + int tag = 0; RiskEvaluationPlan plan = new RiskEvaluationPlan(); //首先添加设备 @@ -333,12 +334,14 @@ //保存复制过的对象 int addNum = riskListService.insertRiskList(risk); - if (addNum<= 0){ - throw new Exception("设备导入失败!"); + if (addNum > 0){ + tag = 1; } } } - + if (tag == 0){ + return AjaxResult.success("导入失败!"); + } return AjaxResult.success("导入成功!"); } diff --git a/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/domain/dto/RiskEvaluationDTO.java b/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/domain/dto/RiskEvaluationDTO.java index 2b74f7f..6653ca3 100644 --- a/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/domain/dto/RiskEvaluationDTO.java +++ b/src/main/java/com/ruoyi/project/tr/riskEvaluationPlan/domain/dto/RiskEvaluationDTO.java @@ -21,15 +21,15 @@ //风险单元相关字段********************************************************************************************************** /** 风险单元编号 */ - @Excel(name = "设备编号") + @Excel(name = "风险点编号") private String riskListNum; /** 风险单元名称 */ - @Excel(name = "设备名称") + @Excel(name = "风险点名称") private String riskListName; /** 是否特种(1否,2是) */ - @Excel(name = "是否特种") + @Excel(name = "是否特种(1否,2是)") private Long riskListIsSpecial; /** 图片 */ @@ -44,6 +44,8 @@ @Excel(name = "规格/型号") private String riskListDeviceModel; + + /** 作业活动类型 */ @Excel(name = "作业活动类型") private String riskListWorkType; diff --git a/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml b/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml index b3b654e..f9a16eb 100644 --- a/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml +++ b/src/main/resources/mybatis/doublePrevention/PreventRiskDangerCheckLogMapper.xml @@ -48,6 +48,11 @@ select * from prevent_risk_danger_check_log where check_id = #{checkId} </select> + + <select id="getByDangerCheckByJobId" resultMap="BaseResultMap"> + select * from prevent_risk_danger_check_log + where job_id = #{jobId} + </select> </mapper> diff --git a/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml b/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml new file mode 100644 index 0000000..9deb4d9 --- /dev/null +++ b/src/main/resources/mybatis/doublePrevention/RiskAndPeopleMapper.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.ruoyi.doublePrevention.repository.RiskAndPeopleInfoRepository"> + + <resultMap type="com.ruoyi.doublePrevention.entity.RiskAndPeopleInfo" id="Result"> + <id property="id" column="id"/> + + <result column="area_code" property="areaCode"/> + <result column="company_name" property="companyName"/> + <result column="company_nature" property="companyNature"/> + <result column="company_nature_name" property="companyNatureName"/> + <result column="hazard_id" property="hazardId"/> + <result column="hazard_code" property="hazardCode"/> + <result column="hazard_name" property="hazardName"/> + <result column="hazard_rank" property="hazardRank"/> + <result column="hazard_rank_name" property="hazardRankName"/> + <result column="park_name" property="parkName"/> + + <result column="main_liability_person_id" property="mainLiabilityPersonId"/> + <result column="main_liability_person_name" property="mainLiabilityPersonName"/> + <result column="main_liability_person_type" property="mainLiabilityPersonType"/> + <result column="main_liability_person_phone" property="mainLiabilityPersonPhone"/> + <result column="main_liability_person_job" property="mainLiabilityPersonJob"/> + <result column="main_liability_person_work" property="mainLiabilityPersonWork"/> + <result column="technology_liability_person_id" property="technologyLiabilityPersonId"/> + <result column="technology_liability_person_name" property="technologyLiabilityPersonName"/> + <result column="technology_liability_person_type" property="technologyLiabilityPersonType"/> + <result column="technology_liability_person_phone" property="technologyLiabilityPersonPhone"/> + <result column="technology_liability_person_job" property="technologyLiabilityPersonJob"/> + <result column="technology_liability_person_work" property="technologyLiabilityPersonWork"/> + <result column="handle_liability_person_id" property="handleLiabilityPersonId"/> + <result column="handle_liability_person_name" property="handleLiabilityPersonName"/> + <result column="handle_liability_person_type" property="handleLiabilityPersonType"/> + <result column="handle_liability_person_phone" property="handleLiabilityPersonPhone"/> + <result column="handle_liability_person_job" property="handleLiabilityPersonJob"/> + <result column="handle_liability_person_work" property="handleLiabilityPersonWork"/> + + <result column="delete_status" property="deleteStatus"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_moditify" property="gmtModitify"/> + <result column="create_by_user_name" property="createByUserName"/> + <result column="last_edit_user_name" property="lastEditUserName"/> + </resultMap> + + <select id="listRiskAndPeoplePage" resultMap="Result"> + select * from risk_and_people_info where delete_status = 0 + </select> + + +</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/tr/HiddenDangerCheckJobLogMapper.xml b/src/main/resources/mybatis/tr/HiddenDangerCheckJobLogMapper.xml index c6ea397..3067213 100644 --- a/src/main/resources/mybatis/tr/HiddenDangerCheckJobLogMapper.xml +++ b/src/main/resources/mybatis/tr/HiddenDangerCheckJobLogMapper.xml @@ -50,7 +50,7 @@ <include refid="selectJobLogVo"/> where check_job_log_id = #{checkJobLogId} </select> - + <delete id="deleteJobLogById" parameterType="Long"> delete from tr_hidden_danger_check_job_log where check_job_log_id = #{checkJobLogId} </delete> @@ -88,4 +88,13 @@ ) </insert> + + + + + <select id="getJobLogByCheckUserId" + resultType="com.ruoyi.project.tr.HiddenDangerCheckJob.domain.HiddenDangerCheckJobLog"> + select * from tr_hidden_danger_check_job_log where check_user_id = #{handleLiabilityPersonId} + </select> + </mapper> \ No newline at end of file -- Gitblit v1.9.2