|
@@ -3,11 +3,13 @@ package com.uas.platform.b2b.service.impl;
|
|
|
import com.uas.platform.b2b.core.util.ContextUtils;
|
|
import com.uas.platform.b2b.core.util.ContextUtils;
|
|
|
import com.uas.platform.b2b.core.util.SplitArray;
|
|
import com.uas.platform.b2b.core.util.SplitArray;
|
|
|
import com.uas.platform.b2b.core.util.ThreadTask;
|
|
import com.uas.platform.b2b.core.util.ThreadTask;
|
|
|
|
|
+import com.uas.platform.b2b.core.util.ThreadUtils;
|
|
|
import com.uas.platform.b2b.dao.*;
|
|
import com.uas.platform.b2b.dao.*;
|
|
|
import com.uas.platform.b2b.erp.model.PurchaseNotify;
|
|
import com.uas.platform.b2b.erp.model.PurchaseNotify;
|
|
|
import com.uas.platform.b2b.event.*;
|
|
import com.uas.platform.b2b.event.*;
|
|
|
import com.uas.platform.b2b.model.*;
|
|
import com.uas.platform.b2b.model.*;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
|
|
+import com.uas.platform.b2b.service.ProductUsersService;
|
|
|
import com.uas.platform.b2b.service.PurchaseNoticeService;
|
|
import com.uas.platform.b2b.service.PurchaseNoticeService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
@@ -61,16 +63,22 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private B2bCodeSetDao b2bCodeSetDao;
|
|
private B2bCodeSetDao b2bCodeSetDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BarPackageDao barPackageDao;
|
|
private BarPackageDao barPackageDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BarSendNotifyDao barSendNotifyDao;
|
|
private BarSendNotifyDao barSendNotifyDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BarPackageDetailDao barPackageDetailDao;
|
|
private BarPackageDetailDao barPackageDetailDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CommonDao commonDao;
|
|
private CommonDao commonDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BarLPSetingDao barLPSetingDao;
|
|
private BarLPSetingDao barLPSetingDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SearchService searchService;
|
|
private SearchService searchService;
|
|
|
|
|
|
|
@@ -92,6 +100,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private VendorDao vendorDao;
|
|
private VendorDao vendorDao;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ProductUsersService productUsersService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void save(List<PurchaseNotice> notices) {
|
|
public void save(List<PurchaseNotice> notices) {
|
|
|
notices = purchaseNoticeDao.save(notices);
|
|
notices = purchaseNoticeDao.save(notices);
|
|
@@ -448,13 +459,15 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
|
ContextUtils.publishEvent(new SaleSendSaveEvent(saleSends));
|
|
ContextUtils.publishEvent(new SaleSendSaveEvent(saleSends));
|
|
|
}
|
|
}
|
|
|
|
|
+ // 我的产品库更新
|
|
|
|
|
+ productUsersService.coverToMyProduct(notice.getOrderItem().getProductId(), SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "单个发货");
|
|
|
return sendItems.get(0).getSend();
|
|
return sendItems.get(0).getSend();
|
|
|
} else {
|
|
} else {
|
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
|
+ @Override
|
|
|
public int getOnhandCount() {
|
|
public int getOnhandCount() {
|
|
|
return purchaseNoticeDao.getCountByVendUUAndStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
return purchaseNoticeDao.getCountByVendUUAndStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
(short) Status.NOT_REPLY.value());
|
|
(short) Status.NOT_REPLY.value());
|
|
@@ -513,6 +526,8 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
notice.setStatus(
|
|
notice.setStatus(
|
|
|
(short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
(short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
purchaseNoticeDao.save(notice);
|
|
purchaseNoticeDao.save(notice);
|
|
|
|
|
+ // 转入我的物料库
|
|
|
|
|
+ productUsersService.coverToMyProduct(notice.getOrderItem().getProductId(), SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "批量发货");
|
|
|
}
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
|
List<SaleSend> saleSends = new ArrayList<SaleSend>();
|
|
List<SaleSend> saleSends = new ArrayList<SaleSend>();
|