fix:备货区管芯信息绑定异常
fix: 任务未完成导致,管芯上报扣除失败 feat: 虚拟分切计划送轴业务
This commit is contained in:
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -119,6 +120,27 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
return bstIvtStockingivtMapper.getCanMovePointOne(location, pointType);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> lines = new ArrayList<>();
|
||||
lines.add("纸制简管|纸管|6英寸|1300");
|
||||
lines.add("纸制简管|纸管|3英寸|12|650");
|
||||
lines.add("玻璃纤维及其制品|FRP管|6英寸|15-20|1700|阶梯");
|
||||
lines.add("玻璃纤维及其制品|FRP管|6英寸|15|1700|高强");
|
||||
// 定义正则表达式,去除最后的中文部分
|
||||
String regex = "\\|[\\u4e00-\\u9fa5]+$";
|
||||
|
||||
// 处理每一行数据
|
||||
List<String> cleanedLines = new ArrayList<>();
|
||||
for (String line : lines) {
|
||||
cleanedLines.add(line.replaceAll(regex, ""));
|
||||
}
|
||||
|
||||
// 打印结果
|
||||
for (String cleanedLine : cleanedLines) {
|
||||
System.out.println(cleanedLine);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject operateIvt(JSONObject jsonObject) {
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
@@ -146,7 +168,7 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
|
||||
//获取当前纸管的高度
|
||||
// 解析描述数组
|
||||
String[] tubeArray = material_name.split("\\|");
|
||||
String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
|
||||
int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
|
||||
|
||||
@@ -193,4 +193,11 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> getUpShaftTip(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.getUpShaftTip(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/forcedFeedShaft")
|
||||
@Log("强制送轴")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> forcedFeedShaft(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.forcedFeedShaft(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,13 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
|
||||
*/
|
||||
PdmBiSlittingproductionplan getByContainerName(String containerName);
|
||||
|
||||
/**
|
||||
* 根据子卷获取分切
|
||||
* @param containerName 子卷
|
||||
* @return /
|
||||
*/
|
||||
PdmBiSlittingproductionplan getByContainerNameIsExist(String containerName, String is_delete);
|
||||
|
||||
/**
|
||||
* 设置气胀轴方向
|
||||
* @param whereJson /
|
||||
|
||||
@@ -125,6 +125,13 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
return pdmBiSlittingproductionplanMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdmBiSlittingproductionplan getByContainerNameIsExist(String containerName, String is_delete) {
|
||||
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
|
||||
lam.eq(PdmBiSlittingproductionplan::getContainer_name, containerName).eq(PdmBiSlittingproductionplan::getIs_delete, is_delete);
|
||||
return pdmBiSlittingproductionplanMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirection(JSONObject whereJson) {
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
|
||||
@@ -298,4 +298,11 @@ public interface SlitterService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject doSubRollWeightBindingTip(JSONObject param);
|
||||
|
||||
/**
|
||||
* 强制送轴
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
JSONObject forcedFeedShaft(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -867,21 +867,33 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
throw new BadRequestException("设备:" + param.getString("device_code") + "排数不能为空");
|
||||
}
|
||||
BstIvtStockingivt device = stockingivtService.getPointByCode(param.getString("device_code"), false);
|
||||
MdPbPapervehicle mdPbPapervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, device.getVehicle_code())
|
||||
String vehicleCode = device.getVehicle_code();
|
||||
if (ObjectUtil.isEmpty(vehicleCode)) {
|
||||
// 如果托盘号为空,那就是任务没完成,需要从任务中获取
|
||||
SchBaseTask bhTask = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getPoint_code2, device.getPoint_code())
|
||||
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getIs_delete, SlitterConstant.SLITTER_NO));
|
||||
if (ObjectUtil.isEmpty(bhTask)) {
|
||||
throw new BadRequestException("扣除纸管失败,原因:点位/任务托盘号不存在,请重试。");
|
||||
}
|
||||
vehicleCode = bhTask.getVehicle_code();
|
||||
}
|
||||
MdPbPapervehicle mdPbPapervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, vehicleCode)
|
||||
.eq(MdPbPapervehicle::getRow_num, param.getString("row_num")));
|
||||
int qty = mdPbPapervehicle.getQty().intValue();
|
||||
if (qty <= 0) {
|
||||
throw new BadRequestException("当前物料数量为0!");
|
||||
}
|
||||
|
||||
UpdateWrapper<MdPbPapervehicle> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("vehicle_code", device.getVehicle_code())
|
||||
updateWrapper.eq("vehicle_code", vehicleCode)
|
||||
.eq("row_num", param.getString("row_num"))
|
||||
.setSql("qty=qty-1");
|
||||
papervehicleService.update(updateWrapper);
|
||||
// 检查更新后的 qty 是否为 0,然后删除相应的记录
|
||||
QueryWrapper<MdPbPapervehicle> deleteWrapper = new QueryWrapper<>();
|
||||
deleteWrapper.eq("vehicle_code", device.getVehicle_code())
|
||||
deleteWrapper.eq("vehicle_code", vehicleCode)
|
||||
.eq("row_num", param.getString("row_num"))
|
||||
.eq("qty", "0");
|
||||
papervehicleService.remove(deleteWrapper);
|
||||
@@ -1892,4 +1904,168 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("tip", "系统记录的重量数值:" + rollWeight + ", " + paperWeight);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject forcedFeedShaft(JSONObject param) {
|
||||
// 纸制筒管|纸管|6英寸|1300
|
||||
// 纸制筒管|纸管|3英寸|12|650
|
||||
// 玻璃纤维及其制品|FRP管|6英寸|15-20|1700|阶梯
|
||||
// 玻璃纤维及其制品|FRP管|6英寸|15|1700|高强
|
||||
// param: area, device_code, up_left_size_k,up_right_size_k, up_left_size_v,up_right_size_v
|
||||
// down_left_size_k,down_right_size_k, down_left_size_v,down_right_size_v
|
||||
log.info("创建虚拟分切计划呼叫气胀轴 - {}", param);
|
||||
String area = param.getString("area");
|
||||
if (!area.startsWith("B")) {
|
||||
throw new BadRequestException("该功能只对二期有用!");
|
||||
}
|
||||
// mes的设备号
|
||||
String deviceCode = param.getString("device_code");
|
||||
// lms的设备号
|
||||
String pointCode = param.getString("point_code");
|
||||
// 上轴左边需要的管芯名称 ...
|
||||
String upLeftSizeK = param.getString("up_left_size_k");
|
||||
String upRightSizeK = param.getString("up_right_size_k");
|
||||
String upLeftSizeV = param.getString("up_left_size_v");
|
||||
String upRightSizeV = param.getString("up_right_size_v");
|
||||
String downLeftSizeK = param.getString("down_left_size_k");
|
||||
String downRightSizeK = param.getString("down_right_size_k");
|
||||
String downLeftSizeV = param.getString("down_left_size_v");
|
||||
String downRightSizeV = param.getString("down_right_size_v");
|
||||
List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
|
||||
// 虚拟计划
|
||||
for (int i = 0; i < 4; i++) {
|
||||
String containerName = area + "虚拟-" + deviceCode + "-" + i;
|
||||
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
|
||||
if (ObjectUtil.isEmpty(plan)) {
|
||||
plan = new PdmBiSlittingproductionplan();
|
||||
plan.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
}
|
||||
// 公共部分插入
|
||||
plan.setOrder_type("1");
|
||||
plan.setContainer_name(containerName);
|
||||
plan.setProduct_name("220890200000001");
|
||||
plan.setDescription("虚拟卷");
|
||||
plan.setParent_container_name(deviceCode);
|
||||
plan.setWare_house("1");
|
||||
plan.setResource_name(deviceCode);
|
||||
plan.setSplit_group("A");
|
||||
plan.setManufacture_sort("P1");
|
||||
plan.setMfg_order_name("-");
|
||||
plan.setManufacture_date(DateUtil.format(DateUtil.date(), "yyyy-MM-dd"));
|
||||
plan.setSplit_breadth(new BigDecimal("999"));
|
||||
plan.setSplit_height(new BigDecimal("999"));
|
||||
plan.setSplit_weight(new BigDecimal("999"));
|
||||
plan.setStart_time(DateUtil.now());
|
||||
plan.setEnd_time("");
|
||||
plan.setStatus("01");
|
||||
plan.setIs_parent_ok("0");
|
||||
plan.setIs_child_tz_ok("0");
|
||||
plan.setIs_child_ps_ok("0");
|
||||
plan.setQzzno("");
|
||||
plan.setIs_delete("0");
|
||||
plan.setSale_order_name("-");
|
||||
plan.setIs_call("0");
|
||||
plan.setIs_paper_ok("1");
|
||||
// 区分位置创建
|
||||
if (i==0 && ObjectUtil.isNotEmpty(upLeftSizeK)) {
|
||||
// 上左
|
||||
plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upLeftSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upLeftSizeV);
|
||||
plan.setPaper_tube_model(upLeftSizeK);
|
||||
plan.setPaper_tube_description(upLeftSizeK);
|
||||
} else {
|
||||
plan.setFRP_material(upLeftSizeV);
|
||||
plan.setFRP_model(upLeftSizeK);
|
||||
plan.setFRP_description(upLeftSizeK);
|
||||
}
|
||||
if (upLeftSizeK.contains("3英寸") || upLeftSizeK.contains("3.12英寸")) {
|
||||
plan.setQzz_generation("4");
|
||||
} else {
|
||||
plan.setQzz_generation("5");
|
||||
}
|
||||
plan.setUp_or_down("1");
|
||||
plan.setLeft_or_right("1");
|
||||
}
|
||||
if (i==1 && ObjectUtil.isNotEmpty(upRightSizeK)) {
|
||||
// 上右
|
||||
plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = upRightSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(upRightSizeV);
|
||||
plan.setPaper_tube_model(upRightSizeK);
|
||||
plan.setPaper_tube_description(upRightSizeK);
|
||||
} else {
|
||||
plan.setFRP_material(upRightSizeV);
|
||||
plan.setFRP_model(upRightSizeK);
|
||||
plan.setFRP_description(upRightSizeK);
|
||||
}
|
||||
plan.setUp_or_down("1");
|
||||
plan.setLeft_or_right("2");
|
||||
}
|
||||
if (i==2 && ObjectUtil.isNotEmpty(downLeftSizeK)) {
|
||||
// 下左
|
||||
plan.setPaper_tube_or_FRP(downLeftSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = downLeftSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(downLeftSizeV);
|
||||
plan.setPaper_tube_model(downLeftSizeK);
|
||||
plan.setPaper_tube_description(downLeftSizeK);
|
||||
} else {
|
||||
plan.setFRP_material(downLeftSizeV);
|
||||
plan.setFRP_model(downLeftSizeK);
|
||||
plan.setFRP_description(downLeftSizeK);
|
||||
}
|
||||
plan.setUp_or_down("2");
|
||||
plan.setLeft_or_right("1");
|
||||
}
|
||||
if (i==4 && ObjectUtil.isNotEmpty(downRightSizeK)) {
|
||||
// 下右
|
||||
plan.setPaper_tube_or_FRP(downRightSizeV.startsWith("48") ? "1" : "2");
|
||||
String[] split = downRightSizeK.split("\\|");
|
||||
plan.setQzz_size(String.valueOf(split[2].charAt(0)));
|
||||
if ("1".equals(plan.getPaper_tube_or_FRP())) {
|
||||
plan.setPaper_tube_material(downRightSizeV);
|
||||
plan.setPaper_tube_model(downRightSizeK);
|
||||
plan.setPaper_tube_description(downRightSizeK);
|
||||
} else {
|
||||
plan.setFRP_material(downRightSizeV);
|
||||
plan.setFRP_model(downRightSizeK);
|
||||
plan.setFRP_description(downRightSizeK);
|
||||
}
|
||||
plan.setUp_or_down("2");
|
||||
plan.setLeft_or_right("2");
|
||||
}
|
||||
if (i==0 && ObjectUtil.isEmpty(upLeftSizeK)) {
|
||||
plan.setIs_delete("1");
|
||||
}
|
||||
if (i==1 && ObjectUtil.isEmpty(upRightSizeK)) {
|
||||
plan.setIs_delete("1");
|
||||
}
|
||||
if (i==2 && ObjectUtil.isEmpty(downLeftSizeK)) {
|
||||
plan.setIs_delete("1");
|
||||
}
|
||||
if (i==3 && ObjectUtil.isEmpty(downRightSizeK)) {
|
||||
plan.setIs_delete("1");
|
||||
}
|
||||
plans.add(plan);
|
||||
}
|
||||
slittingproductionplanService.saveOrUpdateBatch(plans);
|
||||
// 机台打开
|
||||
LambdaUpdateWrapper<StIvtCutpointivt> lamu = new LambdaUpdateWrapper<>();
|
||||
lamu.set(StIvtCutpointivt::getIs_used, "1")
|
||||
.set(StIvtCutpointivt::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(StIvtCutpointivt::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(StIvtCutpointivt::getUpdate_time, DateUtil.now())
|
||||
.eq(StIvtCutpointivt::getPoint_code, pointCode);
|
||||
cutpointivtService.update(lamu);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "呼叫送轴成功!");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class SlitterTaskUtil {
|
||||
if (ObjectUtil.isEmpty(tubeDescription)) {
|
||||
return "";
|
||||
}
|
||||
tubeDescription = tubeDescription.replaceAll("\\|阶梯$", "");
|
||||
tubeDescription = tubeDescription.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "");
|
||||
// 解析描述数组
|
||||
String[] tubeArray = tubeDescription.split("\\|");
|
||||
// 定义尺寸与长度
|
||||
@@ -305,7 +305,7 @@ public class SlitterTaskUtil {
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
}
|
||||
String[] split = paperStr.replaceAll("\\|阶梯$", "").split("\\|");
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:88lmsdb}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_two_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_lms5}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:NLABC&hl123}
|
||||
password: ${DB_PWD:12356}
|
||||
|
||||
@@ -269,4 +269,13 @@ public class EventTest {
|
||||
jo.put("request_param", param.toString());
|
||||
zxDjwTask.createTask(jo);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String name = "纸制筒管|纸管|6英寸|12|650";
|
||||
if (name.contains("3英寸") || name.contains("3.12英寸")) {
|
||||
System.out.println("4");
|
||||
} else {
|
||||
System.out.println("5");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user