|  |  |  | 
|---|
|  |  |  | import com.doumee.core.utils.DESUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.Utils; | 
|---|
|  |  |  | import com.doumee.dao.business.ApproveMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.CarDriverMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.CarUseBookMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.CarsMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.*; | 
|---|
|  |  |  | import com.doumee.dao.business.join.ApproveJoinMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.join.CarUseBookJoinMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.model.*; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.ApproveDataVO; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.DateIntervalVO; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemDictData; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemUser; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private CarDriverMapper carDriverMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MemberMapper memberMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | .eq(CarUseBook::getId,id) | 
|---|
|  |  |  | .last("limit 1"  ); | 
|---|
|  |  |  | CarUseBook model = carUseBookMapper.selectJoinOne(CarUseBook.class,queryWrapper); | 
|---|
|  |  |  | model.setApproveDateVO( | 
|---|
|  |  |  | approveService.arrangeApprovedData(id, | 
|---|
|  |  |  | model.getType().equals(Constants.ZERO)?3:4, | 
|---|
|  |  |  | memberId) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | ApproveDataVO approveDataVO = approveService.arrangeApprovedData(id, | 
|---|
|  |  |  | Constants.equalsInteger(model.getType(),Constants.ZERO)?3:4, | 
|---|
|  |  |  | memberId); | 
|---|
|  |  |  | List<Approve> approveList = approveDataVO.getApproveList(); | 
|---|
|  |  |  | if(Constants.equalsInteger(model.getStatus(),Constants.FOUR)){ | 
|---|
|  |  |  | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() | 
|---|
|  |  |  | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); | 
|---|
|  |  |  | Member member1 = memberMapper.selectById(model.getCancelUser()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Approve approve = new Approve(); | 
|---|
|  |  |  | approve.setApproveType(Constants.ZERO); | 
|---|
|  |  |  | approve.setCreateDate(model.getCancelTime()); | 
|---|
|  |  |  | approve.setTitle("撤销人"); | 
|---|
|  |  |  | approve.setStatusInfo("已撤销"); | 
|---|
|  |  |  | approve.setStatus(Constants.FOUR); | 
|---|
|  |  |  | approve.setType(Constants.ZERO); | 
|---|
|  |  |  | if(member1!=null) { | 
|---|
|  |  |  | approve.setMemberName(member1.getName()); | 
|---|
|  |  |  | if (StringUtils.isNotBlank(member1.getFaceImg())) { | 
|---|
|  |  |  | approve.setFaceImg(path + member1.getFaceImg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | approve.setCheckInfo(model.getCancelInfo()); | 
|---|
|  |  |  | approveList.add(approve); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | model.setApproveDateVO(approveDataVO); | 
|---|
|  |  |  | return  model; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //处理审批记录 | 
|---|
|  |  |  | approveJoinMapper.update(null,new UpdateWrapper<Approve>() | 
|---|
|  |  |  | .lambda() | 
|---|
|  |  |  | .set(Approve::getIsdeleted,Constants.ONE) | 
|---|
|  |  |  | .set(Approve::getStatus,Constants.FOUR) | 
|---|
|  |  |  | .set(Approve::getCheckInfo,"用车申请取消") | 
|---|
|  |  |  | .in(Approve::getStatus,Constants.ZERO,Constants.ONE) | 
|---|
|  |  |  | .in(Approve::getObjType,Constants.approveObjectType.cityUseCar,Constants.approveObjectType.unCityUseCar) | 
|---|
|  |  |  | .eq(Approve::getObjId,id) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|