Index: clientservice/src/main/java/com/freshport/control/ClientService.java
===================================================================
--- clientservice/src/main/java/com/freshport/control/ClientService.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/control/ClientService.java	(revision 28514)
@@ -8,10 +8,13 @@
 import java.net.URL;
 import java.util.HashMap;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.freshport.util.CommonInfo;
 import com.freshport.util.HttpUtil;
 
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
 public class ClientService {
 
     private static final String LOGIN_URL = "https://gateway.bilinl.com/thirdparty";
@@ -18,19 +21,25 @@
 
     private static final String API_URL = "https://gateway.bilinl.com/business";
 
+    private static final String GENMERETOKEN = "/user/genMercToken";
+
+    private static final String REFRESHTOKEN = "/user/refreshToken?refreshToken=";
+
+    private static final String WXGROUP_LIST = "/wxGroup/list";
+
     private static final HashMap<String, String> CacheMap = new HashMap<String, String>();
 
     public static String getToken() {
-        String url = LOGIN_URL + "/user/genMercToken";
+        String url = LOGIN_URL + GENMERETOKEN;
         JSONObject obj = new JSONObject();
-        obj.put("username", "18930185236");
-        obj.put("password", "I8023zxj");
+        obj.put("username", CommonInfo.CS_TOKEN_NAME);
+        obj.put("password", CommonInfo.CS_TOKEN_PD);
         try {
             String result = HttpUtil.postJson(url, obj);
             JSONObject reObj = JSONObject.parseObject(result);
-            System.out.println(result);
+            log.info("getToken==result=:" + result);
             String token = reObj.getJSONObject("data").getString("value");
-            System.out.println(token);
+            log.info("==ClientService==token=：" + token);
             CacheMap.put("token", token);
             return token;
         } catch (IOException e) {
@@ -40,12 +49,12 @@
     }
 
     public static String refreshToken() {
-        String url = LOGIN_URL + "/user/refreshToken?refreshToken=" + CacheMap.get("token");
+        String url = LOGIN_URL + REFRESHTOKEN + CacheMap.get("token");
         try {
             String result = HttpUtil.get(url);
             JSONObject reObj = JSONObject.parseObject(result);
             String token = reObj.getJSONObject("data").getString("value");
-            System.out.println("new token:" + token);
+            log.info("new token:" + token);
             return token;
         } catch (Exception e) {
             e.printStackTrace();
@@ -55,16 +64,18 @@
     }
 
     public static String getGroupInfo() {
-        String url = API_URL + "/wxGroup/list";
+        String url = API_URL + WXGROUP_LIST;
         JSONObject obj = new JSONObject();
-        obj.put("isExpired", 0);
-        obj.put("groupType", "1");
-        obj.put("limit", 99999999);
-        obj.put("page", 1);
+        obj.put("isExpired", CommonInfo.IS_EXPIRED_NO);
+        obj.put("groupType", CommonInfo.GROUP_TYPE_PRIVATE);
+        obj.put("limit", CommonInfo.PAGE_LIMIT);
+        obj.put("page", CommonInfo.PAGE_START);
+
+        HttpURLConnection con = null;
+        DataOutputStream osw = null;
+        BufferedReader br = null;
         try {
             URL u;
-            HttpURLConnection con;
-            DataOutputStream osw;
             StringBuffer buffer = new StringBuffer();
             u = new URL(url);
             con = (HttpURLConnection) u.openConnection();
@@ -80,30 +91,50 @@
             osw.writeBytes(obj.toString());
             osw.flush();
             osw.close();
-            BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+            br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
             String temp;
             while ((temp = br.readLine()) != null) {
                 buffer.append(temp);
             }
+            br.close();
             return buffer.toString();
         } catch (Exception e) {
             e.printStackTrace();
+        } finally {
+            if (br != null) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (osw != null) {
+                try {
+                    osw.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (con != null) {
+                con.disconnect();
+            }
         }
         return null;
     }
 
     public static String getGroupInfoByGoupId(String groupId, String groupType) {
-        String url = API_URL + "/wxGroup/list";
+        String url = API_URL + WXGROUP_LIST;
         JSONObject obj = new JSONObject();
-        obj.put("isExpired", 0);
+        obj.put("isExpired", CommonInfo.IS_EXPIRED_NO);
         obj.put("groupType", groupType);// 1-个人群组，2-企业微信群
-        obj.put("limit", 99999999);
-        obj.put("page", 1);
+        obj.put("limit", CommonInfo.PAGE_LIMIT);
+        obj.put("page", CommonInfo.PAGE_START);
         obj.put("vcGroupId", groupId);
         HttpURLConnection con = null;
+        DataOutputStream osw = null;
+        BufferedReader br = null;
         try {
             URL u;
-            DataOutputStream osw;
             StringBuffer buffer = new StringBuffer();
             u = new URL(url);
             con = (HttpURLConnection) u.openConnection();
@@ -119,7 +150,7 @@
             osw.writeBytes(obj.toString());
             osw.flush();
             osw.close();
-            BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+            br = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
             String temp;
             while ((temp = br.readLine()) != null) {
                 buffer.append(temp);
@@ -128,6 +159,20 @@
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
+            if (br != null) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (osw != null) {
+                try {
+                    osw.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
             if (con != null) {
                 con.disconnect();
             }
@@ -137,11 +182,12 @@
 
     public static void main(String[] args) {
         // getToken();
-        String groupInfo = getGroupInfoByGoupId("245D9EACE9127C21C4F87F752C97D0A2", "1");
-        System.out.println(groupInfo);
-        JSONObject main = JSONObject.parseObject(groupInfo);
-        JSONArray records = main.getJSONObject("data").getJSONArray("records");
-        System.out.println(JSONObject.toJSONString(records));
+        // String groupInfo =
+        // getGroupInfoByGoupId("245D9EACE9127C21C4F87F752C97D0A2", "1");
+        // JSONObject main = JSONObject.parseObject(groupInfo);
+        // JSONArray records =
+        // main.getJSONObject("data").getJSONArray("records");
+        // log.info(JSONObject.toJSONString(records));
 
     }
 }

Index: clientservice/src/main/java/com/freshport/control/ClientServiceAESDencrypt.java
===================================================================
--- clientservice/src/main/java/com/freshport/control/ClientServiceAESDencrypt.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/control/ClientServiceAESDencrypt.java	(revision 28514)
@@ -6,6 +6,9 @@
 
 import org.apache.commons.codec.binary.Base64;
 
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
 public class ClientServiceAESDencrypt {
 
     public static String KEY = "039FC97E2458A-BC61E34D-C7B8-4106-BA56-F6DE9F3A3D08";
@@ -23,9 +26,7 @@
             byte[] encrypted1 = new Base64().decode(data);
             Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
             String key = KEY.substring(0, 32);
-            // System.out.println(key);
             String iv = IV_PARAMETER.substring(0, 16);
-            // System.out.println(iv);
             SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), ALGORITHM);
             IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes());
             cipher.init(Cipher.DECRYPT_MODE, keyspec, ivspec);
@@ -40,41 +41,23 @@
 
     public static void main(String[] args) {
         try {
+            // rd=tOoNOMLhk94rJeG3v3seDfT2ACAo7SYj0jZngZHlfhKUr7543i9mLY0h9Ib8ucadWU51Ypu%2BKFhCiQVvsRE0eVFm7kd6F0HSei9MAYqQLxE=
+            // &qd=G2ilJDltwj%2BVa4/KIqF/uo5UqJQb5aYTqEnUFsFJFLJHNP2PcQEWpCRF0j5oGyyN8H5bD7PmaAlMWTSx3rIRZ3K%2BkqiADE9JGmJxoi4OSE4=
+            // &uid=1412941371469631488
+            // &un=5xHmNTJeIUeA3S2AK7RJlQ==
+            // &mid=1380363339585216512
 //            String rd = "tOoNOMLhk94rJeG3v3seDfT2ACAo7SYj0jZngZHlfhKUr7543i9mLY0h9Ib8ucadWU51Ypu+KFhCiQVvsRE0eVFm7kd6F0HSei9MAYqQLxE=";
 //            String qd = "LHIuVQDiPwEuxNUdjtx2W0KPoxpJjGtbWFfhh5OeZedrKPW8gMeSG9oxx3d/SM94";
+//            String qd1 = "G2ilJDltwj+Va4/KIqF/uo5UqJQb5aYTqEnUFsFJFLJHNP2PcQEWpCRF0j5oGyyN8H5bD7PmaAlMWTSx3rIRZ3K+kqiADE9JGmJxoi4OSE4=";
 //            String uid = "1412941371469631488";
 //            String un = "5xHmNTJeIUeA3S2AK7RJlQ==";
 //            String mid = "1380363339585216512";
-//            System.out.println("==rd=" + decrypt(rd));
-//            System.out.println("==qd=" + decrypt(qd));
-//            System.out.println("==uid=" + uid);
-//            System.out.println("==un=" + decrypt(un));
-//            System.out.println("==mid=" + mid);
-            // 俊杰
-            // String rd1 =
-            // "K+PcaqjzgZctnFII0sFLlCYXO/enoX8obeHdStmJ0DMz7RNgPrDdtwKpuQ0sLYy2";
-            // String qd1 =
-            // "zfj6372+LFKeXuBcCdGnL/3fZtr0Iy//dWcNjwexMtQGkyyqEaW2Wl+UrPNInTva";
-            // String uid1 = "1412941371469631488";
-            // String un1 = "5xHmNTJeIUeA3S2AK7RJlQ==";
-            // String mid1 = "1380363339585216512";
-
-            // System.out.println("==rd1=" + decrypt(rd1));
-            // System.out.println("==qd1=" + decrypt(qd1));
-            // 芬
-            // String rd =
-            // "K+PcaqjzgZctnFII0sFLlCYXO/enoX8obeHdStmJ0DMz7RNgPrDdtwKpuQ0sLYy2";
-            // String qd =
-            // "263uNc3+ZJxuJuUgLycR5k1aGc1ZpPnX4jO2c4PA+JwJ3ITYtdiNyMuhhRzz/MXF";
-            // String uid = "1412941371469631488";
-            // String un = "5xHmNTJeIUeA3S2AK7RJlQ==";
-            // String mid = "1380363339585216512";
-            // System.out.println("==rd=" + decrypt(rd));
-            // System.out.println("==qd=" + decrypt(qd));
-            // System.out.println("==uid=" + uid);
-            // System.out.println("==un=" + decrypt(un));
-            // System.out.println("==mid=" + mid);
-
+//            log.info("==rd=" + decrypt(rd));
+//            log.info("==qd=" + decrypt(qd));
+//            log.info("==qd1=" + decrypt(qd1));
+//            log.info("==uid=" + uid);
+//            log.info("==un=" + decrypt(un));
+//            log.info("==mid=" + mid);
         } catch (Exception e) {
             e.printStackTrace();
         }

Index: clientservice/src/main/java/com/freshport/control/CustomErrorController.java
===================================================================
--- clientservice/src/main/java/com/freshport/control/CustomErrorController.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/control/CustomErrorController.java	(revision 28514)
@@ -30,11 +30,21 @@
 @RequestMapping("/error")
 public class CustomErrorController implements ErrorController {
 
+    /**
+     * 处理contoller的error异常
+     */
     @Override
     public String getErrorPath() {
         return "page/common/error";
     }
 
+    /**
+     * error(系统调用接口) 
+     * @return String
+     * @author wsh
+     * @date 2021年10月9日 上午11:04:00
+     * @Exception 异常对象
+     */
     @RequestMapping
     public String error() {
         return getErrorPath();

Index: clientservice/src/main/java/com/freshport/control/DataController.java
===================================================================
--- clientservice/src/main/java/com/freshport/control/DataController.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/control/DataController.java	(revision 28514)
@@ -4,7 +4,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -24,12 +23,15 @@
 import com.freshport.entity.CsBaseTitleItem;
 import com.freshport.entity.CsGroup;
 import com.freshport.entity.CsGroupRemark;
+import com.freshport.entity.CsOpLog;
 import com.freshport.entity.JsonModel;
+import com.freshport.entity.ReturnModel;
 import com.freshport.entity.vo.BaseTitleItemVo;
 import com.freshport.entity.vo.BaseTitleVo;
 import com.freshport.entity.vo.GroupRemarkVo;
 import com.freshport.entity.vo.TitleContextSave;
 import com.freshport.service.BaseTitleService;
+import com.freshport.service.CsOpLogService;
 import com.freshport.service.GroupRemarkService;
 import com.freshport.service.GroupService;
 import com.freshport.util.CommonEnum;
@@ -64,35 +66,35 @@
     @Resource
     private BaseTitleService baseTitleService;
 
+    @Resource
+    private CsOpLogService csOpLogService;
+
     @GetMapping("/api/v1/showGroupInfo")
     public String sidebarNew(HttpServletRequest request) throws Exception {
         String qd = request.getParameter("qd");
         String un = request.getParameter("un");
-        // qd =
-        // "263uNc3+ZJxuJuUgLycR5k1aGc1ZpPnX4jO2c4PA+JwJ3ITYtdiNyMuhhRzz/MXF";//
-        // // 本地测试
-        // un = "5xHmNTJeIUeA3S2AK7RJlQ==";
         if (CommonUtils.isEmpty(qd)) {
-            request.setAttribute("tipsMessager", "没有群组信息");
-            return "page/common/tipmsg";
+            return returnPage(request, CommonInfo.PARAM_QD_EMPTY);
         }
+        if (CommonUtils.isEmpty(un)) {
+            return returnPage(request, CommonInfo.PARAM_UN_EMPTY);
+        }
         try {
             String groupId = ClientServiceAESDencrypt.decrypt(qd);
-            if (!CommonUtils.isEmpty(groupId)) {
-                CsGroup g = groupService.queryGroupByGroupId(groupId);
-                if (CommonUtils.isEmpty(g)) {
-                    CsGroup sg = CreateAndUpdateGroup(groupId);
-                    if (CommonUtils.isEmpty(sg)) {
-                        request.setAttribute("tipsMessager", "没有群组信息");
-                        return "page/common/tipmsg";
-                    }
+            if (CommonUtils.isEmpty(groupId)) {
+                return returnPage(request, CommonInfo.GROUPID_NULL);
+            }
+            CsGroup g = groupService.queryGroupByGroupId(groupId);
+            if (CommonUtils.isEmpty(g)) {
+                CsGroup sg = CreateAndUpdateGroup(groupId);
+                if (CommonUtils.isEmpty(sg)) {
+                    return returnPage(request, CommonInfo.GROUPID_NULL);
                 }
-            } else {
-                request.setAttribute("tipsMessager", "没有群组信息");
-                return "page/common/tipmsg";
             }
         } catch (Exception e) {
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
+            return returnPage(request, e.getMessage());
         }
         request.setAttribute("un", un);
         request.setAttribute("qd", qd);
@@ -99,12 +101,21 @@
         return "page/sidebarNew";
     }
 
+    private String returnPage(HttpServletRequest request, String messager) {
+        request.setAttribute("tipsMessager", messager);
+        return "page/common/tipmsg";
+    }
+
     @RequestMapping("/api/v1/customer")
     public String customer(HttpServletRequest request) {
         String qd = request.getParameter("qd");
-        request.setAttribute("qd", qd);
         String un = request.getParameter("un");
-        request.setAttribute("un", un);
+        if (CommonUtils.isEmpty(qd)) {
+            return returnPage(request, CommonInfo.PARAM_QD_EMPTY);
+        }
+        if (CommonUtils.isEmpty(un)) {
+            return returnPage(request, CommonInfo.PARAM_UN_EMPTY);
+        }
         try {
             String groupId = ClientServiceAESDencrypt.decrypt(qd);
             CsGroup g = groupService.queryGroupByGroupId(groupId);
@@ -122,8 +133,12 @@
             }
             request.setAttribute("groupRemark", groupRemark);
             request.setAttribute("btVList", btVList);
+            request.setAttribute("qd", qd);
+            request.setAttribute("un", un);
         } catch (Exception e) {// 其他异常
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
+            return returnPage(request, e.getMessage());
         }
         return "page/customer";
     }
@@ -134,33 +149,8 @@
      * @return String
      * @author wsh
      */
-    @Deprecated
     @RequestMapping("/api/v1/business")
     public String business(HttpServletRequest request) {
-        // String qd = request.getParameter("qd");
-        // request.setAttribute("qd", qd);
-        // String un = request.getParameter("un");
-        // request.setAttribute("un", un);
-        // try {
-        // String groupId = ClientServiceAESDencrypt.decrypt(qd);
-        // CsGroup g = groupService.queryGroupByGroupId(groupId);
-        // CsGroupRemark groupRemark = new CsGroupRemark();
-        // List<BaseTitleVo> btVList = new ArrayList<BaseTitleVo>();
-        // if (!CommonUtils.isEmpty(g)) {
-        // groupRemark = groupRemarkService.queryGroupRemarkByGroupId(groupId);
-        // if (CommonUtils.isEmpty(groupRemark)) {
-        // groupRemark = new CsGroupRemark();
-        // groupRemark.setGroupId(groupId);
-        // groupRemark.setGroupName(g.getGroupName());
-        // groupRemark.setCgId(g.getId());
-        // }
-        // btVList = baseTitleService.queryBaseTitleListByGroupId(groupId);
-        // }
-        // request.setAttribute("groupRemark", groupRemark);
-        // request.setAttribute("btVList", btVList);
-        // } catch (Exception e) {// 其他异常
-        // e.printStackTrace();
-        // }
         return "page/business";
     }
 
@@ -200,16 +190,24 @@
             model.setDes(CommonEnum.PARAM_ERROR.getRes());
             return model;
         }
+        if (CommonUtils.isEmpty(grv.getUn())) {
+            model.setCode(CommonEnum.PARAM_ERROR.getCode());
+            model.setDes(CommonEnum.PARAM_ERROR.getRes());
+            return model;
+        }
         try {
             String userName = ClientServiceAESDencrypt.decrypt(grv.getUn());
-            groupRemarkService.updateRemark(grv.getGroupId(), grv.getRemark(), userName);
+            CsOpLog op = groupRemarkService.updateRemark(grv.getGroupId(), grv.getRemark(), userName);
+            if (!CommonUtils.isEmpty(op)) {
+                csOpLogService.insertCsOpLog(op);
+            }
             model.setCode(CommonEnum.API_SUCCESS.getCode());
             model.setDes(CommonEnum.API_SUCCESS.getRes());
         } catch (Exception e) {
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
             model.setCode(CommonEnum.API_ERROR.getCode());
             model.setDes(CommonEnum.API_ERROR.getRes());
-
         }
         return model;
     }
@@ -242,14 +240,23 @@
      */
     @RequestMapping("/api/v1/queryCustomerlist")
     @ResponseBody
-    public Map<String, Object> queryCustomerlist(HttpServletRequest request, HttpServletResponse response) {
+    public ReturnModel<BaseTitleVo> queryCustomerlist(HttpServletRequest request, HttpServletResponse response) {
+        ReturnModel<BaseTitleVo> rm = null;
+        List<BaseTitleVo> btvList = new ArrayList<BaseTitleVo>();
         String groupId = request.getParameter("groupId");
         String groupName = request.getParameter("groupName");
         String maintainStatus = request.getParameter("maintainStatus");
         String pages = request.getParameter("page");
         String rows = request.getParameter("rows");
-        pageIndex = Integer.parseInt(pages);
-        pageSize = Integer.parseInt(rows);
+        if (CommonUtils.isEmpty(pages) || CommonUtils.isEmpty(rows)) {
+            rm = ReturnModel.paramError(btvList, CommonInfo.PAGE_OR_ROWS_NULL);
+            return rm;
+        }
+        if (!CommonUtils.matchInteger(pages) || !CommonUtils.matchInteger(rows)) {
+            rm = ReturnModel.paramError(btvList, CommonInfo.PAGE_OR_ROWS_ERROR);
+            return rm;
+        }
+        // 组装查询数据
         Map<String, Object> quaryParams = new HashMap<String, Object>();
         if (!StringUtils.isEmpty(maintainStatus)) {
             quaryParams.put("maintainStatus", maintainStatus);
@@ -260,18 +267,25 @@
         if (!StringUtils.isEmpty(groupId)) {
             quaryParams.put("groupId", groupId);
         }
-        // 获取总数量
-        Map<String, Object> totalMap = baseTitleService.queryBaseTitleCountByMap(quaryParams);
-        total = Integer.parseInt(totalMap.get("count").toString());
 
-        quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
-        quaryParams.put("pageSize", pageSize);
-        List<BaseTitleVo> btvList = baseTitleService.queryBaseTitleListPage(quaryParams);
-
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("rows", btvList);
-        map.put("total", total);
-        return map;
+        try {
+            pageIndex = Integer.parseInt(pages);
+            pageSize = Integer.parseInt(rows);
+            // 获取总数量
+            Map<String, Object> totalMap = baseTitleService.queryBaseTitleCountByMap(quaryParams);
+            total = Integer.parseInt(totalMap.get("count").toString());
+            if (total != 0) {
+                quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
+                quaryParams.put("pageSize", pageSize);
+                btvList = baseTitleService.queryBaseTitleListPage(quaryParams);
+            }
+            rm = ReturnModel.success(btvList, total);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
+            rm = ReturnModel.apiError(btvList);
+        }
+        return rm;
     }
 
     /**
@@ -294,13 +308,24 @@
                 return model;
             }
             String un = request.getParameter("un");
+            if (CommonUtils.isEmpty(un)) {
+                model.setCode(CommonEnum.PARAM_ERROR.getCode());
+                model.setDes(CommonEnum.PARAM_ERROR.getRes());
+                return model;
+            }
             String userName = ClientServiceAESDencrypt.decrypt(un);
             // 删除运单信息
-            baseTitleService.customerDelete(selectedIDs, userName);
-            model.setCode(CommonEnum.API_SUCCESS.getCode());
-            model.setDes(CommonEnum.API_SUCCESS.getRes());
+            Map<String, String> resultMap = baseTitleService.customerDelete(selectedIDs, userName);
+            if (CommonEnum.API_ERROR.getCode().equals(resultMap.get("code"))) {
+                model.setCode(CommonEnum.API_SUCCESS.getCode());
+                model.setDes(resultMap.get("res"));
+            } else {
+                model.setCode(CommonEnum.API_SUCCESS.getCode());
+                model.setDes(resultMap.get("res"));
+            }
         } catch (Exception e) {
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
             model.setCode(CommonEnum.API_ERROR.getCode());
             model.setDes(CommonEnum.API_ERROR.getRes());
         }
@@ -369,15 +394,28 @@
      */
     @RequestMapping("/api/v1/queryTitleTypeList")
     @ResponseBody
-    public Map<String, Object> queryTitleTypeList(HttpServletRequest request) {
+    public ReturnModel<BaseTitleVo> queryTitleTypeList(HttpServletRequest request) {
+        ReturnModel<BaseTitleVo> rm = null;
+        List<BaseTitleVo> btvList = new ArrayList<BaseTitleVo>();
         String groupId = request.getParameter("groupId");
         String groupName = request.getParameter("groupName");
         String pages = request.getParameter("page");
         String rows = request.getParameter("rows");
-        pageIndex = Integer.parseInt(pages);
-        pageSize = Integer.parseInt(rows);
+        // 校验
+        if (CommonUtils.isEmpty(groupId)) {
+            rm = ReturnModel.paramError(btvList, CommonInfo.GROUPID_NULL);
+            return rm;
+        }
+        if (CommonUtils.isEmpty(pages) || CommonUtils.isEmpty(rows)) {
+            rm = ReturnModel.paramError(btvList, CommonInfo.PAGE_OR_ROWS_NULL);
+            return rm;
+        }
+        if (!CommonUtils.matchInteger(pages) || !CommonUtils.matchInteger(rows)) {
+            rm = ReturnModel.paramError(btvList, CommonInfo.PAGE_OR_ROWS_ERROR);
+            return rm;
+        }
+        // 组装查询数据
         Map<String, Object> quaryParams = new HashMap<String, Object>();
-        List<BaseTitleVo> btvList = new ArrayList<BaseTitleVo>();
         if (!StringUtils.isEmpty(groupName)) {
             quaryParams.put("groupName", groupName);
         }
@@ -384,19 +422,25 @@
         if (!StringUtils.isEmpty(groupId)) {
             quaryParams.put("groupId", groupId);
         }
-        // 判断groupId 是否维护画像类型，如果维护则查询，如果没有维护则默认新增
-        // 获取总数量
-        Map<String, Object> totalMap = baseTitleService.queryTitleTypeCountByMap(quaryParams);
-        total = Integer.parseInt(totalMap.get("count").toString());
-        // 分页获取列表
-        quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
-        quaryParams.put("pageSize", pageSize);
-        btvList = baseTitleService.queryTitleTypeListPage(quaryParams);
-
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("rows", btvList);
-        map.put("total", total);
-        return map;
+        try {
+            pageIndex = Integer.parseInt(pages);
+            pageSize = Integer.parseInt(rows);
+            // 获取总数量
+            Map<String, Object> totalMap = baseTitleService.queryTitleTypeCountByMap(quaryParams);
+            total = Integer.parseInt(totalMap.get("count").toString());
+            if (total != 0) {
+                // 分页获取列表
+                quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
+                quaryParams.put("pageSize", pageSize);
+                btvList = baseTitleService.queryTitleTypeListPage(quaryParams);
+            }
+            rm = ReturnModel.success(btvList, total);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
+            rm = ReturnModel.apiError(btvList);
+        }
+        return rm;
     }
 
     /**
@@ -412,19 +456,30 @@
     @ResponseBody
     public JsonModel saveTitleTypeData(HttpServletRequest request, @RequestBody TitleContextSave<CsBaseTitle> tcSave) {
         JsonModel model = new JsonModel();
-        if (CommonUtils.isEmpty(tcSave)) {
+        if (CommonUtils.isEmpty(tcSave.getId())) {
             model.setCode(CommonEnum.PARAM_ERROR.getCode());
             model.setDes(CommonEnum.PARAM_ERROR.getRes());
             return model;
         }
+        if (CommonUtils.isEmpty(tcSave.getUn())) {
+            model.setCode(CommonEnum.PARAM_ERROR.getCode());
+            model.setDes(CommonEnum.PARAM_ERROR.getRes());
+            return model;
+        }
+        if (CommonUtils.isEmpty(tcSave.getDataList())) {
+            model.setCode(CommonEnum.PARAM_ERROR.getCode());
+            model.setDes(CommonEnum.PARAM_ERROR.getRes());
+            return model;
+        }
         try {
             baseTitleService.saveTitleTypeData(tcSave);
             model.setCode(CommonEnum.API_SUCCESS.getCode());
-            model.setDes("保存成功");
+            model.setDes(CommonEnum.API_SUCCESS.getRes());
         } catch (Exception e) {
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
             model.setCode(CommonEnum.API_ERROR.getCode());
-            model.setDes(CommonEnum.API_ERROR.getRes() + e.getMessage());
+            model.setDes(CommonEnum.API_ERROR.getRes());
         }
         return model;
     }
@@ -443,17 +498,28 @@
     public JsonModel saveTitleContextData(HttpServletRequest request,
             @RequestBody TitleContextSave<CsBaseTitleItem> tcSave) {
         JsonModel model = new JsonModel();
-        if (CommonUtils.isEmpty(tcSave)) {
+        if (CommonUtils.isEmpty(tcSave.getId())) {
             model.setCode(CommonEnum.PARAM_ERROR.getCode());
             model.setDes(CommonEnum.PARAM_ERROR.getRes());
             return model;
         }
+        if (CommonUtils.isEmpty(tcSave.getUn())) {
+            model.setCode(CommonEnum.PARAM_ERROR.getCode());
+            model.setDes(CommonEnum.PARAM_ERROR.getRes());
+            return model;
+        }
+        if (CommonUtils.isEmpty(tcSave.getDataList())) {
+            model.setCode(CommonEnum.PARAM_ERROR.getCode());
+            model.setDes(CommonEnum.PARAM_ERROR.getRes());
+            return model;
+        }
         try {
             baseTitleService.saveTitleConextData(tcSave);
             model.setCode(CommonEnum.API_SUCCESS.getCode());
-            model.setDes("保存成功");
+            model.setDes(CommonEnum.API_SUCCESS.getRes());
         } catch (Exception e) {
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
             model.setCode(CommonEnum.API_ERROR.getCode());
             model.setDes(CommonEnum.API_ERROR.getRes());
         }
@@ -470,28 +536,45 @@
      */
     @RequestMapping("/api/v1/queryTitleItemList")
     @ResponseBody
-    public Map<String, Object> queryTitleItemList(HttpServletRequest request) {
+    public ReturnModel<BaseTitleItemVo> queryTitleItemList(HttpServletRequest request) {
+        ReturnModel<BaseTitleItemVo> rm = null;
+        List<BaseTitleItemVo> btivList = new ArrayList<BaseTitleItemVo>();
         String tId = request.getParameter("tId");
         String pages = request.getParameter("page");
         String rows = request.getParameter("rows");
-        pageIndex = Integer.parseInt(pages);
-        pageSize = Integer.parseInt(rows);
-        Map<String, Object> quaryParams = new HashMap<String, Object>();
-        List<BaseTitleItemVo> btvList = new ArrayList<BaseTitleItemVo>();
-        if (!StringUtils.isEmpty(tId)) {
+        // 校验
+        if (CommonUtils.isEmpty(tId)) {
+            rm = ReturnModel.paramError(btivList, CommonInfo.TID_NULL);
+            return rm;
+        }
+        if (CommonUtils.isEmpty(pages) || CommonUtils.isEmpty(rows)) {
+            rm = ReturnModel.paramError(btivList, CommonInfo.PAGE_OR_ROWS_NULL);
+            return rm;
+        }
+        if (!CommonUtils.matchInteger(pages) || !CommonUtils.matchInteger(rows)) {
+            rm = ReturnModel.paramError(btivList, CommonInfo.PAGE_OR_ROWS_ERROR);
+            return rm;
+        }
+        try {
+            pageIndex = Integer.parseInt(pages);
+            pageSize = Integer.parseInt(rows);
+            Map<String, Object> quaryParams = new HashMap<String, Object>();
             quaryParams.put("tId", tId);
             // 获取总数量
             Map<String, Object> totalMap = baseTitleService.queryTitleItemCountByMap(quaryParams);
             total = Integer.parseInt(totalMap.get("count").toString());
-            quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
-            quaryParams.put("pageSize", pageSize);
-            btvList = baseTitleService.queryTitleItemListPage(quaryParams);
+            if (total != 0) {
+                quaryParams.put("pageStartNum", (pageIndex - 1) * pageSize);
+                quaryParams.put("pageSize", pageSize);
+                btivList = baseTitleService.queryTitleItemListPage(quaryParams);
+            }
+            rm = ReturnModel.success(btivList, total);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
+            rm = ReturnModel.apiError(btivList);
         }
-
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("rows", btvList);
-        map.put("total", total);
-        return map;
+        return rm;
     }
 
     /**
@@ -505,37 +588,40 @@
     private CsGroup CreateAndUpdateGroup(String rqGroupId) {
         // 查询数据
         ClientService.getToken();
-        String result = ClientService.getGroupInfoByGoupId(rqGroupId, "1");
+        // 查询个人群组
+        String result = ClientService.getGroupInfoByGoupId(rqGroupId, CommonInfo.GROUP_TYPE_PRIVATE);
         // 组装数据
         JSONObject main = JSONObject.parseObject(result);
         JSONArray records = main.getJSONObject("data").getJSONArray("records");
         if (records.size() == 0) {
-            result = ClientService.getGroupInfoByGoupId(rqGroupId, "2");
+            // 查询企业群组
+            result = ClientService.getGroupInfoByGoupId(rqGroupId, CommonInfo.GROUP_TYPE_ENTERPRISE);
             // 组装数据
             main = JSONObject.parseObject(result);
             records = main.getJSONObject("data").getJSONArray("records");
         }
+        CsGroup sg = null;
         List<CsGroup> groups = new ArrayList<CsGroup>();
-        CsGroup sg = null;
         if (records.size() > 0) {
-            for (int i = 0; i < records.size(); i++) {
-                JSONObject record = records.getJSONObject(i);
-                String groupId = record.getString("vcGroupId");
-                String groupName = record.getString("vcGroupName");
-                String enterpriseChatRoom = record.getString("enterpriseChatRoom");
-                CsGroup g = new CsGroup(UUID.randomUUID().toString(), groupId, groupName, enterpriseChatRoom);
-                if (rqGroupId.equals(groupId)) {
-                    sg = g;
-                }
-                groups.add(g);
+            groups = JSONObject.parseArray(records.toString(), CsGroup.class);
+            if (!CommonUtils.isEmpty(groups)) {
+                sg = groups.stream().filter(g -> g.getGroupId().equals(rqGroupId)).findAny().get();
             }
-            if (!CommonUtils.isEmpty(groups) && groups.size() > 0) {
-                groupService.saveGroup(groups);
-            }
         }
+        if (!CommonUtils.isEmpty(groups) && groups.size() > 0) {
+            groupService.saveGroup(groups);
+        }
         return sg;
     }
 
+    /**
+     * getGroupInfo(获取客服系统的群组信息，并保存) 
+     * @param request
+     * @return JsonModel
+     * @author wsh
+     * @date 2021年10月9日 下午2:34:08
+     * @Exception 异常对象
+     */
     @GetMapping("/api/v1/getGroupInfo")
     public JsonModel getGroupInfo(HttpServletRequest request) {
         JsonModel model = new JsonModel();
@@ -547,76 +633,20 @@
             JSONObject main = JSONObject.parseObject(result);
             JSONArray records = main.getJSONObject("data").getJSONArray("records");
             List<CsGroup> groups = new ArrayList<CsGroup>();
-            for (int i = 0; i < records.size(); i++) {
-                JSONObject record = records.getJSONObject(i);
-                String groupId = record.getString("vcGroupId");
-                String groupName = record.getString("vcGroupName");
-                String enterpriseChatRoom = record.getString("enterpriseChatRoom");
-                CsGroup g = new CsGroup(UUID.randomUUID().toString(), groupId, groupName, enterpriseChatRoom);
-                groups.add(g);
+            if (records.size() > 0) {
+                groups = JSONObject.parseArray(records.toString(), CsGroup.class);
+                if (!CommonUtils.isEmpty(groups) && groups.size() > 0) {
+                    groupService.saveGroup(groups);
+                }
             }
-            groupService.saveGroup(groups);
             model.setCode(CommonEnum.API_SUCCESS.getCode());
             model.setDes(CommonEnum.API_SUCCESS.getRes());
         } catch (Exception e) {// 其他异常
             e.printStackTrace();
+            log.error(CommonEnum.API_ERROR.getRes(), e);
             model.setCode(CommonEnum.API_ERROR.getCode());
             model.setDes(CommonEnum.API_ERROR.getRes());
         }
         return model;
     }
-
-    /**
-     * 测试接口
-     */
-    @Deprecated
-    @GetMapping("/api/v1/showGroupInfotest")
-    public JsonModel showGroupInfo(HttpServletRequest request) {
-        String qd = request.getParameter("qd");
-        JsonModel model = new JsonModel();
-        try {
-            String groupId = ClientServiceAESDencrypt.decrypt(qd);
-            CsGroup g = groupService.queryGroupByGroupId(groupId);
-            model.setCode(CommonEnum.API_SUCCESS.getCode());
-            model.setDes(CommonEnum.API_SUCCESS.getRes());
-            model.setResult(g);
-        } catch (Exception e) {// 其他异常
-            e.printStackTrace();
-            model.setCode(CommonEnum.API_ERROR.getCode());
-            model.setDes(CommonEnum.API_ERROR.getRes());
-        }
-        return model;
-    }
-
-    /**
-     * sidebar(之前版本-暂停) 
-     * @param request
-     * @return String
-     * @author wsh
-     * @date 2021年9月27日 下午1:41:04
-     * @Exception 异常对象
-     */
-    @Deprecated
-    @GetMapping("/api/v1/sidebar")
-    public String sidebar(HttpServletRequest request) {
-        String qd = request.getParameter("qd");
-        qd = "263uNc3+ZJxuJuUgLycR5k1aGc1ZpPnX4jO2c4PA+JwJ3ITYtdiNyMuhhRzz/MXF";
-        try {
-            String groupId = ClientServiceAESDencrypt.decrypt(qd);
-            if (!CommonUtils.isEmpty(groupId)) {
-                CsGroup g = groupService.queryGroupByGroupId(groupId);
-                if (CommonUtils.isEmpty(g)) {
-                    request.setAttribute("tipsMessager", "没有群组信息");
-                    return "page/common/tipmsg";
-                }
-            } else {
-                request.setAttribute("tipsMessager", "没有群组信息");
-                return "page/common/tipmsg";
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        request.setAttribute("qd", qd);
-        return "page/sidebar";
-    }
 }

Index: clientservice/src/main/java/com/freshport/dao/Mapper/CsBaseTitleMapper.xml
===================================================================
--- clientservice/src/main/java/com/freshport/dao/Mapper/CsBaseTitleMapper.xml	(revision 28513)
+++ clientservice/src/main/java/com/freshport/dao/Mapper/CsBaseTitleMapper.xml	(revision 28514)
@@ -162,20 +162,32 @@
     where t_id = #{tId,jdbcType=VARCHAR}
   </update>
   
-  <select id="queryBaseTitleListByGroupId" parameterType="java.lang.String" resultType="com.freshport.entity.vo.BaseTitleVo">
-    select  t_id as tId, group_id as groupId, group_name as groupName, title_name as titleName, cg_id as cgId,order_number as orderNumber
-    from cs_base_title
-    where group_id = #{groupId}
-    and delete_status='0'
-    order by order_number
+  
+   <resultMap id="CsTitleMap" type="com.freshport.entity.vo.BaseTitleVo">
+    <id column="tId"  property="tId" />
+    <result column="groupId"  property="groupId" />
+    <result column="groupName"  property="groupName" />
+    <result column="titleName"  property="titleName" />
+    <result column="orderNumber"  property="orderNumber" />
+    <collection property="itemList" ofType="com.freshport.entity.CsBaseTitleItem"  >
+     	<id column="item_tiId"  property="tiId" />
+	    <result column="item_tId"  property="tId" />
+	    <result column="item_context"  property="context" />
+	    <result column="item_orderNumber"  property="orderNumber" />
+     </collection>
+  </resultMap>
+  
+  <select id="queryBaseTitleListByGroupId" parameterType="java.lang.String" resultMap="CsTitleMap">
+    select  t.t_id as tId, t.group_id as groupId, t.group_name as groupName, t.title_name as titleName,
+     t.cg_id as cgId,t.order_number as orderNumber
+     ,ti.ti_id as item_tiId,ti.t_id as item_tId, ti.context as item_context,ti.order_number as item_orderNumber
+    from cs_base_title t
+    left join cs_base_title_item ti on ti.t_id = t.t_id and ti.delete_status='0'
+    where t.group_id = #{groupId}
+    and t.delete_status='0'
+    order by t.order_number
   </select>
   <select id="queryBaseTitleListPage" parameterType="java.util.Map" resultType="com.freshport.entity.vo.BaseTitleVo">
-   <!-- select g.group_id as groupId, g.group_name as groupName, group_concat( distinct b.title_name order by b.order_number separator '/') as titleName, b.cg_id as cgId,
-      group_concat(ti.context  order by ti.t_id,ti.order_number separator '/') as titleContext 
-    from  cs_group g 
-    left join cs_base_title b on g.group_id = b.group_id and b.delete_status='0'
-    left join cs_base_title_item ti on b.t_id = ti.t_id and ti.delete_status='0' -->
-    
 	select g.group_id as groupId,g.group_name as groupName,
 			GROUP_CONCAT(concat(tt.titleName,': ',tt.titleContext) order by tt.orderNumber separator '; ') as titleName
 	from
@@ -189,17 +201,17 @@
 		) tt on g.group_id = tt.groupId
     <where>
     	<if test="groupId !=null and groupId !='' ">
-	    	and g.group_id like CONCAT('%',#{groupId},'%')  
+	    	and instr(g.group_id,#{groupId})>0
 	    </if>
 	    <if test="groupName !=null and groupName !='' ">
-	    	and g.group_name like CONCAT('%',#{groupName},'%')   
+	    	and instr(g.group_name,#{groupName})>0  
 	    </if>
     	<if test="maintainStatus !=null and maintainStatus !=''  ">
 	    	<if test='maintainStatus=="0"'>
-	    		and tt.group_id is null
+	    		and tt.groupId is null
 	    	</if>
 	    	<if test='maintainStatus=="1"'>
-	    		and tt.group_id is not null
+	    		and tt.groupId is not null
 	    	</if>
 	    </if>
     </where>
@@ -221,17 +233,17 @@
 		) tt on g.group_id = tt.groupId
     <where>
     	<if test="groupId !=null and groupId !='' ">
-	    	and g.group_id like CONCAT('%',#{groupId},'%')  
+    		and instr(g.group_id,#{groupId})>0
 	    </if>
 	    <if test="groupName !=null and groupName !='' ">
-	    	and g.group_name like CONCAT('%',#{groupName},'%')   
+	    	and instr(g.group_name,#{groupName})>0
 	    </if>
     	<if test="maintainStatus !=null and maintainStatus !=''  ">
 	    	<if test='maintainStatus=="0"'>
-	    		and tt.group_id is null
+	    		and tt.groupId is null
 	    	</if>
 	    	<if test='maintainStatus=="1"'>
-	    		and tt.group_id is not null
+	    		and tt.groupId is not null
 	    	</if>
 	    </if>
     </where>

Index: clientservice/src/main/java/com/freshport/service/BaseTitleService.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/BaseTitleService.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/BaseTitleService.java	(revision 28514)
@@ -66,12 +66,12 @@
     /**    
      * customerDelete(删除客户画像信息) 
      * @param selectedIDs
-     * @param userName void
+     * @param userName  Map<String, String>
      * @author wsh
      * @date 2021年9月23日 下午5:12:52
      * @Exception 异常对象    
     */
-    void customerDelete(List<String> selectedIDs, String userName);
+    Map<String, String> customerDelete(List<String> selectedIDs, String userName);
 
     /**    
      * queryTitleTypeCountByMap(查询画像类型明细Count) 

Index: clientservice/src/main/java/com/freshport/service/CsOpLogService.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/CsOpLogService.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/CsOpLogService.java	(revision 28514)
@@ -9,11 +9,13 @@
  */
 package com.freshport.service;
 
+import com.freshport.entity.CsOpLog;
+
 /**    
  *     
  * 项目名称：clientservice    
  * 类名称：CsOpLogService    
- * 类描述：    
+ * 类描述：    记录备注操作日期Service
  * 创建人：wsh    
  * 创建时间：2021年9月27日 下午4:39:07    
  * 修改人：wsh    
@@ -25,19 +27,12 @@
 public interface CsOpLogService {
 
     /**    
-     * createCsOpLog(这里用一句话描述这个方法的作用) 
-     * TODO(这里描述这个方法适用条件,执行流程 ,使用方法，注意事项– 可选) 
-     * @param groupId
-     * @param remark
-     * @param userName
-     * @param remark2
-     * @param upd
-     * @param sourceRemark void
+     * insertCsOpLog(保存群组备注新增修改记录) 
+     * @param op void
      * @author wsh
-     * @date 2021年9月27日 下午4:45:10
+     * @date 2021年10月9日 下午3:46:48
      * @Exception 异常对象    
     */
-    void createCsOpLog(String groupId, String newContext, String userName, String oldContext, String updType,
-            String source);
+    void insertCsOpLog(CsOpLog op);
 
 }

Index: clientservice/src/main/java/com/freshport/service/GroupRemarkService.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/GroupRemarkService.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/GroupRemarkService.java	(revision 28514)
@@ -10,6 +10,7 @@
 package com.freshport.service;
 
 import com.freshport.entity.CsGroupRemark;
+import com.freshport.entity.CsOpLog;
 
 /**    
  *     
@@ -44,6 +45,6 @@
      * @date 2021年9月22日 上午9:50:19
      * @Exception 异常对象    
     */
-    void updateRemark(String groupId, String remark, String userName);
+    CsOpLog updateRemark(String groupId, String remark, String userName);
 
 }


Index: clientservice/src/main/java/com/freshport/service/impl/BaseTitleServiceImpl.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/impl/BaseTitleServiceImpl.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/impl/BaseTitleServiceImpl.java	(revision 28514)
@@ -9,8 +9,8 @@
  */
 package com.freshport.service.impl;
 
-import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -33,9 +33,9 @@
 import com.freshport.entity.vo.BaseTitleVo;
 import com.freshport.entity.vo.TitleContextSave;
 import com.freshport.service.BaseTitleService;
+import com.freshport.util.CommonEnum;
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
-import com.freshport.util.common.BusinessException;
 
 /**    
  *     
@@ -68,17 +68,8 @@
     @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public List<BaseTitleVo> queryBaseTitleListByGroupId(String groupId) {
+        // 主从结构查询(客户画像类型，内容)
         List<BaseTitleVo> btvList = baseTitleMapper.queryBaseTitleListByGroupId(groupId);
-        if (!CommonUtils.isEmpty(btvList) && btvList.size() > 0) {
-            for (BaseTitleVo vo : btvList) {
-                List<CsBaseTitleItem> itemList = baseTitleItemMapper.queryBaseTitleItemListBybtId(vo.gettId());
-                if (!CommonUtils.isEmpty(itemList) && itemList.size() > 0) {
-                    vo.setItemList(itemList);
-                } else {
-                    vo.setItemList(new ArrayList<CsBaseTitleItem>());
-                }
-            }
-        }
         return btvList;
     }
 
@@ -106,32 +97,36 @@
      */
     @Transactional
     @Override
-    public void customerDelete(List<String> selectedIDs, String userName) {
+    public Map<String, String> customerDelete(List<String> selectedIDs, String userName) {
+        Map<String, String> resultMap = new HashMap<String, String>();
         // 判断是否有画像内容，如果没有无需删除
         List<CsBaseTitle> cbtList = baseTitleMapper.queryBaseTitleByGroupIdList(selectedIDs);
-        if (!CommonUtils.isEmpty(cbtList) && cbtList.size() > 0) {
-            // 根据列表删除客户画像表csBaseTitle
-            for (CsBaseTitle csBaseTitle : cbtList) {
-                csBaseTitle.setDeleteStatus(CommonInfo.COMMON_YES);
-                csBaseTitle.setUpdTime(new Date());
-                csBaseTitle.setUpdUser(userName);
-                baseTitleMapper.updateByPrimaryKeySelective(csBaseTitle);
+        if (CommonUtils.isEmpty(cbtList)) {
+            resultMap.put("code", CommonEnum.API_ERROR.getCode());
+            resultMap.put("res", CommonInfo.TITLE_TYPE_NO_DEL);
+            return resultMap;
+        }
+        // 根据列表删除客户画像表csBaseTitle
+        for (CsBaseTitle csBaseTitle : cbtList) {
+            csBaseTitle.setDeleteStatus(CommonInfo.COMMON_YES);
+            csBaseTitle.setUpdTime(new Date());
+            csBaseTitle.setUpdUser(userName);
+            baseTitleMapper.updateByPrimaryKeySelective(csBaseTitle);
+        }
+        // 根据列表删除客户画像明细表csBaseTitleItem
+        List<String> tIdList = cbtList.stream().map(CsBaseTitle::gettId).collect(Collectors.toList());
+        List<CsBaseTitleItem> cbtiList = baseTitleItemMapper.queryBaseTitleItemBytIdList(tIdList);
+        if (!CommonUtils.isEmpty(cbtiList) && cbtiList.size() > 0) {
+            for (CsBaseTitleItem csBaseTitleItem : cbtiList) {
+                csBaseTitleItem.setDeleteStatus(CommonInfo.COMMON_YES);
+                csBaseTitleItem.setUpdTime(new Date());
+                csBaseTitleItem.setUpdUser(userName);
+                baseTitleItemMapper.updateByPrimaryKeySelective(csBaseTitleItem);
             }
-            // 根据列表删除客户画像明细表csBaseTitleItem
-            List<String> tIdList = cbtList.stream().map(CsBaseTitle::gettId).collect(Collectors.toList());
-            List<CsBaseTitleItem> cbtiList = baseTitleItemMapper.queryBaseTitleItemBytIdList(tIdList);
-            if (!CommonUtils.isEmpty(cbtiList) && cbtiList.size() > 0) {
-                for (CsBaseTitleItem csBaseTitleItem : cbtiList) {
-                    csBaseTitleItem.setDeleteStatus(CommonInfo.COMMON_YES);
-                    csBaseTitleItem.setUpdTime(new Date());
-                    csBaseTitleItem.setUpdUser(userName);
-                    baseTitleItemMapper.updateByPrimaryKeySelective(csBaseTitleItem);
-                }
-            }
-        } else {
-            throw new BusinessException("customerDelete", "没有客户画像,无需删除");
         }
-
+        resultMap.put("code", CommonEnum.API_SUCCESS.getCode());
+        resultMap.put("des", CommonEnum.API_SUCCESS.getRes());
+        return resultMap;
     }
 
     /**

Index: clientservice/src/main/java/com/freshport/service/impl/CsOpLogServiceImpl.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/impl/CsOpLogServiceImpl.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/impl/CsOpLogServiceImpl.java	(revision 28514)
@@ -9,12 +9,10 @@
  */
 package com.freshport.service.impl;
 
-import java.util.Date;
-import java.util.UUID;
-
 import javax.annotation.Resource;
 
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.freshport.dao.CsOpLogMapper;
 import com.freshport.entity.CsOpLog;
@@ -40,26 +38,15 @@
     private CsOpLogMapper csOpLogMapper;
 
     /**    
-     * createCsOpLog(组装操作日志) 
-     * @param groupId
-     * @param remark
-     * @param userName
-     * @param gr void
+     * insertCsOpLog(保存群组备注新增修改记录) 
+     * @param op void
      * @author wsh
-     * @date 2021年9月27日 下午4:37:02
+     * @date 2021年10月9日 下午3:46:48
      * @Exception 异常对象    
     */
-    public void createCsOpLog(String groupId, String newContext, String userName, String oldContext, String updType,
-            String source) {
-        CsOpLog opLog = new CsOpLog();
-        opLog.setId(UUID.randomUUID().toString());
-        opLog.setNewContext(newContext);
-        opLog.setOldContext(oldContext);
-        opLog.setOpid(groupId);
-        opLog.setUpdTime(new Date());
-        opLog.setUpdType(updType);
-        opLog.setUpdSource(source);
-        opLog.setUpdUser(userName);
-        csOpLogMapper.insert(opLog);
+    @Transactional
+    @Override
+    public void insertCsOpLog(CsOpLog op) {
+        csOpLogMapper.insert(op);
     }
 }

Index: clientservice/src/main/java/com/freshport/service/impl/GroupRemarkServiceImpl.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/impl/GroupRemarkServiceImpl.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/impl/GroupRemarkServiceImpl.java	(revision 28514)
@@ -9,6 +9,8 @@
  */
 package com.freshport.service.impl;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.UUID;
 
 import javax.annotation.Resource;
@@ -21,11 +23,13 @@
 import com.freshport.dao.CsGroupRemarkMapper;
 import com.freshport.entity.CsGroup;
 import com.freshport.entity.CsGroupRemark;
-import com.freshport.service.CsOpLogService;
+import com.freshport.entity.CsOpLog;
 import com.freshport.service.GroupRemarkService;
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
 
+import lombok.extern.slf4j.Slf4j;
+
 /**    
  *     
  * 项目名称：clientservice    
@@ -39,8 +43,12 @@
  * @version     
  *     
  */
+@Slf4j
 @Service("groupRemarkService")
 public class GroupRemarkServiceImpl implements GroupRemarkService {
+
+    private static final SimpleDateFormat sdf_long = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
     @Resource
     private CsGroupRemarkMapper groupRemarkMapper;
 
@@ -47,9 +55,6 @@
     @Resource
     private CsGroupMapper csGroupMapper;
 
-    @Resource
-    private CsOpLogService csOpLogService;
-
     /**
      * 根据groupId查询备注信息
      */
@@ -64,11 +69,16 @@
      */
     @Transactional
     @Override
-    public void updateRemark(String groupId, String remark, String userName) {
+    public CsOpLog updateRemark(String groupId, String remark, String userName) {
+        CsOpLog op = new CsOpLog();
+        StringBuffer buffer = new StringBuffer();
         CsGroupRemark gr = groupRemarkMapper.queryGroupRemarkByGroupId(groupId);
         if (!CommonUtils.isEmpty(gr)) {
-            csOpLogService.createCsOpLog(groupId, remark, userName, gr.getRemark(), CommonInfo.UPD,
-                    CommonInfo.SOURCE_REMARK);
+            op = createOp(groupId, remark, userName, gr.getRemark(), CommonInfo.UPD);
+            buffer.append(userName).append(sdf_long.format(new Date())).append(CommonInfo.UPD_NAME).append(groupId)
+                    .append(CommonInfo.SYMBOL_COLON).append(gr.getRemark()).append(CommonInfo.SYMBOL_MOVE)
+                    .append(remark);
+            log.info("==updateRemark=upd==" + buffer.toString());
             gr.setRemark(remark);
             groupRemarkMapper.updateByPrimaryKey(gr);
         } else {
@@ -80,9 +90,36 @@
             cgr.setRemark(remark);
             cgr.setrId(UUID.randomUUID().toString());
             groupRemarkMapper.insert(cgr);
-            csOpLogService.createCsOpLog(groupId, remark, userName, null, CommonInfo.ADD, CommonInfo.SOURCE_REMARK);
+            op = createOp(groupId, remark, userName, null, CommonInfo.ADD);
+            buffer.append(userName).append(sdf_long.format(new Date())).append(CommonInfo.ADD_NAME).append(groupId)
+                    .append(CommonInfo.SYMBOL_COLON).append(CommonInfo.SYMBOL_MOVE).append(remark);
+            log.info("==updateRemark=add==" + buffer.toString());
         }
+        return op;
+    }
 
+    /**    
+     * createOp(组装用户新增修改记录) 
+     * @param groupId
+     * @param remark
+     * @param userName
+     * @param op
+     * @param gr void
+     * @author wsh
+     * @date 2021年10月9日 下午3:38:58
+     * @Exception 异常对象    
+    */
+    private CsOpLog createOp(String groupId, String newRemark, String userName, String oldRemark, String updType) {
+        CsOpLog op = new CsOpLog();
+        op.setId(UUID.randomUUID().toString());
+        op.setNewContext(newRemark);
+        op.setOldContext(oldRemark);
+        op.setOpid(groupId);
+        op.setUpdSource(CommonInfo.SOURCE_REMARK);
+        op.setUpdType(updType);
+        op.setUpdUser(userName);
+        op.setUpdTime(new Date());
+        return op;
     }
 
 }

Index: clientservice/src/main/java/com/freshport/service/impl/GroupServiceImpl.java
===================================================================
--- clientservice/src/main/java/com/freshport/service/impl/GroupServiceImpl.java	(revision 28513)
+++ clientservice/src/main/java/com/freshport/service/impl/GroupServiceImpl.java	(revision 28514)
@@ -1,6 +1,7 @@
 package com.freshport.service.impl;
 
 import java.util.List;
+import java.util.UUID;
 
 import javax.annotation.Resource;
 
@@ -24,6 +25,7 @@
         for (CsGroup group : groups) {
             CsGroup query = groupDao.selectByGroupId(group.getGroupId());
             if (query == null) {
+                group.setId(UUID.randomUUID().toString());
                 groupDao.insert(group);
             } else {
                 groupDao.updateByGroupId(group);

