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,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.sch.tasks.slitter.service.SlitterService;
|
||||
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: lyd
|
||||
* @Description:
|
||||
* @Date: 2024/5/30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pda/slitter")
|
||||
@Slf4j
|
||||
public class SlitterPdaController {
|
||||
|
||||
@Autowired
|
||||
private SlitterService slitterDevices;
|
||||
|
||||
@PostMapping("/slitterDevices")
|
||||
@Log("获取分切设备")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> slitterDevices() {
|
||||
return new ResponseEntity<>(slitterDevices.slitterDevices(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/downRolls")
|
||||
@Log("下卷")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> downRolls(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.downRolls(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.b_lms.pda.service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2024/5/30
|
||||
*/
|
||||
public interface SlitterPdaService {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import org.nl.b_lms.pda.service.SlitterPdaService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2024/5/30
|
||||
*/
|
||||
@Service
|
||||
public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.sch.point.service;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -58,6 +59,14 @@ public interface IstIvtCutpointivtService extends IService<StIvtCutpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
StIvtCutpointivt getPintByPointCode(String code, boolean flag);
|
||||
|
||||
/**
|
||||
* 通过外部设备码获取设备数据
|
||||
* @param code ext_code
|
||||
* @param flag 是否判断启用
|
||||
* @return /
|
||||
*/
|
||||
StIvtCutpointivt getPintByExtCode(String code, boolean flag);
|
||||
/**
|
||||
* 根据点位编码获取分切机上下轴
|
||||
* @param code 点位编码
|
||||
@@ -65,6 +74,14 @@ public interface IstIvtCutpointivtService extends IService<StIvtCutpointivt> {
|
||||
* @return /
|
||||
*/
|
||||
StIvtCutpointivt getPintByUpOrDownCode(String code, boolean flag);
|
||||
|
||||
/**
|
||||
* 根据分切机前缀获取数据
|
||||
* @param prefix 前缀
|
||||
* @param flag 是否判断启用
|
||||
* @return /
|
||||
*/
|
||||
List<StIvtCutpointivt> getListByStartsWith(String prefix, boolean flag);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
@@ -91,6 +92,14 @@ public class StIvtCutpointivtServiceImpl extends ServiceImpl<StIvtCutpointivtMap
|
||||
return stIvtCutpointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtCutpointivt getPintByExtCode(String code, boolean flag) {
|
||||
LambdaQueryWrapper<StIvtCutpointivt> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(StIvtCutpointivt::getExt_code, code)
|
||||
.eq(flag, StIvtCutpointivt::getIs_used, "1");
|
||||
return stIvtCutpointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtCutpointivt getPintByUpOrDownCode(String code, boolean flag) {
|
||||
LambdaQueryWrapper<StIvtCutpointivt> lam = new LambdaQueryWrapper<>();
|
||||
@@ -100,6 +109,14 @@ public class StIvtCutpointivtServiceImpl extends ServiceImpl<StIvtCutpointivtMap
|
||||
return stIvtCutpointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StIvtCutpointivt> getListByStartsWith(String prefix, boolean flag) {
|
||||
LambdaQueryWrapper<StIvtCutpointivt> lam = new QueryWrapper<StIvtCutpointivt>().lambda();
|
||||
lam.likeRight(StIvtCutpointivt::getExt_code, prefix)
|
||||
.eq(flag, StIvtCutpointivt::getIs_used, "1");
|
||||
return stIvtCutpointivtMapper.selectList(lam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实体基础信息
|
||||
*
|
||||
|
||||
@@ -134,7 +134,31 @@ public class SlitterDownTrussTask extends AbstractAcsTask {
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
// todo: 分切计划回退?
|
||||
// 分切计划回退
|
||||
// 下来:06 -> 05 上去:04 -> 03
|
||||
String pointCode1 = task.getPoint_code1();
|
||||
StIvtCutpointivt point1 = cutpointivtService.getPintByUpOrDownCode(pointCode1, false);
|
||||
String pointCode2 = task.getPoint_code2();
|
||||
BstIvtCutpointivt point2 = bcutpointivtService.getPintByTrussCode(pointCode2, false);
|
||||
String tmpUpQzzNo = point1.getUp_qzzno();
|
||||
String tmpDownQzzNo = point1.getDown_qzzno();
|
||||
// 更新分切计划
|
||||
// 下来的分切计划状态:06 -> 05
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("05");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
List<String> downQzzNos = Stream.of(tmpUpQzzNo, tmpDownQzzNo)
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, downQzzNos));
|
||||
// 上去的分切计划状态:04 -> 03
|
||||
p.setStatus("03");
|
||||
List<String> upQzzNos = Stream.of(point2.getQzz_no1(), point2.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
if (upQzzNos.size() > 0) {
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, upQzzNos));
|
||||
}
|
||||
}
|
||||
task.setUpdate_time(DateUtil.now());
|
||||
taskService.updateById(task);
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
@@ -113,6 +115,24 @@ public class TrussCallAirShaftTask extends AbstractAcsTask {
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
// 将分切计划is_paper_ok --- 2 -> 1
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject jsonObject = JSONObject.parseObject(requestParam);
|
||||
if (ObjectUtil.isEmpty(requestParam)) {
|
||||
throw new BadRequestException("任务 code = " + task.getTask_code() + " 参数错误");
|
||||
}
|
||||
JSONObject needPlan = jsonObject.getJSONObject("needPlan");
|
||||
if (ObjectUtil.isNotEmpty(needPlan)) {
|
||||
// 回退
|
||||
LambdaUpdateWrapper<PdmBiSlittingproductionplan> updateWrapper = new LambdaUpdateWrapper<PdmBiSlittingproductionplan>();
|
||||
updateWrapper.set(PdmBiSlittingproductionplan::getIs_paper_ok, "1")
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, needPlan.getString("parent_container_name"))
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, needPlan.getString("resource_name"))
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, needPlan.getString("split_group"))
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, needPlan.getString("up_or_down"))
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO);
|
||||
slittingproductionplanService.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
task.setUpdate_time(DateUtil.now());
|
||||
taskService.updateById(task);
|
||||
|
||||
@@ -121,7 +121,7 @@ public class TrussSendAirShaftTask extends AbstractAcsTask {
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
// 是否需要回退分切计划套轴完成
|
||||
// 回退分切计划套轴完成
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
|
||||
@@ -126,7 +126,7 @@ public class UpShaftTrussTask extends AbstractAcsTask {
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
|
||||
// 分切计划修改状态回退03
|
||||
// 分切计划修改状态回退04 -> 03
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
@@ -83,4 +84,16 @@ public interface SlitterService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject acsSendSubVolume(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取设备信息
|
||||
* @return
|
||||
*/
|
||||
JSONArray slitterDevices();
|
||||
|
||||
/**
|
||||
* 下卷
|
||||
* @param param
|
||||
*/
|
||||
JSONObject downRolls(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -607,4 +608,34 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("data", taskParam);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray slitterDevices() {
|
||||
String prefix = "B2_";
|
||||
List<StIvtCutpointivt> list = cutpointivtService.getListByStartsWith(prefix, 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 downRolls(JSONObject param) {
|
||||
// param: device_code
|
||||
String device_code = param.getString("device_code");
|
||||
StIvtCutpointivt deviceCode = cutpointivtService.getPintByExtCode(device_code, false);
|
||||
List<String> collect = Stream.of(deviceCode.getUp_qzzno(), deviceCode.getDown_qzzno())
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
param.put("container", collect);
|
||||
log.info("手持调用分切机{}下卷, 参数:{}", device_code, param);
|
||||
mesSlittingMachineSendMaterial(param);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "分切机" + device_code + "下卷成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,6 +94,9 @@ public enum IOSEnum {
|
||||
// 区域
|
||||
PRODUCT_AREA(MapOf.of("BLK", "BLK")),
|
||||
|
||||
// 出库口点位
|
||||
OUT_POINT(MapOf.of("出库口1", "CK2026","出库口2", "CK2027")),
|
||||
|
||||
//acs申请任务
|
||||
ACSTOLMS_TYPE(MapOf.of("成品入库任务", "1","空盘入库","2","空盘出库","3","异常处理位","4","木箱入库","5","退货入库","6","贴标","1","捆扎","2")),
|
||||
;
|
||||
|
||||
@@ -1223,8 +1223,29 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
String start_device_code = "";
|
||||
// 是否自动下发
|
||||
String is_auto_issue = IOSEnum.IS_SEND.code("是");
|
||||
// 终点
|
||||
String end_device_code = "";
|
||||
// 是否自动分配终点
|
||||
boolean is_auto_div_point = false;
|
||||
// 取绝对值
|
||||
int abs = Math.abs(taskMangeList.size() / 2);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(point_code)) {
|
||||
end_device_code = point_code;
|
||||
} else {
|
||||
is_auto_div_point = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < taskMangeList.size(); i++) {
|
||||
// 确定终点
|
||||
if (is_auto_div_point) {
|
||||
if (abs > i) {
|
||||
end_device_code = IOSEnum.OUT_POINT.code("出库口1");
|
||||
} else {
|
||||
end_device_code = IOSEnum.OUT_POINT.code("出库口2");
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject json = taskMangeList.get(i);
|
||||
start_device_code = json.getString("struct_code");
|
||||
|
||||
@@ -1271,7 +1292,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
jsonTaskParam.put("task_type", "010711");
|
||||
jsonTaskParam.put("point_code1", start_device_code);
|
||||
jsonTaskParam.put("point_code2", point_code);
|
||||
jsonTaskParam.put("point_code2", end_device_code);
|
||||
jsonTaskParam.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
if (ObjectUtil.isNotEmpty(jsonExt)) {
|
||||
jsonTaskParam.put("vehicle_code2", jsonExt.getString("storagevehicle_code"));
|
||||
@@ -1299,7 +1320,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
String task_id = twoOutTask.createTask(jsonTaskParam);
|
||||
|
||||
// 更新分配明细
|
||||
JSONObject jsonPoint = schBasePointService.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
JSONObject jsonPoint = schBasePointService.query("point_code = '" + end_device_code + "'").uniqueResult(0);
|
||||
|
||||
disDaoList.forEach(row -> {
|
||||
row.setWork_status(IOSEnum.WORK_STATUS.code("生成"));
|
||||
|
||||
@@ -636,9 +636,11 @@ export default {
|
||||
}
|
||||
},
|
||||
allSetPoint() {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
if (this.mstrow.stor_id !== '1582991156504039455') {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}
|
||||
if (this.currentRow === '') {
|
||||
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -656,9 +658,11 @@ export default {
|
||||
})
|
||||
},
|
||||
allSetPointAllDtl() {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
if (this.mstrow.stor_id !== '1582991156504039455') {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}
|
||||
this.loadingSetAllPoint = true
|
||||
const data = {
|
||||
|
||||
Reference in New Issue
Block a user