|
@@ -47,6 +47,7 @@ import com.github.zuihou.file.biz.FileBiz;
|
|
|
import com.github.zuihou.file.service.AttachmentService;
|
|
|
import com.github.zuihou.log.annotation.SysLog;
|
|
|
import com.github.zuihou.tenant.service.CodeRuleService;
|
|
|
+import com.mysql.cj.protocol.x.Notice;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -191,7 +192,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
@ApiOperation(value = "刀具需求下发给EOP", notes = "刀具需求下发给EOP")
|
|
|
@PostMapping("/externalApi/sendCutterNeedToEop")
|
|
|
public R sendCutterNeedToEop(@RequestBody List<ToolCheckDTO> datas) {
|
|
|
- log.info("定时================发送刀具需求给Eop系统开始================");
|
|
|
+ log.info("================发送刀具需求给Eop系统开始================");
|
|
|
StringBuffer isExist = new StringBuffer();
|
|
|
BaseContextHandler.setTenant("0000");
|
|
|
|
|
@@ -241,14 +242,14 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
}
|
|
|
|
|
|
MesNotice mesNotice = MesNotice.builder().orderNo(data.getOrderNo()).buType("TASKAPPLY").lineCode("407109")
|
|
|
- .status("1").apiType("CUTTERNEED").source("产线管控单元").targetSource("刀具系统(EOP)").apiAddress(url)
|
|
|
+ .status("0").apiType("CUTTERNEED").source("产线管控单元").targetSource("刀具系统(EOP)").apiAddress(url)
|
|
|
.acceptPar(JSONObject.toJSONString(cutterApply)).build();
|
|
|
+
|
|
|
try {
|
|
|
- boolean b = baseService.addNotice(mesNotice);
|
|
|
- if(b){
|
|
|
- // 调用接口发送需求
|
|
|
- String returnData = msgUtil.httpForPost(mesNotice.getApiAddress(),mesNotice.getAcceptPar());
|
|
|
- log.info("=========接口反馈============"+ returnData);
|
|
|
+ String s = baseService.sendCutterNeedToEop(mesNotice);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
+ if(!jsonObject.get("code").equals(200)){
|
|
|
+ isExist.append("<br>订单号:"+data.getOrderNo()+";刀具列表:"+ data.getList()+";"+ jsonObject.get("msg"));
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
// 新增失败
|
|
@@ -261,25 +262,29 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
return R.success(null,"部分成功:"+isExist.toString());
|
|
|
}
|
|
|
|
|
|
- log.info("定时================发送刀具需求给Eop系统结束================");
|
|
|
+ log.info("================发送刀具需求给Eop系统结束================");
|
|
|
return R.success();
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "接受刀具分拣结果", notes = "接受刀具分拣结果")
|
|
|
- @PostMapping("/externalApi/acceptSortingResult")
|
|
|
- public R acceptSortingResult(@RequestBody CutterNeedDto data) {
|
|
|
- log.info("定时================质检结果上报开始================");
|
|
|
+ @PostMapping("/externalApi/acceptCutterNeedResult")
|
|
|
+ public R acceptCutterNeedResult(@RequestBody JSONObject jsonObject) {
|
|
|
+ log.info("================质检结果上报开始================{}", jsonObject.toJSONString());
|
|
|
// 根据代办的质量任务,查询是否已经检测完成,是,进行上报
|
|
|
try {
|
|
|
- MesNotice mesNotice = MesNotice.builder().build();
|
|
|
- mesNotice.setSource("QUALITY");
|
|
|
- baseService.QualityResultReport(mesNotice);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("质检结果上报失败:" + e);
|
|
|
|
|
|
+ boolean b = baseService.acceptCutterNeedResult(jsonObject);
|
|
|
+
|
|
|
+ }catch (NullPointerException nulle){
|
|
|
+ log.error("===================刀具分拣接口失败:" + nulle);
|
|
|
+ nulle.printStackTrace();
|
|
|
+ return R.fail("没查询到任务");
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.error("===================刀具分拣接口失败:" + e);
|
|
|
+ e.printStackTrace();
|
|
|
return R.fail(e.getMessage());
|
|
|
}
|
|
|
- log.info("定时================质检结果上报结束================");
|
|
|
+ log.info("================质检结果上报结束================");
|
|
|
return R.success();
|
|
|
|
|
|
}
|