Browse Source

bug 修改

傅行帆 3 years ago
parent
commit
04aa3f0c22

+ 1
- 1
src/main/java/com/yunzhi/marketing/controller/TaBuildingDynamicController.java View File

450
         Integer cityId = iTaBuildingService.getCityById(dynamic.getBuildingId());
450
         Integer cityId = iTaBuildingService.getCityById(dynamic.getBuildingId());
451
         dynamic.setCityId(cityId);
451
         dynamic.setCityId(cityId);
452
         //发布状态 1展示
452
         //发布状态 1展示
453
-        dynamic.setStatus(1);
453
+        dynamic.setStatus(CommConstant.NOT_PUBLISH);
454
         //活动状态,如果不需要报名则直接置为进行中
454
         //活动状态,如果不需要报名则直接置为进行中
455
         dynamic.setActivityStatus(1);
455
         dynamic.setActivityStatus(1);
456
         dynamic.setIsEnlist(1);
456
         dynamic.setIsEnlist(1);

+ 11
- 11
src/main/java/com/yunzhi/marketing/controller/TaCustomImgController.java View File

102
                 customImg.setImgDesc("小程序首页分享配图");
102
                 customImg.setImgDesc("小程序首页分享配图");
103
                 taCustomImgs.add(customImg);
103
                 taCustomImgs.add(customImg);
104
             }
104
             }
105
-            if (CommConstant.BANNER_INDEX.equals(taCustomImg.getImgType())){
106
-                TaCustomImg customImg = new TaCustomImg();
107
-                customImg.setCreateTime(LocalDateTime.now());
108
-                customImg.setUpdateTime(LocalDateTime.now());
109
-                customImg.setOrgId(getOrgId(request));
110
-                customImg.setStatus(CommConstant.STATUS_NORMAL);
111
-                customImg.setImgUrl("http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png");
112
-                customImg.setImgType(CommConstant.INDEX_NEWS);
113
-                customImg.setImgDesc("首页资讯logo");
114
-                taCustomImgs.add(customImg);
115
-            }
105
+//            if (CommConstant.BANNER_INDEX.equals(taCustomImg.getImgType())){
106
+//                TaCustomImg customImg = new TaCustomImg();
107
+//                customImg.setCreateTime(LocalDateTime.now());
108
+//                customImg.setUpdateTime(LocalDateTime.now());
109
+//                customImg.setOrgId(getOrgId(request));
110
+//                customImg.setStatus(CommConstant.STATUS_NORMAL);
111
+//                customImg.setImgUrl("http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png");
112
+//                customImg.setImgType(CommConstant.INDEX_NEWS);
113
+//                customImg.setImgDesc("首页资讯logo");
114
+//                taCustomImgs.add(customImg);
115
+//            }
116
             if (iTaCustomImgService.saveBatch(taCustomImgs)){
116
             if (iTaCustomImgService.saveBatch(taCustomImgs)){
117
                 responseBean.addSuccess(taCustomImg);
117
                 responseBean.addSuccess(taCustomImg);
118
             }else {
118
             }else {

+ 1
- 1
src/main/java/com/yunzhi/marketing/job/CustomerStatisticTimeJob.java View File

50
      *
50
      *
51
      * 开启定时任务,每天23:50执行
51
      * 开启定时任务,每天23:50执行
52
      */
52
      */
53
-//    @Scheduled(cron = "59 50 23 * * ?")
53
+    @Scheduled(cron = "59 50 23 * * ?")
54
 //    @Scheduled(cron = "* 0/1 * * * ?")
54
 //    @Scheduled(cron = "* 0/1 * * * ?")
55
     private void configureTasks() {
55
     private void configureTasks() {
56
         LocalDateTime nowDate = LocalDateTime.now();
56
         LocalDateTime nowDate = LocalDateTime.now();

+ 2
- 0
src/main/java/com/yunzhi/marketing/po/TaRecommendCustomerPO.java View File

25
 
25
 
26
     private String customerStatus;
26
     private String customerStatus;
27
 
27
 
28
+    private Boolean visitStatus;
29
+
28
     private String channelStatus;
30
     private String channelStatus;
29
 
31
 
30
     private String consultant;
32
     private String consultant;

+ 1
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaLiveActivityServiceImpl.java View File

78
             taLiveActivity.setLiveAppPath(taLiveActivity.getLiveRoomParam().replace(".html", ""));
78
             taLiveActivity.setLiveAppPath(taLiveActivity.getLiveRoomParam().replace(".html", ""));
79
         }
79
         }
80
 
80
 
81
+        taLiveActivity.setStatus(CommConstant.NOT_PUBLISH);
81
         Boolean result = save(taLiveActivity);
82
         Boolean result = save(taLiveActivity);
82
         if (!result) {
83
         if (!result) {
83
             responseBean.addError("fail");
84
             responseBean.addError("fail");

+ 1
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaPersonServiceImpl.java View File

330
         result.put("pvNum", person.getPvNum());
330
         result.put("pvNum", person.getPvNum());
331
         result.put("post", person.getPost());
331
         result.put("post", person.getPost());
332
         result.put("phone", user.getPhone());
332
         result.put("phone", user.getPhone());
333
-        result.put("avatar",user.getAvatar());
333
+        result.put("avatar",person.getAvatarurl());
334
         result.put("visitors", visitors);
334
         result.put("visitors", visitors);
335
         result.put("liked", false);
335
         result.put("liked", false);
336
         result.put("unReadNum", 0);
336
         result.put("unReadNum", 0);

+ 1
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java View File

392
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
392
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
393
         queryWrapper.eq(TaRecommendCustomer::getPhone,channelReportDTO.getPhone());
393
         queryWrapper.eq(TaRecommendCustomer::getPhone,channelReportDTO.getPhone());
394
         queryWrapper.eq(TaRecommendCustomer::getBuildingId,channelReportDTO.getBuildingId());
394
         queryWrapper.eq(TaRecommendCustomer::getBuildingId,channelReportDTO.getBuildingId());
395
-        queryWrapper.isNull(TaRecommendCustomer::getRecommendPerson);
395
+        queryWrapper.isNotNull((TaRecommendCustomer::getRecommendPerson));
396
         List<TaRecommendCustomer> taRecommendCustomers = taRecommendCustomerMapper.selectList(queryWrapper);
396
         List<TaRecommendCustomer> taRecommendCustomers = taRecommendCustomerMapper.selectList(queryWrapper);
397
         if (taRecommendCustomers.size() > 0) {
397
         if (taRecommendCustomers.size() > 0) {
398
             return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);
398
             return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);

+ 1
- 1
src/main/java/com/yunzhi/marketing/statistic/controller/TsCustomerGenderStatisticController.java View File

173
             QueryWrapper<TsCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
173
             QueryWrapper<TsCustomerGenderStatistic> queryWrapper = new QueryWrapper<>();
174
             queryWrapper.eq("org_id",getOrgId(request));
174
             queryWrapper.eq("org_id",getOrgId(request));
175
             queryWrapper.eq("customer_type",customerType);
175
             queryWrapper.eq("customer_type",customerType);
176
-            queryWrapper.eq("realty_consultant",person.getPersonId());
176
+            queryWrapper.nested(query -> query.eq("realty_consultant", person.getPersonId()).or().eq("realty_consultant", person.getUserId()));
177
             queryWrapper.orderByDesc("create_date");
177
             queryWrapper.orderByDesc("create_date");
178
      
178
      
179
             List<TsCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.list(queryWrapper);
179
             List<TsCustomerGenderStatistic> result = iTaCustomerGenderStatisticService.list(queryWrapper);

+ 7
- 1
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java View File

129
     @ApiOperation(value = "森哥看这里-wx-驻场确认到访", notes = "森哥看这里-wx-驻场确认到访")
129
     @ApiOperation(value = "森哥看这里-wx-驻场确认到访", notes = "森哥看这里-wx-驻场确认到访")
130
     @RequestMapping(value="/{plat}/marking/visit",method= RequestMethod.PUT)
130
     @RequestMapping(value="/{plat}/marking/visit",method= RequestMethod.PUT)
131
     public ResponseBean channelCustomerUpdate(@RequestBody MarkingChannelCustomerDTO params){
131
     public ResponseBean channelCustomerUpdate(@RequestBody MarkingChannelCustomerDTO params){
132
-        return iChannelCustomerService.markingChannelCustomer(params);
132
+        ResponseBean responseBean = new ResponseBean();
133
+        try {
134
+            responseBean = iChannelCustomerService.markingChannelCustomer(params);
135
+        }catch (Exception e){
136
+            responseBean.addError("不允许重复报备");
137
+        }
138
+        return responseBean;
133
     }
139
     }
134
 
140
 
135
     /**
141
     /**

+ 1
- 1
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java View File

32
      * @param params
32
      * @param params
33
      * @return
33
      * @return
34
      */
34
      */
35
-    ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params);
35
+    ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) throws Exception;
36
 
36
 
37
     /**
37
     /**
38
      * 驻场 无效报备
38
      * 驻场 无效报备

+ 9
- 1
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java View File

23
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
23
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
24
 import org.springframework.beans.factory.annotation.Autowired;
24
 import org.springframework.beans.factory.annotation.Autowired;
25
 import org.springframework.stereotype.Service;
25
 import org.springframework.stereotype.Service;
26
+import org.springframework.transaction.annotation.Transactional;
26
 
27
 
27
 import java.time.LocalDateTime;
28
 import java.time.LocalDateTime;
28
 import java.util.List;
29
 import java.util.List;
167
      * @return
168
      * @return
168
      */
169
      */
169
     @Override
170
     @Override
170
-    public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
171
+    @Transactional
172
+    public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) throws Exception {
171
         CustomerVisit customerVisit = params.getCustomerVisit();
173
         CustomerVisit customerVisit = params.getCustomerVisit();
172
         // 渠道推荐的客户
174
         // 渠道推荐的客户
173
         if ("report".equals(params.getType())) {
175
         if ("report".equals(params.getType())) {
255
 
257
 
256
         // 保存到访单
258
         // 保存到访单
257
         customerVisit.setCreateDate(LocalDateTime.now());
259
         customerVisit.setCreateDate(LocalDateTime.now());
260
+        LambdaQueryWrapper<CustomerVisit> lambdaQueryWrapper = new LambdaQueryWrapper<>();
261
+        lambdaQueryWrapper.eq(CustomerVisit::getCustomerId,customerVisit.getCustomerId());
262
+        CustomerVisit oldCustomerVisit = customerVisitMapper.selectOne(lambdaQueryWrapper);
263
+        if (null != oldCustomerVisit) {
264
+            throw new Exception("不允许重复报备");
265
+        }
258
         customerVisitMapper.insert(customerVisit);
266
         customerVisitMapper.insert(customerVisit);
259
 
267
 
260
         return ResponseBean.success("审核成功");
268
         return ResponseBean.success("审核成功");

+ 6
- 2
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

1019
             t.recommend_person,
1019
             t.recommend_person,
1020
             null as channel_id,
1020
             null as channel_id,
1021
             p.name as channelName,
1021
             p.name as channelName,
1022
-            t.create_date
1022
+            t.create_date,
1023
+            if(v.customer_visit_id is not null || t.`status` = 2 ,true,false) as visitStatus
1023
         FROM
1024
         FROM
1024
             ta_recommend_customer t
1025
             ta_recommend_customer t
1025
          left JOIN ta_person p ON t.realty_consultant = p.person_id
1026
          left JOIN ta_person p ON t.realty_consultant = p.person_id
1027
+         LEFT JOIN xlk_customer_visit v on t.customer_id = v.customer_id
1026
         WHERE
1028
         WHERE
1027
             t.building_id = #{buildingId}
1029
             t.building_id = #{buildingId}
1028
         and t.entry_type = "verify"
1030
         and t.entry_type = "verify"
1044
         t.recommend_person,
1046
         t.recommend_person,
1045
         t.channel_id,
1047
         t.channel_id,
1046
         c.channel_name as channelName,
1048
         c.channel_name as channelName,
1047
-        t.create_date
1049
+        t.create_date,
1050
+        false as visitStatus
1048
         FROM
1051
         FROM
1049
             xlk_channel_customer t
1052
             xlk_channel_customer t
1050
         Left join ta_channel c on t.channel_id = c.channel_id
1053
         Left join ta_channel c on t.channel_id = c.channel_id
1054
         <if test="keywords != null and keywords !=''">
1057
         <if test="keywords != null and keywords !=''">
1055
             and t.name like CONCAT('%',#{keywords}, '%')
1058
             and t.name like CONCAT('%',#{keywords}, '%')
1056
         </if>
1059
         </if>
1060
+        ORDER BY create_date desc
1057
     </select>
1061
     </select>
1058
     <select id="getCustomersRecommended" resultType="com.yunzhi.marketing.entity.TaRecommendCustomer">
1062
     <select id="getCustomersRecommended" resultType="com.yunzhi.marketing.entity.TaRecommendCustomer">
1059
         select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id
1063
         select a.*,b.avatarurl from ta_recommend_customer a left join ta_person b on a.person_id = b.person_id

+ 0
- 3
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml View File

86
         LEFT JOIN ta_building d on a.building_id = d.building_id
86
         LEFT JOIN ta_building d on a.building_id = d.building_id
87
         WHERE
87
         WHERE
88
         a.recommend_person = #{params.personId}
88
         a.recommend_person = #{params.personId}
89
-        and a.`status` != 3
90
         and a.org_id = #{params.orgId}
89
         and a.org_id = #{params.orgId}
91
         <if test="params.status != null and params.status !=''">
90
         <if test="params.status != null and params.status !=''">
92
             and c.status = #{params.status}
91
             and c.status = #{params.status}
109
         FROM
108
         FROM
110
         xlk_channel_customer t
109
         xlk_channel_customer t
111
         WHERE t.channel_id  = #{params.channelId}
110
         WHERE t.channel_id  = #{params.channelId}
112
-        and t.`status` = 1
113
         <if test="params.startDate != null or params.endDate != null">
111
         <if test="params.startDate != null or params.endDate != null">
114
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
112
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
115
         </if>
113
         </if>
144
         FROM
142
         FROM
145
         xlk_channel_customer t
143
         xlk_channel_customer t
146
         WHERE t.channel_id  = #{params.channelId}
144
         WHERE t.channel_id  = #{params.channelId}
147
-        and t.`status` = 1
148
         <if test="params.startDate != null or params.endDate != null">
145
         <if test="params.startDate != null or params.endDate != null">
149
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
146
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
150
         </if>
147
         </if>

+ 2
- 1
src/main/resources/mapper/xlk/SearchHouseMapper.xml View File

9
             p.`nickname`,
9
             p.`nickname`,
10
             p.phone,
10
             p.phone,
11
             p.gender,
11
             p.gender,
12
-            c.`name`
12
+            CONCAT(cc.name,c.name) as `name`
13
         FROM
13
         FROM
14
             xlk_search_house t
14
             xlk_search_house t
15
             LEFT JOIN ta_person p ON t.person_id = p.person_id
15
             LEFT JOIN ta_person p ON t.person_id = p.person_id
16
             LEFT JOIN td_city c on t.intent_area = c.id
16
             LEFT JOIN td_city c on t.intent_area = c.id
17
+            LEFT JOIN td_city cc on cc.id = c.parentid
17
             WHERE t.ORG_ID = #{params.orgId}
18
             WHERE t.ORG_ID = #{params.orgId}
18
                 and t.type = #{params.type}
19
                 and t.type = #{params.type}
19
         <if test="params.nickname != null and params.nickname != ''">
20
         <if test="params.nickname != null and params.nickname != ''">