|
|
@@ -181,6 +181,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
Map<Object, Object> map1 = FlexJsonUtil.fromJson(dsl);
|
|
|
String pr_code = null;
|
|
|
SqlRowList rs1 = null;
|
|
|
+ String psl_prodcode = null;
|
|
|
double bar_remain =0;
|
|
|
//传的字段 DL_ID,DL_DECODE,DL_LINECODE,DL_MACODE,DL_TABLE,DL_STATUSCODE,DL_STATUS,PS_ID,MA_ID
|
|
|
SqlRowList rs = null;
|
|
|
@@ -206,6 +207,14 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}else{
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"当前线别"+linecode+"没有绑定工单",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
}
|
|
|
+
|
|
|
+ rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+ +" where psl_psid=? and psl_location=? and psl_table=? ",map.get("PS_ID"),location, map.get("DL_TABLE"));
|
|
|
+ if (rs.next())
|
|
|
+ {
|
|
|
+ psl_prodcode = rs.getString("psl_prodcode");
|
|
|
+ }
|
|
|
+
|
|
|
rs = baseDao.queryForRowSet("select dsl_id,dsl_barcode,dsl_prodcode from devSMTLocation where dsl_linecode=? and dsl_makecode=? and dsl_location=? and dsl_status=0 and dsl_table=?",linecode,dl_macode,location,map.get("DL_TABLE"));
|
|
|
if(rs.next()){
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"该站位已上料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
@@ -238,7 +247,13 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
rs1 = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+" where psl_psid=? and psl_location=? and psl_table=? and (psl_prodcode=? or psl_repcode=?)",map.get("PS_ID"),location,map.get("DL_TABLE"),rs.getString("bar_prodcode"),rs.getString("bar_prodcode"));
|
|
|
if(!rs1.next()){
|
|
|
- showSmtError(APIErrorCode.DATA_NOT_FOUND,"料卷对应的物料["+rs.getString("bar_prodcode")+"]不是该站位需要上料的物料",handleType,linecode,location,ps_prodcode,"料卷"+bar_code,bool,table);
|
|
|
+ rs1 = baseDao.queryForRowSet("select bo_mothercode,bd_soncode,pre_repcode from wp_replace_view@WP where bo_mothercode = ? and bd_soncode = ? and pre_repcode = ?",ps_prodcode,psl_prodcode,rs.getString("bar_prodcode"));
|
|
|
+ if(!rs1.next()){
|
|
|
+ rs1 = baseDao.queryForRowSet("select bd_mothercode,bd_soncode,prr_reprodcode from PRODUCTRELATION left join bomdetail on bd_id = prr_bdid where bd_mothercode = ? and bd_soncode = ? and prr_reprodcode = ?",ps_prodcode,psl_prodcode,rs.getString("bar_prodcode"));
|
|
|
+ if(!rs1.next()) {
|
|
|
+ showSmtError(APIErrorCode.DATA_NOT_FOUND, "料卷对应的物料[" + rs.getString("bar_prodcode") + "]不是该站位需要上料的物料", handleType, linecode, location, ps_prodcode, "料卷" + bar_code, bool, table);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if(rs.getDouble("bar_remain") <= 0){
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"料卷号数量必须大于0",handleType,linecode,location,ps_prodcode,"料卷"+bar_code,bool,table);
|
|
|
@@ -584,6 +599,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
SqlRowList rs = null;
|
|
|
SqlRowList rs1 = null;
|
|
|
SqlRowList rs2 = null;
|
|
|
+ String psl_prodcode = null;
|
|
|
Map<Object, Object> map = FlexJsonUtil.fromJson(deviceLineMake);
|
|
|
Map<Object, Object> map1 = FlexJsonUtil.fromJson(dsl);
|
|
|
Object ma_code = map.get("DL_MACODE"),linecode=map.get("DL_LINECODE"),location=map1.get("dsl_location"),table = map.get("DL_TABLE");
|
|
|
@@ -615,6 +631,12 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}else{
|
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"站位未上料无需接料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
}
|
|
|
+ rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+ +" where psl_psid=? and psl_location=? and psl_table=? ",map.get("PS_ID"),location, map.get("DL_TABLE"));
|
|
|
+ if (rs.next())
|
|
|
+ {
|
|
|
+ psl_prodcode = rs.getString("psl_prodcode");
|
|
|
+ }
|
|
|
String type="barcode";
|
|
|
rs = baseDao.queryForRowSet("select dsl_barcode,dsl_repcode from devSMTLocation where dsl_linecode=? and dsl_makecode=? and dsl_location=? and dsl_table =? and dsl_status=0 and dsl_barcode=?",linecode,ma_code,location,map.get("DL_TABLE"),bar_code);
|
|
|
if(rs.next()){
|
|
|
@@ -627,7 +649,13 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+" where psl_psid=? and psl_location=? and psl_table=? and (psl_prodcode=? or psl_repcode=?)",map.get("PS_ID"),location,map.get("DL_TABLE"),rs1.getString("bar_prodcode"),rs1.getString("bar_prodcode"));
|
|
|
if(!rs.next()){
|
|
|
- showSmtError(APIErrorCode.DATA_NOT_FOUND,"条码对应的物料["+rs1.getString("bar_prodcode")+"]不是该站位需要使用的物料",handleType,linecode,location,ps_prodcode,"料卷"+bar_code,bool,table);
|
|
|
+ rs = baseDao.queryForRowSet("select bo_mothercode,bd_soncode,pre_repcode from wp_replace_view@WP where bo_mothercode = ? and bd_soncode = ? and pre_repcode = ?",ps_prodcode,psl_prodcode,rs1.getString("bar_prodcode"));
|
|
|
+ if(!rs.next()){
|
|
|
+ rs = baseDao.queryForRowSet("select bd_mothercode,bd_soncode,prr_reprodcode from PRODUCTRELATION left join bomdetail on bd_id = prr_bdid where bd_mothercode = ? and bd_soncode = ? and prr_reprodcode = ?",ps_prodcode,psl_prodcode,rs1.getString("bar_prodcode"));
|
|
|
+ if(!rs.next()) {
|
|
|
+ showSmtError(APIErrorCode.DATA_NOT_FOUND, "料卷对应的物料[" + rs1.getString("bar_prodcode") + "]不是该站位需要上料的物料", handleType, linecode, location, ps_prodcode, "料卷" + bar_code, bool, table);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
pr_code = rs1.getString("bar_prodcode");
|
|
|
bar_remain = rs1.getDouble("bar_remain");
|
|
|
@@ -736,6 +764,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
SqlRowList rs2 = null;
|
|
|
SqlRowList rs0 = null;
|
|
|
String pr_code = null;
|
|
|
+ String psl_prodcode = null;
|
|
|
String type = "barcode",ps_prodcode = null,handleType = "换料";
|
|
|
double remain = 0;
|
|
|
double bar_remain = 0;
|
|
|
@@ -760,13 +789,25 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
if(!rs.next()){
|
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"站位未上料无需换料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
}
|
|
|
+ rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+ +" where psl_psid=? and psl_location=? and psl_table=? ",map.get("PS_ID"),location, map.get("DL_TABLE"));
|
|
|
+ if (rs.next())
|
|
|
+ {
|
|
|
+ psl_prodcode = rs.getString("psl_prodcode");
|
|
|
+ }
|
|
|
|
|
|
rs2 = baseDao.queryForRowSet("select bar_remain,bar_place,bar_prodcode,bar_code from barcode where bar_code=?",bar_code);
|
|
|
if(rs2.next()){
|
|
|
rs = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
|
+" where psl_psid=? and psl_location=? and psl_table=? and (psl_prodcode=? or psl_repcode=?)",map.get("PS_ID"),location,map.get("DL_TABLE"),rs2.getString("bar_prodcode"),rs2.getString("bar_prodcode"));
|
|
|
if(!rs.next()){
|
|
|
- showSmtError(APIErrorCode.DATA_NOT_FOUND,"条码对应的物料["+rs2.getString("bar_prodcode")+"]不是该站位需要使用的物料",handleType,linecode,location,ps_prodcode,"料卷"+bar_code,bool,table);
|
|
|
+ rs = baseDao.queryForRowSet("select bo_mothercode,bd_soncode,pre_repcode from wp_replace_view@WP where bo_mothercode = ? and bd_soncode = ? and pre_repcode = ?",ps_prodcode,psl_prodcode,rs2.getString("bar_prodcode"));
|
|
|
+ if(!rs.next()){
|
|
|
+ rs = baseDao.queryForRowSet("select bd_mothercode,bd_soncode,prr_reprodcode from PRODUCTRELATION left join bomdetail on bd_id = prr_bdid where bd_mothercode = ? and bd_soncode = ? and prr_reprodcode = ?",ps_prodcode,psl_prodcode,rs2.getString("bar_prodcode"));
|
|
|
+ if(!rs.next()) {
|
|
|
+ showSmtError(APIErrorCode.DATA_NOT_FOUND, "料卷对应的物料[" + rs2.getString("bar_prodcode") + "]不是该站位需要上料的物料", handleType, linecode, location, ps_prodcode, "料卷" + bar_code, bool, table);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
pr_code = rs2.getString("bar_prodcode");
|
|
|
bar_remain = rs2.getDouble("bar_remain");
|
|
|
@@ -1146,16 +1187,16 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_SMTFORCE,"站位["+unloadLocation+"]没有上料料卷不允许启动");
|
|
|
}
|
|
|
}
|
|
|
- rs0 = baseDao.queryForRowSet("select wm_concat(distinct dsl_location) dsl_location,count(1) cn from devsmtlocation where dsl_linecode=? and dsl_makecode=? and dsl_table=?"
|
|
|
- +" and dsl_status=0 and (dsl_prodcode,dsl_location) not in (select psl_repcode,psl_location from productsmt left join productsmtlocation on ps_id=psl_psid"
|
|
|
- +" where ps_linecode=? and ps_prodcode=? and psl_table=?)",map.get("DL_LINECODE"),ma_prodcode,map.get("DL_TABLE"),map.get("DL_LINECODE"),
|
|
|
- map.get("DL_MACODE"),map.get("DL_TABLE"));
|
|
|
- if(rs0.next() && rs0.getInt("cn") > 0){
|
|
|
- errorLocation = rs0.getString("dsl_location");
|
|
|
- if(!("强制启动").equals(op)){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_SMTFORCE,"站位["+errorLocation+"]上料料卷不正确不允许启动");
|
|
|
- }
|
|
|
- }
|
|
|
+// rs0 = baseDao.queryForRowSet("select wm_concat(distinct dsl_location) dsl_location,count(1) cn from devsmtlocation where dsl_linecode=? and dsl_makecode=? and dsl_table=?"
|
|
|
+// +" and dsl_status=0 and (dsl_prodcode,dsl_location) not in (select psl_repcode,psl_location from productsmt left join productsmtlocation on ps_id=psl_psid"
|
|
|
+// +" where ps_linecode=? and ps_prodcode=? and psl_table=?)",map.get("DL_LINECODE"),ma_prodcode,map.get("DL_TABLE"),map.get("DL_LINECODE"),
|
|
|
+// map.get("DL_MACODE"),map.get("DL_TABLE"));
|
|
|
+// if(rs0.next() && rs0.getInt("cn") > 0){
|
|
|
+// errorLocation = rs0.getString("dsl_location");
|
|
|
+// if(!("强制启动").equals(op)){
|
|
|
+// throw new APIErrorException(APIErrorCode.BUSINESS_SMTFORCE,"站位["+errorLocation+"]上料料卷不正确不允许启动");
|
|
|
+// }
|
|
|
+// }
|
|
|
rs1=baseDao.queryForRowSet("select ps_id from productsmt left join productsmtlocation on psl_psid=ps_id where ps_linecode=? and ps_prodcode=? and ps_statuscode='AUDITED' and psl_table=?",map.get("DL_LINECODE"),ma_prodcode,map.get("DL_TABLE"));
|
|
|
if(rs1.next()){
|
|
|
baseDao.execute("update devsmtlocation set dsl_validtime=sysdate where dsl_linecode=? and dsl_makecode=? and dsl_table=? and dsl_status=0 and dsl_usable=1 and dsl_validtime is null",map.get("DL_LINECODE"),map.get("DL_MACODE"),map.get("DL_TABLE"));
|