更新
This commit is contained in:
@@ -108,6 +108,14 @@ public class InstructionController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log("强制取消指令")
|
||||||
|
@ApiOperation("强制取消指令")
|
||||||
|
@PostMapping(value = "/forceCancel/{id}")
|
||||||
|
public ResponseEntity<Object> forceCancel(@RequestBody String id) throws Exception {
|
||||||
|
instructionService.cancelNOSendAgv(id);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@Log("导出指令")
|
@Log("导出指令")
|
||||||
@ApiOperation("导出指令")
|
@ApiOperation("导出指令")
|
||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
|
|||||||
@@ -363,8 +363,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String start_device_code = task.getStart_device_code();
|
String start_device_code = dto.getStart_device_code();
|
||||||
String next_device_code = task.getNext_device_code();
|
String next_device_code = dto.getNext_device_code();
|
||||||
String route_plan_code = task.getRoute_plan_code();
|
String route_plan_code = task.getRoute_plan_code();
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||||
RouteLineDto route = null;
|
RouteLineDto route = null;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.hand.rest;
|
package org.nl.hand.rest;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -9,10 +10,7 @@ import org.nl.hand.service.HFHandService;
|
|||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
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.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -172,4 +170,14 @@ public class HFHandController {
|
|||||||
return new ResponseEntity<>(HandService.queryDevice(), HttpStatus.OK);
|
return new ResponseEntity<>(HandService.queryDevice(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryStorageExtra")
|
||||||
|
@Log("查询货架扩展信息")
|
||||||
|
@ApiOperation("查询货架扩展信息")
|
||||||
|
@SaIgnore
|
||||||
|
//@PreAuthorize("@el.check('sect:list')")
|
||||||
|
//@RequestBody JSONObject json
|
||||||
|
public ResponseEntity<Object> queryStorageExtra(@RequestBody JSONObject storage_code) {
|
||||||
|
return new ResponseEntity<>(HandService.queryStorageExtra(storage_code.getString("storage_code")), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
package org.nl.hand.service;
|
package org.nl.hand.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,4 +116,9 @@ public interface HFHandService {
|
|||||||
Map<String, Object> createTask2(Map<String, String> whereJson);
|
Map<String, Object> createTask2(Map<String, String> whereJson);
|
||||||
|
|
||||||
Map<String, Object> queryDevice();
|
Map<String, Object> queryDevice();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据货架号,查询扩展信息
|
||||||
|
*/
|
||||||
|
JSONObject queryStorageExtra(String device_code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,6 +292,10 @@ public class HFHandServiceImpl implements HFHandService {
|
|||||||
String priority = jsonObject.get("priority");
|
String priority = jsonObject.get("priority");
|
||||||
String carrier = jsonObject.get("carrier");
|
String carrier = jsonObject.get("carrier");
|
||||||
String emptypallet_num = jsonObject.get("emptypallet_num");
|
String emptypallet_num = jsonObject.get("emptypallet_num");
|
||||||
|
String form_y = jsonObject.get("form_y");
|
||||||
|
String form_z = jsonObject.get("form_z");
|
||||||
|
String to_y = jsonObject.get("to_y");
|
||||||
|
String to_z = jsonObject.get("to_z");
|
||||||
|
|
||||||
JSONObject resultJson = new JSONObject();
|
JSONObject resultJson = new JSONObject();
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
@@ -360,11 +364,19 @@ public class HFHandServiceImpl implements HFHandService {
|
|||||||
dto.setMaterial(material_type);
|
dto.setMaterial(material_type);
|
||||||
dto.setStart_point_code(start_devicecode);
|
dto.setStart_point_code(start_devicecode);
|
||||||
dto.setNext_point_code(next_devicecode);
|
dto.setNext_point_code(next_devicecode);
|
||||||
|
dto.setStart_device_code(start_devicecode);
|
||||||
|
dto.setNext_device_code(next_devicecode);
|
||||||
dto.setMaterial(material_type);
|
dto.setMaterial(material_type);
|
||||||
dto.setTask_type(task_type);
|
dto.setTask_type(task_type);
|
||||||
dto.setPriority(priority);
|
dto.setPriority(priority);
|
||||||
dto.setVehicle_code(carrier);
|
dto.setVehicle_code(carrier);
|
||||||
dto.setEmptypallet_num(emptypallet_num);
|
dto.setEmptypallet_num(emptypallet_num);
|
||||||
|
dto.setFrom_x("1");
|
||||||
|
dto.setFrom_y(form_y);
|
||||||
|
dto.setFrom_z(form_z);
|
||||||
|
dto.setTo_x("1");
|
||||||
|
dto.setTo_y(to_y);
|
||||||
|
dto.setTo_z(to_z);
|
||||||
try {
|
try {
|
||||||
taskService.create(dto);
|
taskService.create(dto);
|
||||||
// startDevice.setIslock("true");
|
// startDevice.setIslock("true");
|
||||||
@@ -772,10 +784,34 @@ public class HFHandServiceImpl implements HFHandService {
|
|||||||
public Map<String, Object> queryDevice() {
|
public Map<String, Object> queryDevice() {
|
||||||
WQLObject wo = WQLObject.getWQLObject("acs_device");
|
WQLObject wo = WQLObject.getWQLObject("acs_device");
|
||||||
JSONArray resultJSONArray = wo.query("1 = 1", "device_code").getResultJSONArray(0);
|
JSONArray resultJSONArray = wo.query("1 = 1", "device_code").getResultJSONArray(0);
|
||||||
|
JSONArray js = new JSONArray();
|
||||||
|
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = resultJSONArray.getJSONObject(i);
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("device_id",jsonObject.getString("device_id"));
|
||||||
|
map.put("device_code",jsonObject.getString("device_code"));
|
||||||
|
map.put("device_name",jsonObject.getString("device_name"));
|
||||||
|
map.put("device_type",jsonObject.getString("device_type"));
|
||||||
|
js.add(map);
|
||||||
|
}
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("code", "1");
|
jo.put("code", "1");
|
||||||
jo.put("desc", "查询成功");
|
jo.put("desc", "查询成功");
|
||||||
jo.put("result", resultJSONArray);
|
jo.put("result", js);
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject queryStorageExtra(String device_code) {
|
||||||
|
JSONObject device = WQLObject.getWQLObject("acs_device").query("device_code = '" + device_code + "'").uniqueResult(0);
|
||||||
|
String device_id = device.getString("device_id");
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("maxY", wo.query("device_id = '" + device_id + "' AND extra_code = 'maxY'").uniqueResult(0).getString("extra_value"));
|
||||||
|
jo.put("minY", wo.query("device_id = '" + device_id + "' AND extra_code = 'minY'").uniqueResult(0).getString("extra_value"));
|
||||||
|
jo.put("maxZ", wo.query("device_id = '" + device_id + "' AND extra_code = 'maxZ'").uniqueResult(0).getString("extra_value"));
|
||||||
|
jo.put("minZ", wo.query("device_id = '" + device_id + "' AND extra_code = 'minZ'").uniqueResult(0).getString("extra_value"));
|
||||||
|
//jo.put("tunnel", wo.query("device_id = '" + device_id + "' AND extra_code = 'tunnel'").uniqueResult(0).getString("extra_value"));
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
@@ -58,19 +59,46 @@ public class AutoCreateInst {
|
|||||||
if(StrUtil.equals(is_send,"0")){
|
if(StrUtil.equals(is_send,"0")){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(StrUtil.equals(acsTask.getTask_type(),"1") || StrUtil.equals(acsTask.getTask_type(),"2")){
|
// if(StrUtil.equals(acsTask.getTask_type(),"1") || StrUtil.equals(acsTask.getTask_type(),"2")){
|
||||||
//校验路由关系
|
// //校验路由关系
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
// if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||||
acsTask.setRemark("路由不通无法生成指令");
|
// acsTask.setRemark("路由不通无法生成指令");
|
||||||
taskserver.updateByCodeFromCache(acsTask);
|
// taskserver.updateByCodeFromCache(acsTask);
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||||
|
// String path = routeLineDto.getPath();
|
||||||
|
// String type = routeLineDto.getType();
|
||||||
|
// String[] str = path.split("->");
|
||||||
|
// List<String> pathlist = Arrays.asList(str);
|
||||||
|
// int index = 0;
|
||||||
|
// for (int m = 0; m < pathlist.size(); m++) {
|
||||||
|
// if (pathlist.get(m).equals(start_device_code)) {
|
||||||
|
// index = m + 1;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// next_device_code = pathlist.get(index);
|
||||||
|
//
|
||||||
|
// if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||||
|
// next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
||||||
|
// } else {
|
||||||
|
// next_point_code = next_device_code;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始平均分解校验
|
||||||
|
*/
|
||||||
|
String this_device_code = taskserver.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||||
|
if (StrUtil.isEmpty(this_device_code)) {
|
||||||
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, acsTask.getNext_device_code(), route_plan_code);
|
||||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||||
String path = routeLineDto.getPath();
|
String path = routeLineDto.getPath();
|
||||||
String type = routeLineDto.getType();
|
String type = routeLineDto.getType();
|
||||||
@@ -84,12 +112,34 @@ public class AutoCreateInst {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
next_device_code = pathlist.get(index);
|
next_device_code = pathlist.get(index);
|
||||||
|
} else {
|
||||||
|
next_device_code = this_device_code;
|
||||||
|
}
|
||||||
|
//校验路由关系
|
||||||
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||||
|
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||||
|
acsTask.setRemark("路由不通无法生成指令");
|
||||||
|
taskserver.updateByCodeFromCache(acsTask);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Device startdevice = appService.findDeviceByCode(start_device_code);
|
||||||
|
Device nextdevice = appService.findDeviceByCode(next_device_code);
|
||||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||||
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();
|
||||||
} else {
|
} else {
|
||||||
next_point_code = next_device_code;
|
next_point_code = next_device_code;
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isEmpty(appService)) {
|
||||||
|
log.info("地址对应设备未找到");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isEmpty(startdevice)) {
|
||||||
|
log.info("地址对应设备未找到");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
|
|||||||
@@ -62,4 +62,12 @@ export function reload() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload }
|
export function forceCancel(instruction_id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/instruction/forceCancel/' + instruction_id,
|
||||||
|
method: 'post',
|
||||||
|
data: instruction_id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload, forceCancel }
|
||||||
|
|||||||
@@ -160,6 +160,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
||||||
|
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">强制取消</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@@ -290,6 +291,14 @@ export default {
|
|||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
forceCancel(index, row) {
|
||||||
|
crudInstruction.forceCancel(row.instruction_id).then(res => {
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.crud.notify('强制取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
reload() {
|
reload() {
|
||||||
crudInstruction.reload().then(res => {
|
crudInstruction.reload().then(res => {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
@@ -313,6 +322,9 @@ export default {
|
|||||||
case 'b':// 取消
|
case 'b':// 取消
|
||||||
this.cancel(command.index, command.row)
|
this.cancel(command.index, command.row)
|
||||||
break
|
break
|
||||||
|
case 'c':// 强制取消
|
||||||
|
this.forceCancel(command.index, command.row)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,6 +313,13 @@ export default {
|
|||||||
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
|
this.form.next_device_code = Array.of(data.form.next_device_code.split('').join(''))
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit](data) {
|
||||||
|
if (this.crud.status.edit === 1) {
|
||||||
|
this.form.device_code = data.form.device_code.join('')
|
||||||
|
this.form.next_device_code = data.form.next_device_code.join('')
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
// 改变状态
|
// 改变状态
|
||||||
changeEnabled(data) {
|
changeEnabled(data) {
|
||||||
var msg = '停用'
|
var msg = '停用'
|
||||||
|
|||||||
Reference in New Issue
Block a user