From cbcc5d809d1d93bd1e2bda66ff70a3d3ed1ae853 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 8 Sep 2020 12:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=BA=E5=85=B3=E7=BB=93=E6=9E=84=E4=BB=8E?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=A4=B4=E4=B8=AD=E8=8E=B7=E5=8F=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7Id=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E5=88=99=E9=BB=98=E8=AE=A4=E4=B8=BA=E5=B8=82=E5=8C=97=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E7=9A=84=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/AgencyController.java | 9 ++++++++- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 1b063dd470..c6d6de4ce3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -7,12 +7,15 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; + /** * 组织相关api * @@ -34,7 +37,11 @@ public class AgencyController { */ //@ExternalAppRequestAuth @PostMapping("tree") - public Result tree(ExternalAppRequestParam externalAppRequestParam){ + public Result tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){ + String customerId = request.getHeader("CustomerId"); + if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){ + externalAppRequestParam.setCustomerId(customerId); + } return new Result().ok(agencyService.tree(externalAppRequestParam)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 6eef8b2387..6d6632dbdf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,13 +44,13 @@ public class AgencyServiceImpl implements AgencyService { @Override public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { // 1. 查询客户根组织ID -// String customerId = externalAppRequestParam.getCustomerId(); + String customerId = externalAppRequestParam.getCustomerId(); // 验签关闭,customerId无法获取,暂时写死 - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - - + if(StringUtils.isBlank(customerId)){ + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + } TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); if (null == rootAgency){ return new TreeResultDTO();