feat: 套轴优化,新增手持气胀轴维护
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
|
||||
OR pp.qzzno = bc.qzz_no2
|
||||
WHERE bc.point_type = #{type}
|
||||
AND IFNULL(pp.qzzno,'') <![CDATA[ <> ]]> ''
|
||||
AND pp.qzz_size = #{size}
|
||||
<if test="size == '3'">
|
||||
AND pp.qzz_generation = #{generation}
|
||||
|
||||
@@ -100,4 +100,12 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> shaftMaintenanceInventory(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.shaftMaintenanceInventory(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/toShaftBinding")
|
||||
@Log("气胀轴绑定")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> toShaftBinding(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterDevices.toShaftBinding(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
resultType="org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto">
|
||||
SELECT
|
||||
p.resource_name,
|
||||
IF(LENGTH(p.parent_container_name) > 0, p.parent_container_name, p.container_name) AS parent_container_name,
|
||||
p.parent_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
@@ -70,7 +70,6 @@
|
||||
GROUP BY
|
||||
p.resource_name,
|
||||
p.parent_container_name,
|
||||
p.container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
|
||||
@@ -186,4 +186,11 @@ public interface SlitterService {
|
||||
* @return /
|
||||
*/
|
||||
JSONObject shaftMaintenanceInventory(JSONObject param);
|
||||
|
||||
/**
|
||||
* 气胀轴绑定
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject toShaftBinding(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -1171,4 +1171,45 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
res.put("message", "气胀轴库设置成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject toShaftBinding(JSONObject param) {
|
||||
// param : container_name, point_code
|
||||
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 + "] 的分切计划没找到,检查是否推送或者子卷号是否正确!");
|
||||
}
|
||||
BstIvtCutpointivt pointCode = bcutpointivtService.getPintByTrussCode(pointCode1, false);
|
||||
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();
|
||||
plans.forEach(p -> {
|
||||
p.setQzzno(qzzNo);
|
||||
p.setStatus("03");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
});
|
||||
if (pointCode1.endsWith("A")) {
|
||||
pointCode.setQzz_no1(qzzNo);
|
||||
} else {
|
||||
pointCode.setQzz_no2(qzzNo);
|
||||
}
|
||||
pointCode.setPoint_status("3");
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
bcutpointivtService.updateById(pointCode);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "气胀轴绑定成功!");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user