张延森 il y a 2 ans
Parent
révision
6156ee567b

+ 3
- 3
src/main/java/com/yunzhi/marketing/base/BaseController.java Voir le fichier

@@ -137,9 +137,9 @@ public class BaseController {
137 137
         TaUser taUser = taUserService.getById(getUserId(request));
138 138
         List<Institution> list = iInstitutionService.getAllByUser(taUser);
139 139
         List<String> institutions = list.stream().map(Institution::getInstitutionId).collect(Collectors.toList());
140
-        if (institutions.contains(CommConstant.ROOT_INSTITUTION)) {
141
-            return null;
142
-        }
140
+//        if (institutions.contains(CommConstant.ROOT_INSTITUTION)) {
141
+//            return null;
142
+//        }
143 143
         return institutions;
144 144
     }
145 145
 

+ 14
- 1
src/main/java/com/yunzhi/marketing/broker/controller/BkFirstScreenController.java Voir le fichier

@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
24 24
 
25 25
 import javax.servlet.http.HttpServletRequest;
26 26
 import java.util.List;
27
+import java.util.UUID;
27 28
 
28 29
 /**
29 30
  * <p>
@@ -85,10 +86,17 @@ public class BkFirstScreenController extends BaseController {
85 86
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
86 87
     public ResponseBean bkFirstScreenAdd(@ApiParam("保存内容") @RequestBody BkFirstScreen bkFirstScreen,
87 88
                                          HttpServletRequest request) throws Exception{
88
-
89
+        String uuid = UUID.randomUUID().toString().replaceAll("-","");
90
+        bkFirstScreen.setScreenId(uuid);
89 91
         bkFirstScreen.setInstitutionId(CommConstant.ROOT_INSTITUTION);
90 92
         bkFirstScreen.setOrgId(getOrgId(request).toString());
91 93
 
94
+        if (!StringUtils.isEmpty(bkFirstScreen.getPageParam())) {
95
+            if (bkFirstScreen.getPageParam().contains("{id}")) {
96
+                bkFirstScreen.setPageParam(bkFirstScreen.getPageParam().replace("{id}", uuid));
97
+            }
98
+        }
99
+
92 100
         if (iBkFirstScreenService.save(bkFirstScreen)){
93 101
             return ResponseBean.success(bkFirstScreen);
94 102
         }else {
@@ -122,6 +130,11 @@ public class BkFirstScreenController extends BaseController {
122 130
                                         @ApiParam("更新内容") @RequestBody BkFirstScreen bkFirstScreen) throws Exception{
123 131
 
124 132
         bkFirstScreen.setScreenId(id);
133
+        if (!StringUtils.isEmpty(bkFirstScreen.getPageParam())) {
134
+            if (bkFirstScreen.getPageParam().contains("{id}")) {
135
+                bkFirstScreen.setPageParam(bkFirstScreen.getPageParam().replace("{id}", id));
136
+            }
137
+        }
125 138
 
126 139
         if (iBkFirstScreenService.updateById(bkFirstScreen)){
127 140
             return ResponseBean.success(iBkFirstScreenService.getById(id));

+ 23
- 0
src/main/java/com/yunzhi/marketing/broker/controller/BrokerController.java Voir le fichier

@@ -11,6 +11,8 @@ import com.yunzhi.marketing.broker.vo.BrokerVO;
11 11
 import com.yunzhi.marketing.common.CommConstant;
12 12
 import com.yunzhi.marketing.common.StringUtils;
13 13
 import com.yunzhi.marketing.entity.TaPerson;
14
+import com.yunzhi.marketing.xlk.entity.ChannelCustomer;
15
+import com.yunzhi.marketing.xlk.service.IChannelCustomerService;
14 16
 import io.swagger.annotations.Api;
15 17
 import io.swagger.annotations.ApiOperation;
16 18
 import io.swagger.annotations.ApiParam;
@@ -34,6 +36,9 @@ public class BrokerController extends BaseController {
34 36
     @Autowired
35 37
     IBkInviteRecordService iBkInviteRecordService;
36 38
 
39
+    @Autowired
40
+    IChannelCustomerService iChannelCustomerService;
41
+
37 42
 
38 43
     @RequestMapping(value="/admin/broker",method= RequestMethod.GET)
39 44
     @ApiOperation(value="经纪人列表", notes = "经纪人列表", httpMethod = "GET", response = ResponseBean.class)
@@ -51,6 +56,24 @@ public class BrokerController extends BaseController {
51 56
     }
52 57
 
53 58
 
59
+    @RequestMapping(value="/admin/broker/customer",method= RequestMethod.GET)
60
+    @ApiOperation(value="经纪人客户列表", notes = "经纪人客户列表", httpMethod = "GET", response = ResponseBean.class)
61
+    public ResponseBean getCustomerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
62
+                                      @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
63
+                                      @ApiParam("手机号") @RequestParam(value ="phone", required = false) String phone,
64
+                                      @ApiParam("姓名") @RequestParam(value ="name", required = false) String name,
65
+                                      @ApiParam("推荐人") @RequestParam(value ="recommendPerson", required = false) String recommendPerson) throws Exception {
66
+
67
+        if (StringUtils.isEmpty(recommendPerson)) {
68
+            return ResponseBean.error("请选择推荐经纪人", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+
71
+        IPage<ChannelCustomer> page = new Page<>(pageNum, pageSize);
72
+        IPage<ChannelCustomer> result = iChannelCustomerService.getPageByBroker(page, recommendPerson, name, phone);
73
+        return ResponseBean.success(result);
74
+    }
75
+
76
+
54 77
     @RequestMapping(value="/wx/broker",method= RequestMethod.GET)
55 78
     @ApiOperation(value="小程序端经纪人列表", notes = "小程序端经纪人列表", httpMethod = "GET", response = ResponseBean.class)
56 79
     public ResponseBean getWxBrokerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,

+ 1
- 1
src/main/java/com/yunzhi/marketing/broker/entity/BkFirstScreen.java Voir le fichier

@@ -27,7 +27,7 @@ public class BkFirstScreen implements Serializable {
27 27
     private static final long serialVersionUID = 1L;
28 28
 
29 29
     @ApiModelProperty(value = "ID")
30
-    @TableId(value = "screen_id", type = IdType.UUID)
30
+    @TableId(value = "screen_id", type = IdType.INPUT)
31 31
     private String screenId;
32 32
 
33 33
     @ApiModelProperty(value = "标题")

+ 1
- 1
src/main/java/com/yunzhi/marketing/controller/ExtendContentController.java Voir le fichier

@@ -97,7 +97,7 @@ public class ExtendContentController extends BaseController {
97 97
             queryWrapper.ne("status",9);
98 98
             queryWrapper.eq(status != null, "status", status);
99 99
             queryWrapper.eq( "org_id", getOrgId(request));
100
-            queryWrapper.in("institution_id",getInstitutionIds(request));
100
+            queryWrapper.in("institution_id", getInstitutionIds(request));
101 101
             queryWrapper.and(taPersonBuildingList.size() > 0, wapper -> wapper.in("building_id",taPersonBuildingList.stream().map(TaPersonBuilding::getBuildingId).collect(Collectors.toList())).or().eq("create_user",getUserId(request)));
102 102
             queryWrapper.orderByDesc("order_no");
103 103
             queryWrapper.orderByDesc("create_date");

+ 0
- 1
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Voir le fichier

@@ -666,7 +666,6 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
666 666
             return ResponseBean.error("已存在的客户报备失败", ResponseBean.ERROR_UNAVAILABLE);
667 667
         }
668 668
 
669
-
670 669
         // 如果是全民经纪人
671 670
         if (CommConstant.PERSON_BROKER.equals(person.getPersonType())) {
672 671
             TaBuilding taBuilding = taBuildingMapper.selectById(buildingId);

+ 2
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/ChannelCustomerMapper.java Voir le fichier

@@ -60,4 +60,6 @@ public interface ChannelCustomerMapper extends BaseMapper<ChannelCustomer> {
60 60
     ChannelCustomer getMoreInfoById(@Param("channelCustomerId") String channelCustomerId, @Param("customerId") String customerId);
61 61
 
62 62
     List<ChannelCustomer> getRecommendedOrExpired(@Param("buildingId") String buildingId,@Param("phone") String phone);
63
+
64
+    IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, @Param("recommendPerson") String recommendPerson, @Param("name") String name, @Param("phone") String phone);
63 65
 }

+ 2
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IChannelCustomerService.java Voir le fichier

@@ -93,4 +93,6 @@ public interface IChannelCustomerService extends IService<ChannelCustomer> {
93 93
      * @throws Exception
94 94
      */
95 95
     void updateBizNode(MarkingSignatoryCustomerDTO params, Integer bizStatus, String bizType) throws Exception;
96
+
97
+    IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, String recommendPerson, String name, String phone);
96 98
 }

+ 5
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java Voir le fichier

@@ -661,6 +661,11 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
661 661
         }
662 662
     }
663 663
 
664
+    @Override
665
+    public IPage<ChannelCustomer> getPageByBroker(IPage<ChannelCustomer> page, String recommendPerson, String name, String phone) {
666
+        return baseMapper.getPageByBroker(page, recommendPerson, name, phone);
667
+    }
668
+
664 669
     private Integer intIfNvl(Integer i) {
665 670
         return i == null ? 0 : i;
666 671
     }

+ 45
- 1
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml Voir le fichier

@@ -78,13 +78,14 @@
78 78
             b.avatarurl ,
79 79
             ifnull(c.`status`, 1) as customer_status,
80 80
             if(c.customer_id is null, "report", "customer") as type,
81
-            d.expiration_date,
81
+            IF(a.recommend_person_type = 'broker', m.expiration_days, d.expiration_date) as expiration_date,
82 82
             d.building_name
83 83
         FROM
84 84
             xlk_channel_customer a
85 85
         LEFT JOIN ta_person b ON a.person_id = b.person_id
86 86
         left join ta_recommend_customer c on a.customer_id = c.customer_id
87 87
         LEFT JOIN ta_building d on a.building_id = d.building_id
88
+        LEFT JOIN bk_agreement m ON a.building_id = m.building_id
88 89
         WHERE
89 90
         a.recommend_person = #{params.personId}
90 91
         and a.org_id = #{params.orgId}
@@ -221,4 +222,47 @@
221 222
                 )
222 223
             )
223 224
     </select>
225
+    <select id="getPageByBroker" resultType="com.yunzhi.marketing.xlk.entity.ChannelCustomer">
226
+        SELECT
227
+            t.channel_customer_id,
228
+            t.create_date,
229
+            t.org_id,
230
+            t.building_id,
231
+            fun_mix_str ( t.phone, 4 ) AS phone,
232
+            t.`name`,
233
+            t.picture,
234
+            t.sex,
235
+            t.person_id,
236
+            t.`status`,
237
+            t.channel_id,
238
+            t.recommend_person,
239
+            t.realty_consultant,
240
+            t.remark,
241
+            t.customer_id,
242
+            t.visit_date,
243
+            t.preparatory_date,
244
+            t.signed_date,
245
+            t.commission_date,
246
+            t.institution_id,
247
+            t.recommend_person_type,
248
+            t.total_commission,
249
+            t.unsettled_commission,
250
+            t.settled_commission,
251
+            s.building_name
252
+        FROM
253
+            xlk_channel_customer t
254
+                INNER JOIN ta_building s ON t.building_id = s.building_id
255
+        WHERE
256
+            t.recommend_person = #{recommendPerson}
257
+          <if test="name != null and name != ''">
258
+              AND t.`name` LIKE CONCAT( '%', #{name}, '%' )
259
+          </if>
260
+          <if test="phone != null and phone != ''">
261
+              AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
262
+          </if>
263
+            AND t.`status` = 2
264
+--           AND t.`status` &gt; -1
265
+        ORDER BY
266
+            t.create_date DESC
267
+    </select>
224 268
 </mapper>