子卷出站
This commit is contained in:
@@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pda.mps.service.CasingService;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -21,20 +22,20 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Slf4j
|
||||
public class OutController {
|
||||
|
||||
private final CasingService casingService;
|
||||
private final OutService outService;
|
||||
|
||||
@PostMapping("/queryMaterialInfo")
|
||||
@Log("分切计划初始化查询")
|
||||
@ApiOperation("分切计划初始化查询")
|
||||
public ResponseEntity<Object> queryMaterialInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(casingService.queryMaterialInfo(whereJson), HttpStatus.OK);
|
||||
return new ResponseEntity<>(outService.queryMaterialInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("套轴确认")
|
||||
@ApiOperation("套轴确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
casingService.confirm(whereJson);
|
||||
outService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.mps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface OutService {
|
||||
@@ -9,7 +10,7 @@ public interface OutService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryMaterialInfo(JSONObject whereJson);
|
||||
JSONArray queryMaterialInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 出站确认
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package org.nl.wms.pda.mps.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -14,11 +19,16 @@ public class OutServiceImpl implements OutService {
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject queryMaterialInfo(JSONObject whereJson) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code", "1");
|
||||
result.put("desc", "查询成功");
|
||||
return result;
|
||||
public JSONArray queryMaterialInfo(JSONObject whereJson) {
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("flag", "5");
|
||||
if (StrUtil.isNotEmpty(product_area)) {
|
||||
map.put("product_area", product_area);
|
||||
}
|
||||
JSONArray rows = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.mps.service.CasingService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -42,21 +43,40 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
JSONObject cut_jo = whereJson.getJSONObject("cut_jo");
|
||||
//查询离该分切计划包含机台最近的一个空载具
|
||||
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
||||
.addParam("sort_seq",cut_jo.getString("sort_seq"))
|
||||
.addParam("product_area",cut_jo.getString("product_area"))
|
||||
.addParam("point_location",cut_jo.getString("point_location"))
|
||||
.addParam("flag","3").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(empty_vehicle)){
|
||||
.addParam("sort_seq", cut_jo.getString("sort_seq"))
|
||||
.addParam("product_area", cut_jo.getString("product_area"))
|
||||
.addParam("point_location", cut_jo.getString("point_location"))
|
||||
.addParam("flag", "3").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(empty_vehicle)) {
|
||||
throw new BadRequestException("未查询到可用的空载具!");
|
||||
}
|
||||
|
||||
//如果查询到给ACS下发一个桁架任务
|
||||
//如果查询到给ACS下发一个输送线任务
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirm(JSONObject whereJson) {
|
||||
JSONArray rows = whereJson.getJSONArray("cut_rows");
|
||||
|
||||
//通过气涨轴对应的分切计划来判断要送到哪个机台编号附近
|
||||
String qzzno = rows.getJSONObject(0).getString("qzzno");
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("flag", "3");
|
||||
|
||||
if (StrUtil.isNotEmpty(qzzno)) {
|
||||
map.put("qzzno", qzzno);
|
||||
}
|
||||
JSONObject plan_jo = WQL.getWO("PDA_02").addParamMap(map).process().uniqueResult(0);
|
||||
//查询离该分切计划包含机台最近的一个空点位
|
||||
JSONObject empty_point = WQL.getWO("PDA_02")
|
||||
.addParam("sort_seq", plan_jo.getString("sort_seq"))
|
||||
.addParam("product_area", plan_jo.getString("product_area"))
|
||||
.addParam("point_location", plan_jo.getString("point_location"))
|
||||
.addParam("flag", "4").process().uniqueResult(0);
|
||||
|
||||
//下发输送线任务
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
WHERE
|
||||
1=1
|
||||
point_status = '02'
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
@@ -124,10 +124,64 @@
|
||||
ivt.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
ORDER BY
|
||||
abs(3-输入.sort_seq),point_code
|
||||
abs(输入.sort_seq-sort_seq),point_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
ivt.*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
WHERE
|
||||
point_status = '01'
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
ORDER BY
|
||||
abs(输入.sort_seq-sort_seq),point_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
plan.mfg_order_name,
|
||||
plan.container_name,
|
||||
ivt.point_code,
|
||||
plan.split_group,
|
||||
plan.manufacture_sort,
|
||||
plan.manufacture_date,
|
||||
plan.paper_tube_or_FRP,
|
||||
plan.paper_tube_material,
|
||||
plan.paper_tube_description,
|
||||
plan.paper_tube_model,
|
||||
plan.FRP_material,
|
||||
plan.FRP_description,
|
||||
plan.FRP_model,
|
||||
plan.workorder_id,
|
||||
ivt.sort_seq,
|
||||
ivt.product_area,
|
||||
ivt.point_location
|
||||
FROM
|
||||
PDM_BI_SlittingProductionPlan plan
|
||||
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
|
||||
WHERE
|
||||
plan.STATUS < 2
|
||||
AND
|
||||
is_child_tz_ok = 1
|
||||
AND
|
||||
is_child_ps_ok = 1
|
||||
OPTION 输入.product_area <> ""
|
||||
ivt.product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user