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/MasterDataController.java |   98 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 87 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/controller/MasterDataController.java b/src/main/java/com/highdatas/mdm/controller/MasterDataController.java
index 5580f37..a821493 100644
--- a/src/main/java/com/highdatas/mdm/controller/MasterDataController.java
+++ b/src/main/java/com/highdatas/mdm/controller/MasterDataController.java
@@ -6,7 +6,10 @@
 import com.highdatas.mdm.entity.Character;
 import com.highdatas.mdm.entity.*;
 import com.highdatas.mdm.mapper.TableInfoMapper;
-import com.highdatas.mdm.pojo.*;
+import com.highdatas.mdm.pojo.CodeMsg;
+import com.highdatas.mdm.pojo.Operate;
+import com.highdatas.mdm.pojo.Result;
+import com.highdatas.mdm.pojo.SysAssembleUpdateType;
 import com.highdatas.mdm.service.*;
 import com.highdatas.mdm.util.Constant;
 import com.highdatas.mdm.util.DbUtils;
@@ -58,6 +61,13 @@
     @Autowired
     NoticeClient noticeClient;
 
+    /**
+     *
+     * @description: 涓婁紶鍚庯紝鍏宠仈鐗堟湰淇℃伅
+     * @param tableName 琛ㄥ悕
+     * @return 鏄惁鍏宠仈鎴愬姛
+     *
+     */
     @RequestMapping(value = "{tableName}/uploaded",  method = RequestMethod.GET)
     public Result get(@PathVariable String tableName, HttpServletRequest request) {
         String uploadTypeStr = request.getParameter("uploadType");
@@ -69,12 +79,12 @@
         }
 
         TUser user = DbUtils.getUser(request);
+        //涓婁紶鏁版嵁鍚庣殑鎿嶄綔锛屽叧鑱旂増鏈�
         Maintain maintain = masterDataService.uploadedData(tableName, uploadType, user.getUserId());
         // 澶勭悊鍏宠仈浜�
         //masterModifiedService.dealAssemble(maintain.getId(), user.getUserId(), true);
         //娣诲姞 std_id 绱㈠紩
         String recordTableName = tableName + Constant.RECORD;
-
         masterDataService.createIdx(recordTableName);
 
         JSONObject object = new JSONObject();
@@ -83,12 +93,26 @@
         return Result.success(object);
     }
 
-
+    /**
+     *
+     * @description: 閫氳繃琛ㄥ悕鍜宨d鑾峰彇鍏蜂綋淇℃伅
+     * @param tableName 琛ㄥ悕
+     * @param id 鏁版嵁id
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "{tableName}/get/{id}",  method = RequestMethod.GET)
     public Result get(@PathVariable String tableName, @PathVariable String id) {
         return masterDataService.selectById(tableName,id);
     }
-
+    /**
+     *
+     * @description: 閫氳繃琛ㄥ悕鍒嗛〉鑾峰彇鏁版嵁
+     * @param tableName 琛ㄥ悕
+     * @param pageNo 椤垫暟
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "{tableName}/all/{pageNo}",  method = RequestMethod.GET)
     public Result getByPage(@PathVariable String tableName, @PathVariable Integer pageNo, HttpServletRequest request) throws UnsupportedEncodingException {
         String uuid = DbUtils.getUUID();
@@ -156,6 +180,13 @@
 
         }
     }
+    /**
+     *
+     * @description: 閫氳繃琛ㄥ悕鑾峰彇鏁版嵁
+     * @param tableName 琛ㄥ悕
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "{tableName}/all",  method = RequestMethod.GET)
     public Result<MenuMapping> getAll(@PathVariable String tableName,HttpServletRequest request) {
         TUser user = DbUtils.getUser(request);
@@ -170,6 +201,14 @@
         return masterDataService.selectList(user, tableName,whereSegment, version);
     }
 
+    /**
+     *
+     * @description: 閫氳繃琛ㄥ悕鍜屾搷浣滅被鍨嬫洿鏂板緟淇敼鏁版嵁
+     * @param maintainId  鏈敓鏁堢殑鐗堟湰id
+     * @param operateStr 鎿嶄綔绫诲瀷
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "{maintainId}/modify/{operateStr}", method = RequestMethod.POST)
     public Result modify(@RequestParam String datas, @PathVariable String maintainId, @PathVariable String operateStr,  @RequestParam String modify, HttpServletRequest request) throws UnsupportedEncodingException {
         Result result = null;
@@ -196,11 +235,9 @@
                 jsonObject.remove(Constant.ID);
                 datas = jsonObject.toJSONString();
                 String updateSegment = masterDataService.getUpdateSegment(maintain.getTableName(), maintain.getTableName() + Constant.RECORD, datas);
-                String tempTable = maintain.getTableName() + Constant.RECORD;
-                Segment segment = new Segment(MessageFormat.format(Constant.Alias, tempTable, Constant.STD_ID), id);
 
-                tableInfoMapper.update(tempTable, updateSegment, segment.toString());
-                result = Result.success(null);
+                Integer updateCount = tableInfoMapper.updateRecordByMaintainId(maintain.getTableName() + Constant.RECORD, updateSegment, DbUtils.quotedStr(maintainId));
+                result = Result.success(updateCount);
                 break;
             case create:
                 JSONObject createObject = JSONObject.parseObject(datas);
@@ -232,7 +269,14 @@
         return result;
     }
 
-
+    /**
+     *
+     * @description:  淇敼涓�鏉℃暟鎹紝 渚涘湪绾跨紪杈戜娇鐢�
+     * @param tableName 琛ㄥ悕
+     * @param operateStr 鎿嶄綔绫诲瀷
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "{tableName}/{operateStr}", method = RequestMethod.POST)
     @Transactional(rollbackFor = {RuntimeException.class, Error.class})
     public Result insert(@PathVariable String tableName,@PathVariable String operateStr, @RequestParam String datas, @RequestParam String modify, HttpServletRequest request) {
@@ -348,6 +392,15 @@
         return result;
 
     }
+
+    /**
+     *
+     * @description: 鐩存帴鏇存柊涓�鏉℃暟鎹�
+     * @param tableName 琛ㄥ悕
+     * @param id 鏁版嵁id
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "update/{id}", method = RequestMethod.POST)
     public Result updateById(@PathVariable String tableName,@RequestParam String datas, @PathVariable String id, HttpServletRequest request)  {
         String totalStr = request.getParameter(Constant.TOTAL);
@@ -373,14 +426,29 @@
         }
 
     }
-
+    /**
+     *
+     * @description: 鐩存帴鍒犻櫎涓�鏉℃暟鎹�
+     * @param tableName 琛ㄥ悕
+     * @param id 鏁版嵁id
+     * @return 鍒犻櫎缁撴灉
+     *
+     */
     @RequestMapping(value = "delete/{id}", method = RequestMethod.GET)
     public Result deleteById(@PathVariable String tableName, @PathVariable String id) {
        return masterDataService.deleteById(tableName,id);
     }
 
+    /**
+     *
+     * @description: 閫氳繃绛涢�夋潯浠跺垹闄ゆ暟鎹�
+     * @param tableName 琛ㄥ悕
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "delete", method = RequestMethod.GET)
     public Result delete(@PathVariable String tableName, HttpServletRequest request) {
+        //whereSegment 绛涢�夋潯浠�
         String whereSegment = request.getParameter(Constant.WHERE_SEGMENT);
         if (StringUtils.isEmpty(whereSegment)) {
             return masterDataService.delete(tableName);
@@ -388,7 +456,15 @@
             return masterDataService.delete(tableName, whereSegment);
         }
     }
-
+    /**
+     *
+     * @description: 閫氳繃瀛楁鐗堟湰鑾峰彇鏌愪釜瀛楁鐨勬墍鏈夌殑鏁版嵁
+     * @param maintainFieldId 瀛楁鐗堟湰
+     * @param menuId 涓婚id
+     * @param field 瀛楁
+     * @return 鍏蜂綋鏁版嵁
+     *
+     */
     @RequestMapping(value = "/getValByMaintainFieldId/{maintainFieldId}", method = RequestMethod.GET)
     public Result getValByMaintainFieldId(@PathVariable String maintainFieldId,@RequestParam String menuId, @RequestParam String field, HttpServletRequest request) {
         String tableName = menuMappingService.getTableNameByMenu(menuId);

--
Gitblit v1.8.0