|
@@ -1,5 +1,6 @@
|
1
|
1
|
package com.huiju.estateagents.eContract.controller;
|
2
|
2
|
|
|
3
|
+import com.alibaba.fastjson.JSONArray;
|
3
|
4
|
import com.alibaba.fastjson.JSONObject;
|
4
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
6
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -10,6 +11,7 @@ import com.huiju.estateagents.common.CommConstant;
|
10
|
11
|
import com.huiju.estateagents.eContract.entity.TaCompanySeal;
|
11
|
12
|
import com.huiju.estateagents.eContract.service.ITaCompanySealService;
|
12
|
13
|
import com.huiju.estateagents.config.FadadaProperties;
|
|
14
|
+import com.huiju.estateagents.sample.entity.TaH5Demand;
|
13
|
15
|
import org.apache.commons.lang3.StringUtils;
|
14
|
16
|
import org.slf4j.Logger;
|
15
|
17
|
import org.slf4j.LoggerFactory;
|
|
@@ -25,7 +27,9 @@ import com.huiju.estateagents.eContract.entity.TaCompany;
|
25
|
27
|
import org.springframework.web.bind.annotation.RestController;
|
26
|
28
|
|
27
|
29
|
import javax.servlet.http.HttpServletRequest;
|
|
30
|
+import java.util.HashMap;
|
28
|
31
|
import java.util.List;
|
|
32
|
+import java.util.Map;
|
29
|
33
|
|
30
|
34
|
/**
|
31
|
35
|
* <p>
|
|
@@ -219,7 +223,7 @@ public class TaCompanyController extends BaseController {
|
219
|
223
|
* @param pageSize
|
220
|
224
|
* @param companyName
|
221
|
225
|
* @param companyCode
|
222
|
|
- * @param certifiedStatus
|
|
226
|
+ * @param status
|
223
|
227
|
* @return
|
224
|
228
|
*/
|
225
|
229
|
@RequestMapping(value = "/channel/company/list", method = RequestMethod.GET)
|
|
@@ -227,7 +231,7 @@ public class TaCompanyController extends BaseController {
|
227
|
231
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
228
|
232
|
@RequestParam(value = "companyName", required = false) String companyName,
|
229
|
233
|
@RequestParam(value = "companyCode", required = false) String companyCode,
|
230
|
|
- @RequestParam(value = "certifiedStatus", required = false) String certifiedStatus) {
|
|
234
|
+ @RequestParam(value = "certifiedStatus", required = false) String status) {
|
231
|
235
|
ResponseBean responseBean = new ResponseBean();
|
232
|
236
|
try {
|
233
|
237
|
//使用分页插件
|
|
@@ -235,8 +239,8 @@ public class TaCompanyController extends BaseController {
|
235
|
239
|
QueryWrapper<TaCompany> queryWrapper = new QueryWrapper<>();
|
236
|
240
|
queryWrapper.like(StringUtils.isNotBlank(companyName), "company_name", companyName);
|
237
|
241
|
queryWrapper.like(StringUtils.isNotBlank(companyCode), "company_code", companyCode);
|
238
|
|
- queryWrapper.eq(StringUtils.isNotBlank(certifiedStatus), "certified_status", certifiedStatus);
|
239
|
|
- queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
|
|
242
|
+ queryWrapper.eq(StringUtils.isNotBlank(status), "status", status);
|
|
243
|
+ queryWrapper.gt("status", CommConstant.STATUS_DELETE);
|
240
|
244
|
queryWrapper.orderByDesc("create_date");
|
241
|
245
|
|
242
|
246
|
IPage<TaCompany> result = iTaCompanyService.page(pg, queryWrapper);
|
|
@@ -303,4 +307,55 @@ public class TaCompanyController extends BaseController {
|
303
|
307
|
}
|
304
|
308
|
return responseBean;
|
305
|
309
|
}
|
|
310
|
+
|
|
311
|
+ /**
|
|
312
|
+ * 根据id去法大大那边拿最新数据然后更新
|
|
313
|
+ *
|
|
314
|
+ * @param id 实体ID
|
|
315
|
+ */
|
|
316
|
+ @RequestMapping(value = "/channel/company/fdd/{id}", method = RequestMethod.GET)
|
|
317
|
+ public ResponseBean updateCompanyInfoByFdd(@PathVariable Integer id) {
|
|
318
|
+ ResponseBean responseBean = new ResponseBean();
|
|
319
|
+ try {
|
|
320
|
+ TaCompany newCompany = iTaCompanyService.updateCompanyInfoByFdd(id);
|
|
321
|
+ responseBean.addSuccess(newCompany);
|
|
322
|
+ } catch (Exception e) {
|
|
323
|
+ e.printStackTrace();
|
|
324
|
+ logger.error("taCompanyDelete -=- {}", e.toString());
|
|
325
|
+ responseBean.addError(e.getMessage());
|
|
326
|
+ }
|
|
327
|
+ return responseBean;
|
|
328
|
+ }
|
|
329
|
+
|
|
330
|
+ /**
|
|
331
|
+ * 根据id更新数据
|
|
332
|
+ *
|
|
333
|
+ * @param
|
|
334
|
+ */
|
|
335
|
+ @RequestMapping(value = "/channel/company/delete", method = RequestMethod.DELETE)
|
|
336
|
+ public ResponseBean updateCompanyInfo(@RequestBody String ids) {
|
|
337
|
+ ResponseBean responseBean = new ResponseBean();
|
|
338
|
+ try {
|
|
339
|
+ int successNum = 0;
|
|
340
|
+ int failNum = 0;
|
|
341
|
+ JSONArray jsonArray = JSONObject.parseObject(ids).getJSONArray("ids");
|
|
342
|
+ for (Object id : jsonArray) {
|
|
343
|
+ TaCompany company = iTaCompanyService.getById((Integer) id);
|
|
344
|
+ if (CommConstant.STATUS_UNACCALIMED.equals(company.getStatus())){
|
|
345
|
+ company.setStatus(CommConstant.STATUS_DELETE);
|
|
346
|
+ iTaCompanyService.updateById(company);
|
|
347
|
+ successNum++;
|
|
348
|
+ }else{
|
|
349
|
+ failNum++;
|
|
350
|
+ }
|
|
351
|
+ }
|
|
352
|
+ Map<String,Object> map = new HashMap<>();
|
|
353
|
+ map.put("successNum",successNum);
|
|
354
|
+ map.put("failNum",failNum);
|
|
355
|
+ responseBean.addSuccess(map);
|
|
356
|
+ }catch (Exception e){
|
|
357
|
+ responseBean.addError(e.getMessage());
|
|
358
|
+ }
|
|
359
|
+ return responseBean;
|
|
360
|
+ }
|
306
|
361
|
}
|