瀏覽代碼

工单信息接口获取

callm 4 月之前
父節點
當前提交
786409114e

+ 2 - 1
src/main/java/com/uas/eis/entity/HelperType.java

@@ -23,7 +23,8 @@ public enum HelperType {
     GetInfoByMaterial("GetInfoByMaterial","根据上料信息获取到SN相关信息"),
     GetMakeInfoBySN("GetMakeInfoBySN","根据SN获取工单相关信息"),
     GetMakeInfoByProd("GetMakeInfoByProd","根据物料获取相关信息"),
-    GetProdInfo("GetProdInfo","根据物料获取相关信息");
+    GetProdInfo("GetProdInfo","根据物料获取相关信息"),
+    GetMakeInfo("GetMakeInfo","获取工单相关信息");
 
     private String code;
     private String name;

+ 29 - 0
src/main/java/com/uas/eis/serviceImpl/MESHelperServiceImpl.java

@@ -112,6 +112,9 @@ public class MESHelperServiceImpl implements MESHelperService {
 			case GetProdInfo:
 				remap = GetProdInfo(json);
 				break;
+			case GetMakeInfo:
+				remap = GetMakeInfo(json);
+				break;
 			default:
 				err = -1;
 				break;
@@ -1017,6 +1020,32 @@ public class MESHelperServiceImpl implements MESHelperService {
 		}
 	}
 
+	private Map<Object,Object> GetMakeInfo(JSONObject map){
+		Map<Object, Object> rmap = new HashMap<Object, Object>();
+		String iSN=null;
+		String oErrMessage=null;
+		if(map.get("iSN")==null){
+			oErrMessage = "SN不能为空";
+			rmap.put("oErrMessage",oErrMessage);
+			return rmap;
+		}
+		iSN=map.get("iSN").toString();
+		String makecode=baseDao.getFieldDataByCondition("makeserial","ms_makecode","ms_id=(select max(ms_id) from makeserial where ms_sncode='"+iSN+"')").toString();
+		SqlRowList rs=baseDao.queryForRowSet("select mid_item,mid_value from makeitem left join makeitemdetail on mi_id=mid_miid " +
+				"where mi_makecode='"+makecode+"' and mid_item is not null");
+		while(rs.next()){
+			rmap.put(rs.getString("mid_item"),rs.getString("mid_value"));
+		}
+		return rmap;
+		/*if(rs.next()){
+
+		}else{
+			oErrMessage = "SN未查询到关联信息";
+			rmap.put("oErrMessage",oErrMessage);
+			return rmap;
+		}*/
+	}
+
 	private Map<Object,Object> GetProdInfo(JSONObject map){
 		Map<Object, Object> rmap = new HashMap<Object, Object>();
 		String iSN=null;