已修改15个文件
已添加15个文件
已重命名1个文件
| | |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param pageQuery 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<TargetExamineQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.targetExamineService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | import java.net.URLEncoder; |
| | | import java.sql.Timestamp; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 目标指标(TargetMng)表控制层 |
| | |
| | | package com.gkhy.safePlatform.targetDuty.entity; |
| | | |
| | | import java.sql.Timestamp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.gkhy.safePlatform.targetDuty.entity.BaseDomain; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * 目标指标(TargetMng)表实体类 |
| | | * |
| | | * @author xurui |
| | | * @since 2022-07-20 11:49:22 |
| | | * @since 2022-08-22 11:00:59 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @TableName("target_mng") |
| | | public class TargetMng extends BaseDomain { |
| | | |
| | | |
| | | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | public Long getId() { |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | //安全目标指标 |
| | | //安全目标指标 |
| | | private String qName; |
| | | |
| | | public String getqName() { |
| | |
| | | public void setqName(String qName) { |
| | | this.qName = qName; |
| | | } |
| | | |
| | | //目标指标编号 |
| | | private String indexNum; |
| | | |
| | | |
| | | public String getIndexNum() { |
| | | return indexNum; |
| | | } |
| | |
| | | public void setIndexNum(String indexNum) { |
| | | this.indexNum = indexNum; |
| | | } |
| | | //年度 |
| | | //年度 |
| | | private String year; |
| | | |
| | | |
| | | public String getYear() { |
| | | return year; |
| | | } |
| | |
| | | public void setYear(String year) { |
| | | this.year = year; |
| | | } |
| | | //指标值 |
| | | //指标值 |
| | | private String value; |
| | | |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | //指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | //1:大于 2:等于 3:小于 |
| | | private Integer valueSign; |
| | | |
| | | public Integer getValueSign() { |
| | | return valueSign; |
| | | } |
| | | |
| | | public void setValueSign(Integer valueSign) { |
| | | this.valueSign = valueSign; |
| | | } |
| | | //指标级别 1:公司级 2:部门分厂级 3:工段班组级 |
| | | private Integer level; |
| | | |
| | | |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | //完成期限 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | //完成期限 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Timestamp completeDate; |
| | | |
| | | |
| | | public Timestamp getCompleteDate() { |
| | | return completeDate; |
| | | } |
| | |
| | | public void setCompleteDate(Timestamp completeDate) { |
| | | this.completeDate = completeDate; |
| | | } |
| | | //备注信息 |
| | | //备注信息 |
| | | private String memo; |
| | | |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | //指标类型 1:年指标 2:月指标 |
| | | //指标类型 1:年指标 2:月指标 3:半年 4:季度 |
| | | private Integer targetType; |
| | | |
| | | |
| | | public Integer getTargetType() { |
| | | return targetType; |
| | | } |
| | |
| | | public void setTargetType(Integer targetType) { |
| | | this.targetType = targetType; |
| | | } |
| | | //分解状态 1:已分解 2:未分解 |
| | | //分解状态 1:已分解 2:未分解 |
| | | private Integer divideStatus; |
| | | |
| | | |
| | | public Integer getDivideStatus() { |
| | | return divideStatus; |
| | | } |
| | |
| | | public void setDivideStatus(Integer divideStatus) { |
| | | this.divideStatus = divideStatus; |
| | | } |
| | | |
| | | } |
| | | //目标制定部门 |
| | | private Long makerDepartmentId; |
| | | |
| | | public Long getMakerDepartmentId() { |
| | | return makerDepartmentId; |
| | | } |
| | | |
| | | public void setMakerDepartmentId(Long makerDepartmentId) { |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | |
| | | } |
| | |
| | | public void setExamineTemplateName(String examineTemplateName) { |
| | | this.examineTemplateName = examineTemplateName; |
| | | } |
| | | |
| | | } |
| | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | //目标制定部门 |
| | | private Long makerDepartmentId; |
| | | |
| | | public Long getMakerDepartmentId() { |
| | | return makerDepartmentId; |
| | | } |
| | | |
| | | public void setMakerDepartmentId(Long makerDepartmentId) { |
| | | this.makerDepartmentId = makerDepartmentId; |
| | | } |
| | | |
| | | |
| | | //目标制定部门名称 |
| | | private String makerDepartmentName; |
| | | |
| | | public String getMakerDepartmentName() { |
| | | return makerDepartmentName; |
| | | } |
| | | |
| | | public void setMakerDepartmentName(String makerDepartmentName) { |
| | | this.makerDepartmentName = makerDepartmentName; |
| | | } |
| | | |
| | | //1:大于 2:等于 3:小于 |
| | | private Integer valueSign; |
| | | |
| | | public Integer getValueSign() { |
| | | return valueSign; |
| | | } |
| | | |
| | | public void setValueSign(Integer valueSign) { |
| | | this.valueSign = valueSign; |
| | | } |
| | | } |
| | |
| | | "</script> ") |
| | | Integer selectTotal(Map<String, Object> beanToMap); |
| | | |
| | | @Select("<script>select COUNT(target_id) from target_divide_detail a INNER JOIN target_mng b on a.target_id = b.id \n" + |
| | | @Select("<script>select COUNT(1) from (select a.target_id from target_divide_detail a INNER JOIN target_mng b on a.target_id = b.id \n" + |
| | | "WHERE a.id not in (select target_divide_detail_id from target_examine where examine_result = 1)\n" + |
| | | "<if test =\"divideStatus !='' and divideStatus !=null\">and b.divide_status = #{divideStatus}</if> " + |
| | | "<if test =\"targetType !='' and targetType !=null\">and b.target_type = #{targetType}</if>" + |
| | | "<if test =\"qName !='' and qName !=null\">and b.q_name = #{qName}</if>" + |
| | | "<if test =\"indexNum !='' and indexNum !=null\">and b.index_num = #{indexNum}</if>" + |
| | | "GROUP BY a.target_id</script> ") |
| | | "GROUP BY a.target_id) x</script> ") |
| | | Integer selectNoComplete(Map<String, Object> beanToMap); |
| | | } |
| | |
| | | * @since 2022-07-22 09:30:01 |
| | | */ |
| | | public interface TargetExamineService extends IService<TargetExamine> { |
| | | ResultVO queryAll(PageQuery<TargetExamineQueryCriteria> pageQuery); |
| | | |
| | | List<TargetExamine> queryAll(TargetExamineQueryCriteria criteria); |
| | | |
| | | // void addOrUpdate(TargetExamineSaveOrUpdate infoDto); |
| | |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.ExamineMngService; |
| | | import com.gkhy.safePlatform.targetDuty.service.ExamineTemplateService; |
| | | import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<ExamineMngQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | |
| | | List<CurrentExamineDto> list = JSONObject.parseArray( dto.getNumberDetailJson(), CurrentExamineDto.class); |
| | | List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList()); |
| | | |
| | | if (!idList.isEmpty()){ |
| | | if(!idList.isEmpty()){ |
| | | List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList); |
| | | Map<Long,ExamineItem> itemMap = itemList.stream().collect( |
| | | Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1)); |
| | |
| | | |
| | | return dto; |
| | | } |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private TargetTypeRepository targetTypeRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetExamineQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | IPage<TargetMng> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | page = targetMngRepository.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetMng.class, pageQuery.getSearchParams())); |
| | | List<TargetExamineDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetExamineDto.class); |
| | | respList.forEach(dto->{ |
| | | //查询关联分解信息 |
| | | TargetDivideDetailQueryCriteria criteria = new TargetDivideDetailQueryCriteria(); |
| | | criteria.setTargetId(dto.getId()); |
| | | List<TargetDivideDetailDto> respList1 = BeanCopyUtils.copyBeanList(targetDivideDetailService.queryAll(criteria), TargetDivideDetailDto.class); |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | |
| | | // --------------------------- 获取目标分类名称----------------------- |
| | | //收集所用到的目标分类ID |
| | | Set<Long> collectTypeSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectTypeSet.add(f.getTargetTypeId()); |
| | | }); |
| | | //获取目标分类名集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetType> typeList = targetTypeRepository.selectBatchIds(collectTypeSet); // TODO |
| | | Map<Long,String> typeNameMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setTargetTypeName(typeNameMap.get(f.getTargetTypeId())); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // --------------------------- 获取考核结果----------------------- |
| | | //收集所用到的分解详情ID |
| | | Set<Long> collectExamResultSet = new HashSet(); |
| | | respList1.forEach(f->{ |
| | | collectExamResultSet.add(f.getId()); |
| | | }); |
| | | //获取核结果集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectBatchIds(collectTypeSet); |
| | | Map<Long,Integer> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getId, TargetExamine::getExamineResult,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setExamineResult(examResultMap.get(f.getId())); |
| | | }); |
| | | } |
| | | |
| | | |
| | | dto.setTargetDivideDetailList(respList1); |
| | | }); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<TargetExamine> queryAll(TargetExamineQueryCriteria criteria) { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.BeanUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDivideDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import com.gkhy.safePlatform.targetDuty.utils.BeanToMapUtil; |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.beans.IntrospectionException; |
| | | import java.io.Serializable; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | |
| | | QueryHelpPlus.getPredicate(TargetMng.class, pageQuery.getSearchParams())); |
| | | List<TargetMngDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetMngDto.class); |
| | | respList.forEach(dto->{ |
| | | // --------------------------- 获取部门信息----------------------- |
| | | dto.setMakerDepartmentName(commonService.getDepName(dto.getMakerDepartmentId())); |
| | | |
| | | //查询关联分解信息 |
| | | TargetDivideDetailQueryCriteria criteria = new TargetDivideDetailQueryCriteria(); |
| | | criteria.setTargetId(dto.getId()); |
| | |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | Map<Long, String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList1.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | |
| | | //获取目标分类名集合 |
| | | if(!collectTypeSet.isEmpty()){ |
| | | List<TargetType> typeList = targetTypeRepository.selectBatchIds(collectTypeSet); // TODO |
| | | Map<Long,String> typeNameMap = typeList.stream() |
| | | Map<Long, String> typeNameMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetType::getId, TargetType::getTypeName,(k1, k2)->k1)); |
| | | |
| | | respList1.forEach(f->{ |
| | |
| | | return null; |
| | | } |
| | | TargetMngDto targetMngDto = BeanCopyUtils.copyBean(targetMng, TargetMngDto.class); |
| | | // --------------------------- 获取部门信息----------------------- |
| | | targetMngDto.setMakerDepartmentName(commonService.getDepName(targetMngDto.getMakerDepartmentId())); |
| | | |
| | | //查询关联分解信息 |
| | | TargetDivideDetailQueryCriteria criteria = new TargetDivideDetailQueryCriteria(); |
| | |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | Map<Long, String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | |
| | | //获取核结果集合 |
| | | if(!collectExamResultSet.isEmpty()){ |
| | | List<TargetExamine> typeList = targetExamineRepository.selectList(new QueryWrapper<TargetExamine>().in("target_divide_detail_id",collectExamResultSet)); |
| | | Map<Long,TargetExamine> examResultMap = typeList.stream() |
| | | Map<Long, TargetExamine> examResultMap = typeList.stream() |
| | | .collect(Collectors.toMap(TargetExamine::getTargetDivideDetailId, Function.identity(),(k1, k2)->k1)); |
| | | |
| | | respList.forEach(f->{ |
| | |
| | | |
| | | @Override |
| | | public Object statistics(TargetMngQueryCriteria criteria) { |
| | | Map<String,String> map = new HashMap<>(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | // 查询总数 |
| | | Integer total = 0; |
| | | // 完成数量 |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.controller; |
| | | |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentCaseReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCaseDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCasePageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentCaseQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentCaseService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/accidentCase") |
| | | public class AccidentCaseController { |
| | | |
| | | @Autowired |
| | | private AccidentCaseService accidentCaseService; |
| | | |
| | | /** |
| | | * 事故报告列表 |
| | | */ |
| | | @RequestMapping(value = "/page/list" ,method = RequestMethod.POST) |
| | | private ResultVO<List<AccidentCasePageRespDTO>> list (@RequestBody PageQuery<AccidentCaseQuery> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | return accidentCaseService.selectAccidentCaseList(pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 事故报告新增 |
| | | */ |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO addAccidentCase(Authentication authentication, @RequestBody AccidentCaseReqDTO AccidentCaseReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accidentCaseService.addAccidentCase(currentUser.getUid(), AccidentCaseReqDTO); |
| | | } |
| | | |
| | | /** |
| | | * 事故报告详情 |
| | | */ |
| | | @RequestMapping(value = "/info/{id}",method = RequestMethod.GET) |
| | | public ResultVO<AccidentCaseDetailRespDTO> getAccidentCaseById(@PathVariable("id")Long id){ |
| | | return accidentCaseService.getAccidentCaseById(id); |
| | | } |
| | | |
| | | /** |
| | | * 事故报告修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateAccidentCase(Authentication authentication, @RequestBody AccidentCaseReqDTO AccidentCaseReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accidentCaseService.updateAccidentCase(currentUser.getUid(), AccidentCaseReqDTO); |
| | | } |
| | | |
| | | /** |
| | | * 事故报告删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteAccidentCase(@RequestBody Long[] ids){ |
| | | return accidentCaseService.batchDeleteAccidentCase(ids); |
| | | } |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @TableName("accident_case") |
| | | public class AccidentCaseInfo { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private Boolean delFlag; |
| | | |
| | | private Date gmtCreate; |
| | | |
| | | private Date gmtModitify; |
| | | |
| | | private Long createUid; |
| | | |
| | | private Long updateUid; |
| | | |
| | | private String caseTitle; |
| | | |
| | | private String caseContent; |
| | | |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Boolean getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(Boolean delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public Date getGmtCreate() { |
| | | return gmtCreate; |
| | | } |
| | | |
| | | public void setGmtCreate(Date gmtCreate) { |
| | | this.gmtCreate = gmtCreate; |
| | | } |
| | | |
| | | public Date getGmtModitify() { |
| | | return gmtModitify; |
| | | } |
| | | |
| | | public void setGmtModitify(Date gmtModitify) { |
| | | this.gmtModitify = gmtModitify; |
| | | } |
| | | |
| | | public Long getCreateUid() { |
| | | return createUid; |
| | | } |
| | | |
| | | public void setCreateUid(Long createUid) { |
| | | this.createUid = createUid; |
| | | } |
| | | |
| | | public Long getUpdateUid() { |
| | | return updateUid; |
| | | } |
| | | |
| | | public void setUpdateUid(Long updateUid) { |
| | | this.updateUid = updateUid; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public String getCaseContent() { |
| | | return caseContent; |
| | | } |
| | | |
| | | public void setCaseContent(String caseContent) { |
| | | this.caseContent = caseContent; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("accident_case") |
| | | public class AccidentCaseInfoDetailDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String caseTitle; |
| | | |
| | | private String caseContent; |
| | | |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public String getCaseContent() { |
| | | return caseContent; |
| | | } |
| | | |
| | | public void setCaseContent(String caseContent) { |
| | | this.caseContent = caseContent; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("accident_case") |
| | | public class AccidentCaseInfoPageDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String caseTitle; |
| | | |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
| | |
| | | WORK_INJURY_DECLARATION_TYPE_NULL("W1006", "工伤类型不可为空"), |
| | | WORK_INJURY_DECLARATION_Date_NULL("W1006", "申报日期不可为空"), |
| | | |
| | | CASE_NULL("C1001", "事故案例不可为空"), |
| | | CASE_NOT_EXIST("C1002", "事故案例不存在"), |
| | | CASE_TITLE_NULL("C1003", "事故案例标题不可为空"), |
| | | CASE_CONTENT_NULL("C1004", "事故案例内容不可为空"), |
| | | |
| | | ERROR("A3000", "未知错误"); |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.model.dto.req; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class AccidentCaseReqDTO { |
| | | |
| | | private Long id; |
| | | |
| | | private String caseTitle; |
| | | |
| | | private String caseContent; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public String getCaseContent() { |
| | | return caseContent; |
| | | } |
| | | |
| | | public void setCaseContent(String caseContent) { |
| | | this.caseContent = caseContent; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.model.dto.resp; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class AccidentCaseDetailRespDTO { |
| | | |
| | | private Long id; |
| | | |
| | | private String caseTitle; |
| | | |
| | | private String caseContent; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public String getCaseContent() { |
| | | return caseContent; |
| | | } |
| | | |
| | | public void setCaseContent(String caseContent) { |
| | | this.caseContent = caseContent; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.model.dto.resp; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class AccidentCasePageRespDTO { |
| | | |
| | | private Long id; |
| | | |
| | | private String caseTitle; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date caseTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | |
| | | public Date getCaseTime() { |
| | | return caseTime; |
| | | } |
| | | |
| | | public void setCaseTime(Date caseTime) { |
| | | this.caseTime = caseTime; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query; |
| | | |
| | | public class AccidentCaseQuery { |
| | | |
| | | private String caseTitle; |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query.db; |
| | | |
| | | public class AccidentCaseDBQuery { |
| | | |
| | | private String caseTitle; |
| | | |
| | | public String getCaseTitle() { |
| | | return caseTitle; |
| | | } |
| | | |
| | | public void setCaseTitle(String caseTitle) { |
| | | this.caseTitle = caseTitle; |
| | | } |
| | | } |
文件名从 incident-manage/incident-manage-service/src/main/java/com/gkhy/safePlatform/incidentManage/query/db/AccidentReportRPCDBQuery.java 修改 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.query.db; |
| | | |
| | | public class AccidentReportRPCDBQuery { |
| | | public class AccidentReportCountDBQuery { |
| | | |
| | | private String level; |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.repository; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentCaseDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface AccidentCaseInfoRepository extends BaseMapper<AccidentCaseInfo> { |
| | | |
| | | List<AccidentCaseInfoPageDO> selectAccidentCaseList(Page<AccidentCaseInfoPageDO> page, @Param("query") AccidentCaseDBQuery accidentCaseDBQuery); |
| | | |
| | | void addAccidentCase(AccidentCaseInfo accidentCaseInfo); |
| | | |
| | | AccidentCaseInfoDetailDO selectAccidentCaseById(@Param("id") Long id); |
| | | |
| | | void updateAccidentCase(AccidentCaseInfo accidentCaseInfo); |
| | | |
| | | void deleteAccidentCaseById(@Param("id") Long id); |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportCountDBQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | |
| | | void deleteAccidentReportById(@Param("id") Long id); |
| | | |
| | | List<AccidentReportCount> selectByTimeAndType(@Param("query")AccidentReportRPCDBQuery dbQuery); |
| | | List<AccidentReportCount> selectByTimeAndType(@Param("query") AccidentReportCountDBQuery dbQuery); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service; |
| | | |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentCaseReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCaseDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCasePageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentCaseQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AccidentCaseService { |
| | | |
| | | SearchResultVO<List<AccidentCasePageRespDTO>> selectAccidentCaseList(PageQuery<AccidentCaseQuery> query); |
| | | |
| | | ResultVO addAccidentCase(Long valueOf, AccidentCaseReqDTO AccidentCaseReqDTO); |
| | | |
| | | ResultVO<AccidentCaseDetailRespDTO> getAccidentCaseById(Long id); |
| | | |
| | | ResultVO updateAccidentCase(Long uid, AccidentCaseReqDTO AccidentCaseReqDTO); |
| | | |
| | | ResultVO batchDeleteAccidentCase(Long[] ids); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service.baseService; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentCaseDBQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface AccidentCaseInfoService extends IService<AccidentCaseInfo> { |
| | | |
| | | List<AccidentCaseInfoPageDO> selectAccidentCaseList(Page<AccidentCaseInfoPageDO> page, AccidentCaseDBQuery AccidentCaseDBQuery); |
| | | |
| | | void addAccidentCase(AccidentCaseInfo AccidentCaseInfo); |
| | | |
| | | AccidentCaseInfoDetailDO selectAccidentCaseById(Long id); |
| | | |
| | | void updateAccidentCase(AccidentCaseInfo AccidentCaseInfo); |
| | | |
| | | void deleteAccidentCaseById(Long teamId); |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportCountDBQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | void deleteAccidentReportById(Long teamId); |
| | | |
| | | List<AccidentReportCount> selectByTimeAndType(AccidentReportRPCDBQuery dbQuery); |
| | | List<AccidentReportCount> selectByTimeAndType(AccidentReportCountDBQuery dbQuery); |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service.baseService.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfo; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentCaseDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.repository.AccidentCaseInfoRepository; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentCaseInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("accidentCaseInfoService") |
| | | public class AccidentCaseInfoServiceImpl extends ServiceImpl<AccidentCaseInfoRepository, AccidentCaseInfo> implements AccidentCaseInfoService { |
| | | |
| | | @Autowired |
| | | private AccidentCaseInfoRepository accidentCaseInfoRepository; |
| | | |
| | | @Override |
| | | public List<AccidentCaseInfoPageDO> selectAccidentCaseList(Page<AccidentCaseInfoPageDO> page, AccidentCaseDBQuery AccidentCaseDBQuery) { |
| | | return accidentCaseInfoRepository.selectAccidentCaseList(page,AccidentCaseDBQuery); |
| | | } |
| | | |
| | | @Override |
| | | public void addAccidentCase(AccidentCaseInfo AccidentCaseInfo) { |
| | | accidentCaseInfoRepository.addAccidentCase(AccidentCaseInfo); |
| | | } |
| | | |
| | | @Override |
| | | public AccidentCaseInfoDetailDO selectAccidentCaseById(Long id) { |
| | | return accidentCaseInfoRepository.selectAccidentCaseById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void updateAccidentCase(AccidentCaseInfo AccidentCaseInfo) { |
| | | accidentCaseInfoRepository.updateAccidentCase(AccidentCaseInfo); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAccidentCaseById(Long teamId) { |
| | | accidentCaseInfoRepository.deleteAccidentCaseById(teamId); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoDetailDO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.AccidentReportInfoPageDO; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportCountDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.repository.AccidentReportInfoRepository; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AccidentReportCount> selectByTimeAndType(AccidentReportRPCDBQuery dbQuery) { |
| | | public List<AccidentReportCount> selectByTimeAndType(AccidentReportCountDBQuery dbQuery) { |
| | | return accidentReportInfoRepository.selectByTimeAndType(dbQuery); |
| | | } |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.incidentManage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.*; |
| | | import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes; |
| | | import com.gkhy.safePlatform.incidentManage.exception.AccidentException; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentCaseReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCaseDetailRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentCasePageRespDTO; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentCaseQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentCaseDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentCaseService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentCaseInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service("accidentCaseService") |
| | | public class AccidentCaseServiceImpl implements AccidentCaseService { |
| | | |
| | | @Autowired |
| | | private AccidentCaseInfoService accidentCaseInfoService; |
| | | |
| | | |
| | | @Override |
| | | public SearchResultVO<List<AccidentCasePageRespDTO>> selectAccidentCaseList(PageQuery<AccidentCaseQuery> query) { |
| | | Long pageIndex = query.getPageIndex(); |
| | | Long pageSize = query.getPageSize(); |
| | | Page<AccidentCaseInfoPageDO> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | AccidentCaseDBQuery accidentCaseDBQuery = new AccidentCaseDBQuery(); |
| | | if (query.getSearchParams() != null) { |
| | | BeanUtils.copyProperties(query.getSearchParams(), accidentCaseDBQuery); |
| | | } |
| | | |
| | | List<AccidentCaseInfoPageDO> accidentCaseInfoPageDOList = accidentCaseInfoService.selectAccidentCaseList(page, accidentCaseDBQuery); |
| | | List<AccidentCasePageRespDTO> respList = BeanCopyUtils.copyBeanList(accidentCaseInfoPageDOList, AccidentCasePageRespDTO.class); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize, page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO addAccidentCase(Long uid, AccidentCaseReqDTO accidentCaseReqDTO) { |
| | | //必填项验证 |
| | | checkRequired(accidentCaseReqDTO); |
| | | |
| | | Date nowDate = new Date(); |
| | | //1.新增事故案例 |
| | | AccidentCaseInfo accidentCaseInfo = new AccidentCaseInfo(); |
| | | BeanUtils.copyProperties(accidentCaseReqDTO, accidentCaseInfo); |
| | | accidentCaseInfo.setDelFlag(false); |
| | | accidentCaseInfo.setCreateUid(uid); |
| | | accidentCaseInfo.setGmtCreate(nowDate); |
| | | accidentCaseInfoService.addAccidentCase(accidentCaseInfo); |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<AccidentCaseDetailRespDTO> getAccidentCaseById(Long id) { |
| | | AccidentCaseDetailRespDTO AccidentCaseDetailRespDTO = new AccidentCaseDetailRespDTO(); |
| | | //查询是否存在 |
| | | AccidentCaseInfoDetailDO AccidentCaseInfoDetailDO = accidentCaseInfoService.selectAccidentCaseById(id); |
| | | if (AccidentCaseInfoDetailDO == null) { |
| | | throw new AccidentException(AccidentResultCodes.CASE_NOT_EXIST); |
| | | } else { |
| | | BeanUtils.copyProperties(AccidentCaseInfoDetailDO, AccidentCaseDetailRespDTO); |
| | | |
| | | return new ResultVO<>(ResultCodes.OK, AccidentCaseDetailRespDTO); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO updateAccidentCase(Long uid, AccidentCaseReqDTO accidentCaseReqDTO) { |
| | | Date nowDate = new Date(); |
| | | //查询是否存在 |
| | | AccidentCaseInfoDetailDO AccidentCaseInfoDetailDO = accidentCaseInfoService.selectAccidentCaseById(accidentCaseReqDTO.getId()); |
| | | if (AccidentCaseInfoDetailDO == null) { |
| | | throw new AccidentException(AccidentResultCodes.CASE_NOT_EXIST); |
| | | } else { |
| | | AccidentCaseInfo accidentCaseInfo = new AccidentCaseInfo(); |
| | | BeanUtils.copyProperties(accidentCaseReqDTO, accidentCaseInfo); |
| | | accidentCaseInfo.setUpdateUid(uid); |
| | | accidentCaseInfo.setGmtModitify(nowDate); |
| | | accidentCaseInfoService.updateAccidentCase(accidentCaseInfo); |
| | | |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteAccidentCase(Long[] ids) { |
| | | if (ids == null || ids.length==0){ |
| | | throw new AccidentException(AccidentResultCodes.CASE_NULL); |
| | | } else { |
| | | for (Long id : ids){ |
| | | deleteAccidentCase(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | private void deleteAccidentCase(Long id) { |
| | | //查询是否存在 |
| | | AccidentCaseInfoDetailDO AccidentCaseInfoDetailDO = accidentCaseInfoService.selectAccidentCaseById(id); |
| | | if (AccidentCaseInfoDetailDO == null) { |
| | | throw new AccidentException(AccidentResultCodes.CASE_NOT_EXIST); |
| | | } else { |
| | | accidentCaseInfoService.deleteAccidentCaseById(id); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 验证必填项 |
| | | * |
| | | * @return |
| | | */ |
| | | private void checkRequired(AccidentCaseReqDTO AccidentCaseReqDTO) { |
| | | // 事故案例标题 |
| | | if (AccidentCaseReqDTO.getCaseTitle() == null) { |
| | | throw new AccidentException(AccidentResultCodes.CASE_TITLE_NULL); |
| | | } |
| | | // 事故案例内容 |
| | | if (StringUtils.isBlank(AccidentCaseReqDTO.getCaseContent())) { |
| | | throw new AccidentException(AccidentResultCodes.CASE_CONTENT_NULL); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.incidentManage.entity.*; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.resp.*; |
| | | import com.gkhy.safePlatform.incidentManage.query.AccidentReportCountQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportRPCDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.query.db.AccidentReportCountDBQuery; |
| | | import com.gkhy.safePlatform.incidentManage.service.AccidentCountService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentReportInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.utils.TimeUtils; |
| | |
| | | public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(AccidentReportCountQuery query) { |
| | | |
| | | List<AccidentReportCount> list = new ArrayList<>(); |
| | | AccidentReportRPCDBQuery dbQuery = new AccidentReportRPCDBQuery(); |
| | | AccidentReportCountDBQuery dbQuery = new AccidentReportCountDBQuery(); |
| | | if (query.getType() == 1) { |
| | | // 月 |
| | | int year = query.getYear(); |
对比新文件 |
| | |
| | | <?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.gkhy.safePlatform.incidentManage.repository.AccidentCaseInfoRepository"> |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoPageDO" id="AccidentCaseInfoPageDOResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="case_title" property="caseTitle"/> |
| | | <result column="case_time" property="caseTime"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectAccidentCaseList" resultMap="AccidentCaseInfoPageDOResult"> |
| | | SELECT |
| | | id,case_title,case_time |
| | | FROM |
| | | accident_case |
| | | WHERE |
| | | del_flag = 0 |
| | | <if test="query.caseTitle != null and query.caseTitle != ''">and case_title = #{query.caseTitle}</if> |
| | | </select> |
| | | |
| | | <insert id="addAccidentCase" parameterType="com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfo" |
| | | keyProperty="id" useGeneratedKeys="true"> |
| | | insert into accident_Case |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">id,</if> |
| | | <if test="delFlag != null ">del_flag,</if> |
| | | <if test="gmtCreate != null ">gmt_create,</if> |
| | | <if test="gmtModitify != null ">gmt_moditify,</if> |
| | | <if test="createUid != null ">create_uid,</if> |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | |
| | | <if test="caseTitle != null and caseTitle != ''">case_title,</if> |
| | | <if test="caseContent != null and caseContent != ''">case_content,</if> |
| | | <if test="caseTime != null ">case_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | | <if test="delFlag != null ">#{delFlag},</if> |
| | | <if test="gmtCreate != null ">#{gmtCreate},</if> |
| | | <if test="gmtModitify != null ">#{gmtModitify},</if> |
| | | <if test="createUid != null ">#{createUid},</if> |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | |
| | | <if test="caseTitle != null and caseTitle != ''">#{caseTitle},</if> |
| | | <if test="caseContent != null and caseContent != ''">#{caseContent},</if> |
| | | <if test="caseTime != null ">#{caseTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfoDetailDO" id="AccidentCaseInfoDetailDOResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="case_title" property="caseTitle"/> |
| | | <result column="case_time" property="caseTime"/> |
| | | <result column="case_content" property="caseContent"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectAccidentCaseById" resultMap="AccidentCaseInfoDetailDOResult"> |
| | | SELECT |
| | | id,case_title,case_time,case_content |
| | | FROM |
| | | accident_case |
| | | WHERE del_flag = 0 and id = #{id} |
| | | </select> |
| | | |
| | | <update id="updateAccidentCase" parameterType="com.gkhy.safePlatform.incidentManage.entity.AccidentCaseInfo"> |
| | | update accident_Case |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if> |
| | | <if test="updateUid != null ">update_uid = #{updateUid},</if> |
| | | |
| | | <if test="caseTitle != null and caseTitle != ''">case_title = #{caseTitle},</if> |
| | | <if test="caseContent != null and caseContent != ''">case_content = #{caseContent},</if> |
| | | <if test="caseTime != null ">case_time = #{caseTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteAccidentCaseById"> |
| | | update accident_Case set del_flag = 1 where id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |