|
|
@@ -148,6 +148,9 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
case SetHashValue:
|
|
|
remap = SetHashValue(json,AE_MASTER);
|
|
|
break;
|
|
|
+ case Weigh:
|
|
|
+ remap = Weigh(json,AE_MASTER);
|
|
|
+ break;
|
|
|
default:
|
|
|
err = -1;
|
|
|
break;
|
|
|
@@ -185,6 +188,78 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
return arr;
|
|
|
}
|
|
|
|
|
|
+ public Map<Object,Object> Weigh(JSONObject map,String Master) {
|
|
|
+ Map<Object, Object> rmap = new HashMap<Object, Object>();
|
|
|
+ String oErrMessage="";
|
|
|
+ String iSN="";
|
|
|
+ String iSource="";
|
|
|
+ String weight="";
|
|
|
+ if(map.get("iSN")==null){
|
|
|
+ oErrMessage = "SN不能为空";
|
|
|
+ rmap.put("oErrMessage",oErrMessage);
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+ if(map.get("iSource")==null){
|
|
|
+ oErrMessage = "工序不能为空";
|
|
|
+ rmap.put("oErrMessage",oErrMessage);
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+ if(map.get("weight")==null){
|
|
|
+ oErrMessage = "重量不能为空";
|
|
|
+ rmap.put("oErrMessage",oErrMessage);
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+ iSN=map.get("iSN").toString();
|
|
|
+ iSource=map.get("iSource").toString();
|
|
|
+ weight=map.get("weight").toString().replaceAll("KG","");
|
|
|
+ Object[] obj = baseDao.getFieldsDataByCondition(Master+".makeserial left join "+Master+".product on pr_code=ms_prodcode","pr_colorboxminw,pr_colorboxmaxw","ms_id =(select max(ms_id) from makeserial where ms_sncode='"+iSN+"')");
|
|
|
+ if(obj[0]!=null&&obj[1]!=null){
|
|
|
+ //不在设置的重量范围内
|
|
|
+ if(Double.parseDouble(weight)<Double.parseDouble(obj[0].toString())||Double.parseDouble(weight)>Double.parseDouble(obj[1].toString())){
|
|
|
+ rmap.put("code",-1);
|
|
|
+ rmap.put("message","SN["+iSN+"]重量为"+weight+",不符合重量范围"+obj[0]+"-"+obj[1]);
|
|
|
+ Map<String, String> rmap1 = new HashMap<String, String>();
|
|
|
+ rmap1.put("minWeight",obj[0].toString());
|
|
|
+ rmap1.put("maxWeight",obj[1].toString());
|
|
|
+ rmap1.put("machineModel","");
|
|
|
+ rmap.put("dataInfo",rmap1);
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+
|
|
|
+ rmap.put("message","SN["+iSN+"]重量为"+weight+",符合重量范围"+obj[0]+"-"+obj[1]+",称重通过");
|
|
|
+ Object ms_id=baseDao.getFieldDataByCondition("makeserial","max(ms_id)","ms_sncode='"+iSN+"'");
|
|
|
+ baseDao.execute("update makeserial set ms_grossw ='"+weight+"' where ms_id="+ms_id);
|
|
|
+
|
|
|
+ Map<String, String> rmap1 = new HashMap<String, String>();
|
|
|
+ rmap1.put("minWeight",obj[0].toString());
|
|
|
+ rmap1.put("maxWeight",obj[1].toString());
|
|
|
+ rmap1.put("machineModel","");
|
|
|
+ rmap.put("dataInfo",rmap1);
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+ return rmap;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Object SetPcbaData(String iSN,String iResCode,String iOperator,String iResult,String Master){
|
|
|
+ //实际业务数据
|
|
|
+ Map<Object, Object> rmap = new HashMap<>();
|
|
|
+ String iErrCode = null;
|
|
|
+ if(iSN==null){
|
|
|
+ iErrCode = "SN不能为空";
|
|
|
+ return iErrCode;
|
|
|
+ }
|
|
|
+ JSONObject map3=new JSONObject();
|
|
|
+ map3.put("iSN",iSN);
|
|
|
+ Map<Object, Object> map2=GetRcardMOInfo(map3,Master);
|
|
|
+ String oMoCode=null;
|
|
|
+ if(map2.get("oMoCode")!=null){
|
|
|
+ oMoCode=map2.get("oMoCode").toString();
|
|
|
+ }
|
|
|
+ if (map2.get("oErrMessage")==null)
|
|
|
+ map2= SetStepFinish(oMoCode, iResCode, iSN, "", iResult, iResCode, iErrCode,Master);
|
|
|
+ return map2.get("oErrMessage");
|
|
|
+ }
|
|
|
+
|
|
|
private Map<Object,Object> SetHashValue(JSONObject map,String Master){
|
|
|
Map<Object, Object> rmap = new HashMap<Object, Object>();
|
|
|
String oErrMessage="";
|
|
|
@@ -488,6 +563,7 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
return rmap;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private Map<Object,Object> CheckRoutePassed(JSONObject map,String Master){
|
|
|
//实际业务数据
|
|
|
Map<Object, Object> rmap = new HashMap<>();
|