备料重算后更新请购单
This commit is contained in:
parent
428a272e5e
commit
ca3ab63f5b
|
|
@ -81,35 +81,30 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule<PMOAggVO> {
|
||||||
pmoids.add(map2.get("pk_praybill").toString());
|
pmoids.add(map2.get("pk_praybill").toString());
|
||||||
}
|
}
|
||||||
if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal) map.get("nplanoutnum"))) > 0) {
|
if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal) map.get("nplanoutnum"))) > 0) {
|
||||||
// 更新请购单
|
|
||||||
String sql = "update po_praybill_b set vbdef33='" + map.get("nplanoutnum") + "' where pk_praybill_b='"
|
|
||||||
+ map2.get("pk_praybill_b") + "'";
|
|
||||||
int num = dao.executeUpdate(sql);
|
|
||||||
if (num > 0 && "C030".equals(orgCode)) {
|
|
||||||
SyncSrmPrayBillUtil billUtil = new SyncSrmPrayBillUtil();
|
|
||||||
JSONObject reqData = new JSONObject();
|
|
||||||
reqData.put("org", "C030");// 组织编码
|
|
||||||
reqData.put("erpId", map2.get("pk_praybill_b"));// 请购单表体主键
|
|
||||||
reqData.put("mainNum", map.get("nplanoutnum"));// 主数量
|
|
||||||
billUtil.reqBIPBill(reqData);
|
|
||||||
}
|
|
||||||
// 꿴璂꽃뭔땐데
|
// 꿴璂꽃뭔땐데
|
||||||
String ordersql = "select pk_order_b from po_order_b where csourcebid ='" + map2.get("pk_praybill_b") + "' and dr = 0";
|
String ordersql = "select pk_order_b from po_order_b where csourcebid ='" + map2.get("pk_praybill_b") + "' and dr = 0";
|
||||||
List<Map<String, Object>> orders = (List<Map<String, Object>>) dao.executeQuery(ordersql, new MapListProcessor());
|
List<Map<String, Object>> orders = (List<Map<String, Object>>) dao.executeQuery(ordersql, new MapListProcessor());
|
||||||
for (Map<String, Object> order : orders) {
|
for (Map<String, Object> order : orders) {
|
||||||
// 更新采购订单
|
|
||||||
String updateOrderSql = "update po_order_b set vbdef33='" + map.get("nplanoutnum") + "' where pk_order_b='"
|
|
||||||
+ order.get("pk_order_b") + "'";
|
|
||||||
dao.executeUpdate(updateOrderSql);
|
|
||||||
// 꿴璂돕새데
|
// 꿴璂돕새데
|
||||||
String arriveordersql = "select pk_arriveorder_b from po_arriveorder_b where csourcebid ='" + order.get("pk_order_b") + "' and dr = 0";
|
String arriveordersql = "select pk_arriveorder_b from po_arriveorder_b where csourcebid ='" + order.get("pk_order_b") + "' and dr = 0";
|
||||||
List<Map<String, Object>> arriveorders = (List<Map<String, Object>>) dao.executeQuery(arriveordersql, new MapListProcessor());
|
List<Map<String, Object>> arriveorders = (List<Map<String, Object>>) dao.executeQuery(arriveordersql, new MapListProcessor());
|
||||||
for (Map<String, Object> arriveorder : arriveorders) {
|
// 20251216 备料重算优化 如果有到货单则不更新最终需求数量
|
||||||
// 更新到货单
|
int innum=arriveorders.size();
|
||||||
String updatearriveorderSql = "update po_arriveorder_b set vbdef33='" + map.get("nplanoutnum") + "' where pk_arriveorder_b='"
|
if ("C030".equals(orgCode) && innum ==0) {
|
||||||
+ arriveorder.get("pk_arriveorder_b") + "'";
|
// 更新请购单
|
||||||
dao.executeUpdate(updatearriveorderSql);
|
String sql = "update po_praybill_b set vbdef33='" + map.get("nplanoutnum") + "' where pk_praybill_b='"
|
||||||
// 已经采购入库的数据不处理
|
+ map2.get("pk_praybill_b") + "'";
|
||||||
|
int num = dao.executeUpdate(sql);
|
||||||
|
// 更新采购订单
|
||||||
|
String updateOrderSql = "update po_order_b set vbdef33='" + map.get("nplanoutnum") + "' where pk_order_b='"
|
||||||
|
+ order.get("pk_order_b") + "'";
|
||||||
|
dao.executeUpdate(updateOrderSql);
|
||||||
|
SyncSrmPrayBillUtil billUtil = new SyncSrmPrayBillUtil();
|
||||||
|
JSONObject reqData = new JSONObject();
|
||||||
|
reqData.put("org", "C030");// 组织编码
|
||||||
|
reqData.put("erpId", map2.get("pk_praybill_b"));// 请购单表体主键
|
||||||
|
reqData.put("mainNum", map.get("nplanoutnum"));// 主数量
|
||||||
|
billUtil.reqBIPBill(reqData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue