opt:代码优化
This commit is contained in:
@@ -751,7 +751,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
RLock lock = redissonClient.getLock("acs_to_deviceApply_wms:" + type);
|
RLock lock = redissonClient.getLock("acs_to_deviceApply_wms:" + type);
|
||||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||||
|
WQLObject pdm_bi_subpackagerelation = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||||
try {
|
try {
|
||||||
if (tryLock) {
|
if (tryLock) {
|
||||||
if ("1".equals(type)) {
|
if ("1".equals(type)) {
|
||||||
@@ -762,7 +762,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (StrUtil.isEmpty(weight)) {
|
if (StrUtil.isEmpty(weight)) {
|
||||||
throw new BadRequestException("重量不能为空!");
|
throw new BadRequestException("重量不能为空!");
|
||||||
}
|
}
|
||||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
JSONObject sub_jo = pdm_bi_subpackagerelation.query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||||
}
|
}
|
||||||
@@ -784,7 +784,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
//更新实际重量
|
//更新实际重量
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("real_weight", NumberUtil.round(weight, 1));
|
map.put("real_weight", NumberUtil.round(weight, 1));
|
||||||
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(map, "package_box_sn = '" + vehicle_code + "'");
|
pdm_bi_subpackagerelation.update(map, "package_box_sn = '" + vehicle_code + "'");
|
||||||
data.put("is_auto_table", "0");
|
data.put("is_auto_table", "0");
|
||||||
result.put("data", data);
|
result.put("data", data);
|
||||||
return result;
|
return result;
|
||||||
@@ -844,7 +844,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (StrUtil.isEmpty(vehicle_code)) {
|
if (StrUtil.isEmpty(vehicle_code)) {
|
||||||
throw new BadRequestException("木箱码不能为空!");
|
throw new BadRequestException("木箱码不能为空!");
|
||||||
}
|
}
|
||||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
JSONObject sub_jo = pdm_bi_subpackagerelation.query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user