fix:MDM上线引起的部分问题修改
This commit is contained in:
@@ -193,10 +193,10 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘信息不能为空!");
|
||||
}
|
||||
if(!vehicle_code.contains("GX")){
|
||||
if (!vehicle_code.contains("GX")) {
|
||||
throw new BadRequestException("请扫描或输入正确的托盘码!");
|
||||
}
|
||||
if(now_qty<=0 || now_qty>5){
|
||||
if (now_qty <= 0 || now_qty > 5) {
|
||||
throw new BadRequestException("数量只允许输入1-5");
|
||||
}
|
||||
//
|
||||
@@ -213,11 +213,12 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
//获取当前纸管的高度
|
||||
// 解析描述数组
|
||||
|
||||
// String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] tubeArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(material_name);
|
||||
int currLength = Integer.parseInt(tubeArray[0]);
|
||||
// String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
// todo 88549333/zhouz 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
// String[] tubeArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(material_name);
|
||||
// int currLength = Integer.parseInt(tubeArray[1]);
|
||||
int currLength = SlitterTaskUtil.getPaperLengthByCodeInt(material_name);
|
||||
//校验高度差要大于50MM,否则不允许进行绑定
|
||||
int num = Integer.parseInt(row_num);
|
||||
if (num == 1) {
|
||||
@@ -230,9 +231,8 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
// String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] nextArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(nextMaterialName);
|
||||
int nextLength = Integer.parseInt(nextArray[0]);
|
||||
// todo 88549333/zhouz 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
int nextLength = SlitterTaskUtil.getPaperLengthByCodeInt(nextMaterialName);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
@@ -247,9 +247,9 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
// String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] nextArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(nextMaterialName);
|
||||
int nextLength = Integer.parseInt(nextArray[0]);
|
||||
// todo 88549333/zhouz 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
//String[] nextArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(nextMaterialName);
|
||||
int nextLength = SlitterTaskUtil.getPaperLengthByCodeInt(nextMaterialName);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
@@ -265,8 +265,8 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
// String[] preArray = preMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
// int preLength = Integer.parseInt(preArray[preArray.length - 1]);
|
||||
// todo 88549333 2026年5月19日19:55:53 这个地方获取纸管高度,会不会有FRP 管相关操作 需要进一步确认,因为两个类型的物料描述差异导致获取高度的方法不一致
|
||||
String[] preArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(preMaterialName);
|
||||
int preLength = Integer.parseInt(preArray[0]);
|
||||
//String[] preArray = MdmDescriptionParseUtils.extractPaperTubeSpecs(preMaterialName);
|
||||
int preLength = SlitterTaskUtil.getPaperLengthByCodeInt(preMaterialName);
|
||||
if (Math.abs(preLength - currLength) <= 50 && !material_code.equals(prePaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
@@ -389,6 +389,7 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
public List<BhTubePointDto> getNeedPaperTubePoint(String pointType, String tube, String location) {
|
||||
return bstIvtStockingivtMapper.getNeedPaperTubePoint(pointType, tube, location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BhTubePointDto> getNeedPaperTubesPoint(String pointType, List<String> tubes, String location) {
|
||||
return bstIvtStockingivtMapper.getNeedPaperTubesPoint(pointType, tubes, location);
|
||||
@@ -458,11 +459,12 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
.orderByAsc(MdPbPapervehicle::getRow_num));
|
||||
return papers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdmBiOrderbominfo showBom2(Map param){
|
||||
String mfg_order_name = String.valueOf(param.get("mfg_order_name"));
|
||||
public PdmBiOrderbominfo showBom2(Map param) {
|
||||
String mfg_order_name = String.valueOf(param.get("mfg_order_name"));
|
||||
LambdaQueryWrapper<PdmBiOrderbominfo> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(PdmBiOrderbominfo::getMfgOrder,mfg_order_name);
|
||||
lam.eq(PdmBiOrderbominfo::getMfgOrder, mfg_order_name);
|
||||
PdmBiOrderbominfo order = pdmBiOrderbominfoService.getOne(lam);
|
||||
return order;
|
||||
}
|
||||
|
||||
@@ -3159,9 +3159,15 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("计划未找到,请确保MES已推送。");
|
||||
}
|
||||
JSONObject tube = new JSONObject();
|
||||
String[] split = SlitterTaskUtil.getTubeConvertInfo(plan).split("\\*");
|
||||
tube.put("bh", split[3]);
|
||||
tube.put("length", SlitterTaskUtil.getPaperLength(plan));
|
||||
String paper_model = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paper_model = plan.getPaper_tube_model();
|
||||
} else {
|
||||
paper_model = plan.getFRP_model();
|
||||
}
|
||||
String[] split = MdmDescriptionParseUtils.extractCommonTubeInfo(paper_model);
|
||||
tube.put("bh", split[1]);
|
||||
tube.put("length", split[0]);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("data", tube);
|
||||
|
||||
@@ -4,6 +4,9 @@ package org.nl.b_lms.sch.tasks.slitter.util;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author ManMan.Yang
|
||||
@@ -27,14 +30,16 @@ public class MdmDescriptionParseUtils {
|
||||
// ==================================================
|
||||
//====通用公共方法 用来解析纸管或者frp管尺寸 ==============
|
||||
//===================================================
|
||||
|
||||
/**
|
||||
* 智能提取管件尺寸(自动识别纸管或FRP管)
|
||||
*
|
||||
* @param tubeModel 管件型号描述
|
||||
* - 纸管示例: 平包树脂管\3''\500mm*15mm\
|
||||
* - FRP管示例: FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 尺寸字符串(英寸)
|
||||
* - 纸管返回: "3.0"
|
||||
* - FRP管返回: "6.0" (152.4mm / 25.4)
|
||||
* - 纸管返回: "3.0"
|
||||
* - FRP管返回: "6.0" (152.4mm / 25.4)
|
||||
*/
|
||||
public static String extractCommonTubeSize(String tubeModel) {
|
||||
if (ObjectUtil.isEmpty(tubeModel)) {
|
||||
@@ -56,12 +61,49 @@ public class MdmDescriptionParseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能提取管件壁厚*长度(自动识别纸管或FRP管)
|
||||
*
|
||||
* @param tubeModel 管件型号描述
|
||||
* - 纸管示例: 平包树脂管\3''\500mm*15mm\
|
||||
* - FRP管示例: FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 尺寸字符串(英寸)
|
||||
* - 纸管返回: "3.0"
|
||||
* - FRP管返回: "6.0" (152.4mm / 25.4)
|
||||
*/
|
||||
public static String[] extractCommonTubeInfo(String tubeModel) {
|
||||
if (ObjectUtil.isEmpty(tubeModel)) {
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
try {
|
||||
// 判断是纸管还是FRP管
|
||||
if (tubeModel.contains("FRP")) {
|
||||
// FRP管:转换为英寸
|
||||
String[] a = Arrays.stream(parseFRPSizeInfo(tubeModel)).skip(1).toArray(String[]::new);
|
||||
return a;
|
||||
} else {
|
||||
// 纸管:直接提取英寸值
|
||||
String[] a = extractPaperTubeSpecs(tubeModel);
|
||||
return a;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("智能提取管件尺寸失败: {}", tubeModel, e);
|
||||
return new String[]{};
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(extractCommonTubeInfo("平包树脂管\\6''\\610mm*15mm\\"));
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
//==================== FRP管解析方法 ===================
|
||||
//===================================================
|
||||
|
||||
/**
|
||||
* 解析尺寸字符串,提取外径、长度、壁厚
|
||||
*
|
||||
* @param sizeInfo 尺寸信息,如 Φ152.4mm*1100mm*15/20mm
|
||||
* @return String数组 [外径, 长度, 壁厚],如 ["152.4", "1100", "15/20"]
|
||||
*/
|
||||
@@ -91,6 +133,7 @@ public class MdmDescriptionParseUtils {
|
||||
|
||||
/**
|
||||
* 清理尺寸值中的特殊字符
|
||||
*
|
||||
* @param value 原始值,如 Φ152.4mm、1100mm、15/20mm
|
||||
* @return 清理后的纯数值,如 152.4、1100、15/20
|
||||
*/
|
||||
@@ -105,10 +148,13 @@ public class MdmDescriptionParseUtils {
|
||||
.replace("mm", "")
|
||||
.replace("MM", "")
|
||||
.replace("''", "")
|
||||
.replace("\\","")
|
||||
.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取长度(mm)
|
||||
*
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 长度字符串,如 "1100"
|
||||
*/
|
||||
@@ -126,8 +172,29 @@ public class MdmDescriptionParseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从纸管管型号中提取长度(mm)
|
||||
*
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 长度字符串,如 "1100"
|
||||
*/
|
||||
public static String extractPaperLength(String frpModel) {
|
||||
if (ObjectUtil.isEmpty(frpModel)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
try {
|
||||
String[] sizeParams = extractPaperTubeSpecs(frpModel);
|
||||
return sizeParams[0]; // 返回长度
|
||||
} catch (Exception e) {
|
||||
log.warn("提取FRP管长度失败: {}", frpModel, e);
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取壁厚
|
||||
*
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 壁厚字符串,单壁厚如 "15",双壁厚如 "15/20"
|
||||
*/
|
||||
@@ -147,6 +214,7 @@ public class MdmDescriptionParseUtils {
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取外径(mm)
|
||||
*
|
||||
* @param frpModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 外径字符串,如 "152.4"
|
||||
*/
|
||||
@@ -166,6 +234,7 @@ public class MdmDescriptionParseUtils {
|
||||
|
||||
/**
|
||||
* 从 FRP 管型号中提取外径(mm)
|
||||
*
|
||||
* @param tubeModel FRP管型号描述,如 FRP管\玻璃纤维+环氧树脂\Φ152.4mm*1100mm*15/20mm\
|
||||
* @return 外径字符串,如 "152.4 / 25.4 = 6"
|
||||
*/
|
||||
@@ -189,7 +258,7 @@ public class MdmDescriptionParseUtils {
|
||||
double diameterMm = Double.parseDouble(externalDiameter);
|
||||
double diameterInch = diameterMm / 25.4;
|
||||
// 保留整数或一位小数
|
||||
return String.valueOf(NumberUtil.round(diameterInch, 1).doubleValue());
|
||||
return String.valueOf(NumberUtil.round(diameterInch, 0));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -202,8 +271,10 @@ public class MdmDescriptionParseUtils {
|
||||
// ==================================================
|
||||
//==================== 纸管解析方法 ===================
|
||||
//===================================================
|
||||
|
||||
/**
|
||||
* 从纸管型号中提取尺寸(英寸)
|
||||
*
|
||||
* @param paperTubeModel 纸管型号描述,如 平包树脂管\3''\500mm*15mm\
|
||||
* @return 英寸数值字符串,如 "3"
|
||||
*/
|
||||
@@ -221,11 +292,12 @@ public class MdmDescriptionParseUtils {
|
||||
// 第二部分是尺寸:3''
|
||||
String sizePart = parts[1];
|
||||
// 移除 '' 符号
|
||||
String cleaned =cleanSizeValue(sizePart);
|
||||
String cleaned = cleanSizeValue(sizePart);
|
||||
double num = Double.parseDouble(cleaned);
|
||||
// 四舍五入取整数
|
||||
long rounded = Math.round(num);
|
||||
return rounded + ".0";
|
||||
return rounded + "";
|
||||
//return rounded + ".0";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("提取纸管尺寸失败: {}", paperTubeModel, e);
|
||||
@@ -236,6 +308,7 @@ public class MdmDescriptionParseUtils {
|
||||
|
||||
/**
|
||||
* 从纸管型号中提取长度和壁厚
|
||||
*
|
||||
* @param paperTubeModel 纸管型号描述,如 平包树脂管\3''\500mm*15mm\
|
||||
* @return String数组 [长度, 壁厚],如 ["500", "15"]
|
||||
*/
|
||||
@@ -270,11 +343,26 @@ public class MdmDescriptionParseUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Integer getPaperLength(String paperName) {
|
||||
//判断物料属于FPR管还是纸管
|
||||
try {
|
||||
if (paperName.contains("FRP")) {
|
||||
return Integer.parseInt(extractFRPLength(paperName));
|
||||
} else {
|
||||
return Integer.parseInt(extractPaperLength(paperName));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("物料描述转换有问题!【" + paperName + "】");
|
||||
}
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
//==================== 木箱解析方法 ===================
|
||||
//===================================================
|
||||
|
||||
/**
|
||||
* 从木箱型号中提取关键信息
|
||||
*
|
||||
* @param woodenBoxModel 木箱型号描述,如 铜箔木箱\1100/1/6\1148mm*636mm*690mm\非熏蒸\U60
|
||||
* @return String数组 [数量/层数/其他],如 ["1100", "1", "6"]
|
||||
*/
|
||||
@@ -317,4 +405,4 @@ public class MdmDescriptionParseUtils {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +181,10 @@ public class SlitterTaskUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getComposePaperTubeInformation("FRP管玻璃纤维+环氧树脂Φ153mm*1700mm*15/20mm"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组成信息
|
||||
* @param tubeDescription 纸管信息
|
||||
@@ -249,20 +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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所需的套管纸管信息
|
||||
* @param param 任务参数
|
||||
@@ -535,6 +525,8 @@ public class SlitterTaskUtil {
|
||||
// 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
|
||||
|
||||
@@ -102,9 +102,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
// 截取子卷号
|
||||
String description = whereJson.getString("Description");
|
||||
try {
|
||||
String one = description.substring(description.indexOf("|") + 1);
|
||||
String two = one.substring(one.indexOf("|") + 1);
|
||||
String num = two.substring(two.indexOf("|") + 1, two.indexOf("|") + 2);
|
||||
String num = getTargetNumber(description);
|
||||
boxDao.setNum(num);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("截取失败,请检查mes数据!");
|
||||
@@ -137,6 +135,27 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
|
||||
return boxDao;
|
||||
}
|
||||
|
||||
public static String getTargetNumber(String line) {
|
||||
// 1. 先按 \ 分割,拿到第二段:1200/1/6
|
||||
String[] splitByBackslash = line.split("\\\\");
|
||||
if (splitByBackslash.length < 2) {
|
||||
throw new BadRequestException("物料描述有问题!");
|
||||
}
|
||||
|
||||
// 2. 再按 / 分割,拿到第二个值(索引1)
|
||||
String[] splitBySlash = splitByBackslash[1].split("/");
|
||||
if (splitBySlash.length >= 2) {
|
||||
return splitBySlash[1]; // 第二个位置,就是你要的数字
|
||||
}
|
||||
|
||||
throw new BadRequestException("物料描述有问题!");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getTargetNumber("铜箔木箱\\810/3/3\\1294mm*880mm*530mm\\非熏蒸\\U30"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject saveBoxInfo(JSONObject jsonObject) {
|
||||
//从MES获取包装关系
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -43,6 +44,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -143,10 +145,14 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
double unassign_qty = dtlDao.getUnassign_qty().doubleValue();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dtlDao.getSource_bill_code())) {
|
||||
Predicate<JSONObject> condition = row ->
|
||||
row.getString("material_id").equals(dtlDao.getMaterial_id().toString())
|
||||
&& row.getString("sale_order_name").equals(dtlDao.getSource_bill_code())
|
||||
&& (ObjectUtil.isEmpty(dtlDao.getPcsn())
|
||||
|| row.getString("pcsn").equals(dtlDao.getPcsn()));
|
||||
// 有订单号: 找相同物料、订单号的库存,并根据仓位分组、即木箱分组
|
||||
Map<String, List<JSONObject>> likeMaterOrderMap = ivtList.stream()
|
||||
.filter(row -> row.getString("material_id").equals(dtlDao.getMaterial_id().toString()) &&
|
||||
row.getString("sale_order_name").equals(dtlDao.getSource_bill_code()))
|
||||
.filter(condition)
|
||||
.collect(Collectors.groupingBy(row -> row.getString("struct_code")));
|
||||
|
||||
if (ObjectUtil.isEmpty(likeMaterOrderMap)) {
|
||||
|
||||
@@ -39,17 +39,17 @@ public class JobRunner implements ApplicationRunner {
|
||||
System.out.println("本机ip:"+localIp);
|
||||
|
||||
log.info("--------------------注入定时任务---------------------");
|
||||
// List<SysQuartzJob> quartzJobs = quartzJobService.findByIsPauseIsFalse();
|
||||
// quartzJobs.forEach(job -> {
|
||||
// if (judgmentIp(job.getJob_ip())) {
|
||||
// log.info("定时任务:{}, 执行ip: {}, 定时任务开启", job.getJob_name(), localIp);
|
||||
// System.out.println("定时任务: " + job.getJob_name() + ", 执行ip: " + localIp + ", 定时任务开启");
|
||||
// quartzManage.addJob(job);
|
||||
// } else {
|
||||
// log.info("定时任务 {} 未开启, 本机ip{} 与 调度ip{} 不同", job.getJob_name(), localIp, job.getJob_ip());
|
||||
// System.out.println("定时任务 " + job.getJob_name() + " 未开启, 本机ip: " + localIp + " 与 调度ip: " + job.getJob_ip() + " 不同");
|
||||
// }
|
||||
// });
|
||||
List<SysQuartzJob> quartzJobs = quartzJobService.findByIsPauseIsFalse();
|
||||
quartzJobs.forEach(job -> {
|
||||
if (judgmentIp(job.getJob_ip())) {
|
||||
log.info("定时任务:{}, 执行ip: {}, 定时任务开启", job.getJob_name(), localIp);
|
||||
System.out.println("定时任务: " + job.getJob_name() + ", 执行ip: " + localIp + ", 定时任务开启");
|
||||
quartzManage.addJob(job);
|
||||
} else {
|
||||
log.info("定时任务 {} 未开启, 本机ip{} 与 调度ip{} 不同", job.getJob_name(), localIp, job.getJob_ip());
|
||||
System.out.println("定时任务 " + job.getJob_name() + " 未开启, 本机ip: " + localIp + " 与 调度ip: " + job.getJob_ip() + " 不同");
|
||||
}
|
||||
});
|
||||
|
||||
log.info("--------------------定时任务注入完成---------------------");
|
||||
}
|
||||
|
||||
@@ -943,9 +943,9 @@
|
||||
FROM
|
||||
md_me_materialbase
|
||||
WHERE
|
||||
(material_code like '48221%'
|
||||
(material_name like 'FRP%'
|
||||
OR
|
||||
material_code like '701990999%')
|
||||
material_name like '平包树脂管%')
|
||||
OPTION 输入.material_code <> ""
|
||||
material_code like 输入.material_code
|
||||
ENDOPTION
|
||||
|
||||
@@ -104,7 +104,7 @@ public class PaperTubeTask extends AbstractAcsTask {
|
||||
String paper_tube_or_FRP = plan_jo.getString("paper_tube_or_frp");
|
||||
String paper_name;
|
||||
String need_size;
|
||||
// todo 88549333 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月05日 19:10
|
||||
// todo 88549333/zhouz 因为新物料描述 纸管和 frp管的尺寸位置不一致,所以之前的取数组第三位的写法就存在问题,现修改为根据不同的类型分别获取。 2026年05月05日 19:10
|
||||
if ("1".equals(paper_tube_or_FRP)) {
|
||||
paper_name = plan_jo.getString("paper_tube_description");
|
||||
need_size = MdmDescriptionParseUtils.extractPaperTubeSize(paper_name);
|
||||
|
||||
@@ -65,10 +65,6 @@
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.quality_scode <> ""
|
||||
ivt.quality_scode = 输入.quality_scode
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.storagevehicle_code <> ""
|
||||
attr.storagevehicle_code = 输入.storagevehicle_code
|
||||
ENDOPTION
|
||||
|
||||
@@ -988,7 +988,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
|
||||
if (!StrUtil.equals(jsonMst.getString("bill_type"), "1001")) {
|
||||
String bill_type = jsonMst.getString("bill_type");
|
||||
if (!"1001,1011,1013,1014,1015".contains(bill_type)) {
|
||||
throw new BadRequestException("请选择发货出库单据!");
|
||||
}
|
||||
|
||||
@@ -1622,12 +1623,18 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (ObjectUtil.isEmpty(dtls)) {
|
||||
throw new BadRequestException("当前订单无可分配出库明细");
|
||||
}
|
||||
boolean add_pcsn = false;
|
||||
//定义需要更新的仓位集合
|
||||
HashMap<String, JSONObject> Struct_map = new HashMap<String, JSONObject>();
|
||||
for (int i = 0; i < dtls.size(); i++) {
|
||||
JSONObject dtl = dtls.getJSONObject(i);
|
||||
double unassign_qty = dtl.getDoubleValue("unassign_qty");
|
||||
double plan_qty = dtl.getDoubleValue("plan_qty");
|
||||
String dtl_pcsn = "";
|
||||
if (StrUtil.isNotEmpty(dtl.getString("pcsn"))) {
|
||||
add_pcsn = true;
|
||||
dtl_pcsn = dtl.getString("pcsn");
|
||||
}
|
||||
/*
|
||||
* 分配规则:
|
||||
* top1.有销售订单号:用销售订单号、物料去找这批物料最早入库的所在的巷道
|
||||
@@ -1650,6 +1657,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jsonMap.put("sale_order_name", dtl.getString("source_bill_code"));
|
||||
jsonMap.put("sect_id", whereJson.getString("sect_id"));
|
||||
jsonMap.put("stor_id", whereJson.getString("stor_id"));
|
||||
if (add_pcsn) {
|
||||
jsonMap.put("pcsn", dtl_pcsn);
|
||||
}
|
||||
|
||||
JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonOneIvt)) {
|
||||
@@ -1676,6 +1686,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
// 查询此木箱下的所有子卷
|
||||
jsonMap.put("flag", "3");
|
||||
jsonMap.put("storagevehicle_code", ivt.getString("storagevehicle_code"));
|
||||
if (add_pcsn){
|
||||
jsonMap.put("pcsn", dtl_pcsn);
|
||||
}
|
||||
JSONArray ivtAllArr2 = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().getResultJSONArray(0);
|
||||
|
||||
for (int k = 0; k < ivtAllArr2.size(); k++) {
|
||||
@@ -1688,6 +1701,28 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
ivt2.put("bill_table", "ST_IVT_IOStorInv");
|
||||
storPublicService.IOStor(ivt2, "11");
|
||||
|
||||
/*if (!dtl.getString("pcsn").equals(ivt2.getString("pcsn"))) {
|
||||
//判断该库存的PCSN是否存在对应的DTL明细,如果存在则直接对应到该DTL明细
|
||||
JSONObject pcsn_dtl = wo_dtl.query("iostorinv_id = '" + dtl.getString("iostorinv_id") + "' AND pcsn = '" + ivt2.getString("pcsn") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(pcsn_dtl)) {
|
||||
dtl = pcsn_dtl;
|
||||
double can_qty = ivt2.getDoubleValue("canuse_qty");
|
||||
double dtl_assign_qty = pcsn_dtl.getDoubleValue("assign_qty");
|
||||
double dtl_unassign_qty = pcsn_dtl.getDoubleValue("unassign_qty");
|
||||
assign_qty = NumberUtil.add(dtl_assign_qty, can_qty);
|
||||
|
||||
if (dtl_unassign_qty >= can_qty) {
|
||||
dtl_unassign_qty = NumberUtil.sub(dtl_unassign_qty, can_qty);
|
||||
} else {
|
||||
dtl_unassign_qty = 0;
|
||||
}
|
||||
pcsn_dtl.put("assign_qty", dtl_assign_qty);
|
||||
pcsn_dtl.put("unassign_qty", dtl_unassign_qty);
|
||||
wo_dtl.update(pcsn_dtl);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
//生成分配明细
|
||||
dtl.put("iostorinvdis_id", IdUtil.getLongId());
|
||||
dtl.put("sect_id", ivt2.getString("sect_id"));
|
||||
@@ -1825,19 +1860,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//更新主表状态
|
||||
this.updateMststatus(iostorinv_id);
|
||||
|
||||
//锁定起点点位、仓位
|
||||
Collection<JSONObject> c = Struct_map.values();
|
||||
Iterator<JSONObject> it = c.iterator();
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "3");
|
||||
for (; it.hasNext(); ) {
|
||||
JSONObject Struct = it.next();
|
||||
from_start.put("struct_id", Struct.getString("struct_id"));
|
||||
from_start.put("inv_type", jo_mst.getString("bill_type"));
|
||||
from_start.put("inv_id", jo_mst.getString("iostorinv_id"));
|
||||
from_start.put("inv_code", jo_mst.getString("bill_code"));
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
}
|
||||
}
|
||||
//锁定起点点位、仓位
|
||||
Collection<JSONObject> c = Struct_map.values();
|
||||
Iterator<JSONObject> it = c.iterator();
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "3");
|
||||
for (; it.hasNext(); ) {
|
||||
JSONObject Struct = it.next();
|
||||
from_start.put("struct_id", Struct.getString("struct_id"));
|
||||
from_start.put("inv_type", jo_mst.getString("bill_type"));
|
||||
from_start.put("inv_id", jo_mst.getString("iostorinv_id"));
|
||||
from_start.put("inv_code", jo_mst.getString("bill_code"));
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
}
|
||||
return null;
|
||||
}, "all_divOne", whereJson);
|
||||
|
||||
@@ -128,6 +128,10 @@
|
||||
ivt.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sale_order_name <> ""
|
||||
sub.sale_order_name = 输入.sale_order_name
|
||||
ENDOPTION
|
||||
@@ -187,6 +191,10 @@
|
||||
attr.storagevehicle_code = 输入.storagevehicle_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn = 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
order by ivt.instorage_time ASC
|
||||
|
||||
ENDSELECT
|
||||
|
||||
@@ -308,7 +308,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
|
||||
// 销售出库
|
||||
// if (StrUtil.equals(bill_type, "1001") && is_productstore.equals("1")) {
|
||||
if (StrUtil.equals(bill_type, "1001")) {
|
||||
if (StrUtil.equals(bill_type, "1001")|| StrUtil.equals(bill_type, "1011") || StrUtil.equals(bill_type, "1013") || StrUtil.equals(bill_type, "1014") || StrUtil.equals(bill_type, "1015")) {
|
||||
// 2.回传mes
|
||||
JSONObject paramMesMst = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_OUT_TYPE"
|
||||
:disabled="item.value === '1099'"
|
||||
:key="item.value"
|
||||
:disabled="item.value === '1099'"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
@@ -99,7 +99,7 @@
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="移入仓库" prop="out_stor_id" v-if="form.bill_type === '1004'" required="true">
|
||||
<el-form-item v-if="form.bill_type === '1004'" label="移入仓库" prop="out_stor_id" required="true">
|
||||
<label slot="label">移入仓库:</label>
|
||||
<el-select
|
||||
v-model="form.out_stor_id"
|
||||
@@ -236,7 +236,7 @@
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />-->
|
||||
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />-->
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
|
||||
<template scope="scope">
|
||||
@@ -251,7 +251,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged5" />
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" :lock-type="1" @tableChanged="tableChanged5" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -349,7 +349,7 @@ export default {
|
||||
this.crud.notify('移入仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
/*if (this.form.out_stor_id === this.form.stor_id) {
|
||||
/* if (this.form.out_stor_id === this.form.stor_id) {
|
||||
this.crud.notify('移出仓库和移入仓库不能一致!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}*/
|
||||
@@ -441,7 +441,7 @@ export default {
|
||||
const data = {
|
||||
'data': rows
|
||||
}
|
||||
if(this.form.bill_type === '1011') {
|
||||
if (this.form.bill_type === '1011') {
|
||||
debugger
|
||||
rows.forEach((item) => {
|
||||
debugger
|
||||
|
||||
Reference in New Issue
Block a user