add:添加载具高度下发

This commit is contained in:
zhangzq
2024-08-22 10:51:53 +08:00
parent 7635b5100c
commit 7b63a1c84f
5 changed files with 38 additions and 16 deletions

View File

@@ -100,14 +100,14 @@ public class HeartClientServer extends AbstraceServer {
System.out.println(channel.id().toString()+"----ppp-----");
try {
Thread.sleep(2000);
ByteBuf log = Unpooled.copiedBuffer("ping--222-", CharsetUtil.UTF_8);
if (channel==null){
return;
}
channel.writeAndFlush(log).sync();
} catch (InterruptedException e) {
e.printStackTrace();
}
ByteBuf log = Unpooled.copiedBuffer("ping--222-", CharsetUtil.UTF_8);
if (channel==null){
return;
}
channel.writeAndFlush(log);
}
});
}

View File

@@ -39,11 +39,11 @@ public class WmsToAcsService{
return result;
}
public TableDataInfo toCommand(String deviceCode,String toCommand){
public TableDataInfo toCommand(String deviceCode,String toCommand,Integer toHeight){
InteracteDto<Object> dto = InteracteDto.builder().service("wmsToAcsService")
.trace_id(MDC.get("trace_id"))
.type("toCommand")
.data(MapOf.of("device_code", deviceCode, "toCommand", toCommand))
.data(MapOf.of("device_code", deviceCode, "toCommand", toCommand,"toHeight",toHeight))
.build();
TableDataInfo result = InterationUtil.notifyExt("/api/wmsToAcs/apply", (JSONObject) JSON.toJSON(dto));
return result;

View File

@@ -58,17 +58,22 @@ public class PdaCommonController {
@Log("获取升级地址")
@SaIgnore
public ResponseEntity<Map> apkUrl() {
Map of = MapOf.of("versionName", "1.0.1", "url", "http://192.168.10.54:8012/api/pda/download/app-release");
Map of = MapOf.of("versionName", "1.0.1", "url", "http://192.168.10.241:8012/api/pda/download/app-release");
return new ResponseEntity<>(of,HttpStatus.OK);
}
@RequestMapping("/download/app-release")
@SaIgnore
public void setPrint(HttpServletResponse response) throws Exception {
public void setPrint(HttpServletResponse response){
Param byCode = iSysParamService.findByCode("apkurl");
if (byCode==null){
throw new BadRequestException("更新失败:为配置apk下载地址");
}
downloadFile(response,byCode.getValue(),"release");
System.out.println(byCode.getValue());
try {
downloadFile(response,byCode.getValue(),"release");
}catch (Exception ex){
ex.printStackTrace();
}
}
/**

View File

@@ -2,6 +2,7 @@ package org.nl.wms.pda_manage.devicemanage;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
@@ -9,10 +10,14 @@ import org.nl.common.TableDataInfo;
import org.nl.common.anno.Log;
import org.nl.common.domain.exception.BadRequestException;
import org.nl.common.domain.exception.handler.ApiError;
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
import org.nl.wms.external_system.acs.service.AcsToWmsService;
import org.nl.wms.external_system.acs.service.WmsToAcsService;
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
import org.nl.wms.pda_manage.devicemanage.dto.ComTp;
import org.nl.wms.pda_manage.palletio.service.PalletIostorinvService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +43,8 @@ public class DeviceManageController {
private WmsToAcsService wmsToAcsService;
@Autowired
private ISchBasePointService iSchBasePointService;
@Autowired
private IBmVehicleInfoService iBmVehicleInfoService;
/**
* 切换出入库模式
@@ -74,12 +81,18 @@ public class DeviceManageController {
@SaIgnore
@Log("下发输送线运动命令")
public ResponseEntity<TableDataInfo> toCommandTP(@RequestBody ComTp form) {
Assert.noNullElements(new Object[]{form.getDevice_code(),form.getVehicle_code()},"请求参数不能为空");
String device_code = form.getDevice_code();
String vehicleCode = form.getVehicle_code();
SchBasePoint code = iSchBasePointService.getOne(new QueryWrapper<SchBasePoint>().eq("code", device_code));
if (code!=null && !code.getIs_used()){
throw new BadRequestException(String.format("输送线%s模式不正确不允许下发运动",device_code));
}
wmsToAcsService.toCommand(device_code,form.getMode());
BmVehicleInfo vehicleInfo = iBmVehicleInfoService.getOne(new QueryWrapper<BmVehicleInfo>().eq("vehicle_code", vehicleCode));
if (vehicleInfo == null ){
throw new BadRequestException(String.format("载具信息不存在"));
}
wmsToAcsService.toCommand(device_code,form.getMode(),vehicleInfo.getH());
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}

View File

@@ -157,22 +157,26 @@ public class PickingService {
JSONObject form_data = mstJ.getJSONObject("form_data");
String platform = form_data.getString("point_code");
String sourceVehicle = mstJ.getString("vehicle_code");
List<String> converys = new ArrayList<>();
List<Map<String,Object>> converys = new ArrayList<>();
for (ExecutionDto executionDto : dto.getItem()) {
for (ExecutionDto executionDto1 : executionDto.getItem()) {
JSONObject dis = executionDto1.getT();
if (!"false".equals(dis.getJSONObject("form_data").getString("s_move"))) {
String vehicle_code = dis.getString("vehicle_code");
BmVehicleInfo vehicleInfo = iBmVehicleInfoService.getOne(new QueryWrapper<BmVehicleInfo>().eq("vehicle_code", vehicle_code));
if (vehicleInfo==null || vehicleInfo.getH()==null ||vehicleInfo.getH().intValue()<1){
throw new BadRequestException(vehicle_code+"载具信息不存在,请确认载具基础表载具及高度信息是否完整");
}
if (vehicle_code.equals(sourceVehicle)) {
converys.add(platform);
converys.add(MapOf.of("c",platform,"v",vehicleInfo.getH()));
} else {
converys.add(Pick_Convery.get(platform));
converys.add(MapOf.of("c",Pick_Convery.get(platform),"v",vehicleInfo.getH()));
}
}
}
}
for (String convery : converys) {
wmsToAcsService.toCommand(convery, "1");
for (Map<String,Object> convery : converys) {
wmsToAcsService.toCommand((String)convery.get("c"), "1",(Integer) convery.get("v"));
}
PickingService pickingService = SpringContextHolder.getBean(this.getClass());