feat: 分切下料,送气胀轴,套轴绑定
This commit is contained in:
@@ -121,6 +121,9 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
|
||||
}catch (Exception ex){
|
||||
throw new RuntimeException();
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(sysUser.getPassword())) {
|
||||
sysUser.setPassword(SaSecureUtil.md5BySalt(sysUser.getPassword(), "salt"));
|
||||
}
|
||||
sysUser.setUpdate_time(new Date());
|
||||
sysUser.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
this.updateById(sysUser);
|
||||
|
||||
@@ -32,4 +32,11 @@ public interface WmsToAcsService {
|
||||
JSONObject updateTask(JSONArray arr);
|
||||
|
||||
JSONObject getHotPointStatus(JSONArray deviceRows);
|
||||
|
||||
/**
|
||||
* 通知ACS可以完成任务
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject canFinishPreviousTask(JSONArray param);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return AcsUtil.notifyAcs(api, deviceRows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject canFinishPreviousTask(JSONArray param) {
|
||||
String api = "api/wms/nextAgv";
|
||||
return AcsUtil.notifyAcs(api, param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,4 +51,9 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> vehicleReturn(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(slitterPdaService.vehicleReturn(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/slitterDown")
|
||||
@Log("分切下料")
|
||||
public ResponseEntity<Object> slitterDown(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(slitterPdaService.slitterDown(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,11 @@ public interface SlitterPdaService {
|
||||
* @return /
|
||||
*/
|
||||
JSONObject vehicleReturn(JSONObject param);
|
||||
|
||||
/**
|
||||
* 分切下料任务
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject slitterDown(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -9,19 +9,26 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.pda.mps.service.SlitterPdaService;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.SendShaftAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.slitter.SlitterDownAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.slitter.SlitterSendRollAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.slitter.SlitterUpTrussTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -43,6 +50,10 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
private SlitterSendRollAGVTask slitterSendRollAGVTask;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService cutpointivtService;
|
||||
@Autowired
|
||||
private IpdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private SlitterDownAGVTask slitterDownAGVTask;
|
||||
@Override
|
||||
public JSONObject queryOrderInfo(JSONObject param) {
|
||||
List<PdmBiRawfoilworkorder> orders = rawfoilworkorderService.getAllUsedRawPlanOnZc();
|
||||
@@ -130,4 +141,40 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
result.put("data", new JSONObject());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject slitterDown(JSONObject param) {
|
||||
log.info("手持分切下料 - {}", param);
|
||||
// point_code: 分切机设备编码
|
||||
// 分切机设备
|
||||
String deviceCode = param.getString("point_code");
|
||||
StIvtCutpointivt device = cutpointivtService.getPintByExtCode(deviceCode, false);
|
||||
List<String> qzzNo = Stream.of(device.getUp_qzzno(), device.getDown_qzzno())
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
if (qzzNo.size() == 0) {
|
||||
throw new BadRequestException("分切机 " + deviceCode + " 的分切计划不存在!");
|
||||
}
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.getByQzzNos(qzzNo, "05");
|
||||
if (list.size() == 0) {
|
||||
throw new BadRequestException("分切机" + deviceCode + " 的分切计划 " + qzzNo + " 不存在");
|
||||
}
|
||||
List<SchBaseTask> tasks = taskService.checkHaveTask(deviceCode);
|
||||
if (tasks.size() > 0) {
|
||||
throw new BadRequestException("分切机" + deviceCode + " 已经有存在的任务");
|
||||
}
|
||||
List<String> collect = list
|
||||
.stream()
|
||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||
.collect(Collectors.toList());
|
||||
param.put("container", collect);
|
||||
param.put("config_code", "SlitterDownAGVTask");
|
||||
param.put("device_code", device.getPoint_code());
|
||||
param.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
log.info("调用分切机{}下卷, 参数:{}", deviceCode, param);
|
||||
slitterDownAGVTask.apply(param);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "分切机" + deviceCode + "下卷成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,4 +55,27 @@ public class NbjPdaController {
|
||||
public ResponseEntity<Object> doSubVolumeBindingWeight(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(nbjPdaService.doSubVolumeBindingWeight(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getSlitterNeedShaftPlans")
|
||||
@Log(value = "套轴绑定-获取分切计划", isAddLogTable=false)
|
||||
public ResponseEntity<Object> getSlitterNeedShaftPlans(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(nbjPdaService.getSlitterNeedShaftPlans(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/doBindingGx")
|
||||
@Log("套轴绑定-绑定管芯")
|
||||
public ResponseEntity<Object> doBindingGx(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(nbjPdaService.doBindingGx(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/getSlitterDeviceBox")
|
||||
@Log(value = "套轴绑定-分切机设备下拉框", isAddLogTable=false)
|
||||
public ResponseEntity<Object> getSlitterDeviceBox() {
|
||||
return new ResponseEntity<>(nbjPdaService.getSlitterDeviceBox(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/doSendShaft")
|
||||
@Log("送气胀轴-送轴")
|
||||
public ResponseEntity<Object> doSendShaft(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(nbjPdaService.doSendShaft(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ package org.nl.wms.pda.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -41,4 +45,30 @@ public interface NbjPdaService {
|
||||
* @return /
|
||||
*/
|
||||
JSONObject doSubVolumeBindingWeight(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取需要气胀轴的分切计划
|
||||
* @return /
|
||||
*/
|
||||
List<PdmBiSlittingproductionplan> getSlitterNeedShaftPlans(@RequestBody JSONObject param);
|
||||
|
||||
/**
|
||||
* 绑定管芯
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject doBindingGx(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取分切设备下拉框
|
||||
* @return /
|
||||
*/
|
||||
JSONArray getSlitterDeviceBox();
|
||||
|
||||
/**
|
||||
* 内包间送气胀轴
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject doSendShaft(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@ import org.nl.wms.basedata.material.service.ImdMeMaterialbaseService;
|
||||
import org.nl.wms.pda.st.service.GxPdaService;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.GxInStorageTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.GxOutStorageTask;
|
||||
import org.nl.wms.util.URLEnum;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -45,7 +47,7 @@ public class GxPdaServiceImpl implements GxPdaService {
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private GxInStorageTask gxInStorageTask;
|
||||
private GxOutStorageTask gxOutStorageTask;
|
||||
@Override
|
||||
public JSONArray getGxSpecification() {
|
||||
MdBaseClassstandard one = classstandardService.getOne(new LambdaQueryWrapper<MdBaseClassstandard>()
|
||||
@@ -76,7 +78,7 @@ public class GxPdaServiceImpl implements GxPdaService {
|
||||
}
|
||||
// 找管芯库中的空位。
|
||||
List<SchBasePoint> allGxPoints = pointService.getPointByConditions("A1", "A1-GXK",
|
||||
"2", "1", null, true);
|
||||
"3", "1", null, true);
|
||||
if (allGxPoints.size() < row.size()) {
|
||||
throw new BadRequestException("管芯库不够存放,只够存放" + allGxPoints.size() + "个管芯");
|
||||
}
|
||||
@@ -134,10 +136,15 @@ public class GxPdaServiceImpl implements GxPdaService {
|
||||
@Override
|
||||
public int remainingQty() {
|
||||
List<SchBasePoint> allGxPoints = pointService.getPointByConditions("A1", "A1-GXK",
|
||||
"2", "1", null, true);
|
||||
"3", "1", null, true);
|
||||
return allGxPoints.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管芯出库需要创建任务
|
||||
* @param param /
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirmedOutStorage(JSONObject param) {
|
||||
@@ -151,32 +158,39 @@ public class GxPdaServiceImpl implements GxPdaService {
|
||||
if (number <= 0) {
|
||||
throw new BadRequestException("数量必须大于0!");
|
||||
}
|
||||
// 判断还有几个同规格的管芯
|
||||
List<SchBasePoint> allPoint = pointService.getPointByConditions("A1", "A1-GXK",
|
||||
"2", "2", materialCode, true);
|
||||
// 判断还有几个同规格的管芯, 没任务
|
||||
List<SchBasePoint> allPoint = pointService.getAllBusinessNotTaskPoint("A1", "A1-GXK",
|
||||
"3", "2", materialCode) ;
|
||||
if (allPoint.size() == 0) {
|
||||
throw new BadRequestException("管芯不存在规格为[" + materialSpec + "]的管芯!");
|
||||
}
|
||||
log.info("找到规格:{} 的管芯有 {} 个", materialSpec, allPoint.size());
|
||||
number = Math.min(number, allPoint.size());
|
||||
log.info("输出 {} 个管芯", number);
|
||||
// acs参数:gx_code, device_code
|
||||
JSONArray acsArray = new JSONArray();
|
||||
|
||||
// 获取终点
|
||||
List<SchBasePoint> endPoints = pointService.getPointByConditions("A1", "A1-GXK",
|
||||
"2", null, null, true);
|
||||
if (endPoints.size() == 0) {
|
||||
throw new BadRequestException("管芯出口未找到!");
|
||||
}
|
||||
SchBasePoint endPoint = endPoints.get(0);
|
||||
List<SchBasePoint> updatePoints = new ArrayList<>();
|
||||
for (int i = 0; i < number; i++) {
|
||||
// 由任务完成来清除点位
|
||||
SchBasePoint point = allPoint.get(i);
|
||||
// 查找点位最终一次性发给ACS
|
||||
JSONObject acs = new JSONObject();
|
||||
acs.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
||||
acs.put("gx_code", point.getVehicle_code());
|
||||
acs.put("device_code", point.getDevice_code());
|
||||
acsArray.add(acs);
|
||||
// 点位清空
|
||||
clearPointNotUpdate(point, TaskFinishedTypeEnum.MANUAL_PDA);
|
||||
updatePoints.add(point);
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
||||
taskParam.put("point_code1", point.getPoint_code());
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
taskParam.put("vehicle_code", point.getVehicle_code());
|
||||
taskParam.put("vehicle_type", point.getVehicle_type());
|
||||
taskParam.put("config_code", "GxOutStorageTask");
|
||||
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
String task = gxOutStorageTask.createTask(taskParam);
|
||||
log.info("任务创建成功 - {}", task);
|
||||
}
|
||||
// todo: 调用ACS
|
||||
log.info("调用ACS管芯入库- {}", acsArray);
|
||||
// 批量清除点位
|
||||
pointService.updateBatchById(updatePoints);
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -11,23 +13,35 @@ import org.nl.config.lucene.TagNameEnum;
|
||||
import org.nl.wms.pda.st.service.NbjPdaService;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.PdaSendShaftAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.SendShaftAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.SubRollDownAGVTask;
|
||||
import org.nl.wms.sch.task_manage.tasks.other.PointToPointAGVTask;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.nl.wms.util.PointUtils.setBCutUpdateByPC;
|
||||
import static org.nl.wms.util.PointUtils.setUpdateByPC;
|
||||
|
||||
/**
|
||||
@@ -46,6 +60,14 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
||||
private SubRollDownAGVTask subRollDownAGVTask;
|
||||
@Autowired
|
||||
private IpdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bstIvtCutpointivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService stIvtCutpointivtService;
|
||||
@Autowired
|
||||
private PointToPointAGVTask pointToPointAGVTask;
|
||||
@Autowired
|
||||
private PdaSendShaftAGVTask pdaSendShaftAGVTask;
|
||||
@Override
|
||||
public JSONObject changeLiftStatus(JSONObject param) {
|
||||
MDC.put("tag_name", TagNameEnum.SWITCH_STATUS_OF_LIFT.getTag());
|
||||
@@ -143,4 +165,178 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
||||
result.put("message", "子卷绑定重量成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PdmBiSlittingproductionplan> getSlitterNeedShaftPlans(@RequestBody JSONObject param) {
|
||||
String pointCode = param.getString("point_code");
|
||||
// 获取所有状态是01的分切计划
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "01")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_child_tz_ok, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(ObjectUtil.isNotEmpty(pointCode), PdmBiSlittingproductionplan::getResource_name, pointCode));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject doBindingGx(JSONObject param) {
|
||||
log.info("手持绑定管芯 - {}", param);
|
||||
// param: point_code, vehicle_code,workorder_id(row)
|
||||
// 维护管芯编码到分切计划上,生成虚拟气胀轴编码维护到分切计划与分切机
|
||||
String pointCode = param.getString("point_code");
|
||||
String vehicleCode = param.getString("vehicle_code");
|
||||
JSONArray row = param.getJSONArray("row");
|
||||
String[] gx = vehicleCode.split(",");
|
||||
BstIvtCutpointivt tzzcPoint = bstIvtCutpointivtService.getPintByTrussCode(pointCode, false);
|
||||
if (ObjectUtil.isEmpty(row)) {
|
||||
// 代表没有与工单绑定,因此只是把管芯编码维护上去,由人工自行创建任务
|
||||
if (tzzcPoint.getTruss_point_code1().equals(pointCode)) {
|
||||
// 上轴
|
||||
tzzcPoint.setUp_gx1(gx[0]);
|
||||
tzzcPoint.setUp_gx2(gx.length > 1 ? gx[1] : "");
|
||||
} else {
|
||||
// 下轴
|
||||
tzzcPoint.setDown_gx1(gx[0]);
|
||||
tzzcPoint.setDown_gx2(gx.length > 1 ? gx[1] : "");
|
||||
}
|
||||
} else {
|
||||
// 如果管芯有值,也选择了分切计划
|
||||
if (row.size() != gx.length) {
|
||||
throw new BadRequestException("管芯数与计划数不相等!");
|
||||
}
|
||||
List<String> workorderIds = new ArrayList<>();
|
||||
for (int i = 0; i < row.size(); i++) {
|
||||
JSONObject jsonObject = row.getJSONObject(i);
|
||||
workorderIds.add(jsonObject.getString("workorder_id"));
|
||||
}
|
||||
// 与工单绑定,AGV任务完成后创建任务
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getWorkorder_id, workorderIds));
|
||||
// 当前套轴的分切计划
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
// 生成虚拟气胀轴编码
|
||||
String qzzNo = TaskUtils.createVirtualQzzNo(resourceName, "yyMMddHHmmss", demoPlan);
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
plan.setQzzno(qzzNo);
|
||||
plan.setIs_child_tz_ok("1");
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
plan.setPaper_tube_material(gx[0]);
|
||||
} else {
|
||||
plan.setPaper_tube_material(gx[1]);
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
plan.setFRP_material(gx[0]);
|
||||
} else {
|
||||
plan.setFRP_material(gx[1]);
|
||||
}
|
||||
}
|
||||
// 点位更新数据
|
||||
if (tzzcPoint.getTruss_point_code1().equals(pointCode)) {
|
||||
// 上轴
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
// 左边
|
||||
tzzcPoint.setUp_gx1(gx[0]);
|
||||
} else {
|
||||
tzzcPoint.setUp_gx2(gx[1]);
|
||||
}
|
||||
tzzcPoint.setQzz_no1(qzzNo);
|
||||
} else {
|
||||
// 下轴
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
// 左边
|
||||
tzzcPoint.setDown_gx1(gx[0]);
|
||||
} else {
|
||||
tzzcPoint.setDown_gx2(gx[1]);
|
||||
}
|
||||
tzzcPoint.setQzz_no2(qzzNo);
|
||||
}
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
}
|
||||
// 批量更新
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
|
||||
}
|
||||
tzzcPoint.setPoint_status("2");
|
||||
setBCutUpdateByPC(tzzcPoint);
|
||||
bstIvtCutpointivtService.updateById(tzzcPoint);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "管芯绑定成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getSlitterDeviceBox() {
|
||||
List<StIvtCutpointivt> list = stIvtCutpointivtService.getListByStartsArea("A1", false);
|
||||
JSONArray jsonArray = list.stream()
|
||||
.map(item -> {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("text", item.getPoint_code());
|
||||
jsonObject.put("value", item.getExt_code());
|
||||
return jsonObject;
|
||||
})
|
||||
.collect(Collectors.toCollection(JSONArray::new));
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject doSendShaft(JSONObject param) {
|
||||
log.info("手持送气胀轴 - {}", param);
|
||||
// param: point_code, device
|
||||
String pointCode = param.getString("point_code");
|
||||
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode);
|
||||
if (CollectionUtil.isNotEmpty(schBaseTasks)) {
|
||||
throw new BadRequestException("该点:" + pointCode + "已经存在任务!");
|
||||
}
|
||||
String device = param.getString("device");
|
||||
BstIvtCutpointivt startPoint = bstIvtCutpointivtService.getPintByTrussCode(pointCode, false);
|
||||
// 组织参数,创建AGV任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("device_code", startPoint.getPoint_code());
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("config_code", "PdaSendShaftAGVTask");
|
||||
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
if (device == null) {
|
||||
// 如果没有选择目的地,就是根据点位上维护的信息送
|
||||
List<String> collect = Stream.of(startPoint.getQzz_no1(), startPoint.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(
|
||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "01")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("系统找不到对应的分切计划,请确保维护了点位信息,或者指定设备!");
|
||||
}
|
||||
// 获取上轴分切计划和下轴分切计划,各一条
|
||||
PdmBiSlittingproductionplan currentUpPlan = plans.stream()
|
||||
.filter(p -> "1".equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
PdmBiSlittingproductionplan currentDownPlan = plans.stream()
|
||||
.filter(p -> "2".equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(demoPlan.getResource_name(), false);
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
taskParam.put("vehicle_code", currentUpPlan.getQzzno());
|
||||
taskParam.put("vehicle_code2", currentDownPlan.getQzzno());
|
||||
taskParam.put("is_flag", "1");
|
||||
} else {
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(device, false);
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
// 不需要修改点位信息
|
||||
taskParam.put("is_flag", "0");
|
||||
}
|
||||
pdaSendShaftAGVTask.createTask(taskParam);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "送轴任务创建成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.pda.st.service.OtherPdaService;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
@@ -40,6 +41,8 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
private RawCallRollTrussTask rawCallRollTrussTask;
|
||||
@Autowired
|
||||
private SlitterSendRollTrussTask slitterSendRollTrussTask;
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject startMoveWasteFoil(JSONObject param) {
|
||||
@@ -104,7 +107,15 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
param.put("up_task_code", task.getTask_code());
|
||||
param.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
wasteFoilAGVTask.apply(param);
|
||||
// todo: 通知ACS完成上一个任务
|
||||
// 通知ACS完成上一个任务
|
||||
JSONArray acs = new JSONArray();
|
||||
JSONObject acsParam = new JSONObject();
|
||||
acsParam.put("task_code", task.getTask_code());
|
||||
acsParam.put("product_area", task.getProduct_area());
|
||||
acs.add(acsParam);
|
||||
log.info("通知ACS完成上一个任务 - {}", acs);
|
||||
JSONObject jsonObject = wmsToAcsService.canFinishPreviousTask(acs);
|
||||
log.info("通知ACS完成任务后的反馈 - {}", jsonObject);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "废箔继续搬运请求成功!");
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.Set;
|
||||
@Slf4j
|
||||
public class PdmBiRawfoilworkorderController {
|
||||
|
||||
|
||||
@Resource
|
||||
private IpdmBiRawfoilworkorderService pdmBiRawfoilworkorderService;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class PdmBiRawfoilworkorderParam extends BaseQuery<PdmBiRawfoilworkorder>
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
private String create_id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@@ -105,7 +105,7 @@ public class PdmBiRawfoilworkorderParam extends BaseQuery<PdmBiRawfoilworkorder>
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
private String update_optid;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
|
||||
@@ -149,7 +149,7 @@ public class PdmBiSlittingproductionplanParam extends BaseQuery<PdmBiSlittingpro
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
private String update_optid;
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
@@ -161,11 +161,11 @@ public class PdmBiSlittingproductionplanParam extends BaseQuery<PdmBiSlittingpro
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long sysdeptid;
|
||||
private String sysdeptid;
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private Long syscompanyid;
|
||||
private String syscompanyid;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@@ -202,4 +202,5 @@ public class PdmBiSlittingproductionplanParam extends BaseQuery<PdmBiSlittingpro
|
||||
* 子卷等级
|
||||
*/
|
||||
private String level;
|
||||
private String product_area;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,20 @@ public interface IpdmBiSlittingproductionplanService extends IService<PdmBiSlitt
|
||||
* @return /
|
||||
*/
|
||||
PdmBiSlittingproductionplan getByTubeCode(String code);
|
||||
|
||||
/**
|
||||
* 根据状态获取指定的气胀轴编码的分切计划
|
||||
* @param qzzNo 气胀轴数组
|
||||
* @param status 状态
|
||||
* @return /
|
||||
*/
|
||||
List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo, String status);
|
||||
/**
|
||||
* 获取指定的气胀轴编码的分切计划
|
||||
* @param qzzNo 气胀轴数组
|
||||
* @return /
|
||||
*/
|
||||
List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.pdm.bi.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -22,6 +23,7 @@ import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||
import org.nl.wms.pdm.bi.dao.mapper.PdmBiRawfoilworkorderMapper;
|
||||
import org.nl.wms.pdm.bi.dto.PdmBiRawfoilworkorderParam;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
||||
import org.nl.wms.pdm.ivt.raw.service.IstIvtSbpointivtService;
|
||||
import org.nl.wms.pdm.ivt.raw.service.dao.StIvtSbpointivt;
|
||||
import org.nl.wms.pdm.ivt.raw.service.dao.mapper.StIvtSbpointivtMapper;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
@@ -58,9 +60,9 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
|
||||
@Resource
|
||||
private StIvtSbpointivtMapper stIvtSbpointivtMapper;
|
||||
@Resource
|
||||
private ImdMeMaterialbaseService materialBaseMapper;
|
||||
@Resource
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
@Autowired
|
||||
private IstIvtSbpointivtService sbpointivtService;
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
@@ -89,6 +91,11 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
|
||||
if (whereJson.containsKey("end_time")) {
|
||||
queryWrapper.le(PdmBiRawfoilworkorder::getCreate_time, whereJson.get("end_time"));
|
||||
}
|
||||
if (whereJson.containsKey("statusX") && "1".equals(whereJson.get("statusX"))) {
|
||||
queryWrapper.ne(PdmBiRawfoilworkorder::getStatus, "09");
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.get("material_spec")),
|
||||
PdmBiRawfoilworkorder::getWind_roll, whereJson.get("material_spec"));
|
||||
}
|
||||
queryWrapper.eq(PdmBiRawfoilworkorder::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"));
|
||||
queryWrapper.orderByDesc(PdmBiRawfoilworkorder::getCreate_time);
|
||||
return pdmBiRawfoilworkorderMapper.selectPage(resultPage, queryWrapper);
|
||||
@@ -139,24 +146,26 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
|
||||
* @param params 对象实体
|
||||
*/
|
||||
private void parametersValidation(PdmBiRawfoilworkorderParam params, boolean isCreate) {
|
||||
StIvtSbpointivt stIvtSbpointivt = stIvtSbpointivtMapper.selectOne(new LambdaQueryWrapper<StIvtSbpointivt>().eq(StIvtSbpointivt::getExt_code, params.getResource_name()));
|
||||
StIvtSbpointivt stIvtSbpointivt = sbpointivtService.getByExtCode(params.getResource_name());
|
||||
if (!isCreate) {
|
||||
PdmBiRawfoilworkorder dto = pdmBiRawfoilworkorderMapper.selectById(params.getWorkorder_id());
|
||||
if (dto == null) {
|
||||
throw new BadRequestException("不存在该数据!");
|
||||
}
|
||||
}
|
||||
if (stIvtSbpointivt != null) {
|
||||
if (stIvtSbpointivt == null) {
|
||||
throw new BadRequestException("点位设备不存在");
|
||||
}
|
||||
params.setPoint_code(stIvtSbpointivt.getPoint_code());
|
||||
params.setProduct_area(stIvtSbpointivt.getProduct_area());
|
||||
PdmBiRawfoilworkorder pdmBiRawfoilworkorder = pdmBiRawfoilworkorderMapper.selectOne(new LambdaQueryWrapper<PdmBiRawfoilworkorder>().eq(PdmBiRawfoilworkorder::getContainer_name, params.getCreate_name()).ne(PdmBiRawfoilworkorder::getStatus, PRODUCT_STATUS.code("结束")));
|
||||
if (pdmBiRawfoilworkorder != null) {
|
||||
throw new BadRequestException("母卷号已存在");
|
||||
}
|
||||
MdMeMaterialbase mdMeMaterialbase = materialBaseMapper.getOne(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_code, params.getProduct_name()).eq(MdMeMaterialbase::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).eq(MdMeMaterialbase::getIs_used, IOSEnum.IS_NOTANDYES.code("是")));
|
||||
if (mdMeMaterialbase == null) {
|
||||
throw new BadRequestException("物料不存在");
|
||||
}
|
||||
// MdMeMaterialbase mdMeMaterialbase = materialBaseMapper.getOne(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_code, params.getProduct_name()).eq(MdMeMaterialbase::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).eq(MdMeMaterialbase::getIs_used, IOSEnum.IS_NOTANDYES.code("是")));
|
||||
// if (mdMeMaterialbase == null) {
|
||||
// throw new BadRequestException("物料不存在");
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,14 +193,14 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
|
||||
private PdmBiRawfoilworkorder getBasicInfo(PdmBiRawfoilworkorderParam params, boolean isCreate) {
|
||||
if (isCreate) {
|
||||
params.setWorkorder_id(IdUtil.getStringId());
|
||||
params.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
params.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
params.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
params.setCreate_time(DateUtil.now());
|
||||
params.setUp_coiler_date(DateUtil.now());
|
||||
params.setRealstart_time(DateUtil.now());
|
||||
params.setIs_delete(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
params.setStatus(PRODUCT_STATUS.code("开始"));
|
||||
}
|
||||
params.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
params.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
params.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
params.setUpdate_time(DateUtil.now());
|
||||
PdmBiRawfoilworkorder pdmBiRawfoilworkorder = new PdmBiRawfoilworkorder();
|
||||
|
||||
@@ -97,6 +97,10 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
if (whereJson.containsKey("end_time")) {
|
||||
queryWrapper.le(PdmBiSlittingproductionplan::getManufacture_date, whereJson.get("end_time"));
|
||||
}
|
||||
if (whereJson.containsKey("statusX") && "1".equals(whereJson.get("statusX"))) {
|
||||
// 对话框
|
||||
queryWrapper.eq(PdmBiSlittingproductionplan::getStatus, "09");
|
||||
}
|
||||
return pdmBiSlittingproductionplanMapper.selectPage(resultPage, queryWrapper);
|
||||
}
|
||||
|
||||
@@ -123,7 +127,19 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
*/
|
||||
@Override
|
||||
public void create(PdmBiSlittingproductionplanParam params) {
|
||||
pdmBiSlittingproductionplanMapper.insert(getBasicInfo(params, true));
|
||||
PdmBiSlittingproductionplan basicInfo = getBasicInfo(params, true);
|
||||
if (ObjectUtil.isEmpty(basicInfo.getContainer_name())) {
|
||||
// 子卷为空则生成
|
||||
// 获取同母卷号,同组,的数量
|
||||
Integer integer = pdmBiSlittingproductionplanMapper.selectCount(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq("1".equals(params.getOrder_type()), PdmBiSlittingproductionplan::getParent_container_name, params.getParent_container_name())
|
||||
.eq("2".equals(params.getOrder_type()), PdmBiSlittingproductionplan::getRestruct_container_name, params.getRestruct_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, params.getSplit_group()));
|
||||
String con = ObjectUtil.isEmpty(params.getParent_container_name())?params.getRestruct_container_name():params.getParent_container_name()
|
||||
+ params.getSplit_group() + (integer + 1);
|
||||
basicInfo.setContainer_name(con);
|
||||
}
|
||||
pdmBiSlittingproductionplanMapper.insert(basicInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +185,8 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
params.setIs_child_ps_ok(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
params.setIs_delete(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
}
|
||||
params.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
params.setProduct_area("A1");
|
||||
params.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
params.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
params.setUpdate_time(DateUtil.now());
|
||||
PdmBiSlittingproductionplan pdmBiSlittingproductionplan = new PdmBiSlittingproductionplan();
|
||||
@@ -232,5 +249,22 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
return getOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo, String status) {
|
||||
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
|
||||
lam.in(PdmBiSlittingproductionplan::getQzzno, qzzNo)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, status);
|
||||
return pdmBiSlittingproductionplanMapper.selectList(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PdmBiSlittingproductionplan> getByQzzNos(List<String> qzzNo) {
|
||||
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
|
||||
lam.in(PdmBiSlittingproductionplan::getQzzno, qzzNo)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0");
|
||||
return pdmBiSlittingproductionplanMapper.selectList(lam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -122,4 +122,11 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getPintByAgvCodesByPointTypeAndArea(String area, List<String> types);
|
||||
|
||||
/**
|
||||
* 获取指定设备的气胀轴点位
|
||||
* @param resourceName /
|
||||
* @return /
|
||||
*/
|
||||
BstIvtCutpointivt getSleeveShaftOkNotTaskPoint(String resourceName);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,18 @@ public class BstIvtCutpointivt implements Serializable {
|
||||
/** 气胀轴编码2 */
|
||||
private String qzz_no2;
|
||||
|
||||
/** 上轴管芯-左边 */
|
||||
private String up_gx1;
|
||||
|
||||
/** 上轴管芯-右边 */
|
||||
private String up_gx2;
|
||||
|
||||
/** 下轴管芯-左边 */
|
||||
private String down_gx1;
|
||||
|
||||
/** 下轴管芯-右边 */
|
||||
private String down_gx2;
|
||||
|
||||
/** 点位类型 */
|
||||
private String point_type;
|
||||
|
||||
|
||||
@@ -23,4 +23,6 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
|
||||
List<BstIvtCutpointivt> getReallyQzzSameDevice(String resourceName);
|
||||
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByStatusNotCheckPickUpCompleted(String type, String pointStatus, String area, String sort);
|
||||
|
||||
BstIvtCutpointivt getSleeveShaftOkNotTaskPoint(String resourceName);
|
||||
}
|
||||
|
||||
@@ -134,4 +134,26 @@
|
||||
ORDER BY bic.sort_seq DESC
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSleeveShaftOkNotTaskPoint"
|
||||
resultType="org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt">
|
||||
SELECT bic.*
|
||||
FROM bst_ivt_cutpointivt bic
|
||||
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bic.qzz_no1
|
||||
OR pp.qzzno = bic.qzz_no2
|
||||
WHERE bic.point_type = '1'
|
||||
AND bic.is_used = '1'
|
||||
AND bic.point_status = '2'
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ <= ]]> '071'
|
||||
AND t.task_status <![CDATA[ <> ]]> '07'
|
||||
AND (t.point_code1 = bic.point_code OR t.point_code2 = bic.point_code
|
||||
OR t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1
|
||||
OR t.point_code1 = bic.truss_point_code2 oR t.point_code2 = bic.truss_point_code2))
|
||||
AND IFNULL(pp.qzzno, '') <![CDATA[ <> ]]> ''
|
||||
AND pp.is_delete = '0'
|
||||
AND pp.`status` = '01'
|
||||
AND pp.resource_name = #{resourceName}
|
||||
ORDER BY bic.update_time LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -144,4 +144,9 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
.eq(BstIvtCutpointivt::getProduct_area, area)
|
||||
.in(BstIvtCutpointivt::getPoint_type, types));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BstIvtCutpointivt getSleeveShaftOkNotTaskPoint(String resourceName) {
|
||||
return bstIvtCutpointivtMapper.getSleeveShaftOkNotTaskPoint(resourceName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,22 @@ public interface IstIvtCutpointivtService extends IService<StIvtCutpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
StIvtCutpointivt getOneByCode(String code);
|
||||
|
||||
/**
|
||||
* 获取区域指定的分切机信息
|
||||
* @param area 区域
|
||||
* @param flag 是否禁用校验
|
||||
* @return /
|
||||
*/
|
||||
List<StIvtCutpointivt> getListByStartsArea(String area, boolean flag);
|
||||
|
||||
/**
|
||||
* 通过设备编码获取分切设备点位信息
|
||||
* @param code 编码
|
||||
* @param flag 是否禁用校验
|
||||
* @return /
|
||||
*/
|
||||
StIvtCutpointivt getPintByExtCode(String code, boolean flag);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -130,6 +130,22 @@ public class StIvtCutpointivtServiceImpl extends ServiceImpl<StIvtCutpointivtMap
|
||||
return getOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StIvtCutpointivt> getListByStartsArea(String area, boolean flag) {
|
||||
LambdaQueryWrapper<StIvtCutpointivt> lam = new QueryWrapper<StIvtCutpointivt>().lambda();
|
||||
lam.eq(StIvtCutpointivt::getProduct_area, area)
|
||||
.eq(flag, StIvtCutpointivt::getIs_used, "1");
|
||||
return stIvtCutpointivtMapper.selectList(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtCutpointivt getPintByExtCode(String code, boolean flag) {
|
||||
LambdaQueryWrapper<StIvtCutpointivt> lam = new QueryWrapper<StIvtCutpointivt>().lambda();
|
||||
lam.eq(StIvtCutpointivt::getExt_code, code)
|
||||
.eq(flag, StIvtCutpointivt::getIs_used, "1");
|
||||
return stIvtCutpointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取实体基础信息
|
||||
|
||||
@@ -66,6 +66,8 @@ public interface IstIvtSbpointivtService extends IService<StIvtSbpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
StIvtSbpointivt getByPointCode(String pointCode, boolean flag);
|
||||
|
||||
StIvtSbpointivt getByExtCode(String resourceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pdm.ivt.raw.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -7,6 +8,7 @@ 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.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pdm.ivt.raw.service.dao.StIvtSbpointivt;
|
||||
import org.nl.wms.pdm.ivt.raw.service.dao.mapper.StIvtSbpointivtMapper;
|
||||
import org.nl.wms.pdm.ivt.raw.service.dao.dto.StIvtSbpointivtParam;
|
||||
@@ -127,6 +129,17 @@ public class StIvtSbpointivtServiceImpl extends ServiceImpl<StIvtSbpointivtMappe
|
||||
return getOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtSbpointivt getByExtCode(String resourceName) {
|
||||
LambdaQueryWrapper<StIvtSbpointivt> lam = new QueryWrapper<StIvtSbpointivt>().lambda();
|
||||
lam.eq(StIvtSbpointivt::getExt_code, resourceName);
|
||||
StIvtSbpointivt one = getOne(lam);
|
||||
if (ObjectUtil.isEmpty(one)) {
|
||||
throw new BadRequestException("设备号[" + resourceName + "]的生箔点位不存在!");
|
||||
}
|
||||
return one;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取实体基础信息
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
WHERE p.product_area = 'A1'
|
||||
AND p.point_type = '3'
|
||||
AND p.point_status = '2'
|
||||
AND p.region_code = 'A1-SJGK'
|
||||
AND p.vehicle_type = #{vehicleType}
|
||||
AND p.is_used = TRUE
|
||||
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.point_code1 = p.point_code AND t.task_status <![CDATA[<]]> '07')
|
||||
ORDER BY p.in_order_seq, p.update_time
|
||||
ORDER BY p.update_time
|
||||
</select>
|
||||
<select id="getHotNotTaskPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
||||
SELECT p.*
|
||||
@@ -56,8 +57,8 @@
|
||||
AND p.vehicle_type = #{vehicleType}
|
||||
</if>
|
||||
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[<]]> '07'
|
||||
AND (t.point_code1 = p.point_code AND t.point_code2 = p.point_code AND t.point_code3 = p.point_code
|
||||
AND t.point_code4 = p.point_code))
|
||||
AND (t.point_code1 = p.point_code OR t.point_code2 = p.point_code OR t.point_code3 = p.point_code
|
||||
OR t.point_code4 = p.point_code))
|
||||
ORDER BY p.in_order_seq, p.update_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -37,7 +37,6 @@ import static org.nl.wms.sch.task_manage.core.constant.TaskConstant.*;
|
||||
* <p>模板模式+策略模式,将具体的创建任务交付给具体的子类,能够做到责任拆分,各司其职</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public abstract class AbstractTask {
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
@@ -61,7 +61,6 @@ public class GxInStorageTask extends AbstractTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 取消
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.nl.wms.sch.task_manage.tasks.nbj;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.TaskStatus;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static org.nl.wms.util.TaskUtils.checkTaskOptionStatus;
|
||||
import static org.nl.wms.util.TaskUtils.setUpdateByType;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 管芯出库任务
|
||||
* @Date: 2024/8/16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(value = "GxOutStorageTask")
|
||||
public class GxOutStorageTask extends AbstractTask {
|
||||
private final String THIS_CLASS = GxOutStorageTask.class.getName();
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
// 创建任务
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setConfig_code("GxOutStorageTask");
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
task.setVehicle_code(form.getString("vehicle_code"));
|
||||
task.setVehicle_type(form.getString("vehicle_type"));
|
||||
task.setCreate_mode(form.getString("create_mode"));
|
||||
task.setRequest_param(JSONObject.toJSONString(form));
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
taskService.save(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 起点清空
|
||||
String pointCode1 = taskObj.getPoint_code1();
|
||||
SchBasePoint point = pointService.getById(pointCode1);
|
||||
PointUtils.clearPoint(point, taskFinishedType);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 取消
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.nl.wms.sch.task_manage.tasks.nbj;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.TaskStatus;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.nl.wms.util.TaskUtils.checkTaskOptionStatus;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持送气胀轴AGV任务
|
||||
* @Date: 2024/8/20
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(value = "PdaSendShaftAGVTask")
|
||||
public class PdaSendShaftAGVTask extends AbstractTask {
|
||||
private final String THIS_CLASS = PdaSendShaftAGVTask.class.getName();
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bstIvtCutpointivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService stIvtCutpointivtService;
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
// 创建任务
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setConfig_code("PdaSendShaftAGVTask");
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
task.setVehicle_code(form.getString("vehicle_code"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setVehicle_type(form.getString("vehicle_type"));
|
||||
task.setCreate_mode(form.getString("create_mode"));
|
||||
task.setRequest_param(JSONObject.toJSONString(form));
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
taskService.save(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
JSONObject requestObj = JSONObject.parseObject(taskObj.getRequest_param());
|
||||
String isFlag = requestObj.getString("is_flag");
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
BstIvtCutpointivt startPoint = bstIvtCutpointivtService.getPintByAgvCode(startPointCode, false);
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getOneByCode(endPointCode);
|
||||
if ("1".equals(isFlag)) {
|
||||
// 终点赋值
|
||||
endPoint.setUp_qzzno(taskObj.getVehicle_code());
|
||||
endPoint.setDown_qzzno(taskObj.getVehicle_code2());
|
||||
PointUtils.setCutUpdateByType(endPoint, taskFinishedType);
|
||||
stIvtCutpointivtService.updateById(endPoint);
|
||||
}
|
||||
// 起点清空
|
||||
startPoint.setPoint_status("1");
|
||||
startPoint.setUp_gx1("");
|
||||
startPoint.setUp_gx2("");
|
||||
startPoint.setDown_gx1("");
|
||||
startPoint.setDown_gx2("");
|
||||
startPoint.setQzz_no1("");
|
||||
startPoint.setQzz_no2("");
|
||||
PointUtils.setBCutUpdateByType(startPoint, taskFinishedType);
|
||||
bstIvtCutpointivtService.updateById(startPoint);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 取消
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package org.nl.wms.sch.task_manage.tasks.nbj;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.TaskStatus;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.nl.wms.util.TaskUtils.checkTaskOptionStatus;
|
||||
import static org.nl.wms.util.TaskUtils.setUpdateByPC;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 送气胀轴AGV任务
|
||||
* @Date: 2024/8/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(value = "SendShaftAGVTask")
|
||||
public class SendShaftAGVTask extends AbstractTask {
|
||||
private final String THIS_CLASS = SendShaftAGVTask.class.getName();
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService stIvtCutpointivtService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IpdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCompletion(SchBaseTask task) {
|
||||
// 送气胀轴到分切机,通过查找是否有套好轴没任务,并且是指定的分切机的点位。有则创建AGV任务
|
||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
BstIvtCutpointivt startPoint = bcutpointivtService.getSleeveShaftOkNotTaskPoint(requestObj.getString("resource_name"));
|
||||
if (ObjectUtil.isEmpty(startPoint)) {
|
||||
log.warn("没有找到设备为[ {} ]套好轴的气胀轴点位信息!", requestObj.getString("resource_name"));
|
||||
}
|
||||
List<String> collect = Stream.of(startPoint.getUp_gx1(), startPoint.getUp_gx2(), startPoint.getDown_gx1(), startPoint.getDown_gx2())
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
requestObj.put("tubes", collect);
|
||||
// 分切计划改成配送中:01->02
|
||||
List<String> qzzNos = Stream.of(startPoint.getQzz_no1(), startPoint.getQzz_no2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
LambdaUpdateWrapper<PdmBiSlittingproductionplan> planLam = new LambdaUpdateWrapper<>();
|
||||
planLam.set(PdmBiSlittingproductionplan::getStatus, "02")
|
||||
.set(PdmBiSlittingproductionplan::getUpdate_time, DateUtil.now())
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNos);
|
||||
slittingproductionplanService.update(planLam);
|
||||
// 创建AGV任务
|
||||
task.setVehicle_code(startPoint.getQzz_no1());
|
||||
task.setVehicle_code2(startPoint.getQzz_no2());
|
||||
task.setPoint_code1(startPoint.getPoint_code());
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
task.setRequest_param(requestObj.toJSONString());
|
||||
setUpdateByPC(task);
|
||||
taskService.save(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
BstIvtCutpointivt startPoint = bcutpointivtService.getPintByAgvCode(startPointCode, false);
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getOneByCode(endPointCode);
|
||||
// 分切计划修改状态:02->03
|
||||
List<String> qzzNos = Stream.of(startPoint.getQzz_no1(), startPoint.getQzz_no2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
LambdaUpdateWrapper<PdmBiSlittingproductionplan> planLam = new LambdaUpdateWrapper<>();
|
||||
planLam.set(PdmBiSlittingproductionplan::getStatus, "03")
|
||||
.set(PdmBiSlittingproductionplan::getUpdate_time, DateUtil.now())
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNos);
|
||||
slittingproductionplanService.update(planLam);
|
||||
// 起点清空
|
||||
startPoint.setQzz_no1("");
|
||||
startPoint.setQzz_no2("");
|
||||
startPoint.setUp_gx1("");
|
||||
startPoint.setUp_gx2("");
|
||||
startPoint.setDown_gx1("");
|
||||
startPoint.setDown_gx2("");
|
||||
PointUtils.setBCutUpdateByType(startPoint, taskFinishedType);
|
||||
bcutpointivtService.updateById(startPoint);
|
||||
// 终点赋值气胀轴编码
|
||||
endPoint.setUp_qzzno(taskObj.getVehicle_code());
|
||||
endPoint.setDown_qzzno(taskObj.getVehicle_code2());
|
||||
PointUtils.setCutUpdateByType(endPoint, taskFinishedType);
|
||||
stIvtCutpointivtService.updateById(endPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 取消
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import static org.nl.wms.util.TaskUtils.setUpdateByPC;
|
||||
* @Description: 点对点AGV任务
|
||||
* @Date: 2024/8/15
|
||||
*/
|
||||
@Deprecated
|
||||
@Slf4j
|
||||
@Component(value = "PointToPointAGVTask")
|
||||
public class PointToPointAGVTask extends AbstractTask {
|
||||
@@ -40,6 +39,8 @@ public class PointToPointAGVTask extends AbstractTask {
|
||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
task.setPoint_code1(requestObj.getString("point_code1"));
|
||||
task.setPoint_code2(requestObj.getString("point_code2"));
|
||||
task.setVehicle_code(requestObj.getString("vehicle_code"));
|
||||
task.setVehicle_code2(requestObj.getString("vehicle_code2"));
|
||||
// 创建任务
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
package org.nl.wms.sch.task_manage.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.TaskStatus;
|
||||
import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.tasks.nbj.SendShaftAGVTask;
|
||||
import org.nl.wms.util.PointUtils;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.nl.wms.util.PointUtils.setBCutUpdateByType;
|
||||
import static org.nl.wms.util.TaskUtils.*;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切下料AGV任务
|
||||
* @Date: 2024/8/20
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(value = "SlitterDownAGVTask")
|
||||
public class SlitterDownAGVTask extends AbstractTask {
|
||||
private final String THIS_CLASS = SlitterDownAGVTask.class.getName();
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bstIvtCutpointivtService;
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
@Autowired
|
||||
private IpdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private SendShaftAGVTask sendShaftAGVTask;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService stIvtCutpointivtService;
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCompletion(SchBaseTask task) {
|
||||
// 分切下料,子卷信息在请求参数中
|
||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
JSONArray container = requestObj.getJSONArray("container");
|
||||
List<String> containerList = container.toJavaList(String.class);
|
||||
// 获取分切计划,最多4个需要出站的任务
|
||||
List<PdmBiSlittingproductionplan> currentPlans = slittingproductionplanService.list(
|
||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, containerList)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "05"));
|
||||
if (currentPlans.size() == 0) {
|
||||
throw new BadRequestException("当前子卷已经出卷或者不存在!");
|
||||
}
|
||||
// 获取上轴分切计划和下轴分切计划,各一条
|
||||
PdmBiSlittingproductionplan currentUpPlan = currentPlans.stream()
|
||||
.filter(p -> "1".equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
PdmBiSlittingproductionplan currentDownPlan = currentPlans.stream()
|
||||
.filter(p -> "2".equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
task.setPoint_code1(requestObj.getString("device_code"));
|
||||
// 查找终点,在内包间的区域找个空位.
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bstIvtCutpointivtService.getAreaNotTaskPointByStatus("1",
|
||||
"1", "0", "1");
|
||||
if (areaEmptyNotTaskPoint.size() == 0) {
|
||||
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
|
||||
}
|
||||
BstIvtCutpointivt endPoint = areaEmptyNotTaskPoint.get(0);
|
||||
RLock lock = redissonClient.getLock(endPoint.getPoint_code());
|
||||
boolean tryLock;
|
||||
try {
|
||||
tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
throw new BadRequestException("获取锁异常");
|
||||
}
|
||||
try {
|
||||
if (tryLock) {
|
||||
task.setPoint_code2(endPoint.getPoint_code());
|
||||
// 设置气胀轴
|
||||
task.setVehicle_code(currentUpPlan != null ? currentUpPlan.getQzzno() : "");
|
||||
task.setVehicle_code2(currentDownPlan != null ? currentDownPlan.getQzzno() : "");
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试!!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
// 创建任务
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
setUpdateByPC(task);
|
||||
taskService.save(task);
|
||||
log.info("任务创建成功:{}", task);
|
||||
// 下来的分切计划修改状态:05 -> 06
|
||||
currentPlans.forEach(plan -> {
|
||||
plan.setStatus("06");
|
||||
updateOptMessageBySlitterPlan(plan);
|
||||
});
|
||||
slittingproductionplanService.updateBatchById(currentPlans);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
List<String> qzzNo = Stream.of(taskObj.getVehicle_code(), taskObj.getVehicle_code2())
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
// 获取分切计划
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.getByQzzNos(qzzNo, "06");
|
||||
// 起点清空
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
StIvtCutpointivt startPoint = stIvtCutpointivtService.getOneByCode(startPointCode);
|
||||
startPoint.setUp_qzzno("");
|
||||
startPoint.setDown_qzzno("");
|
||||
PointUtils.setCutUpdateByType(startPoint, taskFinishedType);
|
||||
stIvtCutpointivtService.updateById(startPoint);
|
||||
// 终点设置数据
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
BstIvtCutpointivt endPoint = bstIvtCutpointivtService.getPintByAgvCode(endPointCode, false);
|
||||
endPoint.setQzz_no1(taskObj.getVehicle_code());
|
||||
endPoint.setQzz_no2(taskObj.getVehicle_code2());
|
||||
// 设置管芯编码
|
||||
setGxMaterialInfoToPoint(list, endPoint);
|
||||
setBCutUpdateByType(endPoint, taskFinishedType);
|
||||
bstIvtCutpointivtService.updateById(endPoint);
|
||||
// 更新分切计划 状态:06 -> 09
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("09");
|
||||
updateOptMessageBySlitterPlan(p);
|
||||
if (qzzNo.size() > 0) {
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNo));
|
||||
}
|
||||
PdmBiSlittingproductionplan demoPlan = list.get(0);
|
||||
// 创建送气胀轴任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("up_task_code", taskObj.getTask_code());
|
||||
taskParam.put("config_code", "SendShaftAGVTask");
|
||||
taskParam.put("resource_name", demoPlan.getResource_name());
|
||||
taskParam.put("create_mode", GeneralDefinition.TASK_CREATION);
|
||||
taskParam.put("device_code", startPointCode);
|
||||
sendShaftAGVTask.apply(taskParam);
|
||||
// 任务更新
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
// 分切计划回退
|
||||
List<String> downQzzNos = Stream.of(taskObj.getVehicle_code(), taskObj.getVehicle_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
// 更新分切计划
|
||||
// 下来的分切计划状态:06 -> 05
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("05");
|
||||
updateOptMessageBySlitterPlan(p);
|
||||
if (downQzzNos.size() > 0) {
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, downQzzNos));
|
||||
}
|
||||
// 取消
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
|
||||
import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt;
|
||||
import org.nl.wms.pdm.ivt.hot.service.IstIvtHotpointivtService;
|
||||
@@ -162,6 +163,36 @@ public class PointUtils {
|
||||
setUpdateByPC(pointObj);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 分切缓存点位修改更新信息
|
||||
**/
|
||||
public static void setBCutUpdateByAcs(BstIvtCutpointivt pointObj) {
|
||||
pointObj.setUpdate_optid(GeneralDefinition.ACS_ID);
|
||||
pointObj.setUpdate_optname(GeneralDefinition.ACS_NAME);
|
||||
pointObj.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分切缓存点位修改更新信息
|
||||
**/
|
||||
public static void setBCutUpdateByPC(BstIvtCutpointivt pointObj) {
|
||||
pointObj.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
pointObj.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
pointObj.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分切缓存赋值点位修改信息,只做赋值不做更新!!!
|
||||
* @param pointObj 点位
|
||||
* @param taskFinishedType 操作类型
|
||||
*/
|
||||
public static void setBCutUpdateByType(BstIvtCutpointivt pointObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
if (taskFinishedType.equals(TaskFinishedTypeEnum.AUTO_ACS)) {
|
||||
setBCutUpdateByAcs(pointObj);
|
||||
} else {
|
||||
setBCutUpdateByPC(pointObj);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 烘箱点位修改更新信息
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
@@ -16,6 +18,8 @@ import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.TaskStatus;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -249,4 +253,74 @@ public class TaskUtils {
|
||||
setRawOrderUpdatePC(order);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定格式的日期时间
|
||||
* @param format 格式
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String getDateTime(String format) {
|
||||
// 获取当前日期和时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 定义日期时间格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
// 格式化日期时间
|
||||
return now.format(formatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建虚拟气胀轴编码
|
||||
* @param resourceName 分切计划设备号
|
||||
* @param format 格式
|
||||
* @param plan 分切计划
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String createVirtualQzzNo(String resourceName, String format, PdmBiSlittingproductionplan demoPlan) {
|
||||
return resourceName.substring(0, 2)
|
||||
+ resourceName.substring(resourceName.length() - 2)
|
||||
+ demoPlan.getSplit_group()
|
||||
+ TaskUtils.getDateTime(format) + "-"
|
||||
+ demoPlan.getUp_or_down();
|
||||
}
|
||||
|
||||
/**
|
||||
* 赋值分切计划的修改时间、人等信息
|
||||
* @param plan 分切计划
|
||||
*/
|
||||
public static void updateOptMessageBySlitterPlan(PdmBiSlittingproductionplan plan) {
|
||||
plan.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
plan.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
plan.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置点位纸管信息
|
||||
* @param list 分切计划
|
||||
* @param point 分切暂存位
|
||||
*/
|
||||
public static void setGxMaterialInfoToPoint(List<PdmBiSlittingproductionplan> list, BstIvtCutpointivt point) {
|
||||
for (PdmBiSlittingproductionplan plan : list) {
|
||||
if ("1".equals(plan.getUp_or_down())) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
point.setUp_gx1("1".equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_material()
|
||||
: plan.getFRP_material());
|
||||
} else {
|
||||
point.setUp_gx2("1".equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_material()
|
||||
: plan.getFRP_material());
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
point.setDown_gx1("1".equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_material()
|
||||
: plan.getFRP_material());
|
||||
} else {
|
||||
point.setDown_gx2("1".equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_material()
|
||||
: plan.getFRP_material());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,11 @@
|
||||
<el-table-column prop="truss_point_code1" label="桁架点位编码1 " :min-width="flexWidth('truss_point_code1',crud.data,'桁架点位编码1 ')" />
|
||||
<el-table-column prop="truss_point_code2" label="桁架点位编码2" :min-width="flexWidth('truss_point_code2',crud.data,'桁架点位编码2')" />
|
||||
<el-table-column prop="qzz_no1" label="气胀轴编码1" :min-width="flexWidth('qzz_no1',crud.data,'气胀轴编码1')" />
|
||||
<el-table-column prop="up_gx1" label="上轴管芯1" :min-width="flexWidth('up_gx1',crud.data,'气胀轴编码1')" />
|
||||
<el-table-column prop="up_gx2" label="上轴管芯2" :min-width="flexWidth('up_gx2',crud.data,'气胀轴编码2')" />
|
||||
<el-table-column prop="qzz_no2" label="气胀轴编码2" :min-width="flexWidth('qzz_no2',crud.data,'气胀轴编码2')" />
|
||||
<el-table-column prop="down_gx1" label="下轴管芯1" :min-width="flexWidth('down_gx1',crud.data,'气胀轴编码1')" />
|
||||
<el-table-column prop="down_gx2" label="下轴管芯2" :min-width="flexWidth('down_gx2',crud.data,'气胀轴编码2')" />
|
||||
<el-table-column prop="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型型')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.BCUT_POINT_TYPE[scope.row.point_type] }}
|
||||
|
||||
@@ -191,14 +191,34 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 250px;" />
|
||||
<el-form-item label="卷类型">
|
||||
<!-- <el-input v-model="form.roll_type" style="width: 250px;" />-->
|
||||
<el-select v-model="form.roll_type" placeholder="请选择" style="width: 250px;">
|
||||
<el-option
|
||||
v-for="item in roll_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否重新更新">
|
||||
<el-radio v-model="form.is_reload_send" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_reload_send" label="1">是</el-radio>
|
||||
<el-form-item label="是否需要烘烤">
|
||||
<el-radio v-model="form.is_baking" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_baking" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.is_baking === '1'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="烘烤温度" prop="baking_temperature">
|
||||
<el-input v-model="form.baking_temperature" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="烘烤时间" prop="baking_time">
|
||||
<el-input v-model="form.baking_time" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -223,7 +243,7 @@
|
||||
<el-table-column prop="mfg_order_name" label="工单号" :min-width="flexWidth('mfg_order_name',crud.data,'工单号')" />
|
||||
<el-table-column prop="status" label="工单状态" :min-width="flexWidth('status',crud.data,'工单状态')" :formatter="formatStatusName" />
|
||||
<el-table-column prop="container_name" label="母卷号" :min-width="flexWidth('container_name',crud.data,'母卷号')" />
|
||||
<el-table-column prop="point_code2" label="点位编码" :min-width="flexWidth('point_code2',crud.data,'点位编码')" />
|
||||
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" />
|
||||
<el-table-column prop="resource_name" label="机台编码" :min-width="flexWidth('resource_name',crud.data,'机台编码')" />
|
||||
<el-table-column prop="product_name" label="产品编码" :min-width="flexWidth('product_name',crud.data,'产品编码')" />
|
||||
<el-table-column prop="theory_height" label="理论长度" :min-width="flexWidth('theory_height',crud.data,'理论长度')" />
|
||||
@@ -233,7 +253,7 @@
|
||||
<el-table-column prop="agvno" label="车号" :min-width="flexWidth('agvno',crud.data,'车号')" />
|
||||
<el-table-column prop="product_area" label="生产区域" :min-width="flexWidth('product_area',crud.data,'生产区域')" />
|
||||
<el-table-column prop="is_baking" label="请求烘烤" :min-width="flexWidth('is_baking',crud.data,'请求烘烤')" :formatter="formatBakeIsOrNot" />
|
||||
<el-table-column prop="is_instor" label="请求入半成品库" :min-width="flexWidth('is_instor',crud.data,'请求入半成品库')" :formatter="formatStorIsOrNot" />
|
||||
<!-- <el-table-column prop="is_instor" label="请求入半成品库" :min-width="flexWidth('is_instor',crud.data,'请求入半成品库')" :formatter="formatStorIsOrNot" />-->
|
||||
<el-table-column prop="update_time" label="更新时间" :min-width="flexWidth('update_time',crud.data,'更新时间')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
@@ -273,6 +293,10 @@ const defaultForm = {
|
||||
eqp_velocity: null,
|
||||
up_coiler_date: null,
|
||||
is_reload_send: '0',
|
||||
is_baking: '0',
|
||||
roll_type: null,
|
||||
baking_time: null,
|
||||
baking_temperature: null,
|
||||
productin_qty: null,
|
||||
realstart_time: null,
|
||||
realend_time: null,
|
||||
@@ -314,6 +338,13 @@ export default {
|
||||
dialogShow: false,
|
||||
openParam: null,
|
||||
permission: {},
|
||||
roll_type: [{
|
||||
value: '1',
|
||||
label: '小卷'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '大卷'
|
||||
}],
|
||||
rules: {
|
||||
resource_name: [
|
||||
{ required: true, message: '机台编码不能为空', trigger: 'blur' }
|
||||
@@ -335,6 +366,12 @@ export default {
|
||||
],
|
||||
p_coiler_date: [
|
||||
{ required: true, message: '上卷开始时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
baking_temperature: [
|
||||
{ required: true, message: '烘烤温度不能为空', trigger: 'blur' }
|
||||
],
|
||||
baking_time: [
|
||||
{ required: true, message: '烘烤时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="母卷选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="母卷号">
|
||||
<el-input
|
||||
v-model="query.container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="母卷号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收卷辊">
|
||||
<el-input
|
||||
v-model="query.material_spec"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="收卷辊"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="container_name" label="母卷号" width="160" />
|
||||
<el-table-column prop="resource_name" label="生箔机台" width="160" />
|
||||
<el-table-column prop="mfg_order_name" label="生产工单" width="160" />
|
||||
<el-table-column prop="description" label="产品" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="productin_qty" label="重量" width="140" />
|
||||
<el-table-column prop="realstart_time" label="开始时间" width="140" />
|
||||
<el-table-column prop="realend_time" label="结束时间" width="140" />
|
||||
<el-table-column prop="status" label="状态" width="140" />
|
||||
<!-- <el-table-column v-if="queryInfo === '库存顺序'" prop="total_material_qty" label="物料总数/块" width="140" />-->
|
||||
<el-table-column prop="product_area" label="生产区域" width="130px" />
|
||||
<el-table-column prop="is_baking" label="是否烘烤">
|
||||
<template slot-scope="scop">
|
||||
{{ scop.row.is_baking === '1' ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="wind_roll" label="收卷辊编码" width="135" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'MaterialDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '获取母卷',
|
||||
url: 'api/rawfoilworkorder',
|
||||
optShow: {},
|
||||
query: {
|
||||
is_used: true,
|
||||
statusX: '1'
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
flag: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: [],
|
||||
queryInfo: '物料顺序',
|
||||
queryFlag: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
queryMaterials() {
|
||||
this.queryFlag = !this.queryFlag
|
||||
if (this.queryFlag) {
|
||||
this.queryInfo = '库存顺序'
|
||||
this.crud.url = 'api/pdmBdWorkorder/materials'
|
||||
this.crud.toQuery()
|
||||
} else {
|
||||
this.queryInfo = '物料顺序'
|
||||
this.crud.url = 'api/mdBaseMaterial'
|
||||
this.crud.toQuery()
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.tableRadio, this.flag)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows, this.flag)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="母卷选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="母卷号">
|
||||
<el-input
|
||||
v-model="query.parent_container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="母卷号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号">
|
||||
<el-input
|
||||
v-model="query.container_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="子卷号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="管芯编码">
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="管芯编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="parent_container_name" label="母卷号" width="160" />
|
||||
<el-table-column prop="container_name" label="子卷号" width="160" />
|
||||
<el-table-column prop="resource_name" label="分切机台" width="160" />
|
||||
<el-table-column prop="mfg_order_name" label="订单号" width="160" />
|
||||
<el-table-column prop="manufacture_date" label="生产日期" width="160" />
|
||||
<el-table-column prop="paper_tube_or_frp" label="管件类型" />
|
||||
<el-table-column prop="paper_tube_material" label="纸筒物料编码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="paper_tube_description" label="纸筒物料描述" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="paper_tube_model" label="纸筒规格" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="frp_material" label="FRP管物料编码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="frp_description" label="FRP管物料描述" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="frp_model" label="FRP管规格" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="start_time" label="开始时间" width="140" />
|
||||
<el-table-column prop="end_time" label="结束时间" width="140" />
|
||||
<el-table-column prop="product_area" label="生产区域" width="130px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'RestructDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '获取改切卷',
|
||||
url: 'api/slittingproductionplan',
|
||||
optShow: {},
|
||||
query: {
|
||||
is_used: true,
|
||||
statusX: '1'
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
flag: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: [],
|
||||
queryInfo: '物料顺序',
|
||||
queryFlag: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
queryMaterials() {
|
||||
this.queryFlag = !this.queryFlag
|
||||
if (this.queryFlag) {
|
||||
this.queryInfo = '库存顺序'
|
||||
this.crud.url = 'api/pdmBdWorkorder/materials'
|
||||
this.crud.toQuery()
|
||||
} else {
|
||||
this.queryInfo = '物料顺序'
|
||||
this.crud.url = 'api/mdBaseMaterial'
|
||||
this.crud.toQuery()
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.tableRadio, this.flag)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows, this.flag)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -284,23 +284,36 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订单类型" prop="order_type">
|
||||
<el-input v-model="form.order_type" style="width: 370px;" />
|
||||
<el-select
|
||||
v-model="form.order_type"
|
||||
clearable
|
||||
disabled
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
style="width: 370px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.order_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷号" prop="container_name">
|
||||
<el-input v-model="form.container_name" style="width: 370px;" />
|
||||
<el-form-item label="子卷号">
|
||||
<el-input v-model="form.container_name" placeholder="没有则系统生成" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="product_name">
|
||||
<el-form-item label="产品编码">
|
||||
<el-input v-model="form.product_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品描述" prop="description">
|
||||
<el-form-item label="产品描述">
|
||||
<el-input v-model="form.description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -308,27 +321,27 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="来源母卷号" prop="parent_container_name">
|
||||
<el-input v-model="form.parent_container_name" style="width: 370px;" />
|
||||
<el-input v-model="form.parent_container_name" style="width: 370px;" @focus="getMaterial" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="改制来源子卷号" prop="restruct_container_name">
|
||||
<el-input v-model="form.restruct_container_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷立库木箱号" prop="package_box_sn">
|
||||
<el-input v-model="form.package_box_sn" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="来源卷位置" prop="ware_house">
|
||||
<el-input v-model="form.ware_house" style="width: 370px;" />
|
||||
<el-input v-model="form.restruct_container_name" style="width: 370px;" @focus="getMaterial2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="子卷立库木箱号" prop="package_box_sn">-->
|
||||
<!-- <el-input v-model="form.package_box_sn" style="width: 370px;" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="来源卷位置" prop="ware_house">-->
|
||||
<!-- <el-input v-model="form.ware_house" style="width: 370px;" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分切机台编码" prop="resource_name">
|
||||
@@ -341,6 +354,32 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上轴/下轴">
|
||||
<el-select v-model="form.up_or_down" placeholder="请选择" style="width: 370px;">
|
||||
<el-option
|
||||
v-for="item in is_up_down"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="左卷/右卷">
|
||||
<el-select v-model="form.left_or_right" placeholder="请选择" style="width: 370px;">
|
||||
<el-option
|
||||
v-for="item in is_left_right"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产顺序" prop="manufacture_sort">
|
||||
@@ -356,7 +395,12 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产日期" prop="manufacture_date">
|
||||
<el-input v-model="form.manufacture_date" style="width: 370px;" />
|
||||
<el-date-picker
|
||||
v-model="form.manufacture_date"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 370px;"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -372,10 +416,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-row v-if="form.paper_tube_or_FRP === '1'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="纸筒物料编码" prop="paper_tube_material">
|
||||
<el-input v-model="form.paper_tube_material" style="width: 370px;" />
|
||||
<el-form-item label="纸筒规格" prop="paper_tube_model">
|
||||
<el-input v-model="form.paper_tube_model" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -384,29 +428,17 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="纸筒规格" prop="paper_tube_model">
|
||||
<el-input v-model="form.paper_tube_model" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管物料编码" prop="FRP_material">
|
||||
<el-input v-model="form.FRP_material" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管物料描述" prop="FRP_description">
|
||||
<el-input v-model="form.FRP_description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row v-if="form.paper_tube_or_FRP === '2'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管规格" prop="FRP_model">
|
||||
<el-input v-model="form.FRP_model" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管物料描述" prop="FRP_description">
|
||||
<el-input v-model="form.FRP_description" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -427,7 +459,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售订单及行号" prop="sale_order_name">
|
||||
<el-form-item label="销售订单及行号">
|
||||
<el-input v-model="form.sale_order_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -467,7 +499,7 @@
|
||||
<el-table-column prop="split_breadth" label="子卷幅宽" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="split_height" label="子卷理论长度" width="100px" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="split_weight" label="子卷理论重量" width="100px" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="paper_tube_or_frp" label="管件类型" :formatter="formatTubeName" />
|
||||
<el-table-column prop="paper_tube_or_FRP" label="管件类型" :formatter="formatTubeName" />
|
||||
<el-table-column prop="paper_tube_material" label="纸筒物料编码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="paper_tube_description" label="纸筒物料描述" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="paper_tube_model" label="纸筒规格" min-width="140" show-overflow-tooltip />
|
||||
@@ -493,6 +525,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />
|
||||
<RestructDialog :dialog-show.sync="restructDialog" @tableChanged="tableChanged2" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -503,6 +537,8 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import MaterialDialog from '@/views/wms/pdm/order/slittingplan/MaterialDialog.vue'
|
||||
import RestructDialog from '@/views/wms/pdm/order/slittingplan/RestructDialog.vue'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
@@ -526,6 +562,8 @@ const defaultForm = {
|
||||
FRP_material: null,
|
||||
FRP_description: null,
|
||||
FRP_model: null,
|
||||
up_or_down: null,
|
||||
left_or_right: null,
|
||||
split_breadth: null,
|
||||
split_height: null,
|
||||
split_weight: null,
|
||||
@@ -552,7 +590,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Slittingproductionplan',
|
||||
dicts: ['product_area', 'order_type', 'cut_product_status', 'ware_house', 'paper_tube_or_frp', 'IS_OR_NOT'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { RestructDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -573,6 +611,22 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
materialDialog: false,
|
||||
restructDialog: false,
|
||||
is_up_down: [{
|
||||
value: '1',
|
||||
label: '上轴'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '下轴'
|
||||
}],
|
||||
is_left_right: [{
|
||||
value: '1',
|
||||
label: '左卷'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '右卷'
|
||||
}],
|
||||
rules: {
|
||||
order_type: [
|
||||
{ required: true, message: '分切订单类型不能为空', trigger: 'blur' }
|
||||
@@ -612,6 +666,22 @@ export default {
|
||||
hand() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getMaterial() {
|
||||
this.materialDialog = true
|
||||
},
|
||||
getMaterial2() {
|
||||
this.restructDialog = true
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.parent_container_name = row.container_name
|
||||
this.form.order_type = '1'
|
||||
this.form.restruct_container_name = ''
|
||||
},
|
||||
tableChanged2(row) {
|
||||
this.form.restruct_container_name = row.container_name
|
||||
this.form.order_type = '2'
|
||||
this.form.parent_container_name = ''
|
||||
},
|
||||
upMaterFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
@@ -672,7 +742,7 @@ export default {
|
||||
return this.dict.label.ware_house[row.ware_house]
|
||||
},
|
||||
formatTubeName(row) {
|
||||
return this.dict.label.paper_tube_or_frp[row.paper_tube_or_frp]
|
||||
return this.dict.label.paper_tube_or_frp[row.paper_tube_or_FRP]
|
||||
},
|
||||
formatParentName(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_parent_ok]
|
||||
|
||||
Reference in New Issue
Block a user