dingxin преди 5 години
родител
ревизия
3a8203761d
променени са 17 файла, в които са добавени 185 реда и са изтрити 27 реда
  1. 39
    3
      src/main/java/com/huiju/estateagents/common/CommConstant.java
  2. 23
    3
      src/main/java/com/huiju/estateagents/controller/ExtendContentController.java
  3. 1
    2
      src/main/java/com/huiju/estateagents/controller/TaCheckinController.java
  4. 3
    1
      src/main/java/com/huiju/estateagents/controller/TaPersonController.java
  5. 4
    0
      src/main/java/com/huiju/estateagents/entity/ExtendContent.java
  6. 11
    4
      src/main/java/com/huiju/estateagents/entity/TaBuilding.java
  7. 1
    1
      src/main/java/com/huiju/estateagents/entity/TaPerson.java
  8. 1
    1
      src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java
  9. 3
    0
      src/main/java/com/huiju/estateagents/mapper/TaBuildingMapper.java
  10. 2
    0
      src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java
  11. 6
    0
      src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java
  12. 1
    0
      src/main/java/com/huiju/estateagents/service/impl/TaMiniFormidsImpl.java
  13. 13
    7
      src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java
  14. 58
    0
      src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java
  15. 10
    4
      src/main/java/com/huiju/estateagents/service/impl/TaSaveServiceImpl.java
  16. 8
    0
      src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java
  17. 1
    1
      src/main/resources/application-prod.yml

+ 39
- 3
src/main/java/com/huiju/estateagents/common/CommConstant.java Целия файл

118
     //=================  首屏广告 / 轮播图 start =======================
118
     //=================  首屏广告 / 轮播图 start =======================
119
 
119
 
120
     /**
120
     /**
121
-     * 首页轮播图类型_活动
121
+     * 首页 轮播图/广告 类型 ====  活动
122
      */
122
      */
123
     public static final String CAROUSEL_ACTIVITY = "activity";
123
     public static final String CAROUSEL_ACTIVITY = "activity";
124
 
124
 
125
     /**
125
     /**
126
-     * 首页 轮播图/广告 类型_项目
126
+     * 首页 轮播图/广告 类型 ==== 项目
127
      */
127
      */
128
     public static final String CAROUSEL_PROJECT = "project";
128
     public static final String CAROUSEL_PROJECT = "project";
129
 
129
 
130
     /**
130
     /**
131
-     * 首页轮播图类型_资讯
131
+     * 首页轮播图/广告 类型 ==== 资讯
132
      */
132
      */
133
     public static final String CAROUSEL_NEWS = "news";
133
     public static final String CAROUSEL_NEWS = "news";
134
 
134
 
154
 
154
 
155
     //=================  首屏广告 / 轮播图 end =======================
155
     //=================  首屏广告 / 轮播图 end =======================
156
 
156
 
157
+    /**
158
+     * 客户报备
159
+     */
160
+    public static final String CUSTOMER_REPORT = "1";
161
+
162
+    /**
163
+     * 客户到访
164
+     */
165
+    public static final String CUSTOMER_VISITE = "2";
166
+
167
+    /**
168
+     * 客户认购
169
+     */
170
+    public static final String CUSTOMER_PREORDER = "3";
171
+
172
+    /**
173
+     * 客户签约
174
+     */
175
+    public static final String CUSTOMER_SIGNED = "4";
176
+
177
+
178
+    /**
179
+     * 待审核
180
+     */
181
+    public static final Integer VERIFY_READY = 0;
182
+
183
+    /**
184
+     * 审核同意
185
+     */
186
+    public static final Integer VERIFY_AGREE = 1;
187
+
188
+    /**
189
+     * 审核不同意
190
+     */
191
+    public static final Integer VERIFY_DISAGREE = 2;
192
+
157
     //=================  客户入口类型 start =======================
193
     //=================  客户入口类型 start =======================
158
     /*
194
     /*
159
     * 自主进入
195
     * 自主进入

+ 23
- 3
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java Целия файл

6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
7
 import com.huiju.estateagents.base.ResponseBean;
8
 import com.huiju.estateagents.entity.ExtendContent;
8
 import com.huiju.estateagents.entity.ExtendContent;
9
+import com.huiju.estateagents.entity.TaBuildingDynamic;
9
 import com.huiju.estateagents.service.IExtendContentService;
10
 import com.huiju.estateagents.service.IExtendContentService;
11
+import com.huiju.estateagents.service.ITaBuildingDynamicService;
12
+import com.huiju.estateagents.service.ITaBuildingService;
13
+import org.apache.commons.lang3.StringUtils;
10
 import org.slf4j.Logger;
14
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
15
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.web.bind.annotation.ResponseBody;
22
 import org.springframework.web.bind.annotation.ResponseBody;
19
 import org.springframework.web.bind.annotation.RestController;
23
 import org.springframework.web.bind.annotation.RestController;
20
 
24
 
25
+import java.time.LocalDateTime;
26
+
21
 /**
27
 /**
22
  * <p>
28
  * <p>
23
     * 辅助内容表  前端控制器
29
     * 辅助内容表  前端控制器
35
     @Autowired
41
     @Autowired
36
     public IExtendContentService iExtendContentService;
42
     public IExtendContentService iExtendContentService;
37
 
43
 
44
+    @Autowired
45
+    private ITaBuildingDynamicService iTaBuildingDynamicService;
46
+
38
 
47
 
39
     /**
48
     /**
40
      * 分页查询列表
49
      * 分页查询列表
44
      */
53
      */
45
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.GET)
54
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.GET)
46
     public ResponseBean extendContentList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
     public ResponseBean extendContentList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
-                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
56
+                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                          @RequestParam(value = "buildingId", required = false) String buildingId,
58
+                                          @RequestParam(value = "showType", required = false) String showType){
48
         ResponseBean responseBean = new ResponseBean();
59
         ResponseBean responseBean = new ResponseBean();
49
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
60
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
50
-            IPage<ExtendContent> result = iExtendContentService.page(pg);
61
+            QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
62
+            queryWrapper.eq(StringUtils.isNotBlank(buildingId), "building_id", buildingId);
63
+            queryWrapper.eq(StringUtils.isNotBlank(showType), "show_type", showType);
64
+            queryWrapper.orderByDesc("create_date");
65
+            IPage<ExtendContent> result = iExtendContentService.page(pg, queryWrapper);
51
             responseBean.addSuccess(result);
66
             responseBean.addSuccess(result);
52
             return responseBean;
67
             return responseBean;
53
     }
68
     }
74
      */
89
      */
75
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
90
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
76
     public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
91
     public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
92
+        extendContent.setCreateDate(LocalDateTime.now());
77
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
93
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
78
           responseBean.addSuccess(extendContent);
94
           responseBean.addSuccess(extendContent);
79
           return responseBean;
95
           return responseBean;
111
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
127
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
112
                                         @RequestBody ExtendContent extendContent){
128
                                         @RequestBody ExtendContent extendContent){
113
         ResponseBean responseBean = new ResponseBean();
129
         ResponseBean responseBean = new ResponseBean();
130
+        extendContent.setContentId(id);
114
         try {
131
         try {
115
             if (iExtendContentService.updateById(extendContent)){
132
             if (iExtendContentService.updateById(extendContent)){
116
                 responseBean.addSuccess(extendContent);
133
                 responseBean.addSuccess(extendContent);
133
     public ResponseBean extendContentGet(@PathVariable Integer id){
150
     public ResponseBean extendContentGet(@PathVariable Integer id){
134
         ResponseBean responseBean = new ResponseBean();
151
         ResponseBean responseBean = new ResponseBean();
135
         try {
152
         try {
136
-            responseBean.addSuccess(iExtendContentService.getById(id));
153
+            ExtendContent extendContent = iExtendContentService.getById(id);
154
+            TaBuildingDynamic taBuildingDynamic = iTaBuildingDynamicService.getById(extendContent.getTargetId());
155
+            extendContent.setTargetName(taBuildingDynamic.getTitle());
156
+            responseBean.addSuccess(extendContent);
137
         }catch (Exception e){
157
         }catch (Exception e){
138
             e.printStackTrace();
158
             e.printStackTrace();
139
             logger.error("extendContentDelete -=- {}",e.toString());
159
             logger.error("extendContentDelete -=- {}",e.toString());

+ 1
- 2
src/main/java/com/huiju/estateagents/controller/TaCheckinController.java Целия файл

97
      */
97
      */
98
     @RequestMapping(value="/wx/taCheckin/activity/{activity}",method= RequestMethod.POST)
98
     @RequestMapping(value="/wx/taCheckin/activity/{activity}",method= RequestMethod.POST)
99
     public ResponseBean taCheckinAdd(@PathVariable String activity, HttpServletRequest request){
99
     public ResponseBean taCheckinAdd(@PathVariable String activity, HttpServletRequest request){
100
-        ResponseBean responseBean = new ResponseBean();
101
         String openid = JWTUtils.getSubject(request);
100
         String openid = JWTUtils.getSubject(request);
102
         List<TaPerson> taPersons = iTaPersonService.getPersonsByOpenId(openid);
101
         List<TaPerson> taPersons = iTaPersonService.getPersonsByOpenId(openid);
103
         if (null == taPersons || taPersons.size() != 1) {
102
         if (null == taPersons || taPersons.size() != 1) {
123
                     return ResponseBean.error("保存失败",ResponseBean.ERROR_UNAVAILABLE);
122
                     return ResponseBean.error("保存失败",ResponseBean.ERROR_UNAVAILABLE);
124
                 }
123
                 }
125
             }
124
             }
126
-
127
         }catch (Exception e){
125
         }catch (Exception e){
126
+            e.printStackTrace();
128
             logger.error("taCheckinAdd -=- {}",e.toString());
127
             logger.error("taCheckinAdd -=- {}",e.toString());
129
             return ResponseBean.error("保存失败"+e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
128
             return ResponseBean.error("保存失败"+e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
130
         }
129
         }

+ 3
- 1
src/main/java/com/huiju/estateagents/controller/TaPersonController.java Целия файл

45
      * @return
45
      * @return
46
      */
46
      */
47
     @GetMapping("/wx/cards")
47
     @GetMapping("/wx/cards")
48
-    public ResponseBean getCardList(@RequestParam int pageNumber, @RequestParam int pageSize) {
48
+    public ResponseBean getCardList(@RequestParam(defaultValue = "1") int pageNumber,
49
+                                    @RequestParam(defaultValue = "10") int pageSize,
50
+                                    @RequestParam(defaultValue = "false") boolean mine) {
49
         if (pageNumber < 0 || pageSize < 0) {
51
         if (pageNumber < 0 || pageSize < 0) {
50
             return ResponseBean.error("分页参数不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
52
             return ResponseBean.error("分页参数不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
51
         }
53
         }

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/ExtendContent.java Целия файл

1
 package com.huiju.estateagents.entity;
1
 package com.huiju.estateagents.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import com.baomidou.mybatisplus.annotation.IdType;
5
 import com.baomidou.mybatisplus.annotation.IdType;
5
 import com.baomidou.mybatisplus.annotation.TableId;
6
 import com.baomidou.mybatisplus.annotation.TableId;
51
      */
52
      */
52
     private String targetId;
53
     private String targetId;
53
 
54
 
55
+    @TableField(exist = false)
56
+    private String targetName;
57
+
54
     /**
58
     /**
55
      * 图片
59
      * 图片
56
      */
60
      */

+ 11
- 4
src/main/java/com/huiju/estateagents/entity/TaBuilding.java Целия файл

160
 
160
 
161
     private String buildingType;
161
     private String buildingType;
162
 
162
 
163
-    private String serviceBuilding;
163
+    private String serviceCompany;
164
 
164
 
165
     private String serviceFee;
165
     private String serviceFee;
166
 
166
 
167
     private String decoration;
167
     private String decoration;
168
 
168
 
169
-    private String receivedDate;
169
+    private LocalDateTime receivedDate;
170
 
170
 
171
-    private String rightsYear;
171
+    private String preSalePermit;
172
 
172
 
173
-    private String familyNum;
173
+    private Integer rightsYear;
174
+
175
+    private Integer familyNum;
174
 
176
 
175
     private String parkingRate;
177
     private String parkingRate;
176
 
178
 
177
     private String volumeRate;
179
     private String volumeRate;
178
 
180
 
181
+    private Integer favorNum;
182
+    private Integer pvNum;
183
+    private Integer saveNum;
184
+    private Integer shareNum;
185
+
179
 
186
 
180
     /**
187
     /**
181
      * 图片
188
      * 图片

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaPerson.java Целия файл

220
 
220
 
221
     private String language;
221
     private String language;
222
 
222
 
223
-
223
+    private Integer saveNum;
224
 }
224
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java Целия файл

129
     @TableField(exist = false)
129
     @TableField(exist = false)
130
     private String consultTel;
130
     private String consultTel;
131
 
131
 
132
-    private String verifyStatus;
132
+    private Integer verifyStatus;
133
 
133
 
134
     private String verifyRemark;
134
     private String verifyRemark;
135
 
135
 

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaBuildingMapper.java Целия файл

6
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
 import org.apache.ibatis.annotations.Mapper;
7
 import org.apache.ibatis.annotations.Mapper;
8
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
9
+import org.apache.ibatis.annotations.Update;
9
 
10
 
10
 import java.util.List;
11
 import java.util.List;
11
 
12
 
26
      */
27
      */
27
     List<TaBuilding> buildingList(IPage<TaBuilding> page, @Param("Name") String name, @Param("Code")String code);
28
     List<TaBuilding> buildingList(IPage<TaBuilding> page, @Param("Name") String name, @Param("Code")String code);
28
 
29
 
30
+    @Update("UPDATE ta_building  SET ${field} = IFNULL(${field}, 0) + #{increment}  WHERE building_id = #{buildingId}")
31
+    void setFieldNum(@Param("buildingId") String buildingId, @Param("field") String field, @Param("increment") int increment);
29
 
32
 
30
     List<TaBuilding> buildingAll();
33
     List<TaBuilding> buildingAll();
31
 
34
 

+ 2
- 0
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java Целия файл

2
 
2
 
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.huiju.estateagents.base.ResponseBean;
4
 import com.huiju.estateagents.base.ResponseBean;
5
+import com.huiju.estateagents.entity.TaPerson;
5
 import com.huiju.estateagents.entity.TaRecommendCustomer;
6
 import com.huiju.estateagents.entity.TaRecommendCustomer;
6
 import com.baomidou.mybatisplus.extension.service.IService;
7
 import com.baomidou.mybatisplus.extension.service.IService;
7
 
8
 
34
     IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building);
35
     IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building);
35
 
36
 
36
 
37
 
38
+    TaRecommendCustomer newByPerson(TaPerson person);
37
 }
39
 }

+ 6
- 0
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java Целия файл

12
 import com.huiju.estateagents.mapper.TaMiniappQrcodeMapper;
12
 import com.huiju.estateagents.mapper.TaMiniappQrcodeMapper;
13
 import com.huiju.estateagents.service.IMiniAppService;
13
 import com.huiju.estateagents.service.IMiniAppService;
14
 import com.huiju.estateagents.service.ITaMiniFormidsService;
14
 import com.huiju.estateagents.service.ITaMiniFormidsService;
15
+import lombok.extern.slf4j.Slf4j;
15
 import me.chanjar.weixin.common.error.WxErrorException;
16
 import me.chanjar.weixin.common.error.WxErrorException;
16
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
21
 import java.util.ArrayList;
22
 import java.util.ArrayList;
22
 import java.util.List;
23
 import java.util.List;
23
 
24
 
25
+@Slf4j
24
 @Service
26
 @Service
25
 public class MiniAppServiceImpl implements IMiniAppService {
27
 public class MiniAppServiceImpl implements IMiniAppService {
26
 
28
 
168
         if (null == tpl) return ;
170
         if (null == tpl) return ;
169
 
171
 
170
         String formid = taMiniFormidsService.getFormidBy(toUser, true);
172
         String formid = taMiniFormidsService.getFormidBy(toUser, true);
173
+        if (StringUtils.isEmpty(formid)) {
174
+            log.error("發送消息失敗, 沒有有效的 formid");
175
+            return;
176
+        }
171
 
177
 
172
         WxMaTemplateMessage message = WxMaTemplateMessage.builder()
178
         WxMaTemplateMessage message = WxMaTemplateMessage.builder()
173
                 .templateId(tpl.getId())
179
                 .templateId(tpl.getId())

+ 1
- 0
src/main/java/com/huiju/estateagents/service/impl/TaMiniFormidsImpl.java Целия файл

39
     @Override
39
     @Override
40
     public String getFormidBy(String openid, boolean... delete) {
40
     public String getFormidBy(String openid, boolean... delete) {
41
         TaMiniFormids taMiniFormids = taMiniFormidsMapper.getFormidCanUse(openid);
41
         TaMiniFormids taMiniFormids = taMiniFormidsMapper.getFormidCanUse(openid);
42
+        if (null == taMiniFormids) return null;
42
 
43
 
43
         if (null != delete && delete.length > 0 && delete[0]) {
44
         if (null != delete && delete.length > 0 && delete[0]) {
44
             QueryWrapper<TaMiniFormids> wrapper = new QueryWrapper<>();
45
             QueryWrapper<TaMiniFormids> wrapper = new QueryWrapper<>();

+ 13
- 7
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java Целия файл

16
 import com.huiju.estateagents.mapper.*;
16
 import com.huiju.estateagents.mapper.*;
17
 import com.huiju.estateagents.service.ITaPersonService;
17
 import com.huiju.estateagents.service.ITaPersonService;
18
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
19
+import com.huiju.estateagents.service.ITaRecommendCustomerService;
19
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.stereotype.Service;
21
 import org.springframework.stereotype.Service;
21
 
22
 
63
     @Autowired
64
     @Autowired
64
     private TaPointsRecordsMapper taPointsRecordsMapper;
65
     private TaPointsRecordsMapper taPointsRecordsMapper;
65
 
66
 
67
+    @Autowired
68
+    private ITaRecommendCustomerService iTaRecommendCustomerService;
69
+
66
     @Override
70
     @Override
67
     public TaPerson mergePersonWxInfo(WxMaUserInfo userInfo) {
71
     public TaPerson mergePersonWxInfo(WxMaUserInfo userInfo) {
68
         // 先查询是否存在用户
72
         // 先查询是否存在用户
113
             return null;
117
             return null;
114
         }
118
         }
115
 
119
 
116
-//        if (null == phone || "".equals(phone)) {
117
-//            return null;
118
-//        }
120
+        // 电话为空, 代表没有获取到电话
121
+        if (null == phone || "".equals(phone)) {
122
+            return null;
123
+        }
119
 
124
 
120
         String tel = person.getTel();
125
         String tel = person.getTel();
121
 
126
 
122
         UpdateWrapper<TaPerson> wrapper = new UpdateWrapper<>();
127
         UpdateWrapper<TaPerson> wrapper = new UpdateWrapper<>();
123
         wrapper.set("phone", phone);
128
         wrapper.set("phone", phone);
124
         wrapper.set("person_type",CommConstant.PERSON_ESTATE_AGENT);
129
         wrapper.set("person_type",CommConstant.PERSON_ESTATE_AGENT);
125
-//        wrapper.set(null == tel || "".equals(tel), "tel", phone);
126
         wrapper.eq("mini_openid", miniOpenid);
130
         wrapper.eq("mini_openid", miniOpenid);
127
-//        wrapper.eq("person_type",null);
128
         wrapper.isNull("person_type");
131
         wrapper.isNull("person_type");
129
         taPersonMapper.update(new TaPerson(), wrapper);
132
         taPersonMapper.update(new TaPerson(), wrapper);
130
 
133
 
132
         if (null == tel || "".equals(tel)){
135
         if (null == tel || "".equals(tel)){
133
             person.setTel(phone);
136
             person.setTel(phone);
134
         }
137
         }
135
-    
138
+
139
+        iTaRecommendCustomerService.newByPerson(person);
140
+
136
         //查看是否领取过授权积分
141
         //查看是否领取过授权积分
137
         QueryWrapper<TaPointsRecords> taPointsRecordsQueryWrapper = new QueryWrapper<>();
142
         QueryWrapper<TaPointsRecords> taPointsRecordsQueryWrapper = new QueryWrapper<>();
143
+        taPointsRecordsQueryWrapper.eq("person_id", person.getPersonId());
138
         taPointsRecordsQueryWrapper.eq("change_type",CommConstant.POINTS_AUTHORIZE);
144
         taPointsRecordsQueryWrapper.eq("change_type",CommConstant.POINTS_AUTHORIZE);
139
-        taPointsRecordsQueryWrapper.like("change_params","%\""+person.getPersonId()+"\"%");
145
+
140
         List<TaPointsRecords> taPointsRecordsList = taPointsRecordsMapper.selectList(taPointsRecordsQueryWrapper);
146
         List<TaPointsRecords> taPointsRecordsList = taPointsRecordsMapper.selectList(taPointsRecordsQueryWrapper);
141
         if (taPointsRecordsList.size() < 0){
147
         if (taPointsRecordsList.size() < 0){
142
             //发放积分
148
             //发放积分

+ 58
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Целия файл

281
         queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
281
         queryWrapper.gt("status", CommConstant.MESSAGE_UNREAD);
282
         IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
282
         IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
283
         return taRecommendCustomerMapper.selectPage(page,queryWrapper);
283
         return taRecommendCustomerMapper.selectPage(page,queryWrapper);
284
+    }
285
+
286
+    @Override
287
+    public TaRecommendCustomer newByPerson(TaPerson person) {
288
+        // 没有手机号, 暂时不生成客户信息
289
+        String phone = StringUtils.ifNull(person.getTel(), person.getPhone());
290
+        if (StringUtils.isEmpty(phone)) {
291
+            return null;
292
+        }
293
+
294
+        // 已经存在的, 随机返回一条记录
295
+        List<TaRecommendCustomer> custs = getCustomerByPhone(phone);
296
+        if (null != custs && custs.size() > 0) {
297
+            return custs.get(0);
298
+        }
299
+
300
+        TaRecommendCustomer cust = new TaRecommendCustomer();
301
+        cust.setName(StringUtils.ifNull(person.getName(), person.getNickname()));
302
+        cust.setSex(null == person.getSex() ? str2Int(person.getGender()) : person.getSex());
303
+        cust.setPhone(phone);
304
+        cust.setPicture(StringUtils.ifNull(person.getPhoto(), person.getAvatarurl()));
305
+        cust.setCountry(person.getCountry());
306
+        cust.setCity(person.getCity());
307
+        cust.setProvince(person.getProvince());
308
+        // 审核同意
309
+        cust.setVerifyStatus(CommConstant.VERIFY_AGREE);
310
+        // 报备状态
311
+        cust.setStatus(CommConstant.CUSTOMER_REPORT);
312
+        // 当前日期
313
+        cust.setReportDate(LocalDateTime.now());
314
+
315
+        if (taRecommendCustomerMapper.insert(cust) > 0) {
316
+            return cust;
317
+        } else {
318
+            log.error("依据人员新增推荐客户失败");
319
+            return null;
320
+        }
321
+    }
322
+
323
+    private List<TaRecommendCustomer> getCustomerByPhone(String phone) {
324
+        QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();
325
+        queryWrapper.eq("phone", phone);
326
+        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
327
+        queryWrapper.orderByDesc("report_date");
328
+
329
+        List<TaRecommendCustomer> custs = taRecommendCustomerMapper.selectList(queryWrapper);
330
+        return custs;
331
+    }
332
+
333
+    private Integer str2Int(String str) {
334
+        if (null == str) {
335
+            return null;
336
+        }
284
 
337
 
338
+        try {
339
+            return Integer.valueOf(str);
340
+        } catch (Exception e) {
341
+            return 0;
342
+        }
285
     }
343
     }
286
 }
344
 }

+ 10
- 4
src/main/java/com/huiju/estateagents/service/impl/TaSaveServiceImpl.java Целия файл

4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
 import com.huiju.estateagents.base.ResponseBean;
5
 import com.huiju.estateagents.base.ResponseBean;
6
 import com.huiju.estateagents.common.CommConstant;
6
 import com.huiju.estateagents.common.CommConstant;
7
+import com.huiju.estateagents.entity.TaBuilding;
7
 import com.huiju.estateagents.entity.TaPerson;
8
 import com.huiju.estateagents.entity.TaPerson;
8
 import com.huiju.estateagents.entity.TaSave;
9
 import com.huiju.estateagents.entity.TaSave;
9
-import com.huiju.estateagents.mapper.TaBuildingDynamicMapper;
10
-import com.huiju.estateagents.mapper.TaNewsMapper;
11
-import com.huiju.estateagents.mapper.TaPersonMapper;
12
-import com.huiju.estateagents.mapper.TaSaveMapper;
10
+import com.huiju.estateagents.mapper.*;
13
 import com.huiju.estateagents.service.ITaSaveService;
11
 import com.huiju.estateagents.service.ITaSaveService;
14
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
40
     @Autowired
38
     @Autowired
41
     private TaNewsMapper taNewsMapper;
39
     private TaNewsMapper taNewsMapper;
42
 
40
 
41
+    @Autowired
42
+    private TaBuildingMapper taBuildingMapper;
43
+
43
     @Autowired
44
     @Autowired
44
     private TaBuildingDynamicMapper taBuildingDynamicMapper;
45
     private TaBuildingDynamicMapper taBuildingDynamicMapper;
45
 
46
 
87
             taBuildingDynamicMapper.setFieldNum(like, "save_num", 1);
88
             taBuildingDynamicMapper.setFieldNum(like, "save_num", 1);
88
         }
89
         }
89
 
90
 
91
+        // 如果是項目收藏, 则 +1
92
+        if(typeOf.equals(CommConstant.FAVOR_PROJECT)) {
93
+            taBuildingMapper.setFieldNum(like, "save_num", 1);
94
+        }
95
+
90
         return ResponseBean.success("");
96
         return ResponseBean.success("");
91
     }
97
     }
92
 
98
 

+ 8
- 0
src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java Целия файл

40
     @Autowired
40
     @Autowired
41
     private TaPointsRecordsMapper taPointsRecordsMapper;
41
     private TaPointsRecordsMapper taPointsRecordsMapper;
42
 
42
 
43
+    @Autowired
44
+    private TaBuildingMapper taBuildingMapper;
45
+
43
     @Autowired
46
     @Autowired
44
     private TaBuildingDynamicMapper taBuildingDynamicMapper;
47
     private TaBuildingDynamicMapper taBuildingDynamicMapper;
45
 
48
 
86
         if (typeOf == CommConstant.FAVOR_CONSULTANT) {
89
         if (typeOf == CommConstant.FAVOR_CONSULTANT) {
87
             taPersonMapper.setFieldIncrement(id,"share_num", 1);
90
             taPersonMapper.setFieldIncrement(id,"share_num", 1);
88
         }
91
         }
92
+
93
+        if(typeOf.equals(CommConstant.FAVOR_PROJECT)) {
94
+            taBuildingMapper.setFieldNum(id, "share_num", 1);
95
+        }
96
+
89
         //发放分享积分
97
         //发放分享积分
90
         if (typeOf.equals(CommConstant.FAVOR_PROJECT)){
98
         if (typeOf.equals(CommConstant.FAVOR_PROJECT)){
91
             QueryWrapper<TdPointsRules> tdPointsRulesQueryWrapper = new QueryWrapper<>();
99
             QueryWrapper<TdPointsRules> tdPointsRulesQueryWrapper = new QueryWrapper<>();

+ 1
- 1
src/main/resources/application-prod.yml Целия файл

1
 server:
1
 server:
2
-  port: 8001
2
+  port: 8566
3
 spring:
3
 spring:
4
   application:
4
   application:
5
     name: estateagents
5
     name: estateagents