| | |
| | | |
| | | private Long planId; |
| | | |
| | | private Long userUId; |
| | | private Long userUid; |
| | | |
| | | private Date startCreate; |
| | | |
| | |
| | | this.planId = planId; |
| | | } |
| | | |
| | | public Long getUserUId() { |
| | | return userUId; |
| | | public Long getUserUid() { |
| | | return userUid; |
| | | } |
| | | |
| | | public void setUserUId(Long userUId) { |
| | | this.userUId = userUId; |
| | | public void setUserUid(Long userUid) { |
| | | this.userUid = userUid; |
| | | } |
| | | |
| | | public Date getStartCreate() { |
| | |
| | | ", createUid=" + createUid + |
| | | ", updateUid=" + updateUid + |
| | | ", planId=" + planId + |
| | | ", userUId=" + userUId + |
| | | ", userUid=" + userUid + |
| | | ", startCreate=" + startCreate + |
| | | ", remark='" + remark + '\'' + |
| | | '}'; |
| | |
| | | |
| | | PLAN_NOT_EXIST("P1001" , "应急预案不存在"), |
| | | |
| | | PLAN_LOG_NOT_EXIST("P1002" , "应急预案启动记录不存在"), |
| | | PLAN_NULL("P1002" , "应急预案不可为空"), |
| | | |
| | | PLAN_LOG_NOT_EXIST("P1003" , "应急预案启动记录不存在"), |
| | | |
| | | |
| | | |
| | |
| | | |
| | | private Long planId; |
| | | |
| | | private Long userUId; |
| | | private Long userUid; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startCreate; |
| | |
| | | this.planId = planId; |
| | | } |
| | | |
| | | public Long getUserUId() { |
| | | return userUId; |
| | | public Long getUserUid() { |
| | | return userUid; |
| | | } |
| | | |
| | | public void setUserUId(Long userUId) { |
| | | this.userUId = userUId; |
| | | public void setUserUid(Long userUid) { |
| | | this.userUid = userUid; |
| | | } |
| | | |
| | | public Date getStartCreate() { |
| | |
| | | return "EmergencyPlanLogRespDTO{" + |
| | | "id=" + id + |
| | | ", planId=" + planId + |
| | | ", userUId=" + userUId + |
| | | ", userUid=" + userUid + |
| | | ", startCreate=" + startCreate + |
| | | ", remark='" + remark + '\'' + |
| | | '}'; |
| | |
| | | @Autowired |
| | | private EmergencyPlanLogInfoService emergencyPlanLogInfoService; |
| | | |
| | | @Autowired |
| | | private EmergencyPlanInfoService emergencyPlanInfoService; |
| | | |
| | | @Override |
| | | public SearchResultVO<List<EmergencyPlanLogRespDTO>> selectEmergencyPlanLogList(PageQuery<EmergencyPlanLogQuery> query) { |
| | | Long pageIndex = query.getPageIndex(); |
| | |
| | | |
| | | @Override |
| | | public ResultVO addEmergencyPlanLog(Long uid, EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | // 判断请求中是否存在应急预案id |
| | | if (emergencyPlanLogReqDTO.getPlanId() == null) { |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NULL); |
| | | } else { |
| | | EmergencyPlanInfoDetailDO emergencyPlanInfoDetailDO = emergencyPlanInfoService.selectEmergencyPlanById(emergencyPlanLogReqDTO.getPlanId()); |
| | | // 判断是否存在该应急预案 |
| | | if (emergencyPlanInfoDetailDO == null) { |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NOT_EXIST); |
| | | } else { |
| | | Date nowDate = new Date(); |
| | | // 新增应急预案 |
| | | // 新增应急预案启动记录 |
| | | EmergencyPlanLogInfo emergencyPlanLogInfo = new EmergencyPlanLogInfo(); |
| | | BeanUtils.copyProperties(emergencyPlanLogReqDTO,emergencyPlanLogInfo); |
| | | emergencyPlanLogInfo.setDelFlag(false); |
| | | emergencyPlanLogInfo.setCreateUid(uid); |
| | | emergencyPlanLogInfo.setGmtCreate(nowDate); |
| | | |
| | | emergencyPlanLogInfo.setUserUid(uid); |
| | | emergencyPlanLogInfo.setStartCreate(nowDate); |
| | | emergencyPlanLogInfoService.addEmergencyPlanLog(emergencyPlanLogInfo); |
| | | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public ResultVO updateEmergencyPlanLog(Long uid, EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | // 查询是否存在 |
| | | // 查询是否存在启动记录 |
| | | EmergencyPlanLogInfoDO emergencyPlanLogInfoDetailDO = emergencyPlanLogInfoService.selectEmergencyPlanLogById(emergencyPlanLogReqDTO.getId()); |
| | | if (emergencyPlanLogInfoDetailDO==null){ |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_LOG_NOT_EXIST); |
| | | } else { |
| | | // 判断请求中是否存在应急预案id |
| | | if (emergencyPlanLogReqDTO.getPlanId() == null) { |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NULL); |
| | | } else { |
| | | EmergencyPlanInfoDetailDO emergencyPlanInfoDetailDO = emergencyPlanInfoService.selectEmergencyPlanById(emergencyPlanLogReqDTO.getPlanId()); |
| | | // 判断是否存在该应急预案 |
| | | if (emergencyPlanInfoDetailDO == null) { |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NOT_EXIST); |
| | | }else{ |
| | | EmergencyPlanLogInfo emergencyPlanLogInfo = new EmergencyPlanLogInfo(); |
| | | BeanUtils.copyProperties(emergencyPlanLogReqDTO,emergencyPlanLogInfo); |
| | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencyPlanLog(String ids) { |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyPlanAreaByPlanId" resultMap="emergencyPlanAreaInfoDOResult"> |
| | | select id , plan_id , area_id from emergency_plan_area where plan_id=#{planId} |
| | | select id , plan_id , area_id from emergency_plan_area where plan_id=#{planId} and del_flag = 0 |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencyPlanAreaByIds" > |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyPlanDepartmentByPlanId" resultMap="emergencyPlanDepartmentInfoDOResult"> |
| | | select id , plan_id , department_id from emergency_plan_department where plan_id=#{planId} |
| | | select id , plan_id , department_id from emergency_plan_department where plan_id=#{planId} and del_flag = 0 |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencyPlanDepartmentByIds" > |
| | |
| | | <if test="gmtModitify != null ">gmt_moditify,</if> |
| | | <if test="createUid != null ">create_uid,</if> |
| | | <if test="updateUid != null ">update_uid,</if> |
| | | <if test="plan_id != null ">plan_id,</if> |
| | | <if test="user_uid != null ">user_uid,</if> |
| | | <if test="start_create != null ">start_create,</if> |
| | | <if test="planId != null ">plan_id,</if> |
| | | <if test="userUid != null ">user_uid,</if> |
| | | <if test="startCreate != null ">start_create,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="gmtModitify != null ">#{gmtModitify},</if> |
| | | <if test="createUid != null ">#{createUid},</if> |
| | | <if test="updateUid != null ">#{updateUid},</if> |
| | | <if test="plan_id != null ">#{planId},</if> |
| | | <if test="user_uid != null ">#{userUid},</if> |
| | | <if test="start_create != null ">#{startCreate},</if> |
| | | <if test="planId != null ">#{planId},</if> |
| | | <if test="userUid != null ">#{userUid},</if> |
| | | <if test="startCreate != null ">#{startCreate},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectEmergencyPlanTeamByPlanId" resultMap="emergencyPlanTeamInfoDOResult"> |
| | | select id ,plan_id ,team_id from emergency_plan_team where plan_id=#{planId} |
| | | select id ,plan_id ,team_id from emergency_plan_team where plan_id=#{planId} and del_flag = 0 |
| | | </select> |
| | | |
| | | <update id = "deleteEmergencyPlanTeamByIds" > |