Преглед на файлове

Merge branch 'master' into prod

buzhanyi преди 6 месеца
родител
ревизия
19022d56d5

+ 19 - 8
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseAgencyController.java

@@ -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());

+ 22 - 5
purchase-system/src/main/java/com/ozs/base/vo/BaseAgentPageReqVo.java

@@ -8,6 +8,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.validation.constraints.NotEmpty;
+import java.util.List;
 
 
 @ApiModel(value = "BaseAgentPageReqVo", description = "代理机构分页查询实体")
@@ -19,14 +20,30 @@ public class BaseAgentPageReqVo extends PageVo {
 
     @ApiModelProperty("代理机构名称")
     private String companyName;
-    // 公司性质
+    /**
+     * 公司性质
+     */
     @ApiModelProperty("公司性质")
     private String companyNature;
-    // 状态0白,1黑
+    /**
+     * 状态 0白,1黑
+     */
     @ApiModelProperty("状态0白,1黑")
     private Integer status;
 
-    // 类型
-    @ApiModelProperty("类型")
-    private Integer companyType;
+    /**
+     * 采购类型
+     */
+    @ApiModelProperty("采购类型")
+    private List<Integer> companyTypes;
+
+    @Override
+    public String toString() {
+        return "BaseAgentPageReqVo{" +
+                "companyName='" + companyName + '\'' +
+                ", companyNature='" + companyNature + '\'' +
+                ", status=" + status +
+                ", companyTypes=" + companyTypes +
+                '}';
+    }
 }