|  |  |  | 
|---|
|  |  |  | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
|---|
|  |  |  | public void audit(AuditDTO auditDTO){ | 
|---|
|  |  |  | if(Objects.isNull(auditDTO) | 
|---|
|  |  |  | || Objects.isNull(auditDTO.getId()) | 
|---|
|  |  |  | || Objects.isNull(auditDTO.getAuditStatus())){ | 
|---|
|  |  |  | || Objects.isNull(auditDTO.getId()) | 
|---|
|  |  |  | || Objects.isNull(auditDTO.getAuditStatus()) | 
|---|
|  |  |  | ||  auditDTO.getAuditStatus()<2 | 
|---|
|  |  |  | ||  auditDTO.getAuditStatus()>3){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | 
|---|
|  |  |  | if(!Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.ONE)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已审批,请勿重复操作"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Date date = new Date(); | 
|---|
|  |  |  | identityInfoMapper.update(new UpdateWrapper<IdentityInfo>().lambda() | 
|---|
|  |  |  | .set(IdentityInfo::getAuditStatus,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
|---|
|  |  |  | .set(IdentityInfo::getAuditStatus, auditDTO.getAuditStatus() ) | 
|---|
|  |  |  | .set(StringUtils.isNotBlank(auditDTO.getAuditRemark()),IdentityInfo::getAuditRemark,auditDTO.getAuditRemark()) | 
|---|
|  |  |  | .set(IdentityInfo::getAuditTime,"now()") | 
|---|
|  |  |  | .set(IdentityInfo::getAuditTime,date) | 
|---|
|  |  |  | .set(IdentityInfo::getUpdateUser,user.getId()) | 
|---|
|  |  |  | .set(IdentityInfo::getUpdateTime,"now()") | 
|---|
|  |  |  | .set(IdentityInfo::getUpdateTime,date) | 
|---|
|  |  |  | .eq(IdentityInfo::getId,identityInfo.getId()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | memberMapper.update(new UpdateWrapper<Member>().lambda() | 
|---|
|  |  |  | .set(Member::getUpdateUser,user.getId()) | 
|---|
|  |  |  | .set(Member::getUpdateTime,"now()") | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
|---|
|  |  |  | .set(Member::getUpdateTime,date) | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity, auditDTO.getAuditStatus() ) | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity , auditDTO.getAuditStatus() ) | 
|---|
|  |  |  | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity , auditDTO.getAuditStatus() ) | 
|---|
|  |  |  | .eq(Member::getId,identityInfo.getMemberId()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|