Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -57,7 +57,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
|
||||
|
||||
// 获取验证码文本
|
||||
String code = captcha.text();
|
||||
String code = captcha.text().toLowerCase();
|
||||
|
||||
// 生成唯一的验证码 ID
|
||||
String captchaKey = IdUtil.randomUUID();
|
||||
@@ -70,10 +70,10 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
|
||||
@Override
|
||||
public LoginVO login(SysLoginDTO loginDTO) {
|
||||
// Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||
// if (!"666666".equals(loginDTO.code()) && code == null || !code.equals(loginDTO.code())) {
|
||||
// throw new ApiNotPrintException("验证码错误");
|
||||
// }
|
||||
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||
if (!"666666".equals(loginDTO.code()) && (code == null || !code.equals(loginDTO.code().toLowerCase()))) {
|
||||
throw new ApiNotPrintException("验证码错误");
|
||||
}
|
||||
|
||||
SysUser user;
|
||||
// 员工账号登录
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
}
|
||||
|
||||
// 添加系统账号
|
||||
shopInfoAddDTO.setRoleId(shopInfoAddDTO.getRoleId() == null ? 1L : shopInfoAddDTO.getRoleId());
|
||||
shopInfoAddDTO.setRoleId(shopInfoAddDTO.getRoleId() == null ? 2L : shopInfoAddDTO.getRoleId());
|
||||
SysUser sysUser = sysUserService.addUser(shopInfoAddDTO.getShopName(), shopInfoAddDTO.getAccountName(), shopInfoAddDTO.getAccountPwd(), shopInfoAddDTO.getPhone(), shopInfoAddDTO.getRoleId());
|
||||
|
||||
// 保存店铺信息
|
||||
|
||||
@@ -252,28 +252,34 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
userInfoService.updateById(userInfo);
|
||||
|
||||
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
||||
if (shopUser != null) {
|
||||
if (shopUser == null) {
|
||||
shopUser = new ShopUser();
|
||||
shopUser.setShopId(shopId);
|
||||
shopUser.setUserId(userId);
|
||||
save(shopUser);
|
||||
} else if (shopUser.getIsVip() == 1) {
|
||||
throw new ApiNotPrintException("您已加入店铺会员");
|
||||
}
|
||||
|
||||
shopUser = BeanUtil.copyProperties(shopUserAddDTO, ShopUser.class);
|
||||
BeanUtil.copyProperties(shopUserAddDTO, shopUser);
|
||||
shopUser.setIsVip(1);
|
||||
shopUser.setCode(generateCode(shopId));
|
||||
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
|
||||
shopUser.setShopId(shopId);
|
||||
shopUser.setUserId(userId);
|
||||
return save(shopUser);
|
||||
shopUser.setUserId(null);
|
||||
shopUser.setShopId(null);
|
||||
|
||||
return updateById(shopUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopUserDetailDTO getInfo(Long shopId, long userId) {
|
||||
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
||||
UserInfo userInfo = userInfoService.getById(userId);
|
||||
if (userInfo == null) {
|
||||
throw new ApiNotPrintException("用户信息不存在");
|
||||
}
|
||||
|
||||
long couponNum = 0;
|
||||
if (shopUser == null) {
|
||||
UserInfo userInfo = userInfoService.getById(userId);
|
||||
if (userInfo == null) {
|
||||
throw new ApiNotPrintException("用户信息不存在");
|
||||
}
|
||||
shopUser = BeanUtil.copyProperties(userInfo, ShopUser.class);
|
||||
shopUser.setShopId(shopId);
|
||||
shopUser.setId(null);
|
||||
@@ -294,6 +300,8 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
List<ShopExtend> shopExtends = shopExtendService.list(new QueryWrapper().eq(ShopExtend::getShopId, shopInfo.getId()));
|
||||
shopUserDetailDTO.setShopExtendList(shopExtends);
|
||||
}
|
||||
|
||||
shopUserDetailDTO.setPayPwd(userInfo.getPayPwd());
|
||||
return shopUserDetailDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysRole> getList(PageDTO pageDTO, String key, String startTime, String endTime) {
|
||||
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
if (!StpKit.USER.isAdmin()) {
|
||||
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
|
||||
|
||||
@@ -608,6 +608,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
if (payOrderId != null) {
|
||||
updateChain.set(OrderInfo::getPayOrderId, payOrderId);
|
||||
}
|
||||
if (orderInfo.getCreditBuyerId() != null) {
|
||||
updateChain.set(OrderInfo::getCreditBuyerId, orderInfo.getCreditBuyerId());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(payType)) {
|
||||
updateChain.set(OrderInfo::getPayType, payType.getValue());
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class PayServiceImpl implements PayService {
|
||||
@Override
|
||||
@Transactional(noRollbackFor = PaySuccessException.class)
|
||||
public CzgResult<Object> creditPayOrder(OrderPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getCreditBuyerId(), "挂账人不可为空");
|
||||
AssertUtil.isNull(payParam.getCreditBuyerId(), "请选择挂账人后支付");
|
||||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||
orderInfo.setCreditBuyerId(payParam.getCreditBuyerId());
|
||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||
|
||||
Reference in New Issue
Block a user