手持
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
package org.nl.wms.pda.callmaterial.rest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.logging.annotation.Log;
|
|
||||||
import org.nl.wms.pda.callmaterial.service.CallMaterialService;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Api(tags = "手持叫料")
|
|
||||||
@RequestMapping("api/pda/callMaterial")
|
|
||||||
@Slf4j
|
|
||||||
public class CallMaterialController {
|
|
||||||
|
|
||||||
private final CallMaterialService callMaterialService;
|
|
||||||
|
|
||||||
@PostMapping("/queryPoint")
|
|
||||||
@Log("查询区域点位")
|
|
||||||
@ApiOperation("查询区域点位")
|
|
||||||
public ResponseEntity<Object> queryPoint() {
|
|
||||||
return new ResponseEntity<>(callMaterialService.queryPoint(), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
|
||||||
@Log("叫料确定")
|
|
||||||
@ApiOperation("叫料确定")
|
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
|
||||||
return new ResponseEntity<>(callMaterialService.confirm(whereJson), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package org.nl.wms.pda.callmaterial.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
public interface CallMaterialService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询区域点位
|
|
||||||
* @return json
|
|
||||||
*/
|
|
||||||
JSONObject queryPoint();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 叫料确定
|
|
||||||
* @param whereJson /
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject confirm(JSONObject whereJson);
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
[交易说明]
|
|
||||||
交易名: 手持叫料查询
|
|
||||||
所属模块:
|
|
||||||
功能简述:
|
|
||||||
版权所有:
|
|
||||||
表引用:
|
|
||||||
版本经历:
|
|
||||||
|
|
||||||
[数据库]
|
|
||||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
|
||||||
|
|
||||||
[IO定义]
|
|
||||||
#################################################
|
|
||||||
## 表字段对应输入参数
|
|
||||||
#################################################
|
|
||||||
输入.flag TYPEAS s_string
|
|
||||||
输入.region_id TYPEAS s_string
|
|
||||||
|
|
||||||
[临时表]
|
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
|
||||||
|
|
||||||
[临时变量]
|
|
||||||
--所有中间过程变量均可在此处定义
|
|
||||||
|
|
||||||
[业务过程]
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 1、输入输出检查 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 2、主过程前处理 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 3、业务主过程 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
region_id,
|
|
||||||
region_code,
|
|
||||||
region_name
|
|
||||||
FROM
|
|
||||||
sch_base_region
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND region_code = 'YQQY01'
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
point_id,
|
|
||||||
point_code,
|
|
||||||
point_name
|
|
||||||
FROM
|
|
||||||
sch_base_point
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND is_delete = '0'
|
|
||||||
AND is_host = '0'
|
|
||||||
AND device_point_type = '3'
|
|
||||||
|
|
||||||
OPTION 输入.region_id <> ""
|
|
||||||
region_id = 输入.region_id
|
|
||||||
ENDOPTION
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package org.nl.wms.pda.callvehicle.rest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.logging.annotation.Log;
|
|
||||||
import org.nl.wms.pda.callvehicle.service.CallVehicleService;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Api(tags = "手持呼叫空托盘")
|
|
||||||
@RequestMapping("api/pda/callEmpty")
|
|
||||||
@Slf4j
|
|
||||||
public class CallVehicleController {
|
|
||||||
|
|
||||||
private final CallVehicleService callVehicleService;
|
|
||||||
|
|
||||||
@PostMapping("/queryPoint")
|
|
||||||
@Log("查询区域点位")
|
|
||||||
@ApiOperation("查询区域点位")
|
|
||||||
public ResponseEntity<Object> queryPoint() {
|
|
||||||
return new ResponseEntity<>(callVehicleService.queryPoint(), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
|
||||||
@Log("呼叫空托盘确定")
|
|
||||||
@ApiOperation("呼叫空托盘确定")
|
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
|
||||||
return new ResponseEntity<>(callVehicleService.confirm(whereJson), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package org.nl.wms.pda.callvehicle.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
public interface CallVehicleService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询区域点位
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject queryPoint();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 呼叫空托盘确定
|
|
||||||
* @param whereJson /
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject confirm(JSONObject whereJson);
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package org.nl.wms.pda.callvehicle.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.wms.ext.acs.service.AcsToWmsService;
|
|
||||||
import org.nl.wms.pda.callvehicle.service.CallVehicleService;
|
|
||||||
import org.nl.modules.wql.WQL;
|
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class CallVehicleServiceImpl implements CallVehicleService {
|
|
||||||
|
|
||||||
private final AcsToWmsService acsToWmsService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject queryPoint() {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1.查询区域:油漆区域 YQQY01、共挤区域 GJQY01
|
|
||||||
JSONArray regionArr = WQL.getWO("PDA_CALLVEHICLE_01").addParam("flag", "1").process().getResultJSONArray(0);
|
|
||||||
// 2.根据区域查询对应的物料上料位
|
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
for (int i = 0; i < regionArr.size(); i++) {
|
|
||||||
JSONObject jsonRegion = regionArr.getJSONObject(i);
|
|
||||||
JSONArray pointArr = WQL.getWO("PDA_CALLVEHICLE_01").addParam("flag", "2").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0);
|
|
||||||
jsonRegion.put("pointArr", pointArr);
|
|
||||||
}
|
|
||||||
resultJson.put("regionja", regionArr);
|
|
||||||
result.put("result", resultJson);
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "查询成功");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONObject confirm(JSONObject whereJson) {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1、准备参数:point_code、type:1为共挤区域,3为油漆区域
|
|
||||||
JSONObject param = new JSONObject();
|
|
||||||
|
|
||||||
String region_id = whereJson.getString("region_id");
|
|
||||||
JSONObject jsonObject = WQLObject.getWQLObject("sch_base_region").query("region_id ='" + region_id + "'").uniqueResult(0);
|
|
||||||
String region_code = jsonObject.getString("region_code");
|
|
||||||
if (StrUtil.equals(region_code, "GJQY01")) param.put("type","1");
|
|
||||||
if (StrUtil.equals(region_code, "YQQY01")) param.put("type","3");
|
|
||||||
|
|
||||||
param.put("point_code",whereJson.getString("point_code"));
|
|
||||||
param.put("vehicle_num",whereJson.getString("qty"));
|
|
||||||
// 2、调用接口
|
|
||||||
JSONObject json = acsToWmsService.apply(param);
|
|
||||||
if (StrUtil.equals(json.getString("status"), "200")) {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "操作成功");
|
|
||||||
} else {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "0");
|
|
||||||
result.put("desc", "操作失败:"+json.getString("message"));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
[交易说明]
|
|
||||||
交易名: 手持呼叫空托盘查询
|
|
||||||
所属模块:
|
|
||||||
功能简述:
|
|
||||||
版权所有:
|
|
||||||
表引用:
|
|
||||||
版本经历:
|
|
||||||
|
|
||||||
[数据库]
|
|
||||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
|
||||||
|
|
||||||
[IO定义]
|
|
||||||
#################################################
|
|
||||||
## 表字段对应输入参数
|
|
||||||
#################################################
|
|
||||||
输入.flag TYPEAS s_string
|
|
||||||
输入.region_id TYPEAS s_string
|
|
||||||
|
|
||||||
[临时表]
|
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
|
||||||
|
|
||||||
[临时变量]
|
|
||||||
--所有中间过程变量均可在此处定义
|
|
||||||
|
|
||||||
[业务过程]
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 1、输入输出检查 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 2、主过程前处理 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 3、业务主过程 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
region_id,
|
|
||||||
region_code,
|
|
||||||
region_name
|
|
||||||
FROM
|
|
||||||
sch_base_region
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND region_code in ('YQQY01','GJQY01')
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
point_id,
|
|
||||||
point_code,
|
|
||||||
point_name
|
|
||||||
FROM
|
|
||||||
sch_base_point
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND is_delete = '0'
|
|
||||||
AND is_host = '0'
|
|
||||||
AND device_point_type = '1'
|
|
||||||
|
|
||||||
OPTION 输入.region_id <> ""
|
|
||||||
region_id = 输入.region_id
|
|
||||||
ENDOPTION
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package org.nl.wms.pda.emptyandqty.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
public interface EmptyAndQtyService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定
|
|
||||||
* @param whereJson /
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject confirm(JSONObject whereJson);
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package org.nl.wms.pda.emptyandqty.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
|
||||||
import org.nl.wms.basedata.master.service.StoragevehicleinfoService;
|
|
||||||
import org.nl.wms.basedata.master.service.dto.StoragevehicleinfoDto;
|
|
||||||
import org.nl.wms.pda.emptyandqty.service.EmptyAndQtyService;
|
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class EmptyAndQtyServiceImpl implements EmptyAndQtyService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONObject confirm(JSONObject whereJson) {
|
|
||||||
String vehicle_code = whereJson.getString("vehicle_code");
|
|
||||||
String qty = whereJson.getString("qty");
|
|
||||||
|
|
||||||
WQLObject vqTab = WQLObject.getWQLObject("PDM_BI_vehicleQty");
|
|
||||||
StoragevehicleinfoDto byCode = SpringContextHolder.getBean(StoragevehicleinfoService.class).findByCode(vehicle_code);
|
|
||||||
|
|
||||||
// 插入记录
|
|
||||||
JSONObject json = new JSONObject();
|
|
||||||
json.put("vehicleqty_id", IdUtil.getSnowflake(1, 1).nextId());
|
|
||||||
json.put("vehicle_id", byCode.getStoragevehicle_id());
|
|
||||||
json.put("vehicle_code", vehicle_code);
|
|
||||||
json.put("qty", qty);
|
|
||||||
json.put("is_task", "0");
|
|
||||||
json.put("create_id", SecurityUtils.getCurrentUserId());
|
|
||||||
json.put("create_name", SecurityUtils.getCurrentNickName());
|
|
||||||
json.put("create_time", DateUtil.now());
|
|
||||||
vqTab.insert(json);
|
|
||||||
// 返回成功
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
result.put("srb", "");
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "操作成功");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.nl.wms.pda.emptyandqty.rest;
|
package org.nl.wms.pda.mps.rest;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -6,7 +6,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.nl.wms.pda.emptyandqty.service.EmptyAndQtyService;
|
import org.nl.wms.pda.mps.service.BakingService;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -16,17 +17,17 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Api(tags = "手持空托盘与数量绑定")
|
@Api(tags = "烘烤工序")
|
||||||
@RequestMapping("api/pda/emptyAndQty")
|
@RequestMapping("api/pda/baking")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EmptyAndQtyController {
|
public class BakingController {
|
||||||
|
|
||||||
private final EmptyAndQtyService emptyAndQtyService;
|
private final BakingService bakingService;
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
@PostMapping("/ovenInAndOut")
|
||||||
@Log("绑定")
|
@Log("烘箱出入")
|
||||||
@ApiOperation("绑定")
|
@ApiOperation("烘箱出入")
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> queryRawFoil(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(emptyAndQtyService.confirm(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(bakingService.ovenInAndOut(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.nl.wms.pda.mps.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.wms.pda.mps.service.PointStatusService;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "点位管理")
|
||||||
|
@RequestMapping("api/pda/point")
|
||||||
|
@Slf4j
|
||||||
|
public class PointStatusController {
|
||||||
|
|
||||||
|
private final PointStatusService pointStatusService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/pointOperate")
|
||||||
|
@Log("点位解绑绑定")
|
||||||
|
@ApiOperation("点位解绑绑定")
|
||||||
|
public ResponseEntity<Object> pointOperate(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pointStatusService.pointOperate(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/pointStatusQuery")
|
||||||
|
@Log("点位状态查询")
|
||||||
|
@ApiOperation("点位状态查询")
|
||||||
|
public ResponseEntity<Object> pointStatusQuery(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(pointStatusService.pointStatusQuery(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.nl.wms.pda.mps.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "生箔工序")
|
||||||
|
@RequestMapping("api/pda/raw")
|
||||||
|
@Slf4j
|
||||||
|
public class RawFoilController {
|
||||||
|
|
||||||
|
private final RawFoilService rawFoilService;
|
||||||
|
|
||||||
|
@PostMapping("/queryProductArea")
|
||||||
|
@Log("查询生产区域")
|
||||||
|
@ApiOperation("查询生产区域")
|
||||||
|
public ResponseEntity<Object> queryProductArea() {
|
||||||
|
return new ResponseEntity<>(rawFoilService.queryProductArea(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryRawFoil")
|
||||||
|
@Log("查询生箔生产进度")
|
||||||
|
@ApiOperation("查询生箔生产进度")
|
||||||
|
public ResponseEntity<Object> queryRawFoil(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(rawFoilService.queryRawFoil(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryRawFoilList")
|
||||||
|
@Log("查询生箔工单")
|
||||||
|
@ApiOperation("查询生箔工单")
|
||||||
|
public ResponseEntity<Object> queryRawFoilList(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(rawFoilService.queryRawFoilList(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.nl.wms.pda.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface BakingService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 烘箱出入
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject ovenInAndOut(JSONObject whereJson);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package org.nl.wms.pda.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface PointStatusService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位操作
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject pointOperate(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点位状态查询
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject pointStatusQuery(JSONObject whereJson);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package org.nl.wms.pda.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface RawFoilService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询生产区域
|
||||||
|
* @return json
|
||||||
|
*/
|
||||||
|
JSONObject queryProductArea();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 叫料确定
|
||||||
|
* @param whereJson /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
JSONObject queryRawFoil(JSONObject whereJson);
|
||||||
|
|
||||||
|
JSONObject queryRawFoilList(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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.wms.ext.acs.service.AcsToWmsService;
|
||||||
|
import org.nl.wms.pda.mps.service.BakingService;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class BakingServiceImpl implements BakingService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject ovenInAndOut(JSONObject whereJson) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("code", "1");
|
||||||
|
result.put("desc", "查询成功");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.wms.pda.mps.service.BakingService;
|
||||||
|
import org.nl.wms.pda.mps.service.PointStatusService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class PointStatusServiceImpl implements PointStatusService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject pointOperate(JSONObject whereJson) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("code", "1");
|
||||||
|
result.put("desc", "查询成功");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject pointStatusQuery(JSONObject whereJson) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("code", "1");
|
||||||
|
result.put("desc", "查询成功");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,44 +1,35 @@
|
|||||||
package org.nl.wms.pda.callmaterial.service.impl;
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
|
||||||
import org.nl.wms.pda.callmaterial.service.CallMaterialService;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
|
import org.nl.wms.pda.mps.service.RawFoilService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class CallMaterialServiceImpl implements CallMaterialService {
|
public class RawFoilServiceImpl implements RawFoilService {
|
||||||
private final AcsToWmsService acsToWmsService;
|
private final AcsToWmsService acsToWmsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject queryPoint() {
|
public JSONObject queryProductArea() {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
// 1.查询区域:油漆区域 YQQY01
|
|
||||||
JSONArray regionArr = WQL.getWO("PDA_CALLMATERIAL_01").addParam("flag", "1").process().getResultJSONArray(0);
|
JSONArray rows = new JSONArray();
|
||||||
// 2.根据区域查询对应的物料上料位
|
result.put("rows", rows);
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
for (int i = 0; i < regionArr.size(); i++) {
|
|
||||||
JSONObject jsonRegion = regionArr.getJSONObject(i);
|
|
||||||
JSONArray pointArr = WQL.getWO("PDA_CALLMATERIAL_01").addParam("flag", "2").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0);
|
|
||||||
jsonRegion.put("pointArr", pointArr);
|
|
||||||
}
|
|
||||||
resultJson.put("regionja", regionArr);
|
|
||||||
result.put("result", resultJson);
|
|
||||||
result.put("code", "1");
|
result.put("code", "1");
|
||||||
result.put("desc", "查询成功");
|
result.put("desc", "查询成功");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
public JSONObject queryRawFoil(JSONObject whereJson) {
|
||||||
public JSONObject confirm(JSONObject whereJson) {
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
// 1、准备参数:point_code、type = 4
|
// 1、准备参数:point_code、type = 4
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
@@ -57,4 +48,45 @@ public class CallMaterialServiceImpl implements CallMaterialService {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject queryRawFoilList(JSONObject whereJson) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
// 1、准备参数:point_code、type = 4
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("type","4");
|
||||||
|
param.put("point_code",whereJson.getString("point_code"));
|
||||||
|
// 2、调用接口
|
||||||
|
JSONObject json = acsToWmsService.apply(param);
|
||||||
|
if (StrUtil.equals(json.getString("status"), "200")) {
|
||||||
|
result.put("result", "");
|
||||||
|
result.put("code", "1");
|
||||||
|
result.put("desc", "操作成功");
|
||||||
|
} else {
|
||||||
|
result.put("result", "");
|
||||||
|
result.put("code", "0");
|
||||||
|
result.put("desc", "操作失败:"+json.getString("message"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendmaterial.rest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.logging.annotation.Log;
|
|
||||||
import org.nl.wms.pda.sendmaterial.service.SendMaterialService;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Api(tags = "手持送料")
|
|
||||||
@RequestMapping("api/pda/sendMaterial")
|
|
||||||
@Slf4j
|
|
||||||
public class SendMaterialController {
|
|
||||||
|
|
||||||
private final SendMaterialService sendMaterialService;
|
|
||||||
|
|
||||||
@PostMapping("/queryPoint")
|
|
||||||
@Log("查询区域点位")
|
|
||||||
@ApiOperation("查询区域点位")
|
|
||||||
public ResponseEntity<Object> queryPoint() {
|
|
||||||
return new ResponseEntity<>(sendMaterialService.queryPoint(), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
|
||||||
@Log("送料确定")
|
|
||||||
@ApiOperation("送料确定")
|
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
|
||||||
return new ResponseEntity<>(sendMaterialService.confirm(whereJson), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendmaterial.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
public interface SendMaterialService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询区域点位
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject queryPoint();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 送料确定
|
|
||||||
* @param whereJson /
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject confirm(JSONObject whereJson);
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendmaterial.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.wms.ext.acs.service.AcsToWmsService;
|
|
||||||
import org.nl.wms.pda.sendmaterial.service.SendMaterialService;
|
|
||||||
import org.nl.modules.wql.WQL;
|
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class SendMaterialServiceImpl implements SendMaterialService {
|
|
||||||
|
|
||||||
private final AcsToWmsService acsToWmsService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject queryPoint() {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1.查询区域:豪凯区域 HKQY01、共挤区域 GJQY01
|
|
||||||
JSONArray regionArr = WQL.getWO("PDA_SENDMATERIAL_01").addParam("flag", "1").process().getResultJSONArray(0);
|
|
||||||
// 2.根据区域查询对应的物料上料位
|
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
for (int i = 0; i < regionArr.size(); i++) {
|
|
||||||
JSONObject jsonRegion = regionArr.getJSONObject(i);
|
|
||||||
JSONArray pointArr = WQL.getWO("PDA_SENDMATERIAL_01").addParam("flag", "2").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0);
|
|
||||||
jsonRegion.put("pointArr", pointArr);
|
|
||||||
}
|
|
||||||
resultJson.put("regionja", regionArr);
|
|
||||||
result.put("result", resultJson);
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "查询成功");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONObject confirm(JSONObject whereJson) {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1、准备参数:point_code、type:2为共挤区域,8为豪凯区域
|
|
||||||
JSONObject param = new JSONObject();
|
|
||||||
|
|
||||||
String region_id = whereJson.getString("region_id");
|
|
||||||
JSONObject jsonObject = WQLObject.getWQLObject("sch_base_region").query("region_id ='" + region_id + "'").uniqueResult(0);
|
|
||||||
String region_code = jsonObject.getString("region_code");
|
|
||||||
if (StrUtil.equals(region_code, "GJQY01")) param.put("type","2");
|
|
||||||
if (StrUtil.equals(region_code, "HKQY01")) param.put("type","8");
|
|
||||||
|
|
||||||
param.put("point_code",whereJson.getString("point_code"));
|
|
||||||
param.put("qty",whereJson.getString("qty"));
|
|
||||||
// 2、调用接口
|
|
||||||
JSONObject json = acsToWmsService.apply(param);
|
|
||||||
if (StrUtil.equals(json.getString("status"), "200")) {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "操作成功");
|
|
||||||
} else {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "0");
|
|
||||||
result.put("desc", "操作失败:"+json.getString("message"));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
[交易说明]
|
|
||||||
交易名: 手持送料查询
|
|
||||||
所属模块:
|
|
||||||
功能简述:
|
|
||||||
版权所有:
|
|
||||||
表引用:
|
|
||||||
版本经历:
|
|
||||||
|
|
||||||
[数据库]
|
|
||||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
|
||||||
|
|
||||||
[IO定义]
|
|
||||||
#################################################
|
|
||||||
## 表字段对应输入参数
|
|
||||||
#################################################
|
|
||||||
输入.flag TYPEAS s_string
|
|
||||||
输入.region_id TYPEAS s_string
|
|
||||||
|
|
||||||
[临时表]
|
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
|
||||||
|
|
||||||
[临时变量]
|
|
||||||
--所有中间过程变量均可在此处定义
|
|
||||||
|
|
||||||
[业务过程]
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 1、输入输出检查 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 2、主过程前处理 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 3、业务主过程 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
region_id,
|
|
||||||
region_code,
|
|
||||||
region_name
|
|
||||||
FROM
|
|
||||||
sch_base_region
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND region_code in ('HKQY01','GJQY01')
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
point_id,
|
|
||||||
point_code,
|
|
||||||
point_name
|
|
||||||
FROM
|
|
||||||
sch_base_point
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND is_delete = '0'
|
|
||||||
AND is_host = '0'
|
|
||||||
AND device_point_type = '2'
|
|
||||||
|
|
||||||
OPTION 输入.region_id <> ""
|
|
||||||
region_id = 输入.region_id
|
|
||||||
ENDOPTION
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendvehicle.rest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.logging.annotation.Log;
|
|
||||||
import org.nl.wms.pda.sendvehicle.service.SendVehicleService;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Api(tags = "手持送空托盘")
|
|
||||||
@RequestMapping("api/pda/sendEmpty")
|
|
||||||
@Slf4j
|
|
||||||
public class SendVehicleController {
|
|
||||||
|
|
||||||
private final SendVehicleService sendVehicleService;
|
|
||||||
|
|
||||||
@PostMapping("/queryPoint")
|
|
||||||
@Log("查询区域点位")
|
|
||||||
@ApiOperation("查询区域点位")
|
|
||||||
public ResponseEntity<Object> queryPoint() {
|
|
||||||
return new ResponseEntity<>(sendVehicleService.queryPoint(), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
|
||||||
@Log("送空托盘确定")
|
|
||||||
@ApiOperation("送空托盘确定")
|
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
|
||||||
return new ResponseEntity<>(sendVehicleService.confirm(whereJson), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendvehicle.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
|
|
||||||
public interface SendVehicleService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询区域点位
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject queryPoint();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 送空托盘确定
|
|
||||||
* @param whereJson /
|
|
||||||
* @return JSONObject
|
|
||||||
*/
|
|
||||||
JSONObject confirm(JSONObject whereJson);
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
package org.nl.wms.pda.sendvehicle.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.wms.ext.acs.service.AcsToWmsService;
|
|
||||||
import org.nl.wms.pda.sendvehicle.service.SendVehicleService;
|
|
||||||
import org.nl.wms.sch.tasks.RegionTypeEnum;
|
|
||||||
import org.nl.modules.wql.WQL;
|
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class SendVehicleServiceImpl implements SendVehicleService {
|
|
||||||
|
|
||||||
private final AcsToWmsService acsToWmsService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject queryPoint() {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1.查询区域:输送区域 SSX01、油漆区域 YQQY01
|
|
||||||
JSONArray regionArr = WQL.getWO("PDA_SENDVEHICLE_01").addParam("flag", "1").process().getResultJSONArray(0);
|
|
||||||
// 2.根据区域查询对应的物料上料位
|
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
for (int i = 0; i < regionArr.size(); i++) {
|
|
||||||
JSONObject jsonRegion = regionArr.getJSONObject(i);
|
|
||||||
if (StrUtil.equals(jsonRegion.getString("region_id"), RegionTypeEnum.SSX.getId())) {
|
|
||||||
JSONArray pointArr = WQL.getWO("PDA_SENDVEHICLE_01").addParam("flag", "2").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0);
|
|
||||||
jsonRegion.put("pointArr", pointArr);
|
|
||||||
} else {
|
|
||||||
JSONArray pointArr = WQL.getWO("PDA_SENDVEHICLE_01").addParam("flag", "3").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0);
|
|
||||||
jsonRegion.put("pointArr", pointArr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resultJson.put("regionja", regionArr);
|
|
||||||
result.put("result", resultJson);
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "查询成功");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONObject confirm(JSONObject whereJson) {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 1、准备参数:point_code、type:6为输送线区域,5为油漆区域
|
|
||||||
JSONObject param = new JSONObject();
|
|
||||||
|
|
||||||
String region_id = whereJson.getString("region_id");
|
|
||||||
JSONObject jsonObject = WQLObject.getWQLObject("sch_base_region").query("region_id ='" + region_id + "'").uniqueResult(0);
|
|
||||||
String region_code = jsonObject.getString("region_code");
|
|
||||||
if (StrUtil.equals(region_code, "SSX01")) param.put("type","6");
|
|
||||||
if (StrUtil.equals(region_code, "YQQY01")) param.put("type","5");
|
|
||||||
|
|
||||||
param.put("point_code",whereJson.getString("point_code"));
|
|
||||||
param.put("vehicle_code",whereJson.getString("vehicle_code"));
|
|
||||||
param.put("vehicle_num",whereJson.getString("qty"));
|
|
||||||
// 2、调用接口
|
|
||||||
JSONObject json = acsToWmsService.apply(param);
|
|
||||||
if (StrUtil.equals(json.getString("status"), "200")) {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "操作成功");
|
|
||||||
} else {
|
|
||||||
result.put("result", "");
|
|
||||||
result.put("code", "0");
|
|
||||||
result.put("desc", "操作失败:"+json.getString("message"));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
[交易说明]
|
|
||||||
交易名: 手持送空托盘查询
|
|
||||||
所属模块:
|
|
||||||
功能简述:
|
|
||||||
版权所有:
|
|
||||||
表引用:
|
|
||||||
版本经历:
|
|
||||||
|
|
||||||
[数据库]
|
|
||||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
|
||||||
|
|
||||||
[IO定义]
|
|
||||||
#################################################
|
|
||||||
## 表字段对应输入参数
|
|
||||||
#################################################
|
|
||||||
输入.flag TYPEAS s_string
|
|
||||||
输入.region_id TYPEAS s_string
|
|
||||||
|
|
||||||
[临时表]
|
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
|
||||||
|
|
||||||
[临时变量]
|
|
||||||
--所有中间过程变量均可在此处定义
|
|
||||||
|
|
||||||
[业务过程]
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 1、输入输出检查 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 2、主过程前处理 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# 3、业务主过程 #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
IF 输入.flag = "1"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
region_id,
|
|
||||||
region_code,
|
|
||||||
region_name
|
|
||||||
FROM
|
|
||||||
sch_base_region
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND region_code in ('SSX01','YQQY01')
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
IF 输入.flag = "2"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
point_id,
|
|
||||||
point_code,
|
|
||||||
point_name
|
|
||||||
FROM
|
|
||||||
sch_base_point
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND is_delete = '0'
|
|
||||||
AND is_host = '0'
|
|
||||||
AND device_point_type = '6'
|
|
||||||
|
|
||||||
OPTION 输入.region_id <> ""
|
|
||||||
region_id = 输入.region_id
|
|
||||||
ENDOPTION
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
IF 输入.flag = "3"
|
|
||||||
QUERY
|
|
||||||
SELECT
|
|
||||||
point_id,
|
|
||||||
point_code,
|
|
||||||
point_name
|
|
||||||
FROM
|
|
||||||
sch_base_point
|
|
||||||
WHERE
|
|
||||||
is_used = '1'
|
|
||||||
AND is_delete = '0'
|
|
||||||
AND is_host = '0'
|
|
||||||
AND device_point_type = '4'
|
|
||||||
|
|
||||||
OPTION 输入.region_id <> ""
|
|
||||||
region_id = 输入.region_id
|
|
||||||
ENDOPTION
|
|
||||||
|
|
||||||
ENDSELECT
|
|
||||||
ENDQUERY
|
|
||||||
ENDIF
|
|
||||||
Reference in New Issue
Block a user