系统要做推广 孙总给定了新的规则:11.9-11.12号期间注册的用户 市级、区县级用户可享免费30天 乡镇级用户可享免费180天

This commit is contained in:
liuchengqian 2023-11-09 11:50:11 +08:00
parent aac7a6d750
commit aba3b12135

View File

@ -141,8 +141,10 @@ public class SysUserServiceImpl implements SysUserService {
if (streetNameList == null || streetNameList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(0);
sysUserEntity.setAccountType("街道级");
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(7L)));
adapterStreetUser(sysUserEntity);
} else if ("0000".equals(countyCode.substring(2))) {
List<StreetEntity> proCodeList = streetDao.findByProCode(countyCode);
if (proCodeList == null || proCodeList.size() == 0) {
@ -152,8 +154,10 @@ public class SysUserServiceImpl implements SysUserService {
if (proNameList == null || proNameList.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(1);
sysUserEntity.setAccountType("省级");
sysUserEntity.setActiveFlag(1);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
// adapterProUser(sysUserEntity);
} else if ("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))) {
List<StreetEntity> cityCodeList = streetDao.findByCityCode(countyCode);
if (cityCodeList == null || cityCodeList.size() == 0) {
@ -163,8 +167,10 @@ public class SysUserServiceImpl implements SysUserService {
if (cityNameList == null || cityNameList.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(1);
sysUserEntity.setAccountType("市级");
sysUserEntity.setActiveFlag(1);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
adapterCityUser(sysUserEntity);
} else {
List<StreetEntity> countyCodeList = streetDao.findByCountyCode(countyCode);
if (countyCodeList == null || countyCodeList.isEmpty()) {
@ -174,13 +180,10 @@ public class SysUserServiceImpl implements SysUserService {
if (countyNameList == null || countyNameList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(0);
sysUserEntity.setAccountType("县级");
}
if (9 == countyCode.length()) {//街道账号7天后过期
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(7L)));
} else {//省市区县账号5天后过期
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
adapterCountyUser(sysUserEntity);
}
sysUserEntity.setStatusCode(0);
sysUserEntity.setAddTime(dateTimeToString(LocalDateTime.now()));
@ -209,6 +212,53 @@ public class SysUserServiceImpl implements SysUserService {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "注册成功!", locale);
}
/**
* 适配2023-11-09到2023-11-12之间注册的街道用户
*/
private void adapterStreetUser(SysUserEntity sysUserEntity) {
if (in1109To1112()) {
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(180L)));
}
}
// private void adapterProUser(SysUserEntity sysUserEntity) {
// if (in1109To1112()) {
// sysUserEntity.setActiveFlag(1);
// sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
// }
// }
/**
* 适配2023-11-09到2023-11-12之间注册的市级用户
*/
private void adapterCityUser(SysUserEntity sysUserEntity) {
if (in1109To1112()) {
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(30L)));
}
}
/**
* 适配2023-11-09到2023-11-12之间注册的区县用户
*/
private void adapterCountyUser(SysUserEntity sysUserEntity) {
if (in1109To1112()) {
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(30L)));
}
}
/**
* 判断当前是否处于2023-11-09到2023-11-12之间注册的
*/
private boolean in1109To1112() {
LocalDateTime now = LocalDateTime.now();
LocalDateTime start1109 = LocalDateTime.of(2023, 11, 9, 0, 0, 0, 0);
LocalDateTime end1112 = LocalDateTime.of(2023, 11, 13, 0, 0, 0, 0);
return start1109.isBefore(now) && end1112.isAfter(now);
}
/**
* 新增用户
*
@ -247,8 +297,9 @@ public class SysUserServiceImpl implements SysUserService {
if (streetNameList == null || streetNameList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(0);
sysUserEntity.setAccountType("街道级");
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(7L)));
} else if ("0000".equals(countyCode.substring(2))) {
List<StreetEntity> proCodeList = streetDao.findByProCode(countyCode);
if (proCodeList == null || proCodeList.size() == 0) {
@ -258,8 +309,9 @@ public class SysUserServiceImpl implements SysUserService {
if (proNameList == null || proNameList.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(1);
sysUserEntity.setAccountType("省级");
sysUserEntity.setActiveFlag(1);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
} else if ("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))) {
List<StreetEntity> cityCodeList = streetDao.findByCityCode(countyCode);
if (cityCodeList == null || cityCodeList.size() == 0) {
@ -269,8 +321,9 @@ public class SysUserServiceImpl implements SysUserService {
if (cityNameList == null || cityNameList.size() == 0) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(1);
sysUserEntity.setAccountType("市级");
sysUserEntity.setActiveFlag(1);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
} else {
List<StreetEntity> countyCodeList = streetDao.findByCountyCode(countyCode);
if (countyCodeList == null || countyCodeList.isEmpty()) {
@ -280,12 +333,8 @@ public class SysUserServiceImpl implements SysUserService {
if (countyNameList == null || countyNameList.isEmpty()) {
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "您所选择的区域不存在!", locale);
}
sysUserEntity.setActiveFlag(0);
sysUserEntity.setAccountType("县级");
}
if (9 == countyCode.length()) {//街道账号7天后过期
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(7L)));
} else {//省市区县账号5天后过期
sysUserEntity.setActiveFlag(0);
sysUserEntity.setOverTime(dateTimeToString(LocalDateTime.now().plusDays(5L)));
}
sysUserEntity.setStatusCode(0);