1
This commit is contained in:
parent
cdd0e230c8
commit
2086924387
@ -26,10 +26,16 @@
|
|||||||
<artifactId>yudao-module-system-biz</artifactId>
|
<artifactId>yudao-module-system-biz</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
<artifactId>dl-module-inspection</artifactId>
|
||||||
|
<version>2.1.0-jdk8-snapshot</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
</properties>
|
</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.domain.WxLoginBody;
|
||||||
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
|
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
|
||||||
import cn.iocoder.yudao.module.rescue.utils.RescueSysLoginService;
|
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.util.WechatPayConfig;
|
||||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||||
@ -98,14 +103,14 @@ public class SysLoginController {
|
|||||||
@Resource
|
@Resource
|
||||||
private SecurityProperties securityProperties;
|
private SecurityProperties securityProperties;
|
||||||
|
|
||||||
// @Autowired
|
@Resource
|
||||||
// private IUserBalanceService balanceService;
|
private IUserBalanceService balanceService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private IShopMallPartnersService partnersService;
|
// private IShopMallPartnersService partnersService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private IPartnerWorkerService jcWorkerService;
|
// private IPartnerWorkerService jcWorkerService;
|
||||||
// @Autowired
|
@Resource
|
||||||
// private IShopConfigService configService;
|
private IShopConfigService configService;
|
||||||
@Resource
|
@Resource
|
||||||
private IDriverInfoService driverInfoService;
|
private IDriverInfoService driverInfoService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
@ -333,33 +338,61 @@ public class SysLoginController {
|
|||||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
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<>();
|
Map<String,Object> ajax = new HashMap<>();
|
||||||
ajax.put("user", user);
|
ajax.put("user", user);
|
||||||
ajax.put("role", roleList);
|
ajax.put("role", roleList);
|
||||||
// ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||||
// if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||||
// ajax.put("openRz", "0");
|
|
||||||
// }else {
|
|
||||||
ajax.put("openRz", "0");
|
ajax.put("openRz", "0");
|
||||||
// }
|
}else {
|
||||||
|
ajax.put("openRz", "0");
|
||||||
|
}
|
||||||
return CommonResult.success(ajax);
|
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用户信息
|
* 获取App用户信息
|
||||||
*
|
*
|
||||||
|
@ -101,4 +101,6 @@ public class UserSaveReqVO {
|
|||||||
|
|
||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
|
private Long balance;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user