add: 分切子卷维护分切机手持
This commit is contained in:
@@ -115,4 +115,16 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> querySlitterSubVolumeInfo(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.querySlitterSubVolumeInfo(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/bindSlitterSubVolumeInfo")
|
||||
@Log("绑定分切机上的子卷信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> bindSlitterSubVolumeInfo(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.bindSlitterSubVolumeInfo(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/unBindSlitterSubVolumeInfo")
|
||||
@Log("接绑分切机上的子卷信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> unBindSlitterSubVolumeInfo(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.unBindSlitterSubVolumeInfo(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,4 +200,18 @@ public interface SlitterService {
|
||||
* @return /
|
||||
*/
|
||||
JSONObject querySlitterSubVolumeInfo(JSONObject param);
|
||||
|
||||
/**
|
||||
* 绑定分切机上的子卷信息
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject bindSlitterSubVolumeInfo(JSONObject param);
|
||||
|
||||
/**
|
||||
* 解绑分切机上的子卷信息
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject unBindSlitterSubVolumeInfo(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -1220,6 +1221,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
@Override
|
||||
public JSONObject querySlitterSubVolumeInfo(JSONObject param) {
|
||||
JSONObject res = new JSONObject();
|
||||
// param: point_code, container_name(多个用','隔开)
|
||||
String containerName = param.getString("container_name");
|
||||
String pointCode1 = param.getString("point_code");
|
||||
@@ -1228,9 +1230,90 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
List<String> collect = Arrays.stream(containerName.split(",")).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByContainerNames(collect);
|
||||
if (plans.size() == 0) {
|
||||
res.put("msg", "子卷号:[" + containerName + "] 的分切计划没找到,检查是否推送或者子卷号是否正确!");
|
||||
return res;
|
||||
}
|
||||
PdmBiSlittingproductionplan plan = plans.get(0);
|
||||
String qzzNo;
|
||||
StIvtCutpointivt slitterDevice = cutpointivtService.getPintByUpOrDownCode(pointCode1, false);
|
||||
if (pointCode1.equals(slitterDevice.getUp_point_code())) {
|
||||
// 上轴
|
||||
qzzNo = slitterDevice.getUp_qzzno();
|
||||
} else {
|
||||
qzzNo = slitterDevice.getDown_qzzno();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(qzzNo)) {
|
||||
res.put("msg", "该位置未存在子卷信息,请绑定!");
|
||||
return res;
|
||||
}
|
||||
if (qzzNo.equals(plan.getQzzno())) {
|
||||
res.put("msg", "该位置子卷信息与实物扫码一致!");
|
||||
return res;
|
||||
} else {
|
||||
res.put("msg", "该位置子卷信息与实物扫码不一致,请绑定!");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject bindSlitterSubVolumeInfo(JSONObject param) {
|
||||
// param: point_code, container_name(逗号隔开)
|
||||
// 子卷生成气胀轴编码,设置05状态
|
||||
String containerName = param.getString("container_name");
|
||||
String pointCode1 = param.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(containerName)) {
|
||||
throw new BadRequestException("子卷号不能为空!");
|
||||
}
|
||||
List<String> collect = Arrays.stream(containerName.split(",")).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByContainerNames(collect);
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("子卷号:[" + containerName + "] 的分切计划没找到,检查是否推送或者子卷号是否正确!");
|
||||
}
|
||||
return null;
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
String resourceName = demoPlan.getResource_name();
|
||||
String qzzNo = resourceName.substring(0, 2)
|
||||
+ resourceName.substring(resourceName.length() - 2)
|
||||
+ demoPlan.getSplit_group()
|
||||
+ TaskUtils.getDateTime("MMddHHmmss") + "-"
|
||||
+ demoPlan.getUp_or_down();
|
||||
if (ObjectUtil.isNotEmpty(demoPlan.getQzzno())) {
|
||||
qzzNo = demoPlan.getQzzno();
|
||||
}
|
||||
for (PdmBiSlittingproductionplan plan : plans) {
|
||||
plan.setQzzno(qzzNo);
|
||||
plan.setStatus("05");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(plan);
|
||||
}
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
// 气胀轴编码设置到分切机器上
|
||||
StIvtCutpointivt slitterDevice = cutpointivtService.getPintByUpOrDownCode(pointCode1, false);
|
||||
if (pointCode1.equals(slitterDevice.getUp_point_code())) {
|
||||
slitterDevice.setUp_qzzno(qzzNo);
|
||||
} else {
|
||||
slitterDevice.setDown_qzzno(qzzNo);
|
||||
}
|
||||
cutpointivtService.updateById(slitterDevice);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "子卷信息绑定成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject unBindSlitterSubVolumeInfo(JSONObject param) {
|
||||
String pointCode1 = param.getString("point_code");
|
||||
StIvtCutpointivt slitterDevice = cutpointivtService.getPintByUpOrDownCode(pointCode1, false);
|
||||
if (pointCode1.equals(slitterDevice.getUp_point_code())) {
|
||||
slitterDevice.setUp_qzzno("");
|
||||
} else {
|
||||
slitterDevice.setDown_qzzno("");
|
||||
}
|
||||
cutpointivtService.updateById(slitterDevice);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "子卷信息清除成功!");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user