1
This commit is contained in:
parent
cdd0e230c8
commit
2086924387
@ -26,10 +26,16 @@
|
||||
<artifactId>yudao-module-system-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>dl-module-inspection</artifactId>
|
||||
<version>2.1.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -15,6 +15,11 @@ import cn.iocoder.yudao.module.rescue.domain.LoginBody;
|
||||
import cn.iocoder.yudao.module.rescue.domain.WxLoginBody;
|
||||
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.RescueSysLoginService;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopConfig;
|
||||
import cn.iocoder.yudao.module.shop.entity.UserBalance;
|
||||
import cn.iocoder.yudao.module.shop.service.IShopConfigService;
|
||||
import cn.iocoder.yudao.module.shop.service.IUserBalanceService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.util.WechatPayConfig;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
@ -98,14 +103,14 @@ public class SysLoginController {
|
||||
@Resource
|
||||
private SecurityProperties securityProperties;
|
||||
|
||||
// @Autowired
|
||||
// private IUserBalanceService balanceService;
|
||||
@Resource
|
||||
private IUserBalanceService balanceService;
|
||||
// @Autowired
|
||||
// private IShopMallPartnersService partnersService;
|
||||
// @Autowired
|
||||
// private IPartnerWorkerService jcWorkerService;
|
||||
// @Autowired
|
||||
// private IShopConfigService configService;
|
||||
@Resource
|
||||
private IShopConfigService configService;
|
||||
@Resource
|
||||
private IDriverInfoService driverInfoService;
|
||||
// @Autowired
|
||||
@ -333,33 +338,61 @@ public class SysLoginController {
|
||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
||||
// 角色集合
|
||||
// Set<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toSet());
|
||||
// UserBalance userBalance = balanceService.selectShopUserBalanceByUserId(NamedObject.user.getUserId());
|
||||
// if (ObjectUtil.isNotEmpty(userBalance)) {
|
||||
// sysUser.setBalance(userBalance.getBalance());
|
||||
// } else {
|
||||
// //新增用户积分表信息
|
||||
// userBalance=new UserBalance();
|
||||
// userBalance.setUserId(NamedObject.user.getUserId());
|
||||
// userBalance.setAllBalance(0L);
|
||||
// userBalance.setBalance(0L);
|
||||
// userBalance.setFrozenBalance(0L);
|
||||
// balanceService.insertShopUserBalance(userBalance);
|
||||
// sysUser.setBalance(0L);
|
||||
// }
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("user", user);
|
||||
ajax.put("role", roleList);
|
||||
// ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
// if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
// ajax.put("openRz", "0");
|
||||
// }else {
|
||||
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
ajax.put("openRz", "0");
|
||||
// }
|
||||
}else {
|
||||
ajax.put("openRz", "0");
|
||||
}
|
||||
return CommonResult.success(ajax);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取App用户信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("/getJcAppInfo")
|
||||
@TenantIgnore
|
||||
public CommonResult getJcAppInfo()
|
||||
{
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
||||
// 角色集合
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
UserBalance userBalance = balanceService.selectShopUserBalanceByUserId(loginUser.getId());
|
||||
if (ObjectUtil.isNotEmpty(userBalance)) {
|
||||
userSaveReqVO.setBalance(userBalance.getBalance());
|
||||
} else {
|
||||
//新增用户积分表信息
|
||||
userBalance=new UserBalance();
|
||||
userBalance.setUserId(loginUser.getId());
|
||||
userBalance.setAllBalance(0L);
|
||||
userBalance.setBalance(0L);
|
||||
userBalance.setFrozenBalance(0L);
|
||||
balanceService.insertShopUserBalance(userBalance);
|
||||
userSaveReqVO.setBalance(0L);
|
||||
}
|
||||
userService.updateUser(userSaveReqVO);
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("user", user);
|
||||
ajax.put("role", roleList);
|
||||
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
ajax.put("openRz", "0");
|
||||
}else {
|
||||
ajax.put("openRz", "0");
|
||||
}
|
||||
return CommonResult.success(ajax);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取App用户信息
|
||||
*
|
||||
|
@ -101,4 +101,6 @@ public class UserSaveReqVO {
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Long balance;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user