This commit is contained in:
mjt
2024-02-18 09:23:41 +08:00
8 changed files with 149 additions and 16 deletions
@@ -269,9 +269,9 @@ public class ApiUserController {
public Object updateAction(ApiUserModel model) {
Long userId = model.getUserId();
Map<String, Object> dataApiUser = new HashMap<String, Object>();
Map<String, Object> user = new HashMap<String, Object>();
// Map<String, Object> user = new HashMap<String, Object>();
dataApiUser.put("email", model.getEmail());
user.put("password", DigestUtils.md5Hex(model.getPassword()));
// user.put("password", DigestUtils.md5Hex(model.getPassword()));
dataApiUser.put("siteName", model.getSiteName());
dataApiUser.put("ip", model.getIp());
dataApiUser.put("company", model.getCompany());
@@ -282,9 +282,9 @@ public class ApiUserController {
dataApiUser.put("isMonitor", model.getIsMonitor());
this.apiUserService.update(dataApiUser, userId);
// 更改用户密码
this.userService.updateById(user,userId);
// this.userService.updateById(user,userId);
// 刷新缓存
this.apiUserService.clearApiUserAuthorityCache(userId);
// this.apiUserService.clearApiUserAuthorityCache(userId);
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
@@ -297,6 +297,30 @@ public class ApiUserController {
return model;
}
public Object doEditPwdAction(ApiUserModel model) {
Long userId = model.getUserId();
Map<String, Object> user = new HashMap<String, Object>();
user.put("password", DigestUtils.md5Hex(model.getPassword()));
//
// // 更改用户密码
this.userService.updateById(user,userId);
// 刷新缓存
this.apiUserService.clearApiUserAuthorityCache(userId);
model.setViewType("redirect");
model.setViewParam("location", "/apiUser/edit?userId="+userId);
return model;
}
public Object editPwdAction(ApiUserModel model) {
Long userId = model.getUserId();
User user = this.userService.findById(userId);
ApiUserBo bo = new ApiUserBo();
bo.setUserName(user.getUserName());
bo.setDisplayName(user.getDisplayName());
model.setApiUserBo(bo);
return model;
}
void modifyUserCfg(Long userId, ApiUserCfg.ApiUserCfgKey cfgKey, Object val) {
if (userId != null && cfgKey != null) {
ApiUserCfg apiUserCfg = this.apiUserCfgService.findByUserId(userId, cfgKey);
@@ -46,11 +46,17 @@
<#-- <tr>-->
<#-- <td>密码</td>-->
<#-- <td><input id="resetPwd" type="button" value="重置密码"/></td>-->
<#-- </tr>-->
<#-- <tr>-->
<#-- <td><b>密码</b></td>-->
<#-- <td><input name="password" value="${apiUserBo.password!}" /></td>-->
<#-- </tr>-->
<tr>
<td><b>密码</b></td>
<td><input name="password" value="${apiUserBo.password!}" /></td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="../apiUser/editPwd?userId=${apiUserBo.userId!}">修改密码</a>
</td>
</tr>
<tr>
<td>账户类型</td>
<td>
@@ -0,0 +1,54 @@
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
<#compress>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>api用户密码修改</title>
<link rel="stylesheet" type="text/css" href="../style/main.css?v=${version}"/>
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<#include "/common_js.ftl" />
<script type="text/javascript">
</script>
</head>
<body>
<#include "/layout/header.ftl" />
<div class="main-content">
<div class="list">
<table width="50%">
<form id="submitForm" action="doEditPwd" method="post" >
<tr>
<td>用户名</td>
<input id="userId" name="userId" value="${userId!}" type="hidden"/>
<td>${apiUserBo.userName!}<#if (apiUserBo.displayName??)>(${apiUserBo.displayName!})</#if></td>
</tr>
<tr>
<td><b>新密码</b></td>
<td><input name="password" value="${apiUserBo.password!}" /></td>
</tr>
</form>
<tr>
<td></td>
<td><input onclick="submitForm();" type="reset" value="修改"/></td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
function submitForm() {
$("#submitForm").attr("action", "doEditPwd");
$("#submitForm").submit();
}
function isIP(strIP) {
if (!strIP)
return false;
var re = /^(\d+)(\.(\d+)){0,3}$/g //匹配IP地址的正则表达式
return re.test(strIP)
}
</script>
</body>
</html>
</#compress>
@@ -276,6 +276,8 @@ public class ComprehensiveQueryController {
district = bieShuDistrict;
}
}
//添加城市
propertyEvaluationModel.setCity(district.getCity());
propertyEvaluationModel.setDistrict(district.getRegion());
propertyEvaluationModel.setName(district.getName());
try {
@@ -507,10 +509,10 @@ public class ComprehensiveQueryController {
throws NumberFormatException, IllegalAccessException {
// RestfulModelAndView mav = new RestfulModelAndView();
// mav.setViewType("rest");
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
if (StringUtils.isBlank(model.getName())
|| StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,区域,小区名,面积(size)为必填项"));
return mav;
mav.setModel(BasicModel.buildBadRequestModel("参数非法:区域,小区名,面积(size)为必填项"));
// return mav;
}
if (model.getCity().endsWith("市")) {
model.setCity(model.getCity().replaceAll("市$", ""));
@@ -880,8 +880,13 @@ public class PropertyController {
districtInfoDto.setAddressAlias(district.getAddrAlias());
if (district.getLat2() != null && district.getLat2() != 0 && district.getLng2() != null
&& district.getLng2() != 0) {
districtInfoDto.setLat(district.getLat2() / 10000000000D);
districtInfoDto.setLng(district.getLng2() / 10000000000D);
districtInfoDto.setLat2(district.getLat2() / 10000000000D);
districtInfoDto.setLng2(district.getLng2() / 10000000000D);
}
if (district.getLat() != null && district.getLat() != 0 && district.getLng() != null
&& district.getLng() != 0) {
districtInfoDto.setLat(district.getLat() / 10000000000D);
districtInfoDto.setLng(district.getLng() / 10000000000D);
}
districtInfoDto.setPropertyType(district.getEstateType2());
if (HouseValidator.validateBuildingType(district.getBuildType())) {
@@ -26,8 +26,14 @@ public class DistrictInfoDto {
private List<String> alias;
private List<String> addressAlias;
private String videoUrl;
//高德坐标
//维度
private Double lat;
//经度
private Double lng;
// 百度坐标
private Double lat2;
private Double lng2;
private String developer;
private String buildType;
private String estateCompany;
@@ -102,7 +108,22 @@ public class DistrictInfoDto {
private String township;
private String landProperty;
public Double getLat2() {
return lat2;
}
public void setLat2(Double lat2) {
this.lat2 = lat2;
}
public Double getLng2() {
return lng2;
}
public void setLng2(Double lng2) {
this.lng2 = lng2;
}
public String getDistrict() {
return district;
}
@@ -0,0 +1,18 @@
package com.fangjia;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.codec.binary.Hex;
import java.util.Scanner;
public class test {
public static void main(String[] args) {
while (true){
Scanner scanner = new Scanner(System.in);
String password = scanner.nextLine();
String p =DigestUtils.md5Hex(password);
System.out.println(p);
}
}
}
@@ -2727,11 +2727,14 @@ public class DistrictServiceImpl implements DistrictService {
public Integer getCreateYear(District district) {
Integer buildYear = getYearFormDate(district.getCreateYear());
int minYear = Integer.MAX_VALUE;
if (buildYear != null && buildYear < minYear) {
minYear = buildYear;
// int minYear = Integer.MAX_VALUE;
if (buildYear != null && buildYear < Integer.MAX_VALUE) {
// minYear = buildYear;
return buildYear;
}else {
return null;
}
return minYear;
// return minYear;
}
public Integer getBuildYear(District district) {