Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -280,10 +280,12 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("ContainerName",container_name);
|
||||
jo.put("isSourceRollDeliveryComplete",1);
|
||||
jo.put("PackageBoxSN",package_box_sn);
|
||||
jo.put("Warehouse",warehouse);
|
||||
jo.put("iContainerName",container_name);
|
||||
jo.put("iisSourceRollDeliveryComplete",1);
|
||||
jo.put("iPackageBoxSN",package_box_sn);
|
||||
jo.put("iWarehouse",warehouse);
|
||||
jo.put("iisAirSwellAssComplete","");
|
||||
jo.put("iisAirSwellDeliveryComplete","");
|
||||
|
||||
String UserName = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
|
||||
@@ -456,6 +456,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
try {
|
||||
String is_mesTolms = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_mesTolms").getValue();
|
||||
if (StrUtil.equals(is_mesTolms, "1")) {
|
||||
String Attribute1 = param.getString("Attribute1");
|
||||
if (Attribute1.equals("0")){
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
System.out.println(result);
|
||||
return result;
|
||||
}
|
||||
String container_name = param.getString("ContainerName");
|
||||
if (StrUtil.isEmpty(container_name)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
@@ -579,6 +588,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("plan_qty", sub_jo.getString("net_weight"));
|
||||
dtl.put("source_billdtl_id",plan_jo.getString("workorder_id"));
|
||||
rows.add(dtl);
|
||||
mst_jo.put("tableData", rows);
|
||||
mst_jo.put("user", "mes");
|
||||
@@ -787,14 +797,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
// String is_mesTolms = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_mesTolms").getValue();
|
||||
// if (StrUtil.equals(is_mesTolms, "1")) {
|
||||
try {
|
||||
JSONArray rows = param.getJSONArray("item");
|
||||
JSONArray rows = param.getJSONArray("details");
|
||||
String SaleOrderItem = param.getString("SaleOrderItem");
|
||||
String CustomerName = param.getString("CustomerName");
|
||||
String DemandDate = param.getString("DemandDate");
|
||||
double total_qty = 0;
|
||||
double detail_count = 0;
|
||||
String changeinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
if (rows.size() == 0) {
|
||||
if (ObjectUtil.isEmpty(rows) || rows.size() == 0) {
|
||||
throw new BadRequestException("item长度不能为0!");
|
||||
}
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
|
||||
@@ -120,7 +120,7 @@ public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
url = url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url).header("TOKEN","877734686FA61EDD99E9D85A96D91E14")
|
||||
.header("sap-client","800")
|
||||
.header("sap-client","130")
|
||||
.body(String.valueOf(jo))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
|
||||
@@ -10,7 +10,9 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -175,7 +177,19 @@ public class InbillServiceImpl {
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
|
||||
//回传MES
|
||||
|
||||
if (StrUtil.equals(mst_jo.getString("bill_type"), "0001")) {
|
||||
//1.回传MES
|
||||
//查询该入库单下的所有箱子回传
|
||||
JSONArray box_rows = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("iostorinv_id",mst_jo.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);
|
||||
}
|
||||
}
|
||||
//回传SAP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,8 +455,21 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
if (ObjectUtil.isNotEmpty(checked) && checked) {
|
||||
JSONObject jo_form = new JSONObject();
|
||||
jo_form.put("box_no", map.get("box_no"));
|
||||
jo_form.put("sect_id", "1582991348217286656");
|
||||
JSONObject struct_jo = this.autoDis(jo_form);
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
if (whereJson.containsKey("sect_id")){
|
||||
String need_sect = (String) whereJson.get("sect_id");
|
||||
if (StrUtil.isNotEmpty(need_sect)){
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("sect_id = '"+need_sect+"' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0);
|
||||
}else {
|
||||
jo_form.put("sect_id", "1582991348217286656");
|
||||
this.autoDis(jo_form);
|
||||
}
|
||||
}else {
|
||||
jo_form.put("sect_id", "1582991348217286656");
|
||||
this.autoDis(jo_form);
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||
throw new BadRequestException("未查询到适用仓位!");
|
||||
}
|
||||
|
||||
@@ -2161,7 +2161,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
//查询该子卷对应的分切计划
|
||||
//JSONArray cut_rows = WQLObject.getWQLObject("")
|
||||
mes_jo.put("contain_name", disArr.getJSONObject(0).getString("pcsn"));
|
||||
JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '"+iostorinv_id+"' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0);
|
||||
mes_jo.put("container_name", source_dtl.getString("pcsn"));
|
||||
mes_jo.put("package_box_sn", disArr.getJSONObject(0).getString("box_no"));
|
||||
mes_jo.put("warehouse", "3");
|
||||
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||
|
||||
@@ -65,13 +65,13 @@
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
count(dis.struct_id) AS num
|
||||
SELECT DISTINCT
|
||||
box_no
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
WHERE
|
||||
1 = 1
|
||||
group by dis.struct_id
|
||||
|
||||
|
||||
OPTION 输入.iostorinv_id <> ""
|
||||
dis.iostorinv_id = 输入.iostorinv_id
|
||||
|
||||
@@ -164,9 +164,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
|
||||
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"));
|
||||
paramMesMst.put("iOutboundOrderNum", jo_mst.getString("bill_code"));
|
||||
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
||||
paramMesMst.put("iOutboundTime", jo_mst.getString("confirm_time"));
|
||||
|
||||
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
||||
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
||||
@@ -177,7 +177,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
JSONObject json = boxArr.getJSONObject(j);
|
||||
JSONObject jsonBox = new JSONObject();
|
||||
|
||||
jsonBox.put("PackageBoxSN", json.getString("num"));
|
||||
jsonBox.put("PackageBoxSN", json.getString("box_no"));
|
||||
paramArr.add(jsonBox);
|
||||
}
|
||||
paramMesMst.put("item", paramArr);
|
||||
@@ -195,8 +195,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
|
||||
//查询该子卷对应的分切计划
|
||||
//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"));
|
||||
JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '"+jo_mst.getString("iostorinv_id")+"' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0);
|
||||
mes_jo.put("container_name", source_dtl.getString("pcsn"));
|
||||
mes_jo.put("package_box_sn", source_dtl.getString("box_no"));
|
||||
mes_jo.put("warehouse", "3");
|
||||
new LmsToMesServiceImpl().cutPlanMomRollDeliveryComplete(mes_jo);
|
||||
}
|
||||
@@ -285,6 +286,60 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
// 调用接口回传
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
}
|
||||
|
||||
// 改切出库
|
||||
if (StrUtil.equals(bill_type, "1003")) {
|
||||
JSONObject paramMst = new JSONObject();
|
||||
JSONArray paramArr = new JSONArray();
|
||||
|
||||
// 去除日期中的横杠、冒号、空格
|
||||
String biz_date = jo_mst.getString("biz_date");
|
||||
String response = biz_date.replaceAll("[[\\s-:punct:]]", "");
|
||||
|
||||
paramMst.put("BLDAT", response); // 去掉-
|
||||
paramMst.put("BUDAT", response); // 去掉-
|
||||
paramMst.put("BKTXT", jo_mst.getString("bill_code")); // 凭证抬头文本: 出库主表单据号
|
||||
paramMst.put("XBLNR", jo_mst.getString("input_optname")); // 参考:出库单创建人name
|
||||
|
||||
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
|
||||
for (int j = 0; j < disArr.size(); j++) {
|
||||
JSONObject json = disArr.getJSONObject(i);
|
||||
JSONObject jsonMater = materTab.query("material_id = '" + json.getString("material_id") + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("RSPOS", j + 1);
|
||||
jsonDtl.put("MATNR", jsonMater.getString("material_code"));
|
||||
jsonDtl.put("BWART", "311");
|
||||
jsonDtl.put("MENGE", json.getDoubleValue("real_qty"));
|
||||
jsonDtl.put("MEINS", json.getString("qty_unit_name"));
|
||||
jsonDtl.put("WERKS", "2460");
|
||||
|
||||
JSONObject jsonSect = sectTab.query("sect_id = '" + json.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
||||
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 库存地点:库区外部标识
|
||||
}
|
||||
|
||||
JSONObject jsonSub = subTab.query("container_name = '" + json.getString("pcsn") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
||||
String sale_order_name = jsonSub.getString("sale_order_name");
|
||||
|
||||
// 销售订单:子卷包装关系 - 前内容
|
||||
jsonDtl.put("KDAUF", sale_order_name.substring(0, sale_order_name.indexOf("-")));
|
||||
// 销售订单行项目:子卷包装关系 - 后内容
|
||||
jsonDtl.put("KDPOS", sale_order_name.substring(sale_order_name.indexOf("-") + 1, sale_order_name.length()));
|
||||
}
|
||||
|
||||
jsonDtl.put("CHARG", json.getString("pcsn"));
|
||||
jsonDtl.put("UMLGO", "AB01"); // 收货库存地点:线边库外部标识
|
||||
jsonDtl.put("UMCHA", json.getString("pcsn"));
|
||||
paramArr.add(jsonDtl);
|
||||
}
|
||||
paramMst.put("T_ITEM", paramArr);
|
||||
|
||||
// 调用接口回传
|
||||
System.out.println(paramMst.toString());
|
||||
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -413,7 +468,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
JSONObject json = boxArr.getJSONObject(j);
|
||||
JSONObject jsonBox = new JSONObject();
|
||||
|
||||
jsonBox.put("PackageBoxSN", json.getString("num"));
|
||||
jsonBox.put("PackageBoxSN", json.getString("box_no"));
|
||||
paramArr.add(jsonBox);
|
||||
}
|
||||
paramMesMst.put("item", paramArr);
|
||||
@@ -489,9 +544,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
|
||||
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"));
|
||||
paramMesMst.put("iOutboundOrderNum", jo_mst.getString("bill_code"));
|
||||
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
||||
paramMesMst.put("iOutboundTime", jo_mst.getString("confirm_time"));
|
||||
|
||||
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
||||
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
||||
@@ -502,7 +557,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
JSONObject json = boxArr.getJSONObject(j);
|
||||
JSONObject jsonBox = new JSONObject();
|
||||
|
||||
jsonBox.put("PackageBoxSN", json.getString("num"));
|
||||
jsonBox.put("iPackageBoxSN", json.getString("box_no"));
|
||||
paramArr.add(jsonBox);
|
||||
}
|
||||
paramMesMst.put("item", paramArr);
|
||||
|
||||
Reference in New Issue
Block a user