李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
    }
}