Browse Source

Merge remote-tracking branch 'origin/xingzc_eis' into xingzc_eis

xiaost 3 weeks ago
parent
commit
b2f3521d4e

+ 1 - 1
src/main/java/com/uas/eis/controller/MESHelperController.java

@@ -81,7 +81,7 @@ public class MESHelperController {
     }
 
     //追溯信息接口
-    @RequestMapping(value="/SPITestInfo")
+    @RequestMapping(value="/MesOutPut")
     public Map<Object,Object> SPITestInfo(HttpServletRequest request,  @RequestBody String json){
         Map<String, Object> modelMap = new HashMap<String, Object>();
         Map<Object,Object> map = mesHelperService.SPITestInfo(json);

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

@@ -20,7 +20,9 @@ public enum HelperType {
     GoMo("GoMo","检测XXX") ,//序列号归属工单
     GetInfoByMaterial("GetInfoByMaterial","根据上料信息获取到SN相关信息"),
     GetMakeInfoBySN("GetMakeInfoBySN","根据SN获取工单相关信息"),
-    SetBpMaterial("SetBpMaterial","自动线摆盘物料上到SN");
+    SetBpMaterial("SetBpMaterial","自动线摆盘物料上到SN"),
+
+    GetSnRepm("GetSnRepm","判断SN是否存在更换屏幕记录");
 
     private String code;
     private String name;

+ 44 - 5
src/main/java/com/uas/eis/serviceImpl/MESHelperServiceImpl.java

@@ -707,8 +707,8 @@ public class MESHelperServiceImpl implements MESHelperService {
 				}
 			}
 			rmap.put("EventCode","0");
-			rmap.put("result","OK");
-			rmap.put("ServerMessage","数据录入成功");
+			rmap.put("Result","OK");
+			rmap.put("Message","数据录入成功");
 		}
 		return rmap;
 	}
@@ -785,11 +785,14 @@ public class MESHelperServiceImpl implements MESHelperService {
 		}
 		ReelId=map.get("ReelId").toString();
 		Quantity=map.get("Quantity").toString();
-		SqlRowList rs=baseDao.queryForRowSet("select bar_id,bar_prodcode,bar_remain,pr_spec,to_char(bar_madedate,'yyyy-mm-dd')bar_madedate from barcode@ERP left join product on bar_prodcode = pr_code where bar_code=?",ReelId);
+		SqlRowList rs=baseDao.queryForRowSet("select bar_id,bar_prodcode,bar_remain,pr_spec,to_char(nvl(bar_madedate,sysdate),'yyyy-mm-dd')bar_madedate from barcode@ERP left join product on bar_prodcode = pr_code where bar_code=?",ReelId);
 		if(rs.next()){
-			baseDao.execute("update barcode@ERP set bar_remain=?,bar_status = 1,bar_outno = '' where bar_id=?",Quantity,rs.getString("bar_id"));
+			baseDao.execute("update barcode@ERP set bar_remain=?,bar_status = 2 where bar_id=?",Quantity,rs.getString("bar_id"));
 			baseDao.execute("insert into barcodechange@ERP(BC_ID,BC_INDATE, BC_REASON, BC_QTY, BC_BARCODE,  BC_PRODCODE, BC_NEWQTY)" +
 					"values(barcodechange_seq.nextval@ERP,sysdate,'点料机更新条码数量',?,?,?,?)",rs.getString("bar_remain"),ReelId,rs.getString("bar_prodcode"),Quantity);
+			baseDao.execute("update barcode set bar_remain=?,bar_status = 1,bar_outno = '' where bar_code=?",Quantity,ReelId);
+			baseDao.execute("insert into barcodechange(BC_ID,BC_INDATE, BC_REASON, BC_QTY, BC_BARCODE,  BC_PRODCODE, BC_NEWQTY)" +
+					"values(barcodechange_seq.nextval,sysdate,'点料机更新条码数量',?,?,?,?)",rs.getString("bar_remain"),ReelId,rs.getString("bar_prodcode"),Quantity);
 			rmap.put("Status","OK");
 			rmap.put("Meassage","通过");
 			rmap.put("PN",rs.getString("bar_prodcode"));
@@ -964,6 +967,9 @@ public class MESHelperServiceImpl implements MESHelperService {
 			case SetBpMaterial:
 				remap = SetBpMaterial(json);
 				break;
+			case GetSnRepm:
+				remap = GetSnRepm(json);
+				break;
 			default:
 				err = -1;
 				break;
@@ -1854,7 +1860,7 @@ public class MESHelperServiceImpl implements MESHelperService {
 						baseDao.execute(sql.toString());
 					}
 					//将不良的序列号的状态码设为3
-					baseDao.execute("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+					baseDao.execute("update makeserial set ms_status='3',ms_mccode = '' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
 				}
 				break;
 			default:
@@ -2084,6 +2090,39 @@ public class MESHelperServiceImpl implements MESHelperService {
 	}
 
 
+	private Map<Object,Object> GetSnRepm(JSONObject map)
+	{
+		Map<Object, Object> rmap = new HashMap<Object, Object>();
+		String iSN=null;
+		String oErrMessage=null;
+		String mbr_solutionname=null;
+		if(map.get("iSN")==null){
+			oErrMessage = "SN不能为空";
+			rmap.put("oErrMessage",oErrMessage);
+			return rmap;
+		}
+		iSN=map.get("iSN").toString();
+		SqlRowList rs = baseDao.queryForRowSet("select mbr_solutionname from makebad left join MAKEBADREASON on mb_id = mbr_mbid where mb_sncode = ? order by mb_id desc",iSN);
+		if (rs.next())
+		{
+			mbr_solutionname = rs.getString("mbr_solutionname");
+			if ("更换屏幕".equals(mbr_solutionname)) {
+				oErrMessage = "需要更换屏幕";
+			}else
+			{
+				oErrMessage = "不需要更换屏幕";
+			}
+			rmap.put("oErrMessage",oErrMessage);
+			return rmap;
+		}else
+		{
+			oErrMessage = "SN"+iSN+"没有不良记录";
+			rmap.put("oErrMessage",oErrMessage);
+			return rmap;
+		}
+	}
+
+
 	private Map<Object,Object> SetBpMaterial(JSONObject map)
 	{
 		Map<Object, Object> rmap = new HashMap<Object, Object>();