|
|
@ -25,7 +25,7 @@ import java.time.LocalDateTime; |
|
|
|
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类 |
|
|
|
* (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类 |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Zhang Xiaolong created at 2023-03-10 |
|
|
|
* @author Zhang Xiaolong created at 2023-03-10 |
|
|
|
* @describe (标准物质停用/报废销毁/恢复/降级使用审批表) 服务实现类 |
|
|
|
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 服务实现类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService { |
|
|
|
public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<StandardMaterialApprovalFormMapper, StandardMaterialApprovalForm> implements StandardMaterialApprovalFormService { |
|
|
@ -38,61 +38,71 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ReferenceMaterialService referenceMaterialService; |
|
|
|
private ReferenceMaterialService referenceMaterialService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser){ |
|
|
|
public StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = new StandardMaterialApprovalForm(); |
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = new StandardMaterialApprovalForm(); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(standardMaterialApprovalFormDTO,standardMaterialApprovalForm); |
|
|
|
BeanUtils.copyProperties(standardMaterialApprovalFormDTO, standardMaterialApprovalForm); |
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApprovalForm.setApplicantId(dlpUser.getId()); |
|
|
|
standardMaterialApprovalForm.setApplicantId(dlpUser.getId()); |
|
|
|
standardMaterialApprovalForm.setApplicantName(dlpUser.getName()); |
|
|
|
standardMaterialApprovalForm.setApplicantName(dlpUser.getName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApprovalForm.setCommitStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApprovalForm.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
standardMaterialApprovalForm.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormDTO.getApplicationContent()==1|standardMaterialApprovalFormDTO.getApplicationContent()==2){ |
|
|
|
if (standardMaterialApprovalFormDTO.getApplicationContent() == 1 | standardMaterialApprovalFormDTO.getApplicationContent() == 2) { |
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
|
|
byId.setStatus(-1); |
|
|
|
byId.setStatus(-1); |
|
|
|
|
|
|
|
|
|
|
|
}else if (standardMaterialApprovalFormDTO.getApplicationContent()==4){ |
|
|
|
referenceMaterialService.updateById(byId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (standardMaterialApprovalFormDTO.getApplicationContent() == 4) { |
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
|
|
byId.setStatus(-2); |
|
|
|
byId.setStatus(-2); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
referenceMaterialService.updateById(byId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(standardMaterialApprovalFormDTO.getReferenceMaterialId()); |
|
|
|
|
|
|
|
|
|
|
|
byId.setStatus(-2); |
|
|
|
byId.setStatus(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
referenceMaterialService.updateById(byId); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApprovalForm.setCommitStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormService.save(standardMaterialApprovalForm)){ |
|
|
|
if (standardMaterialApprovalFormService.save(standardMaterialApprovalForm)) { |
|
|
|
return standardMaterialApprovalForm; |
|
|
|
return standardMaterialApprovalForm; |
|
|
|
}else throw new RuntimeException(String.format("保存失败")); |
|
|
|
} else throw new RuntimeException(String.format("保存失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, QueryWrapper<StandardMaterialApprovalForm> qw){ |
|
|
|
public IPage<StandardMaterialApprovalFormVO> getVOPage(IPage<StandardMaterialApprovalForm> page, QueryWrapper<StandardMaterialApprovalForm> qw) { |
|
|
|
|
|
|
|
|
|
|
|
IPage<StandardMaterialApprovalFormVO> voPage = baseMapper.getVOPage(page, qw); |
|
|
|
IPage<StandardMaterialApprovalFormVO> voPage = baseMapper.getVOPage(page, qw); |
|
|
|
|
|
|
|
|
|
|
|
return voPage; |
|
|
|
return voPage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public StandardMaterialApprovalFormVO getVO(String standardMaterialApprovalFormId){ |
|
|
|
public StandardMaterialApprovalFormVO getVO(String standardMaterialApprovalFormId) { |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId); |
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId); |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = new StandardMaterialApprovalFormVO(); |
|
|
|
StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = new StandardMaterialApprovalFormVO(); |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(byId,standardMaterialApprovalFormVO); |
|
|
|
BeanUtils.copyProperties(byId, standardMaterialApprovalFormVO); |
|
|
|
|
|
|
|
|
|
|
|
SupplierInformation byId1 = supplierInformationService.getById(standardMaterialApprovalFormVO.getManufacturerId()); |
|
|
|
SupplierInformation byId1 = supplierInformationService.getById(standardMaterialApprovalFormVO.getManufacturerId()); |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +112,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//一级审核
|
|
|
|
@Override//一级审核
|
|
|
|
public StandardMaterialApprovalForm auditPrimary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser){ |
|
|
|
public StandardMaterialApprovalForm auditPrimary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
|
|
|
|
|
|
|
@ -111,19 +121,19 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar |
|
|
|
byId.setPrimaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setPrimaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setAuditTimeOfPrimary(LocalDateTime.now()); |
|
|
|
byId.setAuditTimeOfPrimary(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
|
|
if (auditAndApproveDTO.getAuditResult()==true){ |
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
byId.setCommitStatus(2); |
|
|
|
byId.setCommitStatus(2); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
byId.setCommitStatus(-1); |
|
|
|
byId.setCommitStatus(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)){ |
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)) { |
|
|
|
return byId; |
|
|
|
return byId; |
|
|
|
}else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//二级审核
|
|
|
|
@Override//二级审核
|
|
|
|
public StandardMaterialApprovalForm auditSecondary(AuditAndApproveDTO auditAndApproveDTO,DLPUser dlpUser){ |
|
|
|
public StandardMaterialApprovalForm auditSecondary(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
|
|
|
|
|
|
|
@ -131,18 +141,18 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar |
|
|
|
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setSecondaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setSecondaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setAuditTimeOfSecondary(LocalDateTime.now()); |
|
|
|
byId.setAuditTimeOfSecondary(LocalDateTime.now()); |
|
|
|
if (auditAndApproveDTO.getAuditResult()==true){ |
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
byId.setCommitStatus(3); |
|
|
|
byId.setCommitStatus(3); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
byId.setCommitStatus(-1); |
|
|
|
byId.setCommitStatus(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)){ |
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)) { |
|
|
|
return byId; |
|
|
|
return byId; |
|
|
|
}else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//审批
|
|
|
|
@Override//审批
|
|
|
|
public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO,DLPUser dlpUser){ |
|
|
|
public StandardMaterialApprovalForm approveById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
|
|
|
|
|
|
|
@ -150,13 +160,13 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl<Standar |
|
|
|
byId.setResultOfApproval(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setResultOfApproval(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setApproverId(dlpUser.getId()); |
|
|
|
byId.setApproverId(dlpUser.getId()); |
|
|
|
byId.setApprovalOfTime(LocalDateTime.now()); |
|
|
|
byId.setApprovalOfTime(LocalDateTime.now()); |
|
|
|
if (auditAndApproveDTO.getApproveResult()==true){ |
|
|
|
if (auditAndApproveDTO.getApproveResult() == true) { |
|
|
|
byId.setCommitStatus(4); |
|
|
|
byId.setCommitStatus(4); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
byId.setCommitStatus(-2); |
|
|
|
byId.setCommitStatus(-2); |
|
|
|
} |
|
|
|
} |
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)){ |
|
|
|
if (standardMaterialApprovalFormService.updateById(byId)) { |
|
|
|
return byId; |
|
|
|
return byId; |
|
|
|
}else throw new RuntimeException(String.format("审批失败")); |
|
|
|
} else throw new RuntimeException(String.format("审批失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|