Your Name 5 years ago
parent
commit
4ec62da23e

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.huiju.welcome</groupId>
11
 	<groupId>com.huiju.welcome</groupId>
12
 	<artifactId>mainbiz</artifactId>
12
 	<artifactId>mainbiz</artifactId>
13
-	<version>v5.2.0</version>
13
+	<version>v5.3.0</version>
14
 	<name>mainbiz</name>
14
 	<name>mainbiz</name>
15
 	<description>com.huiju.welcome main service</description>
15
 	<description>com.huiju.welcome main service</description>
16
 
16
 

+ 21
- 0
src/main/java/com.huiju.welcome/controller/SysDictController.java View File

138
         }
138
         }
139
         return responseBean;
139
         return responseBean;
140
     }
140
     }
141
+
142
+    @RequestMapping(value="/sysDict",method= RequestMethod.GET)
143
+    public ResponseBean list(@RequestParam(required = false) String type) {
144
+        ResponseBean responseBean = new ResponseBean();
145
+        try {
146
+            QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
147
+            if(!StringUtils.isEmpty(type)){
148
+                queryWrapper.eq("type",type);
149
+            }
150
+            queryWrapper.orderByAsc("type");
151
+            queryWrapper.orderByDesc("sort");
152
+            queryWrapper.orderByDesc("create_date");
153
+
154
+            responseBean.addSuccess(iSysDictService.list(queryWrapper));
155
+        }catch (Exception e){
156
+            e.printStackTrace();
157
+            logger.error("getByType -=- {}",e.toString());
158
+            responseBean.addError(e.getMessage());
159
+        }
160
+        return responseBean;
161
+    }
141
 }
162
 }

+ 19
- 4
src/main/java/com.huiju.welcome/controller/TaCustomerController.java View File

330
 
330
 
331
             responseBean.addSuccess(result);
331
             responseBean.addSuccess(result);
332
         }catch (Exception e){
332
         }catch (Exception e){
333
+            e.printStackTrace();
333
             logger.error("taCustomerList -=- {}",e.toString());
334
             logger.error("taCustomerList -=- {}",e.toString());
334
             responseBean.addError(e.getMessage());
335
             responseBean.addError(e.getMessage());
335
         }
336
         }
388
     
389
     
389
         String userId = JWTUtils.getSubject(request);
390
         String userId = JWTUtils.getSubject(request);
390
         SysUser user = iSysUserService.getById(iTaWechatUserService.getById(userId).getPersonId());
391
         SysUser user = iSysUserService.getById(iTaWechatUserService.getById(userId).getPersonId());
391
-        if (null != user && !user.getUserIdentity().equals(CommConstant.IDENTITY_CONSULTANT_MANAGER)){
392
-            responseBean.addError("你不是置业经理");
392
+
393
+        List<String> allowRights = new ArrayList<String>(){{
394
+            add(CommConstant.IDENTITY_CONSULTANT_MANAGER);
395
+            add(CommConstant.IDENTITY_CHANNEL_MANAGER);
396
+            add(CommConstant.IDENTITY_GENERAL_MANAGER);
397
+        }};
398
+
399
+        if (null != user && !allowRights.contains(user.getUserIdentity())){
400
+            responseBean.addError("您无权限进行该操作");
393
             return responseBean;
401
             return responseBean;
394
         }
402
         }
395
         
403
         
396
-        TaCustomer taCustomer = JSONObject.parseObject(paramStr, TaCustomer.class);
397
-        taCustomer.setCustomerId(id);
404
+        TaCustomer input = JSONObject.parseObject(paramStr, TaCustomer.class);
405
+        TaCustomer taCustomer = iTaCustomerService.getById(id);
406
+        if (null == taCustomer) {
407
+            responseBean.addError("当前客户不存在");
408
+            return responseBean;
409
+        }
410
+
411
+        taCustomer.setConsultantId(input.getConsultantId());
412
+        taCustomer.setRealtyConsultant(input.getRealtyConsultant());
398
         
413
         
399
         try {
414
         try {
400
             if (iTaCustomerService.updateById(taCustomer)){
415
             if (iTaCustomerService.updateById(taCustomer)){

+ 5
- 1
src/main/java/com.huiju.welcome/controller/TaVisitorAppointmentController.java View File

170
     public ResponseBean myAppointmentList(@RequestParam(defaultValue = "1") int pageNum,
170
     public ResponseBean myAppointmentList(@RequestParam(defaultValue = "1") int pageNum,
171
                                           @RequestParam(defaultValue = "10") int pageSize,
171
                                           @RequestParam(defaultValue = "10") int pageSize,
172
                                           @RequestParam(defaultValue = "") String nameOrPhone,
172
                                           @RequestParam(defaultValue = "") String nameOrPhone,
173
+                                          @RequestParam(defaultValue = "true") Boolean mine,
174
+                                          @RequestParam(required = false) String identity,
173
                                           HttpServletRequest request) {
175
                                           HttpServletRequest request) {
174
         TaWechatUser user = iTaWechatUserService.getById(Integer.valueOf(JWTUtils.getSubject(request)));
176
         TaWechatUser user = iTaWechatUserService.getById(Integer.valueOf(JWTUtils.getSubject(request)));
175
-        IPage<TaVisitorAppointment> result = taVisitorAppointmentService.getMyAppointmentList(pageNum, pageSize, user.getPersonId(), nameOrPhone);
177
+        Integer personId = mine ? user.getPersonId() : null;
178
+
179
+        IPage<TaVisitorAppointment> result = taVisitorAppointmentService.getMyAppointmentList(pageNum, pageSize, personId, nameOrPhone, identity);
176
         return ResponseBean.success(result);
180
         return ResponseBean.success(result);
177
     }
181
     }
178
     
182
     

+ 1
- 1
src/main/java/com.huiju.welcome/interceptor/AccessInterceptor.java View File

38
         "/websocket",
38
         "/websocket",
39
          "/face",
39
          "/face",
40
         "/miniapp/login",
40
         "/miniapp/login",
41
-            "/excel/usherListExcel"
41
+        "/excel/usherListExcel"
42
     };
42
     };
43
 
43
 
44
     /*
44
     /*

+ 1
- 1
src/main/java/com.huiju.welcome/mapper/TaVisitorAppointmentMapper.java View File

21
      */
21
      */
22
     IPage<TaVisitorAppointment> visitorAppointmentList(IPage pg, @Param("platNumber") String platNumber, @Param("personName")String personName, @Param("phone")String phone);
22
     IPage<TaVisitorAppointment> visitorAppointmentList(IPage pg, @Param("platNumber") String platNumber, @Param("personName")String personName, @Param("phone")String phone);
23
 
23
 
24
-    IPage<TaVisitorAppointment> getMyAppointmentList(IPage<TaVisitorAppointment> page,@Param("createUser") Integer personId, @Param("nameOrPhone") String nameOrPhone);
24
+    IPage<TaVisitorAppointment> getMyAppointmentList(IPage<TaVisitorAppointment> page,@Param("createUser") Integer personId, @Param("nameOrPhone") String nameOrPhone, @Param("identity") String identity);
25
 	
25
 	
26
 	IPage<TaVisitorAppointment> getTodayAppointmentList(IPage<TaVisitorAppointment> page);
26
 	IPage<TaVisitorAppointment> getTodayAppointmentList(IPage<TaVisitorAppointment> page);
27
 	
27
 	

+ 1
- 1
src/main/java/com.huiju.welcome/service/ITaVisitorAppointmentService.java View File

31
 
31
 
32
     List<TaVisitorAppointment> getAppointmentsByPlateNumber(String plateNumber);
32
     List<TaVisitorAppointment> getAppointmentsByPlateNumber(String plateNumber);
33
 
33
 
34
-    IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone);
34
+    IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone, String identity);
35
 	
35
 	
36
 	IPage<TaVisitorAppointment> getTodayAppointmentList(int pageNum, int pageSize);
36
 	IPage<TaVisitorAppointment> getTodayAppointmentList(int pageNum, int pageSize);
37
 	
37
 	

+ 1
- 1
src/main/java/com.huiju.welcome/service/impl/MessageServiceImpl.java View File

40
         // 同时增加渠道总
40
         // 同时增加渠道总
41
         List<String> identities = new ArrayList<String>(){{
41
         List<String> identities = new ArrayList<String>(){{
42
             add(userIdentity);
42
             add(userIdentity);
43
-            add(CommConstant.IDENTITY_GENERAL_MANAGER);
43
+//            add(CommConstant.IDENTITY_GENERAL_MANAGER);
44
         }};
44
         }};
45
 
45
 
46
         // 推送给置业经理或者渠道经理 + 渠道总
46
         // 推送给置业经理或者渠道经理 + 渠道总

+ 12
- 2
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java View File

90
 
90
 
91
     @Override
91
     @Override
92
     public Map<String, Object> getLastVisitInfo(Integer customerId) {
92
     public Map<String, Object> getLastVisitInfo(Integer customerId) {
93
-        return taMainUsherRecordMapper.getSummaryOfCustomer(customerId);
93
+        Map<String, Object> summaryOfCustomer = taMainUsherRecordMapper.getSummaryOfCustomer(customerId);
94
+
95
+        Object o = summaryOfCustomer.get("visiteDate");
96
+        if (null != o) {
97
+            String visiteDate = summaryOfCustomer.get("visiteDate").toString().replace(".0", "");
98
+            DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
99
+
100
+            summaryOfCustomer.put("visiteDate", LocalDateTime.parse(visiteDate,df));
101
+        }
102
+
103
+        return summaryOfCustomer;
94
     }
104
     }
95
 
105
 
96
     @Override
106
     @Override
539
     public IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType) {
549
     public IPage<TaCustomer> getCustomerListOfFront(int pageNumber, int pageSize, Integer consultantId, String nameOrPhoneOrReceiver, String identity, Integer consultantType) {
540
         IPage<TaCustomer> page = new Page<>(pageNumber, pageSize);
550
         IPage<TaCustomer> page = new Page<>(pageNumber, pageSize);
541
 
551
 
542
-        String customerType = StringUtils.isEmpty(identity) ? null : ( CommConstant.IDENTITY_CONSULTANT_MANAGER.equals(identity) ? "normal" : CommConstant.CUSTOMER_OF_CHANNEL);
552
+        String customerType = StringUtils.isEmpty(identity) ? null : identity;
543
 
553
 
544
         return taCustomerMapper.getCustomerListOfFront(page, consultantId, nameOrPhoneOrReceiver, customerType, consultantType);
554
         return taCustomerMapper.getCustomerListOfFront(page, consultantId, nameOrPhoneOrReceiver, customerType, consultantType);
545
     }
555
     }

+ 2
- 2
src/main/java/com.huiju.welcome/service/impl/TaVisitorAppointmentServiceImpl.java View File

67
     }
67
     }
68
 
68
 
69
     @Override
69
     @Override
70
-    public IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone) {
70
+    public IPage<TaVisitorAppointment> getMyAppointmentList(int pageNum, int pageSize, Integer personId, String nameOrPhone, String identity) {
71
         IPage<TaVisitorAppointment> page = new Page<>(pageNum, pageSize);
71
         IPage<TaVisitorAppointment> page = new Page<>(pageNum, pageSize);
72
-        IPage<TaVisitorAppointment> result = taVisitorAppointmentMapper.getMyAppointmentList(page, personId, nameOrPhone);
72
+        IPage<TaVisitorAppointment> result = taVisitorAppointmentMapper.getMyAppointmentList(page, personId, nameOrPhone, identity);
73
 
73
 
74
         return result;
74
         return result;
75
     }
75
     }

+ 13
- 3
src/main/resources/mapper/TaVisitorAppointmentMapper.xml View File

34
 
34
 
35
     <select id="getMyAppointmentList" resultType="com.huiju.welcome.model.TaVisitorAppointment">
35
     <select id="getMyAppointmentList" resultType="com.huiju.welcome.model.TaVisitorAppointment">
36
         SELECT
36
         SELECT
37
-            *
37
+            t.*,
38
+            s.username
38
         FROM
39
         FROM
39
             ta_visitor_appointment t
40
             ta_visitor_appointment t
41
+         JOIN sys_user s ON t.create_user = s.user_id
40
         WHERE
42
         WHERE
41
-            t.create_user = #{createUser}
42
-            AND t.status &gt; 0
43
+          t.status &gt; 0
44
+            <if test="null != createUser">
45
+                AND t.create_user = #{createUser}
46
+            </if>
47
+            <if test='null != identity and identity == "channel_manager"'>
48
+                AND s.user_identity = 'channel_manager'
49
+            </if>
50
+            <if test='null != identity and identity != "channel_manager"'>
51
+                AND s.user_identity in ('consultant', 'consultant_manager')
52
+            </if>
43
             <if test="nameOrPhone !=null and nameOrPhone !=''">
53
             <if test="nameOrPhone !=null and nameOrPhone !=''">
44
                 AND ( t.person_name LIKE CONCAT('%',#{nameOrPhone},'%') OR t.phone LIKE CONCAT('%',#{nameOrPhone},'%') )
54
                 AND ( t.person_name LIKE CONCAT('%',#{nameOrPhone},'%') OR t.phone LIKE CONCAT('%',#{nameOrPhone},'%') )
45
             </if>
55
             </if>