From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 27 五月 2020 09:59:29 +0800
Subject: [PATCH] merage

---
 src/main/java/com/highdatas/mdm/controller/SysFieldController.java |   82 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 74 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/controller/SysFieldController.java b/src/main/java/com/highdatas/mdm/controller/SysFieldController.java
index dea9884..831e32e 100644
--- a/src/main/java/com/highdatas/mdm/controller/SysFieldController.java
+++ b/src/main/java/com/highdatas/mdm/controller/SysFieldController.java
@@ -5,14 +5,15 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.highdatas.mdm.entity.*;
 import com.highdatas.mdm.entity.Character;
+import com.highdatas.mdm.entity.*;
 import com.highdatas.mdm.mapper.SysFieldMapper;
 import com.highdatas.mdm.pojo.ActivitiStatus;
 import com.highdatas.mdm.pojo.CodeMsg;
 import com.highdatas.mdm.pojo.Operate;
 import com.highdatas.mdm.pojo.Result;
 import com.highdatas.mdm.service.*;
+import com.highdatas.mdm.util.AntianaphylaxisClient;
 import com.highdatas.mdm.util.Constant;
 import com.highdatas.mdm.util.DbUtils;
 import com.highdatas.mdm.util.WorkflowUtils;
@@ -31,6 +32,7 @@
  *  鍓嶇鎺у埗鍣�
  * </p>
  *
+ * @description 瀛楁鎺ュ彛
  * @author kimi
  * @since 2019-12-16
  */
@@ -54,15 +56,34 @@
     IFlowsService flowsService;
     @Autowired
     IMasterAuthorService masterAuthorService;
+    @Autowired
+    AntianaphylaxisClient antianaphylaxisClient;
 
+    /**
+     *
+     * @description:  閫氳繃琛ㄥ悕鑾峰彇瀛楁鍒楄〃
+     * @param tableName 琛ㄥ悕
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @RequestMapping(value = "/{tableName}", method = RequestMethod.GET)
     public Result getFields(@PathVariable String tableName, HttpServletRequest request){
+        //璇锋眰澶磋幏鍙栦娇鐢ㄨ�呭寘瑁呯被
         Character character = DbUtils.getCharacter(request);
         String maintainId = request.getParameter("maintainId");
         if (StringUtils.isEmpty(maintainId)) {
+            //閫氳繃琛ㄥ悕鑾峰彇瀛楁鍒楄〃
             List<SysField> fieldList = fieldService.getFieldByTable(tableName);
+            String isDataIO = request.getParameter("isDataIO");
+            if (StringUtils.isEmpty(isDataIO) && !Boolean.valueOf(isDataIO)) {
+
+                return Result.success(fieldList);
+            }
+            //缁欎笂浼犱笅杞戒娇鐢� 缁勫悎濂藉緟鑴辨晱鐨勬暟鎹繑鍥�
+            antianaphylaxisClient.getHelpfulFieldBySysField(fieldList, tableName);
             return Result.success(fieldList);
         }else {
+            //BY 鐗堟湰鑾峰彇瀛楁
             List<SysField> field = masterAuthorService.getField(character, maintainId);
             //List<SysField> fieldList = fieldService.getFieldByMaintain(maintainId);
 
@@ -71,8 +92,17 @@
 
     }
 
+    /**
+     *
+     * @description:  閫氳繃琛ㄥ悕鍒嗛〉鑾峰彇瀛楁鍒楄〃
+     * @param tableName 琛ㄥ悕
+     * @param pageNo 椤垫暟
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @RequestMapping(value = "total/{tableName}/{pageNo}", method = RequestMethod.GET)
     public Result getTotalFields(@PathVariable String tableName,@PathVariable Integer pageNo, HttpServletRequest request){
+        //isTotal 鏄惁璧版潈闄愶紝 pageSize 姣忛〉鏁版嵁鏁�
         String totalStr = request.getParameter("isTotal");
         String pageSize = request.getParameter("pageSize");
 
@@ -82,6 +112,7 @@
             if (StringUtils.isEmpty(maintainId)){
                 return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED);
             }
+            //鑾峰彇鐢ㄦ埛
             TUser user = DbUtils.getUser(request);
             List<SysField> field = masterAuthorService.getField(user, maintainId);
             Integer size;
@@ -94,15 +125,20 @@
             return fieldService.getPagedDataByList(field, pageNo, size);
 
         }
-
+        //鑾峰彇瀛楁鍒楄〃
         if(StringUtils.isEmpty(pageSize)){
             return fieldService.getTotalFields(tableName, pageNo, 15);
         }else  {
             return fieldService.getTotalFields(tableName, pageNo, Integer.valueOf(pageSize));
         }
-
     }
-
+    /**
+     *
+     * @description:  閫氳繃琛ㄥ悕鑾峰彇褰撳墠绯荤粺涓悇绉嶇姸鎬佺殑瀛楁鍒楄〃
+     * @param tableName 琛ㄥ悕
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @RequestMapping(value = "fix/{tableName}", method = RequestMethod.GET)
     public Result fix(@PathVariable String tableName, HttpServletRequest request){
         Result totalFields = fieldService.getTotalFields(tableName);
@@ -111,13 +147,20 @@
         return totalFields;
     }
 
-
+    /**
+     *
+     * @description:  閫氳繃涓婚鑾峰彇瀛楁閲岃緭鍏ヨ〃
+     * @param id 涓婚id
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @RequestMapping(value = "/menu/{id}", method = RequestMethod.GET)
     public Result getFieldByMenu(@PathVariable String id){
         MenuMapping menuMapping = menuMappingService.selectOne(new EntityWrapper<MenuMapping>().eq("menu_id", id));
         if (menuMapping == null) {
             return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED);
         }
+        //閫氳繃涓婚鑾疯幏鍙栬〃鍚�
         String tableName = menuMapping.getTableName();
         if (StringUtils.isEmpty(tableName)) {
             return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED);
@@ -125,7 +168,12 @@
         List<SysField> fieldList = fieldService.getFieldByTable(tableName);
         return Result.success(fieldList);
     }
-
+    /**
+     *
+     * @description:  鏇存柊瀛楁鏁版嵁
+     * @return: 鏇存柊鏄惁鎴愬姛
+     *
+     */
     @RequestMapping(value = "/update", method = RequestMethod.GET)
     public Result update(@RequestParam String json)  {
         try {
@@ -141,7 +189,13 @@
         }
 
     }
-
+    /**
+     *
+     * @description:  鏇存柊鍩虹鍙傛暟
+     * @param id sys_field 鏁版嵁id
+     * @return: 鏄惁鏇存柊瀹屾垚
+     *
+     */
     @RequestMapping(value = "/updateCommon/{id}", method = RequestMethod.GET)
     public Result addOrUpdate(@PathVariable String id, HttpServletRequest request)  {
         //鏇存柊鍩虹鍙傛暟涓嶉渶瑕佸叧鑱旂増鏈�
@@ -149,6 +203,7 @@
         if (sysField == null) {
             return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED);
         }
+        //鍙洿鎺ユ洿鏂扮殑鍙傛暟
         String width = request.getParameter("width");
         String align = request.getParameter("align");
         String orderNoStr = request.getParameter("orderNo");
@@ -194,6 +249,12 @@
         }
     }
 
+    /**
+     *
+     * @description:  涓婁紶鍚庣敓鎴愮殑瀛楁淇濆瓨鍏ュ簱
+     * @return: 鏄惁淇濆瓨鎴愬姛
+     *
+     */
     @RequestMapping(value = "/loadFields", method = RequestMethod.POST)
     public Result loadFields(@RequestBody String fieldListStr, HttpServletRequest request)  {
         log.info(fieldListStr);
@@ -266,7 +327,12 @@
 
         return Result.success(null);
     }
-
+    /**
+     *
+     * @description:  淇敼瀛楁
+     * @return: 淇敼鍚庣殑瀛楁
+     *
+     */
     @RequestMapping(value = "/change", method = RequestMethod.POST)
     public Result addOrUpdate(@RequestBody SysField sysField, HttpServletRequest request)  {
 

--
Gitblit v1.8.0