This commit is contained in:
xiao-fajia 2024-09-20 16:22:32 +08:00
commit 684e8e0b5a
8 changed files with 58 additions and 12 deletions

View File

@ -99,5 +99,11 @@ public class CustomerMain extends TenantBaseDO {
* 客户状态
*/
private String status;
/**
*
* 会员表id
*
*/
private String memberLevelId;
}

View File

@ -28,6 +28,8 @@ public class CustomerMainRespVO extends CustomerMain {
List<BusiLabel> labelList;
/**车辆品牌型号数组*/
List<String> brandAndModel;
/**会员名称 */
private String levelName;
/**是否车主0否1是*/
private String isOwner;

View File

@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -114,6 +116,15 @@ public class MemberLevelController {
Page<MemberLevelRespVO> page = new Page<>(pageNo, pageSize);
return success(levelService.queryListPage(pageReqVO,page));
}
/**
* 获取全部会员
*
**/
@GetMapping("/all")
@Operation(summary = "获得全部会员")
@PreAuthorize("@ss.hasPermission('member:level:query')")
public CommonResult<List<MemberLevel>> getLevelAll(MemberLevelPageReqVO pageReqVO) {
return success(levelService.queryListAll(pageReqVO));
}
}

View File

@ -61,5 +61,9 @@ public class ActiveMain extends TenantBaseDO {
private String isPack;
/**是否关联卡券*/
private String isCoupon;
/**
* 是否重复参与
*/
private String isParticipate;
}

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 会员等级 Service 接口
*
@ -54,4 +56,11 @@ public interface MemberLevelService extends IService<MemberLevel> {
**/
IPage<MemberLevelRespVO> queryListPage(MemberLevelPageReqVO pageReqVO, Page<MemberLevelRespVO> page);
/**
* 获取全部会员
*
**/
List<MemberLevel> queryListAll(MemberLevelPageReqVO pageReqVO);
}

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.member.service.MemberLevelService;
import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO;
import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO;
import cn.iocoder.yudao.module.member.vo.MemberLevelSaveReqVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
/**
* 会员等级 Service 实现类
@ -82,5 +84,14 @@ public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, Membe
return levelMapper.selectListPage(pageReqVO,page);
}
@Override
public List<MemberLevel> queryListAll(MemberLevelPageReqVO pageReqVO) {
QueryWrapper<MemberLevel> q = new QueryWrapper<>();
q.eq("status","01");
List<MemberLevel> memberLevels = this.levelMapper.selectList(q);
return memberLevels;
}
}

View File

@ -36,10 +36,12 @@
main.inviter AS inviter,
main.inviter_type AS inviterType,
main.status AS status,
group_concat(item.ser_content) AS serContents
group_concat(item.ser_content) AS serContents,
memberLevel.name AS levelName
FROM
base_customer_main main
LEFT JOIN base_customer_item item ON main.id = item.cus_id AND item.deleted = 0
LEFT JOIN dl_member_level memberLevel ON main.member_level_id = memberLevel.id
<where>
main.deleted = 0
<if test="entity.cusName != null and entity.cusName != ''">

View File

@ -212,6 +212,10 @@ public class SysLoginController {
AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO();
authLoginReqVO.setUsername(loginBody.getUsername());
authLoginReqVO.setPassword(loginBody.getPassword());
if(org.apache.commons.lang3.StringUtils.isEmpty(user.getMobile())){
// 借用此字段设置需要填写手机号标志 为1时弹出验证手机号页面
authLoginReqVO.setSocialState("1");
}
return success(loginService.login(authLoginReqVO));
}
@ -230,20 +234,16 @@ public class SysLoginController {
}
/**
* 汽修小程序注册方法
* 汽修小程序更新用户手机号方法
*
* @param registerVO 登录信息
* @return 结果
*/
@PostMapping("/registerQx")
@TenantIgnore
@PostMapping("/updateUserQx")
public CommonResult registerQx(@RequestBody RegisterVO registerVO){
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPhone())){
return error(500,"手机号不能为空");
}
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPassword())){
return error(500,"密码不能为空");
}
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getCode())){
return error(500,"验证码不能为空");
}
@ -253,12 +253,13 @@ public class SysLoginController {
}
redisCache2.deleteObject(registerVO.getPhone() + "-registerCode");
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
userSaveReqVO.setUsername(registerVO.getPhone());
userSaveReqVO.setPassword(passwordEncoder.encode(registerVO.getPassword()));
userSaveReqVO.setId(loginUser.getId());
userSaveReqVO.setMobile(registerVO.getPhone());
userService.createUser(userSaveReqVO);
return success("注册成功");
userService.updateUser(userSaveReqVO);
return success("成功");
}