| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.SmsConstants; |
| | |
| | | import com.doumee.service.business.third.EmayService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public void deleteById(Integer id) { |
| | | hiddenDangerMapper.deleteById(id); |
| | | } |
| | | @Override |
| | | public void deleteById(Integer id,LoginUserInfo user) { |
| | | if( Objects.isNull(id) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | HiddenDanger model = hiddenDangerMapper.selectJoinOne(HiddenDanger.class,new MPJLambdaWrapper<HiddenDanger>() |
| | | .selectAll(HiddenDanger.class) |
| | | .selectAs(Member::getName,HiddenDanger::getCheckorName) |
| | | .leftJoin(Member.class,Member::getId,HiddenDanger::getCheckUserId) |
| | | .eq(HiddenDanger::getId,id) |
| | | .eq(HiddenDanger::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到隐患数据"); |
| | | } |
| | | if (!Constants.equalsInteger(model.getStatus(),Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态已流转,请刷新查看!"); |
| | | } |
| | | HiddenDanger hiddenDanger = new HiddenDanger(); |
| | | hiddenDanger.setIsdeleted(Constants.ONE); |
| | | hiddenDanger.setId(id); |
| | | hiddenDanger.setEditor(user.getId()); |
| | | |
| | | hiddenDanger.setEditDate(new Date()); |
| | | hiddenDangerMapper.updateById(hiddenDanger); |
| | | //存储 操作日志 |
| | | HiddenDangerLog hiddenDangerLog = new HiddenDangerLog(); |
| | | hiddenDangerLog.setIsdeleted(Constants.ZERO); |
| | | hiddenDangerLog.setCreateDate(new Date()); |
| | | hiddenDangerLog.setCreator(hiddenDanger.getEditor()); |
| | | hiddenDangerLog.setEditDate(hiddenDangerLog.getCreateDate()); |
| | | hiddenDangerLog.setEditor(hiddenDanger.getCreator()); |
| | | hiddenDangerLog.setTitle("由【"+user.getRealname()+"】删除记录"); |
| | | hiddenDangerLog.setHiddenDangerId(hiddenDanger.getId()); |
| | | hiddenDangerLog.setObjType(Constants.FIVE); |
| | | hiddenDangerLogMapper.insert(hiddenDangerLog); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(HiddenDanger hiddenDanger) { |
| | |
| | | for(Multifile f : multifiles){ |
| | | if(StringUtils.isBlank(f.getFileurl())){ |
| | | continue; |
| | | } |
| | | if(f.getType() == null){ |
| | | if(StringUtils.endsWithIgnoreCase(f.getFileurl(),".mp4")){ |
| | | f.setType(Constants.ONE); |
| | | }else if(StringUtils.endsWithIgnoreCase(f.getFileurl(),".jpg") |
| | | ||StringUtils.endsWithIgnoreCase(f.getFileurl(),".jpeg") |
| | | ||StringUtils.endsWithIgnoreCase(f.getFileurl(),".png")){ |
| | | f.setType(Constants.ZERO); |
| | | }else{ |
| | | f.setType(Constants.TWO); |
| | | } |
| | | } |
| | | f.setFileurlFull(path+f.getFileurl()); |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HIDDEN_DANGER_SUBMIT.getKey())){ |
| | |
| | | if(StringUtils.isBlank(multifile.getFileurl())){ |
| | | continue; |
| | | } |
| | | multifile.setId(null); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setCreator(hiddenDanger.getEditor()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | if(multifile.getType() == null){ |
| | | if(StringUtils.endsWithIgnoreCase(multifile.getFileurl(),".mp4")){ |
| | | multifile.setType(Constants.ONE); |
| | | }else if(StringUtils.endsWithIgnoreCase(multifile.getFileurl(),".jpg") |
| | | ||StringUtils.endsWithIgnoreCase(multifile.getFileurl(),".jpeg") |
| | | ||StringUtils.endsWithIgnoreCase(multifile.getFileurl(),".png")){ |
| | | multifile.setType(Constants.ZERO); |
| | | }else{ |
| | | multifile.setType(Constants.TWO); |
| | | } |
| | | } |
| | | multifile.setObjId(hiddenDanger.getId()); |
| | | multifile.setCreator(hiddenDanger.getLoginUserInfo().getId()); |
| | | multifile.setObjType(Constants.MultiFile.HIDDEN_DANGER_DEAL_BEFORE.getKey()); |
| | |
| | | if(hiddenDanger.getStatus().equals(Constants.ONE) && !isTrue){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按要求填写处理数据"); |
| | | } |
| | | multifileMapper.update(null,new UpdateWrapper<Multifile>().lambda() |
| | | .set(Multifile::getIsdeleted,Constants.ONE ) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.HIDDEN_DANGER_DEAL_BEFORE.getKey()) |
| | | .eq(Multifile::getObjId,hiddenDanger.getId()) |
| | | ); |
| | | } |
| | | if(hiddenDanger.getStatus().equals(Constants.ONE)){ |
| | | boolean isTrue = false; |
| | |
| | | if(StringUtils.isBlank(multifile.getFileurl())){ |
| | | continue; |
| | | } |
| | | multifile.setId(null); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setCreator(hiddenDanger.getEditor()); |
| | | multifile.setIsdeleted(Constants.ZERO); |