fix: 解决冲突

This commit is contained in:
2024-04-11 16:15:08 +08:00
10 changed files with 71 additions and 67 deletions

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor;
@@ -14,14 +13,11 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproducti
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.dto.SchBaseTaskVO;
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.SecurityUtils;
@@ -32,9 +28,7 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@@ -53,15 +47,14 @@ public class ZxqTask extends AbstractAcsTask {
@Resource
private ZxDjwTask zxDjwTask;
@Resource
private DjqTask djqTask;
@Resource
private IschBaseTaskService taskService;
@Resource
private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource
private IpdmBiSubpackagerelationService subpackageRelationService;
@Resource
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
@Resource
private IPdmBiSlittingproductionplanService productionPlanService;
private final String THIS_CLASS = ZxqTask.class.getName();
@@ -126,34 +119,14 @@ public class ZxqTask extends AbstractAcsTask {
PdmBiSubpackagerelation pdmBiSubpackagerelation = subpackageRelationService
.getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, schBaseTask.getVehicle_code()), false);
if (pdmBiSubpackagerelation != null) {
// 装箱区点位,获取装箱区所在区块
//查询目标点位信息
BstIvtPackageinfoivt zxqPoint = packageinfoivtService.getOne(new LambdaUpdateWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, schBaseTask.getPoint_code2()));
//查询装箱对接位的木箱号和区域与子卷对应的木箱号与区域是否匹配
//装箱对接位的container_name存的是木箱号
BstIvtPackageinfoivt zxdjwPoint = packageinfoivtService.getOne(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
.eq(BstIvtPackageinfoivt::getContainer_name, pdmBiSubpackagerelation.getPackage_box_sn()).eq(BstIvtPackageinfoivt::getBlock, zxqPoint.getBlock()));
if (zxdjwPoint != null) {
//创建搬运任务到装箱位
JSONObject jo = new JSONObject();
//该子卷改为包装关系
pdmBiSubpackagerelation.update(new UpdateWrapper<PdmBiSubpackagerelation>().set("status", SUBEnum.STATUS.code("包装")));
BstIvtBoxinfo boxInfo = iBstIvtBoxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, pdmBiSubpackagerelation.getPackage_box_sn()), false);
if (boxInfo == null) {
throw new BadRequestException("待检区 -> 装箱区,子卷所属的木箱信息不能为空!");
}
List<PdmBiSubpackagerelation> containerList = subpackageRelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, pdmBiSubpackagerelation.getPackage_box_sn()));
long packagingCount = containerList.stream().filter(r -> r.getStatus().equals(SUBEnum.STATUS.code("包装"))).count();
// 给桁架任务添加尾卷信息
if (BigDecimal.valueOf(packagingCount).equals(pdmBiSubpackagerelation.getQuanlity_in_box())) {
JSONObject interactionJson = new JSONObject();
//是否最后子卷
interactionJson.put("lastOne", "1");
//木箱最大子卷数
interactionJson.put("maxNo", boxInfo.getNum());
//木箱实际放的子卷数
interactionJson.put("boxNo", pdmBiSubpackagerelation.getQuanlity_in_box());
jo.put("interaction_json", interactionJson);
}
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"));
jo.put("acs_task_type", PackageInfoIvtEnum.ACS_TASK_TYPE.code("桁架任务"));
jo.put("point_code1", schBaseTask.getPoint_code2());

View File

@@ -61,4 +61,4 @@ public enum PackageInfoIvtEnum {
}
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
}
}
}