|
|
@@ -84,6 +84,90 @@ public class PurchaseProofingServiceImpl implements PurchaseProofingService{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void saveApprovalAttach(List<Attach> attachs) {
|
|
|
+ if (!CollectionUtils.isEmpty(attachs)) {
|
|
|
+ long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (Attach attach : attachs) {
|
|
|
+ List<PurchaseProofingApproval> approvals = purchaseProofingApprovalDao.findByEnUUAndCode(enUU, attach.getSourceId());
|
|
|
+ if (!CollectionUtils.isEmpty(approvals)) {
|
|
|
+ PurchaseProofingApproval approval = approvals.get(0);
|
|
|
+ String atId = approval.getAttach();
|
|
|
+ if (!StringUtils.hasText(atId))
|
|
|
+ atId = "";
|
|
|
+ else
|
|
|
+ atId += ",";
|
|
|
+ atId += attach.getId();
|
|
|
+ approval.setAttach(atId);
|
|
|
+ purchaseProofingApprovalDao.save(approval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveApprovalPrdattach(List<Attach> attachs) {
|
|
|
+ if (!CollectionUtils.isEmpty(attachs)) {
|
|
|
+ long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (Attach attach : attachs) {
|
|
|
+ List<PurchaseProofingApproval> approvals = purchaseProofingApprovalDao.findByEnUUAndCode(enUU, attach.getSourceId());
|
|
|
+ if (!CollectionUtils.isEmpty(approvals)) {
|
|
|
+ PurchaseProofingApproval approval = approvals.get(0);
|
|
|
+ String atId = approval.getPrdattach();
|
|
|
+ if (!StringUtils.hasText(atId))
|
|
|
+ atId = "";
|
|
|
+ else
|
|
|
+ atId += ",";
|
|
|
+ atId += attach.getId();
|
|
|
+ approval.setPrdattach(atId);
|
|
|
+ purchaseProofingApprovalDao.save(approval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveApprovalPadattach(List<Attach> attachs) {
|
|
|
+ if (!CollectionUtils.isEmpty(attachs)) {
|
|
|
+ long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (Attach attach : attachs) {
|
|
|
+ List<PurchaseProofingApproval> approvals = purchaseProofingApprovalDao.findByEnUUAndCode(enUU, attach.getSourceId());
|
|
|
+ if (!CollectionUtils.isEmpty(approvals)) {
|
|
|
+ PurchaseProofingApproval approval = approvals.get(0);
|
|
|
+ String atId = approval.getPadattach();
|
|
|
+ if (!StringUtils.hasText(atId))
|
|
|
+ atId = "";
|
|
|
+ else
|
|
|
+ atId += ",";
|
|
|
+ atId += attach.getId();
|
|
|
+ approval.setPadattach(atId);
|
|
|
+ purchaseProofingApprovalDao.save(approval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveApprovalPpdattach(List<Attach> attachs) {
|
|
|
+ if (!CollectionUtils.isEmpty(attachs)) {
|
|
|
+ long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (Attach attach : attachs) {
|
|
|
+ List<PurchaseProofingApproval> approvals = purchaseProofingApprovalDao.findByEnUUAndCode(enUU, attach.getSourceId());
|
|
|
+ if (!CollectionUtils.isEmpty(approvals)) {
|
|
|
+ PurchaseProofingApproval approval = approvals.get(0);
|
|
|
+ String atId = approval.getPpdattach();
|
|
|
+ if (!StringUtils.hasText(atId))
|
|
|
+ atId = "";
|
|
|
+ else
|
|
|
+ atId += ",";
|
|
|
+ atId += attach.getId();
|
|
|
+ approval.setPpdattach(atId);
|
|
|
+ purchaseProofingApprovalDao.save(approval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<PurchaseProofingItem> findNotUploadProofing() {
|
|
|
return purchaseProofingItemDao.findByVendUUAndSendStatus(SystemSession.getUser().getEnterprise().getUu(),
|