自动化立体仓库 - WMS系统
#
whycq
2023-08-31 55edf5ac7573ea75e8bba47438899cc6a1ee37eb
src/main/java/com/zy/asrs/utils/PostMesDataUtils.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.impl.ApiLogServiceImpl;
@@ -15,9 +16,11 @@
@Slf4j
public class PostMesDataUtils extends AbstractHandler<String> {
    private ApiLogService apiLogService = new ApiLogServiceImpl();
    public ReturnT<String> postMesData(String name,String URL,String mesPath, Object combParam){
//        if (true){
//            System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam);
//            return SUCCESS;
//        }
        if(combParam != null){
            String response = "";
            boolean success = false;
@@ -31,7 +34,9 @@
                        .setJson(JSON.toJSONString(combParam))
                        .build()
                        .doPost();
                System.out.println("response:"+response);
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                } else {
@@ -45,6 +50,7 @@
            } finally {
                try {
                    // 保存接口日志
                    ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class);
                    apiLogService.save(
                            "上报"+name,
                            URL +"/"+ mesPath,
@@ -54,7 +60,8 @@
                            response,
                            success
                    );
                } catch (Exception e) { log.error("", e); }
                } catch (Exception e) {
                    log.error("", e); }
            }
        }
        return SUCCESS;