功能新增
parent
134525de69
commit
b01bbb168e
|
|
@ -33,6 +33,7 @@ import com.ruoyi.common.security.utils.SecurityUtils;
|
|||
import com.ruoyi.system.api.model.LoginUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -51,6 +52,7 @@ import static com.alibaba.nacos.api.common.Constants.ACCESS_TOKEN;
|
|||
@Api(
|
||||
tags = "APP-登录接口"
|
||||
)
|
||||
@Slf4j
|
||||
public class AppLoginController {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -94,7 +96,34 @@ public class AppLoginController {
|
|||
Assert.notNull(appSchool, "学校不存在!");
|
||||
|
||||
String email = registerForm.getEmail();
|
||||
if (StringUtils.isNotEmpty(email) && appSchool.getEmail() != null && appSchool.getEmail().equals(email.substring(email.indexOf("@") + 1,email.length()))) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(email)) {
|
||||
if (org.apache.commons.lang3.StringUtils.isBlank(registerForm.getProve()) && org.apache.commons.lang3.StringUtils.isBlank(appSchool.getEmail())) {
|
||||
return R.fail(2001,"该学校没有提供邮箱审核,请人工审核!");
|
||||
}
|
||||
String emailStr = email.substring(email.indexOf("@") + 1,email.length());
|
||||
if (org.apache.commons.lang3.StringUtils.isBlank(registerForm.getProve()) && !emailStr.equals(appSchool.getEmail())) {
|
||||
return R.fail(2001,"您提供的邮箱后缀与您的学校不符!请提供学习邮箱或人工审核。");
|
||||
}
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
//校验邮箱是否已注册
|
||||
AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
||||
if (emailUser != null && emailUser.getId() != null) {
|
||||
return R.fail(2001,"该邮箱已注册请重新输入!");
|
||||
}
|
||||
String uuid = IdUtils.fastUUID();
|
||||
redisService.setCacheObject(uuid, registerForm);
|
||||
try {
|
||||
String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
||||
+ "<p>请点击下面的网址确认您的注册:</p>"
|
||||
+ "<a href=https://gobig.flameby.com/api/app/activation/" + uuid + "/" + registerForm.getEmail() + ">注册账号</a>"
|
||||
+ "</body></html>";
|
||||
AliMailUtil.sendMail(EM,registerForm.getEmail());
|
||||
log.info("邮箱发送成功-------------------");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
/*if (StringUtils.isNotEmpty(email) && appSchool.getEmail() != null && appSchool.getEmail().equals(email.substring(email.indexOf("@") + 1,email.length()))) {
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
//校验邮箱是否已注册
|
||||
AppUser emailUser = appUserService.selectAppUserByEmail(registerForm.getEmail());
|
||||
|
|
@ -104,14 +133,14 @@ public class AppLoginController {
|
|||
try {
|
||||
String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
||||
+ "<p>请点击下面的网址确认您的注册:</p>"
|
||||
+ "<a href=http://139.224.213.131:7008/app/activation/" + uuid + "/" + registerForm.getEmail() + ">注册账号</a>"
|
||||
+ "<a href=https://gobig.flameby.com/api/app/activation/" + uuid + "/" + registerForm.getEmail() + ">注册账号</a>"
|
||||
+ "</body></html>";
|
||||
|
||||
AliMailUtil.sendMail(EM,registerForm.getEmail());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (register != null && register.getStatus() != null) {
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ public class AppUserController extends BaseController
|
|||
return toAjax(appUserService.updateAppUser(appUser));
|
||||
}
|
||||
|
||||
@Log(title = "app用户修改手机号", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/editPhone")
|
||||
@ApiOperation(value = "修改app用户信息", notes = "修改app用户信息", httpMethod = "PUT")
|
||||
public AjaxResult editPhone(@RequestBody AppUser appUser)
|
||||
{
|
||||
return appUserService.editPhone(appUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除app用户
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -431,7 +431,10 @@ public class PayController extends BaseController
|
|||
endDate = startDate;
|
||||
}
|
||||
endDate = appOrder.getLevel() == 1 ? DateUtils.dateAddTime(endDate,3,7)
|
||||
: (appOrder.getLevel() == 2 ? DateUtils.dateAddTime(endDate,4,31) : DateUtils.dateAddTime(endDate,5,365));
|
||||
: (appOrder.getLevel() == 2 ? DateUtils.dateAddTime(endDate,4,1) : DateUtils.dateAddTime(endDate,5,1));
|
||||
if (appOrder.getLevel() == 4) {
|
||||
endDate = DateUtils.dateAddTime(endDate,4,3);
|
||||
}
|
||||
userEntity.setOrderStartTime(startDate);
|
||||
userEntity.setOrderEndTime(endDate);
|
||||
userEntity.setUpdateTime(new Date());
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ public class AppVip extends BaseEntity
|
|||
@Excel(name = "会员金额")
|
||||
private Long price;
|
||||
|
||||
@Excel(name = "0展示1不展示")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ public interface IAppUserService
|
|||
*/
|
||||
public int updateAppUser(AppUser appUser);
|
||||
|
||||
AjaxResult editPhone(AppUser appUser);
|
||||
|
||||
/**
|
||||
* 批量删除app用户
|
||||
*
|
||||
|
|
|
|||
|
|
@ -234,7 +234,10 @@ public class AppRegisterServiceImpl implements IAppRegisterService {
|
|||
endDate = startDate;
|
||||
}
|
||||
endDate = order.getLevel() == 1 ? DateUtils.dateAddTime(endDate,3,7)
|
||||
: (order.getLevel() == 2 ? DateUtils.dateAddTime(endDate,4,31) : DateUtils.dateAddTime(endDate,5,365));
|
||||
: (order.getLevel() == 2 ? DateUtils.dateAddTime(endDate,4,1) : DateUtils.dateAddTime(endDate,5,1));
|
||||
if (order.getLevel() == 4) {
|
||||
endDate = DateUtils.dateAddTime(endDate,4,3);
|
||||
}
|
||||
userEntity.setOrderStartTime(startDate);
|
||||
userEntity.setOrderEndTime(endDate);
|
||||
userEntity.setUpdateTime(new Date());
|
||||
|
|
|
|||
|
|
@ -365,4 +365,22 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||
|
||||
return appUserMapper.selectAppuserCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult editPhone(AppUser appUser) {
|
||||
AppUser entity = appUserMapper.selectAppUserById(appUser.getId());
|
||||
if (appUser.getPhone() == entity.getPhone()) {
|
||||
return AjaxResult.error(2001,"不能和原手机号一致!");
|
||||
}
|
||||
entity = appUserMapper.selectAppUserByPhone(appUser.getPhone());
|
||||
if (entity != null) {
|
||||
return AjaxResult.error(2001,"该手机号已存在请重新注册!");
|
||||
}
|
||||
entity = new AppUser();
|
||||
entity.setId(appUser.getId());
|
||||
entity.setPhone(appUser.getPhone());
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
appUserMapper.updateAppUser(entity);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="username != null "> and u.username like concat('%',#{username},'%')</if>
|
||||
<if test="content != null and content != ''"> and a.content like concat('%',#{content},'%')</if>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and a.img_url = #{imgUrl}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="remark" column="remark" />
|
||||
<result property="level" column="level" />
|
||||
<result property="price" column="price" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppVipVo">
|
||||
select id, create_time, update_time, remark, level, price from app_vip
|
||||
select id, create_time, update_time, remark, level, price, status from app_vip
|
||||
</sql>
|
||||
|
||||
<select id="selectAppVipList" parameterType="AppVip" resultMap="AppVipResult">
|
||||
|
|
@ -22,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
<if test="level != null "> and level = #{level}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -39,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null">remark,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
|
|
@ -47,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null">#{remark},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -58,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue