From efbe5ef9d6a4ec76dc46427ad24a6a5eead3d2c9 Mon Sep 17 00:00:00 2001 From: syc Date: Mon, 8 Aug 2022 10:31:33 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E5=B1=95=E5=A2=9E=E5=8A=A0=E5=86=85=E9=83=A8=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E3=80=81=E5=A4=84=E7=90=86=E4=B8=AD=E7=9A=84=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E7=AD=89=E4=BF=A1=E6=81=AF=E7=9A=84=E8=BF=94=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/IcEventProcessListResultDTO.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java index 65d28e6501..5afe520905 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java @@ -16,6 +16,10 @@ public class IcEventProcessListResultDTO implements Serializable { private static final long serialVersionUID = 5762152044573235897L; + /** + * 项目ID + */ + private String projectId; /** * 进展Id */ @@ -39,6 +43,26 @@ public class IcEventProcessListResultDTO implements Serializable { * 公开答复 */ private String publicReply; + /** + * 是否发送到外部系统 0否 1是 + */ + private Integer isSend; + /** + * 内部备注 + */ + private String internalRemark; + /** + * 子节点 + */ + private List subProcess; + /** + * 公开答复附件 + */ + private List publicFile; + /** + * 内部备注附件 + */ + private List internalFile; /** * 协办单位类型,1社区自组织,2联建单位 */ @@ -69,4 +93,5 @@ public class IcEventProcessListResultDTO implements Serializable { */ private String actualServiceTime; + } From 46b0781fdeb2ad8c9220c36dfb8c5c32fa2bd228 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 8 Aug 2022 14:41:26 +0800 Subject: [PATCH 02/14] fanhui key --- .../java/com/epmet/service/impl/IcCustomerReportServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index 125b42a422..dea2c795bc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -109,6 +109,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl Date: Mon, 8 Aug 2022 14:44:45 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E5=90=88=E4=B8=A2=E4=BA=86=E5=90=97?= =?UTF-8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcCustomerReportServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index fad0275192..33cd63ca07 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -15,9 +15,8 @@ import com.epmet.constant.CustomerFunctionConstant; import com.epmet.dao.IcCustomerReportDao; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.PreviewReportFormDTO; -import com.epmet.dto.result.PreviewReportResDTO; -import com.epmet.dto.IcCustomerReportDTO; import com.epmet.dto.form.ReportEditFormDTO; +import com.epmet.dto.result.PreviewReportResDTO; import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -27,6 +26,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; From ccd9c8c5d36d649c144a251b70412ee799791ef5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 8 Aug 2022 14:56:32 +0800 Subject: [PATCH 04/14] =?UTF-8?q?orgProjectDetailList=E8=AF=95=E4=B8=8B?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dataaggre/controller/GovOrgController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index bbf8011130..073a181d18 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; @@ -455,6 +456,7 @@ public class GovOrgController { * @Author zhaoqifeng * @Date 2022/7/28 10:34 */ + @ReportRequest @PostMapping("orgProjectDetailList") public Result> orgProjectDetailList(@LoginUser TokenDto tokenDto, @RequestBody OrgStatisticsFormDTO formDTO) { return new Result>().ok(govOrgService.orgProjectDetailList(tokenDto, formDTO)); From 5b3dde38edbf62acde8796ff4ed4300001743140 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 8 Aug 2022 15:05:38 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/ReportEditFormDTO.java | 16 +++++++- .../constant/CustomerFunctionConstant.java | 3 ++ .../com/epmet/dao/IcCustomerReportDao.java | 5 +++ .../impl/IcCustomerReportServiceImpl.java | 40 +++++++++++++++++++ .../resources/mapper/IcCustomerReportDao.xml | 21 ++++++++++ 5 files changed, 83 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java index d1e72f7d15..3bb7871caa 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportEditFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.List; @@ -27,7 +28,18 @@ public class ReportEditFormDTO implements Serializable { @NotBlank(message = "reportId不能为空", groups = ReportEditForm.class) private String reportId; - private List customerIds; + @Valid + private List customerList; - private List categoryKeys; + + @Data + public static class CustomerReportEditForm implements Serializable{ + + private static final long serialVersionUID = 8154093835160706134L; + + private List categoryKeys; + + @NotBlank(message = "customerId不能为空", groups = ReportEditForm.class) + private String customerId; + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java index 5d41b4453c..b5cbc36f11 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/CustomerFunctionConstant.java @@ -25,5 +25,8 @@ public interface CustomerFunctionConstant { String REPORT_CATEGORY = "jmreport_category"; + String REPORT_EDIT = "edit"; + String REPORT_ADD = "add"; + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java index 52513402d2..89b4578045 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -24,4 +25,8 @@ public interface IcCustomerReportDao extends BaseDao { */ List reportList(); + void delCustomerReport(@Param("customerIds") List customerIds); + + void delCustomerReportFun(@Param("reportIds") List reportIds); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index 33cd63ca07..07875f7537 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -19,9 +19,11 @@ import com.epmet.dto.form.ReportEditFormDTO; import com.epmet.dto.result.PreviewReportResDTO; import com.epmet.dto.result.ReportResultDTO; import com.epmet.entity.IcCustomerReportEntity; +import com.epmet.entity.IcReportFunEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.IcCustomerReportService; +import com.epmet.service.IcReportFunService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +31,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -48,6 +51,8 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl getWrapper(Map params){ @@ -124,7 +129,42 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl entities = new ArrayList<>(); + List funEntities = new ArrayList<>(); + formDTO.getCustomerList().forEach(c -> { + IcCustomerReportEntity reportEntity = new IcCustomerReportEntity(); + reportEntity.setReportId(formDTO.getReportId()); + reportEntity.setCustomerId(c.getCustomerId()); + if (CollectionUtils.isNotEmpty(c.getCategoryKeys())){ + c.getCategoryKeys().forEach(key -> { + IcReportFunEntity funEntity = new IcReportFunEntity(); + funEntity.setCustomerReportId(formDTO.getReportId()); + funEntity.setFunCategoryKey(key); + funEntities.add(funEntity); + }); + } + entities.add(reportEntity); + }); + insetCustomerReportAndFun(entities,funEntities); + } + } + @Transactional(rollbackFor = Exception.class) + public void insetCustomerReportAndFun(List reportEntities,List funEntities){ + if (CollectionUtils.isNotEmpty(reportEntities)){ + insertBatch(reportEntities); + } + if (CollectionUtils.isNotEmpty(funEntities)){ + reportFunService.insertBatch(funEntities); + } } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml index 2336b1dc3d..073fcbaa89 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml @@ -3,6 +3,27 @@ + + DELETE FROM ic_customer_report + + WHERE CUSTOMER_ID IN ( + + #{c} + + ) + + + + DELETE FROM ic_report_fun + + WHERE CUSTOMER_REPORT_ID IN ( + + #{r} + + ) + + + + + + \ No newline at end of file From caa74b8edeef21fec37c7bbd4bfe5a28faf24902 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 8 Aug 2022 15:50:04 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dataaggre/controller/GovOrgController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 073a181d18..bbf8011130 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -5,7 +5,6 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; @@ -456,7 +455,6 @@ public class GovOrgController { * @Author zhaoqifeng * @Date 2022/7/28 10:34 */ - @ReportRequest @PostMapping("orgProjectDetailList") public Result> orgProjectDetailList(@LoginUser TokenDto tokenDto, @RequestBody OrgStatisticsFormDTO formDTO) { return new Result>().ok(govOrgService.orgProjectDetailList(tokenDto, formDTO)); From 9246e6df131e0e59a9e5ba2c401c35176d590543 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 9 Aug 2022 10:17:11 +0800 Subject: [PATCH 09/14] =?UTF-8?q?listresi=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcResiUserController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index f958d975d3..778740a9a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; @@ -368,6 +369,7 @@ public class IcResiUserController implements ResultDataResolver { return new Result<>(); } + @ReportRequest @PostMapping("listresi") @MaskResponse(fieldNames = {"MOBILE", "ID_CARD"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) public Result>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO) { From 97ae52f67a0e49655fab2b8d43f2f6ce7cb57014 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 9 Aug 2022 10:22:17 +0800 Subject: [PATCH 10/14] huifu --- .../java/com/epmet/controller/IssueManageController.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java index e5013de9f1..a77e531b26 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java @@ -1,7 +1,6 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.enums.RequirePermissionEnum; @@ -134,10 +133,8 @@ public class IssueManageController { * @author wangc * @date 2020.05.14 13:58 **/ - //先注释掉权限注解 - @ReportRequest @PostMapping(value = "closedlist") - // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSED_LIST) + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSED_LIST) public Result> closedList( @RequestBody CommonIssueListFormDTO issueListFormDTO){ ValidatorUtils.validateEntity(issueListFormDTO); return new Result>().ok(issueService.closedListGov(issueListFormDTO)); From 24435dbb753760c229a5ff4631c6fead023241d1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 9 Aug 2022 10:45:04 +0800 Subject: [PATCH 11/14] =?UTF-8?q?house/houselist=E6=94=BE=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/HouseController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 62dfafccdf..f3eea5b2db 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -27,6 +27,7 @@ import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; @@ -105,6 +106,7 @@ public class HouseController implements ResultDataResolver { @Autowired private IcHouseDao icHouseDao; + @ReportRequest @PostMapping("houselist") @MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE}) From a36655d7bcf73cb54671f72cc72e60458e221e8a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Aug 2022 14:07:43 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dtos/form/JiMuReportFormDTO.java | 2 + .../dtos/result/JiMuReportResultDTO.java | 2 + .../feigns/JiMuReportOpenFeignClient.java | 20 +++- .../JiMuReportOpenFeignClientFallback.java | 15 +++ ...uReportOpenFeignClientFallbackFactory.java | 24 ++++ .../tools/utils/HttpClientManager.java | 28 +++++ .../com/epmet/dto/result/ReportResultDTO.java | 7 ++ .../com/epmet/dao/IcCustomerReportDao.java | 2 +- .../impl/IcCustomerReportServiceImpl.java | 113 +++++++++++++++--- .../resources/mapper/IcCustomerReportDao.xml | 13 +- 10 files changed, 203 insertions(+), 23 deletions(-) create mode 100644 epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java index 03a5e5aa24..caf58ec9a9 100644 --- a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java @@ -28,4 +28,6 @@ public class JiMuReportFormDTO implements Serializable { * 类别 */ private List categoryKeys; + + private String id; } diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java index a7e7291791..9f48ab6bba 100644 --- a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java @@ -19,4 +19,6 @@ public class JiMuReportResultDTO implements Serializable { private String name; private String id; + private String reportId; + private String reportName; } diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java index 0c5dfb97ef..f6afa4d9a4 100644 --- a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java @@ -1,14 +1,30 @@ package com.epmet.commons.feignclient.feigns; -import com.epmet.commons.feignclient.feigns.fallback.JiMuReportOpenFeignClientFallback; +import com.epmet.commons.feignclient.dtos.form.JiMuReportFormDTO; +import com.epmet.commons.feignclient.dtos.result.JiMuReportResultDTO; +import com.epmet.commons.feignclient.feigns.fallback.JiMuReportOpenFeignClientFallbackFactory; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; /** * @Author zxc * @DateTime 2022/8/8 13:52 * @DESC */ -@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class) +@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class, url = "localhost:8118") public interface JiMuReportOpenFeignClient { + + @GetMapping("jmreport/excelQuery") + Result getList(@RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize, + @RequestParam("reportType") String reportType, + @RequestParam("token") String token); + + @GetMapping("jmreport/show") + Result getReport(@RequestBody JiMuReportFormDTO formDTO); + } diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java index f1ca95d23d..24b5580256 100644 --- a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java @@ -1,6 +1,11 @@ package com.epmet.commons.feignclient.feigns.fallback; +import com.epmet.commons.feignclient.dtos.form.JiMuReportFormDTO; +import com.epmet.commons.feignclient.dtos.result.JiMuReportResultDTO; import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; /** * @Author zxc @@ -8,4 +13,14 @@ import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; * @DESC */ public class JiMuReportOpenFeignClientFallback implements JiMuReportOpenFeignClient { + + @Override + public Result getList(Integer pageNo, Integer pageSize, String reportType, String token) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_JM_REPORT, "getList",pageNo,pageSize,reportType, token); + } + + @Override + public Result getReport(JiMuReportFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_JM_REPORT, "getReport",formDTO); + } } diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java new file mode 100644 index 0000000000..e0274436c2 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java @@ -0,0 +1,24 @@ +package com.epmet.commons.feignclient.feigns.fallback; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2022/8/9 13:27 + * @DESC + */ +@Slf4j +@Component +public class JiMuReportOpenFeignClientFallbackFactory implements FallbackFactory { + + private JiMuReportOpenFeignClientFallback fallback = new JiMuReportOpenFeignClientFallback(); + + @Override + public JiMuReportOpenFeignClientFallback create(Throwable cause) { + log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); + return fallback; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 4fe6be37da..69b9d87b97 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -443,6 +443,34 @@ public class HttpClientManager { } } + public Result sendGet(String url, Map params, Map headerMap) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + + System.out.println(builder.getPath()); + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + if (StringUtils.isNotBlank(k)) { + httpGet.addHeader(k, v == null ? null : v.toString()); + } + }); + } + return execute(httpGet,false); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + private Result execute(HttpRequestBase httpMethod, boolean isHttps) { CloseableHttpResponse response = null; try { diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java index 0667a0c226..b8638c3b5c 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ReportResultDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -81,4 +82,10 @@ public class ReportResultDTO implements Serializable { */ private String categoryKey; } + + public ReportResultDTO() { + this.reportName = ""; + this.reportId = ""; + this.customerList = new ArrayList<>(); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java index b7a7e93a01..0e467ca8dc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java @@ -23,7 +23,7 @@ public interface IcCustomerReportDao extends BaseDao { * @author zxc * @date 2022/8/8 10:38 */ - List reportList(); + List reportList(@Param("categoryKeys")List categoryKeys); /** * Desc: 根据客户IDs获取ids diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index d939a18a79..248beb49ff 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -1,8 +1,11 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.feignclient.dtos.form.JiMuReportFormDTO; import com.epmet.commons.feignclient.dtos.result.JiMuReportResultDTO; +import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -12,6 +15,8 @@ import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerFunctionConstant; import com.epmet.dao.IcCustomerReportDao; @@ -27,16 +32,15 @@ import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.IcCustomerReportService; import com.epmet.service.IcReportFunService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.net.InetAddress; +import java.util.*; import java.util.stream.Collectors; /** @@ -46,6 +50,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2022-08-08 */ @Service +@Slf4j public class IcCustomerReportServiceImpl extends BaseServiceImpl implements IcCustomerReportService { @Autowired private RedisUtils redisUtils; @@ -56,6 +61,8 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl getWrapper(Map params){ @@ -75,10 +82,30 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportList() { - List reportList = baseDao.reportList(); - if (CollectionUtils.isEmpty(reportList)){ + Result list = jiMuReportOpenFeignClient.getList(1,10000,"datainfo", EpmetRequestHolder.getHeader("Authorization")); + Result url = getUrl(2, null); + log.info(url.toString()); + Map map = JSON.parseObject(url.getData(), Map.class); + Map map2 = (Map)map.get("result"); + List> map3 = (List>) map2.get("records"); + List allReports = new ArrayList<>(); + map3.forEach(m -> { + allReports.add(ConvertUtils.mapToEntity(m,JiMuReportResultDTO.class)); + }); + if (CollectionUtils.isEmpty(allReports)){ return new ArrayList<>(); } + List allReportList = new ArrayList<>(); + allReports.forEach(r -> { + ReportResultDTO dto = new ReportResultDTO(); + dto.setReportId(r.getId()); + dto.setReportName(r.getName()); + allReportList.add(dto); + }); + List reportList = baseDao.reportList(null); + if (CollectionUtils.isEmpty(reportList)){ + return allReportList; + } Result> dictList = adminOpenFeignClient.dictList(new DictListFormDTO(CustomerFunctionConstant.REPORT_CATEGORY)); if (!dictList.success()){ throw new EpmetException("查询字典信息失败:" + CustomerFunctionConstant.REPORT_CATEGORY); @@ -93,17 +120,9 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportList.stream().filter(r -> c.getId().equals(r.getCustomerId())).forEach(r -> r.setCustomerName(c.getCustomerName()))); } - // todo 报表 - List result = new ArrayList<>(); Map> groupByReport = reportList.stream().collect(Collectors.groupingBy(ReportResultDTO::getReportId)); - groupByReport.forEach((reportId,l) -> { - ReportResultDTO dto = new ReportResultDTO(); - dto.setReportId(reportId); - dto.setReportName(l.get(NumConstant.ZERO).getReportName()); - dto.setCustomerList(ConvertUtils.sourceToTarget(l, ReportResultDTO.CustomerList.class)); - result.add(dto); - }); - return result; + groupByReport.forEach((reportId,l) -> allReportList.stream().filter(a -> a.getReportId().equals(reportId)).forEach(a -> a.setCustomerList(ConvertUtils.sourceToTarget(l, ReportResultDTO.CustomerList.class)))); + return allReportList; } /** @@ -173,7 +192,25 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportIdAndName(ReportListFormDTO formDTO) { - return null; + List reportList = baseDao.reportList(formDTO.getCategoryKeys()); + if (CollectionUtils.isEmpty(reportList)){ + return new ArrayList<>(); + } + List recordIds = reportList.stream().map(m -> m.getReportId()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + List result = new ArrayList<>(); + recordIds.forEach(r -> { + JiMuReportFormDTO form = new JiMuReportFormDTO(); + form.setId(r); +// Result url = getUrl(NumConstant.ONE, r); +// if (!report.success()){ +// throw new EpmetException("查询报表失败:"+r); +// } +// JiMuReportResultDTO data = report.getData(); +// data.setReportId(data.getId()); +// data.setReportName(data.getReportName()); +// result.add(data); + }); + return result; } @Transactional(rollbackFor = Exception.class) @@ -186,4 +223,46 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl getUrl(Integer type,String id) { + String add = ""; + Result result; + try { + InetAddress localHost = InetAddress.getLocalHost(); +// add = localHost.getHostAddress(); + add = "http://192.168.1.141:8118"; + System.out.println(add); + }catch (Exception e){ + log.warn("获取url失败"); + } + if (type.compareTo(NumConstant.TWO) == NumConstant.ZERO){ + add = add.concat("/jmreport/excelQuery"); + Map params = new HashMap<>(16); + params.put("pageNo",1); + params.put("pageSize",10000); + params.put("reportType","datainfo"); + params.put("name",""); + params.put("token", EpmetRequestHolder.getHeader("Authorization")); + Map headers = new HashMap<>(16); + headers.put("token", EpmetRequestHolder.getHeader("Authorization")); + headers.put("X-Access-Token", EpmetRequestHolder.getHeader("Authorization")); + headers.put("Accept", "application/json, text/plain, */*"); + headers.put("Content-Type", "application/json;charset=utf-8"); + result = HttpClientManager.getInstance().sendGet(add, params, headers); + }else { + add.concat("/jmreport/show"); + Map params = new HashMap<>(16); + params.put("id",id); + Map headers = new HashMap<>(16); + headers.put("token", EpmetRequestHolder.getHeader("Authorization")); + result = HttpClientManager.getInstance().sendPostAndHeader(add, params, headers); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml index a30bcdca75..6dcce49e7c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml @@ -5,7 +5,7 @@ DELETE FROM ic_customer_report - + WHERE CUSTOMER_ID IN ( #{c} @@ -15,7 +15,7 @@ DELETE FROM ic_report_fun - + WHERE CUSTOMER_REPORT_ID IN ( #{r} @@ -31,8 +31,15 @@ cr.CUSTOMER_ID, rf.FUN_CATEGORY_KEY AS categoryKey FROM ic_customer_report cr - INNER JOIN ic_report_fun rf ON rf.CUSTOMER_REPORT_ID = cr.REPORT_ID AND rf.DEL_FLAG = 0 + INNER JOIN ic_report_fun rf ON rf.CUSTOMER_REPORT_ID = cr.ID AND rf.DEL_FLAG = 0 WHERE cr.DEL_FLAG = 0 + + AND rf.FUN_CATEGORY_KEY in ( + + #{r} + + ) + ORDER BY cr.CREATED_TIME DESC From c0399d21c028d2b9a8df27a7832c58d8377d3763 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Aug 2022 14:57:37 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF/?= =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF-=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/ReportListFormDTO.java | 2 + .../IcCustomerReportController.java | 3 +- .../com/epmet/dao/IcCustomerReportDao.java | 2 +- .../impl/IcCustomerReportServiceImpl.java | 40 ++++++++++++------- .../resources/mapper/IcCustomerReportDao.xml | 3 ++ 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportListFormDTO.java index 5e70557c95..4d67790aed 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportListFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/ReportListFormDTO.java @@ -16,4 +16,6 @@ public class ReportListFormDTO implements Serializable { private static final long serialVersionUID = -4459838228433571457L; private List categoryKeys; + + private String customerId; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java index f8b1ab415b..0c4cdcc0fa 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcCustomerReportController.java @@ -79,7 +79,8 @@ public class IcCustomerReportController { * @date 2022/8/8 15:20 */ @PostMapping("report-list") - public Result> reportIdAndName(@RequestBody ReportListFormDTO formDTO){ + public Result> reportIdAndName(@RequestBody ReportListFormDTO formDTO,@LoginUser TokenDto tokenDto){ + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result>().ok(icCustomerReportService.reportIdAndName(formDTO)); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java index 0e467ca8dc..ce9fc0334e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcCustomerReportDao.java @@ -23,7 +23,7 @@ public interface IcCustomerReportDao extends BaseDao { * @author zxc * @date 2022/8/8 10:38 */ - List reportList(@Param("categoryKeys")List categoryKeys); + List reportList(@Param("categoryKeys")List categoryKeys,@Param("customerId")String customerId); /** * Desc: 根据客户IDs获取ids diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java index 248beb49ff..fd1b1a2d8c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java @@ -84,8 +84,11 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportList() { Result list = jiMuReportOpenFeignClient.getList(1,10000,"datainfo", EpmetRequestHolder.getHeader("Authorization")); Result url = getUrl(2, null); - log.info(url.toString()); + log.info("所有jm报表"+url); Map map = JSON.parseObject(url.getData(), Map.class); + if (!map.containsValue(true)){ + throw new EpmetException("获取所有jm报表失败"); + } Map map2 = (Map)map.get("result"); List> map3 = (List>) map2.get("records"); List allReports = new ArrayList<>(); @@ -102,7 +105,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportList = baseDao.reportList(null); + List reportList = baseDao.reportList(null,null); if (CollectionUtils.isEmpty(reportList)){ return allReportList; } @@ -192,7 +195,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl reportIdAndName(ReportListFormDTO formDTO) { - List reportList = baseDao.reportList(formDTO.getCategoryKeys()); + List reportList = baseDao.reportList(formDTO.getCategoryKeys(), formDTO.getCustomerId()); if (CollectionUtils.isEmpty(reportList)){ return new ArrayList<>(); } @@ -201,14 +204,17 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl { JiMuReportFormDTO form = new JiMuReportFormDTO(); form.setId(r); -// Result url = getUrl(NumConstant.ONE, r); -// if (!report.success()){ -// throw new EpmetException("查询报表失败:"+r); -// } -// JiMuReportResultDTO data = report.getData(); -// data.setReportId(data.getId()); -// data.setReportName(data.getReportName()); -// result.add(data); + Result url = getUrl(NumConstant.ONE, r); + log.info("模板详情"+url); + Map map = JSON.parseObject(url.getData(), Map.class); + if (!map.containsValue(true)){ + throw new EpmetException("获取jm报表详情失败:"+r); + } + Map map2 = (Map)map.get("result"); + JiMuReportResultDTO data = ConvertUtils.mapToEntity(map2, JiMuReportResultDTO.class); + data.setReportId(data.getId()); + data.setReportName(data.getName()); + result.add(data); }); return result; } @@ -234,8 +240,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl result; try { InetAddress localHost = InetAddress.getLocalHost(); -// add = localHost.getHostAddress(); - add = "http://192.168.1.141:8118"; + add = "http://"+localHost.getHostAddress()+":8118"; System.out.println(add); }catch (Exception e){ log.warn("获取url失败"); @@ -255,12 +260,17 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl params = new HashMap<>(16); params.put("id",id); + params.put("apiUrl",""); + params.put("params",""); Map headers = new HashMap<>(16); headers.put("token", EpmetRequestHolder.getHeader("Authorization")); - result = HttpClientManager.getInstance().sendPostAndHeader(add, params, headers); + headers.put("X-Access-Token", EpmetRequestHolder.getHeader("Authorization")); + headers.put("Accept", "application/json, text/plain, */*"); + headers.put("Content-Type", "application/json;charset=utf-8"); + result = HttpClientManager.getInstance().sendPostByJSONAndHeader(add, JSON.toJSONString(params), headers); } return result; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml index 6dcce49e7c..689f448228 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcCustomerReportDao.xml @@ -40,6 +40,9 @@ ) + + AND cr.CUSTOMER_ID = #{customerId} + ORDER BY cr.CREATED_TIME DESC From 2e865428a2c2df9478a954749a6f2e2fb0aafc03 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Aug 2022 15:20:00 +0800 Subject: [PATCH 14/14] =?UTF-8?q?url=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/feignclient/feigns/JiMuReportOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java index f6afa4d9a4..5317a63ca5 100644 --- a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java @@ -15,8 +15,8 @@ import org.springframework.web.bind.annotation.RequestParam; * @DateTime 2022/8/8 13:52 * @DESC */ -//@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class) -@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class, url = "localhost:8118") +@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class) +//@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class, url = "localhost:8118") public interface JiMuReportOpenFeignClient { @GetMapping("jmreport/excelQuery")