傅行帆 3 lat temu
rodzic
commit
19ec0cff90

+ 3
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Wyświetl plik

@@ -667,7 +667,9 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
667 667
 
668 668
         // 兼容渠道报备客户
669 669
         if (null == taRecommendCustomer) {
670
-            ChannelCustomer customer = channelCustomerMapper.selectById(id);
670
+            LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
671
+            channelCustomerLambdaQueryWrapper.eq(ChannelCustomer::getCustomerId,id);
672
+            ChannelCustomer customer = channelCustomerMapper.selectOne(channelCustomerLambdaQueryWrapper);
671 673
             BeanUtils.copyProperties(customer,taRecommendCustomer);
672 674
         }
673 675
 

+ 9
- 2
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java Wyświetl plik

@@ -8,6 +8,7 @@ import com.yunzhi.marketing.base.BaseController;
8 8
 import com.yunzhi.marketing.base.ResponseBean;
9 9
 import com.yunzhi.marketing.entity.TaPerson;
10 10
 import com.yunzhi.marketing.service.ITaPersonService;
11
+import com.yunzhi.marketing.service.ITaRecommendCustomerService;
11 12
 import com.yunzhi.marketing.xlk.dto.*;
12 13
 import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
13 14
 import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
@@ -40,6 +41,9 @@ public class ChannelCustomerController extends BaseController {
40 41
     @Autowired
41 42
     public IChannelCustomerService iChannelCustomerService;
42 43
 
44
+    @Autowired
45
+    ITaRecommendCustomerService taRecommendCustomerService;
46
+
43 47
     @Autowired
44 48
     private ITaPersonService taPersonService;
45 49
 
@@ -94,6 +98,7 @@ public class ChannelCustomerController extends BaseController {
94 98
     @ApiOperation(value = "admin-渠道报备客户审核", notes = "admin-渠道报备客户审核")
95 99
     @RequestMapping(value="/admin/channelCustomer/{id}",method= RequestMethod.PUT)
96 100
     public ResponseBean channelCustomerUpdate(@PathVariable String id,
101
+                                              @RequestHeader("authorization") String token,
97 102
                                         @RequestBody ChannelCustomerDTO channelCustomerDTO){
98 103
         return iChannelCustomerService.auditCustomer(id,channelCustomerDTO);
99 104
     }
@@ -164,11 +169,13 @@ public class ChannelCustomerController extends BaseController {
164 169
      * 根据id查询对象
165 170
      * @param id  实体ID
166 171
      */
172
+    @ApiOperation(value = "森哥看这里-admin-后台获取详情信息", notes = "森哥看这里-admin-后台获取详情信息")
167 173
     @RequestMapping(value="/admin/channelCustomer/{id}",method= RequestMethod.GET)
168
-    public ResponseBean channelCustomerGet(@PathVariable String id){
174
+    public ResponseBean channelCustomerGet(@PathVariable String id, @RequestHeader("authorization") String token){
169 175
         ResponseBean responseBean = new ResponseBean();
170 176
         try {
171
-            responseBean.addSuccess(iChannelCustomerService.getById(id));
177
+            ChannelCustomer channelCustomer = iChannelCustomerService.getById(id);
178
+            responseBean.addSuccess(taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId()));
172 179
         }catch (Exception e){
173 180
             e.printStackTrace();
174 181
             logger.error("channelCustomerDelete -=- {}",e.toString());

+ 8
- 18
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml Wyświetl plik

@@ -131,13 +131,8 @@
131 131
     </select>
132 132
     <select id="getNewCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
133 133
         SELECT
134
-        <if test="params.type == 'day''">
135
-            date_format( t.create_date, '%d' ) as coordinate,
136
-        </if>
137
-        <if test="params.type == 'month''">
138
-            date_format( t.create_date, '%m' ) as coordinate,
139
-        </if>
140
-        COUNT(1) as customerNum
134
+            date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
135
+            COUNT(1) as customerNum
141 136
         FROM
142 137
         xlk_channel_customer t
143 138
         WHERE t.channel_id  = #{params.channelId}
@@ -149,22 +144,17 @@
149 144
         <if test="params.startDate == null or params.endDate == null">
150 145
             AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
151 146
         </if>
152
-        <if test="params.type == 'day''">
147
+        <if test="params.type == 'day'">
153 148
             group by date_format( t.create_date, '%Y-%m-%d' )
154 149
         </if>
155
-        <if test="params.type == 'month''">
150
+        <if test="params.type == 'month'">
156 151
             group by date_format( t.create_date, '%Y-%m' )
157 152
         </if>
158 153
     </select>
159 154
     <select id="getSuccessCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
160 155
         SELECT
161
-        <if test="params.type == 'day''">
162
-            date_format( t.create_date, '%d' ) as coordinate,
163
-        </if>
164
-        <if test="params.type == 'month''">
165
-            date_format( t.create_date, '%m' ) as coordinate,
166
-        </if>
167
-        COUNT(1) as customerNum
156
+            date_format( t.create_date, '%%Y-%m-%d' ) as coordinate,
157
+            COUNT(1) as customerNum
168 158
         FROM
169 159
         xlk_channel_customer t
170 160
         LEFT join ta_recommend_customer r on t.customer_id = r.customer_id
@@ -177,10 +167,10 @@
177 167
         <if test="params.startDate == null or params.endDate == null">
178 168
             AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
179 169
         </if>
180
-        <if test="params.type == 'day''">
170
+        <if test="params.type == 'day'">
181 171
             group by date_format( t.create_date, '%Y-%m-%d' )
182 172
         </if>
183
-        <if test="params.type == 'month''">
173
+        <if test="params.type == 'month'">
184 174
             group by date_format( t.create_date, '%Y-%m' )
185 175
         </if>
186 176
     </select>

+ 2
- 7
src/main/resources/mapper/xlk/CustomerVisitMapper.xml Wyświetl plik

@@ -19,13 +19,8 @@
19 19
     </select>
20 20
     <select id="getFollowCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
21 21
         SELECT
22
-        <if test="params.type == 'day''">
23
-            date_format( t.create_date, '%d' ) as coordinate,
24
-        </if>
25
-        <if test="params.type == 'month''">
26
-            date_format( t.create_date, '%m' ) as coordinate,
27
-        </if>
28
-        COUNT(1) as customerNum
22
+            date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
23
+            COUNT(1) as customerNum
29 24
         FROM
30 25
         xlk_channel_customer t
31 26
         INNER JOIN xlk_customer_visit v on t.customer_id = v.customer_id