Merge branch 'b_lms' of http://121.40.234.130:8899/root/lanzhouhailiang_one into b_lms
This commit is contained in:
@@ -68,7 +68,7 @@ public class PdmBiSubpackagerelationController {
|
||||
* @param whereJson 查询条件
|
||||
*/
|
||||
@GetMapping("/queryContainerNameBySaleOrder")
|
||||
@Log("查询订单装箱信息")
|
||||
@Log("根据订单号查询子卷信息")
|
||||
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(pdmBiSubpackagerelationService.queryContainerNameBySaleOrder(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,7 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
|
||||
private String box_group;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -161,7 +161,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
;
|
||||
if (entityList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
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;
|
||||
@@ -27,6 +30,7 @@ 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;
|
||||
|
||||
@@ -46,7 +50,8 @@ public class DjqTask extends AbstractAcsTask {
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
@Resource
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@Resource
|
||||
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
|
||||
@Resource
|
||||
private MzhcwTask mzhcwTask;
|
||||
@Resource
|
||||
@@ -87,10 +92,13 @@ public class DjqTask extends AbstractAcsTask {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq( SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
|
||||
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
|
||||
if (schBaseTask == null) {
|
||||
throw new BadRequestException("满轴缓存位 -> 待检区更新接口任务号为空!");
|
||||
}
|
||||
if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
|
||||
throw new BadRequestException("满轴缓存位 -> 待检区,子卷号不能为空!");
|
||||
}
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
schBaseTask.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||
@@ -102,12 +110,25 @@ public class DjqTask extends AbstractAcsTask {
|
||||
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()));
|
||||
//todo 3.手持确认包装关系,生产包装关系表数据
|
||||
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
|
||||
//device_code:终点,box_length: 长,box_width: 宽,box_high: 高,num: 子卷数
|
||||
// JSONObject boxInfo = new JSONObject();
|
||||
// boxInfo.put("device_code", schBaseTask.getPoint_code2());
|
||||
// outBoxManageService.outBox(boxInfo);
|
||||
//PC子卷装箱界面确认包装关系,根据子卷号查询包装关系获取木箱规格
|
||||
String vehicleCode = schBaseTask.getVehicle_code();
|
||||
PdmBiSubpackagerelation pdmBiSubpackagerelation = pdmBiSubpackagerelationService
|
||||
.getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, vehicleCode), false);
|
||||
if (pdmBiSubpackagerelation != null) {
|
||||
//如果子卷数大于0与木箱规格不为空,代表已确定子卷包装关系,则查询木箱号并木箱出库
|
||||
if (pdmBiSubpackagerelation.getQuanlity_in_box().compareTo(BigDecimal.ZERO) > 0 && StringUtils.isNotBlank(pdmBiSubpackagerelation.getBox_type())) {
|
||||
//device_code:终点,material_code:木箱规格,num: 子卷数
|
||||
JSONObject boxInfo = new JSONObject();
|
||||
boxInfo.put("device_code", schBaseTask.getPoint_code2());
|
||||
boxInfo.put("material_code", pdmBiSubpackagerelation.getBox_type());
|
||||
boxInfo.put("num", pdmBiSubpackagerelation.getQuanlity_in_box());
|
||||
outBoxManageService.outBox(boxInfo);
|
||||
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
|
||||
String boxSn = "MX240115000152";
|
||||
//更新子卷包装关系更新木箱号
|
||||
pdmBiSubpackagerelationService.update(pdmBiSubpackagerelation, new UpdateWrapper<PdmBiSubpackagerelation>().set("package_box_sn", boxSn));
|
||||
}
|
||||
}
|
||||
//5.查询是否有未下发的输送线->满轴位任务,有就下发
|
||||
List<SchBaseTask> notIssueTaskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
//确定起点
|
||||
@@ -133,10 +154,9 @@ public class DjqTask extends AbstractAcsTask {
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
jo.put("point_code1", schBaseTask.getPoint_code2());
|
||||
jo.put("point_code2", zxqPointList.get(0).getPoint_code());
|
||||
jo.put("vehicle_code", schBaseTask.getVehicle_code());
|
||||
jo.put("vehicle_code", vehicleCode);
|
||||
zxqTask.createTask(jo);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
throw new BadRequestException("装箱区暂无空余库位!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -13,11 +14,14 @@ 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;
|
||||
@@ -28,7 +32,9 @@ 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;
|
||||
|
||||
@@ -47,14 +53,15 @@ 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();
|
||||
@@ -119,14 +126,34 @@ 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());
|
||||
|
||||
@@ -13,6 +13,7 @@ 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.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
@@ -135,7 +136,7 @@ public class SendAirShaftAgvTask extends AbstractAcsTask {
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("3");
|
||||
task.setIs_delete("0");
|
||||
task.setIs_delete(SlitterConstant.SLITTER_NO);
|
||||
task.setRequest_param(form.toJSONString());
|
||||
task.setTask_type(form.getString("task_type"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
@@ -159,7 +160,7 @@ public class SendAirShaftAgvTask extends AbstractAcsTask {
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ public class SlitterDownTrussTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public class TrussCallShaftCacheTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class TrussSendAirShaftTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class TrussSendShaftCacheTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ public class UpShaftTrussTask extends AbstractAcsTask {
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingprodu
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
@@ -49,6 +50,13 @@ public class AutoCallAirShaftTask {
|
||||
@Autowired
|
||||
private TrussCallShaftCacheTask trussCallShaftCacheTask;
|
||||
|
||||
/**
|
||||
* 执行套轴和拔轴任务的逻辑处理。
|
||||
* 该方法首先寻找空闲的插拔轴位,然后根据不同的条件(如标箔或锂电)来确定区域。接着,它会检查是否有分切计划需要执行,
|
||||
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
|
||||
* 同时,该方法也会更新相关的分切计划状态。
|
||||
* 套拔轴缓存位满了、没有分切计划,则触发自动创建套拔轴任务
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void run() {
|
||||
// 1、获取空的插拔轴位(无任务)
|
||||
@@ -93,8 +101,8 @@ public class AutoCallAirShaftTask {
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, planDto.getResource_name())
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, planDto.getParent_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, planDto.getUp_or_down())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, "1"));
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, SlitterConstant.SLITTER_YES));
|
||||
// 获取其中一条
|
||||
PdmBiSlittingproductionplan needPlan = needPlans.get(0);
|
||||
String qzzSize = needPlan.getQzz_size();
|
||||
@@ -124,24 +132,27 @@ public class AutoCallAirShaftTask {
|
||||
param.put("point_code2", empty.getPoint_code());
|
||||
param.put("vehicle_code", ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
|
||||
? startPoint.getQzz_no1() : startPoint.getQzz_no2());
|
||||
// 气胀轴号
|
||||
param.put("qzz_no", ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
|
||||
? startPoint.getQzz_no1() : startPoint.getQzz_no2());
|
||||
param.put("needPlan", planDto);
|
||||
param.put("is_pulling", "1");
|
||||
param.put("is_bushing", "1");
|
||||
param.put("task_type", "6");
|
||||
// 是否拔轴
|
||||
param.put("is_pulling", SlitterConstant.SLITTER_YES);
|
||||
// 是否套轴
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_YES);
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("qzz_size", needPlan.getQzz_size());
|
||||
// 纸管规格、是否拔轴
|
||||
// 纸管规格
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("left", plan.getPaper_tube_model());
|
||||
} else {
|
||||
param.put("left", plan.getFRP_model());
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("right", plan.getPaper_tube_model());
|
||||
} else {
|
||||
param.put("right", plan.getFRP_model());
|
||||
@@ -149,7 +160,7 @@ public class AutoCallAirShaftTask {
|
||||
}
|
||||
}
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
// 将分切计划is_paper_ok 1 -> 2
|
||||
// 将分切计划is_paper_ok 1(纸管已经准备好) -> 2(已经套轴)
|
||||
needPlans.forEach(p -> {
|
||||
p.setIs_paper_ok("2");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
@@ -206,8 +217,8 @@ public class AutoCallAirShaftTask {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", shafttubeivt.getPoint_code());
|
||||
param.put("point_code2", empty.getPoint_code());
|
||||
param.put("is_bushing", "1");
|
||||
param.put("task_type", "6");
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_YES);
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("qzz_size", qzzSize);
|
||||
trussCallShaftCacheTask.createTask(param);
|
||||
@@ -220,15 +231,15 @@ public class AutoCallAirShaftTask {
|
||||
* @param qzzSize 气涨轴尺寸
|
||||
*/
|
||||
private void saveCutPlanMessage(BstIvtShafttubeivt empty, List<PdmBiSlittingproductionplan> needPlans, String qzzSize) {
|
||||
empty.setHave_qzz("1");
|
||||
empty.setHave_qzz(SlitterConstant.SLITTER_YES);
|
||||
empty.setQzz_size(qzzSize);
|
||||
empty.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
empty.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
empty.setUpdate_time(DateUtil.now());
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
// 左卷
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
empty.setTube_code1(plan.getPaper_tube_material());
|
||||
empty.setTube_name1(plan.getPaper_tube_model());
|
||||
} else {
|
||||
@@ -238,7 +249,7 @@ public class AutoCallAirShaftTask {
|
||||
empty.setContainer_name1(plan.getContainer_name());
|
||||
} else {
|
||||
// 右卷
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
empty.setTube_code1(plan.getPaper_tube_material());
|
||||
empty.setTube_name1(plan.getPaper_tube_model());
|
||||
} else {
|
||||
@@ -250,7 +261,7 @@ public class AutoCallAirShaftTask {
|
||||
}
|
||||
bstIvtShafttubeivtService.updateById(empty);
|
||||
// 分切计划
|
||||
// 将分切计划is_paper_ok 1 -> 2
|
||||
// 将分切计划is_paper_ok 1(准备好纸管) -> 2(套好气胀轴)
|
||||
needPlans.forEach(p -> {
|
||||
p.setIs_paper_ok("2");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
@@ -287,9 +298,10 @@ public class AutoCallAirShaftTask {
|
||||
param.put("qzz_no", qzzNo);
|
||||
// hint: 当前分切计划的气涨轴尺寸
|
||||
param.put("qzz_size", plan.getQzz_size());
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("is_bushing", "0");
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_NO);
|
||||
param.put("is_pulling", SlitterConstant.SLITTER_YES);
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtCutpointivtService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.SendAirShaftAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -57,7 +58,7 @@ public class AutoSendAirShaftAgvTask {
|
||||
// 最多4条分切计划
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("分切计划不存在");
|
||||
}
|
||||
@@ -74,7 +75,8 @@ public class AutoSendAirShaftAgvTask {
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, demoPlan.getParent_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, demoPlan.getResource_name())
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, demoPlan.getSplit_group())
|
||||
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down()));
|
||||
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (list.size() > 0) {
|
||||
// 还有不同轴,所以不继续
|
||||
break;
|
||||
@@ -99,11 +101,11 @@ public class AutoSendAirShaftAgvTask {
|
||||
param.put("point_code2", endPoint.getPoint_code());
|
||||
param.put("vehicle_code1", cutPoint.getQzz_no1());
|
||||
param.put("vehicle_code2", cutPoint.getQzz_no2());
|
||||
param.put("task_type", "3");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
sendAirShaftAgvTask.createTask(param);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.SlitterDownAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -70,14 +71,14 @@ public class AutoSlitterDownAgvTask {
|
||||
toCreateTask(cut, endPoint);
|
||||
return;
|
||||
} else {
|
||||
throw new BadRequestException("资源已被占用,请稍等!");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
} else if (areaEmptyNotTaskPoint.size() == 0 && "3".equals(cut.getPoint_type())) {
|
||||
} else if ("3".equals(cut.getPoint_type())) {
|
||||
// 2、没有位置,就去分切缓存位
|
||||
areaEmptyNotTaskPoint = cutpointivtService.getAreaNotTaskPointByStatus("3", "1", "0","0");
|
||||
}
|
||||
@@ -97,7 +98,7 @@ public class AutoSlitterDownAgvTask {
|
||||
param.put("point_code2", endPoint.getPoint_code());
|
||||
param.put("vehicle_code1", cut.getQzz_no1());
|
||||
param.put("vehicle_code2", cut.getQzz_no2());
|
||||
param.put("task_type", "3");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料AGV任务"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
slitterDownAgvTask.createTask(param);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.UpShaftTrussTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -40,47 +41,62 @@ public class AutoUpShaftTrussTask {
|
||||
@Autowired
|
||||
private SlitterMapper slitterMapper;
|
||||
|
||||
/**
|
||||
* 运行任务,主要负责校验分切机是否有未处理的任务,如果有则跳过;如果没有,会尝试为分切机创建新的任务。
|
||||
* 该过程包括:查找没有气涨轴的分切机点位,校验是否存在相关任务,寻找备好轴的对接点位,获取下一组分切计划,
|
||||
* 并根据计划创建相应的搬运任务。
|
||||
*/
|
||||
public void run() {
|
||||
// 获取没有气涨轴的分切机点位
|
||||
// 获取符合条件的分切机点位信息 hint: (目前暂定B2区域)
|
||||
List<StIvtCutpointivt> devicePoint = cutpointivtService.list(new LambdaQueryWrapper<StIvtCutpointivt>()
|
||||
.eq(StIvtCutpointivt::getProduct_area, "B2")
|
||||
.and(l1 -> l1.eq(StIvtCutpointivt::getUp_qzzno, "").or().isNull(StIvtCutpointivt::getUp_qzzno))
|
||||
.and(l2 -> l2.eq(StIvtCutpointivt::getDown_qzzno, "").or().isNull(StIvtCutpointivt::getDown_qzzno)));
|
||||
|
||||
// 遍历每个分切机点位进行任务的校验和创建
|
||||
devicePoint.forEach(device -> {
|
||||
// 校验任务
|
||||
// todo: 区域
|
||||
String productArea = device.getProduct_area();
|
||||
// 校验是否存在未完成的任务
|
||||
List<String> collect = Stream.of(device.getUp_point_code(), device.getDown_point_code()).collect(Collectors.toList());
|
||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.lt(SchBaseTask::getTask_status, "07")
|
||||
.in(SchBaseTask::getPoint_code1, collect).in(SchBaseTask::getPoint_code2, collect)
|
||||
.in(SchBaseTask::getPoint_code3, collect).in(SchBaseTask::getPoint_code4, collect));
|
||||
if (list.size() > 0) {
|
||||
// 存在未完成任务,跳过当前点位
|
||||
return;
|
||||
}
|
||||
// 获取备好轴的对接点位
|
||||
|
||||
// 寻找备好轴的对接点位
|
||||
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(device.getExt_code());
|
||||
if (cutPointList.size() == 0) {
|
||||
log.warn("分切机【" + device.getExt_code() + "】未找到套好纸管的气涨轴");
|
||||
// 下个分切机
|
||||
// 未找到备好轴的对接点位
|
||||
return;
|
||||
}
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
// 获取当前分切机的下一组分切计划(最多四条分切计划)
|
||||
|
||||
// 获取下一组分切计划
|
||||
List<String> qzzNos = Stream.of(newCutPoint.getQzz_no1(), newCutPoint.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> nextPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNos));
|
||||
if (nextPlans.size() == 0) {
|
||||
log.warn("分切机【" + device.getExt_code() + "】未找到套好轴的分切计划");
|
||||
// 下个分切机
|
||||
// 未找到分切计划
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
// 筛选上下轴各一条
|
||||
PdmBiSlittingproductionplan nextUpPlan = nextPlans.stream().filter(p -> "1".equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
PdmBiSlittingproductionplan nextDownPlan = nextPlans.stream().filter(p -> "2".equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
// 查找对应的分切对接位
|
||||
// 根据计划筛选上下轴任务,并构建任务参数
|
||||
PdmBiSlittingproductionplan nextUpPlan = nextPlans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_UP.equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
PdmBiSlittingproductionplan nextDownPlan = nextPlans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_DOWN.equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan) && ObjectUtil.isNotEmpty(nextDownPlan)) {
|
||||
// 双轴任务
|
||||
// 双轴任务参数构建
|
||||
param.put("point_code1", newCutPoint.getTruss_point_code1());
|
||||
param.put("point_code2", device.getUp_point_code());
|
||||
param.put("point_code3", newCutPoint.getTruss_point_code2());
|
||||
@@ -88,7 +104,7 @@ public class AutoUpShaftTrussTask {
|
||||
param.put("vehicle_code1", newCutPoint.getQzz_no1());
|
||||
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
||||
} else {
|
||||
// 单轴任务
|
||||
// 单轴任务参数构建
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan)) {
|
||||
// 上轴任务
|
||||
param.put("point_code1", newCutPoint.getTruss_point_code1());
|
||||
@@ -101,11 +117,16 @@ public class AutoUpShaftTrussTask {
|
||||
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
||||
}
|
||||
}
|
||||
|
||||
// 构建任务的其他参数
|
||||
param.put("truss_type", "1");
|
||||
param.put("empty_site", "0");
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("分切机上气胀轴"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
|
||||
// 创建任务
|
||||
upShaftTrussTask.createTask(param);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,5 +35,29 @@ public interface SlitterConstant {
|
||||
* 区域:下
|
||||
*/
|
||||
String SLITTER_AREA_DOWN = "1";
|
||||
/**
|
||||
* 子卷:左边
|
||||
*/
|
||||
String SLITTER_SUB_VOLUME_LEFT = "1";
|
||||
/**
|
||||
* 子卷:右边
|
||||
*/
|
||||
String SLITTER_SUB_VOLUME_RIGHT = "2";
|
||||
/**
|
||||
* 子卷:上轴
|
||||
*/
|
||||
String SLITTER_SHAFT_UP = "1";
|
||||
/**
|
||||
* 子卷:下轴
|
||||
*/
|
||||
String SLITTER_SHAFT_DOWN = "2";
|
||||
/**
|
||||
* 子卷类型:纸管
|
||||
*/
|
||||
String SLITTER_TYPE_PAPER = "1";
|
||||
/**
|
||||
* 子卷类型:FRP
|
||||
*/
|
||||
String SLITTER_TYPE_FRP = "2";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切所需要的枚举
|
||||
* @Date: 2024/3/19
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum SlitterEnum {
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
||||
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806"));
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().get(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String check(String code) {
|
||||
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
|
||||
if (entry.getValue().equals("code")) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class SlitterController {
|
||||
@PostMapping("/test3")
|
||||
@Log("1111")
|
||||
public ResponseEntity<Object> create3(@RequestBody JSONObject entity){
|
||||
List<String> collect = Stream.of("B2572312312002B1").collect(Collectors.toList());
|
||||
List<String> collect = Stream.of("B2652312312901A1").collect(Collectors.toList());
|
||||
entity.put("container", collect);
|
||||
return new ResponseEntity<>(slitterService.mesSlittingMachineSendMaterial(entity), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nl.b_lms.sch.tasks.slitter.SlitterDownTrussTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussSendAirShaftTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
@@ -120,7 +121,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
BstIvtShafttubeivt CBJ = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
if (ObjectUtil.isEmpty(CBJ.getTube_code1()) && ObjectUtil.isEmpty(CBJ.getTube_code2())) {
|
||||
// 清空
|
||||
CBJ.setHave_qzz("0");
|
||||
CBJ.setHave_qzz(SlitterConstant.SLITTER_NO);
|
||||
TaskUtils.updateOptMessageByBShaftPoint(CBJ);
|
||||
shafttubeivtService.updateById(CBJ);
|
||||
}
|
||||
@@ -150,10 +151,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("data", r);
|
||||
r.put("device_code", deviceCode);
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
String s = String.valueOf("1".equals(plan.getPaper_tube_or_FRP())
|
||||
String s = String.valueOf(SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_model().split("\\|")[2].charAt(0)
|
||||
: plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
r.put("left_size", s);
|
||||
} else {
|
||||
r.put("right_size", s);
|
||||
@@ -189,6 +190,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 获取分切计划
|
||||
List<String> collect = Stream.of(startPoint.getContainer_name1(), startPoint.getContainer_name2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
if (collect.size() == 0) {
|
||||
log.error("找不到[{}]对应的分切计划!", deviceCode);
|
||||
throw new BadRequestException("找不到[" + deviceCode + "]对应的分切计划!");
|
||||
}
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
@@ -226,7 +231,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 分切计划设置套轴完成
|
||||
String qzzNo = IdUtil.getSnowflake(1,1).nextIdStr();
|
||||
plans.forEach(plan -> {
|
||||
plan.setIs_child_tz_ok("1");
|
||||
plan.setIs_child_tz_ok(SlitterConstant.SLITTER_YES);
|
||||
plan.setQzzno(qzzNo);
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
});
|
||||
@@ -234,15 +239,15 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 创建任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("point_code2", "1".equals(demoPlan.getUp_or_down())
|
||||
taskParam.put("point_code2", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down())
|
||||
? cutPoint.getTruss_point_code1() : cutPoint.getTruss_point_code2());
|
||||
taskParam.put("vehicle_code1", "1".equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("vehicle_code2", "2".equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("task_type", "6");
|
||||
taskParam.put("vehicle_code1", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("vehicle_code2", SlitterConstant.SLITTER_SHAFT_DOWN.equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLockPoint) {
|
||||
@@ -281,7 +286,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
param.put("point_code2", shafttubeivt.getPoint_code());
|
||||
// hint: 当前分切计划的气涨轴尺寸
|
||||
param.put("qzz_size", qzzSize);
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("is_bushing", "0");
|
||||
trussCallShaftCacheTask.createTask(param);
|
||||
@@ -304,7 +309,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 获取分切计划,最多4个需要出站的任务
|
||||
List<PdmBiSlittingproductionplan> currentPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, containerList)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "05"));
|
||||
if (currentPlans.size() == 0) {
|
||||
throw new BadRequestException("当前子卷已经出卷或者不存在!");
|
||||
@@ -370,7 +375,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
slittingproductionplanService.updateBatchById(currentPlans);
|
||||
return res;
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
@@ -554,10 +559,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("查询不到气胀轴编码「" + qzzNo + "」对应的子卷信息!");
|
||||
}
|
||||
PdmBiSlittingproductionplan plan;
|
||||
if ("1".equals(direction)) {
|
||||
plan = plans.stream().filter(p -> "1".equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(direction)) {
|
||||
plan = plans.stream().filter(p -> SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
} else {
|
||||
plan = plans.stream().filter(p -> "2".equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
plan = plans.stream().filter(p -> SlitterConstant.SLITTER_SUB_VOLUME_RIGHT.equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
}
|
||||
if (plan == null) {
|
||||
log.error("设备{}, 找不到气胀轴编码{}对应的分切计划!参数:{}",deviceCode, qzzNo, param);
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
package org.nl.b_lms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
@@ -16,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/boxinfo")
|
||||
public class BstIvtBoxinfoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询木箱信息")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.nl.b_lms.storage_manage.database.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,6 +17,22 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
*/
|
||||
public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据mes信息插入木箱信息
|
||||
* @param whereJson:{
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
@@ -19,6 +25,23 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, BstIvtBoxinfo> implements IBstIvtBoxinfoService {
|
||||
@Resource
|
||||
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
Map<String, Object> mapReslt = new HashMap<>();
|
||||
LambdaQueryWrapper<BstIvtBoxinfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (whereJson.containsKey("search")) {
|
||||
queryWrapper.like(BstIvtBoxinfo::getBox_no, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_code, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_name, whereJson.get("search"));
|
||||
}
|
||||
IPage<BstIvtBoxinfo> result = bstIvtBoxinfoMapper.selectPage(new Page<>(page.getPageNumber() + 1, page.getPageSize()),queryWrapper);
|
||||
mapReslt.put("content", result.getRecords());
|
||||
mapReslt.put("totalElements", result.getTotal());
|
||||
return mapReslt;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BstIvtBoxinfo mesInsert(JSONObject whereJson) {
|
||||
@@ -42,9 +65,9 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
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 = two.substring(two.indexOf("|") + 1, two.indexOf("|") + 2);
|
||||
boxDao.setNum(num);
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
boxDao.setNum("截取失败,请检查mes数据!");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ public interface InBoxManageService {
|
||||
* vehicle_code:托盘号
|
||||
* point_code:起点点位
|
||||
* }
|
||||
* @return {
|
||||
* 长
|
||||
* 宽
|
||||
* 高
|
||||
* 木箱层数
|
||||
* }
|
||||
*/
|
||||
void boxBinVehicle(JSONObject whereJson);
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ public enum PackageInfoIvtEnum {
|
||||
//库存状态
|
||||
IVT_STATUS(MapOf.of("空", "0","空载具", "1","有子卷","2"));
|
||||
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CodeUtil {
|
||||
map.put("code", ruleCode);
|
||||
return SpringContextHolder.getBean(ISysCodeRuleService.class).codeDemo(map);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE pdm_bi_subpackagerelation
|
||||
ADD COLUMN `box_group` varchar(20) NULL DEFAULT '0' COMMENT '木箱组';
|
||||
ALTER TABLE pdm_bi_slittingproductionplan
|
||||
ADD COLUMN `level` char(1) NULL DEFAULT NULL COMMENT '子卷等级';
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_name`, `update_name`, `create_time`, `update_time`, `is_pc`, `system_type`, `create_id`, `category`, `update_id`) VALUES ('1765714619160203264', '329', 0, 4, '子卷装箱', NULL, 'wms/pdm/sub/index', 998, 'zujian', 'wms/pdm/sub/index', 0, b'0', b'0', NULL, NULL, NULL, NULL, NULL, 1, '1', 1, NULL, NULL);
|
||||
INSERT INTO `sys_dict` (`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1765997086853173248', 'sub_package_relation', '子卷包装关系状态', '未分配', '99', 0, NULL, NULL, NULL, NULL, '1', '管理员', '2024-03-08 15:04:50', '1', '管理员', '2024-03-08 15:04:50');
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.Map;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@RequestMapping("/api/Materialbase")
|
||||
@Slf4j
|
||||
public class MaterialbaseController {
|
||||
|
||||
@@ -118,7 +118,7 @@ public class CheckOutBillController {
|
||||
}
|
||||
|
||||
@PostMapping("/allDivOne")
|
||||
@Log("出库单全部分2配")
|
||||
@Log("出库单自动分配")
|
||||
|
||||
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
|
||||
Reference in New Issue
Block a user