소스 검색

Merge remote-tracking branch 'origin/master'

“lqy 1 주 전
부모
커밋
751649d0d6

+ 11 - 0
mjava-jinlun/src/main/java/com/malk/jinlun/controller/JinlunController.java

@@ -1,5 +1,6 @@
 package com.malk.jinlun.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.malk.jinlun.service.JinlunService;
 import com.malk.server.common.McR;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -93,4 +94,14 @@ public class JinlunController {
         return jinlunService.getCustomerWqqk(startDate,customerName);
 //        return null;
     }
+
+    /***
+     * 查询表单数据
+     * @param param
+     * @return
+     */
+    @PostMapping("/queryFromData")
+    public McR queryFromData(@RequestBody JSONObject param){
+        return jinlunService.queryFromData(param);
+    }
 }

+ 2 - 0
mjava-jinlun/src/main/java/com/malk/jinlun/service/JinlunService.java

@@ -18,4 +18,6 @@ public interface JinlunService {
     McR getCustomerDzmx(String startDate, String endDate, String customerName);
 
     McR getCustomerWqqk(String startDate, String customerName);
+
+    McR queryFromData(Map map);
 }

+ 21 - 2
mjava-jinlun/src/main/java/com/malk/jinlun/service/impl/JinlunServiceImpl.java

@@ -16,6 +16,7 @@ import com.malk.jinlun.service.JinlunService;
 import com.malk.server.common.McR;
 import com.malk.server.teambition.TBConf;
 import com.malk.server.teambition.TBR;
+import com.malk.utils.PublicUtil;
 import com.malk.utils.UtilHttp;
 import com.malk.utils.UtilMap;
 import com.malk.utils.UtilToken;
@@ -196,11 +197,13 @@ public class JinlunServiceImpl implements JinlunService {
                 try {
                     resultJson3 = client.audit(formId,JSONObject.toJSONString(audit));
                 }catch (Exception e){
-                    throw new RuntimeException(e);
+//                    throw new RuntimeException(e);
+                    e.printStackTrace();
+                    log.error(e.getMessage());
                 }
 
                 RepoRet repoRet3 = gson.fromJson(resultJson3, RepoRet.class);
-                isTrue(repoRet3);
+//                isTrue(repoRet3);
             }
         }
 
@@ -617,6 +620,22 @@ public class JinlunServiceImpl implements JinlunService {
         return McR.success(customerWqqk);
     }
 
+    @Override
+    public McR queryFromData(Map map) {
+        if (PublicUtil.isNull(map, "schemaCode","propertyCode","propertyValue")){
+            return McR.error("201","参数不能为空!");
+        }
+        Map cpBoList=cpClient.getCpBoList(UtilMap.getString(map,"schemaCode"), UtilMap.map("queryFilterType, propertyCode, propertyValue", "Eq", UtilMap.getString(map,"propertyCode"), UtilMap.getString(map,"propertyValue")), null, 0, 1, null);
+        Map bizObjectPage = UtilMap.getMap(UtilMap.getMap(cpBoList, "data"),"bizObjectPage");
+        int totalElements = UtilMap.getInt(bizObjectPage, "totalElements");
+        if (totalElements == 1){
+            Map content = ((List<Map>) UtilMap.getList(bizObjectPage, "content")).get(0);
+            Map data = UtilMap.getMap(content, "data");
+            return McR.success(data);
+        }
+        return McR.error("201","未查询到数据!");
+    }
+
     private IdentifyInfo initIden(){
         //注意 1:此处不再使用参数形式传入用户名及密码等敏感信息,改为在登录配置文件中设置。
         //注意 2:必须先配置第三方系统登录授权信息后,再进行业务操作,详情参考各语言版本SDK介绍中的登录配置文件说明。

+ 1 - 1
mjava-jinlun/src/main/resources/application-prod.yml

@@ -41,7 +41,7 @@ cloudpivot:
   client_id: xclient
   client_secret: 0a417ecce58c31b32364ce19ca8fcd15
   redirect_uri: http://172.16.10.1/api/
-  operator_user_id: 8ac194c0811240a6b483ebc86aeb9147
+  operator_user_id: 2098b083a6d34ac38cc93b30838c28bd
 
 kingdee:
   # 第三方系统登录授权的账套ID

+ 1 - 1
mjava-jinlun/src/test/java/com/malk/jinlun/DdTest.java

@@ -387,7 +387,7 @@ public class DdTest {
             params.put("client_id","xclient");
             params.put("client_secret","0a417ecce58c31b32364ce19ca8fcd15");
 
-            String s = UtilHttp.doPost("http://192.168.0.12/api/oauth/token", null, params, new HashMap());
+            String s = UtilHttp.doPost("http://172.16.10.1/api/oauth/token", null, params, new HashMap());
 
             Map result = (Map) JSONObject.parse(s);
 

+ 33 - 0
mjava-jinlun/src/test/java/com/malk/jinlun/YsTest.java

@@ -0,0 +1,33 @@
+package com.malk.jinlun;
+
+import com.alibaba.fastjson.JSONObject;
+import com.malk.jinlun.service.CpClient;
+import com.malk.jinlun.service.JinlunService;
+import com.malk.server.common.McR;
+import com.malk.utils.UtilMap;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Map;
+
+@Slf4j
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class YsTest {
+    @Autowired
+    private CpClient cpClient;
+    @Autowired
+    private JinlunService jinlunService;
+
+
+    @Test
+    public void test(){
+        McR result = jinlunService.queryFromData(UtilMap.map("schemaCode, propertyCode, propertyValue","KHDA","ShortText1758195840127","K02219"));
+//        Map result=cpClient.getCpBoList("KHDA", UtilMap.map("queryFilterType, propertyCode, propertyValue", "Eq", "ShortText1758195840127", "K02219"), null, 0, 1, null);
+        System.out.println(JSONObject.toJSONString(result));
+    }
+}