fix: 申请套轴
This commit is contained in:
@@ -81,4 +81,10 @@ public class SlitterPdaController {
|
|||||||
public ResponseEntity<Object> bindSlitterSubVolumeInfo(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> bindSlitterSubVolumeInfo(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(slitterPdaService.bindSlitterSubVolumeInfo(param), HttpStatus.OK);
|
return new ResponseEntity<>(slitterPdaService.bindSlitterSubVolumeInfo(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/requestTubeShaft")
|
||||||
|
@Log("套轴申请 - 请求套轴")
|
||||||
|
public ResponseEntity<Object> requestTubeShaft(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(slitterPdaService.requestTubeShaft(param), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,4 +72,11 @@ public interface SlitterPdaService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject bindSlitterSubVolumeInfo(JSONObject param);
|
JSONObject bindSlitterSubVolumeInfo(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 套轴申请 - 请求套轴
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONObject requestTubeShaft(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package org.nl.wms.pda.mps.service.impl;
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
@@ -11,6 +13,7 @@ import org.nl.common.exception.BadRequestException;
|
|||||||
import org.nl.config.lucene.TagNameEnum;
|
import org.nl.config.lucene.TagNameEnum;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.pda.mps.service.SlitterPdaService;
|
import org.nl.wms.pda.mps.service.SlitterPdaService;
|
||||||
|
import org.nl.wms.pda.mps.service.vo.CallShaftVo;
|
||||||
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
||||||
@@ -34,7 +37,10 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -375,4 +381,56 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
|||||||
res.put("message", "子卷信息绑定成功!");
|
res.put("message", "子卷信息绑定成功!");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject requestTubeShaft(JSONObject param) {
|
||||||
|
log.info("请求套轴 - {}", param);
|
||||||
|
// param: row: point_code,left_or_right,material_code,material_spec,paper_or_frp,qzz_size
|
||||||
|
List<CallShaftVo> row = param.getJSONArray("row").toJavaList(CallShaftVo.class);
|
||||||
|
String pointCode = row.get(0).getPoint_code();
|
||||||
|
StIvtCutpointivt cutDevice = cutpointivtService.getPintByUpOrDownCode(pointCode, false);
|
||||||
|
List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
|
||||||
|
for (CallShaftVo callShaftVo : row) {
|
||||||
|
// 保存工单
|
||||||
|
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
|
||||||
|
plan.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||||
|
plan.setOrder_type("1");
|
||||||
|
plan.setContainer_name("-");
|
||||||
|
plan.setProduct_name("-");
|
||||||
|
plan.setDescription("-");
|
||||||
|
plan.setWare_house("-");
|
||||||
|
plan.setResource_name(cutDevice.getExt_code());
|
||||||
|
plan.setSplit_group("-");
|
||||||
|
plan.setManufacture_sort("1");
|
||||||
|
plan.setMfg_order_name("-");
|
||||||
|
plan.setManufacture_date(DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||||
|
plan.setPaper_tube_or_FRP(callShaftVo.getPaper_or_frp());
|
||||||
|
if ("1".equals(callShaftVo.getPaper_or_frp())) {
|
||||||
|
// 纸管
|
||||||
|
plan.setPaper_tube_material(callShaftVo.getMaterial_code());
|
||||||
|
plan.setPaper_tube_model(callShaftVo.getMaterial_spec());
|
||||||
|
plan.setPaper_tube_description(callShaftVo.getMaterial_spec());
|
||||||
|
} else {
|
||||||
|
// frp
|
||||||
|
plan.setFRP_material(callShaftVo.getMaterial_code());
|
||||||
|
plan.setFRP_model(callShaftVo.getMaterial_spec());
|
||||||
|
plan.setFRP_description(callShaftVo.getMaterial_spec());
|
||||||
|
}
|
||||||
|
plan.setStatus("01");
|
||||||
|
plan.setSplit_height(BigDecimal.valueOf(1));
|
||||||
|
plan.setSplit_breadth(BigDecimal.valueOf(1));
|
||||||
|
plan.setSplit_weight(BigDecimal.valueOf(1));
|
||||||
|
plan.setSale_order_name("-");
|
||||||
|
plan.setQzz_size(callShaftVo.getQzz_size());
|
||||||
|
plan.setUp_or_down(cutDevice.getUp_point_code().equals(callShaftVo.getPoint_code())
|
||||||
|
? "1" : "2");
|
||||||
|
plan.setLeft_or_right(callShaftVo.getLeft_or_right());
|
||||||
|
plans.add(plan);
|
||||||
|
}
|
||||||
|
slittingproductionplanService.saveBatch(plans);
|
||||||
|
JSONObject res = new JSONObject();
|
||||||
|
res.put("status", cn.hutool.http.HttpStatus.HTTP_OK);
|
||||||
|
res.put("message", "请求套轴成功!");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.nl.wms.pda.mps.service.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求套轴Vo
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2024/9/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CallShaftVo {
|
||||||
|
private String point_code;
|
||||||
|
private String left_or_right;
|
||||||
|
private String material_code;
|
||||||
|
private String material_spec;
|
||||||
|
private String paper_or_frp;
|
||||||
|
private String qzz_size;
|
||||||
|
}
|
||||||
@@ -147,15 +147,15 @@ public class SlitterDownAGVTask extends AbstractTask {
|
|||||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||||
.in(PdmBiSlittingproductionplan::getQzzno, qzzNo));
|
.in(PdmBiSlittingproductionplan::getQzzno, qzzNo));
|
||||||
}
|
}
|
||||||
PdmBiSlittingproductionplan demoPlan = list.get(0);
|
// PdmBiSlittingproductionplan demoPlan = list.get(0);
|
||||||
// hint: 创建送气胀轴任务
|
// hint: 创建送气胀轴任务
|
||||||
JSONObject taskParam = new JSONObject();
|
// JSONObject taskParam = new JSONObject();
|
||||||
taskParam.put("up_task_code", taskObj.getTask_code());
|
// taskParam.put("up_task_code", taskObj.getTask_code());
|
||||||
taskParam.put("config_code", "SendShaftAGVTask");
|
// taskParam.put("config_code", "SendShaftAGVTask");
|
||||||
taskParam.put("resource_name", demoPlan.getResource_name());
|
// taskParam.put("resource_name", demoPlan.getResource_name());
|
||||||
taskParam.put("create_mode", GeneralDefinition.TASK_CREATION);
|
// taskParam.put("create_mode", GeneralDefinition.TASK_CREATION);
|
||||||
taskParam.put("device_code", startPointCode);
|
// taskParam.put("device_code", startPointCode);
|
||||||
sendShaftAGVTask.apply(taskParam);
|
// sendShaftAGVTask.apply(taskParam);
|
||||||
// 任务更新
|
// 任务更新
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user