|
|
@@ -534,10 +534,10 @@ public class MESServiceImpl implements MESService {
|
|
|
}
|
|
|
int count1 = baseDao.getCount("select count(1) from MakeMaterial where mm_prodcode='" + itemNo + "' and mm_id in (" + lineId + ")");
|
|
|
if (count1>0) {
|
|
|
- SqlRowList sqlRowList = baseDao.queryForRowSet("select round((mm_qty-nvl(mm_canuserepqty,0)-(nvl" +
|
|
|
+ SqlRowList sqlRowList = baseDao.queryForRowSet("select sum(round((mm_qty-nvl(mm_canuserepqty,0)-(nvl" +
|
|
|
"(mm_havegetqty,0)-nvl(mm_haverepqty,0)+(nvl(mm_returnmqty,0)-nvl(mm_repreturnmqty,0))-(nvl" +
|
|
|
"(mm_addqty,0)-NVL(mm_repaddqty,0)))-nvl(mm_totaluseqty,0)+NVL(mm_repqty,0))-NVL(mm_stepinqty,0)" +
|
|
|
- ",7) mmqty from MakeMaterial where mm_prodcode='" + itemNo + "' and mm_id in (" + lineId + ")");
|
|
|
+ ",7)) mmqty from MakeMaterial where mm_prodcode='" + itemNo + "' and mm_id in (" + lineId + ")");
|
|
|
if (sqlRowList.next()) {
|
|
|
Double mmqty = sqlRowList.getGeneralDouble("mmqty");
|
|
|
qty = qty.compareTo(mmqty) > 0 ? mmqty : qty;
|
|
|
@@ -545,7 +545,9 @@ public class MESServiceImpl implements MESService {
|
|
|
}else {
|
|
|
int count3 = baseDao.getCount("select count(1) from MakeMaterialreplace where mp_prodcode='" + itemNo + "' and mp_mmid in (" + lineId + ")");
|
|
|
if (count3>0){
|
|
|
- SqlRowList sqlRowList1 = baseDao.queryForRowSet("select nvl(mp_canuseqty,0)-(nvl(mp_haverepqty,0)-NVL(mp_addqty,0)+NVL(mp_returnmqty,0))-nvl(mp_repqty,0) mpqty from MakeMaterialreplace where mp_prodcode='" + itemNo + "' and mp_mmid in (" + lineId + ")");
|
|
|
+ SqlRowList sqlRowList1 = baseDao.queryForRowSet("select sum(nvl(mp_canuseqty,0)-(nvl" +
|
|
|
+ "(mp_haverepqty,0)-NVL(mp_addqty,0)+NVL(mp_returnmqty,0))-nvl(mp_repqty,0)) mpqty from " +
|
|
|
+ "MakeMaterialreplace where mp_prodcode='" + itemNo + "' and mp_mmid in (" + lineId + ")");
|
|
|
if (sqlRowList1.next()){
|
|
|
Double mpqty = sqlRowList1.getGeneralDouble("mpqty");
|
|
|
qty = qty.compareTo(mpqty) > 0 ? mpqty : qty;
|