2/19 优化1.0

Lhxyy
wangwei 1 month ago
parent 457b4f6ea6
commit 69d9cb66a0

@ -10,6 +10,7 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.glxp.mipsdl.client.CommonHttpClient;
import com.glxp.mipsdl.config.ThirdSysConfig;
import com.glxp.mipsdl.constant.ConstantType;
@ -40,30 +41,19 @@ import com.glxp.mipsdl.entity.thrsys.ThrProductsEntity;
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.*;
import com.glxp.mipsdl.req.ctqyy.CtqyyRequest;
import com.glxp.mipsdl.req.dsxyy.DsOrderRequest;
import com.glxp.mipsdl.req.lhzyy.LhProductRequest;
import com.glxp.mipsdl.req.lhzyy.LhUnitRequest;
import com.glxp.mipsdl.req.lhzyy.LhzyyRequest;
import com.glxp.mipsdl.req.post.*;
import com.glxp.mipsdl.req.yxzyy.YxBusTypeRequest;
import com.glxp.mipsdl.req.yxzyy.YxProductRequest;
import com.glxp.mipsdl.req.yxzyy.YxUnitRequest;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.Lhzyy.LhBaseResponse;
import com.glxp.mipsdl.res.ctqyy.CtBaseResponse;
import com.glxp.mipsdl.res.udiwms.UdiRelevanceResponse;
import com.glxp.mipsdl.service.auth.AuthWarehouseService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
import com.glxp.mipsdl.util.DateUtil;
import com.glxp.mipsdl.util.DictUtl;
import com.glxp.mipsdl.util.ResultVOUtils;
import com.glxp.mipsdl.util.SubmitOrderUtil;
import lombok.extern.slf4j.Slf4j;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -438,19 +428,25 @@ public class LhzyyClient extends CommonHttpClient {
log.error("提交新增产品信息返回:" + response);
try {
log.error("提交新增产品信息:" + materialDictEntity);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
// LhBaseResponse baseResponse = JSONObject.parseObject(response, LhBaseResponse.class);
if (baseResponse.getCode() != 20000) {
String errMsg = "提交新增产品信息,异常:{}" + response;
log.error(errMsg);
return ResultVOUtils.error(500, "提交新增产品失败!");
} else {
// materialDictEntity.setMaterialNo(baseResponse.getMaterialNo());
log.error("提交新增产品信息,成功:{}", response);
String third = String.valueOf(baseResponse.getData());
return ResultVOUtils.success(third);
String data = String.valueOf(baseResponse.getData());
ObjectMapper objectMapper = new ObjectMapper();
String ypid = "";
try {
Map<String, String> map = objectMapper.readValue(data, Map.class);
ypid = map.get("ypid");
} catch (Exception e) {
e.printStackTrace();
}
return ResultVOUtils.success(ypid);
}
} catch (Exception e) {
String errMsg = "提交新增产品信息,异常:{}" + response;
@ -461,4 +457,20 @@ public class LhzyyClient extends CommonHttpClient {
}
}
// public static void main(String[] args) {
// String data = "{\"ypid\" : \"13682\"}";
// ObjectMapper objectMapper = new ObjectMapper();
// try {
// // 将 JSON 字符串转换为 Map 对象
// Map<String, String> map = objectMapper.readValue(data, Map.class);
// // 获取 ypid 的值
// String ypid = map.get("ypid");
// System.out.println("ypid: " + ypid);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
}

Loading…
Cancel
Save