Your Name před 3 roky
rodič
revize
c811a74aa2
24 změnil soubory, kde provedl 347 přidání a 98 odebrání
  1. 1
    1
      pom.xml
  2. 9
    0
      src/main/java/com/yunzhi/marketing/Application.java
  3. 6
    0
      src/main/java/com/yunzhi/marketing/center/taUser/entity/TaUserVO.java
  4. 7
    1
      src/main/java/com/yunzhi/marketing/controller/TaChannelController.java
  5. 5
    0
      src/main/java/com/yunzhi/marketing/controller/TaLiveActivityController.java
  6. 1
    1
      src/main/java/com/yunzhi/marketing/mapper/TaChannelMapper.java
  7. 4
    7
      src/main/java/com/yunzhi/marketing/service/impl/TaBuildingDynamicServiceImpl.java
  8. 6
    6
      src/main/java/com/yunzhi/marketing/service/impl/TaBuildingServiceImpl.java
  9. 3
    0
      src/main/java/com/yunzhi/marketing/service/impl/TaFavorServiceImpl.java
  10. 16
    16
      src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java
  11. 2
    2
      src/main/java/com/yunzhi/marketing/xlk/controller/CustomerInfoController.java
  12. 17
    18
      src/main/java/com/yunzhi/marketing/xlk/controller/SearchHouseController.java
  13. 17
    0
      src/main/java/com/yunzhi/marketing/xlk/dto/SearchHouseDTO.java
  14. 11
    0
      src/main/java/com/yunzhi/marketing/xlk/mapper/SearchHouseMapper.java
  15. 11
    0
      src/main/java/com/yunzhi/marketing/xlk/service/ISearchHouseService.java
  16. 20
    3
      src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java
  17. 110
    0
      src/main/java/com/yunzhi/marketing/xlk/service/impl/SearchHouseServiceImpl.java
  18. 56
    22
      src/main/resources/mapper/TaBuildingMapper.xml
  19. 2
    2
      src/main/resources/mapper/TaChannelMapper.xml
  20. 1
    1
      src/main/resources/mapper/TaRaiseRecordMapper.xml
  21. 1
    1
      src/main/resources/mapper/TaRecommendCustomerMapper.xml
  22. 17
    17
      src/main/resources/mapper/TaShareCountMapper.xml
  23. 1
    0
      src/main/resources/mapper/TaUserMapper.xml
  24. 23
    0
      src/main/resources/mapper/xlk/SearchHouseMapper.xml

+ 1
- 1
pom.xml Zobrazit soubor

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

+ 9
- 0
src/main/java/com/yunzhi/marketing/Application.java Zobrazit soubor

5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6
 import org.springframework.context.ConfigurableApplicationContext;
6
 import org.springframework.context.ConfigurableApplicationContext;
7
 
7
 
8
+import javax.annotation.PostConstruct;
9
+import java.util.TimeZone;
10
+
8
 @SpringBootApplication
11
 @SpringBootApplication
9
 public class Application {
12
 public class Application {
10
 
13
 
14
+	@PostConstruct
15
+	void started() {
16
+		TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
17
+
18
+	}
19
+
11
 	public static void main(String[] args) {
20
 	public static void main(String[] args) {
12
 		SpringApplication springApplication = new SpringApplication(Application.class);
21
 		SpringApplication springApplication = new SpringApplication(Application.class);
13
 		ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
22
 		ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);

+ 6
- 0
src/main/java/com/yunzhi/marketing/center/taUser/entity/TaUserVO.java Zobrazit soubor

289
      */
289
      */
290
     @TableField(exist = false)
290
     @TableField(exist = false)
291
     private String bossDisplay;
291
     private String bossDisplay;
292
+
293
+    /**
294
+     * ta_user 的 userId
295
+     */
296
+    @TableField(exist = false)
297
+    private Integer realUserId;
292
 }
298
 }

+ 7
- 1
src/main/java/com/yunzhi/marketing/controller/TaChannelController.java Zobrazit soubor

97
         Integer orgId = getOrgId(request);
97
         Integer orgId = getOrgId(request);
98
 
98
 
99
         try {
99
         try {
100
+            String institutionCode = null;
101
+            if (!StringUtils.isEmpty(institutionId)){
102
+                Institution institution = iInstitutionService.getById(institutionId);
103
+                institutionCode = institution.getInstitutionCode();
104
+            }
105
+
100
             //使用分页插件
106
             //使用分页插件
101
 		    IPage<TaChannel> pg = new Page<>(pageNum, pageSize);
107
 		    IPage<TaChannel> pg = new Page<>(pageNum, pageSize);
102
-            IPage<TaChannel> result = taChannelMapper.pageTaChannel(pg,orgId,channelId,getInstitutionIds(request),institutionId);
108
+            IPage<TaChannel> result = taChannelMapper.pageTaChannel(pg,orgId,channelId,getInstitutionIds(request),institutionCode);
103
             List<TaChannel> recommendCount = taChannelMapper.recommendCount(orgId, channelId, getInstitutionIds(request));
109
             List<TaChannel> recommendCount = taChannelMapper.recommendCount(orgId, channelId, getInstitutionIds(request));
104
 
110
 
105
             result.getRecords().stream().forEach(e -> {
111
             result.getRecords().stream().forEach(e -> {

+ 5
- 0
src/main/java/com/yunzhi/marketing/controller/TaLiveActivityController.java Zobrazit soubor

24
 import org.springframework.web.bind.annotation.*;
24
 import org.springframework.web.bind.annotation.*;
25
 
25
 
26
 import javax.servlet.http.HttpServletRequest;
26
 import javax.servlet.http.HttpServletRequest;
27
+import java.time.LocalDateTime;
27
 import java.util.ArrayList;
28
 import java.util.ArrayList;
28
 import java.util.List;
29
 import java.util.List;
29
 
30
 
180
                 taLiveActivity.setLiveAppPath(taLiveActivity.getLiveRoomParam().replace(".html", ""));
181
                 taLiveActivity.setLiveAppPath(taLiveActivity.getLiveRoomParam().replace(".html", ""));
181
             }
182
             }
182
 
183
 
184
+            taLiveActivity.setUpdateDate(LocalDateTime.now());
185
+            taLiveActivity.setUpdateUser(getUserId(request).toString());
183
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
186
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
184
                 responseBean.addSuccess(taLiveActivity);
187
                 responseBean.addSuccess(taLiveActivity);
185
             } else {
188
             } else {
209
             }else if (CommConstant.IS_PUBLISH.equals(taLiveActivity.getStatus())) {
212
             }else if (CommConstant.IS_PUBLISH.equals(taLiveActivity.getStatus())) {
210
                 taLiveActivity.setStatus(CommConstant.NOT_PUBLISH);
213
                 taLiveActivity.setStatus(CommConstant.NOT_PUBLISH);
211
             }
214
             }
215
+            taLiveActivity.setUpdateDate(LocalDateTime.now());
216
+            taLiveActivity.setUpdateUser(getUserId(request).toString());
212
             iTaLiveActivityService.updateById(taLiveActivity);
217
             iTaLiveActivityService.updateById(taLiveActivity);
213
             responseBean.addSuccess(taLiveActivity);
218
             responseBean.addSuccess(taLiveActivity);
214
         } catch (Exception e) {
219
         } catch (Exception e) {

+ 1
- 1
src/main/java/com/yunzhi/marketing/mapper/TaChannelMapper.java Zobrazit soubor

44
      * @param pg
44
      * @param pg
45
      * @return
45
      * @return
46
      */
46
      */
47
-    IPage<TaChannel> pageTaChannel(IPage<TaChannel> pg,@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionIds") List<String> institutionIds,@Param("institutionId") String institutionId);
47
+    IPage<TaChannel> pageTaChannel(IPage<TaChannel> pg,@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionIds") List<String> institutionIds,@Param("institutionCode") String institutionCode);
48
 
48
 
49
     List<TaChannel> recommendCount(@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionIds") List<String> institutionIds);
49
     List<TaChannel> recommendCount(@Param("orgId")Integer orgId,@Param("channelId")Integer channelId,@Param("institutionIds") List<String> institutionIds);
50
 
50
 

+ 4
- 7
src/main/java/com/yunzhi/marketing/service/impl/TaBuildingDynamicServiceImpl.java Zobrazit soubor

146
         QueryWrapper<TaBuildingDynamic> buildingDynamicQueryWrapper = new QueryWrapper<>();
146
         QueryWrapper<TaBuildingDynamic> buildingDynamicQueryWrapper = new QueryWrapper<>();
147
         buildingDynamicQueryWrapper.eq("dynamic_id", dynamicId);
147
         buildingDynamicQueryWrapper.eq("dynamic_id", dynamicId);
148
         buildingDynamicQueryWrapper.eq("status",1);
148
         buildingDynamicQueryWrapper.eq("status",1);
149
-        TaBuildingDynamic tabuildingDynamic = buildingDynamicMapper.selectOne(buildingDynamicQueryWrapper);
150
-        if (null == tabuildingDynamic){
149
+        TaBuildingDynamic buildingDynamic = buildingDynamicMapper.selectOne(buildingDynamicQueryWrapper);
150
+        if (null == buildingDynamic){
151
             return ResponseBean.error("当前活动已失效", ResponseBean.ERROR_UNAVAILABLE);
151
             return ResponseBean.error("当前活动已失效", ResponseBean.ERROR_UNAVAILABLE);
152
         }
152
         }
153
         // 当前阅读量加1
153
         // 当前阅读量加1
154
-        Integer saveNum = tabuildingDynamic.getPvNum() == null ? 1:tabuildingDynamic.getPvNum()+1;
155
-        tabuildingDynamic.setPvNum(saveNum);
156
-        buildingDynamicMapper.updateById(tabuildingDynamic);
157
-        TaBuildingDynamic buildingDynamic = buildingDynamicMapper.selectOne(buildingDynamicQueryWrapper);
154
+        buildingDynamicMapper.setFieldNum(dynamicId, "pv_num", 1);
155
+
158
         TaPerson taPerson = taPersonMapper.selectByIdPerson(openid);
156
         TaPerson taPerson = taPersonMapper.selectByIdPerson(openid);
159
         if (null == taPerson){
157
         if (null == taPerson){
160
             return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
158
             return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
161
         }
159
         }
162
 
160
 
163
-
164
         setExtendInfo(buildingDynamic, taPerson);
161
         setExtendInfo(buildingDynamic, taPerson);
165
 
162
 
166
         // 活动已报名人数
163
         // 活动已报名人数

+ 6
- 6
src/main/java/com/yunzhi/marketing/service/impl/TaBuildingServiceImpl.java Zobrazit soubor

440
 
440
 
441
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "update");
441
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "update");
442
         if (!isMainMoreThanTenFlag) {
442
         if (!isMainMoreThanTenFlag) {
443
-            responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
443
+            responseBean.addError("当前城市最多只能推荐20个项目至首页哦。");
444
             return responseBean;
444
             return responseBean;
445
         }
445
         }
446
 
446
 
604
 
604
 
605
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "add");
605
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "add");
606
         if (!isMainMoreThanTenFlag) {
606
         if (!isMainMoreThanTenFlag) {
607
-            responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
607
+            responseBean.addError("当前城市最多只能推荐20个项目至首页哦。");
608
             return responseBean;
608
             return responseBean;
609
         }
609
         }
610
 
610
 
715
 
715
 
716
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, status, "updateStatus");
716
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, status, "updateStatus");
717
         if (!isMainMoreThanTenFlag) {
717
         if (!isMainMoreThanTenFlag) {
718
-            responseBean.addError("当前城市最多只能推荐10个项目至首页哦");
718
+            responseBean.addError("当前城市最多只能推荐20个项目至首页哦");
719
             return responseBean;
719
             return responseBean;
720
         }
720
         }
721
         building.setStatus(status);
721
         building.setStatus(status);
884
         }
884
         }
885
         switch (orderBy) {
885
         switch (orderBy) {
886
             case "price-asc":
886
             case "price-asc":
887
-                orderBy = "tb.price ASC";
887
+                orderBy = "IFNULL(tbpt.price_type,\"z\") , ifnull(CONVERT(tbpt.start_price, UNSIGNED INTEGER), 9999999999999)";
888
                 break;
888
                 break;
889
             case "price-desc":
889
             case "price-desc":
890
-                orderBy = "tb.price DESC";
890
+                orderBy = "tbpt.price_type desc, CONVERT(tbpt.end_price, UNSIGNED INTEGER) DESC";
891
                 break;
891
                 break;
892
             case "openingDate-asc":
892
             case "openingDate-asc":
893
                 orderBy = "tb.opening_date ASC";
893
                 orderBy = "tb.opening_date ASC";
1212
             taBuildingQueryWrapper.ne("building_id", taBuilding.getBuildingId());
1212
             taBuildingQueryWrapper.ne("building_id", taBuilding.getBuildingId());
1213
         }
1213
         }
1214
         List<TaBuilding> taBuildings = taBuildingMapper.selectList(taBuildingQueryWrapper);
1214
         List<TaBuilding> taBuildings = taBuildingMapper.selectList(taBuildingQueryWrapper);
1215
-        if (taBuildings != null && taBuildings.size() >= 10) {
1215
+        if (taBuildings != null && taBuildings.size() >= 20) {
1216
             return false;
1216
             return false;
1217
         }
1217
         }
1218
         return true;
1218
         return true;

+ 3
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaFavorServiceImpl.java Zobrazit soubor

130
         if (typeOf.equals("card")) {
130
         if (typeOf.equals("card")) {
131
             taPersonMapper.setFieldIncrement(taPerson.getPersonId(),"like_num", -1);
131
             taPersonMapper.setFieldIncrement(taPerson.getPersonId(),"like_num", -1);
132
         }
132
         }
133
+        if (typeOf.equals(CommConstant.FAVOR_CONSULTANT)) {
134
+            taPersonMapper.setFieldIncrement(like,"like_num", -1);
135
+        }
133
 
136
 
134
         // 如果是收藏资讯, 则 - 1
137
         // 如果是收藏资讯, 则 - 1
135
         if (typeOf.equals(CommConstant.FAVOR_NEWS)) {
138
         if (typeOf.equals(CommConstant.FAVOR_NEWS)) {

+ 16
- 16
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Zobrazit soubor

774
             lambdaQueryWrapper.eq(CustomerVisit::getCustomerId,taRecommendCustomer.getCustomerId());
774
             lambdaQueryWrapper.eq(CustomerVisit::getCustomerId,taRecommendCustomer.getCustomerId());
775
             CustomerVisit customerVisit = customerVisitMapper.selectOne(lambdaQueryWrapper);
775
             CustomerVisit customerVisit = customerVisitMapper.selectOne(lambdaQueryWrapper);
776
             taRecommendCustomerVO.setCustomerVisit(customerVisit);
776
             taRecommendCustomerVO.setCustomerVisit(customerVisit);
777
-        }else if (CommConstant.CUSTOMER_PREPARATORY.equals(taRecommendCustomer.getStatus())) {
778
-            // 认筹状态
779
-            LambdaQueryWrapper<CustomerPreparatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
780
-            lambdaQueryWrapper.eq(CustomerPreparatory::getCustomerId,taRecommendCustomer.getCustomerId());
781
-            CustomerPreparatory customerPreparatory = customerPreparatoryMapper.selectOne(lambdaQueryWrapper);
782
-            taRecommendCustomerVO.setCustomerPreparatory(customerPreparatory);
783
-        }else if (CommConstant.CUSTOMER_SIGNED.equals(taRecommendCustomer.getStatus())) {
784
-            // 签约状态
785
-            LambdaQueryWrapper<CustomerSignatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
786
-            lambdaQueryWrapper.eq(CustomerSignatory::getCustomerId,taRecommendCustomer.getCustomerId());
787
-            List<CustomerSignatory> customerSignatories = customerSignatoryMapper.selectList(lambdaQueryWrapper);
788
-            customerSignatories.forEach(e -> {
789
-                TaBuildingApartment taBuildingApartment = taBuildingApartmentMapper.selectById(e.getHouseType());
790
-                e.setBuildingApartment(taBuildingApartment);
791
-            });
792
-            taRecommendCustomerVO.setCustomerSignatory(customerSignatories);
793
         }
777
         }
794
 
778
 
795
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
779
         LambdaQueryWrapper<ChannelCustomer> channelCustomerLambdaQueryWrapper = new LambdaQueryWrapper<>();
798
         if (null != customer) {
782
         if (null != customer) {
799
             taRecommendCustomerVO.setChannelCustomer(customer);
783
             taRecommendCustomerVO.setChannelCustomer(customer);
800
         }
784
         }
785
+        // 认筹状态
786
+        LambdaQueryWrapper<CustomerPreparatory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
787
+        lambdaQueryWrapper.eq(CustomerPreparatory::getCustomerId,taRecommendCustomer.getCustomerId());
788
+        CustomerPreparatory customerPreparatory = customerPreparatoryMapper.selectOne(lambdaQueryWrapper);
789
+        taRecommendCustomerVO.setCustomerPreparatory(customerPreparatory);
790
+
791
+        // 签约状态
792
+        LambdaQueryWrapper<CustomerSignatory> qylambdaQueryWrapper = new LambdaQueryWrapper<>();
793
+        qylambdaQueryWrapper.eq(CustomerSignatory::getCustomerId,taRecommendCustomer.getCustomerId());
794
+        List<CustomerSignatory> customerSignatories = customerSignatoryMapper.selectList(qylambdaQueryWrapper);
795
+        customerSignatories.forEach(e -> {
796
+            TaBuildingApartment taBuildingApartment = taBuildingApartmentMapper.selectById(e.getHouseType());
797
+            e.setBuildingApartment(taBuildingApartment);
798
+        });
799
+        taRecommendCustomerVO.setCustomerSignatory(customerSignatories);
800
+
801
         return ResponseBean.success(taRecommendCustomerVO);
801
         return ResponseBean.success(taRecommendCustomerVO);
802
     }
802
     }
803
 
803
 

+ 2
- 2
src/main/java/com/yunzhi/marketing/xlk/controller/CustomerInfoController.java Zobrazit soubor

236
                 customerInfo = new CustomerInfo();
236
                 customerInfo = new CustomerInfo();
237
             }
237
             }
238
             customerInfo.setName(customer.getName());
238
             customerInfo.setName(customer.getName());
239
-            customerInfo.setSex(customer.getSex());
239
+//            customerInfo.setSex(customer.getSex());
240
             customerInfo.setPhone(customer.getPhone());
240
             customerInfo.setPhone(customer.getPhone());
241
             customerInfo.setPicture(customer.getPicture());
241
             customerInfo.setPicture(customer.getPicture());
242
 
242
 
274
                 customerInfoVO.setRealtyConsultantPerson(realtyPerson);
274
                 customerInfoVO.setRealtyConsultantPerson(realtyPerson);
275
                 // 所属楼盘和 用户信息
275
                 // 所属楼盘和 用户信息
276
                 LambdaQueryWrapper<TaPersonBuilding> taPersonBuildingLambdaQueryWrapper = new LambdaQueryWrapper<>();
276
                 LambdaQueryWrapper<TaPersonBuilding> taPersonBuildingLambdaQueryWrapper = new LambdaQueryWrapper<>();
277
-                taPersonBuildingLambdaQueryWrapper.eq(TaPersonBuilding::getPersonId,customer.getRealtyConsultant());
277
+                taPersonBuildingLambdaQueryWrapper.eq(TaPersonBuilding::getPersonId,customer.getRealtyConsultant()).or().eq(TaPersonBuilding::getUserId,realtyPerson.getUserId());
278
                 List<TaPersonBuilding> list = taPersonBuildingService.list(taPersonBuildingLambdaQueryWrapper);
278
                 List<TaPersonBuilding> list = taPersonBuildingService.list(taPersonBuildingLambdaQueryWrapper);
279
                 if (list.size() > 0) {
279
                 if (list.size() > 0) {
280
                     TaUser taUser = taUserService.getById(list.get(0).getUserId());
280
                     TaUser taUser = taUserService.getById(list.get(0).getUserId());

+ 17
- 18
src/main/java/com/yunzhi/marketing/xlk/controller/SearchHouseController.java Zobrazit soubor

106
      */
106
      */
107
     @ApiOperation(value = "wx-保存帮我找房需求", notes = "wx-保存帮我找房需求")
107
     @ApiOperation(value = "wx-保存帮我找房需求", notes = "wx-保存帮我找房需求")
108
     @RequestMapping(value="/wx/searchHouse",method= RequestMethod.POST)
108
     @RequestMapping(value="/wx/searchHouse",method= RequestMethod.POST)
109
-    public ResponseBean searchHouseAdd(@RequestBody SearchHouseDTO searchHouseDTO, @RequestHeader("authorization") String token, HttpServletRequest request){
109
+    public ResponseBean searchHouseAdd(@RequestBody SearchHouseDTO searchHouseDTO,
110
+                                       @RequestHeader("authorization") String token,
111
+                                       HttpServletRequest request){
110
         ResponseBean responseBean = new ResponseBean();
112
         ResponseBean responseBean = new ResponseBean();
111
         String openid = getOpenId(request);
113
         String openid = getOpenId(request);
112
         Integer orgId = getOrgId(request);
114
         Integer orgId = getOrgId(request);
114
         if (null == persons || persons.size() == 0) {
116
         if (null == persons || persons.size() == 0) {
115
             return ResponseBean.error("当前账户信息异常, 清除缓存重试", ResponseBean.ERROR_UNAVAILABLE);
117
             return ResponseBean.error("当前账户信息异常, 清除缓存重试", ResponseBean.ERROR_UNAVAILABLE);
116
         }
118
         }
119
+
120
+        if (StringUtils.isEmpty(searchHouseDTO.getMinPrice())) {
121
+            return ResponseBean.error("请选择预算价格", ResponseBean.ERROR_UNAVAILABLE);
122
+        }
123
+
117
         TaPerson person = persons.get(0);
124
         TaPerson person = persons.get(0);
118
         try {
125
         try {
119
             SearchHouse searchHouse = new SearchHouse();
126
             SearchHouse searchHouse = new SearchHouse();
123
             searchHouse.setStatus("0");
130
             searchHouse.setStatus("0");
124
             searchHouse.setCreatedTime(LocalDateTime.now());
131
             searchHouse.setCreatedTime(LocalDateTime.now());
125
             if (iSearchHouseService.save(searchHouse)){
132
             if (iSearchHouseService.save(searchHouse)){
126
-                SearchHouseVO searchHouseVO = new SearchHouseVO();
127
-                BeanUtils.copyProperties(searchHouse,searchHouseVO);
128
-                // 获取价格相近的楼盘
129
-                LambdaQueryWrapper<TaBuilding> lambdaQueryWrapper = new LambdaQueryWrapper<>();
130
-                lambdaQueryWrapper.eq(!StringUtils.isEmpty(searchHouseDTO.getIntentArea()),TaBuilding::getBuildingArea,searchHouseDTO.getIntentArea());
131
-                lambdaQueryWrapper.between(TaBuilding::getPrice,searchHouseDTO.getMinPrice(),searchHouseDTO.getMaxPrice());
132
-                lambdaQueryWrapper.ne(TaBuilding::getStatus,-1);
133
-                lambdaQueryWrapper.last(" limit 2");
134
-                List<TaBuilding> list = taBuildingService.list(lambdaQueryWrapper);
135
-                if (list.size() < 1){
136
-                    lambdaQueryWrapper = new LambdaQueryWrapper<>();
137
-                    lambdaQueryWrapper.eq(!StringUtils.isEmpty(searchHouseDTO.getIntentArea()),TaBuilding::getBuildingArea,searchHouseDTO.getIntentArea());
138
-                    lambdaQueryWrapper.ne(TaBuilding::getStatus,-1);
139
-                    lambdaQueryWrapper.last(" limit 2");
140
-                    list = taBuildingService.list(lambdaQueryWrapper);
133
+                if (null != searchHouseDTO.getNeedRecommend() && searchHouseDTO.getNeedRecommend()) {
134
+                    List<TaBuilding> buildingList = iSearchHouseService.getRecommendBuildings(getOrgId(request), searchHouseDTO);
135
+
136
+                    SearchHouseVO searchHouseVO = new SearchHouseVO();
137
+                    BeanUtils.copyProperties(searchHouse,searchHouseVO);
138
+                    searchHouseVO.setTaBuildingList(buildingList);
139
+                    responseBean.addSuccess(searchHouseVO);
140
+                } else {
141
+                    responseBean.addSuccess(null);
141
                 }
142
                 }
142
-                searchHouseVO.setTaBuildingList(list);
143
-                responseBean.addSuccess(searchHouseVO);
144
             }else {
143
             }else {
145
                 responseBean.addError("fail");
144
                 responseBean.addError("fail");
146
             }
145
             }

+ 17
- 0
src/main/java/com/yunzhi/marketing/xlk/dto/SearchHouseDTO.java Zobrazit soubor

66
      */
66
      */
67
     private String questionnaire;
67
     private String questionnaire;
68
 
68
 
69
+    /**
70
+     * 是否需要智能推荐
71
+     */
72
+    @TableField(exist = false)
73
+    private Boolean needRecommend;
74
+
75
+    /**
76
+     * 当前人员所在城市
77
+     */
78
+    @TableField(exist = false)
79
+    private Integer cityId;
80
+
81
+    /**
82
+     * 当前人员所选的面积
83
+     */
84
+    @TableField(exist = false)
85
+    private Integer areaResultId;
69
 }
86
 }

+ 11
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/SearchHouseMapper.java Zobrazit soubor

2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.yunzhi.marketing.entity.TaBuilding;
5
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
6
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
6
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
7
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
7
 import org.apache.ibatis.annotations.Mapper;
8
 import org.apache.ibatis.annotations.Mapper;
8
 import org.apache.ibatis.annotations.Param;
9
 import org.apache.ibatis.annotations.Param;
9
 
10
 
11
+import java.util.List;
12
+
10
 /**
13
 /**
11
  * <p>
14
  * <p>
12
  * 帮我找房  Mapper 接口
15
  * 帮我找房  Mapper 接口
21
     IPage<SearchHouseVO> selectSearchHouseList(IPage<SearchHouseVO> pg,@Param("params") SearchHouseVO searchHouse);
24
     IPage<SearchHouseVO> selectSearchHouseList(IPage<SearchHouseVO> pg,@Param("params") SearchHouseVO searchHouse);
22
 
25
 
23
     SearchHouseVO selectSearchHouseDetail(String id);
26
     SearchHouseVO selectSearchHouseDetail(String id);
27
+
28
+    List<TaBuilding> getRecommendBuildings(@Param("orgId") Integer orgId,
29
+                                           @Param("cityId") Integer cityId,
30
+                                           @Param("areaId") Integer areaId,
31
+                                           @Param("minPriceW") Integer minPriceW,
32
+                                           @Param("maxPriceW") Integer maxPriceW,
33
+                                           @Param("minPrice") Integer minPrice,
34
+                                           @Param("maxPrice") Integer maxPrice);
24
 }
35
 }

+ 11
- 0
src/main/java/com/yunzhi/marketing/xlk/service/ISearchHouseService.java Zobrazit soubor

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
+import com.yunzhi.marketing.entity.TaBuilding;
7
+import com.yunzhi.marketing.xlk.dto.SearchHouseDTO;
6
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
8
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
7
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
9
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
8
 
10
 
11
+import java.util.List;
12
+
9
 /**
13
 /**
10
  * <p>
14
  * <p>
11
  * 帮我找房  服务类
15
  * 帮我找房  服务类
26
     ResponseBean selectSearchHouseList(IPage<SearchHouseVO> pg, SearchHouseVO searchHouse);
30
     ResponseBean selectSearchHouseList(IPage<SearchHouseVO> pg, SearchHouseVO searchHouse);
27
 
31
 
28
     SearchHouseVO selectSearchHouseDetail(String id);
32
     SearchHouseVO selectSearchHouseDetail(String id);
33
+
34
+    /**
35
+     * 推荐楼盘
36
+     * @param searchHouseDTO
37
+     * @return
38
+     */
39
+    List<TaBuilding> getRecommendBuildings(Integer orgId, SearchHouseDTO searchHouseDTO);
29
 }
40
 }

+ 20
- 3
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java Zobrazit soubor

367
         }
367
         }
368
         customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
368
         customerPreparatory.setOrgId(taRecommendCustomer.getOrgId());
369
         customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
369
         customerPreparatory.setCustomerId(taRecommendCustomer.getCustomerId());
370
-        customerPreparatoryMapper.insert(customerPreparatory);
370
+        if (StringUtils.isEmpty(customerPreparatory.getCustomerPreparatoryId())) {
371
+            customerPreparatoryMapper.insert(customerPreparatory);
372
+        }else {
373
+            customerPreparatoryMapper.updateById(customerPreparatory);
374
+        }
375
+
371
         return ResponseBean.success("审核成功");
376
         return ResponseBean.success("审核成功");
372
     }
377
     }
373
 
378
 
406
         customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
411
         customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
407
         customerSignatory.setCreateDate(LocalDateTime.now());
412
         customerSignatory.setCreateDate(LocalDateTime.now());
408
         customerSignatory.setType("commission");
413
         customerSignatory.setType("commission");
409
-        customerSignatoryMapper.insert(customerSignatory);
414
+        customerSignatory.setCustomerId(params.getCustomerId());
415
+        if (StringUtils.isEmpty(customerSignatory.getCustomerSignatoryId())){
416
+            customerSignatoryMapper.insert(customerSignatory);
417
+        }else {
418
+            customerSignatoryMapper.updateById(customerSignatory);
419
+        }
420
+
410
         return ResponseBean.success("审核成功");
421
         return ResponseBean.success("审核成功");
411
     }
422
     }
412
 
423
 
447
         }
458
         }
448
         customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
459
         customerSignatory.setOrgId(taRecommendCustomer.getOrgId());
449
         customerSignatory.setType("signatory");
460
         customerSignatory.setType("signatory");
450
-        customerSignatoryMapper.insert(customerSignatory);
461
+        customerSignatory.setCustomerId(params.getCustomerId());
462
+        if (StringUtils.isEmpty(customerSignatory.getCustomerSignatoryId())) {
463
+            customerSignatoryMapper.insert(customerSignatory);
464
+        }else {
465
+            customerSignatoryMapper.updateById(customerSignatory);
466
+        }
467
+
451
         return ResponseBean.success("审核成功");
468
         return ResponseBean.success("审核成功");
452
     }
469
     }
453
 
470
 

+ 110
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/SearchHouseServiceImpl.java Zobrazit soubor

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.yunzhi.marketing.base.ResponseBean;
5
 import com.yunzhi.marketing.base.ResponseBean;
6
+import com.yunzhi.marketing.common.StringUtils;
7
+import com.yunzhi.marketing.entity.TaBuilding;
6
 import com.yunzhi.marketing.entity.TaCheckin;
8
 import com.yunzhi.marketing.entity.TaCheckin;
9
+import com.yunzhi.marketing.entity.TdCity;
10
+import com.yunzhi.marketing.mapper.TdCityMapper;
11
+import com.yunzhi.marketing.xlk.dto.SearchHouseDTO;
7
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
12
 import com.yunzhi.marketing.xlk.entity.SearchHouse;
8
 import com.yunzhi.marketing.xlk.mapper.SearchHouseMapper;
13
 import com.yunzhi.marketing.xlk.mapper.SearchHouseMapper;
9
 import com.yunzhi.marketing.xlk.service.ISearchHouseService;
14
 import com.yunzhi.marketing.xlk.service.ISearchHouseService;
10
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
15
 import com.yunzhi.marketing.xlk.vo.SearchHouseVO;
16
+import io.swagger.models.auth.In;
11
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
13
 
19
 
20
+import java.util.List;
21
+
14
 /**
22
 /**
15
  * <p>
23
  * <p>
16
  * 帮我找房  服务实现类
24
  * 帮我找房  服务实现类
25
     @Autowired
33
     @Autowired
26
     private SearchHouseMapper searchHouseMapper;
34
     private SearchHouseMapper searchHouseMapper;
27
 
35
 
36
+    @Autowired
37
+    private TdCityMapper tdCityMapper;
38
+
28
     /**
39
     /**
29
      * 查询我的找房需求列表
40
      * 查询我的找房需求列表
30
      *
41
      *
43
     public SearchHouseVO selectSearchHouseDetail(String id) {
54
     public SearchHouseVO selectSearchHouseDetail(String id) {
44
         return searchHouseMapper.selectSearchHouseDetail(id);
55
         return searchHouseMapper.selectSearchHouseDetail(id);
45
     }
56
     }
57
+
58
+    /**
59
+     * 推荐逻辑如下
60
+     * 1、先判断区域+价格,如果有符合楼盘,则推荐,如无看2;
61
+     * 2、判断城市+价格,如过有符合楼盘,则推荐,如无看3;
62
+     * 3、如选择了“不限城市”,则判断价格,在当前城市内推荐一个符合的。
63
+     * @param searchHouseDTO
64
+     * @return
65
+     */
66
+    @Override
67
+    public List<TaBuilding> getRecommendBuildings(Integer orgId, SearchHouseDTO searchHouseDTO) {
68
+        // 区域
69
+        String area = searchHouseDTO.getIntentArea();
70
+        Integer areaId = StringUtils.isEmpty(area) ? null : Integer.valueOf(area);
71
+        // 区域所属城市
72
+        Integer areaCity = null;
73
+        if (null != areaId) {
74
+            TdCity city = tdCityMapper.selectById(areaId);
75
+            areaCity = city.getParentid();
76
+        }
77
+
78
+        // 当前城市
79
+        Integer cityId = searchHouseDTO.getCityId();
80
+        // 最小总价
81
+        Integer minPriceW = Integer.parseInt(searchHouseDTO.getMinPrice());
82
+        // 最大总价
83
+        Integer maxPriceW = Integer.parseInt(searchHouseDTO.getMaxPrice());
84
+        // 面积字典
85
+        Integer areaResultId = searchHouseDTO.getAreaResultId();
86
+        //
87
+        Integer[] unitPrice = getUnitPriceRange(minPriceW, maxPriceW, areaResultId);
88
+        // 最小单价
89
+        Integer minPrice = unitPrice[0];
90
+        // 最大单价
91
+        Integer maxPrice = unitPrice[1];
92
+
93
+        if (null != areaId) {
94
+            // 1、先判断区域+价格
95
+            List<TaBuilding> lst1 = searchHouseMapper.getRecommendBuildings(orgId, null, areaId, minPriceW, maxPriceW, minPrice, maxPrice);
96
+            if (null != lst1 && lst1.size() > 0) {
97
+                return lst1;
98
+            }
99
+
100
+            // 2、判断城市+价格
101
+            List<TaBuilding> lst2 = searchHouseMapper.getRecommendBuildings(orgId, areaCity, null, minPriceW, maxPriceW, minPrice, maxPrice);
102
+            if (null != lst2 && lst2.size() > 0) {
103
+                return lst2;
104
+            }
105
+        }
106
+
107
+        // 3、当前城市
108
+        return searchHouseMapper.getRecommendBuildings(orgId, cityId, null, minPriceW, maxPriceW, minPrice, maxPrice);
109
+    }
110
+
111
+    private Integer[] getUnitPriceRange(Integer minPriceW, Integer maxPriceW, Integer areaResultId) {
112
+        Integer minPrice = minPriceW;
113
+        Integer maxPrice = maxPriceW;
114
+
115
+        // 字典过滤 - 必须与小程序端保持一致
116
+        switch (areaResultId) {
117
+            case 1:
118
+                // 60㎡ 以下, 则按照 30 - 60 处理
119
+                minPrice = minPrice / 60;
120
+                maxPrice = maxPrice / 30;
121
+                break;
122
+            case 2:
123
+                // 60 - 90
124
+                minPrice = minPrice / 90;
125
+                maxPrice = maxPrice / 60;
126
+                break;
127
+            case 3:
128
+                // 90 - 110
129
+                minPrice = minPrice / 110;
130
+                maxPrice = maxPrice / 90;
131
+                break;
132
+            case 4:
133
+                // 110 - 130
134
+                minPrice = minPrice / 130;
135
+                maxPrice = maxPrice / 110;
136
+                break;
137
+            case 5:
138
+                // 130 - 150
139
+                minPrice = minPrice / 150;
140
+                maxPrice = maxPrice / 130;
141
+                break;
142
+            case 6:
143
+                // 150 - 200
144
+                minPrice = minPrice / 200;
145
+                maxPrice = maxPrice / 150;
146
+                break;
147
+            default:
148
+                // 200 以上
149
+                minPrice = minPrice / 200;
150
+                maxPrice = maxPrice / 200;
151
+                break;
152
+        }
153
+
154
+        return new Integer[] {minPrice * 10000, maxPrice * 10000};
155
+    }
46
 }
156
 }

+ 56
- 22
src/main/resources/mapper/TaBuildingMapper.xml Zobrazit soubor

49
         SELECT * FROM ta_building
49
         SELECT * FROM ta_building
50
         <where>
50
         <where>
51
             1 =1
51
             1 =1
52
-            and status = 1
52
+            and status != -1
53
             <if test="Name != null and Name != ''">
53
             <if test="Name != null and Name != ''">
54
                 and  (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
54
                 and  (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
55
             </if>
55
             </if>
119
                 </if>
119
                 </if>
120
                 <if test="buildingArea != null">
120
                 <if test="buildingArea != null">
121
                     AND building_area in
121
                     AND building_area in
122
-                    <foreach collection="buildingAreaLisr" item="buildingList" open="(" close=")" separator=" OR ">
122
+                    <foreach collection="buildingAreaLisr" item="buildingList" open="(" close=")" separator=" , ">
123
                      #{buildingList}
123
                      #{buildingList}
124
                     </foreach>
124
                     </foreach>
125
                 </if>
125
                 </if>
147
                 </if>
147
                 </if>
148
             ) as tb
148
             ) as tb
149
 
149
 
150
-            <if test="(priceList != null and priceList.size > 0) or (buildingTypeList != null and buildingTypeList.length > 0)">
151
-                INNER JOIN
150
+                left JOIN
152
                 (
151
                 (
153
                 SELECT * FROM ta_building_project_type
152
                 SELECT * FROM ta_building_project_type
154
                 <trim prefix="where" prefixOverrides="and | or">
153
                 <trim prefix="where" prefixOverrides="and | or">
155
-
156
-                    <if test="priceList != null">
154
+                    <if test="priceList != null and priceList.size > 0">
157
                         <foreach collection="priceList" item="priceArr" open="(" close=")" separator=" OR ">
155
                         <foreach collection="priceList" item="priceArr" open="(" close=")" separator=" OR ">
158
                             (
156
                             (
159
-                                <if test='priceArr[0] != null and priceArr[0] != ""'>
160
-                                    <![CDATA[ start_price > ${priceArr[0]}  ]]>
161
-                                </if>
162
-                                <if test='priceArr.length > 1 and priceArr[0] != null and priceArr[0] != ""'>
163
-                                    AND
164
-                                </if>
165
-                                <if test='priceArr.length > 1 and priceArr[1] != null and priceArr[1] != ""'>
166
-                                    <![CDATA[ start_price <= ${priceArr[1]}  ]]>
167
-                                </if>
157
+                            <if test='priceArr[0] != null and priceArr[0] != ""'>
158
+                                <![CDATA[ start_price > ${priceArr[0]}  ]]>
159
+                            </if>
160
+                            <if test='priceArr.length > 1 and priceArr[0] != null and priceArr[0] != ""'>
161
+                                AND
162
+                            </if>
163
+                            <if test='priceArr.length > 1 and priceArr[1] != null and priceArr[1] != ""'>
164
+                                <![CDATA[ start_price <= ${priceArr[1]}  ]]>
165
+                            </if>
168
                             )  or
166
                             )  or
169
                             (
167
                             (
170
                             <if test='priceArr[0] != null and priceArr[0] != ""'>
168
                             <if test='priceArr[0] != null and priceArr[0] != ""'>
178
                             </if>
176
                             </if>
179
                             )
177
                             )
180
                         </foreach>
178
                         </foreach>
181
-                    </if>
182
-
183
-                    <if test="priceType != null and priceType != ''">
184
-                        and price_type = #{priceType}
179
+                        <if test="priceType != null and priceType != ''">
180
+                            and price_type = #{priceType}
181
+                        </if>
185
                     </if>
182
                     </if>
186
 
183
 
187
                     <if test="buildingTypeList != null and buildingTypeList.length > 0">
184
                     <if test="buildingTypeList != null and buildingTypeList.length > 0">
194
                 GROUP BY building_id
191
                 GROUP BY building_id
195
                 )
192
                 )
196
                 AS tbpt ON tb.building_id = tbpt.building_id
193
                 AS tbpt ON tb.building_id = tbpt.building_id
197
-            </if>
198
 
194
 
199
             <if test="(areaList != null and areaList.size > 0) or (houseTypeList != null and houseTypeList.length > 0)">
195
             <if test="(areaList != null and areaList.size > 0) or (houseTypeList != null and houseTypeList.length > 0)">
200
                 INNER JOIN
196
                 INNER JOIN
201
                 (
197
                 (
202
                 SELECT * FROM ta_building_apartment
198
                 SELECT * FROM ta_building_apartment
203
                 <trim prefix="where" prefixOverrides="and | or">
199
                 <trim prefix="where" prefixOverrides="and | or">
204
-                    <if test="areaList != null">
200
+                    <if test="areaList != null and areaList.size > 0">
205
                         <foreach collection="areaList" item="areaArr" open="(" close=")" separator=" OR ">
201
                         <foreach collection="areaList" item="areaArr" open="(" close=")" separator=" OR ">
206
                             (
202
                             (
207
                                 <if test='areaArr[0] != null and areaArr[0] != ""'>
203
                                 <if test='areaArr[0] != null and areaArr[0] != ""'>
227
                 GROUP BY building_id
223
                 GROUP BY building_id
228
                 ) as tba ON tb.building_id = tba.building_id
224
                 ) as tba ON tb.building_id = tba.building_id
229
             </if>
225
             </if>
230
-            WHERE tb.org_id = #{orgId}
226
+        <trim prefix="where" prefixOverrides="and | or">
227
+            <if test="priceList != null and priceList.size > 0">
228
+                <foreach collection="priceList" item="priceArr" open="(" close=")" separator=" OR ">
229
+                    (
230
+                    <if test='priceArr[0] != null and priceArr[0] != ""'>
231
+                        <![CDATA[ tbpt.start_price > ${priceArr[0]}  ]]>
232
+                    </if>
233
+                    <if test='priceArr.length > 1 and priceArr[0] != null and priceArr[0] != ""'>
234
+                        AND
235
+                    </if>
236
+                    <if test='priceArr.length > 1 and priceArr[1] != null and priceArr[1] != ""'>
237
+                        <![CDATA[ tbpt.start_price <= ${priceArr[1]}  ]]>
238
+                    </if>
239
+                    )  or
240
+                    (
241
+                    <if test='priceArr[0] != null and priceArr[0] != ""'>
242
+                        <![CDATA[ tbpt.end_price > ${priceArr[0]}  ]]>
243
+                    </if>
244
+                    <if test='priceArr.length > 1 and priceArr[0] != null and priceArr[0] != ""'>
245
+                        AND
246
+                    </if>
247
+                    <if test='priceArr.length > 1 and priceArr[1] != null and priceArr[1] != ""'>
248
+                        <![CDATA[ tbpt.end_price <= ${priceArr[1]}  ]]>
249
+                    </if>
250
+                    )
251
+                </foreach>
252
+                <if test="priceType != null and priceType != ''">
253
+                    and tbpt.price_type = #{priceType}
254
+                </if>
255
+            </if>
256
+
257
+            and tb.org_id = #{orgId}
258
+            <if test="buildingTypeList != null and buildingTypeList.length > 0">
259
+                AND tbpt.building_type_id in
260
+                <foreach collection="buildingTypeList" item="buildingType" open="(" close=")" separator=",">
261
+                    #{buildingType}
262
+                </foreach>
263
+            </if>
264
+        </trim>
231
             ORDER BY ${orderBy}
265
             ORDER BY ${orderBy}
232
     </select>
266
     </select>
233
 
267
 

+ 2
- 2
src/main/resources/mapper/TaChannelMapper.xml Zobrazit soubor

32
             and c.org_id = #{orgId}
32
             and c.org_id = #{orgId}
33
             and c.status = 1
33
             and c.status = 1
34
 
34
 
35
-            <if test="institutionId != null and institutionId != ''">
36
-                AND c.institution_id = #{institutionId}
35
+            <if test="institutionCode != null and institutionCode != ''">
36
+                AND i.institution_code like CONCAT(#{institutionCode}, '%')
37
             </if>
37
             </if>
38
             <if test="institutionIds != null and institutionIds.size > 0">
38
             <if test="institutionIds != null and institutionIds.size > 0">
39
                 AND c.institution_id in
39
                 AND c.institution_id in

+ 1
- 1
src/main/resources/mapper/TaRaiseRecordMapper.xml Zobrazit soubor

42
             AND t.house_locking_status = #{bo.lockingStatus}
42
             AND t.house_locking_status = #{bo.lockingStatus}
43
         </if>
43
         </if>
44
         <if test="bo.lockingStatus == 'unlocked'">
44
         <if test="bo.lockingStatus == 'unlocked'">
45
-            AND (t.house_locking_status = #{bo.lockingStatus} || t.house_locking_status is null)
45
+            AND (t.house_locking_status = #{bo.lockingStatus} OR t.house_locking_status is null)
46
         </if>
46
         </if>
47
         <if test="bo.apartmentId != null and bo.apartmentId != ''">
47
         <if test="bo.apartmentId != null and bo.apartmentId != ''">
48
             AND t.apartment_id = #{bo.apartmentId}
48
             AND t.apartment_id = #{bo.apartmentId}

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Zobrazit soubor

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 || t.realty_consultant is not null,true,false) as visitStatus
1023
+            if(v.customer_visit_id is not null OR t.`status` = 2 OR t.realty_consultant is not null,true,false) as visitStatus
1024
         FROM
1024
         FROM
1025
             ta_recommend_customer t
1025
             ta_recommend_customer t
1026
          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

+ 17
- 17
src/main/resources/mapper/TaShareCountMapper.xml Zobrazit soubor

18
         select
18
         select
19
 
19
 
20
         case
20
         case
21
-        when a.title != null || a.title != '' then a.title
22
-        when b.title != null || b.title != '' then b.title
23
-        when c.activity_name != null || c.activity_name != '' then c.activity_name
24
-        when d.`name` != null || d.name != '' then d.`name`
25
-        when e.building_name != null || e.building_name != '' then e.building_name
26
-        when f.news_name != null || f.news_name != '' then f.news_name
27
-        when g.`name` != null || g.`name` != '' then g.`name`
28
-        when h.sales_batch_name != null || h.sales_batch_name != '' then h.sales_batch_name
21
+        when a.title != null or a.title != '' then a.title
22
+        when b.title != null or b.title != '' then b.title
23
+        when c.activity_name != null or c.activity_name != '' then c.activity_name
24
+        when d.`name` != null or d.name != '' then d.`name`
25
+        when e.building_name != null or e.building_name != '' then e.building_name
26
+        when f.news_name != null or f.news_name != '' then f.news_name
27
+        when g.`name` != null or g.`name` != '' then g.`name`
28
+        when h.sales_batch_name != null or h.sales_batch_name != '' then h.sales_batch_name
29
         else '空'
29
         else '空'
30
         end as shareTitle,t.create_date
30
         end as shareTitle,t.create_date
31
         from ta_share_count t
31
         from ta_share_count t
39
         left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
39
         left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
40
         where t.person_id = #{personId}
40
         where t.person_id = #{personId}
41
         <if test="shareType != null and shareType != ''">
41
         <if test="shareType != null and shareType != ''">
42
-            and (t.tagert_type = #{shareType} || t.tagert_type like CONCAT(#{shareType} , '%'))
42
+            and (t.tagert_type = #{shareType} or t.tagert_type like CONCAT(#{shareType} , '%'))
43
         </if>
43
         </if>
44
         <if test="shareTitle != null and shareTitle != ''">
44
         <if test="shareTitle != null and shareTitle != ''">
45
             and
45
             and
60
     <select id="selectClickListByParams" resultType="com.yunzhi.marketing.entity.TaShareCount">
60
     <select id="selectClickListByParams" resultType="com.yunzhi.marketing.entity.TaShareCount">
61
         SELECT
61
         SELECT
62
             case
62
             case
63
-                when g.title != null || g.title != '' then g.title
64
-                when b.title != null || b.title != '' then b.title
65
-                when c.activity_name != null || c.activity_name != '' then c.activity_name
66
-                when d.`name` != null || d.name != '' then d.`name`
67
-                when e.building_name != null || e.building_name != '' then e.building_name
68
-                when f.news_name != null || f.news_name != '' then f.news_name
69
-                when h.sales_batch_name != null || h.sales_batch_name !='' then h.sales_batch_name
70
-                WHEN y.`name` != NULL || y.`name` != '' THEN y.`name`
63
+                when g.title != null or g.title != '' then g.title
64
+                when b.title != null or b.title != '' then b.title
65
+                when c.activity_name != null or c.activity_name != '' then c.activity_name
66
+                when d.`name` != null or d.name != '' then d.`name`
67
+                when e.building_name != null or e.building_name != '' then e.building_name
68
+                when f.news_name != null or f.news_name != '' then f.news_name
69
+                when h.sales_batch_name != null or h.sales_batch_name !='' then h.sales_batch_name
70
+                WHEN y.`name` != NULL or y.`name` != '' THEN y.`name`
71
                 else '空'
71
                 else '空'
72
                 end as shareTitle,
72
                 end as shareTitle,
73
                         z.phone as personPhone,
73
                         z.phone as personPhone,

+ 1
- 0
src/main/resources/mapper/TaUserMapper.xml Zobrazit soubor

161
     <select id="selectPageList" resultType="com.yunzhi.marketing.center.taUser.entity.TaUserVO">
161
     <select id="selectPageList" resultType="com.yunzhi.marketing.center.taUser.entity.TaUserVO">
162
         SELECT
162
         SELECT
163
             s.person_id as user_id,
163
             s.person_id as user_id,
164
+            t.user_id as real_user_id,
164
             t.*
165
             t.*
165
         FROM
166
         FROM
166
             ta_user t
167
             ta_user t

+ 23
- 0
src/main/resources/mapper/xlk/SearchHouseMapper.xml Zobrazit soubor

26
         <if test="params.status != null and params.status != ''">
26
         <if test="params.status != null and params.status != ''">
27
             and t.status = #{params.status}
27
             and t.status = #{params.status}
28
         </if>
28
         </if>
29
+        order by CREATED_TIME desc
29
     </select>
30
     </select>
30
     <select id="selectSearchHouseDetail" resultType="com.yunzhi.marketing.xlk.vo.SearchHouseVO">
31
     <select id="selectSearchHouseDetail" resultType="com.yunzhi.marketing.xlk.vo.SearchHouseVO">
31
         SELECT
32
         SELECT
39
             LEFT JOIN ta_person p ON t.person_id = p.person_id
40
             LEFT JOIN ta_person p ON t.person_id = p.person_id
40
             WHERE t.id = #{id}
41
             WHERE t.id = #{id}
41
     </select>
42
     </select>
43
+    <select id="getRecommendBuildings" resultType="com.yunzhi.marketing.entity.TaBuilding">
44
+        SELECT
45
+            DISTINCT t.*
46
+        FROM
47
+            ta_building t
48
+            INNER JOIN ta_building_project_type s ON t.building_id = s.building_id
49
+        WHERE
50
+            t.org_id = #{orgId}
51
+        <if test="cityId != null">
52
+            AND t.city_id = #{cityId}
53
+        </if>
54
+        <if test="areaId != null">
55
+            AND t.building_area = #{areaId}
56
+        </if>
57
+            AND (
58
+                ( s.start_price &gt;= #{minPriceW} AND s.end_price &lt;= #{maxPriceW} AND s.price_type = 'total' )
59
+                OR ( s.start_price &gt;= #{minPrice} AND s.end_price &lt;= #{maxPrice} AND s.price_type = 'average' )
60
+            )
61
+            AND t.`status` > - 1
62
+        ORDER BY
63
+            t.is_main ASC
64
+    </select>
42
 </mapper>
65
 </mapper>