物料流程整合
This commit is contained in:
@@ -22,16 +22,11 @@ public class VmCommandController {
|
||||
@Autowired
|
||||
private SimpleRequestMatcher requestMatcher;
|
||||
|
||||
@Autowired
|
||||
private MaterialProcessMapper materialProcessMapper;
|
||||
|
||||
@PostMapping("/send")
|
||||
public String sendAndWait(@RequestBody JSONObject js) {
|
||||
String msg = js.getString("msg");
|
||||
log.info("开始比对物料编码: {}", msg);
|
||||
String processCode = materialProcessMapper.getCodeByMaterial(msg);
|
||||
log.info("物料流程编码: {}", processCode);
|
||||
CheckUtils.throwIf(StrUtil.isBlank(processCode), "未查询到物料流程编码");
|
||||
String materialProcess = js.getString("materialProcess");
|
||||
log.info("开始比对: {}", materialProcess);
|
||||
CheckUtils.throwIf(StrUtil.isBlank(materialProcess), "物料流程编码不能为空");
|
||||
|
||||
// 1. 检查连接
|
||||
Channel channel = channelManager.getFirstChannel();
|
||||
@@ -40,7 +35,7 @@ public class VmCommandController {
|
||||
}
|
||||
// 2. 清空之前的响应队列,避免影响当前请求
|
||||
requestMatcher.clear();
|
||||
channel.writeAndFlush(msg);
|
||||
channel.writeAndFlush(materialProcess);
|
||||
// 3. 等待响应
|
||||
String response = requestMatcher.waitForResponse(20);
|
||||
log.info("sendAndWait-收到响应: {}", response);
|
||||
|
||||
Reference in New Issue
Block a user