feat:印尼MDM、CRM接口上线

This commit is contained in:
2026-06-23 11:44:59 +08:00
parent ad3c6d6439
commit 29460f0e76
16 changed files with 290 additions and 117 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.b_lms.sch.tasks.slitter.util;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
@@ -12,10 +13,8 @@ import org.nl.modules.common.exception.BadRequestException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -28,8 +27,8 @@ public class SlitterTaskUtil {
/** B1区域 */
public final static String B1_AREA_CODE = "B1";
/** A1区域 */
public final static String A1_AREA_CODE = "A1";
/** B2区域 */
public final static String B2_AREA_CODE = "B2";
/**
* 组成纸管信息
* @param plan 对应的分切计划数组
@@ -73,6 +72,18 @@ public class SlitterTaskUtil {
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度*材质1纸管2FRP管
*/
public static String getComposePaperTubeInformation(String tubeDescription, String paperOrFrp) {
if (ObjectUtil.isEmpty(tubeDescription)) {
return "";
}
return getComposePaperTubeInformation(tubeDescription) + "*" + paperOrFrp;
}
/**
* 获取组成信息
* @param tubeDescription 纸管信息
* @return 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
*/
public static String getComposePaperTubeInformation(String tubeDescription) {
if (ObjectUtil.isEmpty(tubeDescription)) {
return "";
}
@@ -170,6 +181,10 @@ public class SlitterTaskUtil {
}
}
public static void main(String[] args) {
System.out.println(getComposePaperTubeInformation("FRP管玻璃纤维+环氧树脂Φ153mm*1700mm*15/20mm"));
}
/**
* 获取组成信息
* @param tubeDescription 纸管信息
@@ -238,30 +253,6 @@ public class SlitterTaskUtil {
return sb.toString();
}
public static void main(String[] args) {
System.out.println("【测试1】单壁厚:");
System.out.println("old: " + getComposePaperTubeInformationOld("纸制筒管|纸管|3.15英寸|1500", "1"));
System.out.println("new: " + getComposePaperTubeInformation("平包树脂管\\3.15''\\1500mm*15mm\\", "1"));
System.out.println("【测试2】阶梯1:");
System.out.println("old: " + getComposePaperTubeInformationOld("玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯", "1"));
System.out.println("new: " + getComposePaperTubeInformation("FRP管\\玻璃纤维+环氧树脂\\Φ152.4mm*1100mm*15/20mm\\", "1"));
// System.out.println(isNumeric(",3000"));
// System.out.println(isNumeric("3000"));
// System.out.println(isNumeric("3000.32"));
// System.out.println(isNumeric("-3000.32"));
// boolean b = checkComplete("1", "2", null); }
}
/**
* 判断字符串是否为数字(整数、小数、负数)
*/
public static boolean isNumeric(String str) {
if (str == null || str.isEmpty() || str.trim().isEmpty()) {
return false;
}
String s = str.trim();
return s.matches("-?\\d+(\\.\\d+)?");
}
/**
* 设置所需的套管纸管信息
* @param param 任务参数
@@ -352,8 +343,8 @@ public class SlitterTaskUtil {
return "0";
}
}
if (area.equals(A1_AREA_CODE)) {
if (num >= 1 && num <= 6) {
if (area.equals(B2_AREA_CODE)) {
if (num >= 1 && num <= 5) {
return "0";
}
}
@@ -492,6 +483,50 @@ public class SlitterTaskUtil {
return length;
}
/**
* 获取: 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
* @param plan
* @return
*/
public static String getTubeConvertInfo(PdmBiSlittingproductionplan plan) {
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
String paperStr = "";
if (plan.getPaper_tube_or_frp().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
paperStr = plan.getPaper_tube_model();
} else {
paperStr = plan.getFRP_model();
}
return getComposePaperTubeInformation(paperStr);
}
/**
* 获取纸管长度
* @param name 描述
* @return /
*/
public static String getPaperLengthByCode(String name) {
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致所以之前的取数组第三位的写法就存在问题现修改为根据不同的类型分别获取。 2026年05月19日 21:26
String length = "";
if(name.contains("FRP管")){
length = MdmDescriptionParseUtils.extractFRPLength( name);
}else{
String spec [] = MdmDescriptionParseUtils.extractPaperTubeSpecs(name);
length = spec[0];
}
return length;
}
/**
* 获取纸管长度
* @param name 描述
* @return /
*/
public static Integer getPaperLengthByCodeInt(String name) {
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
return Integer.valueOf(getPaperLengthByCode(name));
}
public static String getPaperSize(PdmBiSlittingproductionplan plan) {
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致所以之前的取数组第三位的写法就存在问题现修改为根据不同的类型分别获取。 2026年05月19日 21:26
@@ -642,19 +677,12 @@ public class SlitterTaskUtil {
// 如果有重复 key保留第一个按需调整
(existing, replacement) -> existing
));
Map<String, String> planMap2 = plans.stream()
.collect(Collectors.toMap(
p -> p.getContainer_name(),
p -> p.getLeft_or_right(),
// 如果有重复 key保留第一个按需调整
(existing, replacement) -> existing
));
// 2. 遍历 JSONArray
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject item = jsonArray.getJSONObject(i);
String containerName = item.getString("container_name");
String site = item.getString("site");
String left_or_right = item.getString("roll");
// 3. 检查 Plan 中是否存在对应的 container_name
if (!planMap.containsKey(containerName)) {
@@ -668,42 +696,142 @@ public class SlitterTaskUtil {
+ " 的上下轴位置"
+ "与MES分切计划中的上下轴位置" + expectedUpDown + "不一致!");
}
// 4. 比较 left_or_right 和 left_or_right 是否一致
String expectedLeftRight = planMap2.get(containerName);
if (!expectedLeftRight.equals(left_or_right)) {
throw new BadRequestException("校验失败: 子卷号 " + containerName
+ " 的左右卷位置"
+ "与MES分切计划中的左右卷位置" + expectedLeftRight + "不一致!");
}
}
log.info("分切下卷计划位置校验通过!");
}
/**
* 获取纸管长度
* @param name 描述
* @return /
* 判断管芯行家对接位是否有所需的管芯、并且数量是符合的。
* @param tubeCodes
* @param needTubes
* @param papers
* @return
*/
public static String getPaperLengthByCode(String name) {
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致所以之前的取数组第三位的写法就存在问题现修改为根据不同的类型分别获取。 2026年05月19日 21:26
String length = "";
if(name.contains("FRP管")){
length = MdmDescriptionParseUtils.extractFRPLength( name);
}else{
String spec [] = MdmDescriptionParseUtils.extractPaperTubeSpecs(name);
length = spec[0];
public static boolean containsAllTubes(List<String> tubeCodes, List<String> needTubes, List<MdPbPapervehicle> papers) {
Set<String> tubeSet = new HashSet<>(tubeCodes);
for (String tube : needTubes) {
if (!tubeSet.contains(tube)) {
return false;
}
}
return length;
int num = 0;
for (String needTube : needTubes) {
for (MdPbPapervehicle paper : papers) {
if (needTube.equals(paper.getMaterial_code())) {
num += paper.getQty().intValue();
}
}
if (num == 0) {
return false;
}
}
return true;
}
/**
* 获取纸管长度
* @param name 描述
* @return /
* 组成映射Map
* @param tubes
* @return
*/
public static Integer getPaperLengthByCodeInt(String name) {
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
return Integer.valueOf(getPaperLengthByCode(name));
public static Map<String, Integer> countTubes(List<String> tubes) {
if (tubes == null) {
return new HashMap<>();
}
return tubes.stream()
.filter(tube -> tube != null)
.collect(Collectors.toMap(
Function.identity(),
value -> 1,
Integer::sum
));
}
public static <T, U> List<U> mapList(Collection<T> from, Function<T, U> func) {
if (CollUtil.isEmpty(from)) {
return new ArrayList<>();
}
return from.stream().map(func).collect(Collectors.toList());
}
/**
* 转换List<String>
* @param obj
* @return
*/
public static List<String> objectToList(Object obj) {
// 安全转换为List<String>
List<String> errorList = new ArrayList<>();
if (obj instanceof List) {
for (Object item : (List<?>) obj) {
if (item instanceof String) {
errorList.add((String) item);
} else {
// 非字符串元素处理(按需调整)
errorList.add(item.toString());
}
}
} else if (obj != null) {
// 如果存储的不是List如JSON字符串需额外处理
throw new IllegalStateException("Expected List type from Redis, but got: " + obj.getClass());
}
return errorList;
}
/**
* 判断字符串是否为数字(整数、小数、负数)
*/
public static boolean isNumeric(String str) {
if (str == null || str.isEmpty() || str.trim().isEmpty()) {
return false;
}
String s = str.trim();
return s.matches("-?\\d+(\\.\\d+)?");
}
/**
* 单根轴的数据判断:根据指定的尺寸类型,校验左侧或右侧电流数据是否完整。
* 当 size 为 1 时,只需一侧数据完整即返回 true
* 当 size 为 2 时,要求左右两侧数据均完整才返回 true。
*
* @param param 包含相关字段的 JSON 对象,必须包含以下键:
* "currentLeft", "currentLeftSize", "currentLeftSpec",
* "currentRight", "currentRightSize", "currentRightSpec"
* @param size 校验模式大小,决定校验逻辑:
* - 1表示任一轴左或右数据完整即可逻辑或
* - 2表示左右两轴数据都必须完整逻辑与
* @return 符合校验规则时返回 true否则返回 false
*/
public static boolean singleShaftCheck(JSONObject param, int size) {
String currentLeft = param.getString("currentLeft");
String currentLeftSize = param.getString("currentLeftSize");
String currentLeftSpec = param.getString("currentLeftSpec");
String currentRight = param.getString("currentRight");
String currentRightSize = param.getString("currentRightSize");
String currentRightSpec = param.getString("currentRightSpec");
// 根据 size 值执行不同的校验策略1 表示任一轴有效即可2 表示双轴均需有效
switch (size) {
case 1:
return checkComplete(currentLeft, currentLeftSpec, currentLeftSize)
|| checkComplete(currentRight, currentRightSpec, currentRightSize);
case 2:
return checkComplete(currentLeft, currentLeftSpec, currentLeftSize)
&& checkComplete(currentRight, currentRightSpec, currentRightSize);
}
return false;
}
public static boolean checkComplete(String... checks) {
if (checks == null) {
return false;
}
for (String check : checks) {
if (ObjectUtil.isEmpty(check)) {
return false;
}
}
return true;
}
}

View File

@@ -323,7 +323,7 @@
AND
ios.bill_status = '99'
AND
ios.bill_type in ('1001','1009')
ios.bill_type in ('1001','1009','1013','1014','1015')
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
AND ios.stor_id IN
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">

View File

@@ -669,20 +669,20 @@ public class StructattrServiceImpl implements StructattrService {
} else {
// 截取第一个 - 之前的数据集合
List<JSONObject> attrList = WQL.getWO("QST_STRUCT_ATTR").addParam("flag", "2").process()
List<JSONObject> attrList = WQL.getWO("QST_STRUCT_ATTR").addParam("flag", "21").process()
.getResultJSONArray(0).toJavaList(JSONObject.class);
List<String> subStringList = attrList.stream()
.filter(row -> row.getString("struct_code").contains("-"))
.map(row -> row.getString("struct_code").substring(0, row.getString("struct_code").indexOf("-")))
.distinct()
.sorted()
.filter(row -> row.matches("-?\\d+(\\.\\d+)?"))
.collect(Collectors.toList());
prefix = String.valueOf(Integer.parseInt(subStringList.get(subStringList.size() - 1)) + 1);
List<String> collect = subStringList.stream().filter(a -> !a.equals("01"))
.sorted(Comparator.comparingInt(Integer::valueOf))
.collect(Collectors.toList());
prefix = String.valueOf(Integer.parseInt(collect.get(collect.size() - 1)) + 1);
}
/*
* 生成货位
*/
@@ -690,7 +690,7 @@ public class StructattrServiceImpl implements StructattrService {
for (int i = createNum_start; i <= createNum; i++) {
JSONObject json = new JSONObject();
json.put("struct_id", IdUtil.getSnowflake(1,1).nextId());
json.put("struct_id", org.nl.common.utils.IdUtil.getLongId());
if (i < 10) {
json.put("struct_code", prefix + "-"+"000"+i+"-01");
@@ -734,7 +734,7 @@ public class StructattrServiceImpl implements StructattrService {
// 新增点位
JSONObject jsonPoint = new JSONObject();
jsonPoint.put("point_id",IdUtil.getSnowflake(1,1).nextId());
jsonPoint.put("point_id", org.nl.common.utils.IdUtil.getLongId());
jsonPoint.put("point_code", json.getString("struct_code"));
jsonPoint.put("point_name", json.getString("struct_name"));
jsonPoint.put("region_id", json.getString("sect_id"));

View File

@@ -105,6 +105,20 @@
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "21"
QUERY
SELECT
struct.struct_code
FROM
st_ivt_structattr struct
LEFT JOIN st_ivt_sectattr sect ON sect.sect_id = struct.sect_id
WHERE
sect.sect_type_attr = '09'
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "3"
PAGEQUERY

View File

@@ -118,6 +118,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
} catch (Exception exception) {
result.put("TYPE", "E");
result.put("MESSAGE", "推送失败!" + exception.getMessage());
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + exception.getMessage());
log.info("getMaterialInfo的输出参数为------------------------" + result.toString());
return result;
}
@@ -215,6 +217,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
} catch (Exception exception) {
result.put("TYPE", "E");
result.put("MESSAGE", "推送失败!" + exception.getMessage());
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + exception.getMessage());
log.info("getReCutInfo的输出参数为------------------------" + result.toString());
return result;
}
@@ -250,6 +254,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
} catch (Exception exception) {
result.put("TYPE", "E");
result.put("MESSAGE", "推送失败!" + exception.getMessage());
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + exception.getMessage());
log.info("getUnPlanInfo的输出参数为------------------------" + result.toString());
return result;
}

View File

@@ -72,18 +72,18 @@ public class InchargeController {
return new ResponseEntity<>(HttpStatus.OK);
}
// @PostMapping("/charge")
// @Log("冲销")
// public ResponseEntity<Object> charge(@RequestBody JSONObject whereJson) {
// inchargeService.charge(whereJson);
// return new ResponseEntity<>(HttpStatus.OK);
// }
@PostMapping("/charge")
@Log("出库冲销 - 做出库")
public ResponseEntity<Object> inWriteOffCharge(@RequestBody StIvtIostorinv paramMap) {
inchargeService.inWriteOffCharge(paramMap);
return new ResponseEntity<>(HttpStatus.CREATED);
@Log("冲销")
public ResponseEntity<Object> charge(@RequestBody JSONObject whereJson) {
inchargeService.charge(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
// @PostMapping("/charge")
// @Log("出库冲销 - 做出库")
// public ResponseEntity<Object> inWriteOffCharge(@RequestBody StIvtIostorinv paramMap) {
// inchargeService.inWriteOffCharge(paramMap);
// return new ResponseEntity<>(HttpStatus.CREATED);
// }
}

View File

@@ -13,6 +13,8 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author Liuxy
* @date 2022-08-11
@@ -40,19 +42,19 @@ public class OutChargeController {
return new ResponseEntity<>(TableDataInfo.build(outChargeService.outWriteOffPageDatas(paramMap, page)), HttpStatus.OK);
}
// @PostMapping("/charge")
// @Log("冲销")
// //@PreAuthorize("@el.check('regionio:add')")
// public ResponseEntity<Object> charge(@RequestBody Map whereJson) {
// outChargeService.charge(whereJson);
// return new ResponseEntity<>(HttpStatus.CREATED);
// }
@PostMapping("/charge")
@Log("出库冲销 - 做入库")
public ResponseEntity<Object> outWriteOffCharge(@RequestBody StIvtIostorinv paramMap) {
outChargeService.outWriteOffCharge(paramMap);
@Log("冲销")
//@PreAuthorize("@el.check('regionio:add')")
public ResponseEntity<Object> charge(@RequestBody Map whereJson) {
outChargeService.charge(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
// @PostMapping("/charge")
// @Log("出库冲销 - 做入库")
// public ResponseEntity<Object> outWriteOffCharge(@RequestBody StIvtIostorinv paramMap) {
// outChargeService.outWriteOffCharge(paramMap);
// return new ResponseEntity<>(HttpStatus.CREATED);
// }
}

View File

@@ -258,7 +258,7 @@ public class InchargeServiceImpl implements InchargeService {
JSONObject jsonInMst = mstTab.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
JSONObject jsonOutMst = new JSONObject();
jsonOutMst.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonOutMst.put("iostorinv_id", org.nl.common.utils.IdUtil.getLongId());
jsonOutMst.put("bill_code", CodeUtil.getNewCode("IO_CODE"));
jsonOutMst.put("io_type", "1");
jsonOutMst.put("buss_type", "1009");
@@ -292,7 +292,7 @@ public class InchargeServiceImpl implements InchargeService {
for (int i = 0; i < inDtlArr.size(); i++) {
JSONObject json = inDtlArr.getJSONObject(i);
JSONObject jsonOutDtl = new JSONObject();
jsonOutDtl.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId());
jsonOutDtl.put("iostorinvdtl_id", org.nl.common.utils.IdUtil.getLongId());
jsonOutDtl.put("iostorinv_id", jsonOutMst.getLongValue("iostorinv_id"));
jsonOutDtl.put("seq_no", json.getIntValue("seq_no"));
jsonOutDtl.put("material_id", json.getLongValue("material_id"));
@@ -315,7 +315,7 @@ public class InchargeServiceImpl implements InchargeService {
for (int j = 0; j < inDisArr.size(); j++) {
JSONObject json2 = inDisArr.getJSONObject(j);
JSONObject jsonOutDis = new JSONObject();
jsonOutDis.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId());
jsonOutDis.put("iostorinvdis_id", org.nl.common.utils.IdUtil.getLongId());
jsonOutDis.put("iostorinv_id", jsonOutMst.getLongValue("iostorinv_id"));
jsonOutDis.put("iostorinvdtl_id", jsonOutDtl.getLongValue("iostorinvdtl_id"));
jsonOutDis.put("seq_no", json2.getIntValue("seq_no"));
@@ -357,6 +357,7 @@ public class InchargeServiceImpl implements InchargeService {
jsonIvt.put("bill_table", "ST_IVT_IOStorInv");
jsonIvt.put("change_qty", json2.getDoubleValue("real_qty"));
storPublicService.IOStor(jsonIvt, "11");
// 锁定仓位
JSONObject jsonAttr = attrTab.query("struct_id = '" + jsonIvt.getString("struct_id") + "'").uniqueResult(0);
jsonAttr.put("lock_type", "3");

View File

@@ -3,7 +3,6 @@ package org.nl.wms.st.inbill.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
@@ -24,6 +23,7 @@ import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
@@ -166,7 +166,7 @@ public class OutChargeServiceImpl implements OutChargeService {
JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").getResultJSONArray(0);
//生成手工入库单
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String iostorinv_id = org.nl.common.utils.IdUtil.getLongId() + "";
String bill_code = CodeUtil.getNewCode("IO_CODE");
whereJson.put("iostorinv_id", iostorinv_id);
whereJson.put("bill_code", bill_code);
@@ -199,7 +199,7 @@ public class OutChargeServiceImpl implements OutChargeService {
ArrayList<String> ivtList = new ArrayList<>(); // 存在库存的集合
for (int i = 0; i < dis_rows.size(); i++) {
//插入明细表
String iostorinvdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String iostorinvdtl_id = org.nl.common.utils.IdUtil.getLongId() + "";
JSONObject dis_row = dis_rows.getJSONObject(i);
// 校验是否存在库存
@@ -227,7 +227,7 @@ public class OutChargeServiceImpl implements OutChargeService {
//插入手工入库明细表
dtl_wql.insert(dis_row);
dis_row.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId());
dis_row.put("iostorinvdis_id", IdUtil.getLongId());
dis_row.put("seq_no", 1);
dis_row.put("sect_id", "");
dis_row.put("sect_code", "");

View File

@@ -27,6 +27,7 @@ import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.st.instor.service.ProductScrapService;
import org.nl.wms.st.outbill.service.CheckOutBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -49,6 +50,8 @@ public class ProductScrapServiceImpl implements ProductScrapService {
@Autowired
private ISysUserService iSysUserService;
@Autowired
private CheckOutBillService checkOutBillService;
@Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
@@ -218,7 +221,6 @@ public class ProductScrapServiceImpl implements ProductScrapService {
if(StrUtil.isEmpty(scrap_type)){
scrap_type = "1002";
}
// 查询所有明细
JSONArray dtlArr = dtl.query("scrap_id = '" + whereJson.getString("scrap_id") + "'").getResultJSONArray(0);
@@ -231,7 +233,11 @@ public class ProductScrapServiceImpl implements ProductScrapService {
List<JSONObject> ivtList = ivt.query("pcsn in ('" + pcsnJoining + "') and canuse_qty > 0")
.getResultJSONArray(0).toJavaList(JSONObject.class);
if (dtlArr.size() != ivtList.size()) {
Set<String> ivtSet = ivtList.stream().map(row -> row.getString("pcsn")).collect(Collectors.toSet());
String havePcsn = ivtSet.stream().collect(Collectors.joining("','"));
/*if (dtlArr.size() != ivtList.size()) {
throw new BadRequestException("库存异常请检查!");
}
@@ -241,7 +247,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
if (!is_pass) {
throw new BadRequestException("库存异常请检查!");
}
}*/
// 生成出库单
JSONObject jsonOutMst = new JSONObject();
@@ -260,6 +266,9 @@ public class ProductScrapServiceImpl implements ProductScrapService {
JSONArray tableData = new JSONArray();
for (int i = 0; i < dtlArr.size(); i++) {
JSONObject json = dtlArr.getJSONObject(i);
if (!ivtSet.contains(json.getString("pcsn"))) {
continue;
}
JSONObject jsonDtl = new JSONObject();
jsonDtl.put("pcsn", json.getString("pcsn"));
@@ -272,7 +281,17 @@ public class ProductScrapServiceImpl implements ProductScrapService {
}
// 调用出库新增并分配
jsonOutMst.put("tableData", tableData);
String iostorinv_id = checkOutBillService.insertDtl(jsonOutMst);
JSONObject jsonObject = new JSONObject();
jsonObject.put("iostorinv_id", iostorinv_id);
// 变更为手动分配
// checkOutBillService.allDiv(jsonObject);
if (StrUtil.isNotEmpty(havePcsn)) {
HashMap dtlMap = new HashMap();
dtlMap.put("is_audit", "1");
dtl.update(dtlMap, "scrap_id = '" + whereJson.getString("scrap_id") + "' AND pcsn in ('" + havePcsn + "')");
}
// 更新主表为完成
JSONObject param = new JSONObject();
param.put("bill_status", "99");
@@ -282,8 +301,8 @@ public class ProductScrapServiceImpl implements ProductScrapService {
mst.update(param, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
} catch (Exception e) {
JSONObject msg = new JSONObject();
msg.put("remark", "单据异常:"+e.getMessage());
mst.update(msg,"scrap_id = '" + whereJson.getString("scrap_id") + "'");
msg.put("remark", "单据异常:" + e.getMessage());
mst.update(msg, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
}

View File

@@ -43,9 +43,9 @@ spring:
reset-enable: false
filters:
DruidFilter,stat
url: jdbc:mysql://192.168.81.251:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://127.0.0.1:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: root
password: P@ssw0rd.
password: 123456
slave:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
@@ -84,9 +84,9 @@ spring:
reset-enable: false
filters:
DruidFilter,stat
url: jdbc:mysql://192.168.81.251:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://127.0.0.1:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: root
password: P@ssw0rd.
password: 123456
rules:
readwrite-splitting:
data-sources:

View File

@@ -49,6 +49,7 @@ var config = {
"mesErrorTitle": "MES Error"
},
"common": {
"charge_against":"charge against",
"select_scrap_type":"select scrap type",
"scrap_type":"scrap type",
"mdm_data_status":"mdm data status",

View File

@@ -48,6 +48,7 @@ var config = {
"load_text5": "Hanya dapat mengunggah satu file excel!"
},
"common": {
"charge_against":"Penutupan",
"select_scrap_type":"Silakan pilih jenis pembatalan",
"scrap_type":"Jenis pembatalan",
"mdm_data_status":"Status Data MDM",

View File

@@ -93,6 +93,7 @@ var config = {
"correspondingDeepLocationError": "对应的深货位错误!"
},
"common": {
"charge_against":"冲销",
"select_scrap_type":"请选择报废类型",
"scrap_type":"报废类型",
"mdm_data_status":"MDM数据状态",

View File

@@ -118,7 +118,7 @@
size="mini"
@click="charge"
>
冲销
{{ $t('common.charge_against') }}
</el-button>
</crudOperation>
<!--表格渲染-->

View File

@@ -115,12 +115,12 @@
<el-button
slot="right"
class="filter-item"
type="warning"
type="success"
icon="el-icon-check"
size="mini"
@click="charge"
>
{{ $t('status.force_completed') }}
{{ $t('common.charge_against') }}
</el-button>
</crudOperation>
<!--表格渲染-->