| | |
| | | package com.gkhy.safePlatform.emergency.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO addEmergencyPlanLog(Long uid, EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | public ResultVO addEmergencyPlanLog(ContextCacheUser currentUser, EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | Long uid = currentUser.getUid(); |
| | | String uname = currentUser.getRealName(); |
| | | // 判断请求中是否存在应急预案id |
| | | if (emergencyPlanLogReqDTO.getPlanId() == null) { |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_NULL); |
| | |
| | | emergencyPlanLogInfo.setGmtCreate(nowDate); |
| | | |
| | | emergencyPlanLogInfo.setUserUid(uid); |
| | | emergencyPlanLogInfo.setUserName(uname); |
| | | emergencyPlanLogInfo.setStartCreate(nowDate); |
| | | |
| | | emergencyPlanLogInfoService.addEmergencyPlanLog(emergencyPlanLogInfo); |
| | | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO batchDeleteEmergencyPlanLog(String ids) { |
| | | if (StringUtils.isBlank(ids)) { |
| | | public ResultVO batchDeleteEmergencyPlanLog(Long[] ids) { |
| | | if (ids == null || ids.length==0){ |
| | | throw new EmergencyException(EmergencyResultCodes.PLAN_LOG_NOT_EXIST); |
| | | } else { |
| | | String[] idArr = ids.split(","); |
| | | for (String id : idArr) { |
| | | deleteEmergencyPlanLog(Long.valueOf(id)); |
| | | }else{ |
| | | for (Long id : ids){ |
| | | deleteEmergencyPlanLog(id); |
| | | } |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |