|
|
@@ -998,6 +998,7 @@ public class MESServiceImpl implements MESService {
|
|
|
}
|
|
|
return ApiResponse.successRsp("0",requestId,"校验通过!");
|
|
|
} catch (IOException e) {
|
|
|
+ logger.error("makeCheckOutStock==="+e.getMessage());
|
|
|
return ApiResponse.failRsp("10086",requestId,e.getMessage());
|
|
|
}
|
|
|
|
|
|
@@ -1026,6 +1027,39 @@ public class MESServiceImpl implements MESService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ApiResult<String> canMadeQty(HttpServletRequest request) {
|
|
|
+ String requestId = request.getHeader("RequestId");
|
|
|
+ JSONObject jsonData = getJsonData(request);
|
|
|
+ if (jsonData!=null){
|
|
|
+ String makeCode = StringUtil.nvl(jsonData.get("MakeCode"), "");
|
|
|
+ int count = baseDao.getCount("select count(1) from make where ma_code ='" + makeCode + "'");
|
|
|
+ if (count<=0){
|
|
|
+ return ApiResponse.failRsp("10094",requestId,"工单:"+makeCode+"在ERP不存在,请核对!");
|
|
|
+ }
|
|
|
+ Object[] data = baseDao.getFieldsDataByCondition("make", "ma_canmadeqty,ma_code,ma_qty,ma_madeqty,ma_tomadeqty",
|
|
|
+ "ma_code='" + makeCode + "'");
|
|
|
+ if (data!=null&&data.length>0) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("code",data[1]);
|
|
|
+ //备料齐套数量
|
|
|
+ map.put("canmadeqty",data[0]);
|
|
|
+ //工单数量
|
|
|
+ map.put("qty",data[2]);
|
|
|
+ //完工数量
|
|
|
+ map.put("madeqty",data[3]);
|
|
|
+ //已转完工数
|
|
|
+ map.put("tomadeqty",data[4]);
|
|
|
+ return ApiResponse.successRsp("0", "获取成功!",requestId, JSON.toJSONString(map));
|
|
|
+ }else {
|
|
|
+ return ApiResponse.failRsp("10095",requestId,"未找到数据!");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return ApiResponse.failRsp("10096",requestId,"参数异常!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private Map<String, JSONArray> getData(HttpServletRequest request){
|
|
|
Map<String, JSONArray> map = new HashMap<>();
|
|
|
try {
|