|
|
@@ -103,7 +103,8 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> register(String bar_code, Double expTime) {
|
|
|
+ public Map<String, Object> register(String bar_code, Double expTime,String msdRank) {
|
|
|
+ Map<String, Object> resMap = new HashMap<String,Object>();
|
|
|
// 1、判断bar_code 条码号不能为空,已暴露时间必须大于等于0
|
|
|
if(expTime<0.0){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "暴露时长不可小于0!");
|
|
|
@@ -123,11 +124,22 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
if(barrs.next()){
|
|
|
pr_code = barrs.getGeneralString("pr_code");
|
|
|
if(StringUtil.hasText(pr_code)){
|
|
|
+ if(StringUtil.hasText(msdRank) && !msdRank.equals("")){//非MSD物料强制登记,先根据选择湿敏等级先更新湿敏元件为-1 并记录湿敏等级
|
|
|
+ String res = baseDao.callProcedure("MES_TOMSDPROD",new Object[] {pr_code,msdRank});
|
|
|
+ if(StringUtil.hasText(res)){
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED, res);
|
|
|
+ }
|
|
|
+ barrs = baseDao.queryForRowSet("select bar_code,bar_prodcode,pr_code,nvl(pr_msdlevel,'无') pr_msdlevel," +
|
|
|
+ "max(mi_msdlifttime) mi_msdlifttime,pr_ismsd,max(pr_statuscode) pr_statuscode " +
|
|
|
+ "from barcode left join product on pr_code = bar_prodcode left join msdinfo on mi_msdlevel = pr_msdlevel " +
|
|
|
+ "where bar_code=? group by bar_code,bar_prodcode,pr_code,pr_msdlevel,pr_ismsd", bar_code);
|
|
|
+ barrs.next();
|
|
|
+ }
|
|
|
if(!barrs.getGeneralString("pr_statuscode").equals("AUDITED")){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+",尚未审核!");
|
|
|
}
|
|
|
pr_msdlevel = barrs.getGeneralString("pr_msdlevel");
|
|
|
- if(NumberUtil.isEmpty(barrs.getGeneralString("mi_msdlifttime"))){
|
|
|
+ if(NumberUtil.isEmpty(barrs.getGeneralDouble("mi_msdlifttime"))){
|
|
|
int count = baseDao.getCount("select count(1) from msdinfo where mi_msdlevel = '"+barrs.getGeneralString("pr_msdlevel")+"'");
|
|
|
if(count == 0){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"湿敏元件,湿敏等级"+barrs.getGeneralString("pr_msdlevel")+",尚未维护对应湿敏基础资料!");
|
|
|
@@ -135,14 +147,18 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"湿敏元件,湿敏等级"+barrs.getGeneralString("pr_msdlevel")+",尚未维护车间寿命或车间寿命为0!");
|
|
|
}
|
|
|
}else{
|
|
|
- pr_msdlifetime = Double.valueOf(barrs.getGeneralString("mi_msdlifttime"));
|
|
|
+ pr_msdlifetime = Double.valueOf(barrs.getGeneralDouble("mi_msdlifttime"));
|
|
|
}
|
|
|
- if(NumberUtil.isEmpty(barrs.getGeneralInt("pr_ismsd"))){
|
|
|
- throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"非湿敏元件,不能进行登记!");
|
|
|
+ if(NumberUtil.isEmpty(barrs.getGeneralInt("pr_ismsd")) || (!StringUtil.hasText(pr_msdlevel) || (StringUtil.hasText(pr_msdlevel) && pr_msdlevel.equals("无")) )){
|
|
|
+ //非湿敏元件 需要前端处理选择湿敏等级
|
|
|
+ List<String> msdRankList = baseDao.queryForList("select mi_msdlevel from MsdInfo group by mi_msdlevel order by mi_msdlevel asc",String.class);
|
|
|
+ resMap.put("isnotmsd",true);
|
|
|
+ resMap.put("msdranklist",msdRankList);
|
|
|
+ return resMap;
|
|
|
}
|
|
|
- if(!StringUtil.hasText(pr_msdlevel) && pr_msdlevel.equals("无")){
|
|
|
+ /*if(!StringUtil.hasText(pr_msdlevel) && pr_msdlevel.equals("无")){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"湿敏元件,湿敏等级为空或为\"无\"!");
|
|
|
- }
|
|
|
+ }*/
|
|
|
if(NumberUtil.isEmpty(pr_msdlifetime)){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料"+pr_code+",湿敏等级"+pr_msdlevel+",尚未维护湿敏车间寿命!");
|
|
|
}
|
|
|
@@ -155,12 +171,27 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
Object[] prods = baseDao.getFieldsDataByCondition("product left join msdinfo on mi_msdlevel = pr_msdlevel",
|
|
|
"pr_code,pr_msdlevel,pr_ismsd,max(mi_msdlifttime)", "instr('"+bar_code+"',PR_CODE)>0 and nvl(pr_Statuscode,' ') ='AUDITED' group by PR_CODE, PR_MSDLEVEL, PR_ISMSD");
|
|
|
pr_code = prods[0];
|
|
|
- if(NumberUtil.isEmpty(prods[2])){
|
|
|
+ if(StringUtil.hasText(msdRank) && !msdRank.equals("")){//非MSD物料强制登记,先根据选择湿敏等级先更新湿敏元件为-1 并记录湿敏等级
|
|
|
+ String res = baseDao.callProcedure("MES_TOMSDPROD",new Object[] {pr_code,msdRank});
|
|
|
+ if(StringUtil.hasText(res)){
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED, res);
|
|
|
+ }
|
|
|
+ prods = baseDao.getFieldsDataByCondition("product left join msdinfo on mi_msdlevel = pr_msdlevel",
|
|
|
+ "pr_code,pr_msdlevel,pr_ismsd,max(mi_msdlifttime)", "instr('"+bar_code+"',PR_CODE)>0 and nvl(pr_Statuscode,' ') ='AUDITED' group by PR_CODE, PR_MSDLEVEL, PR_ISMSD");
|
|
|
+ }
|
|
|
+ if(NumberUtil.isEmpty(prods[2])|| !StringUtil.hasText(prods[1]) || ( StringUtil.hasText(prods[1]) && prods[1].toString().equals("无") ) ){
|
|
|
+ //非湿敏元件 需要前端处理选择湿敏等级
|
|
|
+ List<String> msdRankList = baseDao.queryForList("select mi_msdlevel from MsdInfo group by mi_msdlevel order by mi_msdlevel asc",String.class);
|
|
|
+ resMap.put("isnotmsd",true);
|
|
|
+ resMap.put("msdranklist",msdRankList);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+ /*if(NumberUtil.isEmpty(prods[2])){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"非湿敏元件,不能进行登记!");
|
|
|
}
|
|
|
if(!StringUtil.hasText(prods[1]) || ( StringUtil.hasText(prods[1]) && prods[1].toString().equals("无") )){
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"对应物料:"+pr_code+"湿敏元件,湿敏等级为空或为\"无\"!");
|
|
|
- }
|
|
|
+ }*/
|
|
|
if(NumberUtil.isEmpty(prods[3])){
|
|
|
int countMsd = baseDao.getCount("select count(1) from msdinfo where mi_msdlevel = '"+prods[1]+"'");
|
|
|
if(countMsd == 0){
|
|
|
@@ -237,7 +268,7 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
/**
|
|
|
* 入烘烤 - 入烘烤按钮确认
|
|
|
* @param bar_code 条码号
|
|
|
- * @param String data 将对应的烘烤温度等值封装在里面
|
|
|
+ * @param data 将对应的烘烤温度等值封装在里面
|
|
|
* 烘烤温度(必填填写数字大于0),湿度(必填填写数字大于0),时长(必填填写大于0的数字),储位
|
|
|
* {“temp”:54 //温度,“humidity”:23 //湿度,“time”:1.5 //时长,”location”:“L01” //储位}
|
|
|
* @return
|
|
|
@@ -267,7 +298,7 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
}
|
|
|
/**
|
|
|
* 出烘烤-确认出烘烤
|
|
|
- * @param code
|
|
|
+ * @param bar_code
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -387,4 +418,6 @@ public class PdaMsdServiceImpl implements PdaMsdService {
|
|
|
throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "条码:"+bar_code+"尚未登记!");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|