|
@@ -59,7 +59,6 @@ public class BaseAgencyController extends BaseController {
|
|
|
private ISysDictDataService dictDataService;
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "新增招标代理机构")
|
|
|
@PostMapping("/insertBaseAgency")
|
|
|
@PreAuthorize("@ss.hasPermi('base:agency:add')")
|
|
@@ -142,9 +141,21 @@ public class BaseAgencyController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(vo.getStatus())) {
|
|
|
lw.eq(BaseAgency::getStatus, vo.getStatus());
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(vo.getCompanyType())) {
|
|
|
- lw.eq(BaseAgency::getCompanyType, vo.getCompanyType());
|
|
|
+ List<Integer> companyType = vo.getCompanyTypes();
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
+ if (!ObjectUtils.isEmpty(companyType)) {
|
|
|
+ builder.append("(");
|
|
|
+ for (int i = 0; i < companyType.size(); i++) {
|
|
|
+ Integer type = companyType.get(i);
|
|
|
+ if (i != companyType.size() - 1) {
|
|
|
+ builder.append("company_type like '%").append(type).append("%' or ");
|
|
|
+ } else {
|
|
|
+ builder.append("company_type like '%").append(type).append("%' )");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ lw.apply(builder.toString());
|
|
|
+ lw.orderBy(true, false, BaseAgency::getCreateTime);
|
|
|
IPage<BaseAgency> page = baseAgencyService.page(new Page<BaseAgency>(vo.getPageNum(), vo.getPageSize()), lw);
|
|
|
if (!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())) {
|
|
|
List<SysDictData> dictData = dictTypeService.selectDictDataByType(Constants.SYS_COMPANY_NATURE);
|
|
@@ -155,15 +166,15 @@ public class BaseAgencyController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(dl)) {
|
|
|
o.setCompanyNature(dl.get(0).getDictLabel());
|
|
|
}
|
|
|
- if(!ObjectUtils.isEmpty(o.getCompanyType())){
|
|
|
+ if (!ObjectUtils.isEmpty(o.getCompanyType())) {
|
|
|
List<String> split = Arrays.asList(o.getCompanyType().split(","));
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- for(String sp:split){
|
|
|
- String valueName = dictDataService.selectDictLabel(Constants.SYS_PROJECT_TYPE,sp);
|
|
|
+ for (String sp : split) {
|
|
|
+ String valueName = dictDataService.selectDictLabel(Constants.SYS_PROJECT_TYPE, sp);
|
|
|
sb.append(valueName).append(",");
|
|
|
}
|
|
|
- sb.deleteCharAt(sb.length()-1);
|
|
|
- o.setCompanyTypeName(sb.toString());
|
|
|
+ sb.deleteCharAt(sb.length() - 1);
|
|
|
+ o.setCompanyTypeName(sb.toString());
|
|
|
}
|
|
|
return o;
|
|
|
}).collect(Collectors.toList());
|