소스 검색

新需求

傅行帆 5 년 전
부모
커밋
cfc9d158ec

+ 7
- 1
src/main/java/com.huiju.welcome/controller/TaVisitorAppointmentController.java 파일 보기

@@ -92,7 +92,13 @@ public class TaVisitorAppointmentController extends BaseController {
92 92
         TaWechatUser user = iTaWechatUserService.getById(Integer.valueOf(JWTUtils.getSubject(request)));
93 93
         SysUser sysUser = iSysUserService.getById(user.getPersonId());
94 94
         taVisitorAppointment.setCreateUser(sysUser.getUserId());
95
-        taVisitorAppointment.setCustomerType(CommConstant.IDENTITY_CHANNEL_MANAGER.equals(sysUser.getUserIdentity()) ? CommConstant.CUSTOMER_OF_CHANNEL : "");
95
+        String customerTypeString = "";
96
+        if (CommConstant.IDENTITY_CHANNEL_MANAGER.equals(sysUser.getUserIdentity())){
97
+            customerTypeString = CommConstant.CUSTOMER_OF_CHANNEL;
98
+        }else if (CommConstant.IDENTITY_PLANNING_MANAGER.equals(sysUser.getUserIdentity())){
99
+            customerTypeString = CommConstant.CUSTOMER_OF_PLANNING;
100
+        }
101
+        taVisitorAppointment.setCustomerType(customerTypeString);
96 102
 
97 103
         boolean success = taVisitorAppointmentService.save(taVisitorAppointment);
98 104
         if (success) {

+ 2
- 0
src/main/java/com.huiju.welcome/mapper/TaVisitingLogMapper.java 파일 보기

@@ -26,4 +26,6 @@ public interface TaVisitingLogMapper extends BaseMapper<TaVisitingLog> {
26 26
     List<Map<String, Long>> getRegularClientTodayAmount();
27 27
 
28 28
     IPage<TaVisitingLog> getVisitingList(Page page, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("personId") Integer personId);
29
+	
30
+	List<TaVisitingLog> selectVisitingList(@Param("todayBegin") String todayBegin);
29 31
 }

+ 1
- 1
src/main/java/com.huiju.welcome/service/ITaCustomerService.java 파일 보기

@@ -61,7 +61,7 @@ public interface ITaCustomerService extends IService<TaCustomer> {
61 61
     
62 62
     void sendMessageToBar(TaCustomer taCustomer,Integer personNum);
63 63
     
64
-    void notifyManager(TaCustomer taCustomer);
64
+    //void notifyManager(TaCustomer taCustomer);
65 65
     
66 66
     void sendMessageAll(TaFirstUsherRecord taFirstUsherRecord, TaCustomer taCustomer, TaMainUsherRecord taMainUsherRecord);
67 67
 

+ 9
- 9
src/main/java/com.huiju.welcome/service/impl/MessageServiceImpl.java 파일 보기

@@ -33,15 +33,15 @@ public class MessageServiceImpl implements IMessageService {
33 33
 
34 34
     @Override
35 35
     public boolean notifyManager(TaCustomer taCustomer) {
36
-        // 置业经理或者渠道经理
37
-        String userIdentity = CommConstant.CUSTOMER_OF_CHANNEL.equals(taCustomer.getCustomerType()) ?
38
-                CommConstant.IDENTITY_CHANNEL_MANAGER : CommConstant.IDENTITY_CONSULTANT_MANAGER;
39
-
40
-        // 同时增加渠道总
41
-        List<String> identities = new ArrayList<String>(){{
42
-            add(userIdentity);
43
-//            add(CommConstant.IDENTITY_GENERAL_MANAGER);
44
-        }};
36
+        // 置业经理,渠道经理,策划经理
37
+        List<String> identities = new ArrayList<String>();
38
+        
39
+        if (CommConstant.CUSTOMER_OF_CHANNEL.equals(taCustomer.getCustomerType())){
40
+            identities.add(CommConstant.IDENTITY_CHANNEL_MANAGER);
41
+        }
42
+        identities.add(CommConstant.IDENTITY_CONSULTANT_MANAGER);
43
+        identities.add(CommConstant.IDENTITY_PLANNING_MANAGER);
44
+        identities.add(CommConstant.IDENTITY_GENERAL_MANAGER);
45 45
 
46 46
         // 推送给置业经理或者渠道经理 + 渠道总
47 47
         List<SysUser> sysUserList = sysUserMapper.filterByIdentities(identities);

+ 35
- 32
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java 파일 보기

@@ -176,6 +176,8 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
176 176
         if (null != sysUser) {
177 177
             if (CommConstant.IDENTITY_CHANNEL_MANAGER.equals(sysUser.getUserIdentity())) {
178 178
                 taCustomer.setCustomerType(CommConstant.CUSTOMER_OF_CHANNEL);
179
+            }else if(CommConstant.IDENTITY_PLANNING_MANAGER.equals(sysUser.getUserIdentity())){
180
+                taCustomer.setCustomerType(CommConstant.CUSTOMER_OF_PLANNING);
179 181
             }
180 182
         }
181 183
         
@@ -627,7 +629,8 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
627 629
     }
628 630
 
629 631
     @Override
630
-    public boolean updateByMainUsher(Integer customerId, JSONObject params) {
632
+    public boolean
633
+    updateByMainUsher(Integer customerId, JSONObject params) {
631 634
         if (null == customerId || customerId == 0) {
632 635
             return false;
633 636
         }
@@ -775,37 +778,37 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
775 778
         } catch (Exception e) {}
776 779
     }
777 780
     
778
-    @Override
779
-    public void notifyManager(TaCustomer taCustomer) {
780
-        String userIdentity = CommConstant.CUSTOMER_OF_CHANNEL.equals(taCustomer.getCustomerType()) ?
781
-                CommConstant.IDENTITY_CHANNEL_MANAGER : CommConstant.IDENTITY_CONSULTANT_MANAGER;
782
-
783
-
784
-        //获取所有的置业经理信息并推送消息
785
-        List<SysUser> sysUserList = sysUserMapper.filterByIdentity(userIdentity);
786
-        sysUserList.stream().forEach(e -> {
787
-            String tpl = miniApp.getTpls().getVisitor();
788
-            String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + taCustomer.getCustomerId();
789
-            String openid = e.getOpenid();
790
-            if (null == openid) {
791
-                return;
792
-            }
793
-            List<Object> data = new ArrayList<Object>(){{
794
-                add(taCustomer.getCustomerName());
795
-                add(taCustomer.getPhone());
796
-                add("您有客户来访, 请及时接待!");
797
-            }};
798
-            
799
-//            miniApp.sendTPLMessage(tpl, openid, page, data);
800
-            if (miniApp.sendTPLMessage(tpl, openid, page, data).getCode() == -1) {
801
-                // 没有 formid 发短信
802
-                String phone = sysUserMapper.getPhoneByOpenid(openid);
803
-                if (null != phone) {
804
-                    smsUtils.sendVisitor(phone, null == taCustomer ? "": StringUtils.ifNull(taCustomer.getCustomerName(), ""));
805
-                }
806
-            }
807
-        });
808
-    }
781
+//    @Override
782
+//    public void notifyManager(TaCustomer taCustomer) {
783
+//        String userIdentity = CommConstant.CUSTOMER_OF_CHANNEL.equals(taCustomer.getCustomerType()) ?
784
+//                CommConstant.IDENTITY_CHANNEL_MANAGER : CommConstant.IDENTITY_CONSULTANT_MANAGER;
785
+//
786
+//
787
+//        //获取所有的置业经理信息并推送消息
788
+//        List<SysUser> sysUserList = sysUserMapper.filterByIdentity(userIdentity);
789
+//        sysUserList.stream().forEach(e -> {
790
+//            String tpl = miniApp.getTpls().getVisitor();
791
+//            String page = CommConstant.PAGE_MY_CUSTOMER + "?id=" + taCustomer.getCustomerId();
792
+//            String openid = e.getOpenid();
793
+//            if (null == openid) {
794
+//                return;
795
+//            }
796
+//            List<Object> data = new ArrayList<Object>(){{
797
+//                add(taCustomer.getCustomerName());
798
+//                add(taCustomer.getPhone());
799
+//                add("您有客户来访, 请及时接待!");
800
+//            }};
801
+//
802
+////            miniApp.sendTPLMessage(tpl, openid, page, data);
803
+//            if (miniApp.sendTPLMessage(tpl, openid, page, data).getCode() == -1) {
804
+//                // 没有 formid 发短信
805
+//                String phone = sysUserMapper.getPhoneByOpenid(openid);
806
+//                if (null != phone) {
807
+//                    smsUtils.sendVisitor(phone, null == taCustomer ? "": StringUtils.ifNull(taCustomer.getCustomerName(), ""));
808
+//                }
809
+//            }
810
+//        });
811
+//    }
809 812
     
810 813
     @Override
811 814
     public void sendMessageAll(TaFirstUsherRecord taFirstUsherRecord, TaCustomer taCustomer, TaMainUsherRecord taMainUsherRecord) {

+ 7
- 1
src/main/java/com.huiju.welcome/service/impl/TaMainUsherRecordServiceImpl.java 파일 보기

@@ -692,7 +692,13 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
692 692
 
693 693
                 UsherRecordExcel item = new UsherRecordExcel();
694 694
                 item.setCustomerSource(customer.getSourceName());
695
-                item.setCustomerType(CommConstant.CUSTOMER_OF_CHANNEL.equals(customer.getCustomerType()) ? "渠道" : "自销");
695
+                String customerTypeString = "自销";
696
+                if (CommConstant.CUSTOMER_OF_CHANNEL.equals(customer.getCustomerType())){
697
+                    customerTypeString = "渠道";
698
+                }else if(CommConstant.CUSTOMER_OF_PLANNING.equals(customer.getCustomerType())){
699
+                    customerTypeString = "策划";
700
+                }
701
+                item.setCustomerType(customerTypeString);
696 702
                 item.setPersonName(customer.getPersonName());
697 703
                 item.setPersonNum(customer.getVisitorNum());;
698 704
                 item.setPhone(StringUtils.mixPhone(customer.getPhone()));

+ 2
- 6
src/main/java/com.huiju.welcome/service/impl/TaVisitingLogServiceImpl.java 파일 보기

@@ -65,12 +65,8 @@ public class TaVisitingLogServiceImpl extends ServiceImpl<TaVisitingLogMapper, T
65 65
     public ResponseBean getTimeline() {
66 66
         LocalDateTime now = LocalDateTime.now();
67 67
         String todayBegin = DateUtils.localDatetime2day(now) + " 00:00:00";
68
-
69
-        QueryWrapper<TaVisitingLog> query4 = new QueryWrapper<>();
70
-        query4.ge("visite_date", todayBegin);
71
-        query4.groupBy("real_person");
72
-        query4.orderByDesc("visite_date");
73
-        List<TaVisitingLog> fourHourList = taVisitingLogMapper.selectList(query4);
68
+        
69
+        List<TaVisitingLog> fourHourList = taVisitingLogMapper.selectVisitingList(todayBegin);
74 70
 
75 71
         return ResponseBean.success(fourHourList);
76 72
     }

+ 4
- 0
src/main/java/com.huiju.welcome/utils/CommConstant.java 파일 보기

@@ -16,12 +16,16 @@ public class CommConstant {
16 16
     public final static String IDENTITY_CHANNEL_MANAGER = "channel_manager";
17 17
     // 营销总
18 18
     public final static String IDENTITY_GENERAL_MANAGER = "general_manager";
19
+    //策划经理
20
+    public final static String IDENTITY_PLANNING_MANAGER = "planning_manager";
19 21
     //
20 22
     public final static String IDENTITY_ALL_USHER = "all-usher";
21 23
 
22 24
     // 正常客户, 类型是空
23 25
     // 渠道客户
24 26
     public final static String CUSTOMER_OF_CHANNEL = "channel";
27
+    //策划客户
28
+    public final static String CUSTOMER_OF_PLANNING = "planning";
25 29
 
26 30
     public final static String PAGE_MY_CUSTOMER = "pages/client/clientdetail/clientdetail";
27 31
     public final static String PAGE_MY_FIRSTUSHER = "pages/client/visitorDetail/visitorDetail";

+ 6
- 6
src/main/resources/application.yml 파일 보기

@@ -1,12 +1,12 @@
1 1
 spring:
2 2
   datasource:
3 3
     driver-class-name: com.mysql.cj.jdbc.Driver
4
-    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/welcome3?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
5
-    username: welcome
6
-    password: s190QU2#z%hdU%^FPkY9qjls
7
-#    url: jdbc:mysql://47.101.36.130:3306/welcome3?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
8
-#    username: root
9
-#    password: Wt4q*/9}i00q@0a4jM{z6O#h129@F/
4
+#    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/welcome3?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
5
+#    username: welcome
6
+#    password: s190QU2#z%hdU%^FPkY9qjls
7
+    url: jdbc:mysql://47.101.36.130:3306/welcome3?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull
8
+    username: root
9
+    password: Wt4q*/9}i00q@0a4jM{z6O#h129@F/
10 10
   servlet:
11 11
     multipart:
12 12
       max-file-size: 1024MB

+ 0
- 3
src/main/resources/mapper/TaCustomerMapper.xml 파일 보기

@@ -104,9 +104,6 @@
104 104
             <if test="nameOrPhoneOrReceiver !=null and nameOrPhoneOrReceiver != ''">
105 105
               AND ( t.customer_name LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%') OR t.phone LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%') OR t.receiver LIKE CONCAT('%',#{nameOrPhoneOrReceiver},'%'))
106 106
             </if>
107
-            <if test='null != customerType and customerType == "normal"'>
108
-                AND IFNULL(t.customer_type, '') = ''
109
-            </if>
110 107
             <if test='null != customerType and customerType == "channel"'>
111 108
                 AND IFNULL(t.customer_type, '') = 'channel'
112 109
             </if>

+ 14
- 0
src/main/resources/mapper/TaVisitingLogMapper.xml 파일 보기

@@ -79,4 +79,18 @@
79 79
                     count(*) > 1
80 80
             ) a
81 81
     </select>
82
+
83
+    <select id="selectVisitingList" resultType="com.huiju.welcome.model.TaVisitingLog">
84
+        SELECT
85
+            *
86
+        FROM
87
+            ta_visiting_log t
88
+        WHERE
89
+            NOT EXISTS ( SELECT * FROM ta_customer_map s WHERE t.person_id = s.person_id OR t.real_person = s.person_id )
90
+            AND visite_date >= #{todayBegin}
91
+        GROUP BY
92
+            real_person
93
+        ORDER BY
94
+            visite_date DESC
95
+    </select>
82 96
 </mapper>