Browse Source

数据追溯接口

callm 2 years ago
parent
commit
45c204e98c
1 changed files with 47 additions and 0 deletions
  1. 47 0
      src/main/java/com/uas/eis/serviceImpl/MESHelperServiceImpl.java

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

@@ -268,6 +268,52 @@ public class MESHelperServiceImpl implements MESHelperService {
 	@Override
 	@Override
 	public Map<Object,Object> SetupResultDataInterface(String data) {
 	public Map<Object,Object> SetupResultDataInterface(String data) {
 		Map<Object, Object> rmap = new HashMap<Object, Object>();
 		Map<Object, Object> rmap = new HashMap<Object, Object>();
+
+		JSONObject object = JSONObject.fromObject(data);
+		JSONObject SetupResultDetail=object.getJSONObject("SetupResultDetail");
+		if(SetupResultDetail!=null){
+			String ActionType=SetupResultDetail.get("ActionType").toString();
+			String LineName=SetupResultDetail.get("LineName").toString();
+			String MachineName=SetupResultDetail.get("MachineName").toString();
+			String ORDERNUMBER=SetupResultDetail.get("ORDERNUMBER").toString();
+			String DockingStationID=SetupResultDetail.get("DockingStationID").toString();
+			String Operator=SetupResultDetail.get("Operator").toString();
+			String TableLocation=SetupResultDetail.get("TableLocation").toString();
+			String TableId=SetupResultDetail.get("TableId").toString();
+			String Track=SetupResultDetail.get("Track").toString();
+			String FeederTypeName=SetupResultDetail.get("FeederTypeName").toString();
+			String FeederID=SetupResultDetail.get("FeederID").toString();
+			JSONObject PackagingUnitDetail=SetupResultDetail.getJSONObject("PackagingUnitDetail");
+			if(PackagingUnitDetail!=null){
+				String PUID=PackagingUnitDetail.getString("PUID");
+				String ComponentBarcode=PackagingUnitDetail.getString("ComponentBarcode");
+				String OriginalQuantity=PackagingUnitDetail.getString("OriginalQuantity");
+				String Quantity=PackagingUnitDetail.getString("Quantity");
+				String CreateDate=Time(PackagingUnitDetail.getString("CreateDate"));
+				String DateCode=PackagingUnitDetail.getString("DateCode");
+				String Batch2=PackagingUnitDetail.getString("Batch2");
+				String MsdLevel=PackagingUnitDetail.getString("MsdLevel");
+				String VerifiedDate=PackagingUnitDetail.getString("VerifiedDate");
+				JSONObject LockInfoList=PackagingUnitDetail.getJSONObject("LockInfoList");
+				JSONObject SplicedPackagingUnitList=PackagingUnitDetail.getJSONObject("SplicedPackagingUnitList");
+				baseDao.execute("insert into SETUPRESULTDETAIL(pu_id,ACTIONTYPE,LINENAME,ORDERNUMBER,MACHINENAME," +
+						"TABLEID,DOCKINGSTATIONID,OPERATOR,TableLocation,FeederTypeName,FeederID)values(SETUPRESULTDETAIL_seq.nextval," +
+						"'"+ActionType+"','"+LineName+"','"+ORDERNUMBER+"','"+MachineName+"','"+TableId+"','"+DockingStationID+"'," +
+						"'"+Operator+"','"+TableLocation+"','"+FeederTypeName+"','"+FeederID+"')");
+				if(LockInfoList!=null){
+					JSONArray LockInfoItem=LockInfoList.getJSONArray("LockInfoItem");
+					for(int i=0;i<=LockInfoItem.size();i++){
+						JSONObject map=LockInfoItem.getJSONObject(i);
+					}
+				}
+				if(SplicedPackagingUnitList!=null){
+					JSONArray SplicedPackagingUnitItem=LockInfoList.getJSONArray("SplicedPackagingUnitItem");
+					for(int i=0;i<=SplicedPackagingUnitItem.size();i++){
+						JSONObject map=SplicedPackagingUnitItem.getJSONObject(i);
+					}
+				}
+			}
+		}
 		return rmap;
 		return rmap;
 	}
 	}
 
 
@@ -354,6 +400,7 @@ public class MESHelperServiceImpl implements MESHelperService {
 	public String Time(String time){
 	public String Time(String time){
 		return time.replaceAll("T"," ").substring(0,19);
 		return time.replaceAll("T"," ").substring(0,19);
 	}
 	}
+
 	@Override
 	@Override
 	public Map<Object,Object> Weigh(String data) {
 	public Map<Object,Object> Weigh(String data) {
 		Map<Object, Object> rmap = new HashMap<Object, Object>();
 		Map<Object, Object> rmap = new HashMap<Object, Object>();