|
|
@ -79,9 +79,10 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
|
|
|
|
|
|
|
|
private RemoteWord2PDFService remoteWord2PDFService; |
|
|
|
private RemoteWord2PDFService remoteWord2PDFService; |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@Override//增加集中采购申请
|
|
|
|
@Override//增加集中采购申请
|
|
|
|
public CentralizedRequest addRequest( List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) { |
|
|
|
public CentralizedRequest addRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequest centralizedRequest = new CentralizedRequest(); |
|
|
|
CentralizedRequest centralizedRequest = new CentralizedRequest(); |
|
|
|
|
|
|
|
|
|
|
@ -108,16 +109,16 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
detailsOfCentralizedList.add(detailsOfCentralized); |
|
|
|
detailsOfCentralizedList.add(detailsOfCentralized); |
|
|
|
} |
|
|
|
} |
|
|
|
if (centralizedRequestService.save(centralizedRequest)&&detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)){ |
|
|
|
if (centralizedRequestService.save(centralizedRequest) && detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { |
|
|
|
return centralizedRequest; |
|
|
|
return centralizedRequest; |
|
|
|
}else return null; |
|
|
|
} else return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//提交申请
|
|
|
|
@Override//提交申请
|
|
|
|
public CentralizedRequest commitRequest(List<CentralizedRequestDTO> centralizedRequestDTOList,DLPUser dlpUser) { |
|
|
|
public CentralizedRequest commitRequest(List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
if (centralizedRequestDTOList.get(0).getCentralizedRequestId()==null){ |
|
|
|
if (centralizedRequestDTOList.get(0).getCentralizedRequestId() == null) { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequest centralizedRequest = centralizedRequestService.addRequest(centralizedRequestDTOList, dlpUser); |
|
|
|
CentralizedRequest centralizedRequest = centralizedRequestService.addRequest(centralizedRequestDTOList, dlpUser); |
|
|
|
|
|
|
|
|
|
|
@ -125,10 +126,10 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
centralizedRequest.setStatus(1); |
|
|
|
centralizedRequest.setStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
if (centralizedRequestService.updateById(centralizedRequest)){ |
|
|
|
if (centralizedRequestService.updateById(centralizedRequest)) { |
|
|
|
return centralizedRequest; |
|
|
|
return centralizedRequest; |
|
|
|
}else return null; |
|
|
|
} else return null; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequest byId = centralizedRequestService.getById(centralizedRequestDTOList.get(0).getCentralizedRequestId()); |
|
|
|
CentralizedRequest byId = centralizedRequestService.getById(centralizedRequestDTOList.get(0).getCentralizedRequestId()); |
|
|
|
|
|
|
|
|
|
|
@ -136,14 +137,13 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
byId.setStatus(1); |
|
|
|
byId.setStatus(1); |
|
|
|
|
|
|
|
|
|
|
|
if (centralizedRequestService.updateById(byId)){ |
|
|
|
if (centralizedRequestService.updateById(byId)) { |
|
|
|
return byId; |
|
|
|
return byId; |
|
|
|
}else return null; |
|
|
|
} else return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override//修改申请
|
|
|
|
@Override//修改申请
|
|
|
|
public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) { |
|
|
|
public DetailsOfCentralized editDetailsById(CentralizedRequestDTO centralizedRequestDto) { |
|
|
|
|
|
|
|
|
|
|
@ -151,9 +151,9 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); |
|
|
|
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); |
|
|
|
|
|
|
|
|
|
|
|
if (detailsOfCentralizedService.updateById(detailsOfCentralized)){ |
|
|
|
if (detailsOfCentralizedService.updateById(detailsOfCentralized)) { |
|
|
|
return detailsOfCentralized; |
|
|
|
return detailsOfCentralized; |
|
|
|
}else return null; |
|
|
|
} else return null; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -166,9 +166,9 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); |
|
|
|
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized); |
|
|
|
|
|
|
|
|
|
|
|
if (detailsOfCentralizedService.save(detailsOfCentralized)){ |
|
|
|
if (detailsOfCentralizedService.save(detailsOfCentralized)) { |
|
|
|
return detailsOfCentralized; |
|
|
|
return detailsOfCentralized; |
|
|
|
}else return null; |
|
|
|
} else return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override//删除申请
|
|
|
|
@Override//删除申请
|
|
|
@ -181,7 +181,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
List<DetailsOfCentralized> list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper); |
|
|
|
List<DetailsOfCentralized> list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
if (list.size()!=0){ |
|
|
|
if (list.size() != 0) { |
|
|
|
|
|
|
|
|
|
|
|
detailsOfCentralizedService.removeBatchByIds(list); |
|
|
|
detailsOfCentralizedService.removeBatchByIds(list); |
|
|
|
|
|
|
|
|
|
|
@ -202,7 +202,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
//查询状态为1的采购申请:已提交
|
|
|
|
//查询状态为1的采购申请:已提交
|
|
|
|
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,1); |
|
|
|
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus, 1); |
|
|
|
|
|
|
|
|
|
|
|
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); |
|
|
|
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
@ -210,7 +210,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
for (CentralizedRequest centralizedRequest : list) { |
|
|
|
for (CentralizedRequest centralizedRequest : list) { |
|
|
|
CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO(); |
|
|
|
CentralizedRequestVO centralizedRequestVO = new CentralizedRequestVO(); |
|
|
|
BeanUtils.copyProperties(centralizedRequest,centralizedRequestVO); |
|
|
|
BeanUtils.copyProperties(centralizedRequest, centralizedRequestVO); |
|
|
|
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId())); |
|
|
|
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestVO.getId())); |
|
|
|
centralizedRequestVOArrayList.add(centralizedRequestVO); |
|
|
|
centralizedRequestVOArrayList.add(centralizedRequestVO); |
|
|
|
} |
|
|
|
} |
|
|
@ -246,7 +246,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO,DLPUser dlpUser){ |
|
|
|
public CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequest byId = centralizedRequestService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
CentralizedRequest byId = centralizedRequestService.getById(auditAndApproveDTO.getUuId()); |
|
|
|
|
|
|
|
|
|
|
@ -255,20 +255,21 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
byId.setAuditOpinion(auditAndApproveDTO.getAuditOpinion()); |
|
|
|
byId.setAuditOpinion(auditAndApproveDTO.getAuditOpinion()); |
|
|
|
byId.setAuditResult(auditAndApproveDTO.getAuditResult()); |
|
|
|
byId.setAuditResult(auditAndApproveDTO.getAuditResult()); |
|
|
|
|
|
|
|
|
|
|
|
if (auditAndApproveDTO.getAuditResult()==true){ |
|
|
|
if (auditAndApproveDTO.getAuditResult() == true) { |
|
|
|
byId.setStatus(2); |
|
|
|
byId.setStatus(2); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
byId.setStatus(-2); |
|
|
|
} |
|
|
|
} |
|
|
|
else {byId.setStatus(-2);} |
|
|
|
if (centralizedRequestService.updateById(byId)) { |
|
|
|
if (centralizedRequestService.updateById(byId)){ |
|
|
|
|
|
|
|
return byId; |
|
|
|
return byId; |
|
|
|
}else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} else throw new RuntimeException(String.format("审核失败")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<PurchaseRequestPrintVO> getPurchaseRequestPrintList(String id, String type) { |
|
|
|
public List<PurchaseRequestPrintVO> getPurchaseRequestPrintList(String id, String type) { |
|
|
|
ArrayList<PurchaseRequestPrintVO> purchaseRequestPrintVOList = new ArrayList<>(); |
|
|
|
ArrayList<PurchaseRequestPrintVO> purchaseRequestPrintVOList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
if(type.equals("集中采购申请")){ |
|
|
|
if (type.equals("集中采购申请")) { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequestVO centralizedRequest = centralizedRequestService.getCentralizedRequestVO(id); |
|
|
|
CentralizedRequestVO centralizedRequest = centralizedRequestService.getCentralizedRequestVO(id); |
|
|
|
|
|
|
|
|
|
|
@ -279,7 +280,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
|
|
|
|
|
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId()); |
|
|
|
ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId()); |
|
|
|
|
|
|
|
|
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")){ |
|
|
|
if (reagentConsumables.getCategory().equals("标准物质")) { |
|
|
|
|
|
|
|
|
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName()); |
|
|
|
purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName()); |
|
|
@ -291,17 +292,18 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
purchaseRequestPrintVO.setUnitPrice(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getUnitPrice()); |
|
|
|
purchaseRequestPrintVO.setUnitPrice(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getUnitPrice()); |
|
|
|
purchaseRequestPrintVO.setSubtotal(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getSubtotal()); |
|
|
|
purchaseRequestPrintVO.setSubtotal(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getSubtotal()); |
|
|
|
purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getOne(Wrappers.<PurchaseListDetails>query().eq("procurement_content_id", detailsOfCentralized.getProcurementContentId())).getSupplierId()).getSupplierName()); |
|
|
|
purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getOne(Wrappers.<PurchaseListDetails>query().eq("procurement_content_id", detailsOfCentralized.getProcurementContentId())).getSupplierId()).getSupplierName()); |
|
|
|
purchaseRequestPrintVOList.add(purchaseRequestPrintVO);} |
|
|
|
purchaseRequestPrintVOList.add(purchaseRequestPrintVO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); |
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); |
|
|
|
|
|
|
|
|
|
|
|
for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) { |
|
|
|
for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) { |
|
|
|
|
|
|
|
|
|
|
|
if (decentralizeDetails.getCategory().equals("标准物质")){ |
|
|
|
if (decentralizeDetails.getCategory().equals("标准物质")) { |
|
|
|
|
|
|
|
|
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); |
|
|
|
|
|
|
|
|
|
|
@ -315,11 +317,13 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
//查找出供应商名称
|
|
|
|
//查找出供应商名称
|
|
|
|
purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName()); |
|
|
|
purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName()); |
|
|
|
|
|
|
|
|
|
|
|
purchaseRequestPrintVOList.add(purchaseRequestPrintVO);} |
|
|
|
purchaseRequestPrintVOList.add(purchaseRequestPrintVO); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return purchaseRequestPrintVOList; |
|
|
|
return purchaseRequestPrintVOList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void purchaseRequestTablePDF(List<PurchaseRequestPrintVO> voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { |
|
|
|
public void purchaseRequestTablePDF(List<PurchaseRequestPrintVO> voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { |
|
|
|
System.out.println("purchaseRequestTablePDF................."); |
|
|
|
System.out.println("purchaseRequestTablePDF................."); |
|
|
@ -334,7 +338,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
x++; |
|
|
|
x++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String firstAuditName =null; |
|
|
|
String firstAuditName = null; |
|
|
|
String secondAuditName = null; |
|
|
|
String secondAuditName = null; |
|
|
|
String thirdAuditName = null; |
|
|
|
String thirdAuditName = null; |
|
|
|
String fourthAuditName = null; |
|
|
|
String fourthAuditName = null; |
|
|
@ -343,7 +347,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
//-----------------------------
|
|
|
|
//-----------------------------
|
|
|
|
// 生成 word 版本的 采购目录
|
|
|
|
// 生成 word 版本的 采购目录
|
|
|
|
|
|
|
|
|
|
|
|
if (type.equals("集中采购申请")){ |
|
|
|
if (type.equals("集中采购申请")) { |
|
|
|
|
|
|
|
|
|
|
|
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(id); |
|
|
|
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(id); |
|
|
|
PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId()); |
|
|
|
PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId()); |
|
|
@ -351,16 +355,15 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques |
|
|
|
secondAuditName = byId.getCreateName(); |
|
|
|
secondAuditName = byId.getCreateName(); |
|
|
|
thirdAuditName = byId.getPrimaryAuditorName(); |
|
|
|
thirdAuditName = byId.getPrimaryAuditorName(); |
|
|
|
fourthAuditName = byId.getApproverName(); |
|
|
|
fourthAuditName = byId.getApproverName(); |
|
|
|
commitTime = LocalDateTimeUtil.format(centralizedRequestVO.getDateOfApplication(),"yyyy年MM月dd日"); |
|
|
|
commitTime = LocalDateTimeUtil.format(centralizedRequestVO.getDateOfApplication(), "yyyy年MM月dd日"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
else { |
|
|
|
|
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); |
|
|
|
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); |
|
|
|
firstAuditName = requestById.getPrimaryAuditorName(); |
|
|
|
firstAuditName = requestById.getPrimaryAuditorName(); |
|
|
|
secondAuditName = requestById.getSecondaryAuditorName(); |
|
|
|
secondAuditName = requestById.getSecondaryAuditorName(); |
|
|
|
thirdAuditName = requestById.getThreeLevelAuditName(); |
|
|
|
thirdAuditName = requestById.getThreeLevelAuditName(); |
|
|
|
fourthAuditName = requestById.getApproverName(); |
|
|
|
fourthAuditName = requestById.getApproverName(); |
|
|
|
commitTime = LocalDateTimeUtil.format(requestById.getCommitTime(),"yyyy年MM月dd日"); |
|
|
|
commitTime = LocalDateTimeUtil.format(requestById.getCommitTime(), "yyyy年MM月dd日"); |
|
|
|
} |
|
|
|
} |
|
|
|
String applyFileName = "标准物质采购申请表-" + id; |
|
|
|
String applyFileName = "标准物质采购申请表-" + id; |
|
|
|
|
|
|
|
|
|
|
|