用户管理完善
This commit is contained in:
+29
-6
@@ -89,7 +89,24 @@ public class ApiUserController {
|
||||
* @param ApiUser
|
||||
* :用户的appKey username、等资料
|
||||
*/
|
||||
List<ApiUser> apiUsers = this.apiUserService.findApiUsersByParamsSortDate(null);
|
||||
ArrayList<QueryParam> queryParams = new ArrayList<QueryParam>();
|
||||
if (model.getStatus() != null) {
|
||||
queryParams.add(new QueryParam("status", model.getStatus()));
|
||||
}else {
|
||||
queryParams.add(new QueryParam("status",0));
|
||||
}
|
||||
if (model.getIsTest()!=null){
|
||||
queryParams.add(new QueryParam("isTest",model.getIsTest()));
|
||||
}else {
|
||||
queryParams.add(new QueryParam("isTest",0));
|
||||
}
|
||||
if (model.getPurpose()!=null){
|
||||
queryParams.add(new QueryParam("purpose",model.getPurpose()));
|
||||
}else {
|
||||
queryParams.add(new QueryParam("purpose",1));
|
||||
}
|
||||
|
||||
List<ApiUser> apiUsers = this.apiUserService.findApiUsersByParamsSortDate(queryParams);
|
||||
List<ApiUserBo> apiUserBoList = new ArrayList<ApiUserBo>();
|
||||
for (ApiUser apiUser : apiUsers) {
|
||||
User user = this.userService.findById(apiUser.getId());
|
||||
@@ -195,6 +212,8 @@ public class ApiUserController {
|
||||
apiUser.setDeadTime(model.getDeadTime());
|
||||
apiUser.setManager(model.getManager());
|
||||
apiUser.setIsMonitor(model.getIsMonitor());
|
||||
apiUser.setContact(model.getContact());
|
||||
apiUser.setPhone(model.getPhone());
|
||||
this.apiUserService.save(apiUser);
|
||||
// 新增用户,默认挂牌价改为默认评估价
|
||||
model.setPriceType("evaluate");
|
||||
@@ -238,6 +257,8 @@ public class ApiUserController {
|
||||
bo.setDeadTime(apiUser.getDeadTime());
|
||||
bo.setManager(apiUser.getManager());
|
||||
bo.setIsMonitor(apiUser.getIsMonitor());
|
||||
bo.setContact(apiUser.getContact());
|
||||
bo.setPhone(apiUser.getPhone());
|
||||
ApiUserCfg apiUserCfg_rate = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE);
|
||||
if (apiUserCfg_rate != null) {
|
||||
bo.setEvaluateRate((Double) apiUserCfg_rate.getCfgValue());
|
||||
@@ -291,6 +312,8 @@ public class ApiUserController {
|
||||
dataApiUser.put("deadTime", model.getDeadTime());
|
||||
dataApiUser.put("manager", model.getManager());
|
||||
dataApiUser.put("isMonitor", model.getIsMonitor());
|
||||
dataApiUser.put("contact", model.getContact());
|
||||
dataApiUser.put("phone", model.getPhone());
|
||||
this.apiUserService.update(dataApiUser, userId);
|
||||
// 更改用户密码
|
||||
// this.userService.updateById(user,userId);
|
||||
@@ -1255,7 +1278,7 @@ public class ApiUserController {
|
||||
dataList.add(row);
|
||||
}
|
||||
|
||||
String dateStr ="("+ DateUtils.format(startDate, "yyyy/MM/dd") + "—" + DateUtils.format(endDate, "yyyy/MM/dd") +")";
|
||||
String dateStr = "(" + DateUtils.format(startDate, "yyyy/MM/dd") + "—" + DateUtils.format(endDate, "yyyy/MM/dd") + ")";
|
||||
String fileName = "用户账号使用统计" + dateStr + ".xlsx";
|
||||
// ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();
|
||||
String displayName = URLEncoder.encode(fileName, "UTF-8");
|
||||
@@ -1265,10 +1288,10 @@ public class ApiUserController {
|
||||
Sheet sheet = workbook.createSheet("用户账号使用统计");
|
||||
List<String> head = Arrays.asList(
|
||||
"用户ID", "账号", "合同到期时间", "接口", "接口名称", "剩余使用次数",
|
||||
"访问次数(近一周)", "日均访问量(近一周)","成功并有效(近一周)", "成功并无效(近一周)","失败次数(近一周)",
|
||||
"访问次数(近一月)", "日均访问量(近一月)","成功并有效(近一月)", "成功并无效(近一月)","失败次数(近一月)",
|
||||
"访问次数"+dateStr, "日均访问量"+dateStr,"成功并有效"+dateStr, "成功并无效"+dateStr,"失败次数"+dateStr
|
||||
);
|
||||
"访问次数(近一周)", "日均访问量(近一周)", "成功并有效(近一周)", "成功并无效(近一周)", "失败次数(近一周)",
|
||||
"访问次数(近一月)", "日均访问量(近一月)", "成功并有效(近一月)", "成功并无效(近一月)", "失败次数(近一月)",
|
||||
"访问次数" + dateStr, "日均访问量" + dateStr, "成功并有效" + dateStr, "成功并无效" + dateStr, "失败次数" + dateStr
|
||||
);
|
||||
// 创建表头
|
||||
Row headRow = sheet.createRow(0);
|
||||
for (int i = 0; i < head.size(); i++) {
|
||||
|
||||
@@ -40,6 +40,10 @@ public class ApiUserModel extends BaseModel {
|
||||
private Map<String,Double> priceRatingMap;
|
||||
private Integer isMonitor;
|
||||
|
||||
private String contact;
|
||||
|
||||
private String phone;
|
||||
|
||||
public String getPriceType() {
|
||||
return priceType;
|
||||
}
|
||||
@@ -70,7 +74,7 @@ public class ApiUserModel extends BaseModel {
|
||||
private String type;
|
||||
private String citys;// spell
|
||||
private String unCheckCitys;// 页面反选的city
|
||||
private int status;
|
||||
private Integer status;
|
||||
private String uri;
|
||||
private boolean hasAuth;
|
||||
private boolean supportLatLng;
|
||||
@@ -378,15 +382,15 @@ public class ApiUserModel extends BaseModel {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
@@ -615,4 +619,20 @@ public class ApiUserModel extends BaseModel {
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
<form id="addForm" action="doAdd" method="post">
|
||||
<tr>
|
||||
<td><b>昵称</b></td>
|
||||
<td><input name="displayName" value="${displayName!}"/></td>
|
||||
<td><input id="displayName" name="displayName" placeholder="必填项" value="${displayName!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>用户名</b></td>
|
||||
<input name="userId" value="${userId!}" type="hidden"/>
|
||||
<td><input id="userName" name="userName" value="${userName!}"/></td>
|
||||
<td><input id="userName" name="userName" placeholder="必填项" value="${userName!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>密码</b></td>
|
||||
@@ -59,7 +59,7 @@
|
||||
<td>账户用途</td>
|
||||
<td>
|
||||
<select name="purpose">
|
||||
<option value="">请选择</option>
|
||||
<#-- <option value="">请选择</option>-->
|
||||
<option value="1">API</option>
|
||||
<option value="2">PDS</option>
|
||||
<option value="4">房生活</option>
|
||||
@@ -75,15 +75,15 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><input name="email" value="${email!}"/></td>
|
||||
<td><input id="email" name="email" placeholder="必填项" value="${email!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>销售负责人</td>
|
||||
<td><input name="manager" value="${manager!}"/></td>
|
||||
<td><input id="manager" name="manager" placeholder="必填项" value="${manager!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司</td>
|
||||
<td><input name="company" value="${company!}"/></td>
|
||||
<td><input id="company" name="company" placeholder="必填项" value="${company!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>估价调整比率</td>
|
||||
@@ -92,13 +92,21 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>siteName</td>
|
||||
<td><input name="siteName" value="${siteName!}"/></td>
|
||||
<td><input name="siteName" value="${siteName!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>到期时间</td>
|
||||
<td><input name="deadTime"
|
||||
<td><input name="deadTime" id="deadTime" placeholder="必填项"
|
||||
onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-{%d+7}'})"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>客户联系人</td>
|
||||
<td><input id="contact" name="contact" placeholder="必填项" value="${contact!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>客户联系人电话</td>
|
||||
<td><input id="phone" name="phone" placeholder="必填项" value="${phone!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ip地址</td>
|
||||
<td><textarea id="ip" name="ip" rows="5" cols="12"
|
||||
@@ -125,6 +133,57 @@
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 检查其他字段是否为空
|
||||
var displayName = $.trim($("#displayName").val());
|
||||
var userName = $.trim($("#userName").val());
|
||||
var password = $.trim($("#password").val());
|
||||
var email = $.trim($("#email").val());
|
||||
var manager = $.trim($("#manager").val());
|
||||
var company = $.trim($("#company").val());
|
||||
var deadTime = $.trim($("#deadTime").val());
|
||||
var contact = $.trim($("#contact").val());
|
||||
var phone = $.trim($("#phone").val());
|
||||
if (displayName === '') {
|
||||
alert("昵称不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (userName === '') {
|
||||
alert("用户名不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (password === '') {
|
||||
alert("密码不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (email === '') {
|
||||
alert("邮箱不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (manager === '') {
|
||||
alert("销售负责人不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (company === '') {
|
||||
alert("公司不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (deadTime === '') {
|
||||
alert("到期时间不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (contact === '') {
|
||||
alert("客户联系人不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (phone === '') {
|
||||
alert("客户联系人电话不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (email === '') {
|
||||
alert("邮箱不能为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_userNameCheck) {
|
||||
$("#addForm").submit();
|
||||
}
|
||||
|
||||
@@ -97,15 +97,15 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><input name="email" value="${apiUserBo.email!}"/></td>
|
||||
<td><input id="email" name="email" placeholder="必填项" value="${apiUserBo.email!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>销售负责人</td>
|
||||
<td><input name="manager" value="${apiUserBo.manager!}" /></td>
|
||||
<td><input id="manager" name="manager" placeholder="必填项" value="${apiUserBo.manager!}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司</td>
|
||||
<td><input name="company" value="${apiUserBo.company!}"/></td>
|
||||
<td><input id="company" name="company" placeholder="必填项" value="${apiUserBo.company!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>估价调整比率</td>
|
||||
@@ -128,7 +128,15 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>到期时间</td>
|
||||
<td><input name="deadTime" value="<#if apiUserBo.deadTime??>${apiUserBo.deadTime?string("yyyy-MM-dd")}</#if>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
|
||||
<td><input id="deadTime" name="deadTime" placeholder="必填项" value="<#if apiUserBo.deadTime??>${apiUserBo.deadTime?string("yyyy-MM-dd")}</#if>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>客户联系人</td>
|
||||
<td><input id="contact" name="contact" placeholder="必填项" value="${apiUserBo.contact!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>客户联系人电话</td>
|
||||
<td><input id="phone" name="phone" placeholder="必填项" value="${apiUserBo.phone!}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ip地址</td>
|
||||
@@ -156,6 +164,42 @@
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 检查其他字段是否为空
|
||||
var email = $.trim($("#email").val());
|
||||
var manager = $.trim($("#manager").val());
|
||||
var company = $.trim($("#company").val());
|
||||
var deadTime = $.trim($("#deadTime").val());
|
||||
var contact = $.trim($("#contact").val());
|
||||
var phone = $.trim($("#phone").val());
|
||||
if (email === '') {
|
||||
alert("邮箱不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (manager === '') {
|
||||
alert("销售负责人不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (company === '') {
|
||||
alert("公司不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (deadTime === '') {
|
||||
alert("到期时间不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (contact === '') {
|
||||
alert("客户联系人不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (phone === '') {
|
||||
alert("客户联系人电话不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (email === '') {
|
||||
alert("邮箱不能为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#submitForm").attr("action", "update");
|
||||
$("#submitForm").submit();
|
||||
}
|
||||
|
||||
@@ -47,6 +47,34 @@
|
||||
<div style="padding-left:5px;">
|
||||
共有用户<b>${apiUserBoList?size}</b>个
|
||||
</div>
|
||||
<form action="../apiUser/list" id="_search_log_form">
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<label for="purpose" class="form-label">账号用途:</label>
|
||||
<select name="purpose" class="form-select">
|
||||
<option value="1">API</option>
|
||||
<option value="2">PDS</option>
|
||||
<option value="4">房生活</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="isTest" class="form-label">账号类型:</label>
|
||||
<select name="isTest" class="form-select">
|
||||
<option value="0">正式账号</option>
|
||||
<option value="1">测试账号</option>
|
||||
<option value="2">内部账号</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="form-label">账号状态:</label>
|
||||
<select name="status" class="form-select">
|
||||
<option value="0">正常</option>
|
||||
<option value="1">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="queryBtn" class="btn btn-primary form-button" type="submit" value="查询"/>
|
||||
</div>
|
||||
</form>
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -177,5 +205,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<style>
|
||||
.form-label {
|
||||
font-size: 15px; /* 增加标签的字体大小 */
|
||||
}
|
||||
|
||||
.form-select {
|
||||
font-size: 15px; /* 增加选择框的字体大小 */
|
||||
margin-right: 10px; /* 调整选择框之间的间距 */
|
||||
}
|
||||
|
||||
.form-button {
|
||||
font-size: 15px; /* 增加按钮的字体大小 */
|
||||
}
|
||||
|
||||
.form-group {
|
||||
display: inline-block; /* 使每个表单组不换行 */
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
</#compress>
|
||||
@@ -28,6 +28,10 @@ public class ApiUser implements SqlEntity {
|
||||
private String company;
|
||||
private int isTest; //0-正式客戶 1-测试用户 2-内部测试用户
|
||||
private Date deadTime;
|
||||
|
||||
private String contact; //联系人
|
||||
|
||||
private String phone; //联系人手机号
|
||||
/**
|
||||
* 账户用途
|
||||
* 1:Open APi
|
||||
@@ -185,4 +189,22 @@ public class ApiUser implements SqlEntity {
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
|
||||
@Column(name = "CUSTOMER_CONTACT")
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
@Column(name = "CUSTOMER_CONTACT_MOBILE")
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ public class ApiUserBo implements Serializable {
|
||||
private String priceType;
|
||||
private Integer isMonitor;
|
||||
|
||||
private String contact; //ÁªÏµÈË
|
||||
|
||||
private String phone; //ÁªÏµÈËÊÖ»úºÅ
|
||||
|
||||
public String getPriceType() {
|
||||
return priceType;
|
||||
}
|
||||
@@ -171,4 +175,20 @@ public class ApiUserBo implements Serializable {
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user