根据 生产订单-备料计划-计划订单-请购单-采购订单-到货单-采购入库 依次更新下游单据

This commit is contained in:
lihao 2025-10-17 11:06:58 +08:00
parent 80cea4f91e
commit d2ff8dfb85
1 changed files with 21 additions and 8 deletions

View File

@ -30,18 +30,31 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule<PMOAggVO> {
// ²éѯ±¸Áϼƻ®
String pickmsql = "select cpickm_bid,nplanoutnum from mm_pickm_b where cpickmid in ( select cpickmid from mm_pickm where csourcebillrowid='" + pmoid + "' and dr=0) and dr = 0";
List<Map<String,Object>> hmateral = (List<Map<String,Object>>) dao.executeQuery(pickmsql, new MapListProcessor());
// 몽앴 <EFBFBD>끓땐데-구죕셕뺍-셕뺍땐데-헝뭔데-꽃뭔땐데-돕새데-꽃뭔흙욋 弩늴뫘劤苟踏데앴
for (Map<String,Object> map : hmateral) {
String buyingreqsql = "select pk_praybill_b,nnum from po_praybill_b where csourcebid ='" + map.get("cpickm_bid") + "' and dr = 0";
List<Map<String,Object>> buyingreq = (List<Map<String,Object>>) dao.executeQuery(buyingreqsql, new MapListProcessor());
for (Map<String,Object> map2 : buyingreq) {
if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal)map.get("nplanoutnum"))) >0) {
String sql = "update po_praybill_b set vbdef15='" +map.get("nplanoutnum") + "' where pk_praybill_b='"
+map2.get("pk_praybill_b") + "'";
dao.executeUpdate(sql);
// 꿴璂셕뺍땐데
String plosql = "select cpoid from mm_plo where vsrcbid ='" + map.get("cpickm_bid") + "' and dr = 0";
List<Map<String,Object>> ploList = (List<Map<String,Object>>) dao.executeQuery(plosql, new MapListProcessor());
for (Map<String,Object> plo : ploList) {
// 꿴璂헝뭔데
String buyingreqsql = "select pk_praybill_b,nnum from po_praybill_b where csourcebid ='" + plo.get("cpoid") + "' and dr = 0";
List<Map<String,Object>> buyingreq = (List<Map<String,Object>>) dao.executeQuery(buyingreqsql, new MapListProcessor());
for (Map<String,Object> map2 : buyingreq) {
if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal)map.get("nplanoutnum"))) >0) {
// 뫘劤헝뭔데
String sql = "update po_praybill_b set vbdef15='" +map.get("nplanoutnum") + "' where pk_praybill_b='"
+map2.get("pk_praybill_b") + "'";
dao.executeUpdate(sql);
}
}
}
}
} catch (DAOException e) {
throw new RuntimeException(e);