Prechádzať zdrojové kódy

【功能完善】【根据SN获取mainSN 再获取所有子SN】

koul 2 mesiacov pred
rodič
commit
2493630ca4

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

@@ -220,4 +220,15 @@ public class MESHelperController {
     public Map<Object,Object> getMakeSnCode(HttpServletRequest request,  @RequestBody String json){
         return mesHelperService.getMakeSnCode(json);
     }
+
+    /**
+     * 获取MES生成的SN条码
+     * @param request
+     * @param json
+     * @return
+     */
+    @RequestMapping(value="/getMainAllSnCode")
+    public Map<Object,Object> getMainAllSnCode(HttpServletRequest request,  @RequestBody String json){
+        return mesHelperService.getMainAllSnCode(json);
+    }
 }

+ 2 - 0
src/main/java/com/uas/eis/service/MESHelperService.java

@@ -35,4 +35,6 @@ public interface MESHelperService {
 
 	Map<Object, Object> getMakeSnCode(String data);
 
+	Map<Object, Object> getMainAllSnCode(String data);
+
 }

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

@@ -1895,6 +1895,30 @@ public class MESHelperServiceImpl implements MESHelperService {
 		return rmap;
 	}
 
+	@Override
+	public Map<Object, Object> getMainAllSnCode(String data) {
+		Map<String, Object> map=null;
+		Map<Object, Object> rmap = new HashMap<Object, Object>();
+		try{
+			map =BaseUtil.convertJsonToMap(data);
+		}catch (Exception e){
+			rmap.put("code",-1);
+			rmap.put("message",e.getMessage());
+			System.out.printf(e.getMessage()) ;
+			return rmap;
+		}
+		String sn = StringUtil.nvl(map.get("sn"),"");
+		if("".equals(sn)){
+			rmap.put("code",-1);
+			rmap.put("message","SN不能为空");
+			return rmap;
+		}
+		List<Map<String, Object>> maps = baseDao.queryForList("select msl_sncode serialNo from MakeSnList where msl_mainbarcode=(select msl_mainbarcode from MakeSnList where msl_sncode='" + sn + "')");
+		rmap.put("code",0);
+		rmap.put("data",maps);
+		return rmap;
+	}
+
 
 	private Map<Object,Object> SetBpMaterial(JSONObject map)
 	{