|
|
@@ -337,10 +337,10 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
mapR.put("DSL_REMAINQTY", bar_remain);
|
|
|
mapR.put("DSL_FESPEC", rs.getString("psl_feeder"));
|
|
|
|
|
|
- rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,psl_location from productsmtlocation "
|
|
|
+ rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,psl_location||'|'||PSL_PRODCODE psl_location from productsmtlocation "
|
|
|
+" where psl_psid=? and psl_table=? and psl_location not in (select distinct dsl_location from devsmtlocation where "
|
|
|
+" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0) "
|
|
|
- +" group by psl_location order by psl_detno)) where rownum<=20 ",map.get("PS_ID"),map.get("DL_TABLE"),linecode,dl_macode,map.get("DL_TABLE"));
|
|
|
+ +" group by psl_location||'|'||PSL_PRODCODE order by psl_detno)) where rownum<=20 ",map.get("PS_ID"),map.get("DL_TABLE"),linecode,dl_macode,map.get("DL_TABLE"));
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotFeedLocation", rs.getResultList());
|
|
|
}else{
|
|
|
@@ -466,25 +466,25 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
dl_smtid = rs.getInt("dl_smtid");
|
|
|
dl_hasmake = rs.getInt("dl_hasmake");
|
|
|
dl_prodcode = rs.getString("dl_prodcode");
|
|
|
- if(dl_madeqty < madeqty ){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于产出数");
|
|
|
- }else{
|
|
|
- if(rs.getInt("dl_hasmake")==-1){
|
|
|
- //是否允许超工单数
|
|
|
- if(rs.getGeneralInt("ma_unlimitin")==0 && dl_madeqty>rs.getInt("ma_qty")){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不允许超工单数["+rs.getInt("ma_qty")+"]");
|
|
|
- }
|
|
|
- if(("A").equals(dl_table)){
|
|
|
- if(dl_madeqty < rs.getInt("ma_smtaqty")){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于A面已完成贴片数["+rs.getInt("ma_smtaqty")+"]");
|
|
|
- }
|
|
|
- }else{
|
|
|
- if (dl_madeqty < rs.getInt("ma_smtbqty")){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于B面已完成贴片数["+rs.getInt("ma_smtbqty")+"]");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// if(dl_madeqty < madeqty ){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于产出数");
|
|
|
+// }else{
|
|
|
+// if(rs.getInt("dl_hasmake")==-1){
|
|
|
+// //是否允许超工单数
|
|
|
+// if(rs.getGeneralInt("ma_unlimitin")==0 && dl_madeqty>rs.getInt("ma_qty")){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不允许超工单数["+rs.getInt("ma_qty")+"]");
|
|
|
+// }
|
|
|
+// if(("A").equals(dl_table)){
|
|
|
+// if(dl_madeqty < rs.getInt("ma_smtaqty")){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于A面已完成贴片数["+rs.getInt("ma_smtaqty")+"]");
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// if (dl_madeqty < rs.getInt("ma_smtbqty")){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"数量不能小于B面已完成贴片数["+rs.getInt("ma_smtbqty")+"]");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
}else{
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"当前线别+板面无在线工单,无需全部下料!");
|
|
|
}
|
|
|
@@ -515,7 +515,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
dsl_remainqty = rs.getDouble("dsl_remainqty");
|
|
|
dsl_location = rs.getString("dsl_location");
|
|
|
remainAddQty = rs.getDouble("remainAddQty");
|
|
|
- dsl_remainqty -= remainAddQty;
|
|
|
+ //dsl_remainqty -= remainAddQty;
|
|
|
if(rs.getInt("cn")==1){//只有一条记录
|
|
|
//只有一条记录直接扣料
|
|
|
sqls.add("update devsmtlocation set dsl_remainqty="+dsl_remainqty+" where dsl_id="+rs.getInt("dsl_id"));
|
|
|
@@ -534,16 +534,16 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
while (rsM.next()){
|
|
|
double qty = rsM.getDouble("dsl_remainqty");
|
|
|
index = rsM.getCurrentIndex()+1;
|
|
|
- if(remainAddQty >0){
|
|
|
- //循环如果是最后一个也就直接减掉 index == rssize
|
|
|
- if(remainAddQty < qty || remainAddQty == qty || index == rssize){
|
|
|
- sqls.add("update devsmtlocation set dsl_remainqty=dsl_remainqty-"+remainAddQty+" where dsl_id="+rsM.getInt("dsl_id"));
|
|
|
- remainAddQty = 0;
|
|
|
- }else{
|
|
|
- sqls.add("update devsmtlocation set dsl_remainqty=0 where dsl_id="+rsM.getInt("dsl_id"));
|
|
|
- remainAddQty -=qty;
|
|
|
- }
|
|
|
- }
|
|
|
+// if(remainAddQty >0){
|
|
|
+// //循环如果是最后一个也就直接减掉 index == rssize
|
|
|
+// if(remainAddQty < qty || remainAddQty == qty || index == rssize){
|
|
|
+// sqls.add("update devsmtlocation set dsl_remainqty=dsl_remainqty-"+remainAddQty+" where dsl_id="+rsM.getInt("dsl_id"));
|
|
|
+// remainAddQty = 0;
|
|
|
+// }else{
|
|
|
+// sqls.add("update devsmtlocation set dsl_remainqty=0 where dsl_id="+rsM.getInt("dsl_id"));
|
|
|
+// remainAddQty -=qty;
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -554,9 +554,9 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
sqls.add("update feeder set fe_location='' where fe_location='"+dsl_location+"'");
|
|
|
}
|
|
|
//接料原料卷数量更新成0,接料实际操作是将原料卷剩余料拼到新料卷中
|
|
|
- sqls.add("update barcode set bar_place=1,bar_forcastremain=0,bar_remain=0 where bar_code in (select dsl_barcode from devsmtlocation where dsl_linecode='"+dl_linecode+"' and dsl_makecode='"+dl_macode+"' and dsl_status=0 and dsl_location='"+rs.getString("dsl_location")+"' and dsl_id<>"+rs.getInt("dsl_id")+") and bar_place='"+dl_macode+"'");
|
|
|
+ sqls.add("update barcode set bar_place=1 where bar_code in (select dsl_barcode from devsmtlocation where dsl_linecode='"+dl_linecode+"' and dsl_makecode='"+dl_macode+"' and dsl_status=0 and dsl_location='"+rs.getString("dsl_location")+"' and dsl_id<>"+rs.getInt("dsl_id")+") and bar_place='"+dl_macode+"'");
|
|
|
//多条记录接料料卷
|
|
|
- sqls.add("update barcode set bar_place=1,bar_forcastremain="+dsl_remainqty+",bar_remain="+dsl_remainqty+" where bar_code=(select dsl_barcode from devsmtlocation where dsl_id="+rs.getInt("dsl_id")+") and bar_place='"+dl_macode+"'");
|
|
|
+ sqls.add("update barcode set bar_place=1 where bar_code=(select dsl_barcode from devsmtlocation where dsl_id="+rs.getInt("dsl_id")+") and bar_place='"+dl_macode+"'");
|
|
|
}
|
|
|
}
|
|
|
//更新工单的SMT贴片数
|
|
|
@@ -783,7 +783,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
Object bar_code = map1.get("dsl_barcode"),ma_code = map.get("DL_MACODE"),table = map.get("DL_TABLE");
|
|
|
Object dsl_fecode= map1.get("dsl_fecode");
|
|
|
Object location = map1.get("dsl_location"),linecode= map.get("DL_LINECODE");
|
|
|
-
|
|
|
+ showSmtError(APIErrorCode.BUSINESS_FAILED,"换料功能取消",handleType,linecode,"",ps_prodcode,"",bool,table);
|
|
|
rs=baseDao.queryForRowSet("select dl_macode,dl_statuscode,dl_hasmake,dl_prodcode from deviceline where dl_linecode=?",linecode);
|
|
|
if(rs.next()){
|
|
|
has_make=rs.getInt("dl_hasmake");
|
|
|
@@ -1558,10 +1558,10 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
ps_prodcode = rs.getString("dl_prodcode");
|
|
|
}
|
|
|
//未上料站位前二十条
|
|
|
- rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,psl_location from productsmtlocation left join productsmt on ps_id = psl_psid"
|
|
|
+ rs=baseDao.queryForRowSet("select * from (select psl_location from(select min(psl_detno)psl_detno,psl_location||'|'||PSL_PRODCODE psl_location from productsmtlocation left join productsmt on ps_id = psl_psid"
|
|
|
+" where ps_linecode=? and ps_prodcode = ? and psl_table=? and psl_location not in (select distinct dsl_location from devsmtlocation where "
|
|
|
+" dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0) "
|
|
|
- +" group by psl_location order by psl_detno asc)) where rownum<=20 ",linecode,ps_prodcode,table,linecode,macode,table);
|
|
|
+ +" group by psl_location||'|'||PSL_PRODCODE order by psl_detno asc)) where rownum<=20 ",linecode,ps_prodcode,table,linecode,macode,table);
|
|
|
if(rs.next()){
|
|
|
mapR.put("NotFeedLocation", rs.getResultList());
|
|
|
}else{
|