Bläddra i källkod

Merge remote-tracking branch 'origin/master'

buzhanyi 2 år sedan
förälder
incheckning
6a7c5ec559

+ 11 - 8
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -12,6 +12,7 @@ import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
+import com.ozs.common.utils.PageUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.bean.BeanUtils;
 import com.ozs.system.service.SysRegionService;
@@ -94,17 +95,19 @@ public class BaseExpertController extends BaseController {
         if (!ObjectUtils.isEmpty(baseExpertVo.getMajorGrade())) {
             lw.eq(BaseExpert::getMajorGrade, baseExpertVo.getMajorGrade());
         }
-        IPage<BaseExpert> page = baseExpertService.page(new Page<BaseExpert>(baseExpertVo.getPageNum(), baseExpertVo.getPageSize()), lw);
+        List<BaseExpert> list = baseExpertService.list(lw);
+        // IPage<BaseExpert> page = baseExpertService.page(new Page<BaseExpert>(baseExpertVo.getPageNum(), baseExpertVo.getPageSize()), lw);
+        // List<BaseExpert> records = page.getRecords();
         // todo 把 localArea 翻译为 省/市/县,存localAreaName中,(使用SysRegionService的getParentAdministrativeDivisionNames方法)
-        List<BaseExpert> records = page.getRecords();
-        for (BaseExpert baseExpert : records) {
-            if (StringUtils.isNotNull(baseExpert.getLocalArea())) {
-                String parentAdministrativeDivisionNames = sysRegionService.getParentAdministrativeDivisionNames(baseExpert.getLocalArea());
-                baseExpert.setLocalAreaName(parentAdministrativeDivisionNames);
+        List<BaseExpertVo> listVo = BeanUtils.entityListToVOList(list, BaseExpertVo.class);
+        for (BaseExpertVo vo : listVo) {
+            if (StringUtils.isNotNull(vo.getLocalArea())) {
+                String parentAdministrativeDivisionNames = sysRegionService.getParentAdministrativeDivisionNames(vo.getLocalArea());
+                vo.setLocalAreaName(parentAdministrativeDivisionNames);
             }
         }
-        page.setRecords(records);
-        return success(page);
+        Page pages = PageUtils.getPages(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue(), listVo);
+        return success(pages);
     }
 
     @ApiOperation(value = "黑白名单开关", notes = "必传id,status 其他字段不传; 黑名单传0,白名单传1")

+ 0 - 1
purchase-system/src/main/java/com/ozs/base/domain/BaseExpert.java

@@ -106,7 +106,6 @@ public class BaseExpert extends BaseDto {
     @ApiModelProperty(value = "所在区域(行政区域表的code)")
     @TableField("local_area")
     private String localArea;
-    private String localAreaName;
 
     /**
      * 身份证号