代码规范更新

This commit is contained in:
ludj
2023-12-13 13:13:24 +08:00
parent d7c8665c54
commit 074a6e78cd
4 changed files with 35 additions and 73 deletions

View File

@@ -20,8 +20,6 @@ import java.util.HashMap;
@RequiredArgsConstructor
@Slf4j
public class CrmToLmsServiceImpl implements CrmToLmsService {
@Override
public JSONObject getCustomerInfo(JSONObject row) {
@@ -194,11 +192,9 @@ public class CrmToLmsServiceImpl implements CrmToLmsService {
if (StrUtil.isNotEmpty(thickness_request)) {
map.put("thickness_request", thickness_request);
}
//将查询条件带入查询LMS成品库库存信息
JSONArray rows = WQL.getWO("QCRM_001").addParamMap(map).addParam("flag", "1").process().getResultJSONArray(0);
JSONObject result = new JSONObject();
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");

View File

@@ -9,17 +9,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -107,17 +103,17 @@ public class InbillServiceImpl {
dis_table.update(dis_row);
String pcsn = dis_row.getString("pcsn");
JSONObject sub_jo = sub_table.query("container_name = '"+pcsn+"' AND package_box_sn = '"+dis_row.getString("box_no")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)){
throw new BadRequestException("未查询到子卷号为:"+pcsn+"对应的包装关系!");
JSONObject sub_jo = sub_table.query("container_name = '" + pcsn + "' AND package_box_sn = '" + dis_row.getString("box_no") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到子卷号为:" + pcsn + "对应的包装关系!");
}
JSONObject mst_jo = mst_table.query("iostorinv_id = '" + dis_row.getString("iostorinv_id") + "'").uniqueResult(0);
sub_jo.put("bill_code",mst_jo.getString("bill_code"));
sub_jo.put("bill_id",mst_jo.getString("iostorinv_id"));
sub_jo.put("bill_type",mst_jo.getString("bill_type"));
sub_jo.put("io_type","0");
sub_jo.put("insert_time",DateUtil.now());
sub_jo.put("record_id",IdUtil.getSnowflake(1, 1).nextId());
sub_jo.put("bill_code", mst_jo.getString("bill_code"));
sub_jo.put("bill_id", mst_jo.getString("iostorinv_id"));
sub_jo.put("bill_type", mst_jo.getString("bill_type"));
sub_jo.put("io_type", "0");
sub_jo.put("insert_time", DateUtil.now());
sub_jo.put("record_id", IdUtil.getSnowflake(1, 1).nextId());
sub_record.insert(sub_jo);
//回写明细表实际数量
@@ -188,14 +184,14 @@ public class InbillServiceImpl {
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
storPublicService.IOStor(i_form, "33");
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_SN = '"+dis_row.getString("box_no")+"' AND container_name = '"+dis_row.getString("pcsn")+"' AND status = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)){
throw new BadRequestException("未查询到子卷号为:"+dis_row.getString("pcsn")+"对应状态为包装状态的包装关系,请分析数据!");
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_SN = '" + dis_row.getString("box_no") + "' AND container_name = '" + dis_row.getString("pcsn") + "' AND status = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(sub_jo)) {
throw new BadRequestException("未查询到子卷号为:" + dis_row.getString("pcsn") + "对应状态为包装状态的包装关系,请分析数据!");
}
//更新该子卷对应的包装关系为入库
HashMap<String,String> map = new HashMap<>();
map.put("status","2");
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(map,"package_box_SN = '"+dis_row.getString("box_no")+"' AND container_name = '"+dis_row.getString("pcsn")+"' AND status = '1'");
HashMap<String, String> map = new HashMap<>();
map.put("status", "2");
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(map, "package_box_SN = '" + dis_row.getString("box_no") + "' AND container_name = '" + dis_row.getString("pcsn") + "' AND status = '1'");
}
mst_jo.put("bill_status", "99");
@@ -220,17 +216,11 @@ public class InbillServiceImpl {
param.put("rows", rows);
try {
bean.uploadMES(param);
} catch (Exception e) {
System.out.println(e.getMessage());
log.info(e.getMessage());
} finally {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}
//回传SAP
}
}

View File

@@ -4730,7 +4730,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
try {
// 调用接口回传
System.out.println(paramMst.toString());
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
} catch (Exception e) {
throw new BadRequestException("回传sap失败"+e.getMessage());
@@ -4765,8 +4764,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
// 调用出库任务类下发任务
new OutTask().immediateNotifyAcs(jsonTask.getString("task_id"));
// List<AcsTaskDto> acsTaskDtos = new OutTask().addTask();
// System.out.println(acsTaskDtos.toString());
// 更新任务状态为下发
jsonTask.put("task_status", TaskStatusEnum.ISSUE.getCode());

View File

@@ -25,8 +25,6 @@ import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
import org.nl.wms.st.returns.service.InAndOutReturnService;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -39,8 +37,6 @@ import java.util.*;
@RequiredArgsConstructor
@Slf4j
public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
private final TransactionTemplate transactionTemplate;
private final ISysUserService iSysUserService;
@@ -235,9 +231,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
paramMesMst.put("iOutboundTime", DateUtil.now());
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
.process().getResultJSONArray(0);
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++) {
@@ -275,9 +269,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
paramMesMst.put("iOutboundTime", DateUtil.now());
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
.process().getResultJSONArray(0);
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++) {
@@ -421,7 +413,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", lgort); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -441,7 +433,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
// System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param);
@@ -494,7 +485,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -564,11 +555,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonSect = sectTab.query("sect_id = '" + json2.getString("sect_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) {
//jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
jsonDtl.put("LGORT", lgort); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -588,7 +578,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param);
@@ -626,7 +615,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '" + jsonDis.getString("iostorinv_id") + "'").uniqueResult(0);
paramDis.put("ZHL02", jsonSub.getString("width"));
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
@@ -636,7 +625,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
}
param.put("ITEM", paramSapMstArr);
//查询该调拨入库单对应的出库单
JSONObject out_mst = wo_mst.query("source_id = '"+jo_mst.getString("source_id")+"' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
JSONObject out_mst = wo_mst.query("source_id = '" + jo_mst.getString("source_id") + "' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
param.put("ZACTION", "P");
param.put("BUDAT", out_mst.getString("biz_date"));
param.put("ZZYGYF", out_mst.getString("estimated_freight"));
@@ -708,7 +697,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMst.put("T_ITEM", paramArr);
// 调用接口回传
System.out.println(paramMst.toString());
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
jo_mst.put("upload_sap", "1");
@@ -760,7 +748,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -829,12 +817,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
map.put("幅宽", json.getString("width_standard"));
map.put("仓位", json.getString("struct_code"));
if (ObjectUtil.isEmpty(json.getString("sale_order_name"))) {
throw new BadRequestException("子卷"+json.getString("pcsn")+"销售订单为空!");
throw new BadRequestException("子卷" + json.getString("pcsn") + "销售订单为空!");
}
try {
map.put("销售订单", json.getString("sale_order_name").substring(0, json.getString("sale_order_name").indexOf("-")));
map.put("行号", json.getString("sale_order_name").substring(json.getString("sale_order_name").indexOf("-")+1,json.getString("sale_order_name").length()));
map.put("行号", json.getString("sale_order_name").substring(json.getString("sale_order_name").indexOf("-") + 1, json.getString("sale_order_name").length()));
} catch (Exception e) {
map.put("销售订单", json.getString("sale_order_name"));
map.put("行号", "");
@@ -940,7 +928,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jo_mst.getString("remark")); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -960,8 +948,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
// System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param);
@@ -994,7 +980,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '" + jsonDis.getString("iostorinv_id") + "'").uniqueResult(0);
paramDis.put("ZHL02", jsonSub.getString("width"));
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
@@ -1003,10 +989,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramSapMstArr.add(paramDis);
}
param.put("ITEM", paramSapMstArr);
System.out.println(param.toString());
//查询该调拨入库单对应的出库单
JSONObject out_mst = wo_mst.query("source_id = '"+jo_mst.getString("source_id")+"' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
JSONObject out_mst = wo_mst.query("source_id = '" + jo_mst.getString("source_id") + "' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
param.put("ZACTION", "P");
param.put("BUDAT", out_mst.getString("biz_date"));
param.put("ZZYGYF", out_mst.getString("estimated_freight"));
@@ -1093,7 +1078,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -1189,11 +1174,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonSect = sectTab.query("sect_id = '" + json2.getString("sect_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) {
//jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
jsonDtl.put("LGORT", lgort); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
@@ -1213,7 +1197,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnDelivery(param);
@@ -1234,9 +1217,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
paramMesMst.put("iOutboundTime", DateUtil.now());
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
.process().getResultJSONArray(0);
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++) {
@@ -1326,9 +1307,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
paramMesMst.put("iOutboundTime", DateUtil.now());
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
.process().getResultJSONArray(0);
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++) {
@@ -1460,7 +1439,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}