|
@@ -189,6 +189,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
Object dl_macode = map.get("DL_MACODE");
|
|
Object dl_macode = map.get("DL_MACODE");
|
|
|
Object linecode= map.get("DL_LINECODE"),location = map1.get("dsl_location");
|
|
Object linecode= map.get("DL_LINECODE"),location = map1.get("dsl_location");
|
|
|
Object table = map.get("DL_TABLE");
|
|
Object table = map.get("DL_TABLE");
|
|
|
|
|
+ Object fe_code = map1.get("dsl_fecode");
|
|
|
String type="barcode",ps_prodcode = null;
|
|
String type="barcode",ps_prodcode = null;
|
|
|
int has_make=0;
|
|
int has_make=0;
|
|
|
String handleType = "上料";
|
|
String handleType = "上料";
|
|
@@ -209,7 +210,23 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
if(rs.next()){
|
|
if(rs.next()){
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"该站位已上料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"该站位已上料",handleType,linecode,location,ps_prodcode,"",bool,table);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ rs=baseDao.queryForRowSet("select fe_code,fe_location,fe_barcode from feeder where fe_code='"+fe_code+"'");
|
|
|
|
|
+ //验证飞达是否存在
|
|
|
|
|
+ if(rs.next()){
|
|
|
|
|
+ String fe_location=rs.getString("fe_location");
|
|
|
|
|
+ String fe_barcode=rs.getString("fe_barcode");
|
|
|
|
|
+ bar_code=rs.getString("fe_barcode");
|
|
|
|
|
+ //飞达未绑定其他站位的时候
|
|
|
|
|
+ if(fe_barcode == null || ("").equals(fe_barcode)){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "飞达未绑定料盘");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!(fe_location == null || ("").equals(fe_location))){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "飞达已绑定站位"+fe_location);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "飞达"+fe_code+"不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
rs = baseDao.queryForRowSet("select bar_remain,nvl(bar_place,1)bar_place,bar_prodcode,bar_code from barcode where bar_code=? ",bar_code);
|
|
rs = baseDao.queryForRowSet("select bar_remain,nvl(bar_place,1)bar_place,bar_prodcode,bar_code from barcode where bar_code=? ",bar_code);
|
|
|
if(rs.next()){
|
|
if(rs.next()){
|
|
|
rs1 = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
rs1 = baseDao.queryForRowSet("select psl_baseqty,psl_prodcode,psl_repcode,psl_feeder,psl_id from productsmtlocation "
|
|
@@ -236,15 +253,11 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
if(bar_code.toString().contains(rs.getString("psl_prodcode"))){
|
|
if(bar_code.toString().contains(rs.getString("psl_prodcode"))){
|
|
|
pr_code = rs.getString("psl_prodcode");
|
|
pr_code = rs.getString("psl_prodcode");
|
|
|
}else{
|
|
}else{
|
|
|
- try {
|
|
|
|
|
- String [] stringArr= rs.getString("repcode").split(",");
|
|
|
|
|
- for (String s : stringArr) {
|
|
|
|
|
- if (bar_code.toString().contains(s)) {
|
|
|
|
|
- pr_code = s;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String [] stringArr= rs.getString("repcode").split(",");
|
|
|
|
|
+ for (String s : stringArr) {
|
|
|
|
|
+ if (bar_code.toString().contains(s)) {
|
|
|
|
|
+ pr_code = s;
|
|
|
}
|
|
}
|
|
|
- }catch (Exception ex){
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"物料["+bar_code+"]不是该站位需要上料的物料",handleType,linecode,location,ps_prodcode,"料号"+bar_code,bool,table);
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"物料["+bar_code+"]不是该站位需要上料的物料",handleType,linecode,location,ps_prodcode,"料号"+bar_code,bool,table);
|
|
@@ -259,6 +272,8 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //更新飞达所在站位
|
|
|
|
|
+ baseDao.updateByCondition("feeder","fe_location='"+location+"'","fe_code='"+fe_code+"'");
|
|
|
double ma_qty=0;
|
|
double ma_qty=0;
|
|
|
rs = baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
rs = baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
|
if(rs.next()){
|
|
if(rs.next()){
|
|
@@ -269,7 +284,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 校验是否湿敏条码
|
|
* 校验是否湿敏条码
|
|
|
* */
|
|
* */
|
|
|
- //checkMsdBarCode(bar_code);
|
|
|
|
|
|
|
+ checkMsdBarCode(bar_code);
|
|
|
//上料
|
|
//上料
|
|
|
rs = baseDao.queryForRowSet("select wm_concat(psl_repcode) repcode ,max(psl_prodcode)psl_prodcode,count(1) cn ,max(psl_feeder) psl_feeder, max(psl_baseqty) psl_baseqty from productsmtlocation "
|
|
rs = baseDao.queryForRowSet("select wm_concat(psl_repcode) repcode ,max(psl_prodcode)psl_prodcode,count(1) cn ,max(psl_feeder) psl_feeder, max(psl_baseqty) psl_baseqty from productsmtlocation "
|
|
|
+ " where psl_psid=? and psl_location=? and psl_table=?",map.get("PS_ID"),location,map.get("DL_TABLE"));
|
|
+ " where psl_psid=? and psl_location=? and psl_table=?",map.get("PS_ID"),location,map.get("DL_TABLE"));
|
|
@@ -286,9 +301,9 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
|
* */
|
|
* */
|
|
|
-// if(checkMsdBarCode(bar_code)){
|
|
|
|
|
-// updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if(checkMsdBarCode(bar_code)){
|
|
|
|
|
+ updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
+ }
|
|
|
//记录日志上料
|
|
//记录日志上料
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"上料","上料成功,"+(has_make == -1 ? "工单":"产品")+":"+dl_macode+","+(("product").equals(type)?"物料编号":"料卷号")+":"+bar_code,linecode,location,0,ps_prodcode,("product").equals(type)?"物料"+pr_code:"料卷"+bar_code,map.get("DL_TABLE"),has_make == -1?dl_macode:"");
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"上料","上料成功,"+(has_make == -1 ? "工单":"产品")+":"+dl_macode+","+(("product").equals(type)?"物料编号":"料卷号")+":"+bar_code,linecode,location,0,ps_prodcode,("product").equals(type)?"物料"+pr_code:"料卷"+bar_code,map.get("DL_TABLE"),has_make == -1?dl_macode:"");
|
|
|
Map<String,Object> mapR = new HashMap<String,Object>();
|
|
Map<String,Object> mapR = new HashMap<String,Object>();
|
|
@@ -326,7 +341,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* 确认下料
|
|
* 确认下料
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<Map<String, Object>> cuttingStock(String code ,String deviceLineMake) {
|
|
|
|
|
|
|
+ public List<Map<String, Object>> cuttingStock(String code ,String deviceLineMake,Integer Untying) {
|
|
|
Map<Object, Object> map = FlexJsonUtil.fromJson(deviceLineMake);
|
|
Map<Object, Object> map = FlexJsonUtil.fromJson(deviceLineMake);
|
|
|
SqlRowList rs = null;
|
|
SqlRowList rs = null;
|
|
|
SqlRowList rsReturn = null;
|
|
SqlRowList rsReturn = null;
|
|
@@ -352,7 +367,14 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
if(rsReturn.next()){
|
|
if(rsReturn.next()){
|
|
|
dsl_location = rsReturn.getString("dsl_location"); //站位,一个站位统一下料
|
|
dsl_location = rsReturn.getString("dsl_location"); //站位,一个站位统一下料
|
|
|
}else{
|
|
}else{
|
|
|
- showSmtError(APIErrorCode.DATA_NOT_FOUND,"机台+工单+站位["+code+"]无上料数据,无需下料",handleType,linecode,"",pr_code,"",bool,table);
|
|
|
|
|
|
|
+ //查询Code是否是飞达
|
|
|
|
|
+ rs=baseDao.queryForRowSet("select fe_location from feeder where fe_code='"+code+"'");
|
|
|
|
|
+ if(rs.next()){
|
|
|
|
|
+ dsl_location=rs.getString("fe_location");
|
|
|
|
|
+ }else
|
|
|
|
|
+ {
|
|
|
|
|
+ showSmtError(APIErrorCode.DATA_NOT_FOUND,"机台+工单+站位["+code+"]无上料数据,无需下料",handleType,linecode,"",pr_code,"",bool,table);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
rsReturn = baseDao.queryForRowSet("select max(dsl_location) dsl_location,max(dsl_remainqty) dsl_remainqty,max(dsl_id) dsl_id,max(dsl_barcode) dsl_barcode,max(dsl_fespec) dsl_fespec,max(dsl_prodcode) dsl_prodcode,wm_concat(nvl(dsl_barcode,dsl_prodcode)) dsl_return from devsmtlocation "
|
|
rsReturn = baseDao.queryForRowSet("select max(dsl_location) dsl_location,max(dsl_remainqty) dsl_remainqty,max(dsl_id) dsl_id,max(dsl_barcode) dsl_barcode,max(dsl_fespec) dsl_fespec,max(dsl_prodcode) dsl_prodcode,wm_concat(nvl(dsl_barcode,dsl_prodcode)) dsl_return from devsmtlocation "
|
|
|
+ " where dsl_linecode=? and dsl_makecode=? and dsl_status=0 and dsl_location =? and dsl_table =? ",linecode,map.get("DL_MACODE"),dsl_location,map.get("DL_TABLE"));
|
|
+ " where dsl_linecode=? and dsl_makecode=? and dsl_status=0 and dsl_location =? and dsl_table =? ",linecode,map.get("DL_MACODE"),dsl_location,map.get("DL_TABLE"));
|
|
@@ -373,13 +395,19 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
}
|
|
|
sqls.add("update devsmtlocation set dsl_status=-1,dsl_cutman='"+SystemSession.getUser().getEm_name()+"',dsl_invalidtime=sysdate"
|
|
sqls.add("update devsmtlocation set dsl_status=-1,dsl_cutman='"+SystemSession.getUser().getEm_name()+"',dsl_invalidtime=sysdate"
|
|
|
+" where dsl_linecode='"+linecode+"' and dsl_makecode='"+ma_code+"' and dsl_status=0 and dsl_location ='"+dsl_location+"' and dsl_table='"+map.get("DL_TABLE")+"'");
|
|
+" where dsl_linecode='"+linecode+"' and dsl_makecode='"+ma_code+"' and dsl_status=0 and dsl_location ='"+dsl_location+"' and dsl_table='"+map.get("DL_TABLE")+"'");
|
|
|
- baseDao.execute(sqls);
|
|
|
|
|
//记录日志下料
|
|
//记录日志下料
|
|
|
rs = baseDao.queryForRowSet("select dl_macode,dl_hasmake from deviceline where dl_linecode =?",linecode);
|
|
rs = baseDao.queryForRowSet("select dl_macode,dl_hasmake from deviceline where dl_linecode =?",linecode);
|
|
|
int has_make=0;
|
|
int has_make=0;
|
|
|
if(rs.next()){
|
|
if(rs.next()){
|
|
|
has_make=rs.getInt("dl_hasmake");
|
|
has_make=rs.getInt("dl_hasmake");
|
|
|
}
|
|
}
|
|
|
|
|
+ //把飞达和站位解绑,Untying=-1飞达和条码号解绑
|
|
|
|
|
+ if(Untying==-1){
|
|
|
|
|
+ sqls.add("update feeder set fe_location='',fe_barcode='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ sqls.add("update feeder set fe_location='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }
|
|
|
|
|
+ baseDao.execute(sqls);
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"下料","下料成功,"+(has_make == -1 ? "工单":"产品")+":"+ma_code+",料卷号或站位:"+code,linecode,dsl_location,0,pr_code,rsReturn.getString("dsl_return"),map.get("DL_TABLE"),has_make == -1?ma_code:"");
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"下料","下料成功,"+(has_make == -1 ? "工单":"产品")+":"+ma_code+",料卷号或站位:"+code,linecode,dsl_location,0,pr_code,rsReturn.getString("dsl_return"),map.get("DL_TABLE"),has_make == -1?ma_code:"");
|
|
|
return rsReturn.getResultList();
|
|
return rsReturn.getResultList();
|
|
|
}else{
|
|
}else{
|
|
@@ -394,7 +422,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public void cuttingAllStock(String dl_macode,String dl_linecode,Integer dl_madeqty) {
|
|
|
|
|
|
|
+ public void cuttingAllStock(String dl_macode,String dl_linecode,Integer dl_madeqty,Integer Untying) {
|
|
|
SqlRowList rs = null;
|
|
SqlRowList rs = null;
|
|
|
int madeqty = 0;
|
|
int madeqty = 0;
|
|
|
String dl_table="",dl_devcode = "",dl_prodcode;
|
|
String dl_table="",dl_devcode = "",dl_prodcode;
|
|
@@ -468,6 +496,11 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
//只有一条记录直接扣料
|
|
//只有一条记录直接扣料
|
|
|
sqls.add("update devsmtlocation set dsl_remainqty="+dsl_remainqty+" where dsl_id="+rs.getInt("dsl_id"));
|
|
sqls.add("update devsmtlocation set dsl_remainqty="+dsl_remainqty+" where dsl_id="+rs.getInt("dsl_id"));
|
|
|
sqls.add("update barcode set bar_place=1,bar_forcastremain="+dsl_remainqty+",bar_remain="+dsl_remainqty+" where bar_code='"+rs.getString("dsl_barcode")+"' and bar_place='"+dl_macode+"'");
|
|
sqls.add("update barcode set bar_place=1,bar_forcastremain="+dsl_remainqty+",bar_remain="+dsl_remainqty+" where bar_code='"+rs.getString("dsl_barcode")+"' and bar_place='"+dl_macode+"'");
|
|
|
|
|
+ if(Untying==-1){
|
|
|
|
|
+ sqls.add("update feeder set fe_location='',fe_barcode='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ sqls.add("update feeder set fe_location='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }
|
|
|
}else{//多条记录
|
|
}else{//多条记录
|
|
|
//扣料
|
|
//扣料
|
|
|
if(actAddQty >0){
|
|
if(actAddQty >0){
|
|
@@ -490,6 +523,12 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //把飞达和站位解绑,Untying=-1飞达和条码号解绑
|
|
|
|
|
+ if(Untying==-1){
|
|
|
|
|
+ sqls.add("update feeder set fe_location='',fe_barcode='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ sqls.add("update feeder set fe_location='' where fe_location='"+dsl_location+"'");
|
|
|
|
|
+ }
|
|
|
//接料原料卷数量更新成0,接料实际操作是将原料卷剩余料拼到新料卷中
|
|
//接料原料卷数量更新成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,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+"'");
|
|
|
//多条记录接料料卷
|
|
//多条记录接料料卷
|
|
@@ -545,7 +584,6 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
Object bar_code = map1.get("dsl_barcode");
|
|
Object bar_code = map1.get("dsl_barcode");
|
|
|
Boolean isBarcode = isOurBarcode(bar_code);
|
|
Boolean isBarcode = isOurBarcode(bar_code);
|
|
|
int has_make=0;
|
|
int has_make=0;
|
|
|
- double remain = 0;
|
|
|
|
|
double bar_remain=0;
|
|
double bar_remain=0;
|
|
|
String pr_code = null;
|
|
String pr_code = null;
|
|
|
String dsl_barcode = null;
|
|
String dsl_barcode = null;
|
|
@@ -628,17 +666,12 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 校验是否湿敏条码
|
|
* 校验是否湿敏条码
|
|
|
* */
|
|
* */
|
|
|
- //checkMsdBarCode(bar_code);
|
|
|
|
|
|
|
+ checkMsdBarCode(bar_code);
|
|
|
double ma_qty=0;
|
|
double ma_qty=0;
|
|
|
rs2 = baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
rs2 = baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
|
if(rs2.next()){
|
|
if(rs2.next()){
|
|
|
ma_qty=rs2.getDouble("ma_qty");
|
|
ma_qty=rs2.getDouble("ma_qty");
|
|
|
}
|
|
}
|
|
|
- rs = baseDao.queryForRowSet("select sum(dsl_remainqty) dsl_remainqty,max(dsl_id) dsl_id, count(1) cn from"
|
|
|
|
|
- +" devsmtlocation where dsl_linecode=? and dsl_makecode=? and dsl_status=0 and dsl_table=? and dsl_location =? ",linecode,ma_code,map.get("DL_TABLE"),location);
|
|
|
|
|
- if(rs.next()) {
|
|
|
|
|
- remain = rs.getDouble("dsl_remainqty")>0?rs.getDouble("dsl_remainqty"):0; //将第一个料卷剩余料加给第二个料卷
|
|
|
|
|
- }
|
|
|
|
|
rs2 = baseDao.queryForRowSet("select wm_concat(psl_repcode)repcode ,count(1) cn ,max(psl_prodcode)psl_prodcode,count(1) cn ,max(psl_feeder) psl_feeder, max(psl_baseqty) psl_baseqty from productsmtlocation "
|
|
rs2 = baseDao.queryForRowSet("select wm_concat(psl_repcode)repcode ,count(1) cn ,max(psl_prodcode)psl_prodcode,count(1) cn ,max(psl_feeder) psl_feeder, max(psl_baseqty) psl_baseqty from productsmtlocation "
|
|
|
+"where psl_psid=? and psl_location=? and psl_table=?",map.get("PS_ID"),location,map.get("DL_TABLE"));
|
|
+"where psl_psid=? and psl_location=? and psl_table=?",map.get("PS_ID"),location,map.get("DL_TABLE"));
|
|
|
if(rs2.next()){
|
|
if(rs2.next()){
|
|
@@ -662,7 +695,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
}
|
|
|
baseDao.execute("insert into devsmtlocation (dsl_id,dsl_maid,dsl_makecode,dsl_location,dsl_prodcode,dsl_repcode,dsl_fespec,dsl_baseqty,dsl_table,dsl_needqty,dsl_getqty,dsl_remainqty,dsl_barcode,dsl_linecode,dsl_devcode,dsl_status, dsl_indate,dsl_inman,dsl_ifcheck,dsl_fprodcode,dsl_usable,dsl_validtime)values( DEVSMTLOCATION_SEQ.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,sysdate,?,?,?,?,?)",map.get("MA_ID"),ma_code,location,pr_code,rs2.getString("repcode"),
|
|
baseDao.execute("insert into devsmtlocation (dsl_id,dsl_maid,dsl_makecode,dsl_location,dsl_prodcode,dsl_repcode,dsl_fespec,dsl_baseqty,dsl_table,dsl_needqty,dsl_getqty,dsl_remainqty,dsl_barcode,dsl_linecode,dsl_devcode,dsl_status, dsl_indate,dsl_inman,dsl_ifcheck,dsl_fprodcode,dsl_usable,dsl_validtime)values( DEVSMTLOCATION_SEQ.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,sysdate,?,?,?,?,?)",map.get("MA_ID"),ma_code,location,pr_code,rs2.getString("repcode"),
|
|
|
rs2.getString("psl_feeder"),rs2.getDouble("psl_baseqty"),map.get("DL_TABLE"),rs2.getDouble("psl_baseqty")*ma_qty,
|
|
rs2.getString("psl_feeder"),rs2.getDouble("psl_baseqty"),map.get("DL_TABLE"),rs2.getDouble("psl_baseqty")*ma_qty,
|
|
|
- bar_remain+remain,bar_remain+remain,(("product").equals(type)?"":bar_code),linecode,map.get("DL_DECODE"),SystemSession.getUser().getEm_name(),0,rs2.getString("psl_prodcode"),usable,(usable==1)?Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)):"");
|
|
|
|
|
|
|
+ bar_remain,bar_remain,(("product").equals(type)?"":bar_code),linecode,map.get("DL_DECODE"),SystemSession.getUser().getEm_name(),0,rs2.getString("psl_prodcode"),usable,(usable==1)?Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)):"");
|
|
|
}else{
|
|
}else{
|
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"没有排位图信息",handleType,linecode,"",ps_prodcode,"",bool,map.get("DL_TABLE"));
|
|
showSmtError(APIErrorCode.BUSINESS_FAILED,"没有排位图信息",handleType,linecode,"",ps_prodcode,"",bool,map.get("DL_TABLE"));
|
|
|
}
|
|
}
|
|
@@ -671,9 +704,9 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
|
* */
|
|
* */
|
|
|
-// if(checkMsdBarCode(bar_code)){
|
|
|
|
|
-// updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if(checkMsdBarCode(bar_code)){
|
|
|
|
|
+ updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
+ }
|
|
|
//记录日志接料
|
|
//记录日志接料
|
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"接料","接料成功,"+(has_make == -1 ? "工单":"产品")+":"+ma_code+","+(("product").equals(type)?"物料编号":"料卷号")+":"+bar_code,linecode,location,0,ps_prodcode,(("product").equals(type)?"物料":"料卷")+":"+bar_code,map.get("DL_TABLE"),has_make == -1?ma_code:"");
|
|
baseDao.execute(INSERT_SMTLOG,SystemSession.getUser().getEm_name(),"接料","接料成功,"+(has_make == -1 ? "工单":"产品")+":"+ma_code+","+(("product").equals(type)?"物料编号":"料卷号")+":"+bar_code,linecode,location,0,ps_prodcode,(("product").equals(type)?"物料":"料卷")+":"+bar_code,map.get("DL_TABLE"),has_make == -1?ma_code:"");
|
|
|
Map<String,Object> mapReturn = new HashMap <String, Object>();
|
|
Map<String,Object> mapReturn = new HashMap <String, Object>();
|
|
@@ -704,6 +737,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
int has_make=0;
|
|
int has_make=0;
|
|
|
List<String> sqls = new ArrayList<String>();
|
|
List<String> sqls = new ArrayList<String>();
|
|
|
Object bar_code = map1.get("dsl_barcode"),ma_code = map.get("DL_MACODE"),table = map.get("DL_TABLE");
|
|
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");
|
|
Object location = map1.get("dsl_location"),linecode= map.get("DL_LINECODE");
|
|
|
|
|
|
|
|
rs=baseDao.queryForRowSet("select dl_macode,dl_statuscode,dl_hasmake,dl_prodcode from deviceline where dl_linecode=?",linecode);
|
|
rs=baseDao.queryForRowSet("select dl_macode,dl_statuscode,dl_hasmake,dl_prodcode from deviceline where dl_linecode=?",linecode);
|
|
@@ -747,16 +781,11 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
if(bar_code.toString().contains(rs.getString("psl_prodcode"))){
|
|
if(bar_code.toString().contains(rs.getString("psl_prodcode"))){
|
|
|
pr_code = rs.getString("psl_prodcode");
|
|
pr_code = rs.getString("psl_prodcode");
|
|
|
}else{
|
|
}else{
|
|
|
- try {
|
|
|
|
|
- String[] stringArr = rs.getString("repcode").split(",");
|
|
|
|
|
- for (String s : stringArr) {
|
|
|
|
|
- if (bar_code.toString().contains(s)) {
|
|
|
|
|
- pr_code = s;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String [] stringArr= rs.getString("repcode").split(",");
|
|
|
|
|
+ for (String s : stringArr) {
|
|
|
|
|
+ if (bar_code.toString().contains(s)) {
|
|
|
|
|
+ pr_code = s;
|
|
|
}
|
|
}
|
|
|
- }catch (Exception ex)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"物料["+bar_code+"]不是该站位需要上料的物料",handleType,linecode,location,ps_prodcode,"料号"+bar_code,bool,table);
|
|
showSmtError(APIErrorCode.DATA_NOT_FOUND,"物料["+bar_code+"]不是该站位需要上料的物料",handleType,linecode,location,ps_prodcode,"料号"+bar_code,bool,table);
|
|
@@ -776,7 +805,7 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 校验是否湿敏条码
|
|
* 校验是否湿敏条码
|
|
|
* */
|
|
* */
|
|
|
- //checkMsdBarCode(bar_code);
|
|
|
|
|
|
|
+ checkMsdBarCode(bar_code);
|
|
|
double ma_qty=0;
|
|
double ma_qty=0;
|
|
|
rs0=baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
rs0=baseDao.queryForRowSet("select ma_qty from make where ma_id=?",map.get("MA_ID"));
|
|
|
if(rs0.next()){
|
|
if(rs0.next()){
|
|
@@ -847,9 +876,9 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
* @Date 2018-01-22
|
|
* @Date 2018-01-22
|
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
* 上料、接料、换料 更新状态为“已上线” 并记录日志
|
|
|
* */
|
|
* */
|
|
|
-// if(checkMsdBarCode(bar_code)){
|
|
|
|
|
-// updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if(checkMsdBarCode(bar_code)){
|
|
|
|
|
+ updateMsdbarcodeOnLine(bar_code);
|
|
|
|
|
+ }
|
|
|
Map<String,Object> mapReturn = new HashMap <String, Object>();
|
|
Map<String,Object> mapReturn = new HashMap <String, Object>();
|
|
|
mapReturn.put("DSL_LOCATION",location);
|
|
mapReturn.put("DSL_LOCATION",location);
|
|
|
mapReturn.put("DSL_BARCODE",("product").equals(type)?"":bar_code);
|
|
mapReturn.put("DSL_BARCODE",("product").equals(type)?"":bar_code);
|
|
@@ -1870,14 +1899,13 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
for(Map<String ,Object> mapnow:rs.getResultList()) {
|
|
for(Map<String ,Object> mapnow:rs.getResultList()) {
|
|
|
if (barcode.toString().contains(mapnow.get("psl_prodcode").toString())) {
|
|
if (barcode.toString().contains(mapnow.get("psl_prodcode").toString())) {
|
|
|
pr_code =mapnow.get("psl_prodcode").toString();
|
|
pr_code =mapnow.get("psl_prodcode").toString();
|
|
|
- } else {try {
|
|
|
|
|
- String[] stringArr = mapnow.get("repcode").toString().split(",");
|
|
|
|
|
- for (String s : stringArr) {
|
|
|
|
|
- if (barcode.toString().contains(s)) {
|
|
|
|
|
- pr_code = s;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String[] stringArr = mapnow.get("repcode").toString().split(",");
|
|
|
|
|
+ for (String s : stringArr) {
|
|
|
|
|
+ if (barcode.toString().contains(s)) {
|
|
|
|
|
+ pr_code = s;
|
|
|
}
|
|
}
|
|
|
- }catch(Exception e){}
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
if(pr_code == null || ("").equals(pr_code)){
|
|
@@ -1898,61 +1926,39 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public Map<String, Object> prebarcodeGetLocation(String barcode, String linecode, String makecode, String table) {
|
|
|
|
|
- Map<String, Object> location = new HashMap<String, Object>();
|
|
|
|
|
- SqlRowList rr = baseDao.queryForRowSet("select ma_prodcode from make where ma_code = ?",makecode);
|
|
|
|
|
- Object ps_prodcode;
|
|
|
|
|
- if (rr.next())
|
|
|
|
|
- {
|
|
|
|
|
- ps_prodcode = rr.getString("ma_prodcode");
|
|
|
|
|
- }else {
|
|
|
|
|
- throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "工单["+makecode+"]错误,不存在");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- String pr_code = "";
|
|
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select bar_status,bar_prodcode,pr_detail,pr_spec,bar_batchcode,bar_whcode,bar_remain,bar_vendcode "
|
|
|
|
|
- + "from barcode left join product on pr_code=bar_prodcode where bar_code=?", barcode);
|
|
|
|
|
- if (rs.next()) {
|
|
|
|
|
- SqlRowList ra = baseDao.queryForRowSet("select NVL(WM_CONCAT(PSL_LOCATION),' ') PSL_LOCATION from productsmtlocation left join productsmt on ps_id = psl_psid where ps_linecode = ? and ps_prodcode = ? and (psl_prodcode=? or psl_repcode=?) and psl_table=?", linecode, ps_prodcode, rs.getString("bar_prodcode"), rs.getString("bar_prodcode"), table);
|
|
|
|
|
- ra.next();
|
|
|
|
|
- if (" ".equals(ra.getString("PSL_LOCATION")))
|
|
|
|
|
- throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "料卷对应的物料[" + rs.getString("bar_prodcode") + "]不是当前线别需要上料的物料");
|
|
|
|
|
- else {
|
|
|
|
|
- location.put("location", ra.getString("PSL_LOCATION"));
|
|
|
|
|
- return location;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- rs = baseDao.queryForRowSet("select psl_prodcode,wm_concat(psl_repcode)repcode from productsmtlocation left join productsmt on ps_id = psl_psid where ps_linecode = ? and ps_prodcode = ? and psl_table=? group by psl_prodcode",linecode,ps_prodcode,table);
|
|
|
|
|
- if(rs.next()){
|
|
|
|
|
- for(Map<String ,Object> mapnow:rs.getResultList()) {
|
|
|
|
|
- if (barcode.toString().contains(mapnow.get("psl_prodcode").toString())) {
|
|
|
|
|
- pr_code =mapnow.get("psl_prodcode").toString();
|
|
|
|
|
- } else {try {
|
|
|
|
|
- String[] stringArr = mapnow.get("repcode").toString().split(",");
|
|
|
|
|
- for (String s : stringArr) {
|
|
|
|
|
- if (barcode.toString().contains(s)) {
|
|
|
|
|
- pr_code = s;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }catch(Exception e){}
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Map<String, Object> bindFeederBarcode(String barcode,String fe_code) {
|
|
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
+ if(baseDao.checkIf("feeder","fe_code='"+fe_code+"'")){
|
|
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select bar_remain,nvl(bar_place,1)bar_place,bar_prodcode,bar_code from barcode where bar_code=? ",barcode);
|
|
|
|
|
+ if(rs.next()){
|
|
|
|
|
+ if(rs.getDouble("bar_remain") <= 0){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"料卷号数量必须大于0");
|
|
|
|
|
+ }else if(!"1".equals(rs.getString("bar_place"))){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"料卷已被单据["+rs.getString("bar_place")+"]使用");
|
|
|
}
|
|
}
|
|
|
|
|
+ baseDao.updateByCondition("feeder","fe_barcode='"+barcode+"'","fe_code='"+fe_code+"'");
|
|
|
|
|
+ map.put("barcode",barcode);
|
|
|
|
|
+ map.put("fe_code",fe_code);
|
|
|
|
|
+ }else
|
|
|
|
|
+ {
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "料卷"+barcode+"不存在");
|
|
|
}
|
|
}
|
|
|
- if(pr_code == null || ("").equals(pr_code)){
|
|
|
|
|
- throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "料卷["+barcode+"]不是该机台需要上料的料卷");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- SqlRowList ra = baseDao.queryForRowSet("select NVL(WM_CONCAT(PSL_LOCATION),' ') PSL_LOCATION from productsmtlocation left join productsmt on ps_id = psl_psid where ps_linecode = ? and ps_prodcode = ? and (psl_prodcode=? or psl_repcode=?) and psl_table=?", linecode, ps_prodcode, pr_code,pr_code, table);
|
|
|
|
|
- ra.next();
|
|
|
|
|
- if (" ".equals(ra.getString("PSL_LOCATION")))
|
|
|
|
|
- throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "料卷对应的物料[" + pr_code + "]不是当前机台需要上料的物料");
|
|
|
|
|
- else {
|
|
|
|
|
- location.put("location", ra.getString("PSL_LOCATION"));
|
|
|
|
|
- return location;
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
- throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "线别["+linecode+"],产品["+ps_prodcode+"],版面["+table+"]无对应排位表");
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "飞达"+fe_code+"不存在");
|
|
|
}
|
|
}
|
|
|
|
|
+ return map;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Map<String, Object> getFeederLocation(String fe_code) {
|
|
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
+ if(baseDao.checkIf("feeder","fe_code='"+fe_code+"'")){
|
|
|
|
|
+ map.put("fe_code",fe_code);
|
|
|
|
|
+ map.put("fe_location",baseDao.getFieldDataByCondition("feeder","fe_location","fe_code='"+fe_code+"'"));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND, "飞达"+fe_code+"不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|