瀏覽代碼

字典表

傅行帆 6 年之前
父節點
當前提交
06953bf790

+ 11
- 4
src/main/java/com.huiju.welcome/controller/SysDictController.java 查看文件

9
 import org.slf4j.Logger;
9
 import org.slf4j.Logger;
10
 import org.slf4j.LoggerFactory;
10
 import org.slf4j.LoggerFactory;
11
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.util.StringUtils;
12
 import org.springframework.web.bind.annotation.PathVariable;
13
 import org.springframework.web.bind.annotation.PathVariable;
13
 import org.springframework.web.bind.annotation.RequestBody;
14
 import org.springframework.web.bind.annotation.RequestBody;
14
 import org.springframework.web.bind.annotation.RequestMapping;
15
 import org.springframework.web.bind.annotation.RequestMapping;
32
     private final Logger logger = LoggerFactory.getLogger(SysDictController.class);
33
     private final Logger logger = LoggerFactory.getLogger(SysDictController.class);
33
 
34
 
34
     @Autowired
35
     @Autowired
35
-    public ISysDictService iSysDictService;
36
+    private ISysDictService iSysDictService;
36
 
37
 
37
 
38
 
38
     /**
39
     /**
118
      * 根据TYPE查询对象
119
      * 根据TYPE查询对象
119
      * @param type  实体type
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
         ResponseBean responseBean = new ResponseBean();
124
         ResponseBean responseBean = new ResponseBean();
124
         try {
125
         try {
125
             QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
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
             responseBean.addSuccess(iSysDictService.list(queryWrapper));
134
             responseBean.addSuccess(iSysDictService.list(queryWrapper));
128
         }catch (Exception e){
135
         }catch (Exception e){
129
             logger.error("getByType -=- {}",e.toString());
136
             logger.error("getByType -=- {}",e.toString());

+ 1
- 1
src/main/java/com.huiju.welcome/controller/TaCustomerController.java 查看文件

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

+ 43
- 2
src/main/java/com.huiju.welcome/model/TaCustomer.java 查看文件

49
     private String favorHouse;
49
     private String favorHouse;
50
 
50
 
51
     private String favorLevel;
51
     private String favorLevel;
52
+    
53
+    @TableField(exist = false)
54
+    private String favorLevelLable;
52
 
55
 
53
     private String remark;
56
     private String remark;
54
 
57
 
85
      * 现居住区域
88
      * 现居住区域
86
      */
89
      */
87
     private Integer nowArea;
90
     private Integer nowArea;
91
+    
92
+    @TableField(exist = false)
93
+    private String nowAreaLable;
88
 
94
 
89
     /**
95
     /**
90
      * 现居住小区
96
      * 现居住小区
100
      * 家庭成员收入工作城市
106
      * 家庭成员收入工作城市
101
      */
107
      */
102
     private Integer familyWork;
108
     private Integer familyWork;
103
-
109
+    
110
+    @TableField(exist = false)
111
+    private String familyWorkLable;
104
     /**
112
     /**
105
      * 请填写具体城市名称
113
      * 请填写具体城市名称
106
      */
114
      */
115
      * 家庭收入成员工作行业
123
      * 家庭收入成员工作行业
116
      */
124
      */
117
     private String familyIndustry;
125
     private String familyIndustry;
126
+    
127
+    @TableField(exist = false)
128
+    private String familyIndustryLable;
118
 
129
 
119
     /**
130
     /**
120
      * 家庭收入成员工作职务
131
      * 家庭收入成员工作职务
121
      */
132
      */
122
     private String familyDuty;
133
     private String familyDuty;
134
+    
135
+    @TableField(exist = false)
136
+    private String familyDutyLable;
123
 
137
 
124
     /**
138
     /**
125
      * 家庭本市置业次数
139
      * 家庭本市置业次数
126
      */
140
      */
127
     private Integer housePurchasing;
141
     private Integer housePurchasing;
142
+    
143
+    @TableField(exist = false)
144
+    private String housePurchasingLable;
128
 
145
 
129
     /**
146
     /**
130
      * 家庭本市名下房产数量
147
      * 家庭本市名下房产数量
131
      */
148
      */
132
     private Integer houseProperty;
149
     private Integer houseProperty;
150
+    
151
+    @TableField(exist = false)
152
+    private String housePropertyLable;
133
 
153
 
134
     /**
154
     /**
135
      * 现居住面积
155
      * 现居住面积
136
      */
156
      */
137
     private Integer houseLivingArea;
157
     private Integer houseLivingArea;
158
+    
159
+    @TableField(exist = false)
160
+    private String houseLivingAreaLable;
138
 
161
 
139
     /**
162
     /**
140
      * 现居住户型
163
      * 现居住户型
141
      */
164
      */
142
     private Integer houseType;
165
     private Integer houseType;
166
+    
167
+    @TableField(exist = false)
168
+    private String houseTypeLable;
143
 
169
 
144
     /**
170
     /**
145
      * 目前家庭结构
171
      * 目前家庭结构
146
      */
172
      */
147
     private Integer familyStructure;
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
 
67
 
68
     @Autowired
68
     @Autowired
69
     MiniApp miniApp;
69
     MiniApp miniApp;
70
+    
71
+    @Autowired
72
+    private ISysDictService iSysDictService;
70
 
73
 
71
     @Override
74
     @Override
72
     public List<TaPerson> getGroup(Integer customerId) {
75
     public List<TaPerson> getGroup(Integer customerId) {
293
     public TaCustomer getByPhoneOrPlate(String phone, String plateNumber) {
296
     public TaCustomer getByPhoneOrPlate(String phone, String plateNumber) {
294
         QueryWrapper<TaCustomer> queryWrapper = new QueryWrapper<>();
297
         QueryWrapper<TaCustomer> queryWrapper = new QueryWrapper<>();
295
         queryWrapper.eq(phone != null,"phone", phone).or().eq(plateNumber != null, "plate_number", plateNumber);
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
         queryWrapper.orderByDesc("status");
301
         queryWrapper.orderByDesc("status");
298
         queryWrapper.orderByDesc("create_date");
302
         queryWrapper.orderByDesc("create_date");
299
         queryWrapper.last("limit 1");
303
         queryWrapper.last("limit 1");
304
     @Override
308
     @Override
305
     public TaCustomer getWithLastVisit(Integer id) {
309
     public TaCustomer getWithLastVisit(Integer id) {
306
         TaCustomer taCustomer = taCustomerMapper.selectById(id);
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
         TaMainUsherRecord taMainUsherRecord = iTaMainUsherRecordService.getTodayRecord(taCustomer.getCustomerId());
353
         TaMainUsherRecord taMainUsherRecord = iTaMainUsherRecordService.getTodayRecord(taCustomer.getCustomerId());
310
         if (null != taMainUsherRecord) {
354
         if (null != taMainUsherRecord) {