|
@@ -448,10 +448,11 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
}
|
|
}
|
|
|
List<SaleSendItem> sendItems = 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()));
|
|
|
|
|
|
|
+ Short status = (short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value());
|
|
|
|
|
+ notice.setStatus(status);
|
|
|
purchaseNoticeDao.save(notice);
|
|
purchaseNoticeDao.save(notice);
|
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
|
- List<SaleSend> saleSends = new ArrayList<SaleSend>();
|
|
|
|
|
|
|
+ List<SaleSend> saleSends = new ArrayList<>();
|
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
|
}
|
|
}
|
|
|
// 我的产品库更新
|
|
// 我的产品库更新
|
|
@@ -482,36 +483,39 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
saleSend.setVerifystatus(Constant.NO);
|
|
saleSend.setVerifystatus(Constant.NO);
|
|
|
short number = 0;
|
|
short number = 0;
|
|
|
List<SaleSendItem> sendItems = new ArrayList<SaleSendItem>();
|
|
List<SaleSendItem> sendItems = new ArrayList<SaleSendItem>();
|
|
|
|
|
+ Set<Long> noticeIdSet = new HashSet<>();
|
|
|
for (SaleSendItem item : saleSend.getSendItems()) {
|
|
for (SaleSendItem item : saleSend.getSendItems()) {
|
|
|
- PurchaseNotice notice = purchaseNoticeDao.findOne(item.getNoticeId());
|
|
|
|
|
- if (notice != null) {
|
|
|
|
|
- if (notice.getEnd() != null && notice.getEnd() == Constant.YES) {
|
|
|
|
|
- String error = "货车中订单:" + notice.getOrderItem().getOrder().getCode() + "的物料号为"
|
|
|
|
|
- + notice.getOrderItem().getProduct().getCode() + "的发货通知被取消!";
|
|
|
|
|
- throw new IllegalOperatorException(error);
|
|
|
|
|
- } else {
|
|
|
|
|
- double thisQty = item.getQty();
|
|
|
|
|
- double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + thisQty;
|
|
|
|
|
- if (endQty > notice.getQty()) {
|
|
|
|
|
- throw new IllegalOperatorException("累计发货数量将超出本次送货提醒的需求数!");
|
|
|
|
|
- }
|
|
|
|
|
- item.setNotice(notice);
|
|
|
|
|
- // 带了序号则不重设序号,不带这重设序号
|
|
|
|
|
- if (item.getNumber() == null || item.getNumber() == 0) {
|
|
|
|
|
- item.setNumber(++number);
|
|
|
|
|
- }
|
|
|
|
|
- item.setOrderItem(notice.getOrderItem());
|
|
|
|
|
- item.setOrderItemId(notice.getOrderItemId());
|
|
|
|
|
- saleSend.setRate(notice.getOrderItem().getOrder().getRate());
|
|
|
|
|
- item.setSend(saleSend);
|
|
|
|
|
- sendItems.add(item);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- throw new IllegalOperatorException("参数错误,无效的客户送货提醒单!");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (!noticeIdSet.contains(item.getNoticeId())) {
|
|
|
|
|
+ PurchaseNotice notice = purchaseNoticeDao.findOne(item.getNoticeId());
|
|
|
|
|
+ noticeIdSet.add(item.getNoticeId());
|
|
|
|
|
+ if (notice != null) {
|
|
|
|
|
+ if (notice.getEnd() != null && notice.getEnd() == Constant.YES) {
|
|
|
|
|
+ String error = "货车中订单:" + notice.getOrderItem().getOrder().getCode() + "的物料号为"
|
|
|
|
|
+ + notice.getOrderItem().getProduct().getCode() + "的发货通知被取消!";
|
|
|
|
|
+ throw new IllegalOperatorException(error);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ double thisQty = item.getQty();
|
|
|
|
|
+ double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + thisQty;
|
|
|
|
|
+ if (endQty > notice.getQty()) {
|
|
|
|
|
+ throw new IllegalOperatorException("累计发货数量将超出本次送货提醒的需求数!");
|
|
|
|
|
+ }
|
|
|
|
|
+ item.setNotice(notice);
|
|
|
|
|
+ // 带了序号则不重设序号,不带这重设序号
|
|
|
|
|
+ if (item.getNumber() == null || item.getNumber() == 0) {
|
|
|
|
|
+ item.setNumber(++number);
|
|
|
|
|
+ }
|
|
|
|
|
+ item.setOrderItem(notice.getOrderItem());
|
|
|
|
|
+ item.setOrderItemId(notice.getOrderItemId());
|
|
|
|
|
+ saleSend.setRate(notice.getOrderItem().getOrder().getRate());
|
|
|
|
|
+ item.setSend(saleSend);
|
|
|
|
|
+ sendItems.add(item);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new IllegalOperatorException("参数错误,无效的客户送货提醒单!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- sendItems = saleSendItemDao.save(sendItems);
|
|
|
|
|
|
|
+ List<PurchaseNotice> noticeList = new ArrayList<>();
|
|
|
for (SaleSendItem sendItem : sendItems) {
|
|
for (SaleSendItem sendItem : sendItems) {
|
|
|
PurchaseNotice notice = purchaseNoticeDao.findOne(sendItem.getNoticeId());
|
|
PurchaseNotice notice = purchaseNoticeDao.findOne(sendItem.getNoticeId());
|
|
|
double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + sendItem.getQty();
|
|
double endQty = (notice.getEndQty() == null ? 0.0 : notice.getEndQty()) + sendItem.getQty();
|
|
@@ -519,14 +523,16 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
throw new IllegalOperatorException("累计发货数量将超出本次送货提醒的需求数!");
|
|
throw new IllegalOperatorException("累计发货数量将超出本次送货提醒的需求数!");
|
|
|
}
|
|
}
|
|
|
notice.setEndQty(endQty);
|
|
notice.setEndQty(endQty);
|
|
|
- notice.setStatus(
|
|
|
|
|
- (short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
|
|
- purchaseNoticeDao.save(notice);
|
|
|
|
|
|
|
+ Short status = (short) (endQty == notice.getQty() ? Status.REPLIED.value() : Status.NOT_REPLY.value());
|
|
|
|
|
+ notice.setStatus(status);
|
|
|
|
|
+ noticeList.add(notice);
|
|
|
// 转入我的物料库
|
|
// 转入我的物料库
|
|
|
personalProductService.covertPersonalProduct(notice.getOrderItem().getProductId(), "批量发货");
|
|
personalProductService.covertPersonalProduct(notice.getOrderItem().getProductId(), "批量发货");
|
|
|
}
|
|
}
|
|
|
|
|
+ purchaseNoticeDao.save(noticeList);
|
|
|
|
|
+ sendItems = saleSendItemDao.save(sendItems);
|
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
if (!CollectionUtils.isEmpty(sendItems)) {
|
|
|
- List<SaleSend> saleSends = new ArrayList<SaleSend>();
|
|
|
|
|
|
|
+ List<SaleSend> saleSends = new ArrayList<>();
|
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
saleSends.add(sendItems.get(0).getSend());
|
|
|
}
|
|
}
|
|
|
return sendItems.get(0).getSend();
|
|
return sendItems.get(0).getSend();
|
|
@@ -815,8 +821,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
code.append(date);
|
|
code.append(date);
|
|
|
barcodeSet.setMaxdate(date);
|
|
barcodeSet.setMaxdate(date);
|
|
|
// 如果当前日期大于上次日期
|
|
// 如果当前日期大于上次日期
|
|
|
- if (!("").equals(maxdate) && null != maxdate && (!NULL_COUNT.equals(date))
|
|
|
|
|
- && (Integer.valueOf(maxdate) > Integer.valueOf(date))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(maxdate) && (!NULL_COUNT.equals(date)) && (Integer.valueOf(maxdate) > Integer.valueOf(date))) {
|
|
|
// 流水重新开始
|
|
// 流水重新开始
|
|
|
code.append(lpad(lennum, "1"));
|
|
code.append(lpad(lennum, "1"));
|
|
|
// 流水号增加1
|
|
// 流水号增加1
|
|
@@ -862,8 +867,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
code.append(date);
|
|
code.append(date);
|
|
|
barcodeSet.setMaxdate(date);
|
|
barcodeSet.setMaxdate(date);
|
|
|
// 如果当前日期大于上次日期
|
|
// 如果当前日期大于上次日期
|
|
|
- if (!("").equals(maxdate) && null != maxdate && (!NULL_COUNT.equals(date))
|
|
|
|
|
- && (Integer.valueOf(maxdate) > Integer.valueOf(date))) {
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(maxdate) && (!NULL_COUNT.equals(date)) && (Integer.valueOf(maxdate) > Integer.valueOf(date))) {
|
|
|
// 流水重新开始
|
|
// 流水重新开始
|
|
|
code.append(lpad(lennum, "1"));
|
|
code.append(lpad(lennum, "1"));
|
|
|
// 流水号增加1
|
|
// 流水号增加1
|
|
@@ -950,7 +954,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
|
|
for (BarSendNotify barcode : bars) {
|
|
for (BarSendNotify barcode : bars) {
|
|
|
List<Map<String, Object>> list1 = new ArrayList<Map<String, Object>>();
|
|
List<Map<String, Object>> list1 = new ArrayList<Map<String, Object>>();
|
|
|
- Map<String, Object> mp1 = new HashMap<String, Object>();
|
|
|
|
|
|
|
+ Map<String, Object> mp1;
|
|
|
va = setting.getSql().replaceAll(regex, String.valueOf(barcode.getId()));
|
|
va = setting.getSql().replaceAll(regex, String.valueOf(barcode.getId()));
|
|
|
List<Map<String, Object>> listData = commonDao.queryForList(va);
|
|
List<Map<String, Object>> listData = commonDao.queryForList(va);
|
|
|
for (Map<String, Object> mapD : listData) {
|
|
for (Map<String, Object> mapD : listData) {
|
|
@@ -1002,7 +1006,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
List<Map<String, Object>> parameter = commonDao.queryForList(
|
|
List<Map<String, Object>> parameter = commonDao.queryForList(
|
|
|
"select la_pagesize, lp_id,lp_valuetype,lp_encode,lp_name,lp_leftrate,lp_toprate,lp_width,lp_ifshownote,lp_font,lp_size,lp_notealignjustify,lp_height from bar$labelParameter left join bar$label on la_id=lp_laid where la_id="
|
|
"select la_pagesize, lp_id,lp_valuetype,lp_encode,lp_name,lp_leftrate,lp_toprate,lp_width,lp_ifshownote,lp_font,lp_size,lp_notealignjustify,lp_height from bar$labelParameter left join bar$label on la_id=lp_laid where la_id="
|
|
|
+ setting.getLabel().getId());
|
|
+ setting.getLabel().getId());
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
|
+ Map<String, Object> map;
|
|
|
va = setting.getSql().replaceAll(regex, String.valueOf(bsnId));
|
|
va = setting.getSql().replaceAll(regex, String.valueOf(bsnId));
|
|
|
List<Map<String, Object>> listData = commonDao.queryForList(va);
|
|
List<Map<String, Object>> listData = commonDao.queryForList(va);
|
|
|
for (Map<String, Object> mapD : listData) {
|
|
for (Map<String, Object> mapD : listData) {
|