修改了动态多条件查询的县级查询

This commit is contained in:
DESKTOP-G8BCEP0\HP 2021-08-10 08:41:17 +08:00
parent aa5b920dd9
commit 85ffb7d594
10 changed files with 55 additions and 6 deletions

View File

@ -100,6 +100,7 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
for(SysAuthorityEntity sysAuthorityEntity : permissionList) { for(SysAuthorityEntity sysAuthorityEntity : permissionList) {
permissions.add(new GrantedAuthorityImpl(sysAuthorityEntity.getAuthorityName())); permissions.add(new GrantedAuthorityImpl(sysAuthorityEntity.getAuthorityName()));
} }
// 生成令牌 // 生成令牌
Authentication authToken = new UsernamePasswordAuthenticationToken(userName, encryptPassword, permissions); Authentication authToken = new UsernamePasswordAuthenticationToken(userName, encryptPassword, permissions);
return authToken; return authToken;

View File

@ -51,6 +51,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET,"/websocketTest").permitAll() .antMatchers(HttpMethod.GET,"/websocketTest").permitAll()
.antMatchers(HttpMethod.GET,"/selectCityName").permitAll() .antMatchers(HttpMethod.GET,"/selectCityName").permitAll()
.antMatchers(HttpMethod.GET,"/weather/cityName").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityName").permitAll()
.antMatchers(HttpMethod.GET,"/weather/cityId").permitAll()
.antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll() .antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll()
.antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll() .antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll()
.antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll() .antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll()

View File

@ -136,7 +136,7 @@ public class FirePointController {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
// 查询县 // 查询县
}else { }else {
List<FirePointEntity> firePointEntities = firePointService.selectFirePointByCounty(cityCode, satelliteType, landType, startTime, endTime); List<FirePointEntity> firePointEntities = firePointService.selectFirePointByCounty(sysUserEntity.getCountyCode(), satelliteType, landType, startTime, endTime);
if(firePointEntities == null || firePointEntities.size() == 0){ if(firePointEntities == null || firePointEntities.size() == 0){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
} }

View File

@ -82,7 +82,7 @@ public interface SysUserDao extends JpaRepository<SysUserEntity,Integer> {
* 查询用户信息 * 查询用户信息
* @return * @return
*/ */
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType) " + @Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName) " +
"from SysUserEntity") "from SysUserEntity")
List<SysUserVo> selectAll(); List<SysUserVo> selectAll();
@ -91,7 +91,7 @@ public interface SysUserDao extends JpaRepository<SysUserEntity,Integer> {
* @param userName * @param userName
* @return * @return
*/ */
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType) " + @Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName) " +
"from SysUserEntity where userName = :userName") "from SysUserEntity where userName = :userName")
SysUserVo selectUserByUserName(String userName); SysUserVo selectUserByUserName(String userName);

View File

@ -84,6 +84,14 @@ public class SysUserEntity implements Serializable {
@Column(length = 64,columnDefinition = "varchar(64)") @Column(length = 64,columnDefinition = "varchar(64)")
private String accountType; private String accountType;
@Column(length = 64,columnDefinition = "varchar(64)")
private String countyName;
/**
* 登录次数
*/
private Integer loginNum;
public Integer getId() { public Integer getId() {
return id; return id;
} }
@ -220,6 +228,22 @@ public class SysUserEntity implements Serializable {
this.accountType = accountType; this.accountType = accountType;
} }
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
public Integer getLoginNum() {
return loginNum;
}
public void setLoginNum(Integer loginNum) {
this.loginNum = loginNum;
}
@Override @Override
public String toString() { public String toString() {
return "SysUserEntity{" + return "SysUserEntity{" +
@ -240,6 +264,8 @@ public class SysUserEntity implements Serializable {
", dayNum=" + dayNum + ", dayNum=" + dayNum +
", overTime='" + overTime + '\'' + ", overTime='" + overTime + '\'' +
", accountType='" + accountType + '\'' + ", accountType='" + accountType + '\'' +
", countyName='" + countyName + '\'' +
", loginNum=" + loginNum +
'}'; '}';
} }
} }

View File

@ -60,6 +60,8 @@ public class SysUserQo {
private String accountType; private String accountType;
private String countyName;
public Integer getId() { public Integer getId() {
return id; return id;
} }
@ -155,4 +157,12 @@ public class SysUserQo {
public void setAccountType(String accountType) { public void setAccountType(String accountType) {
this.accountType = accountType; this.accountType = accountType;
} }
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
} }

View File

@ -26,7 +26,9 @@ public class SysUserVo implements Serializable {
private String accountType; private String accountType;
public SysUserVo(Integer id, String reallyName, String telephone, String countyCode, Integer activeFlag, String addTime, String overTime, Integer dayNum, String accountType) { private String countyName;
public SysUserVo(Integer id, String reallyName, String telephone, String countyCode, Integer activeFlag, String addTime, String overTime, Integer dayNum, String accountType, String countyName) {
this.id = id; this.id = id;
this.reallyName = reallyName; this.reallyName = reallyName;
this.telephone = telephone; this.telephone = telephone;
@ -36,6 +38,7 @@ public class SysUserVo implements Serializable {
this.overTime = overTime; this.overTime = overTime;
this.dayNum = dayNum; this.dayNum = dayNum;
this.accountType = accountType; this.accountType = accountType;
this.countyName = countyName;
} }
public Integer getId() { public Integer getId() {
@ -109,5 +112,13 @@ public class SysUserVo implements Serializable {
public void setAccountType(String accountType) { public void setAccountType(String accountType) {
this.accountType = accountType; this.accountType = accountType;
} }
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
} }

View File

@ -259,7 +259,6 @@ public class FirePointServiceImpl implements FirePointService {
} }
List<FireTaskPhoto> fireTaskPhotos = PhotoUtil.uploadImage(files, appTaskBodyVo.getFireCode()); List<FireTaskPhoto> fireTaskPhotos = PhotoUtil.uploadImage(files, appTaskBodyVo.getFireCode());
List<FireTaskPhoto> fireTaskPhotos1 = fireTaskPhotoDao.saveAll(fireTaskPhotos); List<FireTaskPhoto> fireTaskPhotos1 = fireTaskPhotoDao.saveAll(fireTaskPhotos);
//List<FireTaskPhoto> fireTaskPhotos1 = jdbcUtils.batchWithJdbcTemplate(fireTaskPhotos);
if(fireTaskPhotos1 == null || fireTaskPhotos1.size() == 0){ if(fireTaskPhotos1 == null || fireTaskPhotos1.size() == 0){
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"图片上传失败,任务提交失败",locale); return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"图片上传失败,任务提交失败",locale);
} }

View File

@ -100,6 +100,7 @@ public class SysUserServiceImpl implements SysUserService {
sysUserEntity.setDayNum(7); sysUserEntity.setDayNum(7);
String string = dateTimeToString(LocalDateTime.now().plusDays(7L)); String string = dateTimeToString(LocalDateTime.now().plusDays(7L));
sysUserEntity.setOverTime(string); sysUserEntity.setOverTime(string);
sysUserEntity.setCountyName(sysUserQo.getCountyName());
sysUserDao.save(sysUserEntity); sysUserDao.save(sysUserEntity);

View File

@ -38,7 +38,7 @@ spring.cache.type = redis
spring.redis.database = 8 spring.redis.database = 8
spring.redis.host = localhost spring.redis.host = localhost
spring.redis.port = 6379 spring.redis.port = 6379
spring.redis.password=sdust2020 #spring.redis.password=sdust2020
spring.redis.timeout = 10000 spring.redis.timeout = 10000
spring.redis.lettuce.pool.max-active = 100 spring.redis.lettuce.pool.max-active = 100
spring.redis.lettuce.pool.max-wait = 10000 spring.redis.lettuce.pool.max-wait = 10000