소스 검색

字典表

傅行帆 6 년 전
부모
커밋
06953bf790

+ 11
- 4
src/main/java/com.huiju.welcome/controller/SysDictController.java 파일 보기

@@ -9,6 +9,7 @@ import com.huiju.welcome.service.ISysDictService;
9 9
 import org.slf4j.Logger;
10 10
 import org.slf4j.LoggerFactory;
11 11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.util.StringUtils;
12 13
 import org.springframework.web.bind.annotation.PathVariable;
13 14
 import org.springframework.web.bind.annotation.RequestBody;
14 15
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,7 +33,7 @@ public class SysDictController extends BaseController {
32 33
     private final Logger logger = LoggerFactory.getLogger(SysDictController.class);
33 34
 
34 35
     @Autowired
35
-    public ISysDictService iSysDictService;
36
+    private ISysDictService iSysDictService;
36 37
 
37 38
 
38 39
     /**
@@ -118,12 +119,18 @@ public class SysDictController extends BaseController {
118 119
      * 根据TYPE查询对象
119 120
      * @param type  实体type
120 121
      */
121
-    @RequestMapping(value="/dict/get",method= RequestMethod.GET)
122
-    public ResponseBean getDictByType(@RequestParam  String type){
122
+    @RequestMapping(value="/miniapp/dicts",method= RequestMethod.GET)
123
+    public ResponseBean getDictByType(String type){
123 124
         ResponseBean responseBean = new ResponseBean();
124 125
         try {
125 126
             QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
126
-            queryWrapper.eq("type",type);
127
+            if(!StringUtils.isEmpty(type)){
128
+                queryWrapper.eq("type",type);
129
+            }
130
+            queryWrapper.orderByAsc("type");
131
+            queryWrapper.orderByDesc("sort");
132
+            queryWrapper.orderByDesc("create_date");
133
+            
127 134
             responseBean.addSuccess(iSysDictService.list(queryWrapper));
128 135
         }catch (Exception e){
129 136
             logger.error("getByType -=- {}",e.toString());

+ 1
- 1
src/main/java/com.huiju.welcome/controller/TaCustomerController.java 파일 보기

@@ -202,7 +202,7 @@ public class TaCustomerController extends BaseController {
202 202
 
203 203
             iTaMainUsherRecordService.updateByCustomer(taCustomer, follows, JWTUtils.getSubject(request));
204 204
 
205
-            taCustomer.setRemark(null);
205
+            //taCustomer.setRemark(null);
206 206
             if (iTaCustomerService.updateById(taCustomer)){
207 207
 
208 208
                 // 反更新人员

+ 43
- 2
src/main/java/com.huiju.welcome/model/TaCustomer.java 파일 보기

@@ -49,6 +49,9 @@ public class TaCustomer implements Serializable {
49 49
     private String favorHouse;
50 50
 
51 51
     private String favorLevel;
52
+    
53
+    @TableField(exist = false)
54
+    private String favorLevelLable;
52 55
 
53 56
     private String remark;
54 57
 
@@ -85,6 +88,9 @@ public class TaCustomer implements Serializable {
85 88
      * 现居住区域
86 89
      */
87 90
     private Integer nowArea;
91
+    
92
+    @TableField(exist = false)
93
+    private String nowAreaLable;
88 94
 
89 95
     /**
90 96
      * 现居住小区
@@ -100,7 +106,9 @@ public class TaCustomer implements Serializable {
100 106
      * 家庭成员收入工作城市
101 107
      */
102 108
     private Integer familyWork;
103
-
109
+    
110
+    @TableField(exist = false)
111
+    private String familyWorkLable;
104 112
     /**
105 113
      * 请填写具体城市名称
106 114
      */
@@ -115,35 +123,68 @@ public class TaCustomer implements Serializable {
115 123
      * 家庭收入成员工作行业
116 124
      */
117 125
     private String familyIndustry;
126
+    
127
+    @TableField(exist = false)
128
+    private String familyIndustryLable;
118 129
 
119 130
     /**
120 131
      * 家庭收入成员工作职务
121 132
      */
122 133
     private String familyDuty;
134
+    
135
+    @TableField(exist = false)
136
+    private String familyDutyLable;
123 137
 
124 138
     /**
125 139
      * 家庭本市置业次数
126 140
      */
127 141
     private Integer housePurchasing;
142
+    
143
+    @TableField(exist = false)
144
+    private String housePurchasingLable;
128 145
 
129 146
     /**
130 147
      * 家庭本市名下房产数量
131 148
      */
132 149
     private Integer houseProperty;
150
+    
151
+    @TableField(exist = false)
152
+    private String housePropertyLable;
133 153
 
134 154
     /**
135 155
      * 现居住面积
136 156
      */
137 157
     private Integer houseLivingArea;
158
+    
159
+    @TableField(exist = false)
160
+    private String houseLivingAreaLable;
138 161
 
139 162
     /**
140 163
      * 现居住户型
141 164
      */
142 165
     private Integer houseType;
166
+    
167
+    @TableField(exist = false)
168
+    private String houseTypeLable;
143 169
 
144 170
     /**
145 171
      * 目前家庭结构
146 172
      */
147 173
     private Integer familyStructure;
148
-
174
+    
175
+    @TableField(exist = false)
176
+    private String familyStructureLable;
177
+    
178
+    /**
179
+     * 客户年龄
180
+     */
181
+    private Integer customerAge;
182
+    
183
+    @TableField(exist = false)
184
+    private String customerAgeLable;
185
+    
186
+    /**
187
+     * 身份证号
188
+     */
189
+    private String idcard;
149 190
 }

+ 46
- 2
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java 파일 보기

@@ -67,6 +67,9 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
67 67
 
68 68
     @Autowired
69 69
     MiniApp miniApp;
70
+    
71
+    @Autowired
72
+    private ISysDictService iSysDictService;
70 73
 
71 74
     @Override
72 75
     public List<TaPerson> getGroup(Integer customerId) {
@@ -293,7 +296,8 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
293 296
     public TaCustomer getByPhoneOrPlate(String phone, String plateNumber) {
294 297
         QueryWrapper<TaCustomer> queryWrapper = new QueryWrapper<>();
295 298
         queryWrapper.eq(phone != null,"phone", phone).or().eq(plateNumber != null, "plate_number", plateNumber);
296
-        queryWrapper.eq(null == phone || null == plateNumber, "customer_id", -1); // 故意设置一个查询不到数据的条件
299
+        // 故意设置一个查询不到数据的条件
300
+        queryWrapper.eq(null == phone || null == plateNumber, "customer_id", -1);
297 301
         queryWrapper.orderByDesc("status");
298 302
         queryWrapper.orderByDesc("create_date");
299 303
         queryWrapper.last("limit 1");
@@ -304,7 +308,47 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
304 308
     @Override
305 309
     public TaCustomer getWithLastVisit(Integer id) {
306 310
         TaCustomer taCustomer = taCustomerMapper.selectById(id);
307
-        if (null == taCustomer) return null;
311
+        if (null == taCustomer) {
312
+            return null;
313
+        }
314
+        //获取字典表所有信息
315
+        List<SysDict> dictList = iSysDictService.list();
316
+        dictList.stream().forEach(e -> {
317
+            //对比数据重新赛值
318
+            if (e.getId().equals(taCustomer.getNowArea())){
319
+                taCustomer.setNowAreaLable(e.getLabel());
320
+            }
321
+            if (e.getId().equals(taCustomer.getFamilyWork())){
322
+                taCustomer.setFamilyWorkLable(e.getLabel());
323
+            }
324
+            if (e.getId().equals(Integer.valueOf(taCustomer.getFamilyIndustry()))){
325
+                taCustomer.setFamilyIndustryLable(e.getLabel());
326
+            }
327
+            if (e.getId().equals(Integer.valueOf(taCustomer.getFamilyDuty()))){
328
+                taCustomer.setFamilyDutyLable(e.getLabel());
329
+            }
330
+            if (e.getId().equals(taCustomer.getHousePurchasing())){
331
+                taCustomer.setHousePurchasingLable(e.getLabel());
332
+            }
333
+            if (e.getId().equals(taCustomer.getHouseProperty())){
334
+                taCustomer.setHousePropertyLable(e.getLabel());
335
+            }
336
+            if (e.getId().equals(taCustomer.getHouseLivingArea())){
337
+                taCustomer.setHouseLivingAreaLable(e.getLabel());
338
+            }
339
+            if (e.getId().equals(taCustomer.getHouseType())){
340
+                taCustomer.setHouseTypeLable(e.getLabel());
341
+            }
342
+            if (e.getId().equals(taCustomer.getFamilyStructure())){
343
+                taCustomer.setFamilyStructureLable(e.getLabel());
344
+            }
345
+            if (e.getId().equals(taCustomer.getCustomerAge())){
346
+                taCustomer.setCustomerAgeLable(e.getLabel());
347
+            }
348
+            if (e.getId().equals(Integer.valueOf(taCustomer.getFavorLevel()))){
349
+                taCustomer.setFavorLevelLable(e.getLabel());
350
+            }
351
+        });
308 352
 
309 353
         TaMainUsherRecord taMainUsherRecord = iTaMainUsherRecordService.getTodayRecord(taCustomer.getCustomerId());
310 354
         if (null != taMainUsherRecord) {