| | |
| | | /** |
| | | * 应急预案删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencyPlan(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencyPlan(@RequestBody Long[] ids){ |
| | | return emergencyPlanService.batchDeleteEmergencyPlan(ids); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 应急队伍删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencyTeam(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencyTeam(@RequestBody Long[] ids){ |
| | | return emergencyTeamService.batchDeleteEmergencyTeam(ids); |
| | | } |
| | | |
| | |
| | | @TableName("emergency_plan") |
| | | public class EmergencyPlanInfo { |
| | | |
| | | private String authorName; |
| | | |
| | | public String getAuthorName() { |
| | | return authorName; |
| | | } |
| | | |
| | | public void setAuthorName(String authorName) { |
| | | this.authorName = authorName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_plan") |
| | | public class EmergencyPlanInfoDetailDO { |
| | | |
| | | private String authorName; |
| | | |
| | | public String getAuthorName() { |
| | | return authorName; |
| | | } |
| | | |
| | | public void setAuthorName(String authorName) { |
| | | this.authorName = authorName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_plan_team") |
| | | public class EmergencyPlanTeamInfoDO { |
| | | |
| | | private String teamName; |
| | | |
| | | public String getTeamName() { |
| | | return teamName; |
| | | } |
| | | |
| | | public void setTeamName(String teamName) { |
| | | this.teamName = teamName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_team") |
| | | public class EmergencyTeamInfo { |
| | | |
| | | private String principalName; |
| | | |
| | | public String getPrincipalName() { |
| | | return principalName; |
| | | } |
| | | |
| | | public void setPrincipalName(String principalName) { |
| | | this.principalName = principalName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableName("emergency_team") |
| | | public class EmergencyTeamInfoDetailDO { |
| | | |
| | | private String principalName; |
| | | |
| | | public String getPrincipalName() { |
| | | return principalName; |
| | | } |
| | | |
| | | public void setPrincipalName(String principalName) { |
| | | this.principalName = principalName; |
| | | } |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | |
| | | public class EmergencyPlanReqDTO { |
| | | |
| | | private String authorName; |
| | | |
| | | public String getAuthorName() { |
| | | return authorName; |
| | | } |
| | | |
| | | public void setAuthorName(String authorName) { |
| | | this.authorName = authorName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Integer status; |
| | |
| | | |
| | | public class EmergencyTeamReqDTO { |
| | | |
| | | private String principalName; |
| | | |
| | | public String getPrincipalName() { |
| | | return principalName; |
| | | } |
| | | |
| | | public void setPrincipalName(String principalName) { |
| | | this.principalName = principalName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long principalUid; |
| | |
| | | |
| | | public class EmergencyPlanDepartmentRespDTO { |
| | | |
| | | private String departmentName; |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long planId; |
| | |
| | | |
| | | public class EmergencyPlanDetailRespDTO { |
| | | |
| | | private String authorName; |
| | | |
| | | public String getAuthorName() { |
| | | return authorName; |
| | | } |
| | | |
| | | public void setAuthorName(String authorName) { |
| | | this.authorName = authorName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Integer status; |
| | |
| | | |
| | | public class EmergencyPlanTeamRespDTO { |
| | | |
| | | private String teamName; |
| | | |
| | | public String getTeamName() { |
| | | return teamName; |
| | | } |
| | | |
| | | public void setTeamName(String teamName) { |
| | | this.teamName = teamName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long planId; |
| | |
| | | |
| | | public class EmergencyTeamDetailRespDTO { |
| | | |
| | | private String principalName; |
| | | |
| | | public String getPrincipalName() { |
| | | return principalName; |
| | | } |
| | | |
| | | public void setPrincipalName(String principalName) { |
| | | this.principalName = principalName; |
| | | } |
| | | |
| | | private Long id; |
| | | |
| | | private Long principalUid; |
| | |
| | | |
| | | ResultVO updateEmergencyPlan(Long uid, EmergencyPlanReqDTO emergencyPlanReqDTO); |
| | | |
| | | ResultVO batchDeleteEmergencyPlan(String ids); |
| | | ResultVO batchDeleteEmergencyPlan(Long[] ids); |
| | | } |
| | |
| | | |
| | | ResultVO getEmergencyTeamMemberById(Long id); |
| | | |
| | | ResultVO batchDeleteEmergencyTeam(String ids); |
| | | ResultVO batchDeleteEmergencyTeam(Long[] ids); |
| | | |
| | | ResultVO getEmergencyTeamMemberByTeamId(Long teamId); |
| | | } |
| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | 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.emergency.query.db.EmergencyPlanDBQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyPlanService; |
| | | import com.gkhy.safePlatform.emergency.service.baseService.*; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("emergencyPlanService") |
| | |
| | | |
| | | @Autowired |
| | | private EmergencyPlanFileInfoService emergencyPlanFileInfoService; |
| | | |
| | | @DubboReference(check = false) |
| | | private AccountDepartmentService accountDepartmentService; |
| | | |
| | | @Override |
| | | public SearchResultVO<List<EmergencyPlanPageRespDTO>> selectEmergencyPlanList(PageQuery<EmergencyPlanQuery> query) { |
| | |
| | | List<EmergencyPlanDepartmentInfoDO> emergencyPlanDepartmentInfoDOList = emergencyPlanDepartmentInfoService.selectEmergencyPlanDepartmentByPlanId(id); |
| | | if (!CollectionUtils.isEmpty(emergencyPlanDepartmentInfoDOList)){ |
| | | List<EmergencyPlanDepartmentRespDTO> emergencyTeamDepartmentRespDTOList = BeanCopyUtils.copyBeanList(emergencyPlanDepartmentInfoDOList , EmergencyPlanDepartmentRespDTO.class); |
| | | |
| | | Map<Long, String> deptPool = new HashMap<>(); |
| | | for (EmergencyPlanDepartmentRespDTO emergencyPlanDepartmentRespDTO : emergencyTeamDepartmentRespDTOList) { |
| | | if (!deptPool.containsKey(emergencyPlanDepartmentRespDTO.getDepartmentId())) { |
| | | ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(emergencyPlanDepartmentRespDTO.getDepartmentId()); |
| | | if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) { |
| | | if (rpcResult.getData() != null) { |
| | | DepInfoRPCRespDTO dep = (DepInfoRPCRespDTO) rpcResult.getData(); |
| | | |
| | | deptPool.put(dep.getDepId(), dep.getDepName()); |
| | | } |
| | | } |
| | | } |
| | | String depName = deptPool.get(emergencyPlanDepartmentRespDTO.getDepartmentId()); |
| | | emergencyPlanDepartmentRespDTO.setDepartmentName(depName); |
| | | } |
| | | emergencyPlanDetailRespDTO.setDeptList(emergencyTeamDepartmentRespDTOList); |
| | | } |
| | | // 查找对应的应急队伍 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencyPlan(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | public ResultVO batchDeleteEmergencyPlan(Long[] ids) { |
| | | |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NOT_EXIST); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencyPlan(Long.valueOf(id)); |
| | | for (Long id : ids){ |
| | | deleteEmergencyPlan(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencyTeam(String ids) { |
| | | if (StringUtils.isBlank(ids)){ |
| | | public ResultVO batchDeleteEmergencyTeam(Long[] ids) { |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.TEAM_NULL); |
| | | }else{ |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencyTeam(Long.valueOf(id)); |
| | | for (Long id : ids){ |
| | | deleteEmergencyTeam(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | |
| | | <if test="status != null ">status,</if> |
| | | <if test="releaseDate != null ">release_date,</if> |
| | | <if test="authorUid != null ">author_uid,</if> |
| | | <if test="authorName != null and authorName != ''">`author_name`,</if> |
| | | <if test="authorDeptId != null ">author_dept_id,</if> |
| | | <if test="associatedDanger != null ">associated_danger,</if> |
| | | <if test="type != null and type != ''">`type`,</if> |
| | |
| | | <if test="status != null ">#{status},</if> |
| | | <if test="releaseDate != null ">#{releaseDate},</if> |
| | | <if test="authorUid != null ">#{authorUid},</if> |
| | | <if test="authorName != null and authorName != ''">#{authorName},</if> |
| | | <if test="authorDeptId != null ">#{authorDeptId},</if> |
| | | <if test="associatedDanger!= null ">#{associatedDanger},</if> |
| | | <if test="type != null and type != ''">#{type},</if> |
| | |
| | | <result column="level" property="level"/> |
| | | <result column="release_date" property="releaseDate"/> |
| | | <result column="author_uid" property="authorUid"/> |
| | | <result column="author_name" property="authorName"/> |
| | | <result column="author_dept_id" property="authorDeptId"/> |
| | | <result column="associated_danger" property="associatedDanger"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyPlanById" resultMap="emergencyPlanInfoDetailDOResult"> |
| | | select id ,`name`,`status`,`type`,`level`,release_date ,author_uid ,author_dept_id ,associated_danger from emergency_plan |
| | | select id ,`name`,`status`,`type`,`level`,release_date ,author_uid ,author_dept_id ,associated_danger,author_name from emergency_plan |
| | | where del_flag = 0 and id = #{id} |
| | | </select> |
| | | |
| | |
| | | <if test="status != null ">status = #{status},</if> |
| | | <if test="releaseDate != null ">release_date = #{releaseDate},</if> |
| | | <if test="authorUid != null ">author_uid = #{authorUid},</if> |
| | | <if test="authorName != null and authorName != ''">author_name =#{authorName},</if> |
| | | <if test="authorDeptId != null ">author_dept_id = #{authorDeptId},</if> |
| | | <if test="associatedDanger != null ">associated_danger = #{associatedDanger},</if> |
| | | <if test="type != null and type != ''">type = #{type},</if> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyPlanTeamByPlanId" resultMap="emergencyPlanTeamInfoDOResult"> |
| | | select id ,plan_id ,team_id from emergency_plan_team where plan_id=#{planId} and del_flag = 0 |
| | | SELECT |
| | | a.id, |
| | | a.plan_id, |
| | | a.team_id, |
| | | b.team_name AS teamName |
| | | FROM |
| | | emergency_plan_team a |
| | | LEFT JOIN emergency_team b ON a.team_id = b.id |
| | | WHERE |
| | | a.plan_id = #{planId} |
| | | AND a.del_flag = 0 |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencyPlanTeamByIds" > |
| | |
| | | <if test="createUid != null ">create_uid,</if> |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | <if test="principalUid != null ">principal_uid,</if> |
| | | <if test="principalName != null and principalName != ''">principal_name,</if> |
| | | <if test="principalDepartmentId != null ">principal_department_id,</if> |
| | | <if test="teamLevel != null and teamLevel != ''">team_level,</if> |
| | | <if test="teamName != null and teamName != ''">team_name,</if> |
| | |
| | | <if test="createUid != null ">#{createUid},</if> |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | <if test="principalUid != null ">#{principalUid},</if> |
| | | <if test="principalName != null and principalName != ''">#{principalName},</if> |
| | | <if test="principalDepartmentId != null ">#{principalDepartmentId},</if> |
| | | <if test="teamLevel != null and teamLevel != ''">#{teamLevel},</if> |
| | | <if test="teamName != null and teamName != ''">#{teamName},</if> |
| | |
| | | id="emergencyTeamInfoDetailDOResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="principal_uid" property="principalUid"/> |
| | | <result column="principal_name" property="principalName"/> |
| | | <result column="principal_department_id" property="principalDepartmentId"/> |
| | | <result column="team_level" property="teamLevel"/> |
| | | <result column="team_name" property="teamName"/> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyTeamById" resultMap="emergencyTeamInfoDetailDOResult"> |
| | | select id,principal_uid,principal_department_id,`team_level`,`team_name`,`principal_phone`,telephone_number,`team_desc` |
| | | select id,principal_uid,principal_department_id,`team_level`,`team_name`,`principal_phone`,telephone_number,`team_desc`,principal_name |
| | | from emergency_team where del_flag = 0 and id = #{id} |
| | | </select> |
| | | |
| | |
| | | <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if> |
| | | <if test="updateUid != null ">update_uid = #{updateUid},</if> |
| | | <if test="principalUid != null ">principal_uid = #{principalUid},</if> |
| | | <if test="principalName != null and principalName != ''">principal_name = #{principalName},</if> |
| | | <if test="principalDepartmentId != null ">principal_department_id = #{principalDepartmentId},</if> |
| | | <if test="teamLevel != null and teamLevel != ''">team_level = #{teamLevel},</if> |
| | | <if test="teamName != null and teamName != ''">team_name = #{teamName},</if> |
| | |
| | | |
| | | private String accidentCause; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date occurrenceTime; |
| | | |
| | | private String occurrencePlace; |
| | |
| | | |
| | | private String accidentCause; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reportDeadline; |
| | | |
| | | private String accidentLevel; |
| | |
| | | |
| | | private String workInjuryType; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date declareDate; |
| | | |
| | | private BigDecimal lostTime; |