Browse Source

大屏接口,查询机关结构从请求头中获取客户Id,如果为空则默认为市北大屏的数据。

dev_shibei_match
wangchao 5 years ago
parent
commit
cbcc5d809d
  1. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  2. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

9
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<TreeResultDTO> tree(ExternalAppRequestParam externalAppRequestParam){
public Result<TreeResultDTO> tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){
String customerId = request.getHeader("CustomerId");
if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){
externalAppRequestParam.setCustomerId(customerId);
}
return new Result<TreeResultDTO>().ok(agencyService.tree(externalAppRequestParam));
}

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

Loading…
Cancel
Save