---
# System prepended metadata

title: E34

---

# E34

工程備料預計表維護頁面：

https://10.100.50.20:9080/mr/mr50002_man.jsp?s_FNOH_FCODE=FW&FNOH_EDATE=&FNOH_ANO=0C&s_FNOH_FSEQE=60&s_FNOH_FSEQS=60&FNOH_FCODE=FW&FNOH_FYY=110&s_FNOH_FDATEE=&s_FNOH_EDATEE=&FNOH_FDATE=1101201&UNITID=0C&s_FNOH_EDATES=&s_FNOH_WNOS=&FNOH_FSEQ=60&s_FNOH_WNOE=&s_FNOH_SNO=&s_FNOH_ANOE=&s_FNOH_FDATES=&s_FNOH_FYY=110&s_FNOH_ANOS=


分配清單畫面：

https://10.100.50.20:9080/mr/mr40501_lis.jsp?s_ALOTT_WNO=&s_ALOTT_NO3=60&s_ALOTT_NO2=110&ListBox1=&s_ALOTT_NO1=FW&s_ALOTT_FLAG=1&s_ALOTT_CIDEPT=0C

追加 sql:
[MAST_FNOB 文件](https://docs.google.com/document/u/1/d/1fmReb8IRCYivUFt4Dzk6gxf9QeNztllV/edit?usp=drive_web&ouid=103629154485329904225&rtpof=true)
```sql
-- 追加數量為 FNOB_ADDQTY，追減為 FNOB_SUBQTY
SELECT A.* FROM MAST_FNOB A
WHERE 1=1
    AND A.FNOB_FCODE='FW'
    AND A.FNOB_FYY='110'
    AND A.FNOB_FSEQ='60'
    AND A.FNOB_MNO IN ('A46012250017','A46012400017')
    ;
```

分配sql
```sql
-- 數量為 ALOTT_QTY
SELECT A.* FROM MAST_ALOTT A
WHERE 1=1
AND ALOTT_CIDEPT='0C'
AND ALOTT_NO1='FW'
AND ALOTT_NO2='110'
AND ALOTT_NO3='60'
AND ALOTT_MNO IN  ('A46012250017','A46012400017')
;
```

理論上核定追加數量時，應該會改變 ALOTT_QTY
mr50002_manHandlers.jsp 1143-1151
```java
ld_qty = ld_fnob_fqty + ld_fnob_addqty - ld_fnob_subqty;

//抓session使用者代碼
String ls_userid = SessionStorage.getInstance(e.getPage().getRequest()).getAttributeAsString("UserID");

//調撥數有異動update mast_alott table
DBTools.executeUpdate("UPDATE mast_alott SET alott_qty=" + Utils.convertToString(ld_qty) + ",alott_upuser='" + ls_userid + "' WHERE alott_ano = '" + ls_fnob_ano.substring(0,2) + "'  AND  alott_cidept = '" + ls_fnob_ano + "'  AND  alott_no1 = '" + ls_fnob_fcode + "' AND alott_no2=" + ls_fnob_fyy + " AND alott_no3=" + ls_fnob_fseq + " AND alott_seq=" + ls_fnob_seq + " AND alott_mno='" + ls_fnob_mno + "'", "SynctConn");
```

最快的是補執行該段語法，後續再釐清可能的原因
```sql
UPDATE mast_alott 
SET alott_qty='236'
WHERE alott_ano = '0C'  AND  alott_cidept = '0C'  
AND  alott_no1 = 'FW' AND alott_no2='110' AND alott_no3='60' 
AND alott_seq='2' AND alott_mno='A46012250017';

UPDATE mast_alott 
SET alott_qty='260'
WHERE alott_ano = '0C'  AND  alott_cidept = '0C'  
AND  alott_no1 = 'FW' AND alott_no2='110' AND alott_no3='60' 
AND alott_seq='3' AND alott_mno='A46012400017';
```

可能的原因為：可能使用者輸入的字串解析為數字失敗，造成備料預計表(MAST_FNOB)更新追加追減的時候，追加追減沒有反映到 MAST_ALOTT 的可分配數量，此為資料面錯。
而後續再更新備料預計表(MAST_FNOB)的時候因為追加追減數字沒有變動，就不會再執行該段語法
目前該框架沒有有效的方式防止使用者輸入錯誤的數字，
建議後續遇到處理方法可再次變動該材料的追加追減數目，例如：變動追加為39=>修改追加為40，可重複觸發次處語法執行

![](https://i.imgur.com/ISOGIQb.png)
