| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.dao.business.dao.UserActionMapper; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private PlatformBooksMapper platformBooksMapper; |
| | | @Autowired |
| | | private UserActionMapper userActionMapper; |
| | | @Autowired |
| | | private PlatformJobMapper platformJobMapper; |
| | | |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | |
| | | public void deleteById(Integer id) { |
| | | platformBooksMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void deleteById(Integer id,LoginUserInfo user) { |
| | | PlatformBooks model =findById(id); |
| | | if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Date date =new Date(); |
| | | platformBooksMapper.update(null,new UpdateWrapper<PlatformBooks>().lambda() |
| | | .set(PlatformBooks::getIsdeleted,Constants.ONE) |
| | | .set(PlatformBooks::getEditDate,date) |
| | | .set(PlatformBooks::getEditor,user.getId()) |
| | | .eq(PlatformBooks::getId,id)); |
| | | platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda() |
| | | .set(PlatformJob::getIsdeleted,Constants.ONE) |
| | | .set(PlatformJob::getEditDate,new Date()) |
| | | .set(PlatformJob::getEditor,user.getId()) |
| | | .eq(PlatformJob::getBookId,id) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO)); |
| | | String[] params = new String[3]; |
| | | params[0] = user.getRealname(); |
| | | params[1]=DateUtil.getPlusTime2(date); |
| | | params[2]=model.getContractNum()+"-【司机:"+model.getDriverName()+" "+model.getDriverPhone()+"】-【车牌好: "+model.getPlateNum()+"】"; |
| | | //记录删除日志 |
| | | UserActionServiceImpl.saveUserActionBiz(user,id,Constants.UserActionType.PLATFROM_BOOK_DEL,userActionMapper,date,params, JSONObject.toJSONString(model)); |
| | | } |
| | | @Override |
| | | public void delete(PlatformBooks platformBooks) { |
| | | UpdateWrapper<PlatformBooks> deleteWrapper = new UpdateWrapper<>(platformBooks); |