소스 검색

1029需要变更

wanghongzhi 1 년 전
부모
커밋
b480ac5528

+ 0 - 1
easydo-chengfa/src/main/java/easydo/technology/controller/ApiController.java

@@ -82,7 +82,6 @@ public class ApiController {
         }
     }
 
-    // TODO: 2024-9-25 projectId
     @WebLog
     @RequestMapping(value = "/bidNotice/getList")
     public Object getNoticeList(@RequestBody Map<String, Object> map) throws Exception {

+ 4 - 2
easydo-chengfa/src/main/java/easydo/technology/controller/SupplierController.java

@@ -38,7 +38,7 @@ public class SupplierController {
 
     @WebLog
     @RequestMapping(value = "/getPage")
-    public Object getPage(@RequestBody Map<String, Object> map)throws Exception {
+    public Object getPage(@RequestBody Map<String, Object> map) throws Exception {
         Connection connection = null;
         try {
             connection = dataSource.getConnection();
@@ -106,7 +106,9 @@ public class SupplierController {
                 jdbcClient.jdbcInsert(bank, connection);
             }
             try {
-                mdmService.sendSupplier(model, false);
+                String code = mdmService.sendSupplier(model, false);
+                model.setSupplierNo(code);
+                jdbcClient.jdbcUpdateById(model, connection);
             } catch (Exception ee) {
                 log.error(ee.getMessage());
             }

+ 7 - 1
easydo-chengfa/src/main/java/easydo/technology/service/MDMService.java

@@ -32,7 +32,7 @@ public class MDMService {
     @Resource
     DataSource dataSource;
 
-    public Boolean sendSupplier(Supplier supplier, boolean isDeleted) throws Exception {
+    public String sendSupplier(Supplier supplier, boolean isDeleted) throws Exception {
         String url = mdmHost + supplierPath;
         JSONObject object = new JSONObject();
 
@@ -76,6 +76,12 @@ public class MDMService {
         log.info(uuid + "推送MSM供应商数据req========>" + object.toJSONString() + ",url========>" + url);
         JSONObject resObj = HttpClientUtil.sendPOST(url, object.toJSONString());
         log.info(uuid + "推送MSM供应商数据res========>" + resObj.toJSONString());
+
+        if ("S".equals(resObj.getString("result"))) {
+            JSONObject parametersObj = (JSONObject) resObj.getJSONArray("Parameters").get(0);
+            String code = parametersObj.getJSONObject("sourceInfo").getString("C_EXTERNAL_UNIT_CODE");
+            return code;
+        }
         return null;
     }
 }