Commit bd8472ac authored by sam.x.wang's avatar sam.x.wang

log 和css 修改

parent 69de6bd6
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v47/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
This diff is collapsed.
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>didi2</title> <title>didi2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"> <link rel="stylesheet" href="font_roboto.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons"> <link rel="stylesheet" href="font_material.css">
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -14,6 +14,7 @@ import pwc.taxtech.atms.common.DDUserInfoRes; ...@@ -14,6 +14,7 @@ import pwc.taxtech.atms.common.DDUserInfoRes;
import pwc.taxtech.atms.common.HttpUtil; import pwc.taxtech.atms.common.HttpUtil;
import pwc.taxtech.atms.dto.AtmsTokenDto; import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.web.AtmsWebSettings; import pwc.taxtech.atms.web.AtmsWebSettings;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
...@@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Controller @Controller
...@@ -50,6 +52,8 @@ public class IndexController { ...@@ -50,6 +52,8 @@ public class IndexController {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Autowired
private OrangeHeapService orangeHeapService;
/** /**
* *
* @param atmsApiToken * @param atmsApiToken
...@@ -202,4 +206,17 @@ public class IndexController { ...@@ -202,4 +206,17 @@ public class IndexController {
return JSON.toJSONString(ddUserInfoRes); return JSON.toJSONString(ddUserInfoRes);
} }
@RequestMapping(value = {"/getCookie"}, method = RequestMethod.GET)
@ResponseBody
public String getCookie( HttpServletRequest request,
HttpServletResponse response) {
orangeHeapService.getDDTicketByCookie();
return null;
}
} }
...@@ -2,6 +2,8 @@ package pwc.taxtech.atms.web.controller; ...@@ -2,6 +2,8 @@ package pwc.taxtech.atms.web.controller;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -12,6 +14,7 @@ import pwc.taxtech.atms.dto.ApiResultDto; ...@@ -12,6 +14,7 @@ import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.web.service.OrangeHeapService; import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Optional;
@RestController @RestController
@RequestMapping("/OrangeHeap") @RequestMapping("/OrangeHeap")
...@@ -20,6 +23,7 @@ public class OrangeHeapController { ...@@ -20,6 +23,7 @@ public class OrangeHeapController {
@Resource @Resource
private OrangeHeapService tableauService; private OrangeHeapService tableauService;
private static Logger logger = LoggerFactory.getLogger(OrangeHeapController.class);
//以上是示范代码 //以上是示范代码
//TODO 加入其他图表 //TODO 加入其他图表
...@@ -33,12 +37,14 @@ public class OrangeHeapController { ...@@ -33,12 +37,14 @@ public class OrangeHeapController {
@ResponseBody @ResponseBody
@GetMapping("getTableauTaxCategoryUnreturnedTax") @GetMapping("getTableauTaxCategoryUnreturnedTax")
public ApiResultDto getTableauTaxCategoryUnreturnedTax() { public ApiResultDto getTableauTaxCategoryUnreturnedTax() {
logger.info("进入税种未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax().orElse(StringUtils.EMPTY)); return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax().orElse(StringUtils.EMPTY));
} }
@ResponseBody @ResponseBody
@GetMapping("getTableauDistrictUnreturnedTax") @GetMapping("getTableauDistrictUnreturnedTax")
public ApiResultDto getTableauDistrictUnreturnedTax() { public ApiResultDto getTableauDistrictUnreturnedTax() {
logger.info("地区未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax().orElse(StringUtils.EMPTY)); return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax().orElse(StringUtils.EMPTY));
} }
......
...@@ -34,10 +34,10 @@ public class OrangeHeapService { ...@@ -34,10 +34,10 @@ public class OrangeHeapService {
private static Logger logger = LoggerFactory.getLogger(OrangeHeapService.class); private static Logger logger = LoggerFactory.getLogger(OrangeHeapService.class);
@Autowired @Autowired
HttpServletRequest request; private HttpServletRequest request;
@Autowired @Autowired
HttpServletResponse response; private HttpServletResponse response;
@Value("${get_user_info_url}") @Value("${get_user_info_url}")
private String getUserInfoUrl; private String getUserInfoUrl;
...@@ -53,10 +53,12 @@ public class OrangeHeapService { ...@@ -53,10 +53,12 @@ public class OrangeHeapService {
CloseableHttpClient httpClient = null; CloseableHttpClient httpClient = null;
try { try {
String ticketUrl = String.format(systemConfig.getTableauGetTicket(), username); String ticketUrl = String.format(systemConfig.getTableauGetTicket(), username);
logger.info("进去获取tableau的url"+ticketUrl);
httpClient = HttpClients.createDefault(); httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(ticketUrl); HttpPost httpPost = new HttpPost(ticketUrl);
HttpResponse httpResponse = httpClient.execute(httpPost); HttpResponse httpResponse = httpClient.execute(httpPost);
String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
logger.info("获取tableau的结果"+response);
return StringUtils.equals(response, "-1") ? Optional.empty() : Optional.of(response); return StringUtils.equals(response, "-1") ? Optional.empty() : Optional.of(response);
} catch (Exception e) { } catch (Exception e) {
logger.error("getTicket error.", e); logger.error("getTicket error.", e);
...@@ -156,7 +158,7 @@ public class OrangeHeapService { ...@@ -156,7 +158,7 @@ public class OrangeHeapService {
return optional.map(s -> String.format(systemConfig.getTableauOtherTaxAnalysis(), getTicket(s).orElse(StringUtils.EMPTY))); return optional.map(s -> String.format(systemConfig.getTableauOtherTaxAnalysis(), getTicket(s).orElse(StringUtils.EMPTY)));
} }
//sso通过cookie获取登录的DD用户
public String getDDUserName() { public String getDDUserName() {
logger.info("进入 获取DD user的方法~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); logger.info("进入 获取DD user的方法~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
String ticket = getDDTicketByCookie(); String ticket = getDDTicketByCookie();
...@@ -166,16 +168,18 @@ public class OrangeHeapService { ...@@ -166,16 +168,18 @@ public class OrangeHeapService {
//通過cookie 取出ddTicket //通過cookie 取出ddTicket
public String getDDTicketByCookie() { public String getDDTicketByCookie() {
logger.info("进去获取cookie方法");
Map<String,Cookie> cookieMap = ReadCookieMap(); Map<String,Cookie> cookieMap = ReadCookieMap();
//TODO 修改token的名字到配置文件,判断ddTicket是否过期 //TODO 修改token的名字到配置文件,判断ddTicket是否过期
if(cookieMap.containsKey("ddTicket")){ if(cookieMap.containsKey("ddTicket")){
logger.info("ddTicket=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+Optional.ofNullable(cookieMap.get("ddTicket")).map(s->s.getValue()).orElse(""));
return Optional.ofNullable(cookieMap.get("ddTicket")).map(s->s.getValue()).orElse(""); return Optional.ofNullable(cookieMap.get("ddTicket")).map(s->s.getValue()).orElse("");
}else{ }else{
logger.info("code=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse("")); logger.info("code=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse(""));
return getDDTicket(Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse("")); return getDDTicket(Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse(""));
} }
} }
private String findUsernameByDDTicket(String ticket) { private String findUsernameByDDTicket(String ticket) {
Assert.hasText(ticket, "empty ticket"); Assert.hasText(ticket, "empty ticket");
......
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v47/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment