|
@@ -50,6 +50,7 @@ import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
import com.uas.search.b2b.model.SPage;
|
|
import com.uas.search.b2b.model.SPage;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
@@ -363,13 +364,6 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
// 未收料
|
|
// 未收料
|
|
|
send.setVerifystatus(Constant.NO);
|
|
send.setVerifystatus(Constant.NO);
|
|
|
send.setCustUU(notice.getEnUU());
|
|
send.setCustUU(notice.getEnUU());
|
|
|
- /*
|
|
|
|
|
- if (!StringUtils.isEmpty(notice.getOrderItem().getCustPurchaseCode())) {
|
|
|
|
|
- send.setCustUserUU(enterpriseDao.findOne(notice.getEnUU()).getEnAdminuu());
|
|
|
|
|
- } else {
|
|
|
|
|
- send.setCustUserUU(order.getUserUU());
|
|
|
|
|
- }
|
|
|
|
|
- */
|
|
|
|
|
send.setCustUserUU(order.getUserUU());
|
|
send.setCustUserUU(order.getUserUU());
|
|
|
send.setDate(new Date());
|
|
send.setDate(new Date());
|
|
|
send.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
send.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
@@ -397,14 +391,13 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
}
|
|
}
|
|
|
// 我的产品库更新
|
|
// 我的产品库更新
|
|
|
personalProductService.covertPersonalProduct(notice.getOrderItem().getProductId(), "单个发货");
|
|
personalProductService.covertPersonalProduct(notice.getOrderItem().getProductId(), "单个发货");
|
|
|
|
|
+ SaleSend saleSend = new SaleSend();
|
|
|
|
|
+ BeanUtils.copyProperties(sendItems.get(0).getSend(), saleSend);
|
|
|
// 代采发货单
|
|
// 代采发货单
|
|
|
if (!StringUtils.isEmpty(notice.getOrderItem().getCustPurchaseCode())) {
|
|
if (!StringUtils.isEmpty(notice.getOrderItem().getCustPurchaseCode())) {
|
|
|
- //send.setCustUserUU(enterpriseDao.findOne(notice.getEnUU()).getEnAdminuu());
|
|
|
|
|
- ContextUtils.publishEvent(new SaleSendAgentEvent(notice));
|
|
|
|
|
- } else {
|
|
|
|
|
- send.setCustUserUU(order.getUserUU());
|
|
|
|
|
|
|
+ ContextUtils.publishEvent(new SaleSendAgentEvent(notice, send));
|
|
|
}
|
|
}
|
|
|
- return sendItems.get(0).getSend();
|
|
|
|
|
|
|
+ return saleSend;
|
|
|
} else {
|
|
} else {
|
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
|
}
|
|
}
|
|
@@ -478,6 +471,19 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
}
|
|
}
|
|
|
purchaseNoticeDao.save(noticeList);
|
|
purchaseNoticeDao.save(noticeList);
|
|
|
sendItems = saleSendItemDao.save(sendItems);
|
|
sendItems = saleSendItemDao.save(sendItems);
|
|
|
|
|
+ for (SaleSendItem sendItem : sendItems) {
|
|
|
|
|
+ Long noticeId = sendItem.getNoticeId();
|
|
|
|
|
+ for (PurchaseNotice notice : noticeList) {
|
|
|
|
|
+ if (notice.getId().equals(noticeId) && !StringUtils.isEmpty(notice.getOrderItem().getCustPurchaseCode())) {
|
|
|
|
|
+ SaleSend send = new SaleSend();
|
|
|
|
|
+ send.setRecorder(sendItem.getSend().getRecorder());
|
|
|
|
|
+ Set<SaleSendItem> set = new HashSet<>();
|
|
|
|
|
+ set.add(sendItem);
|
|
|
|
|
+ send.setSendItems(set);
|
|
|
|
|
+ ContextUtils.publishEvent(new SaleSendAgentEvent(notice, send));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
|
List<SaleSend> saleSends = new ArrayList<>();
|
|
List<SaleSend> saleSends = new ArrayList<>();
|
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
saleSends.add(sendItems.get(0).getSend());
|