acs兼容浙大和NDC系统
This commit is contained in:
@@ -14,18 +14,14 @@ public interface AcsConfig {
|
|||||||
String CREATETASKCHECK = "createTaskCheck";
|
String CREATETASKCHECK = "createTaskCheck";
|
||||||
//撤销任务检查
|
//撤销任务检查
|
||||||
String CANCELTASKCHECK = "cancelTaskCheck";
|
String CANCELTASKCHECK = "cancelTaskCheck";
|
||||||
//一楼agv系统接口地址
|
//agv系统接口地址
|
||||||
String AGVURL = "agvurl";
|
String AGVURL = "agvurl";
|
||||||
//AGV系统端口
|
//AGV系统端口
|
||||||
String AGVPORT = "agvport";
|
String AGVPORT = "agvport";
|
||||||
//二楼1区agv系统接口地址
|
//rgv系统接口地址
|
||||||
String AGVURL2 = "agvurl2";
|
String RGVURL = "rgvurl";
|
||||||
//二楼1区AGV系统端口
|
//RGV系统端口
|
||||||
String AGVPORT2 = "agvport2";
|
String RGVPORT = "rgvport";
|
||||||
//二楼2区agv系统接口地址
|
|
||||||
String AGVURL22 = "agvurl22";
|
|
||||||
//二楼2区AGV系统端口
|
|
||||||
String AGVPORT22 = "agvport22";
|
|
||||||
//指定AGV系统
|
//指定AGV系统
|
||||||
String AGVTYPE = "agvType";
|
String AGVTYPE = "agvType";
|
||||||
//WMS系统接口地址
|
//WMS系统接口地址
|
||||||
|
|||||||
@@ -36,6 +36,6 @@ public interface ZheDaAgvService {
|
|||||||
* @param instCode
|
* @param instCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public HttpResponse deleteZDAgvInst(String instCode);
|
public HttpResponse deleteZDAgvInst(String instCode) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,18 +69,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
jo.put("destinations", destinations);
|
jo.put("destinations", destinations);
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvurl2 = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
|
||||||
String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
|
||||||
|
|
||||||
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
|
||||||
|
|
||||||
//不同楼层下发不同的agv系统
|
|
||||||
if (task_type.equals("1")) {
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code();
|
|
||||||
} else {
|
|
||||||
agvurl = agvurl2 + ":" + agvport2 + "/v1/transportOrders/" + inst.getInstruction_code();
|
|
||||||
}
|
|
||||||
log.info("下发agv任务请求:{}", agvurl);
|
log.info("下发agv任务请求:{}", agvurl);
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
@@ -101,14 +94,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = "";
|
String agvurl = "";
|
||||||
String agvport = "";
|
String agvport = "";
|
||||||
if (type.equals("1")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
}
|
|
||||||
if (type.equals("2")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
|
||||||
agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders";
|
||||||
HttpResponse result = HttpRequest.get(agvurl)
|
HttpResponse result = HttpRequest.get(agvurl)
|
||||||
@@ -278,8 +267,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
|
|
||||||
jo.put("destinations", destinations);
|
jo.put("destinations", destinations);
|
||||||
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
String url = agvurl + ":" + agvport + "/addDestinations";
|
String url = agvurl + ":" + agvport + "/addDestinations";
|
||||||
log.info("下发agv任务请求:{}", url);
|
log.info("下发agv任务请求:{}", url);
|
||||||
@@ -399,12 +388,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
log.info("反馈AGV请求数据:{}", requestjo);
|
log.info("反馈AGV请求数据:{}", requestjo);
|
||||||
System.out.println("back agv:" + requestjo);
|
System.out.println("back agv:" + requestjo);
|
||||||
|
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
if (inst.getInstruction_type().equals("4")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
|
||||||
}
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + jobno + "/interact";
|
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + jobno + "/interact";
|
||||||
|
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
@@ -420,8 +405,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
public HttpResponse markComplete(String code) {
|
public HttpResponse markComplete(String code) {
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
|
|
||||||
agvurl = agvurl + ":" + agvport + "/v1/" + code + "/markComplete";
|
agvurl = agvurl + ":" + agvport + "/v1/" + code + "/markComplete";
|
||||||
log.info("关闭agv运单序列请求:{}", agvurl);
|
log.info("关闭agv运单序列请求:{}", agvurl);
|
||||||
@@ -554,14 +539,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
|
|
||||||
@LokiLog(type = LokiLogType.AGV)
|
@LokiLog(type = LokiLogType.AGV)
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse deleteZDAgvInst(String instCode) {
|
public HttpResponse deleteZDAgvInst(String instCode) throws Exception {
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||||
String agvurl = paramService.findByCode(AcsConfig.AGVURL2).getValue();
|
String agvurl = paramService.findByCode(AcsConfig.RGVURL).getValue();
|
||||||
String agvport = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
|
String agvport = paramService.findByCode(AcsConfig.RGVPORT).getValue();
|
||||||
Instruction instruction = instructionService.findByCode(instCode);
|
Instruction instruction = instructionService.findByCode(instCode);
|
||||||
if (instruction.getInstruction_type().equals("1")) {
|
|
||||||
agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
|
||||||
}
|
|
||||||
agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + instCode + "/withdrawal";
|
agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + instCode + "/withdrawal";
|
||||||
log.info("删除agv指令请求agvurl:{}", agvurl);
|
log.info("删除agv指令请求agvurl:{}", agvurl);
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -18,6 +19,7 @@ import org.nl.acs.AcsConfig;
|
|||||||
import org.nl.acs.agv.server.MagicAgvService;
|
import org.nl.acs.agv.server.MagicAgvService;
|
||||||
import org.nl.acs.agv.server.NDCAgvService;
|
import org.nl.acs.agv.server.NDCAgvService;
|
||||||
import org.nl.acs.agv.server.XianGongAgvService;
|
import org.nl.acs.agv.server.XianGongAgvService;
|
||||||
|
import org.nl.acs.agv.server.ZheDaAgvService;
|
||||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||||
import org.nl.acs.device.domain.Device;
|
import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
@@ -73,9 +75,9 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jiaolm
|
* @author jiaolm
|
||||||
* @date 2023-05-09
|
* @date 2023-05-09
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
// @CacheConfig(cacheNames = InstructionService.CACHE_KEY)
|
// @CacheConfig(cacheNames = InstructionService.CACHE_KEY)
|
||||||
@@ -88,7 +90,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
TaskMapper taskMapper;
|
TaskMapper taskMapper;
|
||||||
List<Instruction> instructions = new CopyOnWriteArrayList();
|
List<Instruction> instructions = new CopyOnWriteArrayList();
|
||||||
// List<InstructionMybatis> instructions_mybatis = new CopyOnWriteArrayList();
|
// List<InstructionMybatis> instructions_mybatis = new CopyOnWriteArrayList();
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceAppService deviceAppService;
|
DeviceAppService deviceAppService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -110,7 +112,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InstructionDto> queryAll(InstructionQueryParam query){
|
public List<InstructionDto> queryAll(InstructionQueryParam query) {
|
||||||
return ConvertUtil.convertList(instructionMapper.selectList(QueryHelpMybatisPlus.getPredicate(query)), InstructionDto.class);
|
return ConvertUtil.convertList(instructionMapper.selectList(QueryHelpMybatisPlus.getPredicate(query)), InstructionDto.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +129,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int updateById(InstructionDto resources){
|
public int updateById(InstructionDto resources) {
|
||||||
InstructionMybatis entity = ConvertUtil.convert(resources, InstructionMybatis.class);
|
InstructionMybatis entity = ConvertUtil.convert(resources, InstructionMybatis.class);
|
||||||
int ret = instructionMapper.updateById(entity);
|
int ret = instructionMapper.updateById(entity);
|
||||||
// delCaches(resources.id);
|
// delCaches(resources.id);
|
||||||
@@ -136,14 +138,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int removeByIds(Set<String> ids){
|
public int removeByIds(Set<String> ids) {
|
||||||
// delCaches(ids);
|
// delCaches(ids);
|
||||||
return instructionMapper.deleteBatchIds(ids);
|
return instructionMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int removeById(String id){
|
public int removeById(String id) {
|
||||||
Set<String> set = new HashSet<>(1);
|
Set<String> set = new HashSet<>(1);
|
||||||
set.add(id);
|
set.add(id);
|
||||||
return this.removeByIds(set);
|
return this.removeByIds(set);
|
||||||
@@ -175,7 +177,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
.eq(InstructionMybatis::getIs_delete, "0")
|
.eq(InstructionMybatis::getIs_delete, "0")
|
||||||
.list();
|
.list();
|
||||||
// List list = this.queryAll("instruction_status <2 and is_delete =0");
|
// List list = this.queryAll("instruction_status <2 and is_delete =0");
|
||||||
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list,Instruction.class));
|
this.instructions = new CopyOnWriteArrayList<>(ConvertUtil.convertList(list, Instruction.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -191,20 +193,20 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
IPage<InstructionMybatis> queryPage = PageUtil.toMybatisPage(page);
|
IPage<InstructionMybatis> queryPage = PageUtil.toMybatisPage(page);
|
||||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||||
// wrapper.eq(InstructionMybatis::getIs_delete,0);
|
// wrapper.eq(InstructionMybatis::getIs_delete,0);
|
||||||
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
wrapper.and(StringUtils.isNotBlank(code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
||||||
wrapper.like(StringUtils.isNotBlank(vehicle_code),InstructionMybatis::getVehicle_code,vehicle_code);
|
wrapper.like(StringUtils.isNotBlank(vehicle_code), InstructionMybatis::getVehicle_code, vehicle_code);
|
||||||
wrapper.eq(StringUtils.isNotBlank(material_type),InstructionMybatis::getMaterial,material_type);
|
wrapper.eq(StringUtils.isNotBlank(material_type), InstructionMybatis::getMaterial, material_type);
|
||||||
wrapper.eq(StringUtils.isNotBlank(status),InstructionMybatis::getInstruction_status,status);
|
wrapper.eq(StringUtils.isNotBlank(status), InstructionMybatis::getInstruction_status, status);
|
||||||
wrapper.and(StringUtils.isNotBlank(point_code),instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code));
|
wrapper.and(StringUtils.isNotBlank(point_code), instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
||||||
wrapper.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type);
|
wrapper.eq(StringUtils.isNotBlank(instruction_type), InstructionMybatis::getInstruction_type, instruction_type);
|
||||||
if (!StrUtil.isEmpty(is_over)) {
|
if (!StrUtil.isEmpty(is_over)) {
|
||||||
if (StrUtil.equals(is_over,"1")){
|
if (StrUtil.equals(is_over, "1")) {
|
||||||
wrapper.ge(InstructionMybatis::getInstruction_status,2);
|
wrapper.ge(InstructionMybatis::getInstruction_status, 2);
|
||||||
}else{
|
} else {
|
||||||
wrapper.lt(InstructionMybatis::getInstruction_status,2);
|
wrapper.lt(InstructionMybatis::getInstruction_status, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper);
|
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage, wrapper);
|
||||||
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
@@ -223,31 +225,31 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||||
// wrapper.eq(InstructionMybatis::getIs_delete,"0");
|
// wrapper.eq(InstructionMybatis::getIs_delete,"0");
|
||||||
if (!StrUtil.isEmpty(code)) {
|
if (!StrUtil.isEmpty(code)) {
|
||||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code,code).or().like(InstructionMybatis::getTask_code,code));
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, code).or().like(InstructionMybatis::getTask_code, code));
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||||
wrapper.like(InstructionMybatis::getVehicle_code,vehicle_code);
|
wrapper.like(InstructionMybatis::getVehicle_code, vehicle_code);
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(material_type)) {
|
if (!StrUtil.isEmpty(material_type)) {
|
||||||
wrapper.eq(InstructionMybatis::getMaterial,material_type);
|
wrapper.eq(InstructionMybatis::getMaterial, material_type);
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(status)) {
|
if (!StrUtil.isEmpty(status)) {
|
||||||
wrapper.eq(InstructionMybatis::getInstruction_status,status);
|
wrapper.eq(InstructionMybatis::getInstruction_status, status);
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(point_code)) {
|
if (!StrUtil.isEmpty(point_code)) {
|
||||||
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code));
|
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
|
||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||||
wrapper.between(InstructionMybatis::getCreate_time,create_time,end_time);
|
wrapper.between(InstructionMybatis::getCreate_time, create_time, end_time);
|
||||||
}
|
}
|
||||||
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage,wrapper);
|
IPage<InstructionMybatis> insPage = instructionMapper.selectPage(queryPage, wrapper);
|
||||||
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getByTaskId(String id) {
|
public Map<String, Object> getByTaskId(String id) {
|
||||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.eq(InstructionMybatis::getTask_id, id)
|
.eq(InstructionMybatis::getTask_id, id)
|
||||||
.list();
|
.list();
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -273,9 +275,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Instruction> queryAll(Map whereJson) {
|
public List<Instruction> queryAll(Map whereJson) {
|
||||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.list();
|
.list();
|
||||||
return ConvertUtil.convertList(insList,Instruction.class);
|
return ConvertUtil.convertList(insList, Instruction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -283,10 +285,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
// JSONArray arr = wo.query(whereJson, "create_time").getResultJSONArray(0);
|
// JSONArray arr = wo.query(whereJson, "create_time").getResultJSONArray(0);
|
||||||
// List<Instruction> list = arr.toJavaList(Instruction.class);
|
// List<Instruction> list = arr.toJavaList(Instruction.class);
|
||||||
List<InstructionMybatis> insList= new LambdaQueryChainWrapper<>(instructionMapper)
|
List<InstructionMybatis> insList = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.lt(InstructionMybatis::getInstruction_status, "2")
|
.lt(InstructionMybatis::getInstruction_status, "2")
|
||||||
.list();
|
.list();
|
||||||
return ConvertUtil.convertList(insList,Instruction.class);
|
return ConvertUtil.convertList(insList, Instruction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -300,13 +302,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// final Instruction obj = json.toJavaObject(Instruction.class);
|
// final Instruction obj = json.toJavaObject(Instruction.class);
|
||||||
// return obj;
|
// return obj;
|
||||||
|
|
||||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.eq(InstructionMybatis::getInstruction_code, code)
|
.eq(InstructionMybatis::getInstruction_code, code)
|
||||||
.one();
|
.one();
|
||||||
if(ObjectUtil.isEmpty(ins)){
|
if (ObjectUtil.isEmpty(ins)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return ConvertUtil.convert(ins,Instruction.class);
|
return ConvertUtil.convert(ins, Instruction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -315,13 +317,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0);
|
// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0);
|
||||||
// final Instruction obj = json.toJavaObject(Instruction.class);
|
// final Instruction obj = json.toJavaObject(Instruction.class);
|
||||||
// return obj;
|
// return obj;
|
||||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.eq(InstructionMybatis::getTask_code, code)
|
.eq(InstructionMybatis::getTask_code, code)
|
||||||
.one();
|
.one();
|
||||||
if(ObjectUtil.isEmpty(ins)){
|
if (ObjectUtil.isEmpty(ins)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return ConvertUtil.convert(ins,Instruction.class);
|
return ConvertUtil.convert(ins, Instruction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -350,11 +352,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// return null;
|
// return null;
|
||||||
|
|
||||||
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(InstructionMybatis::getTask_id,id);
|
wrapper.eq(InstructionMybatis::getTask_id, id);
|
||||||
wrapper.apply(StringUtils.isNotBlank(wherecaluse),wherecaluse);
|
wrapper.apply(StringUtils.isNotBlank(wherecaluse), wherecaluse);
|
||||||
InstructionMybatis ins = instructionMapper.selectOne(wrapper);
|
InstructionMybatis ins = instructionMapper.selectOne(wrapper);
|
||||||
if (ObjectUtil.isNotEmpty(ins)) {
|
if (ObjectUtil.isNotEmpty(ins)) {
|
||||||
return ConvertUtil.convert(ins,Instruction.class);
|
return ConvertUtil.convert(ins, Instruction.class);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -386,7 +388,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
dto.setIs_send(task.getLink_num());
|
dto.setIs_send(task.getLink_num());
|
||||||
}
|
}
|
||||||
// if (task.getTask_type().equals("1") || task.getTask_type().equals("2")) {
|
// if (task.getTask_type().equals("1") || task.getTask_type().equals("2")) {
|
||||||
dto.setInstruction_type(task.getTask_type());
|
dto.setInstruction_type(task.getTask_type());
|
||||||
// } else if (false) {
|
// } else if (false) {
|
||||||
//
|
//
|
||||||
// } else {
|
// } else {
|
||||||
@@ -410,8 +412,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername)?currentUsername:"admin");
|
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
dto.setStart_parent_code(task.getStart_parent_code());
|
dto.setStart_parent_code(task.getStart_parent_code());
|
||||||
@@ -450,19 +452,34 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||||
|
} else if (StrUtil.equals(shortPathsList.get(0).getType(), "2")) {
|
||||||
|
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||||
|
HttpResponse result = zheDaAgvService.sendAgvInstToAgv(dto);
|
||||||
|
if (!ObjectUtils.isEmpty(result)) {
|
||||||
|
JSONObject jo = JSON.parseObject(result.body());
|
||||||
|
if (jo.getInteger("status") != 200) {
|
||||||
|
dto.setSend_status("2");
|
||||||
|
} else {
|
||||||
|
dto.setSend_status("1");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dto.setSend_status("2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch(Exception e)
|
||||||
dto.setSend_status("2");
|
{
|
||||||
e.printStackTrace();
|
dto.setSend_status("2");
|
||||||
log.error("");
|
e.printStackTrace();
|
||||||
}
|
log.error("");
|
||||||
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
}
|
||||||
|
|
||||||
|
// WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
// wo.insert(json);
|
// wo.insert(json);
|
||||||
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
|
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
|
||||||
instructionMapper.insert(entity);
|
instructionMapper.insert(entity);
|
||||||
instructions.add(dto);
|
instructions.add(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create2(Instruction dto) throws Exception {
|
public void create2(Instruction dto) throws Exception {
|
||||||
@@ -602,11 +619,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// + dto.getTask_id()
|
// + dto.getTask_id()
|
||||||
// + "'")
|
// + "'")
|
||||||
// .uniqueResult(0);
|
// .uniqueResult(0);
|
||||||
InstructionMybatis ins= new LambdaQueryChainWrapper<>(instructionMapper)
|
InstructionMybatis ins = new LambdaQueryChainWrapper<>(instructionMapper)
|
||||||
.lt(InstructionMybatis::getInstruction_status, 3)
|
.lt(InstructionMybatis::getInstruction_status, 3)
|
||||||
.eq(InstructionMybatis::getNext_point_code,dto.getNext_point_code())
|
.eq(InstructionMybatis::getNext_point_code, dto.getNext_point_code())
|
||||||
.eq(InstructionMybatis::getStart_point_code,dto.getStart_point_code())
|
.eq(InstructionMybatis::getStart_point_code, dto.getStart_point_code())
|
||||||
.eq(InstructionMybatis::getTask_id,dto.getTask_id())
|
.eq(InstructionMybatis::getTask_id, dto.getTask_id())
|
||||||
.one();
|
.one();
|
||||||
|
|
||||||
|
|
||||||
@@ -801,7 +818,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
||||||
|
|
||||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||||
.eq(Task::getTask_id,insttaskid)
|
.eq(Task::getTask_id, insttaskid)
|
||||||
.one();
|
.one();
|
||||||
// =0 则不用再次请求
|
// =0 则不用再次请求
|
||||||
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
||||||
@@ -836,7 +853,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
// TaskDto obj = taskjson.toJavaObject(TaskDto.class);
|
||||||
|
|
||||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||||
.eq(Task::getTask_id,insttaskid)
|
.eq(Task::getTask_id, insttaskid)
|
||||||
.one();
|
.one();
|
||||||
// =0 则不用再次请求
|
// =0 则不用再次请求
|
||||||
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
if (StrUtil.equals(task.getRequest_again(), "0")) {
|
||||||
@@ -890,7 +907,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
// JSONObject taskjson = taskwo.query("task_id ='" + dto.getTask_id() + "'").uniqueResult(0);
|
// JSONObject taskjson = taskwo.query("task_id ='" + dto.getTask_id() + "'").uniqueResult(0);
|
||||||
// TaskDto acsTask = taskjson.toJavaObject(TaskDto.class);
|
// TaskDto acsTask = taskjson.toJavaObject(TaskDto.class);
|
||||||
Task acsTask = new LambdaQueryChainWrapper<>(taskMapper)
|
Task acsTask = new LambdaQueryChainWrapper<>(taskMapper)
|
||||||
.eq(Task::getTask_id,dto.getTask_id())
|
.eq(Task::getTask_id, dto.getTask_id())
|
||||||
.one();
|
.one();
|
||||||
|
|
||||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
||||||
@@ -978,24 +995,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
entity.setRoute_plan_code(task.getRoute_plan_code());
|
entity.setRoute_plan_code(task.getRoute_plan_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
// != 0 为agv任务 1=magic 2=NDC 3=XZ,4=ZHEDA
|
// != 0 1=NDC任务 2=RGV任务
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "1")
|
if (StrUtil.equals(task.getAgv_system_type(), "1")
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||||
MagicAgvService magicAgvService = SpringContextHolder.getBean(MagicAgvService.class);
|
|
||||||
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
|
||||||
flag = true;
|
|
||||||
|
|
||||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
|
||||||
// NDC agv指令不当场取消指令,需要等agv上报
|
// NDC agv指令不当场取消指令,需要等agv上报
|
||||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||||
ndcAgvService.deleteAgvInstToNDC((Instruction)entity);
|
ndcAgvService.deleteAgvInstToNDC((Instruction)entity);
|
||||||
} else {
|
|
||||||
flag = true;
|
|
||||||
}
|
}
|
||||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
flag = true;
|
||||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
|
||||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
} else if (StrUtil.equals(task.getAgv_system_type(), "2")) {
|
||||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
try {
|
||||||
|
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
|
||||||
|
zheDaAgvService.deleteZDAgvInst(entity.getInstruction_code());
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("下发浙大取消指令失败{}",e.getMessage());
|
||||||
|
}
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
flag = true;
|
flag = true;
|
||||||
@@ -1525,7 +1540,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(String id) {
|
public void init(String id) {
|
||||||
InstructionDto inst = this.findById(id);
|
InstructionDto inst = this.findById(id);
|
||||||
if (inst == null) {
|
if (inst == null) {
|
||||||
throw new BadRequestException("指令不存在或已删除");
|
throw new BadRequestException("指令不存在或已删除");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class AutoCreateInst {
|
|||||||
* 根据任务状态创建指令、生成下一条指令
|
* 根据任务状态创建指令、生成下一条指令
|
||||||
* 创建指令前需要判断是否条件具备:起始位置是否有货、目标位置是否有货
|
* 创建指令前需要判断是否条件具备:起始位置是否有货、目标位置是否有货
|
||||||
*/
|
*/
|
||||||
public void run() throws Exception {
|
public synchronized void run() throws Exception {
|
||||||
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
|
||||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
||||||
@@ -123,9 +123,9 @@ public class AutoCreateInst {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
Device startdevice = appService.findDeviceByCode(start_device_code);
|
Device startdevice = appService.findDeviceByCode(start_device_code);
|
||||||
Device nextdevice = appService.findDeviceByCode(next_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")) {
|
||||||
|
|||||||
@@ -168,6 +168,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.type=='0' ">输送路由</span>
|
<span v-if="scope.row.type=='0' ">输送路由</span>
|
||||||
<span v-if="scope.row.type=='1' ">agv路由</span>
|
<span v-if="scope.row.type=='1' ">agv路由</span>
|
||||||
|
<span v-if="scope.row.type=='2' ">rgv路由</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
|
<el-table-column prop="next_device_code" min-width="120" label="后置设备号" />
|
||||||
@@ -269,6 +270,10 @@ export default {
|
|||||||
{
|
{
|
||||||
typeName: 'agv路由',
|
typeName: 'agv路由',
|
||||||
typeValue: '1'
|
typeValue: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
typeName: 'rgv路由',
|
||||||
|
typeValue: '2'
|
||||||
}],
|
}],
|
||||||
permission: {
|
permission: {
|
||||||
add: ['admin', 'routeLine:add'],
|
add: ['admin', 'routeLine:add'],
|
||||||
|
|||||||
Reference in New Issue
Block a user