|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
@ -15,16 +16,18 @@ import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormAuditDTO; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.entity.WarehousingRecordForm; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.service.*; |
|
|
|
import digital.laboratory.platform.reagent.utils.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.utils.PageUtils; |
|
|
|
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; |
|
|
|
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; |
|
|
|
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm; |
|
|
|
import digital.laboratory.platform.reagent.entity.ReagentConsumables; |
|
|
|
import digital.laboratory.platform.reagent.entity.ReagentConsumables; |
|
|
|
import digital.laboratory.platform.reagent.mapper.AcceptanceRecordFormMapper; |
|
|
|
import digital.laboratory.platform.reagent.mapper.AcceptanceRecordFormMapper; |
|
|
|
import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService; |
|
|
|
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormFullVO; |
|
|
|
import digital.laboratory.platform.reagent.service.BlacklistService; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.service.ReagentConsumablesService; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; |
|
|
|
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.vo.WarehousingContentVO; |
|
|
|
import feign.Response; |
|
|
|
import feign.Response; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
@ -57,12 +60,18 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ReagentConsumablesService reagentConsumablesService; |
|
|
|
private ReagentConsumablesService reagentConsumablesService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private WarehousingContentService warehousingContentService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private OssFile ossFile; |
|
|
|
private OssFile ossFile; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private RemoteWord2PDFService remoteWord2PDFService; |
|
|
|
private RemoteWord2PDFService remoteWord2PDFService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private WarehousingRecordFormService warehousingRecordFormService; |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, DLPUser dlpUser) { |
|
|
|
public void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, DLPUser dlpUser) { |
|
|
@ -95,7 +104,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
} if (byId.getStatus() == -3) { |
|
|
|
} |
|
|
|
|
|
|
|
if (byId.getStatus() == -3) { |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
@ -116,7 +126,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
throw new RuntimeException(String.format("重新提交失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
} if (byId.getStatus() == -4) { |
|
|
|
} |
|
|
|
|
|
|
|
if (byId.getStatus() == -4) { |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId); |
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
|
byId.setUserName(dlpUser.getName()); |
|
|
@ -156,7 +167,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId) { |
|
|
|
public AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId, String acceptanceSignForId) { |
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm acceptanceRecordForm = new AcceptanceRecordForm(); |
|
|
|
AcceptanceRecordForm acceptanceRecordForm = new AcceptanceRecordForm(); |
|
|
|
|
|
|
|
|
|
|
@ -164,6 +175,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setSupplierId(supplierId); |
|
|
|
acceptanceRecordForm.setSupplierId(supplierId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setAcceptanceSignForId(acceptanceSignForId); |
|
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId); |
|
|
|
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId); |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId); |
|
|
|
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId); |
|
|
@ -180,9 +193,9 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw) { |
|
|
|
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm> qw,String acceptanceSignForId) { |
|
|
|
|
|
|
|
|
|
|
|
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page,qw); |
|
|
|
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page, qw,acceptanceSignForId); |
|
|
|
|
|
|
|
|
|
|
|
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords(); |
|
|
|
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords(); |
|
|
|
|
|
|
|
|
|
|
@ -236,64 +249,90 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//一级审核
|
|
|
|
@Override//一级审核
|
|
|
|
public AcceptanceRecordForm primaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
@Transactional |
|
|
|
|
|
|
|
public boolean primaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId(); |
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId()); |
|
|
|
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String s : uuId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(s); |
|
|
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 1) { |
|
|
|
if (byId.getStatus() != 1) { |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
} |
|
|
|
} |
|
|
|
byId.setPrimaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setPrimaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setAuditOpinionOfPrimary(auditAndApproveDTO.getAuditOpinion()); |
|
|
|
byId.setAuditOpinionOfPrimary(acceptanceRecordFormAuditDTO.getAuditOpinion()); |
|
|
|
byId.setAuditTimeOfPrimary(LocalDateTime.now()); |
|
|
|
byId.setAuditTimeOfPrimary(LocalDateTime.now()); |
|
|
|
byId.setAuditResultOfPrimary(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setAuditResultOfPrimary(acceptanceRecordFormAuditDTO.getAuditResult()); |
|
|
|
|
|
|
|
|
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) { |
|
|
|
byId.setStatus(2); |
|
|
|
byId.setStatus(2); |
|
|
|
} else byId.setStatus(-2); |
|
|
|
} else byId.setStatus(-2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
|
|
|
|
|
|
|
|
if (this.updateById(byId)) { |
|
|
|
} |
|
|
|
return byId; |
|
|
|
|
|
|
|
|
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
|
|
|
return true; |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//二级审核
|
|
|
|
@Override//二级审核
|
|
|
|
public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
@Transactional |
|
|
|
|
|
|
|
public boolean secondaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId()); |
|
|
|
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId(); |
|
|
|
|
|
|
|
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String s : uuId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(s); |
|
|
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 2) { |
|
|
|
if (byId.getStatus() != 2) { |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
} |
|
|
|
} |
|
|
|
byId.setSecondaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setSecondaryAuditorId(dlpUser.getId()); |
|
|
|
byId.setAuditOpinionOfSecondary(auditAndApproveDTO.getAuditOpinion()); |
|
|
|
byId.setAuditOpinionOfSecondary(acceptanceRecordFormAuditDTO.getAuditOpinion()); |
|
|
|
byId.setAuditTimeOfSecondary(LocalDateTime.now()); |
|
|
|
byId.setAuditTimeOfSecondary(LocalDateTime.now()); |
|
|
|
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setAuditResultOfSecondary(acceptanceRecordFormAuditDTO.getAuditResult()); |
|
|
|
|
|
|
|
|
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) { |
|
|
|
byId.setStatus(3); |
|
|
|
byId.setStatus(3); |
|
|
|
} else byId.setStatus(-3); |
|
|
|
} else byId.setStatus(-3); |
|
|
|
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
if (this.updateById(byId)) { |
|
|
|
} |
|
|
|
return byId; |
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
|
|
|
return true; |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//三级审核
|
|
|
|
@Override//三级审核
|
|
|
|
public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
@Transactional |
|
|
|
|
|
|
|
public boolean threeLevelAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId(); |
|
|
|
|
|
|
|
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId()); |
|
|
|
for (String s : uuId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AcceptanceRecordForm byId = this.getById(s); |
|
|
|
|
|
|
|
|
|
|
|
if (byId.getStatus() != 3) { |
|
|
|
if (byId.getStatus() != 3) { |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
throw new RuntimeException(String.format("当前状态不能审核")); |
|
|
|
} |
|
|
|
} |
|
|
|
byId.setThreeLevelAuditorId(dlpUser.getId()); |
|
|
|
byId.setThreeLevelAuditorId(dlpUser.getId()); |
|
|
|
byId.setAuditOpinionOfThreeLevel(auditAndApproveDTO.getAuditOpinion()); |
|
|
|
byId.setAuditOpinionOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditOpinion()); |
|
|
|
byId.setAuditTimeOfThreeLevel(LocalDateTime.now()); |
|
|
|
byId.setAuditTimeOfThreeLevel(LocalDateTime.now()); |
|
|
|
byId.setAuditResultOfThreeLevel(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setAuditResultOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditResult()); |
|
|
|
|
|
|
|
|
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) { |
|
|
|
|
|
|
|
|
|
|
|
if (byId.getNonconformingItem() != null) { |
|
|
|
if (byId.getNonconformingItem() != null) { |
|
|
|
|
|
|
|
|
|
|
@ -301,9 +340,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} |
|
|
|
} |
|
|
|
byId.setStatus(6); |
|
|
|
byId.setStatus(6); |
|
|
|
} else byId.setStatus(-4); |
|
|
|
} else byId.setStatus(-4); |
|
|
|
|
|
|
|
acceptanceRecordForms.add(byId); |
|
|
|
if (this.updateById(byId)) { |
|
|
|
} |
|
|
|
return byId; |
|
|
|
if (this.updateBatchById(acceptanceRecordForms)) { |
|
|
|
|
|
|
|
return true; |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -434,5 +474,4 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|