张延森 3 år sedan
förälder
incheckning
1dfbde41d0

+ 2
- 1
src/main/java/com/yunzhi/marketing/controller/TaBuildingDynamicController.java Visa fil

@@ -588,7 +588,8 @@ public class TaBuildingDynamicController extends BaseController {
588 588
         if (dynamic.getType().equals("look")) {
589 589
             LambdaQueryWrapper<TaBuildingDynamic> lambdaQueryWrapper = new LambdaQueryWrapper<>();
590 590
             lambdaQueryWrapper.eq(TaBuildingDynamic::getStatus,1);
591
-            lambdaQueryWrapper.eq(TaBuildingDynamic::getBuildingId,dynamic.getBuildingId());
591
+            lambdaQueryWrapper.eq(TaBuildingDynamic::getType,"look");
592
+            lambdaQueryWrapper.eq(TaBuildingDynamic::getBuilding,dynamic.getBuildingId());
592 593
             List<TaBuildingDynamic> list = iBuildingDynamicService.list(lambdaQueryWrapper);
593 594
             if (list.size() > 0){
594 595
                 responseBean.addError("相同的项目看房团只能发布一个");

+ 16
- 15
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Visa fil

@@ -1526,7 +1526,8 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
1526 1526
         // 4.校验公客是否已经是分配项目下的私客
1527 1527
         QueryWrapper<TaRecommendCustomer> customerQueryWrapper2 = new QueryWrapper<>();
1528 1528
         customerQueryWrapper2.eq("org_id", orgId);
1529
-        customerQueryWrapper2.eq("person_id", customerInfo.getPersonId());
1529
+//        customerQueryWrapper2.eq("person_id", customerInfo.getPersonId());
1530
+        customerQueryWrapper2.eq("phone", customerInfo.getPhone());
1530 1531
         customerQueryWrapper2.eq("building_id", taPersonBuilding.getBuildingId());
1531 1532
         customerQueryWrapper2.eq("status", CommConstant.CUSTOMER_REPORT);
1532 1533
         customerQueryWrapper2.eq("verify_status", CommConstant.VERIFY_AGREE);
@@ -1539,19 +1540,19 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
1539 1540
         }
1540 1541
 
1541 1542
         // 5.无buildingId,新增一条私客数据
1542
-        TaPerson taPerson = taPersonMapper.getById(customerInfo.getPersonId());
1543
-        if (taPerson == null) {
1544
-            logger.info("公客分配置业顾问 taPerson为空");
1545
-            responseBean.addError("分配客户失败");
1546
-            return responseBean;
1547
-        }
1543
+//        TaPerson taPerson = taPersonMapper.getById(customerInfo.getPersonId());
1544
+//        if (taPerson == null) {
1545
+//            logger.info("公客分配置业顾问 taPerson为空");
1546
+//            responseBean.addError("分配客户失败");
1547
+//            return responseBean;
1548
+//        }
1548 1549
 
1549 1550
         TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
1550 1551
         taRecommendCustomer.setOrgId(orgId);
1551
-        taRecommendCustomer.setName(taPerson.getNickname());
1552
-        taRecommendCustomer.setPicture(taPerson.getAvatarurl());
1553
-        taRecommendCustomer.setPhone(taPerson.getPhone());
1554
-        taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
1552
+        taRecommendCustomer.setName(customerInfo.getName());
1553
+        taRecommendCustomer.setPicture(customerInfo.getAvatarurl());
1554
+        taRecommendCustomer.setPhone(customerInfo.getPhone());
1555
+        taRecommendCustomer.setSex(null == customerInfo.getSex() ? null : ("1".equals(customerInfo.getSex()) ? 1 : 2));
1555 1556
         taRecommendCustomer.setRealtyConsultant(taUser.getUserId());
1556 1557
         taRecommendCustomer.setBuildingId(taPersonBuilding.getBuildingId());
1557 1558
         TaBuilding building = taBuildingMapper.selectById(taPersonBuilding.getBuildingId());
@@ -1559,13 +1560,13 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
1559 1560
         taRecommendCustomer.setReportRecommendStatus(CommConstant.VERIFY_AGREE);
1560 1561
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
1561 1562
         taRecommendCustomer.setReportDate(LocalDateTime.now());
1562
-        taRecommendCustomer.setPersonId(taPerson.getPersonId());
1563
+        taRecommendCustomer.setPersonId(customerInfo.getPersonId());
1563 1564
         taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
1564 1565
         taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
1565 1566
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
1566
-        taRecommendCustomer.setPersonId(taPerson.getPersonId());
1567
-        taRecommendCustomer.setRecommendPerson(taPerson.getRecommendPerson());
1568
-
1567
+        taRecommendCustomer.setPersonId(customerInfo.getPersonId());
1568
+        taRecommendCustomer.setRecommendPerson(customerInfo.getRecommendPerson());
1569
+        taRecommendCustomer.setInstitutionId(customerInfo.getInstitutionId());
1569 1570
         int row = taRecommendCustomerMapper.insert(taRecommendCustomer);
1570 1571
         if (row < 1) {
1571 1572
             responseBean.addError("分配客户失败");

+ 15
- 4
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java Visa fil

@@ -60,9 +60,8 @@ public class BrandController extends BaseController {
60 60
      * @return
61 61
      */
62 62
     @ApiOperation(value = "admin-品牌开发商表列表", notes = "admin-品牌开发商表列表")
63
-    @RequestMapping(value="/{plat}/brand",method= RequestMethod.GET)
64
-    public ResponseBean brandList(@PathVariable String plat,
65
-                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
63
+    @RequestMapping(value="/admin/brand",method= RequestMethod.GET)
64
+    public ResponseBean brandList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66 65
                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
67 66
                                   @RequestParam(value ="brandName",required = false) String brandName,
68 67
                                   @RequestHeader("authorization") String token,HttpServletRequest request){
@@ -73,7 +72,7 @@ public class BrandController extends BaseController {
73 72
             LambdaQueryWrapper<Brand> queryWrapper = new LambdaQueryWrapper<>();
74 73
             queryWrapper.eq(Brand::getOrgId,getOrgId(request));
75 74
             queryWrapper.like(!StringUtils.isEmpty(brandName),Brand::getBrandName,brandName);
76
-            queryWrapper.orderByDesc(Brand::getCreatedTime);
75
+            queryWrapper.orderByAsc(Brand::getIndexLetter);
77 76
 
78 77
             IPage<Brand> result = iBrandService.page(pg, queryWrapper);
79 78
             responseBean.addSuccess(result);
@@ -85,6 +84,18 @@ public class BrandController extends BaseController {
85 84
         return responseBean;
86 85
     }
87 86
 
87
+    /**
88
+     *
89
+     * @return
90
+     */
91
+    @ApiOperation(value = "wx-品牌开发商表列表", notes = "wx-品牌开发商表列表")
92
+    @RequestMapping(value="/wx/brand",method= RequestMethod.GET)
93
+    public ResponseBean wxBrandList(@RequestParam(value ="brandName",required = false) String brandName,
94
+                                  @RequestParam(value ="cityId",required = false) Integer cityId,
95
+                                  @RequestHeader("authorization") String token,HttpServletRequest request){
96
+        return iBrandService.getWxBrandList(cityId,brandName,getOrgId(request));
97
+    }
98
+
88 99
     /**
89 100
      * 保存对象
90 101
      * @param brandDTO 实体对象

+ 9
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/BrandMapper.java Visa fil

@@ -1,8 +1,10 @@
1 1
 package com.yunzhi.marketing.xlk.mapper;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6 8
 
7 9
 /**
8 10
  * <p>
@@ -15,4 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
15 17
 @Mapper
16 18
 public interface BrandMapper extends BaseMapper<Brand> {
17 19
 
20
+    /**
21
+     * 获取品牌开发商列表
22
+     * @param cityId
23
+     * @param brandName
24
+     * @return
25
+     */
26
+    ResponseBean getWxBrandList(Integer cityId, String brandName,Integer orgId);
18 27
 }

+ 8
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IBrandService.java Visa fil

@@ -1,5 +1,6 @@
1 1
 package com.yunzhi.marketing.xlk.service;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
5 6
 
@@ -13,4 +14,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
13 14
  */
14 15
 public interface IBrandService extends IService<Brand> {
15 16
 
17
+    /**
18
+     * 获取微信端的品牌开发商
19
+     * @param cityId
20
+     * @param brandName
21
+     * @return
22
+     */
23
+    ResponseBean getWxBrandList(Integer cityId, String brandName, Integer orgId);
16 24
 }

+ 12
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/BrandServiceImpl.java Visa fil

@@ -1,5 +1,6 @@
1 1
 package com.yunzhi.marketing.xlk.service.impl;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.yunzhi.marketing.xlk.mapper.BrandMapper;
5 6
 import com.yunzhi.marketing.xlk.service.IBrandService;
@@ -17,4 +18,15 @@ import org.springframework.stereotype.Service;
17 18
 @Service
18 19
 public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
19 20
 
21
+    /**
22
+     * 获取微信端的品牌开发商
23
+     *
24
+     * @param cityId
25
+     * @param brandName
26
+     * @return
27
+     */
28
+    @Override
29
+    public ResponseBean getWxBrandList(Integer cityId, String brandName,Integer orgId) {
30
+        return this.baseMapper.getWxBrandList(cityId, brandName,orgId);
31
+    }
20 32
 }

+ 26
- 0
src/main/resources/mapper/xlk/BrandMapper.xml Visa fil

@@ -2,4 +2,30 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.BrandMapper">
4 4
 
5
+    <select id="getWxBrandList" resultType="com.yunzhi.marketing.base.ResponseBean">
6
+        SELECT
7
+            b.*
8
+        FROM
9
+            xlk_brand b
10
+            INNER JOIN (
11
+            SELECT
12
+                t.building_id,
13
+                t.brand_id
14
+            FROM
15
+                ta_building t
16
+            WHERE
17
+                t.org_id = #{orgId}
18
+            <if test="cityId != null and cityId != ''">
19
+                AND t.city_id = #{cityId}
20
+            </if>
21
+            GROUP BY
22
+                t.brand_id
23
+            ) c ON b.brand_id = c.brand_id
24
+        WHERE
25
+            b.ORG_ID = #{orgId}
26
+        <if test="brandName != null and brandName != ''">
27
+            and b.brand_name like CONCAT('%', #{brandName}, '%')
28
+        </if>
29
+        ORDER BY b.Index_letter
30
+    </select>
5 31
 </mapper>