|
|
|
@ -52,14 +52,12 @@ import java.util.List; |
|
|
|
|
@Service |
|
|
|
|
@SuppressWarnings("all") |
|
|
|
|
public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecordFormMapper, AcceptanceRecordForm> implements AcceptanceRecordFormService { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BlacklistService blacklistService; |
|
|
|
|
@Autowired |
|
|
|
|
private AcceptanceSignForService acceptanceSignForService; |
|
|
|
|
@Autowired |
|
|
|
|
private ReagentConsumablesService reagentConsumablesService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private WarehousingContentService warehousingContentService; |
|
|
|
|
@Autowired |
|
|
|
@ -72,7 +70,6 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
@Transactional |
|
|
|
|
@Override//批量提交
|
|
|
|
|
public void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
for (AcceptanceRecordFormDTO acceptanceRecordFormDTO : acceptanceRecordFormDTOList) { |
|
|
|
|
//调用单个提交方法
|
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = this.commitForm(acceptanceRecordFormDTO, dlpUser); |
|
|
|
@ -81,83 +78,64 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
|
|
|
|
|
@Override//提交验收记录表
|
|
|
|
|
public AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(acceptanceRecordFormDTO.getAcceptanceRecordFormId()); |
|
|
|
|
//验收记录状态为-2,代表验收审核不通过后重新提交,需置空原有审核信息
|
|
|
|
|
if (byId.getStatus() == -2) { |
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
|
byId.setAuditResultOfPrimary(false); |
|
|
|
|
byId.setAuditOpinionOfPrimary(""); |
|
|
|
|
byId.setAuditTimeOfPrimary(null); |
|
|
|
|
byId.setPrimaryAuditorId(""); |
|
|
|
|
byId.setCommitTime(LocalDateTime.now()); |
|
|
|
|
byId.setStatus(1); |
|
|
|
|
byId.setDateOfAcceptance(LocalDateTime.now()); |
|
|
|
|
byId.setCreateBy(dlpUser.getId()); |
|
|
|
|
if (this.updateById(byId)) { |
|
|
|
|
return byId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = this.getById(acceptanceRecordFormDTO.getAcceptanceRecordFormId()); |
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, acceptanceRecordForm); |
|
|
|
|
acceptanceRecordForm.setUserName(dlpUser.getName()); |
|
|
|
|
acceptanceRecordForm.setCommitTime(LocalDateTime.now()); |
|
|
|
|
acceptanceRecordForm.setStatus(1); |
|
|
|
|
acceptanceRecordForm.setDateOfAcceptance(LocalDateTime.now()); |
|
|
|
|
acceptanceRecordForm.setCreateBy(dlpUser.getId()); |
|
|
|
|
//验收记录状态为-2\-3\-4,代表验收审核不通过后重新提交,需置空原有审核信息
|
|
|
|
|
switch (acceptanceRecordForm.getStatus()) { |
|
|
|
|
case -2: { |
|
|
|
|
acceptanceRecordForm.setAuditResultOfPrimary(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfPrimary(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfPrimary(null); |
|
|
|
|
acceptanceRecordForm.setPrimaryAuditorId(""); |
|
|
|
|
if (this.updateById(acceptanceRecordForm)) { |
|
|
|
|
return acceptanceRecordForm; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (byId.getStatus() == -3) { |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
|
byId.setAuditResultOfSecondary(false); |
|
|
|
|
byId.setAuditOpinionOfSecondary(""); |
|
|
|
|
byId.setAuditTimeOfSecondary(null); |
|
|
|
|
byId.setSecondaryAuditorId(""); |
|
|
|
|
byId.setAuditResultOfPrimary(false); |
|
|
|
|
byId.setAuditOpinionOfPrimary(""); |
|
|
|
|
byId.setAuditTimeOfPrimary(null); |
|
|
|
|
byId.setPrimaryAuditorId(""); |
|
|
|
|
byId.setCommitTime(LocalDateTime.now()); |
|
|
|
|
byId.setStatus(1); |
|
|
|
|
byId.setDateOfAcceptance(LocalDateTime.now()); |
|
|
|
|
byId.setCreateBy(dlpUser.getId()); |
|
|
|
|
if (this.updateById(byId)) { |
|
|
|
|
return byId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
case -3: { |
|
|
|
|
acceptanceRecordForm.setAuditResultOfSecondary(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfSecondary(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfSecondary(null); |
|
|
|
|
acceptanceRecordForm.setSecondaryAuditorId(""); |
|
|
|
|
acceptanceRecordForm.setAuditResultOfPrimary(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfPrimary(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfPrimary(null); |
|
|
|
|
acceptanceRecordForm.setPrimaryAuditorId(""); |
|
|
|
|
if (this.updateById(acceptanceRecordForm)) { |
|
|
|
|
return acceptanceRecordForm; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (byId.getStatus() == -4) { |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
|
byId.setAuditResultOfThreeLevel(false); |
|
|
|
|
byId.setAuditOpinionOfThreeLevel(""); |
|
|
|
|
byId.setAuditTimeOfThreeLevel(null); |
|
|
|
|
byId.setThreeLevelAuditorId(""); |
|
|
|
|
byId.setAuditResultOfSecondary(false); |
|
|
|
|
byId.setAuditOpinionOfSecondary(""); |
|
|
|
|
byId.setAuditTimeOfSecondary(null); |
|
|
|
|
byId.setSecondaryAuditorId(""); |
|
|
|
|
byId.setAuditResultOfPrimary(false); |
|
|
|
|
byId.setAuditOpinionOfPrimary(""); |
|
|
|
|
byId.setAuditTimeOfPrimary(null); |
|
|
|
|
byId.setPrimaryAuditorId(""); |
|
|
|
|
byId.setCommitTime(LocalDateTime.now()); |
|
|
|
|
byId.setStatus(1); |
|
|
|
|
byId.setDateOfAcceptance(LocalDateTime.now()); |
|
|
|
|
byId.setCreateBy(dlpUser.getId()); |
|
|
|
|
if (this.updateById(byId)) { |
|
|
|
|
return byId; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
case -4: { |
|
|
|
|
acceptanceRecordForm.setAuditResultOfThreeLevel(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfThreeLevel(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfThreeLevel(null); |
|
|
|
|
acceptanceRecordForm.setThreeLevelAuditorId(""); |
|
|
|
|
acceptanceRecordForm.setAuditResultOfSecondary(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfSecondary(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfSecondary(null); |
|
|
|
|
acceptanceRecordForm.setSecondaryAuditorId(""); |
|
|
|
|
acceptanceRecordForm.setAuditResultOfPrimary(false); |
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfPrimary(""); |
|
|
|
|
acceptanceRecordForm.setAuditTimeOfPrimary(null); |
|
|
|
|
acceptanceRecordForm.setPrimaryAuditorId(""); |
|
|
|
|
if (this.updateById(acceptanceRecordForm)) { |
|
|
|
|
return acceptanceRecordForm; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//正常提交
|
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
|
byId.setCommitTime(LocalDateTime.now()); |
|
|
|
|
byId.setStatus(1); |
|
|
|
|
byId.setCreateBy(dlpUser.getId()); |
|
|
|
|
byId.setDateOfAcceptance(LocalDateTime.now()); |
|
|
|
|
if (this.updateById(byId)) { |
|
|
|
|
return byId; |
|
|
|
|
if (this.updateById(acceptanceRecordForm)) { |
|
|
|
|
return acceptanceRecordForm; |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException(String.format("提交失败")); |
|
|
|
|
} |
|
|
|
@ -165,83 +143,41 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId, String acceptanceSignForId) { |
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = new AcceptanceRecordForm(); |
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
|
acceptanceRecordForm.setSupplierId(supplierId);//供应商ID
|
|
|
|
|
acceptanceRecordForm.setAcceptanceSignForId(acceptanceSignForId);//验收分类ID
|
|
|
|
|
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId);//验收试剂耗材ID
|
|
|
|
|
|
|
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId); |
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setReagentConsumableName(byId.getReagentConsumableName());//将物品名称赋值给验收记录表
|
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(reagentConsumableId); |
|
|
|
|
acceptanceRecordForm.setReagentConsumableName(reagentConsumables.getReagentConsumableName());//将物品名称赋值给验收记录表
|
|
|
|
|
acceptanceRecordForm.setStatus(0);//初始化状态
|
|
|
|
|
|
|
|
|
|
if ((this.save(acceptanceRecordForm))) { |
|
|
|
|
|
|
|
|
|
return acceptanceRecordForm; |
|
|
|
|
|
|
|
|
|
} else throw new RuntimeException(String.format("创建验收任务失败")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm> qw) { |
|
|
|
|
|
|
|
|
|
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page, qw);//获取验收记录列表
|
|
|
|
|
|
|
|
|
|
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords(); |
|
|
|
|
//添加试剂耗材信息至VO
|
|
|
|
|
for (AcceptanceRecordFormVO record : records) { |
|
|
|
|
|
|
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(record.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
record.setReagentConsumables(byId); |
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(record.getReagentConsumableId()); |
|
|
|
|
record.setReagentConsumables(reagentConsumables); |
|
|
|
|
} |
|
|
|
|
return acceptanceRecordFormVOPage; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVORecordPage(IPage<AcceptanceRecordForm> page) {
|
|
|
|
|
//
|
|
|
|
|
// LambdaQueryWrapper<AcceptanceRecordForm> acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
//
|
|
|
|
|
// acceptanceRecordFormLambdaQueryWrapper.eq(AcceptanceRecordForm::getStatus, 4);
|
|
|
|
|
//
|
|
|
|
|
// List<AcceptanceRecordForm> list = this.list(acceptanceRecordFormLambdaQueryWrapper);
|
|
|
|
|
//
|
|
|
|
|
// ArrayList<AcceptanceRecordFormVO> acceptanceRecordFormVOS = new ArrayList<>();
|
|
|
|
|
//
|
|
|
|
|
// if (list.size() != 0) {
|
|
|
|
|
//
|
|
|
|
|
// for (AcceptanceRecordForm acceptanceRecordForm : list) {
|
|
|
|
|
//
|
|
|
|
|
// AcceptanceRecordFormVO acceptanceRecordFormVO = this.getAcceptanceRecordFormVO(acceptanceRecordForm.getId());
|
|
|
|
|
//
|
|
|
|
|
// acceptanceRecordFormVOS.add(acceptanceRecordFormVO);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// PageUtils pageUtils = new PageUtils();
|
|
|
|
|
//
|
|
|
|
|
// Page pages = pageUtils.getPages((int) page.getPages(), (int) page.getSize(), acceptanceRecordFormVOS);
|
|
|
|
|
//
|
|
|
|
|
// return pages;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId) { |
|
|
|
|
|
|
|
|
|
AcceptanceRecordFormVO acceptanceRecordFormVO = baseMapper.getAcceptanceRecordFormVO(acceptanceRecordFormId);//查询单个验收记录表
|
|
|
|
|
|
|
|
|
|
if (acceptanceRecordFormVO == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId());//查询试剂耗材信息
|
|
|
|
|
|
|
|
|
|
acceptanceRecordFormVO.setReagentConsumables(byId); |
|
|
|
|
|
|
|
|
|
//查询试剂耗材信息
|
|
|
|
|
acceptanceRecordFormVO.setReagentConsumables(reagentConsumablesService.getById(acceptanceRecordFormVO.getReagentConsumableId())); |
|
|
|
|
return acceptanceRecordFormVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -250,26 +186,21 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
public boolean primaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) { |
|
|
|
|
//批量审核
|
|
|
|
|
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId();//验收记录ID数组
|
|
|
|
|
|
|
|
|
|
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>();//验收记录表集合
|
|
|
|
|
|
|
|
|
|
for (String id : uuId) { |
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(id); |
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 1) { |
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = this.getById(id); |
|
|
|
|
if (acceptanceRecordForm.getStatus() != 1) { |
|
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
|
} |
|
|
|
|
byId.setPrimaryAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
byId.setAuditOpinionOfPrimary(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
byId.setAuditTimeOfPrimary(LocalDateTime.now());//审核时间,默认为接口执行时间
|
|
|
|
|
byId.setAuditResultOfPrimary(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
acceptanceRecordForm.setPrimaryAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfPrimary(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
acceptanceRecordForm.setAuditTimeOfPrimary(LocalDateTime.now());//审核时间,默认为接口执行时间
|
|
|
|
|
acceptanceRecordForm.setAuditResultOfPrimary(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
|
|
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) { |
|
|
|
|
byId.setStatus(2);//审核成功状态
|
|
|
|
|
} else byId.setStatus(-2);//审核失败状态
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
|
acceptanceRecordForm.setStatus(2);//审核成功状态
|
|
|
|
|
} else acceptanceRecordForm.setStatus(-2);//审核失败状态
|
|
|
|
|
acceptanceRecordForms.add(acceptanceRecordForm); |
|
|
|
|
} |
|
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
return true; |
|
|
|
@ -283,23 +214,21 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
//批量审核
|
|
|
|
|
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId();//验收记录ID数组
|
|
|
|
|
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>();//验收记录表集合
|
|
|
|
|
|
|
|
|
|
for (String id : uuId) { |
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = this.getById(id); |
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(id); |
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 2) { |
|
|
|
|
if (acceptanceRecordForm.getStatus() != 2) { |
|
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
|
} |
|
|
|
|
byId.setSecondaryAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
byId.setAuditOpinionOfSecondary(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
byId.setAuditTimeOfSecondary(LocalDateTime.now());//审核时间,默认为接口执行时间
|
|
|
|
|
byId.setAuditResultOfSecondary(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
acceptanceRecordForm.setSecondaryAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfSecondary(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
acceptanceRecordForm.setAuditTimeOfSecondary(LocalDateTime.now());//审核时间,默认为接口执行时间
|
|
|
|
|
acceptanceRecordForm.setAuditResultOfSecondary(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
|
|
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) { |
|
|
|
|
byId.setStatus(3);//审核成功状态
|
|
|
|
|
} else byId.setStatus(-3);//审核失败状态
|
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
|
acceptanceRecordForm.setStatus(3);//审核成功状态
|
|
|
|
|
} else acceptanceRecordForm.setStatus(-3);//审核失败状态
|
|
|
|
|
acceptanceRecordForms.add(acceptanceRecordForm); |
|
|
|
|
} |
|
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
return true; |
|
|
|
@ -317,51 +246,45 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
List<String> stringList = new ArrayList<>();//用于接收验收集合表ID
|
|
|
|
|
|
|
|
|
|
for (String s : uuId) { |
|
|
|
|
AcceptanceRecordForm byId = this.getById(s); |
|
|
|
|
if (!stringList.contains(byId.getAcceptanceSignForId())) {//添加验收集合表ID至数组
|
|
|
|
|
stringList.add(byId.getAcceptanceSignForId()); |
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = this.getById(s); |
|
|
|
|
if (!stringList.contains(acceptanceRecordForm.getAcceptanceSignForId())) {//添加验收集合表ID至数组
|
|
|
|
|
stringList.add(acceptanceRecordForm.getAcceptanceSignForId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 3) { |
|
|
|
|
if (acceptanceRecordForm.getStatus() != 3) { |
|
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
|
} |
|
|
|
|
byId.setThreeLevelAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
byId.setAuditOpinionOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
byId.setAuditTimeOfThreeLevel(LocalDateTime.now());//审核时间
|
|
|
|
|
byId.setAuditResultOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setThreeLevelAuditorId(dlpUser.getId());//审核人ID
|
|
|
|
|
acceptanceRecordForm.setAuditOpinionOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditOpinion());//审核意见
|
|
|
|
|
acceptanceRecordForm.setAuditTimeOfThreeLevel(LocalDateTime.now());//审核时间
|
|
|
|
|
acceptanceRecordForm.setAuditResultOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditResult());//审核结果
|
|
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) {//审核通过
|
|
|
|
|
if (byId.getNonconformingItem() != null) {//验收不合格项目不为空,会写入供应商黑名单
|
|
|
|
|
blacklistService.addListById2(byId.getReagentConsumableId(), byId.getSupplierId()); |
|
|
|
|
if (acceptanceRecordForm.getNonconformingItem() != null) {//验收不合格项目不为空,会写入供应商黑名单
|
|
|
|
|
blacklistService.addListById2(acceptanceRecordForm.getReagentConsumableId(), acceptanceRecordForm.getSupplierId()); |
|
|
|
|
} |
|
|
|
|
byId.setStatus(6); |
|
|
|
|
} else byId.setStatus(-4); |
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
|
acceptanceRecordForm.setStatus(6); |
|
|
|
|
} else acceptanceRecordForm.setStatus(-4); |
|
|
|
|
acceptanceRecordForms.add(acceptanceRecordForm); |
|
|
|
|
} |
|
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
//判断是否验收完毕,更改验收集合表状态
|
|
|
|
|
for (String s : stringList) { |
|
|
|
|
|
|
|
|
|
AcceptanceSignFor acceptanceSignFor = acceptanceSignForService.getById(s);//批量审核的验收记录关联的所有验收集合表
|
|
|
|
|
for (String id : stringList) { |
|
|
|
|
AcceptanceSignFor acceptanceSignFor = acceptanceSignForService.getById(id);//批量审核的验收记录关联的所有验收集合表
|
|
|
|
|
//得到签收物品集合
|
|
|
|
|
List<WarehousingContent> warehousingContentList = warehousingContentService.list(Wrappers.<WarehousingContent>query().eq("warehousing_record_form_id", warehousingRecordFormService.getById(acceptanceSignFor.getWarehousingRecordFormId()).getId())); |
|
|
|
|
//得到验收集合中的所有验收记录表
|
|
|
|
|
List<AcceptanceRecordForm> recordFormList = this.list(Wrappers.<AcceptanceRecordForm>query().eq("acceptance_sign_for_id", s)); |
|
|
|
|
|
|
|
|
|
List<AcceptanceRecordForm> recordFormList = this.list(Wrappers.<AcceptanceRecordForm>query().eq("acceptance_sign_for_id", id)); |
|
|
|
|
if (warehousingContentList.size() == recordFormList.size()) {//判断是否签收完毕(签收完成一条物品,才会生成一个验收记录表)
|
|
|
|
|
|
|
|
|
|
int x = 0; |
|
|
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
for (AcceptanceRecordForm acceptanceRecordForm : recordFormList) { |
|
|
|
|
|
|
|
|
|
if (acceptanceRecordForm.getStatus() == 6) {//验收审核通过的状态
|
|
|
|
|
x = x + 1; |
|
|
|
|
index += 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (x == recordFormList.size()) {//验收审核通过的数量==总验收数量,验收集合项目完成
|
|
|
|
|
AcceptanceSignFor byId = acceptanceSignForService.getById(s); |
|
|
|
|
byId.setStatus(2); |
|
|
|
|
acceptanceSignForService.updateById(byId); |
|
|
|
|
if (index == recordFormList.size()) {//验收审核通过的数量==总验收数量,验收集合项目完成
|
|
|
|
|
AcceptanceSignFor acceptanceSignForById = acceptanceSignForService.getById(id); |
|
|
|
|
acceptanceSignForById.setStatus(2); |
|
|
|
|
acceptanceSignForService.updateById(acceptanceSignForById); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|