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 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>didi2</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons">
<link rel="stylesheet" href="font_roboto.css">
<link rel="stylesheet" href="font_material.css">
</head>
<body>
<noscript>
......
......@@ -14,6 +14,7 @@ import pwc.taxtech.atms.common.DDUserInfoRes;
import pwc.taxtech.atms.common.HttpUtil;
import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.web.AtmsWebSettings;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
......@@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@Controller
......@@ -50,6 +52,8 @@ public class IndexController {
@Autowired
private RestTemplate restTemplate;
@Autowired
private OrangeHeapService orangeHeapService;
/**
*
* @param atmsApiToken
......@@ -202,4 +206,17 @@ public class IndexController {
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;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -12,6 +14,7 @@ import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.annotation.Resource;
import java.util.Optional;
@RestController
@RequestMapping("/OrangeHeap")
......@@ -20,6 +23,7 @@ public class OrangeHeapController {
@Resource
private OrangeHeapService tableauService;
private static Logger logger = LoggerFactory.getLogger(OrangeHeapController.class);
//以上是示范代码
//TODO 加入其他图表
......@@ -33,12 +37,14 @@ public class OrangeHeapController {
@ResponseBody
@GetMapping("getTableauTaxCategoryUnreturnedTax")
public ApiResultDto getTableauTaxCategoryUnreturnedTax() {
logger.info("进入税种未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauDistrictUnreturnedTax")
public ApiResultDto getTableauDistrictUnreturnedTax() {
logger.info("地区未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax().orElse(StringUtils.EMPTY));
}
......
......@@ -34,10 +34,10 @@ public class OrangeHeapService {
private static Logger logger = LoggerFactory.getLogger(OrangeHeapService.class);
@Autowired
HttpServletRequest request;
private HttpServletRequest request;
@Autowired
HttpServletResponse response;
private HttpServletResponse response;
@Value("${get_user_info_url}")
private String getUserInfoUrl;
......@@ -53,10 +53,12 @@ public class OrangeHeapService {
CloseableHttpClient httpClient = null;
try {
String ticketUrl = String.format(systemConfig.getTableauGetTicket(), username);
logger.info("进去获取tableau的url"+ticketUrl);
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(ticketUrl);
HttpResponse httpResponse = httpClient.execute(httpPost);
String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
logger.info("获取tableau的结果"+response);
return StringUtils.equals(response, "-1") ? Optional.empty() : Optional.of(response);
} catch (Exception e) {
logger.error("getTicket error.", e);
......@@ -156,7 +158,7 @@ public class OrangeHeapService {
return optional.map(s -> String.format(systemConfig.getTableauOtherTaxAnalysis(), getTicket(s).orElse(StringUtils.EMPTY)));
}
//sso通过cookie获取登录的DD用户
public String getDDUserName() {
logger.info("进入 获取DD user的方法~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
String ticket = getDDTicketByCookie();
......@@ -166,16 +168,18 @@ public class OrangeHeapService {
//通過cookie 取出ddTicket
public String getDDTicketByCookie() {
logger.info("进去获取cookie方法");
Map<String,Cookie> cookieMap = ReadCookieMap();
//TODO 修改token的名字到配置文件,判断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("");
}else{
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(""));
}
}
}
private String findUsernameByDDTicket(String 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