Commit 7728ae5a by ddx

增加token管理页面

parent 9a6560be
......@@ -104,6 +104,12 @@ public class JxSampleController {
private String incomeSmsSendRequestQueryListUrl;
@NacosValue(value = "${income.upassword}", autoRefreshed = true)
private String incomeUpassword;
@NacosValue(value = "${income.request.query.token.list.url}", autoRefreshed = true)
private String incomeRequestQueryTokenListUrl;
@NacosValue(value = "${income.request.update.token.list.url}", autoRefreshed = true)
private String incomeRequestUpdateTokenListUrl;
@NacosValue(value = "${income.request.clean.token.list.url}", autoRefreshed = true)
private String incomeRequestCleanTokenListUrl;
@GetMapping("/jx-analysis-hourly")
public String jxAnalysisHourly(String username, String startDate, String endDate) {
......@@ -792,6 +798,54 @@ public class JxSampleController {
}
}
@PostMapping("/management/query/token/page")
public String queryTokenPage(@RequestBody ManagementQueryToken managementQueryToken) {
try {
if (managementQueryToken.getPageSize() > 100) {
managementQueryToken.setPageSize(100);
}
String reqUrl = incomeRequestQueryTokenListUrl;
log.info("query token request url {} page param:{}", reqUrl, JSONUtil.toString(managementQueryToken));
String response = HttpUtil.createPost(reqUrl).contentType("application/json")
.body(JSON.toJSONString(managementQueryToken)).execute().body();
log.info("query token request page response:{}", response);
return this.handlePageResult(response);
} catch (Exception e) {
log.error("query token request page error:", e);
return "{}";
}
}
@PostMapping("/management/start/income/token/token-ids")
public String startIncomeTokenByIds(ManagementUpdateToken managementUpdateToken) {
try {
String response = HttpUtil.post(incomeRequestUpdateTokenListUrl, JSONUtil.toString(managementUpdateToken));
log.info("get income start token with ids response:{}", response);
return "{}";
} catch (Exception e) {
log.error("get income start token with ids error:", e);
return "{}";
}
}
@GetMapping("/management/start/income/token/token-id")
public String startIncomeTokenById(String applyId) {
RequestConfig requestConfig = RequestConfig.builder()
.contentType("form")
.method("GET")
.charset(StandardCharsets.UTF_8.toString())
.retryTimes(1)
.build();
try {
String response = ETaxPureNetUtil.postResponseString(incomeRequestCleanTokenListUrl + this.appendParamTokenId(applyId), null, null, requestConfig, new ResponseCarrier());
log.info("get income start token with ids response:{}", response);
return response;
} catch (Exception e) {
log.error("get income start token with ids error:", e);
return "{}";
}
}
@GetMapping("/get-dqdm")
public String getDqdm(String taxno) {
return etaxConfigService.getArea(taxno);
......@@ -801,6 +855,10 @@ public class JxSampleController {
return String.format("?taxnoIds=%s&userCode=%s", taxnoIds, userCode);
}
private String appendParamTokenId(String applyId) {
return String.format("?applyId=%s", applyId);
}
private String appendParamInvoiceIds(String invoiceIds, String userCode, String taxno) {
return String.format("?invoiceIds=%s&userCode=%s&taxno=%s", invoiceIds, userCode, taxno);
}
......
package com.sxc.etaxincome.domain.model.report;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
public class ManagementQueryToken {
private Integer pageSize;
private Integer pageNumber;
private String userCode;
private String errorCode;
private String zoneCode;
private String loginType;
private String taxLoginName;
private String errorMessage;
private String userType;
private String serverNo;
private String taxno;
}
package com.sxc.etaxincome.domain.model.report;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
public class ManagementUpdateToken {
private String tokenIds;
private String userCode;
private String serverNo;
private String userType;
}
......@@ -30,4 +30,8 @@
"index": 8,
"api": "登录短信列表",
"url": "management-query-smsSend-page.html"
},{
"index": 9,
"api": "token配置列表",
"url": "management-query-token-page.html"
}]
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- debug disable cache -->
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Management Query Token Page</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link type="image/x-ico" href="/etax-income/favicon.ico" rel="shortcut icon"/>
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="/etax-income/plugins/bootstrap/css/bootstrap.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="css/bootstrap-table.min.css">
<link rel="stylesheet" href="css/bootstrap-table-editable.css">
<link rel="stylesheet" href="/etax-income/plugins/font-awesome-4.5.0/css/font-awesome.min.css">
</head>
<script src="/etax-income/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<script src="/etax-income/plugins/jQueryUI/jquery-ui.min.js"></script>
<script src="/etax-income/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/etax-income/plugins/datatables/bootstrap-table.min.js"></script>
<script src="/etax-income/plugins/echarts/echarts.min.js"></script>
<script src="/etax-income/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/etax-income/plugins/fileDownload/jquery.fileDownload.js"></script>
<script src="/etax-income/scripts/common.js"></script>
<script src="/etax-income/scripts/management-query-token-page.js"></script>
<script>
$(document).ready(function () {
$.widget.bridge('uibutton', $.ui.button);
initAll();
});
</script>
<body>
<div class="box-body">
<div class="toolbar" style="float: right;">
<a class="btn btn-info" onclick="refreshPageList()">
<i class="fa fa-search" style="font-size: 15px; color: white;"></i> 查询
</a>
</div>
<form class="form-inline">
<div class="box-body">
<div class="form-group" role="form">
<label class="col-sm-2 control-label">userCode:</label>
<div class="col-sm-4">
<select class="form-control" id="userCode">
<option value="">请选择</option>
</select>
</div>
<label class="col-sm-2 control-label">areaCode:</label>
<div class="col-sm-4">
<select class="form-control" id="areaCode">
<option value="">请选择</option>
</select>
</div>
<label class="col-sm-2 control-label">登录类型:</label>
<div class="col-sm-4">
<select class="form-control" id="serverNo">
<option value="">请选择</option>
<option value="E00004">页面登录</option>
<option value="E00005">快捷登录</option>
</select>
</div>
<label class="col-sm-2 control-label">用户类型:</label>
<div class="col-sm-4">
<select class="form-control" id="userType">
<option value="">请选择</option>
<option value="1">自动</option>
<option value="2">人工</option>
</select>
</div>
<label class="col-sm-2 control-label">taxno:</label>
<div class="col-sm-4">
<input class="form-control" id="taxno" value="">
</div>
<label class="col-sm-2 control-label">errorMessage:</label>
<div class="col-sm-4">
<input class="form-control" id="errorMessage" value="">
</div>
</div>
</div>
</form>
<div class="col-xs-12">
<div id="toolbar">
<button id="startServer" class="btn btn-danger" disabled>
<i class="fa fa-unlock"></i> 配置
</button>
</div>
<table id="queryTaxUserTable"></table>
</div>
</div><!-- /.box-body -->
<div class="modal fade" id="openTokenConfigModal" role="dialog" aria-labelledby="openTokenConfigModalLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
</button>
<h4 class="modal-title" id="openTokenConfigModalLabel">
income token update
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="box-body">
<div class="form-group">
<label class="col-sm-3 control-label">登录类型:</label>
<div class="col-sm-3">
<select class="form-control" id="serverNoRequest">
<option value="E00004">页面登录</option>
<option value="E00005">快捷登录</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户类型:</label>
<div class="col-sm-3">
<select class="form-control" id="userTypeRequest">
<option value="1">自动</option>
<option value="2">人工</option>
</select>
</div>
</div>
<div class="form-group text-center">
<button type="button" class="btn btn-info" onclick="submitLoginInfo()">提交</button>
</div>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="confirmModalLabel">启用操作</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>
<div class="modal-body">
<p>您确定要执行此操作吗?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="confirm-action">确认</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="cleanTokenSampleModal" role="dialog" aria-labelledby="cleanTokenSampleModalLabel" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
</button>
<h4 class="modal-title" id="cleanTokenSampleModalLabel">
clean token cache
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="box-body">
<div class="form-group">
<label class="col-sm-3 control-label">登录类型:</label>
<div class="col-sm-12">
<textarea class="form-control" id="cleanTokenResult" cols="46" rows="16"></textarea>
</div>
</div>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</body>
</html>
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