package com.chinaztt.mes.plan.controller;
|
|
import com.chinaztt.mes.plan.dto.OACallBackResult;
|
import com.chinaztt.mes.plan.service.CustomerOrderService;
|
import com.chinaztt.ztt.common.security.annotation.Inner;
|
import io.swagger.annotations.Api;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/planOaCallBack")
|
@Inner(false)
|
@Api(value = "planOaCallBack", tags = "计划模块OA回调")
|
@Slf4j
|
public class PlanOaCallBackController {
|
|
private final CustomerOrderService customerOrderService;
|
|
@RequestMapping("/result")
|
public String result(String data) {
|
OACallBackResult callBackResult = customerOrderService.oaResultCallBack(data);
|
if (StringUtils.isNotBlank(callBackResult.getResult())) {
|
try {
|
customerOrderService.pushPartNoToOtc(callBackResult);
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
}
|
}
|
return callBackResult.getMessage();
|
}
|
}
|