|
@@ -18,6 +18,7 @@ import com.huiju.estateagents.eContract.entity.TaContractUser;
|
18
|
18
|
import com.huiju.estateagents.eContract.service.ITaCompanySealService;
|
19
|
19
|
import com.huiju.estateagents.config.FadadaProperties;
|
20
|
20
|
import com.huiju.estateagents.eContract.service.ITaContractUserService;
|
|
21
|
+import com.huiju.estateagents.eContract.service.impl.TaCompanySealUtil;
|
21
|
22
|
import com.huiju.estateagents.entity.TaMiniapp;
|
22
|
23
|
import com.huiju.estateagents.sample.entity.TaH5Demand;
|
23
|
24
|
import com.huiju.estateagents.service.impl.TaMiniappServiceImpl;
|
|
@@ -76,6 +77,9 @@ public class TaCompanyController extends BaseController {
|
76
|
77
|
@Autowired
|
77
|
78
|
private TaMiniappServiceImpl taMiniappService;
|
78
|
79
|
|
|
80
|
+ @Autowired
|
|
81
|
+ private TaCompanySealUtil taCompanySealUtil;
|
|
82
|
+
|
79
|
83
|
|
80
|
84
|
/**
|
81
|
85
|
* 条件查询企业列表
|
|
@@ -122,18 +126,12 @@ public class TaCompanyController extends BaseController {
|
122
|
126
|
@RequestMapping(value = "/admin/taCompanyList", method = RequestMethod.GET)
|
123
|
127
|
public ResponseBean companyList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
124
|
128
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
125
|
|
- String companyName, String companyCode) {
|
|
129
|
+ String companyName, String companyCode, HttpServletRequest request) {
|
126
|
130
|
ResponseBean responseBean = new ResponseBean();
|
127
|
131
|
try {
|
128
|
132
|
//使用分页插件
|
129
|
133
|
IPage<TaCompany> pg = new Page<>(pageNum, pageSize);
|
130
|
|
- QueryWrapper<TaCompany> queryWrapper = new QueryWrapper<>();
|
131
|
|
- queryWrapper.like(StringUtils.isNotBlank(companyName), "company_name", companyName);
|
132
|
|
- queryWrapper.like(StringUtils.isNotBlank(companyCode), "company_code", companyCode);
|
133
|
|
- queryWrapper.eq("status", CommConstant.REAL_NAME_STATUS);
|
134
|
|
- queryWrapper.orderByDesc("create_date");
|
135
|
|
-
|
136
|
|
- IPage<TaCompany> result = iTaCompanyService.page(pg, queryWrapper);
|
|
134
|
+ IPage<TaCompany> result = iTaCompanyService.selectListByOrgId(pg, companyCode, companyName, getOrgId(request));
|
137
|
135
|
List<TaCompany> taCompanyList = result.getRecords();
|
138
|
136
|
for (TaCompany taCompany : taCompanyList){
|
139
|
137
|
QueryWrapper<TaCompanySeal> sealQueryWrapper = new QueryWrapper<>();
|
|
@@ -506,6 +504,37 @@ public class TaCompanyController extends BaseController {
|
506
|
504
|
return responseBean;
|
507
|
505
|
}
|
508
|
506
|
|
|
507
|
+ /**
|
|
508
|
+ * 设置默认章
|
|
509
|
+ */
|
|
510
|
+ @RequestMapping(value = "/channel/company/setDefaultSeal/{id}", method = RequestMethod.POST)
|
|
511
|
+ public ResponseBean setDefaultSeal(@PathVariable Integer id){
|
|
512
|
+ ResponseBean responseBean = new ResponseBean();
|
|
513
|
+ TaCompanySeal taCompanySeal = iTaCompanySealService.getById(id);
|
|
514
|
+ TaCompany taCompany = iTaCompanyService.getById(taCompanySeal.getCompanyId());
|
|
515
|
+ String res = taCompanySealUtil.setDefaultSeal(taCompanySeal.getSignatureId(), taCompany.getFadadaCode());
|
|
516
|
+ JSONObject result = JSONObject.parseObject(res);
|
|
517
|
+ if ((Integer) result.get("code") != 1){
|
|
518
|
+ responseBean.addError(result.getString("msg"));
|
|
519
|
+ return responseBean;
|
|
520
|
+ }
|
|
521
|
+ //更新旧的印章为否
|
|
522
|
+ QueryWrapper<TaCompanySeal> taCompanySealQueryWrapper = new QueryWrapper<>();
|
|
523
|
+ taCompanySealQueryWrapper.eq("company_id", taCompany.getCompanyId());
|
|
524
|
+ taCompanySealQueryWrapper.eq("default_seal", CommConstant.STATUS_NORMAL);
|
|
525
|
+ TaCompanySeal oldDefaultSeal = iTaCompanySealService.getOne(taCompanySealQueryWrapper);
|
|
526
|
+ oldDefaultSeal.setDefaultSeal(CommConstant.STATUS_UNACCALIMED);
|
|
527
|
+ iTaCompanySealService.updateById(oldDefaultSeal);
|
|
528
|
+
|
|
529
|
+ //更新默认章
|
|
530
|
+ taCompanySeal.setDefaultSeal(CommConstant.STATUS_NORMAL);
|
|
531
|
+ iTaCompanySealService.updateById(taCompanySeal);
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+ responseBean.addSuccess(result.getString("msg"));
|
|
535
|
+ return responseBean;
|
|
536
|
+ }
|
|
537
|
+
|
509
|
538
|
|
510
|
539
|
/**
|
511
|
540
|
* 手动签署回调函数
|