|
@@ -24,6 +24,7 @@ import com.uas.platform.b2b.dao.SaleSendDao;
|
|
|
import com.uas.platform.b2b.dao.SaleSendItemDao;
|
|
import com.uas.platform.b2b.dao.SaleSendItemDao;
|
|
|
import com.uas.platform.b2b.erp.model.PurchaseNotify;
|
|
import com.uas.platform.b2b.erp.model.PurchaseNotify;
|
|
|
import com.uas.platform.b2b.event.PurchaseNoticeSaveEvent;
|
|
import com.uas.platform.b2b.event.PurchaseNoticeSaveEvent;
|
|
|
|
|
+import com.uas.platform.b2b.event.SaleSendSaveEvent;
|
|
|
import com.uas.platform.b2b.model.PurchaseNotice;
|
|
import com.uas.platform.b2b.model.PurchaseNotice;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrder;
|
|
import com.uas.platform.b2b.model.PurchaseOrder;
|
|
|
import com.uas.platform.b2b.model.SaleSend;
|
|
import com.uas.platform.b2b.model.SaleSend;
|
|
@@ -234,15 +235,14 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
item.setPrice(notice.getOrderItem().getPrice());
|
|
item.setPrice(notice.getOrderItem().getPrice());
|
|
|
item.setSend(send);
|
|
item.setSend(send);
|
|
|
}
|
|
}
|
|
|
- saleSendItemDao.save(send.getSendItems());
|
|
|
|
|
|
|
+ List<SaleSendItem> sendItems = saleSendItemDao.save(send.getSendItems());
|
|
|
notice.setEndQty(endQty);
|
|
notice.setEndQty(endQty);
|
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
purchaseNoticeDao.save(notice);
|
|
purchaseNoticeDao.save(notice);
|
|
|
- if (send.getCustUserUU() != null) {
|
|
|
|
|
- XingePusher.pushSingleAccountAndroid(send.getCustUserUU().toString(), "供应商发货了", "供应商:"
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName(), null);
|
|
|
|
|
- XingePusher.pushSingleAccountIOS(send.getCustUserUU().toString(), "供应商发货了" + " 供应商:"
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName());
|
|
|
|
|
|
|
+ if(!CollectionUtils.isEmpty(sendItems)) {
|
|
|
|
|
+ List<SaleSend> saleSends = new ArrayList<SaleSend>();
|
|
|
|
|
+ saleSends.add(sendItems.get(0).getSend());
|
|
|
|
|
+ ContextUtils.publishEvent(new SaleSendSaveEvent(saleSends));
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
throw new IllegalOperatorException("请对有效的送货提醒发货!");
|
|
@@ -296,11 +296,10 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
notice.setStatus((short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
purchaseNoticeDao.save(notice);
|
|
purchaseNoticeDao.save(notice);
|
|
|
}
|
|
}
|
|
|
- if (saleSend.getCustUserUU() != null) {
|
|
|
|
|
- XingePusher.pushSingleAccountAndroid(saleSend.getCustUserUU().toString(), "供应商发货了", "供应商:"
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName(), null);
|
|
|
|
|
- XingePusher.pushSingleAccountIOS(saleSend.getCustUserUU().toString(), "供应商发货了" + " 供应商:"
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName());
|
|
|
|
|
|
|
+ if(!CollectionUtils.isEmpty(sendItems)) {
|
|
|
|
|
+ List<SaleSend> saleSends = new ArrayList<SaleSend>();
|
|
|
|
|
+ saleSends.add(sendItems.get(0).getSend());
|
|
|
|
|
+ ContextUtils.publishEvent(new SaleSendSaveEvent(saleSends));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|