From 9124c19d1894d31408674434955963dbc7a93746 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Tue, 16 Aug 2022 17:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E6=97=A5=E5=BF=97=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcEnterpriseController.java | 15 ++++++++ .../epmet/service/IcEnterpriseService.java | 12 +++++++ .../IcEnterpriseChangeRecordServiceImpl.java | 2 ++ .../service/impl/IcEnterpriseServiceImpl.java | 34 +++++++++++++++++++ 4 files changed, 63 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java index 244711596d..ab2d7cdcb9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constants.ImportTaskConstants; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; @@ -100,6 +101,20 @@ public class IcEnterpriseController implements ResultDataResolver { return new Result>().ok(icEnterpriseService.list(formDTO)); } + /** + * 操作日志基础表 + * + * @param params + * @return com.epmet.commons.tools.utils.Result> + * @author zhy + * @date 2022/8/16 16:52 + */ + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icEnterpriseService.page(params); + return new Result>().ok(page); + } + /** * 企事业单位列表导出 * @param tokenDto diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java index 82057fb0cd..40cb66edfb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; import com.epmet.dto.form.EnterprisePatrolFormDTO; @@ -10,6 +11,7 @@ import com.epmet.dto.result.EnterprisePatrolResultDTO; import com.epmet.entity.IcEnterpriseEntity; import java.nio.file.Path; +import java.util.Map; /** * 企事业单位表 @@ -68,4 +70,14 @@ public interface IcEnterpriseService extends BaseService { PageData list(EnterprisePageFormDTO formDTO); void execAsyncExcelImport(Path fileSavePath, String taskId, String customerId, String userId); + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-08-16 + */ + PageData page(Map params); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java index dbbc97aa4f..593306e5d9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseChangeRecordServiceImpl.java @@ -50,9 +50,11 @@ public class IcEnterpriseChangeRecordServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String originId = (String)params.get("originId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(originId), "ORIGIN_ID", originId); return wrapper; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java index 576726412c..cb8774154d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java @@ -2,8 +2,11 @@ package com.epmet.service.impl; import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; @@ -23,6 +26,7 @@ import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; +import com.epmet.dto.IcEnterpriseChangeRecordDTO; import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.form.EnterpriseFormDTO; import com.epmet.dto.form.EnterprisePageFormDTO; @@ -413,6 +417,36 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EnterpriseDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String placeOrgName = (String)params.get("placeOrgName"); + String mobile = (String)params.get("mobile"); + String gridId = (String)params.get("gridId"); + String placeType = (String)params.get("placeType"); + String scale = (String)params.get("scale"); + String result = (String)params.get("result"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(placeOrgName), "PLACE_ORG_NAME", placeOrgName); + wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile); + wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(placeType), "PLACE_TYPE", placeType); + wrapper.eq(StringUtils.isNotBlank(scale), "SCALE", scale); + wrapper.eq(StringUtils.isNotBlank(result), "LATEST_RESULT", result); + + return wrapper; + } + private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); if (null == staffInfo) {