fix: 优化逻辑
This commit is contained in:
parent
956aaccfb2
commit
294e34dbbf
@ -865,10 +865,17 @@ public class FishDraftDataController {
|
|||||||
warnings.add("rstcd");
|
warnings.add("rstcd");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.getBaseId() != null && !data.getBaseId().isEmpty()) {
|
// if (data.getBaseId() != null && !data.getBaseId().isEmpty()) {
|
||||||
String baseId = fishImportService.resolveBaseCode(data.getBaseId(), data.getBaseName());
|
// String baseId = fishImportService.resolveBaseCode(data.getBaseId(), data.getBaseName());
|
||||||
|
// if (baseId == null) {
|
||||||
|
// warnings.add("baseId");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (data.getHbrvcd() != null && !data.getHbrvcd().isEmpty()) {
|
||||||
|
String baseId = fishImportService.resolveHbrvcdCode(data.getHbrvcd(), data.getHbrvnm());
|
||||||
if (baseId == null) {
|
if (baseId == null) {
|
||||||
warnings.add("baseId");
|
warnings.add("hbrvcd");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -879,16 +886,16 @@ public class FishDraftDataController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.getHbrvcd() != null && !data.getHbrvcd().isEmpty()) {
|
// if (data.getHbrvcd() != null && !data.getHbrvcd().isEmpty()) {
|
||||||
String hbrvcd = fishImportService.resolveHbrvcdCode(data.getRvcd(), data.getRvcd());
|
// String hbrvcd = fishImportService.resolveHbrvcdCode(data.getHbrvcd(), data.getRvcd());
|
||||||
if (hbrvcd == null) {
|
// if (hbrvcd == null) {
|
||||||
warnings.add("hbrvcd");
|
// warnings.add("hbrvcd");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (data.getTm() == null) {
|
// if (data.getTm() == null) {
|
||||||
warnings.add("tm");
|
// warnings.add("tm");
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (data.getFtp() == null || data.getFtp().isEmpty()) {
|
if (data.getFtp() == null || data.getFtp().isEmpty()) {
|
||||||
warnings.add("ftp");
|
warnings.add("ftp");
|
||||||
@ -929,9 +936,9 @@ public class FishDraftDataController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.hasText(data.getBaseId()) && StringUtils.hasText(data.getRstcd())) {
|
if (StringUtils.hasText(data.getHbrvcd()) && StringUtils.hasText(data.getRstcd())) {
|
||||||
if (!fishImportService.validateStationBelongsToBase(data.getRstcd(), data.getBaseId())) {
|
if (!fishImportService.validateStationBelongsToBase(data.getRstcd(), data.getHbrvcd())) {
|
||||||
warnings.add("baseId");
|
warnings.add("hbrvcd");
|
||||||
warnings.add("rstcd");
|
warnings.add("rstcd");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -439,10 +439,10 @@ public class FishImportServiceImpl implements IFishImportService {
|
|||||||
|
|
||||||
private void validateStationFpssRelation(FishDraftData data, FishImportResult.FishImportRow importRow) {
|
private void validateStationFpssRelation(FishDraftData data, FishImportResult.FishImportRow importRow) {
|
||||||
loadStationAndBaseCache();
|
loadStationAndBaseCache();
|
||||||
if (StringUtils.hasText(data.getBaseId()) && StringUtils.hasText(data.getRstcd())) {
|
if (StringUtils.hasText(data.getHbrvcd()) && StringUtils.hasText(data.getRstcd())) {
|
||||||
if (!validateStationBelongsToBase(data.getRstcd(), data.getBaseId())) {
|
if (!validateStationBelongsToBase(data.getRstcd(), data.getHbrvcd())) {
|
||||||
if (!importRow.getWarnings().contains("baseId")) {
|
if (!importRow.getWarnings().contains("hbrvcd")) {
|
||||||
importRow.getWarnings().add("baseId");
|
importRow.getWarnings().add("hbrvcd");
|
||||||
}
|
}
|
||||||
if (!importRow.getWarnings().contains("rstcd")) {
|
if (!importRow.getWarnings().contains("rstcd")) {
|
||||||
importRow.getWarnings().add("rstcd");
|
importRow.getWarnings().add("rstcd");
|
||||||
@ -454,8 +454,8 @@ public class FishImportServiceImpl implements IFishImportService {
|
|||||||
}
|
}
|
||||||
if (StringUtils.hasText(data.getRstcd()) && StringUtils.hasText(data.getStcd())) {
|
if (StringUtils.hasText(data.getRstcd()) && StringUtils.hasText(data.getStcd())) {
|
||||||
if (!validateFpssBelongsToStation(data.getStcd(), data.getRstcd())) {
|
if (!validateFpssBelongsToStation(data.getStcd(), data.getRstcd())) {
|
||||||
if (!importRow.getWarnings().contains("baseId")) {
|
if (!importRow.getWarnings().contains("hbrvcd")) {
|
||||||
importRow.getWarnings().add("baseId");
|
importRow.getWarnings().add("hbrvcd");
|
||||||
}
|
}
|
||||||
if (!importRow.getWarnings().contains("stcd")) {
|
if (!importRow.getWarnings().contains("stcd")) {
|
||||||
importRow.getWarnings().add("stcd");
|
importRow.getWarnings().add("stcd");
|
||||||
@ -479,7 +479,7 @@ public class FishImportServiceImpl implements IFishImportService {
|
|||||||
STATION_CODE_TO_NAME_CACHE.put(station.getStcd().trim().toLowerCase(), station.getEnnm().trim().toLowerCase());
|
STATION_CODE_TO_NAME_CACHE.put(station.getStcd().trim().toLowerCase(), station.getEnnm().trim().toLowerCase());
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(station.getBaseId())) {
|
if (StringUtils.hasText(station.getBaseId())) {
|
||||||
STATION_TO_BASE_CACHE.put(station.getStcd().trim().toLowerCase(), station.getBaseId());
|
STATION_TO_BASE_CACHE.put(station.getStcd().trim().toLowerCase(), station.getHbrvcd());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,7 +204,7 @@ public class SmsVerifyCodeController {
|
|||||||
selectedBasinCodes.addAll(Arrays.asList(hbrvcdCode.split(",")));
|
selectedBasinCodes.addAll(Arrays.asList(hbrvcdCode.split(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> addedStationCodes = new HashSet<>();
|
// Set<String> addedStationCodes = new HashSet<>();
|
||||||
|
|
||||||
for (String basinCode : selectedBasinCodes) {
|
for (String basinCode : selectedBasinCodes) {
|
||||||
if (StringUtils.isEmpty(basinCode)) {
|
if (StringUtils.isEmpty(basinCode)) {
|
||||||
@ -241,7 +241,7 @@ public class SmsVerifyCodeController {
|
|||||||
scope.setStatus(1);
|
scope.setStatus(1);
|
||||||
scope.setPermissionType("READ");
|
scope.setPermissionType("READ");
|
||||||
sysUserDataScopeService.addDataScope(scope);
|
sysUserDataScopeService.addDataScope(scope);
|
||||||
addedStationCodes.add(basinCode);
|
// addedStationCodes.add(basinCode);
|
||||||
} else {
|
} else {
|
||||||
Set<String> stationsInBasinAndSelected = allStationCodesInBasin.stream()
|
Set<String> stationsInBasinAndSelected = allStationCodesInBasin.stream()
|
||||||
.filter(selectedStationCodes::contains)
|
.filter(selectedStationCodes::contains)
|
||||||
@ -255,27 +255,27 @@ public class SmsVerifyCodeController {
|
|||||||
scope.setStatus(1);
|
scope.setStatus(1);
|
||||||
scope.setPermissionType("READ");
|
scope.setPermissionType("READ");
|
||||||
sysUserDataScopeService.addDataScope(scope);
|
sysUserDataScopeService.addDataScope(scope);
|
||||||
addedStationCodes.add(stationCd);
|
// addedStationCodes.add(stationCd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> standaloneStations = selectedStationCodes.stream()
|
// Set<String> standaloneStations = selectedStationCodes.stream()
|
||||||
.filter(code -> !addedStationCodes.contains(code))
|
// .filter(code -> !addedStationCodes.contains(code))
|
||||||
.collect(Collectors.toSet());
|
// .collect(Collectors.toSet());
|
||||||
|
//
|
||||||
for (String stationCd : standaloneStations) {
|
// for (String stationCd : standaloneStations) {
|
||||||
if (StringUtils.isEmpty(stationCd)) {
|
// if (StringUtils.isEmpty(stationCd)) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
SysUserDataScope scope = new SysUserDataScope();
|
// SysUserDataScope scope = new SysUserDataScope();
|
||||||
scope.setUserId(userId);
|
// scope.setUserId(userId);
|
||||||
scope.setOrgType("STATION");
|
// scope.setOrgType("STATION");
|
||||||
scope.setOrgId(stationCd);
|
// scope.setOrgId(stationCd);
|
||||||
scope.setStatus(1);
|
// scope.setStatus(1);
|
||||||
scope.setPermissionType("READ");
|
// scope.setPermissionType("READ");
|
||||||
sysUserDataScopeService.addDataScope(scope);
|
// sysUserDataScopeService.addDataScope(scope);
|
||||||
}
|
// }
|
||||||
SysUser user = new SysUser();
|
SysUser user = new SysUser();
|
||||||
user.setId(userId);
|
user.setId(userId);
|
||||||
userService.updateUserRoles( user,"c13481a486c9ee559cf305284df4d207");
|
userService.updateUserRoles( user,"c13481a486c9ee559cf305284df4d207");
|
||||||
@ -316,9 +316,12 @@ public class SmsVerifyCodeController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ResponseResult.error("密码解密失败");
|
return ResponseResult.error("密码解密失败");
|
||||||
}
|
}
|
||||||
|
String encodePassword = existUser.getPassword();
|
||||||
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
String encryptedPassword = passwordEncoder.encode(password);
|
String encryptedPassword = passwordEncoder.encode(password);
|
||||||
|
if (passwordEncoder.matches(password, encodePassword)) {
|
||||||
|
return ResponseResult.error("新密码不能与旧密码相同");
|
||||||
|
}
|
||||||
boolean success = userService.updatePasswordByPhone(phone, encryptedPassword);
|
boolean success = userService.updatePasswordByPhone(phone, encryptedPassword);
|
||||||
if (success) {
|
if (success) {
|
||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
sys_user u
|
sys_user u
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
AND ( ( u.REG_STATUS != 0 AND u.REG_STATUS != 2 ) OR u.REG_STATUS IS NULL )
|
AND ( ( u.REG_STATUS != 'PENDING' AND u.REG_STATUS != 'REJECTED' ) OR u.REG_STATUS IS NULL )
|
||||||
AND u.usertype != 0
|
AND u.usertype != 0
|
||||||
<if test="orgid != null">
|
<if test="orgid != null">
|
||||||
and u.orgid = #{orgid}
|
and u.orgid = #{orgid}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user