Merge branch 'b_lms' of http://121.40.234.130:8899/root/lanzhouhailiang_one into b_lms
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package org.nl.b_lms.pda.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/api/twoPda/st")
|
||||
@Slf4j
|
||||
public class ProductOutTwoController {
|
||||
|
||||
@Autowired
|
||||
private ProductOutTwoService productOutTwoService;
|
||||
|
||||
@PostMapping("/ivtQuery")
|
||||
@Log("单据初始化查询")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> ivtQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productOutTwoService.ivtQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ivtDtlQuery")
|
||||
@Log("查询点位木箱")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> ivtDtlQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productOutTwoService.ivtDtlQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ivtbBoxDtlQuery")
|
||||
@Log("木箱明细")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> ivtbBoxDtlQuery(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productOutTwoService.ivtbBoxDtlQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outConfirm")
|
||||
@Log("确认")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> outConfirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productOutTwoService.outConfirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.b_lms.pda.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.VehicleTwoService;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/api/twoPda/vehicle")
|
||||
@Slf4j
|
||||
public class VehicleTwoController {
|
||||
|
||||
@Autowired
|
||||
private VehicleTwoService vehicleTwoService;
|
||||
|
||||
@PostMapping("/vehicleIn")
|
||||
@Log("入空载具")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> vehicleIn(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(vehicleTwoService.vehicleIn(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/boxIn")
|
||||
@Log("木箱入库")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> boxIn(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(vehicleTwoService.boxIn(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.b_lms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface ProductOutTwoService {
|
||||
/**
|
||||
* 单据初始化查询
|
||||
* @param whereJson {
|
||||
* box_no: 木箱号
|
||||
* bill_code: 单据号
|
||||
* }
|
||||
* @return JSONObject: 返回前端参数
|
||||
*/
|
||||
JSONObject ivtQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询点位木箱
|
||||
* @param whereJson {
|
||||
* box_no: 木箱号
|
||||
* bill_code: 单据号
|
||||
* }
|
||||
* @return JSONObject: 返回前端参数
|
||||
*/
|
||||
JSONObject ivtDtlQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 木箱明细
|
||||
* @param whereJson {
|
||||
* box_no: 木箱号
|
||||
* }
|
||||
* @return JSONObject: 返回前端参数
|
||||
*/
|
||||
JSONObject ivtbBoxDtlQuery(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 木箱明细
|
||||
* @param whereJson {
|
||||
* box_no: 木箱号
|
||||
* }
|
||||
* @return JSONObject: 返回前端参数
|
||||
*/
|
||||
JSONObject outConfirm(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.b_lms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @description 服务接口
|
||||
* @date 2022-05-25
|
||||
**/
|
||||
public interface VehicleTwoService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code: 载具号
|
||||
* vehicle_type: 载具类型
|
||||
* point_code: 点位
|
||||
* }
|
||||
* @return :JSONObject:返回前端参数
|
||||
*/
|
||||
JSONObject vehicleIn(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param whereJson {
|
||||
* box_no: 木箱号
|
||||
* vehicle_code: 载具号
|
||||
* point_code: 点位
|
||||
* }
|
||||
* @return :JSONObject:返回前端参数~
|
||||
*/
|
||||
JSONObject boxIn(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxlashboundService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.st.service.impl.ProductionOutServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ProductOutTwoServiceImpl implements ProductOutTwoService {
|
||||
|
||||
/**
|
||||
* 木箱绑定服务
|
||||
*/
|
||||
@Autowired
|
||||
private IBstIvtBoxlashboundService iBstIvtBoxlashboundService;
|
||||
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
return new ProductionOutServiceImpl().ivtQuery(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject ivtDtlQuery(JSONObject whereJson) {
|
||||
return new ProductionOutServiceImpl().ivtDtlQuery(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject ivtbBoxDtlQuery(JSONObject whereJson) {
|
||||
return new ProductionOutServiceImpl().ivtbBoxDtlQuery(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject outConfirm(JSONObject whereJson) {
|
||||
// 点位表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
if (ObjectUtil.isEmpty(box_no)) {
|
||||
throw new BadRequestException("木箱不能为空");
|
||||
}
|
||||
|
||||
BstIvtBoxlashbound boundDao = iBstIvtBoxlashboundService.getOne(
|
||||
new QueryWrapper<BstIvtBoxlashbound>().lambda()
|
||||
.eq(BstIvtBoxlashbound::getBox_no, box_no)
|
||||
);
|
||||
|
||||
if (ObjectUtil.isEmpty(boundDao)) {
|
||||
throw new BadRequestException("此木箱没有经过自动捆扎,请手动解绑!");
|
||||
}
|
||||
|
||||
// 查出所有捆绑在一起的木箱
|
||||
List<BstIvtBoxlashbound> boundDaoList = iBstIvtBoxlashboundService.list(
|
||||
new QueryWrapper<BstIvtBoxlashbound>().lambda()
|
||||
.eq(BstIvtBoxlashbound::getBound_id, boundDao.getBound_id())
|
||||
);
|
||||
|
||||
// 查询所在点位
|
||||
String box_in = boundDaoList.stream()
|
||||
.map(BstIvtBoxlashbound::getBox_no)
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("vehicle_code IN ('" + box_in + "') and is_delete = '0' and is_used = '1' and point_type = '9'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("请输入正确的木箱或查看点位是否存在");
|
||||
}
|
||||
|
||||
// 解锁点位
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_code", "");
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
// 删除木箱绑定关系
|
||||
iBstIvtBoxlashboundService.removeByIds(boundDaoList);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "解绑成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.VehicleTwoService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBoxManageService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InVehicleManageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class VehicleTwoServiceImpl implements VehicleTwoService {
|
||||
|
||||
/**
|
||||
* 入空载具服务
|
||||
*/
|
||||
@Autowired
|
||||
private InVehicleManageService inVehicleManageService;
|
||||
|
||||
/**
|
||||
* 入空木箱服务
|
||||
*/
|
||||
@Autowired
|
||||
private InBoxManageService inBoxManageService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject vehicleIn(JSONObject whereJson) {
|
||||
// 调用接口
|
||||
whereJson.put("device_code", whereJson.getString("point_code"));
|
||||
inVehicleManageService.inVehicle(whereJson);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "入库成功!");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject boxIn(JSONObject whereJson) {
|
||||
// 调用接口
|
||||
inBoxManageService.boxBinVehicle(whereJson);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "入库成功!");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,7 +63,6 @@
|
||||
AND p.is_child_tz_ok = '0'
|
||||
AND p.is_paper_ok = '1'
|
||||
AND p.is_delete = '0'
|
||||
AND p.manufacture_date = '2024-01-05'
|
||||
AND LEFT ( p.resource_name, 2 ) = #{area}
|
||||
AND p.up_or_down IS NOT NULL
|
||||
AND p.left_or_right IS NOT NULL
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PdmBiSubpackagerelationController {
|
||||
* @param whereJson 查询条件
|
||||
*/
|
||||
@GetMapping("/queryContainerNameBySaleOrder")
|
||||
@Log("查询订单装箱信息")
|
||||
@Log("根据订单号查询子卷信息")
|
||||
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(pdmBiSubpackagerelationService.queryContainerNameBySaleOrder(whereJson)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,7 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
|
||||
private String box_group;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -161,7 +161,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
;
|
||||
if (entityList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -106,11 +106,11 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
String point_code2 = jsonTask.getString("point_code2");
|
||||
String point_code4 = jsonTask.getString("point_code4");
|
||||
String task_type = jsonTask.getString("task_type");
|
||||
String container_name = jsonTask.getString("container_name");
|
||||
|
||||
if ("010701".equals(task_type)) {
|
||||
//维护冷却区满轴点位的库存
|
||||
JSONObject cool_jo1 = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
String container_name = cool_jo1.getString("container_name");
|
||||
String full_vehicle_code = cool_jo1.getString("full_vehicle_code");
|
||||
HashMap map = new HashMap();
|
||||
map.put("container_name", "");
|
||||
@@ -121,7 +121,6 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
String empty_vehicle_code = st_jo1.getString("up_scroll");
|
||||
HashMap map2 = new HashMap();
|
||||
map2.put("up_scroll", full_vehicle_code);
|
||||
map2.put("up_pcsn", container_name);
|
||||
stTab.update(map2, "point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
//维护冷却区空轴点位的库存
|
||||
HashMap map3 = new HashMap();
|
||||
@@ -131,7 +130,6 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
if ("010702".equals(task_type)) {
|
||||
//维护冷却区满轴点位的库存
|
||||
JSONObject cool_jo1 = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
String container_name = cool_jo1.getString("container_name");
|
||||
String full_vehicle_code = cool_jo1.getString("full_vehicle_code");
|
||||
HashMap map = new HashMap();
|
||||
map.put("container_name", "");
|
||||
@@ -141,7 +139,6 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
//维护表处区点位
|
||||
HashMap map2 = new HashMap();
|
||||
map2.put("up_scroll", full_vehicle_code);
|
||||
map2.put("up_pcsn", container_name);
|
||||
stTab.update(map2, "up_point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
}
|
||||
if ("010703".equals(task_type)) {
|
||||
@@ -150,7 +147,6 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
String empty_vehicle_code = st_jo1.getString("up_scroll");
|
||||
HashMap map1 = new HashMap();
|
||||
map1.put("up_scroll", "");
|
||||
map1.put("up_pcsn", "");
|
||||
stTab.update(map1, "point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
//维护冷却区空轴点位的库存
|
||||
HashMap map3 = new HashMap();
|
||||
@@ -161,10 +157,8 @@ public class ProcessTask extends AbstractAcsTask {
|
||||
//维护表处区点位
|
||||
JSONObject st_jo1 = stTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
String full_vehicle_code = st_jo1.getString("up_scroll");
|
||||
String container_name = st_jo1.getString("up_pcsn");
|
||||
HashMap map1 = new HashMap();
|
||||
map1.put("up_scroll", "");
|
||||
map1.put("up_pcsn", "");
|
||||
stTab.update(map1, "point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
//维护冷却区空轴点位的库存
|
||||
HashMap map3 = new HashMap();
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
package org.nl.b_lms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 二期入木箱行架任务类
|
||||
* Created by Lxy on 2024/1/19.
|
||||
*/
|
||||
public class TwoInBoxTrussTask extends AbstractAcsTask {
|
||||
|
||||
/**
|
||||
* 处理类
|
||||
*/
|
||||
private final String THIS_CLASS = TwoInBoxTrussTask.class.getName();
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
// 任务表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
// 更新任务的参数
|
||||
JSONObject map = new JSONObject();
|
||||
|
||||
/*
|
||||
* 1-执行中, 2-完成 ,0-acs取消
|
||||
*/
|
||||
// 执行中
|
||||
if (status.equals(TaskStatusEnum.EXECUTING.getCode())) {
|
||||
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
|
||||
// 完成
|
||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
|
||||
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
|
||||
if (taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务已执行不能取消");
|
||||
}
|
||||
|
||||
// 更新任务表删除字段
|
||||
map.put("is_delete", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
|
||||
}
|
||||
|
||||
map.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
map.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
map.put("update_time", DateUtil.now());
|
||||
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
if (StrUtil.isBlank(form.getString("task_type"))) {
|
||||
throw new BadRequestException("业务类型不能为空!");
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(form.getString("start_device_code"))) {
|
||||
throw new BadRequestException("起点不能为空!");
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(form.getString("next_device_code"))) {
|
||||
throw new BadRequestException("终点不能为空!");
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
json.put("vehicle_type", form.getString("vehicle_type"));
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("task_group_id", form.getLongValue("task_group_id"));
|
||||
json.put("point_code1", form.getString("start_device_code"));
|
||||
json.put("point_code2", form.getString("next_device_code"));
|
||||
json.put("handle_class", this.getClass().getName());
|
||||
json.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
json.put("create_name", SecurityUtils.getCurrentUsername());
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("priority", "1");
|
||||
json.put("acs_task_type", "7");
|
||||
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, IOSEnum.ACS_RESULT.code("取消"));
|
||||
}
|
||||
}
|
||||
@@ -171,6 +171,7 @@ public class TwoOutTask extends AbstractAcsTask {
|
||||
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
json.put("task_name", form.getString("task_name"));
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
|
||||
@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -27,6 +30,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,7 +50,8 @@ public class DjqTask extends AbstractAcsTask {
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
@Resource
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@Resource
|
||||
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
|
||||
@Resource
|
||||
private MzhcwTask mzhcwTask;
|
||||
@Resource
|
||||
@@ -87,10 +92,13 @@ public class DjqTask extends AbstractAcsTask {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq( SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
|
||||
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
|
||||
if (schBaseTask == null) {
|
||||
throw new BadRequestException("满轴缓存位 -> 待检区更新接口任务号为空!");
|
||||
}
|
||||
if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
|
||||
throw new BadRequestException("满轴缓存位 -> 待检区,子卷号不能为空!");
|
||||
}
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
schBaseTask.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||
@@ -102,12 +110,25 @@ public class DjqTask extends AbstractAcsTask {
|
||||
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
|
||||
//更新库存记录
|
||||
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("有子卷")).set("container_name", schBaseTask.getVehicle_code()).eq("point_code", schBaseTask.getPoint_code2()));
|
||||
//todo 3.手持确认包装关系,生产包装关系表数据
|
||||
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
|
||||
//device_code:终点,box_length: 长,box_width: 宽,box_high: 高,num: 子卷数
|
||||
// JSONObject boxInfo = new JSONObject();
|
||||
// boxInfo.put("device_code", schBaseTask.getPoint_code2());
|
||||
// outBoxManageService.outBox(boxInfo);
|
||||
//PC子卷装箱界面确认包装关系,根据子卷号查询包装关系获取木箱规格
|
||||
String vehicleCode = schBaseTask.getVehicle_code();
|
||||
PdmBiSubpackagerelation pdmBiSubpackagerelation = pdmBiSubpackagerelationService
|
||||
.getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, vehicleCode), false);
|
||||
if (pdmBiSubpackagerelation != null) {
|
||||
//如果子卷数大于0与木箱规格不为空,代表已确定子卷包装关系,则查询木箱号并木箱出库
|
||||
if (pdmBiSubpackagerelation.getQuanlity_in_box().compareTo(BigDecimal.ZERO) > 0 && StringUtils.isNotBlank(pdmBiSubpackagerelation.getBox_type())) {
|
||||
//device_code:终点,material_code:木箱规格,num: 子卷数
|
||||
JSONObject boxInfo = new JSONObject();
|
||||
boxInfo.put("device_code", schBaseTask.getPoint_code2());
|
||||
boxInfo.put("material_code", pdmBiSubpackagerelation.getBox_type());
|
||||
boxInfo.put("num", pdmBiSubpackagerelation.getQuanlity_in_box());
|
||||
outBoxManageService.outBox(boxInfo);
|
||||
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
|
||||
String boxSn = "MX240115000152";
|
||||
//更新子卷包装关系更新木箱号
|
||||
pdmBiSubpackagerelationService.update(pdmBiSubpackagerelation, new UpdateWrapper<PdmBiSubpackagerelation>().set("package_box_sn", boxSn));
|
||||
}
|
||||
}
|
||||
//5.查询是否有未下发的输送线->满轴位任务,有就下发
|
||||
List<SchBaseTask> notIssueTaskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
//确定起点
|
||||
@@ -133,10 +154,9 @@ public class DjqTask extends AbstractAcsTask {
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
jo.put("point_code1", schBaseTask.getPoint_code2());
|
||||
jo.put("point_code2", zxqPointList.get(0).getPoint_code());
|
||||
jo.put("vehicle_code", schBaseTask.getVehicle_code());
|
||||
jo.put("vehicle_code", vehicleCode);
|
||||
zxqTask.createTask(jo);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
throw new BadRequestException("装箱区暂无空余库位!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproducti
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
@@ -135,7 +136,7 @@ public class SendAirShaftAgvTask extends AbstractAcsTask {
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("3");
|
||||
task.setIs_delete("0");
|
||||
task.setIs_delete(SlitterConstant.SLITTER_NO);
|
||||
task.setRequest_param(form.toJSONString());
|
||||
task.setTask_type(form.getString("task_type"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
@@ -159,7 +160,7 @@ public class SendAirShaftAgvTask extends AbstractAcsTask {
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ public class SlitterDownTrussTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public class TrussCallShaftCacheTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class TrussSendAirShaftTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class TrussSendShaftCacheTask extends AbstractAcsTask {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ public class UpShaftTrussTask extends AbstractAcsTask {
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
// this.immediateNotifyAcs(null);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingprodu
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -49,6 +51,13 @@ public class AutoCallAirShaftTask {
|
||||
@Autowired
|
||||
private TrussCallShaftCacheTask trussCallShaftCacheTask;
|
||||
|
||||
/**
|
||||
* 执行套轴和拔轴任务的逻辑处理。
|
||||
* 该方法首先寻找空闲的插拔轴位,然后根据不同的条件(如标箔或锂电)来确定区域。接着,它会检查是否有分切计划需要执行,
|
||||
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
|
||||
* 同时,该方法也会更新相关的分切计划状态。
|
||||
* 套拔轴缓存位满了、没有分切计划,则触发自动创建套拔轴任务
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void run() {
|
||||
// 1、获取空的插拔轴位(无任务)
|
||||
@@ -93,8 +102,8 @@ public class AutoCallAirShaftTask {
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, planDto.getResource_name())
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, planDto.getParent_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, planDto.getUp_or_down())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, "1"));
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, SlitterConstant.SLITTER_YES));
|
||||
// 获取其中一条
|
||||
PdmBiSlittingproductionplan needPlan = needPlans.get(0);
|
||||
String qzzSize = needPlan.getQzz_size();
|
||||
@@ -124,32 +133,34 @@ public class AutoCallAirShaftTask {
|
||||
param.put("point_code2", empty.getPoint_code());
|
||||
param.put("vehicle_code", ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
|
||||
? startPoint.getQzz_no1() : startPoint.getQzz_no2());
|
||||
// 气胀轴号
|
||||
param.put("qzz_no", ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
|
||||
? startPoint.getQzz_no1() : startPoint.getQzz_no2());
|
||||
param.put("needPlan", planDto);
|
||||
param.put("is_pulling", "1");
|
||||
param.put("is_bushing", "1");
|
||||
param.put("task_type", "6");
|
||||
// 是否拔轴
|
||||
param.put("is_pulling", SlitterConstant.SLITTER_YES);
|
||||
// 是否套轴
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_YES);
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("qzz_size", needPlan.getQzz_size());
|
||||
// 纸管规格、是否拔轴
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("left", plan.getPaper_tube_model());
|
||||
} else {
|
||||
param.put("left", plan.getFRP_model());
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("right", plan.getPaper_tube_model());
|
||||
} else {
|
||||
param.put("right", plan.getFRP_model());
|
||||
}
|
||||
}
|
||||
// 所需的纸管规格
|
||||
SlitterTaskUtil.putNeedPaperSpec(param, needPlans);
|
||||
// 当前纸管的规格信息
|
||||
String oldQzzNo = ObjectUtil.isNotEmpty(startPoint.getQzz_no1())
|
||||
? startPoint.getQzz_no1() : startPoint.getQzz_no2();
|
||||
if (oldQzzNo == null) {
|
||||
throw new BadRequestException("当前气胀轴的编码为空!");
|
||||
}
|
||||
// 最多两条
|
||||
List<PdmBiSlittingproductionplan> oldPlans = slittingproductionplanService.getByQzzNo(oldQzzNo);
|
||||
SlitterTaskUtil.putCurrentPaperSpec(param, oldPlans);
|
||||
// 套管数量
|
||||
param.put("casingCount", needPlans.size());
|
||||
// 拔管数量
|
||||
param.put("pullCount", oldPlans.size());
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
// 将分切计划is_paper_ok 1 -> 2
|
||||
// 将分切计划is_paper_ok 1(纸管已经准备好) -> 2(已经套轴)
|
||||
needPlans.forEach(p -> {
|
||||
p.setIs_paper_ok("2");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
@@ -206,8 +217,8 @@ public class AutoCallAirShaftTask {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", shafttubeivt.getPoint_code());
|
||||
param.put("point_code2", empty.getPoint_code());
|
||||
param.put("is_bushing", "1");
|
||||
param.put("task_type", "6");
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_YES);
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("qzz_size", qzzSize);
|
||||
trussCallShaftCacheTask.createTask(param);
|
||||
@@ -220,15 +231,15 @@ public class AutoCallAirShaftTask {
|
||||
* @param qzzSize 气涨轴尺寸
|
||||
*/
|
||||
private void saveCutPlanMessage(BstIvtShafttubeivt empty, List<PdmBiSlittingproductionplan> needPlans, String qzzSize) {
|
||||
empty.setHave_qzz("1");
|
||||
empty.setHave_qzz(SlitterConstant.SLITTER_YES);
|
||||
empty.setQzz_size(qzzSize);
|
||||
empty.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
empty.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
empty.setUpdate_time(DateUtil.now());
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
// 左卷
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
empty.setTube_code1(plan.getPaper_tube_material());
|
||||
empty.setTube_name1(plan.getPaper_tube_model());
|
||||
} else {
|
||||
@@ -238,7 +249,7 @@ public class AutoCallAirShaftTask {
|
||||
empty.setContainer_name1(plan.getContainer_name());
|
||||
} else {
|
||||
// 右卷
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
empty.setTube_code1(plan.getPaper_tube_material());
|
||||
empty.setTube_name1(plan.getPaper_tube_model());
|
||||
} else {
|
||||
@@ -250,7 +261,7 @@ public class AutoCallAirShaftTask {
|
||||
}
|
||||
bstIvtShafttubeivtService.updateById(empty);
|
||||
// 分切计划
|
||||
// 将分切计划is_paper_ok 1 -> 2
|
||||
// 将分切计划is_paper_ok 1(准备好纸管) -> 2(套好气胀轴)
|
||||
needPlans.forEach(p -> {
|
||||
p.setIs_paper_ok("2");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
@@ -287,9 +298,10 @@ public class AutoCallAirShaftTask {
|
||||
param.put("qzz_no", qzzNo);
|
||||
// hint: 当前分切计划的气涨轴尺寸
|
||||
param.put("qzz_size", plan.getQzz_size());
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("is_bushing", "0");
|
||||
param.put("is_bushing", SlitterConstant.SLITTER_NO);
|
||||
param.put("is_pulling", SlitterConstant.SLITTER_YES);
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtCutpointivtService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.SendAirShaftAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -57,7 +58,7 @@ public class AutoSendAirShaftAgvTask {
|
||||
// 最多4条分切计划
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("分切计划不存在");
|
||||
}
|
||||
@@ -74,7 +75,8 @@ public class AutoSendAirShaftAgvTask {
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, demoPlan.getParent_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, demoPlan.getResource_name())
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, demoPlan.getSplit_group())
|
||||
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down()));
|
||||
.ne(PdmBiSlittingproductionplan::getUp_or_down, demoPlan.getUp_or_down())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (list.size() > 0) {
|
||||
// 还有不同轴,所以不继续
|
||||
break;
|
||||
@@ -99,11 +101,11 @@ public class AutoSendAirShaftAgvTask {
|
||||
param.put("point_code2", endPoint.getPoint_code());
|
||||
param.put("vehicle_code1", cutPoint.getQzz_no1());
|
||||
param.put("vehicle_code2", cutPoint.getQzz_no2());
|
||||
param.put("task_type", "3");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
sendAirShaftAgvTask.createTask(param);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.SlitterDownAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.redisson.api.RLock;
|
||||
@@ -70,14 +71,14 @@ public class AutoSlitterDownAgvTask {
|
||||
toCreateTask(cut, endPoint);
|
||||
return;
|
||||
} else {
|
||||
throw new BadRequestException("资源已被占用,请稍等!");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
} else if (areaEmptyNotTaskPoint.size() == 0 && "3".equals(cut.getPoint_type())) {
|
||||
} else if ("3".equals(cut.getPoint_type())) {
|
||||
// 2、没有位置,就去分切缓存位
|
||||
areaEmptyNotTaskPoint = cutpointivtService.getAreaNotTaskPointByStatus("3", "1", "0","0");
|
||||
}
|
||||
@@ -97,7 +98,7 @@ public class AutoSlitterDownAgvTask {
|
||||
param.put("point_code2", endPoint.getPoint_code());
|
||||
param.put("vehicle_code1", cut.getQzz_no1());
|
||||
param.put("vehicle_code2", cut.getQzz_no2());
|
||||
param.put("task_type", "3");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料AGV任务"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
slitterDownAgvTask.createTask(param);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.UpShaftTrussTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -40,47 +41,62 @@ public class AutoUpShaftTrussTask {
|
||||
@Autowired
|
||||
private SlitterMapper slitterMapper;
|
||||
|
||||
/**
|
||||
* 运行任务,主要负责校验分切机是否有未处理的任务,如果有则跳过;如果没有,会尝试为分切机创建新的任务。
|
||||
* 该过程包括:查找没有气涨轴的分切机点位,校验是否存在相关任务,寻找备好轴的对接点位,获取下一组分切计划,
|
||||
* 并根据计划创建相应的搬运任务。
|
||||
*/
|
||||
public void run() {
|
||||
// 获取没有气涨轴的分切机点位
|
||||
// 获取符合条件的分切机点位信息 hint: (目前暂定B2区域)
|
||||
List<StIvtCutpointivt> devicePoint = cutpointivtService.list(new LambdaQueryWrapper<StIvtCutpointivt>()
|
||||
.eq(StIvtCutpointivt::getProduct_area, "B2")
|
||||
.and(l1 -> l1.eq(StIvtCutpointivt::getUp_qzzno, "").or().isNull(StIvtCutpointivt::getUp_qzzno))
|
||||
.and(l2 -> l2.eq(StIvtCutpointivt::getDown_qzzno, "").or().isNull(StIvtCutpointivt::getDown_qzzno)));
|
||||
|
||||
// 遍历每个分切机点位进行任务的校验和创建
|
||||
devicePoint.forEach(device -> {
|
||||
// 校验任务
|
||||
// todo: 区域
|
||||
String productArea = device.getProduct_area();
|
||||
// 校验是否存在未完成的任务
|
||||
List<String> collect = Stream.of(device.getUp_point_code(), device.getDown_point_code()).collect(Collectors.toList());
|
||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.lt(SchBaseTask::getTask_status, "07")
|
||||
.in(SchBaseTask::getPoint_code1, collect).in(SchBaseTask::getPoint_code2, collect)
|
||||
.in(SchBaseTask::getPoint_code3, collect).in(SchBaseTask::getPoint_code4, collect));
|
||||
if (list.size() > 0) {
|
||||
// 存在未完成任务,跳过当前点位
|
||||
return;
|
||||
}
|
||||
// 获取备好轴的对接点位
|
||||
|
||||
// 寻找备好轴的对接点位
|
||||
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(device.getExt_code());
|
||||
if (cutPointList.size() == 0) {
|
||||
log.warn("分切机【" + device.getExt_code() + "】未找到套好纸管的气涨轴");
|
||||
// 下个分切机
|
||||
// 未找到备好轴的对接点位
|
||||
return;
|
||||
}
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
// 获取当前分切机的下一组分切计划(最多四条分切计划)
|
||||
|
||||
// 获取下一组分切计划
|
||||
List<String> qzzNos = Stream.of(newCutPoint.getQzz_no1(), newCutPoint.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> nextPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNos));
|
||||
if (nextPlans.size() == 0) {
|
||||
log.warn("分切机【" + device.getExt_code() + "】未找到套好轴的分切计划");
|
||||
// 下个分切机
|
||||
// 未找到分切计划
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
// 筛选上下轴各一条
|
||||
PdmBiSlittingproductionplan nextUpPlan = nextPlans.stream().filter(p -> "1".equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
PdmBiSlittingproductionplan nextDownPlan = nextPlans.stream().filter(p -> "2".equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
// 查找对应的分切对接位
|
||||
// 根据计划筛选上下轴任务,并构建任务参数
|
||||
PdmBiSlittingproductionplan nextUpPlan = nextPlans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_UP.equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
PdmBiSlittingproductionplan nextDownPlan = nextPlans.stream()
|
||||
.filter(p -> SlitterConstant.SLITTER_SHAFT_DOWN.equals(p.getUp_or_down())).findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan) && ObjectUtil.isNotEmpty(nextDownPlan)) {
|
||||
// 双轴任务
|
||||
// 双轴任务参数构建
|
||||
param.put("point_code1", newCutPoint.getTruss_point_code1());
|
||||
param.put("point_code2", device.getUp_point_code());
|
||||
param.put("point_code3", newCutPoint.getTruss_point_code2());
|
||||
@@ -88,7 +104,7 @@ public class AutoUpShaftTrussTask {
|
||||
param.put("vehicle_code1", newCutPoint.getQzz_no1());
|
||||
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
||||
} else {
|
||||
// 单轴任务
|
||||
// 单轴任务参数构建
|
||||
if (ObjectUtil.isNotEmpty(nextUpPlan)) {
|
||||
// 上轴任务
|
||||
param.put("point_code1", newCutPoint.getTruss_point_code1());
|
||||
@@ -101,11 +117,16 @@ public class AutoUpShaftTrussTask {
|
||||
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
||||
}
|
||||
}
|
||||
|
||||
// 构建任务的其他参数
|
||||
param.put("truss_type", "1");
|
||||
param.put("empty_site", "0");
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("分切机上气胀轴"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
|
||||
// 创建任务
|
||||
upShaftTrussTask.createTask(param);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,5 +35,29 @@ public interface SlitterConstant {
|
||||
* 区域:下
|
||||
*/
|
||||
String SLITTER_AREA_DOWN = "1";
|
||||
/**
|
||||
* 子卷:左边
|
||||
*/
|
||||
String SLITTER_SUB_VOLUME_LEFT = "1";
|
||||
/**
|
||||
* 子卷:右边
|
||||
*/
|
||||
String SLITTER_SUB_VOLUME_RIGHT = "2";
|
||||
/**
|
||||
* 子卷:上轴
|
||||
*/
|
||||
String SLITTER_SHAFT_UP = "1";
|
||||
/**
|
||||
* 子卷:下轴
|
||||
*/
|
||||
String SLITTER_SHAFT_DOWN = "2";
|
||||
/**
|
||||
* 子卷类型:纸管
|
||||
*/
|
||||
String SLITTER_TYPE_PAPER = "1";
|
||||
/**
|
||||
* 子卷类型:FRP
|
||||
*/
|
||||
String SLITTER_TYPE_FRP = "2";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切所需要的枚举
|
||||
* @Date: 2024/3/19
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum SlitterEnum {
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
||||
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806"));
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().get(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String check(String code) {
|
||||
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
|
||||
if (entry.getValue().equals("code")) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class SlitterController {
|
||||
@PostMapping("/test3")
|
||||
@Log("1111")
|
||||
public ResponseEntity<Object> create3(@RequestBody JSONObject entity){
|
||||
List<String> collect = Stream.of("B2572312312002B1").collect(Collectors.toList());
|
||||
List<String> collect = Stream.of("B2652312312901A1").collect(Collectors.toList());
|
||||
entity.put("container", collect);
|
||||
return new ResponseEntity<>(slitterService.mesSlittingMachineSendMaterial(entity), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nl.b_lms.sch.tasks.slitter.SlitterDownTrussTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussSendAirShaftTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
@@ -120,7 +121,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
BstIvtShafttubeivt CBJ = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||
if (ObjectUtil.isEmpty(CBJ.getTube_code1()) && ObjectUtil.isEmpty(CBJ.getTube_code2())) {
|
||||
// 清空
|
||||
CBJ.setHave_qzz("0");
|
||||
CBJ.setHave_qzz(SlitterConstant.SLITTER_NO);
|
||||
TaskUtils.updateOptMessageByBShaftPoint(CBJ);
|
||||
shafttubeivtService.updateById(CBJ);
|
||||
}
|
||||
@@ -150,10 +151,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("data", r);
|
||||
r.put("device_code", deviceCode);
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
String s = String.valueOf("1".equals(plan.getPaper_tube_or_FRP())
|
||||
String s = String.valueOf(SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())
|
||||
? plan.getPaper_tube_model().split("\\|")[2].charAt(0)
|
||||
: plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
if ("1".equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
r.put("left_size", s);
|
||||
} else {
|
||||
r.put("right_size", s);
|
||||
@@ -189,6 +190,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 获取分切计划
|
||||
List<String> collect = Stream.of(startPoint.getContainer_name1(), startPoint.getContainer_name2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
if (collect.size() == 0) {
|
||||
log.error("找不到[{}]对应的分切计划!", deviceCode);
|
||||
throw new BadRequestException("找不到[" + deviceCode + "]对应的分切计划!");
|
||||
}
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
@@ -226,7 +231,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 分切计划设置套轴完成
|
||||
String qzzNo = IdUtil.getSnowflake(1,1).nextIdStr();
|
||||
plans.forEach(plan -> {
|
||||
plan.setIs_child_tz_ok("1");
|
||||
plan.setIs_child_tz_ok(SlitterConstant.SLITTER_YES);
|
||||
plan.setQzzno(qzzNo);
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
});
|
||||
@@ -234,15 +239,15 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 创建任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("point_code2", "1".equals(demoPlan.getUp_or_down())
|
||||
taskParam.put("point_code2", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down())
|
||||
? cutPoint.getTruss_point_code1() : cutPoint.getTruss_point_code2());
|
||||
taskParam.put("vehicle_code1", "1".equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("vehicle_code2", "2".equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("task_type", "6");
|
||||
taskParam.put("vehicle_code1", SlitterConstant.SLITTER_SHAFT_UP.equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("vehicle_code2", SlitterConstant.SLITTER_SHAFT_DOWN.equals(demoPlan.getUp_or_down()) ? qzzNo : "");
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
trussSendAirShaftTask.createTask(taskParam);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLockPoint) {
|
||||
@@ -281,7 +286,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
param.put("point_code2", shafttubeivt.getPoint_code());
|
||||
// hint: 当前分切计划的气涨轴尺寸
|
||||
param.put("qzz_size", qzzSize);
|
||||
param.put("task_type", "6");
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("is_bushing", "0");
|
||||
trussCallShaftCacheTask.createTask(param);
|
||||
@@ -304,7 +309,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 获取分切计划,最多4个需要出站的任务
|
||||
List<PdmBiSlittingproductionplan> currentPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, containerList)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "05"));
|
||||
if (currentPlans.size() == 0) {
|
||||
throw new BadRequestException("当前子卷已经出卷或者不存在!");
|
||||
@@ -370,7 +375,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
slittingproductionplanService.updateBatchById(currentPlans);
|
||||
return res;
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
@@ -554,10 +559,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("查询不到气胀轴编码「" + qzzNo + "」对应的子卷信息!");
|
||||
}
|
||||
PdmBiSlittingproductionplan plan;
|
||||
if ("1".equals(direction)) {
|
||||
plan = plans.stream().filter(p -> "1".equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(direction)) {
|
||||
plan = plans.stream().filter(p -> SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
} else {
|
||||
plan = plans.stream().filter(p -> "2".equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
plan = plans.stream().filter(p -> SlitterConstant.SLITTER_SUB_VOLUME_RIGHT.equals(p.getLeft_or_right())).findFirst().orElse(null);
|
||||
}
|
||||
if (plan == null) {
|
||||
log.error("设备{}, 找不到气胀轴编码{}对应的分切计划!参数:{}",deviceCode, qzzNo, param);
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切部分的任务工具类
|
||||
* @Date: 2024/4/12
|
||||
*/
|
||||
public class SlitterTaskUtil {
|
||||
/**
|
||||
* 组成纸管信息
|
||||
* @param plan 对应的分切计划数组
|
||||
* @return 组成的纸管信息
|
||||
*/
|
||||
public static String getPaperTubeInformation(PdmBiSlittingproductionplan plan) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 长*外径*内径*壁厚*重量*材质(1纸管,2FRP管)
|
||||
// 长
|
||||
sb.append(plan.getPaper_tube_model().split("\\|")[3]);
|
||||
sb.append("*");
|
||||
// 外径
|
||||
sb.append(0);
|
||||
sb.append("*");
|
||||
// 内径
|
||||
sb.append(0);
|
||||
sb.append("*");
|
||||
// 壁厚
|
||||
sb.append(0);
|
||||
sb.append("*");
|
||||
// 重量
|
||||
sb.append(0);
|
||||
sb.append("*");
|
||||
// 材质
|
||||
sb.append(plan.getPaper_tube_or_FRP());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所需的套管纸管信息
|
||||
* @param param 任务参数
|
||||
* @param needPlans 所需的分切计划
|
||||
*/
|
||||
public static void putNeedPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> needPlans) {
|
||||
for (PdmBiSlittingproductionplan plan : needPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("left", plan.getPaper_tube_material());
|
||||
param.put("leftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("left", plan.getFRP_material());
|
||||
param.put("leftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("leftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("right", plan.getPaper_tube_material());
|
||||
param.put("rightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("right", plan.getFRP_material());
|
||||
param.put("rightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("rightSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前的拔管纸管信息
|
||||
* @param param 任务参数
|
||||
* @param oldPlans 老的分切计划
|
||||
*/
|
||||
public static void putCurrentPaperSpec(JSONObject param, List<PdmBiSlittingproductionplan> oldPlans) {
|
||||
for (PdmBiSlittingproductionplan plan : oldPlans) {
|
||||
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentLeft", plan.getPaper_tube_material());
|
||||
param.put("currentLeftSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("currentLeft", plan.getFRP_material());
|
||||
param.put("currentLeftSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentRight", plan.getPaper_tube_model());
|
||||
param.put("currentRightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("currentRight", plan.getFRP_model());
|
||||
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
package org.nl.b_lms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
@@ -16,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/boxinfo")
|
||||
public class BstIvtBoxinfoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询木箱信息")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.nl.b_lms.storage_manage.database.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,6 +17,22 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
*/
|
||||
public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据mes信息插入木箱信息
|
||||
* @param whereJson:{
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
@@ -19,6 +25,23 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, BstIvtBoxinfo> implements IBstIvtBoxinfoService {
|
||||
@Resource
|
||||
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
Map<String, Object> mapReslt = new HashMap<>();
|
||||
LambdaQueryWrapper<BstIvtBoxinfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (whereJson.containsKey("search")) {
|
||||
queryWrapper.like(BstIvtBoxinfo::getBox_no, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_code, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_name, whereJson.get("search"));
|
||||
}
|
||||
IPage<BstIvtBoxinfo> result = bstIvtBoxinfoMapper.selectPage(new Page<>(page.getPageNumber() + 1, page.getPageSize()),queryWrapper);
|
||||
mapReslt.put("content", result.getRecords());
|
||||
mapReslt.put("totalElements", result.getTotal());
|
||||
return mapReslt;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BstIvtBoxinfo mesInsert(JSONObject whereJson) {
|
||||
@@ -42,9 +65,9 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
try {
|
||||
String one = description.substring(description.indexOf("|") + 1);
|
||||
String two = one.substring(one.indexOf("|") + 1);
|
||||
String num = two.substring(two.indexOf("|") + 1,two.indexOf("|") + 2);
|
||||
String num = two.substring(two.indexOf("|") + 1, two.indexOf("|") + 2);
|
||||
boxDao.setNum(num);
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
boxDao.setNum("截取失败,请检查mes数据!");
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void manualDiv(JSONObject whereJson) {
|
||||
StIvtIostorinv mstDao = this.getById(whereJson.getJSONObject("row").getString("iostorinv_id"));
|
||||
|
||||
@@ -361,7 +361,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelDiv(JSONObject whereJson) {
|
||||
// 任务表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoInBoxTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoInBoxTrussTask;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
@@ -61,7 +62,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
private final IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void inBox(JSONObject whereJson) {
|
||||
/*
|
||||
* 1.找木箱区的一个仓位
|
||||
@@ -142,7 +143,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
JSONObject mesBoxInfo = new JSONObject();
|
||||
|
||||
// 插入木箱信息表
|
||||
iBstIvtBoxinfoService.mesInsert(mesBoxInfo);
|
||||
// iBstIvtBoxinfoService.mesInsert(mesBoxInfo);
|
||||
|
||||
/*
|
||||
* 插入木箱对应载具表
|
||||
@@ -163,7 +164,17 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
jsonVeExt.put("device_uuid", IdUtil.getLongId());
|
||||
veExtTab.insert(jsonVeExt);
|
||||
|
||||
// TODO 手持下发桁架任务
|
||||
// 下发桁架任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("task_type", "010713");
|
||||
taskParam.put("start_device_code", whereJson.getString("point_code"));
|
||||
taskParam.put("next_device_code", "1001");
|
||||
taskParam.put("vehicle_code", whereJson.getString("box_no"));
|
||||
taskParam.put("vehicle_code2", whereJson.getString("vehicle_code"));
|
||||
|
||||
TwoInBoxTrussTask taskBean = new TwoInBoxTrussTask();
|
||||
taskBean.createTask(taskParam);
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,7 +62,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void outBox(JSONObject whereJson) {
|
||||
/*
|
||||
* 1.找到符合条件的空木箱
|
||||
|
||||
@@ -53,7 +53,7 @@ public class OutVehicleManageServiceImpl implements OutVehicleManageService {
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void outVehicle(JSONObject whereJson) {
|
||||
/*
|
||||
* 1.找到相同托盘类型的最多的巷道
|
||||
|
||||
@@ -26,6 +26,13 @@ public interface InBoxManageService {
|
||||
* @param whereJson:{
|
||||
* box_no: 木箱号
|
||||
* vehicle_code:托盘号
|
||||
* point_code:起点点位
|
||||
* }
|
||||
* @return {
|
||||
* 长
|
||||
* 宽
|
||||
* 高
|
||||
* 木箱层数
|
||||
* }
|
||||
*/
|
||||
void boxBinVehicle(JSONObject whereJson);
|
||||
|
||||
@@ -42,6 +42,7 @@ public enum PackageInfoIvtEnum {
|
||||
//库存状态
|
||||
IVT_STATUS(MapOf.of("空", "0","空载具", "1","有子卷","2"));
|
||||
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
@@ -60,4 +61,4 @@ public enum PackageInfoIvtEnum {
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CodeUtil {
|
||||
map.put("code", ruleCode);
|
||||
return SpringContextHolder.getBean(ISysCodeRuleService.class).codeDemo(map);
|
||||
} else {
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -13,6 +13,5 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
public class ESConfig {
|
||||
|
||||
@Value(("${es.index}"))
|
||||
private String index;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE pdm_bi_subpackagerelation
|
||||
ADD COLUMN `box_group` varchar(20) NULL DEFAULT '0' COMMENT '木箱组';
|
||||
ALTER TABLE pdm_bi_slittingproductionplan
|
||||
ADD COLUMN `level` char(1) NULL DEFAULT NULL COMMENT '子卷等级';
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_name`, `update_name`, `create_time`, `update_time`, `is_pc`, `system_type`, `create_id`, `category`, `update_id`) VALUES ('1765714619160203264', '329', 0, 4, '子卷装箱', NULL, 'wms/pdm/sub/index', 998, 'zujian', 'wms/pdm/sub/index', 0, b'0', b'0', NULL, NULL, NULL, NULL, NULL, 1, '1', 1, NULL, NULL);
|
||||
INSERT INTO `sys_dict` (`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1765997086853173248', 'sub_package_relation', '子卷包装关系状态', '未分配', '99', 0, NULL, NULL, NULL, NULL, '1', '管理员', '2024-03-08 15:04:50', '1', '管理员', '2024-03-08 15:04:50');
|
||||
|
||||
@@ -61,10 +61,6 @@ public class MobileAuthorizationController {
|
||||
// 获取权限列表 - 登录查找权限
|
||||
List<String> permissionList = roleService.getPermissionList((JSONObject) JSON.toJSON(userInfo));
|
||||
|
||||
if (!userInfo.getIs_used()) {
|
||||
throw new BadRequestException("账号未激活");
|
||||
}
|
||||
|
||||
// 登录输入,登出删除
|
||||
CurrentUser user = new CurrentUser();
|
||||
user.setId(userInfo.getUser_id());
|
||||
|
||||
@@ -461,9 +461,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要区分一期二期
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> queryAuthority(Map<String, String> param) {
|
||||
String accountId = "1";
|
||||
String accountId = SecurityUtils.getCurrentUserId();
|
||||
JSONObject returnjo = new JSONObject();
|
||||
if (StrUtil.isEmpty(accountId)) {
|
||||
returnjo.put("code", "0");
|
||||
@@ -475,19 +480,23 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
if(ObjectUtil.isEmpty(pa)){
|
||||
throw new BadRequestException("当前用户无菜单权限!");
|
||||
}
|
||||
JSONObject result = pa.getJSONObject(0);
|
||||
//查询二级
|
||||
JSONArray SecondResults = baseMapper.queryPdaAuthority(accountId, "1", null);
|
||||
//查询三级
|
||||
JSONArray roleTree = new JSONArray();
|
||||
for (int i = 0; i < SecondResults.size(); i++) {
|
||||
JSONObject row = SecondResults.getJSONObject(i);
|
||||
String menu_id = row.getString("menu_id");
|
||||
JSONArray ThirdResults = baseMapper.queryPdaAuthority(accountId, "2", menu_id);
|
||||
row.put("sonTree", ThirdResults);
|
||||
roleTree.add(row);
|
||||
JSONObject result = new JSONObject();
|
||||
for (int i = 0; i < pa.size(); i++) {
|
||||
JSONObject res = pa.getJSONObject(i);
|
||||
//查询二级
|
||||
JSONArray secondResults = baseMapper.queryPdaAuthority(accountId, "1", res.getString("menu_id"));
|
||||
//查询三级
|
||||
JSONArray roleTree = new JSONArray();
|
||||
for (int j = 0; j < secondResults.size(); j++) {
|
||||
JSONObject row = secondResults.getJSONObject(j);
|
||||
String menu_id = row.getString("menu_id");
|
||||
JSONArray ThirdResults = baseMapper.queryPdaAuthority(accountId, "2", menu_id);
|
||||
row.put("sonTree", ThirdResults);
|
||||
roleTree.add(row);
|
||||
}
|
||||
res.put("sonTree", roleTree);
|
||||
result.put("rf_menu" + i, res);
|
||||
}
|
||||
result.put("sonTree", roleTree);
|
||||
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "查询成功!");
|
||||
|
||||
@@ -267,11 +267,6 @@ public class OnlineUserService {
|
||||
// 获取权限列表 - 登录查找权限
|
||||
List<String> permissionList = roleService.getPermissionList((JSONObject) JSON.toJSON(userInfo));
|
||||
|
||||
|
||||
if (!userInfo.getIs_used()) {
|
||||
throw new BadRequestException("账号未激活");
|
||||
}
|
||||
|
||||
// 登录输入,登出删除
|
||||
CurrentUser user = new CurrentUser();
|
||||
user.setId(userInfo.getUser_id());
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.Map;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@RequestMapping("/api/Materialbase")
|
||||
@Slf4j
|
||||
public class MaterialbaseController {
|
||||
|
||||
@@ -113,6 +113,13 @@ public class MesToLmsController {
|
||||
return new ResponseEntity<>(mesToLmsService.sendProcessInfo(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/processFoilStart")
|
||||
@Log("表处工单推送")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> processFoilStart(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(mesToLmsService.processFoilStart(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/sendTargetHouse")
|
||||
@Log("MES传递给LMS入线边库或者入成品库")
|
||||
|
||||
@@ -63,6 +63,8 @@ public interface MesToLmsService {
|
||||
|
||||
JSONObject sendProcessInfo(JSONObject param);
|
||||
|
||||
JSONObject processFoilStart(JSONObject param);
|
||||
|
||||
/**
|
||||
* MES传递给LMS入线边库或者入成品库
|
||||
*/
|
||||
|
||||
@@ -1471,7 +1471,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
public JSONObject sendProcessInfo(JSONObject param) {
|
||||
log.info("sendProcessInfo输入参数为:-------------------" + param.toString());
|
||||
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
|
||||
// 冷却区点位库存表
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt");
|
||||
|
||||
JSONObject resultParam = new JSONObject();
|
||||
try {
|
||||
@@ -1500,10 +1501,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
//上料
|
||||
if ("1".equals(Type)) {
|
||||
String up_scroll = device_jo.getString("up_scroll");
|
||||
String up_pcsn = device_jo.getString("up_pcsn");
|
||||
/*if (StrUtil.isNotEmpty(up_pcsn)) {
|
||||
throw new BadRequestException("LMS系统上【" + ResourceName + "】表处机上还存在母卷号,不能进行上料!");
|
||||
}*/
|
||||
//查询母卷所在点位
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
|
||||
JSONObject form = new JSONObject();
|
||||
@@ -1512,7 +1509,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
form.put("point_code1", jsonCoolIvt.getString("full_point_code"));
|
||||
form.put("point_code2", device_jo.getString("up_point_code"));
|
||||
form.put("task_type", "010702");
|
||||
form.put("material_code", jsonCoolIvt.getString("container_name"));
|
||||
form.put("material_code", containerName);
|
||||
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
|
||||
form.put("product_area", device_jo.getString("product_area"));
|
||||
} else {
|
||||
@@ -1531,7 +1528,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
form.put("point_code4", jsonIvt.getString("empty_point_code"));
|
||||
}
|
||||
form.put("task_type", "010701");
|
||||
form.put("material_code", jsonCoolIvt.getString("container_name"));
|
||||
form.put("material_code", containerName);
|
||||
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
|
||||
form.put("product_area", device_jo.getString("product_area"));
|
||||
}
|
||||
@@ -1549,7 +1546,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
//寻找可用的冷却区满轴点位
|
||||
form.put("point_code2", jsonIvt.getString("full_point_code"));
|
||||
form.put("task_type", "010704");
|
||||
form.put("material_code", device_jo.getString("up_pcsn"));
|
||||
form.put("material_code", containerName);
|
||||
form.put("vehicle_code", device_jo.getString("up_scroll"));
|
||||
form.put("product_area", device_jo.getString("product_area"));
|
||||
processTask.createTask(form);
|
||||
@@ -1568,6 +1565,89 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
return resultParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject processFoilStart(JSONObject param) {
|
||||
log.info("processFoilStart接口输入参数为:-------------------" + param.toString());
|
||||
|
||||
String FoilContainerName = param.getString("FoilContainerName");
|
||||
String TRContainerName = param.getString("TRContainerName");
|
||||
String ResourceName = param.getString("ResourceName");
|
||||
String MfgOrderName = param.getString("MfgOrderName");
|
||||
String ProductName = param.getString("ProductName");
|
||||
String Description = param.getString("Description");
|
||||
String UpCoilerDate = param.getString("UpCoilerDate");
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_stpointivt");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_SurProcessOrder");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
try {
|
||||
// 校验数据
|
||||
if (ObjectUtil.isEmpty(FoilContainerName)) {
|
||||
throw new BadRequestException("母卷号不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(TRContainerName)) {
|
||||
throw new BadRequestException("表处批次号不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(ResourceName)) {
|
||||
throw new BadRequestException("机台编码不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(MfgOrderName)) {
|
||||
throw new BadRequestException("生产工单不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(ProductName)) {
|
||||
throw new BadRequestException("产品编码不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(Description)) {
|
||||
throw new BadRequestException("产品名称不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(UpCoilerDate)) {
|
||||
throw new BadRequestException("开始时间不能为空");
|
||||
}
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("ext_code ='" + ResourceName + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
jsonPoint = new JSONObject();
|
||||
}
|
||||
|
||||
// 插入生箔工序工单表
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("foil_container_ame", FoilContainerName);
|
||||
json.put("container_name", TRContainerName);
|
||||
json.put("resource_name", ResourceName);
|
||||
json.put("mfg_order_name", MfgOrderName);
|
||||
json.put("product_name", ProductName);
|
||||
json.put("description", Description);
|
||||
json.put("up_coiler_date", UpCoilerDate);
|
||||
json.put("product_area", jsonPoint.getString("product_area"));
|
||||
json.put("point_code", jsonPoint.getString("point_code"));
|
||||
json.put("realstart_time", DateUtil.now());
|
||||
json.put("status", "01");
|
||||
json.put("is_delete", "0");
|
||||
json.put("productin_qty", 0);
|
||||
json.put("create_id", "1");
|
||||
json.put("create_name", "管理员");
|
||||
json.put("create_time", DateUtil.now());
|
||||
orderTab.insert(json);
|
||||
|
||||
// 返回成功
|
||||
result.put("RTYPE", "S");
|
||||
result.put("RTMSG", "操作成功!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
} catch (Exception e) {
|
||||
// 返回失败
|
||||
result.put("RTYPE", "E");
|
||||
result.put("RTMSG", "操作失败!" + e.getMessage());
|
||||
result.put("RTOAL", 0);
|
||||
result.put("RTDAT", null);
|
||||
}
|
||||
log.info("processFoilStart接口输出参数为:-------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject sendTargetHouse(JSONObject param) {
|
||||
log.info("sendTargetHouse输入参数为:-------------------" + param.toString());
|
||||
|
||||
@@ -443,6 +443,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("ext_code", result.getString("RTDAT"));
|
||||
// 单据状态改变 10(生成) -> 20(审核)
|
||||
jsonObject.put("bill_status", "20");
|
||||
mst.update(jsonObject, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class CheckOutBillController {
|
||||
}
|
||||
|
||||
@PostMapping("/allDivOne")
|
||||
@Log("出库单全部分2配")
|
||||
@Log("出库单自动分配")
|
||||
|
||||
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
|
||||
Reference in New Issue
Block a user