修改
This commit is contained in:
@@ -24,7 +24,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LmsToMesServiceImpl implements LmsToMesService {
|
public class LmsToMesServiceImpl implements LmsToMesService {
|
||||||
|
|
||||||
private static String is_connect_mes = "0";
|
private static String is_connect_mes = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LMS的PDA操作AGV下卷,AGV称重完成后AGV称重信息发送MES
|
* LMS的PDA操作AGV下卷,AGV称重完成后AGV称重信息发送MES
|
||||||
@@ -46,7 +46,11 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray list = new JSONArray();
|
String UserName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String Password = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
|
||||||
|
param.put("UserName",UserName);
|
||||||
|
param.put("Password",Password);
|
||||||
|
|
||||||
// String url = acsUrl + api;
|
// String url = acsUrl + api;
|
||||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
@@ -54,21 +58,19 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
url = url + api;
|
url = url + api;
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(list))
|
.body(String.valueOf(param))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("momRollFoilWeighing接口输出参数为:-------------------" + result.toString());
|
log.info("momRollFoilWeighing接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -104,16 +106,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("momRollBakeInBound接口输出参数为:-------------------" + result.toString());
|
log.info("momRollBakeInBound接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -149,16 +149,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("momRollBakeOutBound接口输出参数为:-------------------" + result.toString());
|
log.info("momRollBakeOutBound接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -195,15 +193,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("momRollSemiFGInboundComplete接口输出参数为:-------------------" + result.toString());
|
log.info("momRollSemiFGInboundComplete接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -246,16 +243,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------" + result.toString());
|
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -282,12 +277,19 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
String package_box_sn = param.getString("package_box_sn");
|
String package_box_sn = param.getString("package_box_sn");
|
||||||
String warehouse = param.getString("warehouse");
|
String warehouse = param.getString("warehouse");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("ContainerName",container_name);
|
jo.put("ContainerName",container_name);
|
||||||
jo.put("isSourceRollDeliveryComplete",1);
|
jo.put("isSourceRollDeliveryComplete",1);
|
||||||
jo.put("PackageBoxSN",package_box_sn);
|
jo.put("PackageBoxSN",package_box_sn);
|
||||||
jo.put("Warehouse",warehouse);
|
jo.put("Warehouse",warehouse);
|
||||||
|
|
||||||
|
String UserName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String Password = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
jo.put("UserName",UserName);
|
||||||
|
jo.put("Password",Password);
|
||||||
|
|
||||||
// String url = acsUrl + api;
|
// String url = acsUrl + api;
|
||||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
String api = "CamstarApi/CutPlanMomRollDeliveryComplete";
|
String api = "CamstarApi/CutPlanMomRollDeliveryComplete";
|
||||||
@@ -300,15 +302,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------" + result.toString());
|
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -352,15 +353,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("airSwellWithPaperTubeAssArrival接口输出参数为:-------------------" + result.toString());
|
log.info("airSwellWithPaperTubeAssArrival接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -392,27 +392,31 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
jo.put("iArrivalDate", DateUtil.now());
|
jo.put("iArrivalDate", DateUtil.now());
|
||||||
jo.put("iUser", User);
|
jo.put("iUser", User);
|
||||||
|
|
||||||
|
String UserName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String Password = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
jo.put("UserName",UserName);
|
||||||
|
jo.put("Password",Password);
|
||||||
|
|
||||||
// String url = acsUrl + api;
|
// String url = acsUrl + api;
|
||||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
String api = "CamstarApi/ChildRollFGInboundComplete";
|
String api = "CamstarApi/ChildRollFGInboundComplete";
|
||||||
url = url + api;
|
url = url + api;
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(param))
|
.body(String.valueOf(jo))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("childRollFGInboundComplete接口输出参数为:-------------------" + result.toString());
|
log.info("childRollFGInboundComplete接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -450,15 +454,14 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("childRollFGOutboundComplete接口输出参数为:-------------------" + result.toString());
|
log.info("childRollFGOutboundComplete接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if (RTYPE.equals("E")){
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
throw new BadRequestException(e.getMessage());
|
||||||
//ConnectException: Connection refused: connect
|
|
||||||
//网络不通
|
|
||||||
System.out.println(msg);
|
|
||||||
result.put("status", HttpStatus.BAD_REQUEST);
|
|
||||||
result.put("message", "网络不通,操作失败!");
|
|
||||||
result.put("data", new JSONObject());
|
|
||||||
log.info("网络不通,操作失败!");
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
result.put("RTOAL", 1);
|
result.put("RTOAL", 1);
|
||||||
result.put("RTDAT", null);
|
result.put("RTDAT", null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
result.put("RTYPE", "1");
|
result.put("RTYPE", "E");
|
||||||
result.put("RTMSG", "操作失败!" + e.getMessage());
|
result.put("RTMSG", "操作失败!" + e.getMessage());
|
||||||
result.put("RTOAL", 1);
|
result.put("RTOAL", 1);
|
||||||
result.put("RTDAT", null);
|
result.put("RTDAT", null);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public interface InAndOutReturnService {
|
|||||||
|
|
||||||
void upload(JSONObject whereJson);
|
void upload(JSONObject whereJson);
|
||||||
|
|
||||||
void uploadMES(Map whereJson);
|
void uploadMES(JSONObject whereJson);
|
||||||
|
|
||||||
void uploadSAP(JSONObject whereJson);
|
void uploadSAP(JSONObject whereJson);
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,153 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadMES(Map whereJson) {
|
public void uploadMES(JSONObject whereJson) {
|
||||||
|
{
|
||||||
|
//出库分配表
|
||||||
|
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||||
|
//出库明细表
|
||||||
|
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||||
|
//出库主表
|
||||||
|
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||||
|
// 物料表
|
||||||
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||||
|
// 库区表
|
||||||
|
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
|
// 子卷包装关系表
|
||||||
|
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||||
|
|
||||||
|
//根据出入单类型判断回传业务
|
||||||
|
//1、生产入库:回传MES;手工入库:回传SAP
|
||||||
|
//1、销售出库:回传MES、SAP;改切出库:回传SAP
|
||||||
|
JSONArray rows = whereJson.getJSONArray("rows");
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject jo_mst = rows.getJSONObject(i);
|
||||||
|
String isUpload = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_upload").getValue();
|
||||||
|
if (StrUtil.equals(isUpload, "1")) {
|
||||||
|
String bill_type = jo_mst.getString("bill_type");
|
||||||
|
//生产入库
|
||||||
|
if (StrUtil.equals(bill_type, "0001")) {
|
||||||
|
//1.回传MES
|
||||||
|
|
||||||
|
//查询该入库单下的所有箱子回传
|
||||||
|
JSONArray box_rows = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).addParam("flag","2").process().getResultJSONArray(0);
|
||||||
|
for (int j = 0; j < box_rows.size(); j++) {
|
||||||
|
JSONObject box_row = box_rows.getJSONObject(j);
|
||||||
|
// 调用接口回传
|
||||||
|
JSONObject paramMesMst = new JSONObject();
|
||||||
|
paramMesMst.put("PackageBoxSN",box_row.getString("box_no"));
|
||||||
|
paramMesMst.put("User",box_row.getString("confirm_optname"));
|
||||||
|
new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 销售出库
|
||||||
|
if (StrUtil.equals(bill_type, "1001")) {
|
||||||
|
// 1.回传sap
|
||||||
|
JSONArray paramSapMstArr = new JSONArray();
|
||||||
|
|
||||||
|
JSONObject paramSapMst = new JSONObject();
|
||||||
|
paramSapMst.put("ZACTION", "P");
|
||||||
|
paramSapMst.put("BUDAT", jo_mst.getString("biz_date"));
|
||||||
|
paramSapMst.put("ZZYGYF", jo_mst.getString("estimated_freight"));
|
||||||
|
paramSapMst.put("ZZYFGY", jo_mst.getString("trans_code"));
|
||||||
|
|
||||||
|
JSONArray paramDtlArr = new JSONArray();
|
||||||
|
JSONArray dtlArr = wo_dtl.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
|
||||||
|
for (int k = 0; k < dtlArr.size(); k++) {
|
||||||
|
JSONArray paramDisArr = new JSONArray();
|
||||||
|
JSONObject json = dtlArr.getJSONObject(k);
|
||||||
|
JSONObject jsonMater = materTab.query("material_id = '" + json.getString("material_id") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
// 明细
|
||||||
|
JSONObject jsonDtl = new JSONObject();
|
||||||
|
jsonDtl.put("VBELN", json.getString("vbeln")); // 交货
|
||||||
|
paramSapMst.put("VBELN", json.getString("vbeln")); // 主表交货
|
||||||
|
jsonDtl.put("POSNR", json.getString("posnr")); // 项目
|
||||||
|
jsonDtl.put("MATNR", jsonMater.getString("material_code"));
|
||||||
|
|
||||||
|
// 分配明细
|
||||||
|
JSONArray disArr = wo_dis.query("iostorinvdtl_id = '" + json.getString("iostorinvdtl_id") + "'").getResultJSONArray(0);
|
||||||
|
for (int j = 0; j < disArr.size(); j++) {
|
||||||
|
JSONObject json2 = disArr.getJSONObject(j);
|
||||||
|
JSONObject jsonDis = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject jsonSect = sectTab.query("sect_id = '" + json2.getString("sect_id") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
||||||
|
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
||||||
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
||||||
|
}
|
||||||
|
jsonDis.put("VBELN", json.getString("vbeln")); // 交货
|
||||||
|
jsonDis.put("POSNR", json.getString("posnr")); // 项目
|
||||||
|
jsonDis.put("LFIMG", json2.getString("real_qty"));
|
||||||
|
jsonDis.put("VRKME", json.getString("qty_unit_name"));
|
||||||
|
jsonDis.put("PIKMG", json2.getString("real_qty"));
|
||||||
|
jsonDis.put("VRKMP", json2.getString("qty_unit_name"));
|
||||||
|
paramDisArr.add(jsonDis);
|
||||||
|
}
|
||||||
|
jsonDtl.put("CHARG_T", paramDisArr);
|
||||||
|
paramDtlArr.add(jsonDtl);
|
||||||
|
}
|
||||||
|
paramSapMst.put("ITEM", paramDtlArr);
|
||||||
|
paramSapMstArr.add(paramSapMst);
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("HEAD", paramSapMstArr);
|
||||||
|
System.out.println(param.toString());
|
||||||
|
|
||||||
|
// 调用接口回传
|
||||||
|
// new LmsToSapServiceImpl().returnDelivery(param);
|
||||||
|
|
||||||
|
// 2.回传mes
|
||||||
|
JSONObject paramMesMst = new JSONObject();
|
||||||
|
String userName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String passWord = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
|
||||||
|
paramMesMst.put("UserName", userName);
|
||||||
|
paramMesMst.put("Password", passWord);
|
||||||
|
paramMesMst.put("OutboundOrderNum", jo_mst.getString("bill_code"));
|
||||||
|
paramMesMst.put("OutboundUser", jo_mst.getString("confirm_optname"));
|
||||||
|
paramMesMst.put("OutboundTime", jo_mst.getString("confirm_time"));
|
||||||
|
|
||||||
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
||||||
|
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
JSONArray paramArr = new JSONArray();
|
||||||
|
for (int j = 0; j < boxArr.size(); j++) {
|
||||||
|
JSONObject json = boxArr.getJSONObject(j);
|
||||||
|
JSONObject jsonBox = new JSONObject();
|
||||||
|
|
||||||
|
jsonBox.put("PackageBoxSN", json.getString("num"));
|
||||||
|
paramArr.add(jsonBox);
|
||||||
|
}
|
||||||
|
paramMesMst.put("item", paramArr);
|
||||||
|
|
||||||
|
// 调用接口回传
|
||||||
|
JSONObject jsonObject = new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 改切出库
|
||||||
|
if (StrUtil.equals(bill_type, "1003")) {
|
||||||
|
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
|
||||||
|
|
||||||
|
//调用母卷配送到位接口
|
||||||
|
JSONObject mes_jo = new JSONObject();
|
||||||
|
|
||||||
|
//查询该子卷对应的分切计划
|
||||||
|
//JSONArray cut_rows = WQLObject.getWQLObject("")
|
||||||
|
mes_jo.put("contain_name", disArr.getJSONObject(0).getString("pcsn"));
|
||||||
|
mes_jo.put("package_box_sn", disArr.getJSONObject(0).getString("box_no"));
|
||||||
|
mes_jo.put("warehouse", "3");
|
||||||
|
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -398,6 +544,16 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
|
|
||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||||
|
|
||||||
|
//调用母卷配送到位接口
|
||||||
|
JSONObject mes_jo = new JSONObject();
|
||||||
|
|
||||||
|
//查询该子卷对应的分切计划
|
||||||
|
//JSONArray cut_rows = WQLObject.getWQLObject("")
|
||||||
|
mes_jo.put("contain_name", disArr.getJSONObject(0).getString("pcsn"));
|
||||||
|
mes_jo.put("package_box_sn", disArr.getJSONObject(0).getString("box_no"));
|
||||||
|
mes_jo.put("warehouse", "3");
|
||||||
|
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export function uploadSAP(data) {
|
|||||||
|
|
||||||
export function uploadMES(data) {
|
export function uploadMES(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/inandoutreturn/uploadSAP',
|
url: '/api/inandoutreturn/uploadMES',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
debugger
|
debugger
|
||||||
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
|
crudSectattr.getSect({ 'is_productstore': '1' }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
const area_type = '1585164789083148288'
|
const area_type = '1585164789083148288'
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
|
||||||
this.storlist = res.content
|
this.storlist = res.content
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user