|
|
@ -192,6 +192,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
} |
|
|
|
RLock lock = redissonClient.getFairLock("acs_to_wms:" + point_code); |
|
|
|
boolean try_lock = false; |
|
|
|
String task_code = null; |
|
|
|
try { |
|
|
|
try_lock = lock.tryLock(5, TimeUnit.SECONDS); |
|
|
|
if (try_lock) { |
|
|
@ -230,12 +231,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
switch (region) { |
|
|
|
case HL: |
|
|
|
hlSendMaterialTask.createTask(method_param); |
|
|
|
task_code = hlSendMaterialTask.createTask(method_param); |
|
|
|
break; |
|
|
|
case YZ: |
|
|
|
method_param.put("workorder", param.getJSONObject("workorder")); |
|
|
|
method_param.put("vd", param.getJSONObject("vd")); |
|
|
|
yzSendMaterialTask.createTask(method_param); |
|
|
|
task_code = yzSendMaterialTask.createTask(method_param); |
|
|
|
break; |
|
|
|
case SZ: |
|
|
|
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); |
|
|
@ -250,7 +251,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
vd_table.update(vd); |
|
|
|
method_param.put("vd", vd); |
|
|
|
|
|
|
|
szSendMaterialTask.createTask(method_param); |
|
|
|
task_code = szSendMaterialTask.createTask(method_param); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new BadRequestException("[" + region.label() + "] 不能发起送料任务!"); |
|
|
@ -260,7 +261,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
// 叫料
|
|
|
|
switch (region) { |
|
|
|
case FJ: |
|
|
|
fjCallMaterialTask.createTask(method_param); |
|
|
|
task_code = fjCallMaterialTask.createTask(method_param); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new BadRequestException("[" + region.label() + "] 不能发起叫料任务!"); |
|
|
@ -270,7 +271,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
// 送空
|
|
|
|
switch (region) { |
|
|
|
case FJ: |
|
|
|
fjSendEmptyTask.createTask(method_param); |
|
|
|
task_code = fjSendEmptyTask.createTask(method_param); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new BadRequestException("[" + region.label() + "] 不能发起送空任务!"); |
|
|
@ -280,10 +281,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
// 叫空
|
|
|
|
switch (region) { |
|
|
|
case HL: |
|
|
|
hlCallEmptyTask.createTask(method_param); |
|
|
|
task_code = hlCallEmptyTask.createTask(method_param); |
|
|
|
break; |
|
|
|
case YZ: |
|
|
|
yzCallEmptyTask.createTask(method_param); |
|
|
|
task_code = yzCallEmptyTask.createTask(method_param); |
|
|
|
break; |
|
|
|
case GTK: |
|
|
|
break; |
|
|
@ -304,7 +305,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
result.put("message", "申请任务成功!"); |
|
|
|
result.put("message", "申请任务成功,任务编码 [" + task_code + "]"); |
|
|
|
result.put("status", HttpStatus.OK.value()); |
|
|
|
return result; |
|
|
|
} |
|
|
@ -314,10 +315,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
* 组盘 |
|
|
|
* |
|
|
|
* @param jsonObject |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void manipulatorApply(JSONObject jsonObject) { |
|
|
|
public JSONObject manipulatorApply(JSONObject jsonObject) { |
|
|
|
String point_code = jsonObject.getString("device_code"); // 对接位
|
|
|
|
if (StrUtil.isBlank(point_code)) { |
|
|
|
throw new BadRequestException("点位不能为空!"); |
|
|
@ -337,7 +339,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
} |
|
|
|
String is_full = jsonObject.getString("is_full"); |
|
|
|
if (StrUtil.isBlank(is_full)) { |
|
|
|
throw new BadRequestException("是否满拖不能为空!"); |
|
|
|
throw new BadRequestException("是否满垛不能为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject point = WQLObject |
|
|
@ -350,7 +352,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
TaskUtils.isLocked(point); |
|
|
|
|
|
|
|
JSONObject work_order = TaskUtils.hasWorkOrder(point); |
|
|
|
String device_code = work_order.getString("device_code"); |
|
|
|
String vehicle_type = work_order.getString("vehicle_type"); |
|
|
|
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); |
|
|
|
JSONObject vd_update = new JSONObject(); |
|
|
@ -445,7 +446,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
param.put("vehicle_code", vehicle_code); |
|
|
|
param.put("type", "1"); |
|
|
|
param.put("request_param", jsonObject.toJSONString()); |
|
|
|
this.apply(param); |
|
|
|
return this.apply(param); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|