代码更新
This commit is contained in:
@@ -172,7 +172,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String vehicle_type = whereJson.getString("vehicle_type");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String qty = whereJson.getString("vehicle_num");
|
||||
//载具数量
|
||||
String vehicle_num = whereJson.getString("vehicle_num");
|
||||
//物料数量
|
||||
String material_num = whereJson.getString("material_num");
|
||||
|
||||
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
|
||||
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
|
||||
@@ -190,24 +193,24 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
*/
|
||||
if (StrUtil.equals(type, "1")) {
|
||||
// 1.共挤线申请空盘: 调用空托盘出库处理类创建任务
|
||||
if (ObjectUtil.isEmpty(qty)) throw new BadRequestException("数量不能为空");
|
||||
if (ObjectUtil.isEmpty(vehicle_num)) throw new BadRequestException("数量不能为空");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code2", point_code);
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
param.put("qty", qty);
|
||||
param.put("qty", material_num);
|
||||
// 创建任务
|
||||
GjxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(GjxCallEmpVehicleTask.class);
|
||||
taskBean.createTask(param);
|
||||
|
||||
} else if (StrUtil.equals(type, "2")) {
|
||||
// 2.共挤线满托入库: 调用物料入库处理类创建任务
|
||||
if (ObjectUtil.isEmpty(qty) || (StrUtil.equals(qty, "0")))
|
||||
if (ObjectUtil.isEmpty(material_num) || (StrUtil.equals(material_num, "0")))
|
||||
throw new BadRequestException("物料数量不能为空或者为0");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code); // 满料位
|
||||
param.put("qty", qty); // 满料位
|
||||
param.put("qty", material_num); // 满料位
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
|
||||
@@ -215,11 +218,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String task_id = taskBean.createTask(param); // 创建任务
|
||||
} else if (StrUtil.equals(type, "3")) {
|
||||
// 3.油漆线申请空盘: 调用空托盘出库处理类创建任务
|
||||
if (ObjectUtil.isEmpty(qty)) throw new BadRequestException("数量不能为空");
|
||||
if (ObjectUtil.isEmpty(vehicle_num)) throw new BadRequestException("数量不能为空");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code2", point_code);
|
||||
param.put("qty", qty);
|
||||
param.put("qty", vehicle_num);
|
||||
// 创建任务
|
||||
YqxCallEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxCallEmpVehicleTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
@@ -237,12 +240,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
} else if (StrUtil.equals(type, "5")) {
|
||||
// 5.油漆线空盘入库: 调用空托盘入库处理类创建任务
|
||||
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
|
||||
if (ObjectUtil.isEmpty(qty)) throw new BadRequestException("数量不能为空");
|
||||
if (ObjectUtil.isEmpty(vehicle_num)) throw new BadRequestException("数量不能为空");
|
||||
if (ObjectUtil.isEmpty(vehicle_type)) throw new BadRequestException("载具类型不能为空");
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code);
|
||||
param.put("qty", qty);
|
||||
param.put("qty", vehicle_num);
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
// 创建任务
|
||||
YqxSendEmpVehicleTask taskBean = SpringContextHolder.getBean(YqxSendEmpVehicleTask.class);
|
||||
@@ -256,10 +259,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
// 查询载具号对应的数量
|
||||
JSONObject jsonVeQty = new JSONObject();
|
||||
if (ObjectUtil.isEmpty(qty)) {
|
||||
if (ObjectUtil.isEmpty(vehicle_num)) {
|
||||
if (ObjectUtil.isEmpty(jsonVeQty)) throw new BadRequestException("请先手持扫码");
|
||||
} else {
|
||||
jsonVeQty.put("qty", qty);
|
||||
jsonVeQty.put("qty", vehicle_num);
|
||||
}
|
||||
|
||||
param.put("qty", jsonVeQty.getString("qty"));
|
||||
@@ -273,6 +276,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
} else if (StrUtil.equals(type, "7")) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code);
|
||||
param.put("qty", material_num);
|
||||
// 1.生成起点确定的任务
|
||||
SpringContextHolder.getBean(YqxSendMaterialTask.class).createTask(param);
|
||||
} else if (StrUtil.equals(type, "8")) {
|
||||
@@ -281,7 +285,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
param.put("point_code1", point_code);
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
param.put("qty", qty);
|
||||
param.put("qty", material_num);
|
||||
HkxSendMaterialTask taskBean = SpringContextHolder.getBean(HkxSendMaterialTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.callmaterial.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -8,7 +9,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.callmaterial.service.CallMaterialService;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -43,18 +43,18 @@ public class CallMaterialServiceImpl implements CallMaterialService {
|
||||
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"));
|
||||
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")) {
|
||||
if (ObjectUtil.isEmpty(json) || 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"));
|
||||
result.put("desc", "操作失败:" + json.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
FROM
|
||||
sch_base_region
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND region_code = 'YQQY01'
|
||||
region_code = 'YQQY01'
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
@@ -65,8 +64,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_host = '0'
|
||||
AND device_point_type = '3'
|
||||
AND point_type = '3'
|
||||
|
||||
OPTION 输入.region_id <> ""
|
||||
region_id = 输入.region_id
|
||||
@@ -74,4 +72,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.callvehicle.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -9,8 +10,6 @@ import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.callvehicle.service.CallVehicleService;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -50,21 +49,21 @@ public class CallVehicleServiceImpl implements CallVehicleService {
|
||||
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");
|
||||
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"));
|
||||
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")) {
|
||||
if (ObjectUtil.isEmpty(json) || 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"));
|
||||
result.put("desc", "操作失败:" + json.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
FROM
|
||||
sch_base_region
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND region_code in ('YQQY01','GJQY01')
|
||||
region_code in ('YQQY01','GJQY01')
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
@@ -65,8 +64,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_host = '0'
|
||||
AND device_point_type = '1'
|
||||
AND point_type = '1'
|
||||
|
||||
OPTION 输入.region_id <> ""
|
||||
region_id = 输入.region_id
|
||||
@@ -74,4 +72,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package org.nl.wms.pda.emptyandqty.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.emptyandqty.service.EmptyAndQtyService;
|
||||
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/emptyAndQty")
|
||||
@Slf4j
|
||||
public class EmptyAndQtyController {
|
||||
|
||||
private final EmptyAndQtyService emptyAndQtyService;
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("绑定")
|
||||
@ApiOperation("绑定")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(emptyAndQtyService.confirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -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,51 +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.core.bean.WQLObject;
|
||||
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.basedata.service.VehicleService;
|
||||
import org.nl.wms.basedata.service.dto.VehicleDto;
|
||||
import org.nl.wms.pda.emptyandqty.service.EmptyAndQtyService;
|
||||
|
||||
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");
|
||||
VehicleDto byCode = SpringContextHolder.getBean(VehicleService.class).findByCode(vehicle_code);
|
||||
|
||||
// 插入记录
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("vehicleqty_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("vehicle_id", byCode.getVehicle_id());
|
||||
json.put("vehicle_code", vehicle_code);
|
||||
json.put("qty", qty);
|
||||
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,5 +1,6 @@
|
||||
package org.nl.wms.pda.sendmaterial.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -9,8 +10,6 @@ import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.sendmaterial.service.SendMaterialService;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -50,21 +49,21 @@ public class SendMaterialServiceImpl implements SendMaterialService {
|
||||
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");
|
||||
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"));
|
||||
param.put("point_code", whereJson.getString("point_code"));
|
||||
param.put("material_num", whereJson.getString("qty"));
|
||||
// 2、调用接口
|
||||
JSONObject json = acsToWmsService.apply(param);
|
||||
if (StrUtil.equals(json.getString("status"), "200")) {
|
||||
if (ObjectUtil.isEmpty(json) || 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"));
|
||||
result.put("desc", "操作失败:" + json.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
FROM
|
||||
sch_base_region
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND region_code in ('HKQY01','GJQY01')
|
||||
region_code in ('HKQY01','GJQY01')
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
@@ -65,8 +64,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_host = '0'
|
||||
AND device_point_type = '2'
|
||||
AND point_type = '3'
|
||||
|
||||
OPTION 输入.region_id <> ""
|
||||
region_id = 输入.region_id
|
||||
@@ -74,4 +72,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
FROM
|
||||
sch_base_region
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND region_code in ('SSX01','YQQY01')
|
||||
region_code in ('SSX01','YQQY01')
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
@@ -65,8 +64,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_host = '0'
|
||||
AND device_point_type = '6'
|
||||
AND point_type = '6'
|
||||
|
||||
OPTION 输入.region_id <> ""
|
||||
region_id = 输入.region_id
|
||||
@@ -87,8 +85,7 @@
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_host = '0'
|
||||
AND device_point_type = '4'
|
||||
AND point_type = '4'
|
||||
|
||||
OPTION 输入.region_id <> ""
|
||||
region_id = 输入.region_id
|
||||
@@ -96,4 +93,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user