Browse Source

Merge branch 'develop' of http://git.ycjcjy.com/marketing/services into develop

傅行帆 3 years ago
parent
commit
aad8078791

+ 1
- 1
pom.xml View File

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>marketing</artifactId>
13
-	<version>v1.0.7</version>
13
+	<version>v1.0.12</version>
14 14
 	<name>marketing-cloud</name>
15 15
 	<description>新联康营销云</description>
16 16
 

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

@@ -588,6 +588,7 @@ 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::getType,"look");
591 592
             lambdaQueryWrapper.eq(TaBuildingDynamic::getBuilding,dynamic.getBuildingId());
592 593
             List<TaBuildingDynamic> list = iBuildingDynamicService.list(lambdaQueryWrapper);
593 594
             if (list.size() > 0){

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

@@ -85,7 +85,6 @@ public class TaPolicyController extends BaseController {
85 85
             queryWrapper.orderByDesc("weight", "create_date");
86 86
             queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
87 87
             queryWrapper.eq("org_id", getOrgId(request));
88
-            queryWrapper.in("institution_id",getInstitutionIds(request));
89 88
 
90 89
             IPage<TaPolicy> result = iTaPolicyService.page(pg, queryWrapper);
91 90
             List<TaPolicy> records = result.getRecords();

+ 7
- 6
src/main/java/com/yunzhi/marketing/service/impl/TaBuildingServiceImpl.java View File

@@ -621,13 +621,14 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
621 621
             tdCityMapper.updateById(city);
622 622
         }
623 623
 
624
+        // 新联康不需要这个逻辑了
624 625
         //新建项目以后自动授权给当前用户
625
-        TaUser taUser = taUserMapper.selectById(userId);
626
-        TaPersonBuilding taPersonBuilding = new TaPersonBuilding();
627
-        taPersonBuilding.setBuildingId(building.getBuildingId());
628
-        taPersonBuilding.setUserId(taUser.getUserId());
629
-        taPersonBuilding.setCreateDate(LocalDateTime.now());
630
-        taPersonBuildingMapper.insert(taPersonBuilding);
626
+//        TaUser taUser = taUserMapper.selectById(userId);
627
+//        TaPersonBuilding taPersonBuilding = new TaPersonBuilding();
628
+//        taPersonBuilding.setBuildingId(building.getBuildingId());
629
+//        taPersonBuilding.setUserId(taUser.getUserId());
630
+//        taPersonBuilding.setCreateDate(LocalDateTime.now());
631
+//        taPersonBuildingMapper.insert(taPersonBuilding);
631 632
 
632 633
         // 项目主图
633 634
         String imgStr = object.getString("img");

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

@@ -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("分配客户失败");

+ 22
- 4
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java View File

@@ -29,7 +29,9 @@ import org.springframework.web.bind.annotation.RestController;
29 29
 
30 30
 import javax.servlet.http.HttpServletRequest;
31 31
 import java.time.LocalDateTime;
32
+import java.util.HashMap;
32 33
 import java.util.List;
34
+import java.util.Map;
33 35
 
34 36
 /**
35 37
  * <p>
@@ -60,9 +62,8 @@ public class BrandController extends BaseController {
60 62
      * @return
61 63
      */
62 64
     @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,
65
+    @RequestMapping(value="/admin/brand",method= RequestMethod.GET)
66
+    public ResponseBean brandList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66 67
                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
67 68
                                   @RequestParam(value ="brandName",required = false) String brandName,
68 69
                                   @RequestHeader("authorization") String token,HttpServletRequest request){
@@ -73,7 +74,7 @@ public class BrandController extends BaseController {
73 74
             LambdaQueryWrapper<Brand> queryWrapper = new LambdaQueryWrapper<>();
74 75
             queryWrapper.eq(Brand::getOrgId,getOrgId(request));
75 76
             queryWrapper.like(!StringUtils.isEmpty(brandName),Brand::getBrandName,brandName);
76
-            queryWrapper.orderByDesc(Brand::getCreatedTime);
77
+            queryWrapper.orderByAsc(Brand::getIndexLetter);
77 78
 
78 79
             IPage<Brand> result = iBrandService.page(pg, queryWrapper);
79 80
             responseBean.addSuccess(result);
@@ -85,6 +86,23 @@ public class BrandController extends BaseController {
85 86
         return responseBean;
86 87
     }
87 88
 
89
+    /**
90
+     *
91
+     * @return
92
+     */
93
+    @ApiOperation(value = "wx-品牌开发商表列表", notes = "wx-品牌开发商表列表")
94
+    @RequestMapping(value="/wx/brand",method= RequestMethod.GET)
95
+    public ResponseBean wxBrandList(@RequestParam(value ="brandName",required = false) String brandName,
96
+                                  @RequestParam(value ="cityId",required = false) Integer cityId,
97
+                                  @RequestHeader("authorization") String token,HttpServletRequest request){
98
+        List<Brand> brandList = iBrandService.getWxBrandList(cityId, brandName, getOrgId(request));
99
+
100
+        Map<String, Object> result = new HashMap<>();
101
+        result.put("records", brandList);
102
+
103
+        return ResponseBean.success(result);
104
+    }
105
+
88 106
     /**
89 107
      * 保存对象
90 108
      * @param brandDTO 实体对象

+ 11
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/BrandMapper.java View File

@@ -1,8 +1,12 @@
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;
8
+
9
+import java.util.List;
6 10
 
7 11
 /**
8 12
  * <p>
@@ -15,4 +19,11 @@ import org.apache.ibatis.annotations.Mapper;
15 19
 @Mapper
16 20
 public interface BrandMapper extends BaseMapper<Brand> {
17 21
 
22
+    /**
23
+     * 获取品牌开发商列表
24
+     * @param cityId
25
+     * @param brandName
26
+     * @return
27
+     */
28
+    List<Brand> getWxBrandList(Integer cityId, String brandName, Integer orgId);
18 29
 }

+ 10
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IBrandService.java View File

@@ -1,8 +1,11 @@
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
 
7
+import java.util.List;
8
+
6 9
 /**
7 10
  * <p>
8 11
  * 品牌开发商表  服务类
@@ -13,4 +16,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
13 16
  */
14 17
 public interface IBrandService extends IService<Brand> {
15 18
 
19
+    /**
20
+     * 获取微信端的品牌开发商
21
+     * @param cityId
22
+     * @param brandName
23
+     * @return
24
+     */
25
+    List<Brand> getWxBrandList(Integer cityId, String brandName, Integer orgId);
16 26
 }

+ 14
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/BrandServiceImpl.java View File

@@ -1,11 +1,14 @@
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;
6 7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 8
 import org.springframework.stereotype.Service;
8 9
 
10
+import java.util.List;
11
+
9 12
 /**
10 13
  * <p>
11 14
  * 品牌开发商表  服务实现类
@@ -17,4 +20,15 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
19 22
 
23
+    /**
24
+     * 获取微信端的品牌开发商
25
+     *
26
+     * @param cityId
27
+     * @param brandName
28
+     * @return
29
+     */
30
+    @Override
31
+    public List<Brand> getWxBrandList(Integer cityId, String brandName,Integer orgId) {
32
+        return this.baseMapper.getWxBrandList(cityId, brandName, orgId);
33
+    }
20 34
 }

+ 1
- 1
src/main/resources/application.yml View File

@@ -28,7 +28,7 @@ ali:
28 28
   oss:
29 29
     endpoint: oss-cn-shanghai.aliyuncs.com
30 30
     bucketName: xlk-assets
31
-    bucketURL: https://xlk-assets.oss-accelerate.aliyuncs.com
31
+    bucketURL: https://xlk-assets.oss-cn-shanghai.aliyuncs.com
32 32
 
33 33
 # file path
34 34
 file:

+ 26
- 0
src/main/resources/mapper/xlk/BrandMapper.xml View File

@@ -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.xlk.entity.Brand">
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">
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>