Merge pull request 'b_lms_to_merge' (#6) from b_lms into master_merge

Reviewed-on: http://121.40.234.130:8899/root/lanzhouhailiang_one/pulls/6
This commit is contained in:
2024-07-03 11:10:05 +08:00
6 changed files with 56 additions and 10 deletions

View File

@@ -2,6 +2,8 @@ package org.nl.b_lms.pdm.subpackagerelation.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.StopWatch; import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@@ -744,6 +746,39 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
if (StrUtil.isEmpty(containerName)) { if (StrUtil.isEmpty(containerName)) {
throw new BadRequestException("输入的子卷号不能为空!"); throw new BadRequestException("输入的子卷号不能为空!");
} }
List<PdmBiSubpackagerelation> subList = this.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, jo.getString("container_name")));
if (CollectionUtils.isEmpty(subList)) {
PdmBiSlittingproductionplan plan = iPdmBiSlittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, containerName));
if (ObjectUtil.isEmpty(plan)) {
throw new BadRequestException("未查询到可用的分切计划!");
}
PdmBiSubpackagerelation sub = new PdmBiSubpackagerelation();
sub.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId() + "");
sub.setContainer_name(plan.getContainer_name());
sub.setSale_order_name(plan.getSale_order_name());
sub.setCustomer_name("test");
sub.setCustomer_description("临时包装关系");
sub.setProduct_description(plan.getDescription());
sub.setWidth(String.valueOf(plan.getSplit_breadth()));
if (StringUtils.isBlank(plan.getWeight()) || StringUtils.isBlank(plan.getPaper_weight())) {
throw new BadRequestException("该子卷分切计划中的子卷重量参数为空!");
}
int net_weight = Integer.parseInt(plan.getWeight()) - Integer.parseInt(plan.getPaper_weight());
sub.setNet_weight(net_weight + "");
sub.setLength("1000");
sub.setIs_un_plan_production("0");
sub.setCreate_id(1L);
sub.setCreate_name("管理员");
sub.setCreate_time(DateUtil.now());
sub.setStatus("99");
sub.setSap_pcsn("Test");
sub.setExt_code("BC01");
sub.setBox_group(null);
sub.setProduct_name("测试");
this.saveOrUpdate(sub);
}
} }
@@ -770,7 +805,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷"); throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷");
} }
//均衡获取木箱出库装箱区对接位 //均衡获取木箱出库装箱区对接位
String deviceCode = getPointCode(); // String deviceCode = getPointCode();
String deviceCode = "ZXQ_1_1";
Integer taskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount(deviceCode.substring(deviceCode.lastIndexOf("_") + 1)); Integer taskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount(deviceCode.substring(deviceCode.lastIndexOf("_") + 1));
if (taskCount + packagerelationList.size() > 10) { if (taskCount + packagerelationList.size() > 10) {
throw new BadRequestException("子卷搬运任务数已达上限!"); throw new BadRequestException("子卷搬运任务数已达上限!");
@@ -811,7 +847,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer
maxBoxGroup, String boxType) { maxBoxGroup, String boxType) {
//均衡获取装箱对接位 //均衡获取装箱对接位
//String deviceCode = "ZXQ_1_1";
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
JSONObject boxInfo = new JSONObject(); JSONObject boxInfo = new JSONObject();
@@ -823,7 +858,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
stopWatch.stop(); stopWatch.stop();
System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis()); System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis()); log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
//String boxSn = "MX230118000013"; //String boxSn = "MX240702000169";
StopWatch stopWatch1 = new StopWatch(); StopWatch stopWatch1 = new StopWatch();
stopWatch1.start(); stopWatch1.start();
//更新及子卷包装状态已分配规格及木箱规格组 //更新及子卷包装状态已分配规格及木箱规格组
@@ -831,7 +866,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
try { try {
updateBoxGroup(maxBoxGroup, workIdList, boxSn, boxType); updateBoxGroup(maxBoxGroup, workIdList, boxSn, boxType);
} catch (Exception e) { } catch (Exception e) {
log.error("异常信息" + e); log.error("updateBoxGroup接口更新及子卷包装状态已分配规格及木箱规格组异常:" + e);
} }
}, pool); }, pool);
//待检区->装箱区agv任务 //待检区->装箱区agv任务
@@ -839,7 +874,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
try { try {
agvTransfer(containerNameList, deviceCode, boxSn); agvTransfer(containerNameList, deviceCode, boxSn);
} catch (Exception e) { } catch (Exception e) {
log.error("异常信息" + e); log.error("agvTransfer接口待检区->装箱区agv任务异常:" + e);
} }
}, pool); }, pool);
stopWatch1.stop(); stopWatch1.stop();
@@ -878,6 +913,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
jo.put("vehicle_code2", groupId); jo.put("vehicle_code2", groupId);
//任务组id //任务组id
SchBaseTask task = new SchBaseTask(); SchBaseTask task = new SchBaseTask();
//保存任务子卷号
SchBaseTask taskDto = zxqTask.createTaskReturnTask(jo); SchBaseTask taskDto = zxqTask.createTaskReturnTask(jo);
task.setTask_id(taskDto.getTask_id()); task.setTask_id(taskDto.getTask_id());
task.setVehicle_code(taskDto.getVehicle_code()); task.setVehicle_code(taskDto.getVehicle_code());

View File

@@ -548,9 +548,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
result.put("message", "子卷号或子卷品质为空"); result.put("message", "子卷号或子卷品质为空");
return result; return result;
} }
subpackagerelationService.createSubTest(whereJson); subpackagerelationService.createSubTest(whereJson);
//"有子卷","2","合格品","3","管制品","4" //"有子卷","2","合格品","3","管制品","4"
BstIvtPackageinfoivt dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name"))); BstIvtPackageinfoivt dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
if (dto == null) { if (dto == null) {

View File

@@ -134,7 +134,7 @@ public class ZxqTask extends AbstractAcsTask {
//2.改变起点点位状态 //2.改变起点点位状态
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1())); packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
//更新库存记录 //更新库存记录
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("有子卷")).set("container_name", schBaseTask.getVehicle_code()).eq("point_code", schBaseTask.getPoint_code2())); packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")).set("container_name", schBaseTask.getVehicle_code()).eq("point_code", schBaseTask.getPoint_code2()));
//3.查询子卷对应的包装关系表,判断装箱位的木箱号是否为子卷对应的木箱号,是,创建搬运任务到装箱对接位位桁架任务,否,什么都不做 //3.查询子卷对应的包装关系表,判断装箱位的木箱号是否为子卷对应的木箱号,是,创建搬运任务到装箱对接位位桁架任务,否,什么都不做
//zxqToZxw(schBaseTask); //zxqToZxw(schBaseTask);
} }
@@ -232,6 +232,9 @@ public class ZxqTask extends AbstractAcsTask {
} }
/**
* 返回实体
*/
public SchBaseTask createTaskReturnTask(JSONObject form) { public SchBaseTask createTaskReturnTask(JSONObject form) {
Assert.notNull(form, "请求参数不能为空"); Assert.notNull(form, "请求参数不能为空");
String taskType = form.getString("task_type"); String taskType = form.getString("task_type");

View File

@@ -82,7 +82,7 @@ public class AutoSendZxToDjw {
return; return;
} }
//装箱区有子卷且没有正在进行的装箱任务 //装箱区有子卷且没有正在进行的装箱任务
List<BstIvtPackageinfoivt> zxqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("有子卷"), "", "", ""); List<BstIvtPackageinfoivt> zxqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"), "", "", "");
if (CollectionUtils.isEmpty(zxqPackageinfoivtList)) { if (CollectionUtils.isEmpty(zxqPackageinfoivtList)) {
return; return;
} }
@@ -91,6 +91,7 @@ public class AutoSendZxToDjw {
//获取木箱信息,未包装的木箱 //获取木箱信息,未包装的木箱
BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo).ne(BstIvtBoxinfo::getIs_packing, "1")); BstIvtBoxinfo bstIvtBoxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo).ne(BstIvtBoxinfo::getIs_packing, "1"));
if (bstIvtBoxinfo == null) { if (bstIvtBoxinfo == null) {
log.info("请检查木箱号:" + boxNo + "是否存在或者状态为已装箱!");
throw new BadRequestException("请检查木箱号:" + boxNo + "是否存在或者状态为已装箱!"); throw new BadRequestException("请检查木箱号:" + boxNo + "是否存在或者状态为已装箱!");
} }
//检查木箱信息 //检查木箱信息
@@ -99,6 +100,7 @@ public class AutoSendZxToDjw {
List<PdmBiSubpackagerelation> relationList = subpackageRelationService List<PdmBiSubpackagerelation> relationList = subpackageRelationService
.list(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, boxNo).eq(PdmBiSubpackagerelation::getStatus, "0")); .list(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, boxNo).eq(PdmBiSubpackagerelation::getStatus, "0"));
if (CollectionUtils.isEmpty(relationList)) { if (CollectionUtils.isEmpty(relationList)) {
log.info("装箱位的木箱号" + boxNo + "对应的子卷包装关系为空,请检查子卷包装关系状态是否为0!");
throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!"); throw new BadRequestException("装箱位的木箱号" + boxNo + "对应的子卷包装关系异常,请检查子卷包装关系状态是否为0!");
} }
//获取与该木箱号匹配的子卷号 //获取与该木箱号匹配的子卷号
@@ -108,6 +110,7 @@ public class AutoSendZxToDjw {
if (CollectionUtils.isNotEmpty(zxqPoint)) { if (CollectionUtils.isNotEmpty(zxqPoint)) {
List<PdmBiSlittingproductionplan> productionPlanList = pdmBiSlittingproductionplanMapper.selectList(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, containerName)); List<PdmBiSlittingproductionplan> productionPlanList = pdmBiSlittingproductionplanMapper.selectList(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, containerName));
if (productionPlanList.isEmpty()) { if (productionPlanList.isEmpty()) {
log.info("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!");
throw new BadRequestException("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!"); throw new BadRequestException("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!");
} }
//校验是否存在相同子卷号任务 //校验是否存在相同子卷号任务
@@ -157,6 +160,7 @@ public class AutoSendZxToDjw {
*/ */
public void transferBoxPackageToMes(List<PdmBiSubpackagerelation> packagerelationList, BstIvtBoxinfo bstIvtBoxinfo) { public void transferBoxPackageToMes(List<PdmBiSubpackagerelation> packagerelationList, BstIvtBoxinfo bstIvtBoxinfo) {
if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn()) || packagerelationList.get(0).getBox_weight() == null) { if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn()) || packagerelationList.get(0).getBox_weight() == null) {
log.info("transferBoxPackageToMes接口的子卷号" + packagerelationList.get(0).getContainer_name() + ",子卷未确定木箱规格信息");
throw new BadRequestException("子卷未确定木箱规格信息!"); throw new BadRequestException("子卷未确定木箱规格信息!");
} }
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@@ -165,6 +169,7 @@ public class AutoSendZxToDjw {
.collect(Collectors.toSet()); .collect(Collectors.toSet());
List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().in(PdmBiSlittingproductionplan::getContainer_name, containerNameList)); List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().in(PdmBiSlittingproductionplan::getContainer_name, containerNameList));
if (CollectionUtils.isEmpty(planList)) { if (CollectionUtils.isEmpty(planList)) {
log.info("装箱区的子卷号为" + planList.get(0).getContainer_name() + "无对应的分切计划信息,请检查!");
throw new BadRequestException("该箱号不存在分切计划"); throw new BadRequestException("该箱号不存在分切计划");
} }
BigDecimal totalWeight; BigDecimal totalWeight;
@@ -175,14 +180,17 @@ public class AutoSendZxToDjw {
.map(BigDecimal::new) .map(BigDecimal::new)
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
if (totalWeight.compareTo(new BigDecimal(0)) == 0) { if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
log.info(planList.get(0).getContainer_name()+"分切计划的子卷重量不能为0");
throw new BadRequestException("分切计划的子卷重量不能为0"); throw new BadRequestException("分切计划的子卷重量不能为0");
} }
BigDecimal boxWeight = new BigDecimal(bstIvtBoxinfo.getBox_weight()); BigDecimal boxWeight = new BigDecimal(bstIvtBoxinfo.getBox_weight());
if (boxWeight.compareTo(new BigDecimal(0)) == 0) { if (boxWeight.compareTo(new BigDecimal(0)) == 0) {
log.info(planList.get(0).getContainer_name()+"对应的木箱的重量不能0");
throw new BadRequestException("木箱的重量不能0"); throw new BadRequestException("木箱的重量不能0");
} }
totalWeight = totalWeight.add(boxWeight); totalWeight = totalWeight.add(boxWeight);
if (totalWeight.compareTo(new BigDecimal(0)) == 0) { if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
log.info(planList.get(0).getContainer_name()+"理论毛重计算有误不能为0,请检查!");
throw new BadRequestException("理论毛重不能为0"); throw new BadRequestException("理论毛重不能为0");
} }
//更新子卷包装关系的重量 //更新子卷包装关系的重量

View File

@@ -64,7 +64,7 @@ public class TaskQueue {
task.setPoint_code2(pointCode); task.setPoint_code2(pointCode);
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode()); task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
taskService.updateById(task); taskService.updateById(task);
//删除子卷包装关系 //同步删除子卷包装关系
LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PdmBiSubpackagerelation::getContainer_name, task.getVehicle_code()); queryWrapper.eq(PdmBiSubpackagerelation::getContainer_name, task.getVehicle_code());
pdmBiSubpackagerelationMapper.delete(queryWrapper); pdmBiSubpackagerelationMapper.delete(queryWrapper);

View File

@@ -307,6 +307,7 @@ export default {
// 表格1的行点击事件 // 表格1的行点击事件
handleRowClick(scope) { handleRowClick(scope) {
debugger debugger
// 按钮禁用
this.isButtonDisabled = !!(scope.status !== '99') this.isButtonDisabled = !!(scope.status !== '99')
this.isButtonDisabled1 = scope.status === '99' this.isButtonDisabled1 = scope.status === '99'
const table2 = this.$refs.dis_table const table2 = this.$refs.dis_table