opt: 套轴长度判断、下卷的壁厚长度信息提供
This commit is contained in:
@@ -267,5 +267,11 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> doCallTubeShaft(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterService.doCallTubeShaft(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/getTubeLength")
|
||||
@Log("获取轴长")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getTubeLength(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterService.getTubeLength(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -392,4 +392,10 @@ public interface SlitterService {
|
||||
* @param param
|
||||
*/
|
||||
List<CallPlanViewVO> doCallTubeShaftShow(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取轴长
|
||||
* @param param
|
||||
*/
|
||||
JSONObject getTubeLength(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -174,6 +174,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
List<String> tubes = Stream.of(point.getTube_code1(), point.getTube_code2())
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(point.getTube_name1()) && ObjectUtil.isNotEmpty(point.getTube_name2())) {
|
||||
// 判断是否超过长度
|
||||
Integer tubeLen1 = SlitterTaskUtil.getPaperLengthByCodeInt(point.getTube_name1());
|
||||
Integer tubeLen2 = SlitterTaskUtil.getPaperLengthByCodeInt(point.getTube_name2());
|
||||
if (tubeLen1 + tubeLen2 > 1700) {
|
||||
stepTipLogs.add("两个管芯相加长度超出轴长度,请检查!");
|
||||
redisUtils.set("ERROR" + deviceCode, stepTipLogs);
|
||||
throw new BadRequestException("两个管芯相加长度超出轴长度,请检查!");
|
||||
}
|
||||
}
|
||||
List<GxQtyDto> gxQtyList = papervehicleService.getGxPoints(point.getPoint_location(), tubes);
|
||||
// point.getTube_code1() 编码 , getTube_name1() : 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||
res.put("device_code", deviceCode);
|
||||
@@ -2973,6 +2983,25 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
return callPlanViewVOS.stream().filter(p -> p.getResource_name().equals(deviceCode)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getTubeLength(JSONObject param) {
|
||||
// container_name
|
||||
String containerName = param.getString("container_name");
|
||||
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
|
||||
if (ObjectUtil.isEmpty(plan)) {
|
||||
throw new BadRequestException("计划未找到,请确保MES已推送。");
|
||||
}
|
||||
JSONObject tube = new JSONObject();
|
||||
String[] split = SlitterTaskUtil.getTubeConvertInfo(plan).split("\\*");
|
||||
tube.put("bh", split[3]);
|
||||
tube.put("length", SlitterTaskUtil.getPaperLength(plan));
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("data", tube);
|
||||
res.put("message", "获取信息成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<String> getRedisListValue(String key) {
|
||||
List<String> stepTipLogs = (List<String>) redisUtils.get(key);
|
||||
if (CollectionUtil.isEmpty(stepTipLogs)) {
|
||||
|
||||
@@ -359,6 +359,42 @@ public class SlitterTaskUtil {
|
||||
String[] split = paperStr.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取: 长*外径*内径*壁厚*重量*薄壁厚*阶梯长度
|
||||
* @param plan
|
||||
* @return
|
||||
*/
|
||||
public static String getTubeConvertInfo(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
if (plan.getPaper_tube_or_FRP().equals(SlitterConstant.SLITTER_TYPE_PAPER)) {
|
||||
paperStr = plan.getPaper_tube_model();
|
||||
} else {
|
||||
paperStr = plan.getFRP_model();
|
||||
}
|
||||
return getComposePaperTubeInformation(paperStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @return /
|
||||
*/
|
||||
public static String getPaperLengthByCode(String name) {
|
||||
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String[] split = name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
return split[split.length - 1];
|
||||
}
|
||||
/**
|
||||
* 获取纸管长度
|
||||
* @param plan 分切计划
|
||||
* @return /
|
||||
*/
|
||||
public static Integer getPaperLengthByCodeInt(String name) {
|
||||
// String name = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
return Integer.valueOf(getPaperLengthByCode(name));
|
||||
}
|
||||
public static String getPaperSize(PdmBiSlittingproductionplan plan) {
|
||||
// String s = "玻璃纤维及其制品|FRP管|6英寸|15|1700";
|
||||
String paperStr = "";
|
||||
|
||||
Reference in New Issue
Block a user