|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.platform.b2b.service.impl;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -11,9 +12,12 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import com.uas.platform.b2b.dao.ApbillAdjustmentDao;
|
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
|
+import com.uas.platform.b2b.erp.model.PurchaseAPBill;
|
|
|
import com.uas.platform.b2b.model.ApbillAdjustment;
|
|
|
import com.uas.platform.b2b.service.ApbillAdjustmentService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
+import com.uas.platform.core.model.Status;
|
|
|
|
|
|
|
|
|
@Service
|
|
|
@@ -125,4 +129,35 @@ public class ApbillAdjustmentServiceImpl implements ApbillAdjustmentService {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ApbillAdjustment> convertnonPostAdjustment(List<PurchaseAPBill> apBills) {
|
|
|
+ List<ApbillAdjustment> adjusts = new ArrayList<ApbillAdjustment>();
|
|
|
+ if (!CollectionUtils.isEmpty(apBills)) {
|
|
|
+ Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (PurchaseAPBill apBill : apBills) {
|
|
|
+ List<ApbillAdjustment> list = apbillAdjustmentDao.findByEnuuAndInoutno(enUU, apBill.getAb_code());
|
|
|
+ if (list.size() > 0) {
|
|
|
+ adjusts.add(list.get(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return adjusts;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void nonPosting(List<ApbillAdjustment> adjustments) {
|
|
|
+ if (!CollectionUtils.isEmpty(adjustments)) {
|
|
|
+ for (ApbillAdjustment adjustment : adjustments) {
|
|
|
+ if (adjustment.getSendstatus() == Status.DOWNLOADED.value()) {
|
|
|
+ // 已传输到供应商ERP,修改单据反过账状态
|
|
|
+ adjustment.setNonposting(Constant.YES);
|
|
|
+ apbillAdjustmentDao.save(adjustment);
|
|
|
+ } else {
|
|
|
+ // 未传输到供应商ERP,直接删除平台上的单据
|
|
|
+ apbillAdjustmentDao.delete(adjustment);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|