|
|
|
@ -20,6 +20,7 @@ import org.apache.poi.ss.formula.functions.T;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
@Api(tags = "客户端通讯测试")
|
|
|
|
@Api(tags = "客户端通讯测试")
|
|
|
|
@RequestMapping("/clientTest")
|
|
|
|
@RequestMapping("/clientTest")
|
|
|
|
@ -51,44 +52,49 @@ public class ClientTestController {
|
|
|
|
ClientChanel.write(msg,SRMNumber);
|
|
|
|
ClientChanel.write(msg,SRMNumber);
|
|
|
|
//获取空货位的结果信息
|
|
|
|
//获取空货位的结果信息
|
|
|
|
// 返回给普天
|
|
|
|
// 返回给普天
|
|
|
|
Street street = streetService.getStreetByPlcId(SRMNumber);
|
|
|
|
//Street street = streetService.getStreetByPlcId(SRMNumber);
|
|
|
|
PTEmptyCheckContent ptEmptyCheckContent = null;
|
|
|
|
|
|
|
|
PTData ptData = null;
|
|
|
|
//String shevel = null;
|
|
|
|
String shevel = null;
|
|
|
|
Map<String,String> map = emptyCheckService.getAllEmptyStatus(SRMNumber,row,startColumn,endColumn);
|
|
|
|
if(street.getLeftType() == 0){
|
|
|
|
map.forEach((k,v)->{
|
|
|
|
//单伸
|
|
|
|
PTEmptyCheckContent ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,k,v);
|
|
|
|
String SingleLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,1,row,startColumn,endColumn);
|
|
|
|
PTData ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
shevel = "L01";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleLeft);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
String SingleRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
shevel = "R01";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleRight);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
String SingleInLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,1,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
shevel = "L01";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleInLeft);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
String SingleInRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
shevel = "R01";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleInRight);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
String SingleOutLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,2,1,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
shevel = "L02";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleOutLeft);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
String SingleOutRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,2,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
shevel = "R02";
|
|
|
|
|
|
|
|
ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleOutRight);
|
|
|
|
|
|
|
|
ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
PuTianNettyClient.write(ptData);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// if(street.getLeftType() == 0){
|
|
|
|
|
|
|
|
// //单伸
|
|
|
|
|
|
|
|
// String SingleLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,1,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "L01";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleLeft);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// String SingleRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "R01";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleRight);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
|
|
// String SingleInLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,1,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "L01";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleInLeft);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// String SingleInRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,1,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "R01";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleInRight);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// String SingleOutLeft = emptyCheckService.getEmptyStatus(SRMNumber,taskId,2,1,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "L02";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleOutLeft);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// String SingleOutRight = emptyCheckService.getEmptyStatus(SRMNumber,taskId,2,2,row,startColumn,endColumn);
|
|
|
|
|
|
|
|
// shevel = "R02";
|
|
|
|
|
|
|
|
// ptEmptyCheckContent = PTEmptyCheckContent.emptyCheckResponse(SRMNumber,taskId,row,startColumn,endColumn,shevel,SingleOutRight);
|
|
|
|
|
|
|
|
// ptData = PTData.EmptyStatusResponse(ptEmptyCheckContent);
|
|
|
|
|
|
|
|
// PuTianNettyClient.write(ptData);
|
|
|
|
|
|
|
|
// }
|
|
|
|
return Result.success(msg);
|
|
|
|
return Result.success(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|