新增指令删除接口
This commit is contained in:
@@ -130,4 +130,11 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> queryPrintInfoByCode(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.queryPrintInfoByCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteTask")
|
||||
@Log("删除下料到货架的未完成的任务")
|
||||
@ApiOperation("删除下料到货架的未完成的任务")
|
||||
public ResponseEntity<Object> deleteTask(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.deleteTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,4 +122,10 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
Map<String, Object> queryPrintInfoByCode(Map jsonObject);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> deleteTask(Map jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@@ -652,6 +652,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateVehicleType(Map jsonObject) {
|
||||
String vehicle_type = (String) jsonObject.get("vehicle_type");
|
||||
if (vehicle_type.equals("1")) {
|
||||
@@ -686,6 +687,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> receiveTaskStatusAcs(String string) {
|
||||
{
|
||||
JSONArray array = JSONArray.parseArray(string);
|
||||
@@ -768,6 +770,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> receiveAgvStatus(JSONArray arr) {
|
||||
WQLObject deviceStatus_table = WQLObject.getWQLObject("st_buss_deviceStatus");
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
@@ -804,6 +807,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryCribbingInfo(Map jsonObject) {
|
||||
String device_code = (String) jsonObject.get("device_code");
|
||||
@@ -828,6 +832,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public Map<String, Object> queryPrintInfoByCode(Map jsonObject) {
|
||||
//找出最近的一个到包装位的任务
|
||||
JSONObject taskObj = WQLObject.getWQLObject("sch_base_task").query("next_point_code='BZSLW' and is_delete='0' and task_type='07'", "update_time desc").uniqueResult(0);
|
||||
@@ -835,6 +840,40 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> deleteTask(Map jsonObject) {
|
||||
String task_code = jsonObject.get("task_code").toString();
|
||||
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject group_table = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
JSONObject taskObj = task_table.query("task_code ='" + task_code + "' and task_status='06'and is_delete='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("任务号为'" + task_code + "' 执行中的任务未找到");
|
||||
}
|
||||
String start_point_code = taskObj.getString("start_point_code");
|
||||
String next_point_code = taskObj.getString("next_point_code");
|
||||
JSONObject startObj = point_table.query("point_code ='" + start_point_code + "'").uniqueResult(0);
|
||||
|
||||
if (!StrUtil.equals(startObj.getString("area_type"), AreaEnum.YZQY.getCode())) {
|
||||
throw new BadRequestException("只能取消任务类型为下料任务!");
|
||||
}
|
||||
JSONObject nextObj = point_table.query("point_code ='" + next_point_code + "'").uniqueResult(0);
|
||||
//删除任务,解锁终点,删除组盘表
|
||||
nextObj.put("lock_type", "00");
|
||||
point_table.update(nextObj);
|
||||
task_table.delete(taskObj);
|
||||
JSONObject groupObj = group_table.query("task_id ='" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
group_table.delete(groupObj);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "任务状态反馈成功!");
|
||||
result.put("data", new JSONObject());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static JSONObject getProduceInfoByCode(String code) {
|
||||
//根据 设备点位去找生产任务信息
|
||||
//1 根据点位去找设备,去找对应的设备信息
|
||||
@@ -846,8 +885,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(productTaskObj)) {
|
||||
throw new BadRequestException("未找到点位为'" + code + "'的生产任务!");
|
||||
|
||||
}
|
||||
|
||||
return productTaskObj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user