| @@ -72,7 +72,7 @@ public class HomeController { | |||||
| if(page.getSize()>0) { | if(page.getSize()>0) { | ||||
| Long roleId = page.getList().get(0).getRoleId(); | Long roleId = page.getList().get(0).getRoleId(); | ||||
| MallRolePermission p = new MallRolePermission(); | MallRolePermission p = new MallRolePermission(); | ||||
| p.setRoleId(p.getRoleId()); | |||||
| p.setRoleId(roleId); | |||||
| p.setTenantId(info.getTenantId()); | p.setTenantId(info.getTenantId()); | ||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | ||||
| String menus = ""; | String menus = ""; | ||||
| @@ -14,8 +14,10 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.MallRole; | |||||
| import com.simple.domain.po.MallUserInfo; | import com.simple.domain.po.MallUserInfo; | ||||
| import com.simple.domain.po.MallUserRole; | import com.simple.domain.po.MallUserRole; | ||||
| import com.simple.service.MallRoleService; | |||||
| import com.simple.service.MallUserInfoService; | import com.simple.service.MallUserInfoService; | ||||
| import com.simple.service.MallUserRoleService; | import com.simple.service.MallUserRoleService; | ||||
| import com.simple.shiro.PasswordHelper; | import com.simple.shiro.PasswordHelper; | ||||
| @@ -38,6 +40,9 @@ public class MallUserInfoController { | |||||
| @Autowired | @Autowired | ||||
| MallUserRoleService userRoleService; | MallUserRoleService userRoleService; | ||||
| @Autowired | |||||
| MallRoleService mallRoleService; | |||||
| @ApiOperation(value = "用户分页接口", response = String.class) | @ApiOperation(value = "用户分页接口", response = String.class) | ||||
| @GetMapping("lists") | @GetMapping("lists") | ||||
| @@ -48,11 +53,11 @@ public class MallUserInfoController { | |||||
| r.setUid(u.getId()); | r.setUid(u.getId()); | ||||
| PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | ||||
| if(ur.getSize()>0) { | if(ur.getSize()>0) { | ||||
| u.setRoleId(ur.getList().get(0).getRoleId()); | |||||
| MallRole role = mallRoleService.getById(ur.getList().get(0).getRoleId()); | |||||
| u.setRoleName(role.getName()); | |||||
| } | } | ||||
| u.setPassword(null);//不返回密码 | u.setPassword(null);//不返回密码 | ||||
| } | } | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -226,8 +226,10 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| @ApiOperation("查询会员年龄结构") | @ApiOperation("查询会员年龄结构") | ||||
| @GetMapping("/findUserAgeStructure") | @GetMapping("/findUserAgeStructure") | ||||
| public ResultData findUserAgeStructure() { | public ResultData findUserAgeStructure() { | ||||
| Calendar c = Calendar.getInstance(); | |||||
| long all =wxCUserBasicInfoService.findCountByAge(new WxCuerBasicInfoDto()); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| for(EnumAgeInfo a:EnumAgeInfo.values()) { | for(EnumAgeInfo a:EnumAgeInfo.values()) { | ||||
| c.clear(); | c.clear(); | ||||
| c.setTime(new Date()); | c.setTime(new Date()); | ||||
| @@ -235,6 +237,7 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| c.set(Calendar.MINUTE,0); | c.set(Calendar.MINUTE,0); | ||||
| c.set(Calendar.SECOND,0); | c.set(Calendar.SECOND,0); | ||||
| long count = getCountByAge(a, c); | long count = getCountByAge(a, c); | ||||
| vos.add(getVo(count, all, a.getDesc())); | |||||
| } | } | ||||
| @@ -65,8 +65,14 @@ public class MallUserInfo implements Serializable { | |||||
| /*0 不是超管 1是超管**/ | /*0 不是超管 1是超管**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | ||||
| private Integer isAdmin; | private Integer isAdmin; | ||||
| @io.swagger.annotations.ApiModelProperty(value="昵称",name="nickName") | |||||
| private String nickName; | |||||
| @Transient | @Transient | ||||
| private Long roleId; | private Long roleId; | ||||
| @Transient | |||||
| private String roleName; | |||||
| //该用户所有的角色 | //该用户所有的角色 | ||||
| @Transient | @Transient | ||||
| private List<MallRole> role; | private List<MallRole> role; | ||||
| @@ -85,12 +91,12 @@ public class MallUserInfo implements Serializable { | |||||
| this.menus = menus; | this.menus = menus; | ||||
| } | } | ||||
| public Long getRoleId() { | |||||
| return roleId; | |||||
| public String getRoleName() { | |||||
| return roleName; | |||||
| } | } | ||||
| public void setRoleId(Long roleId) { | |||||
| this.roleId = roleId; | |||||
| public void setRoleName(String roleName) { | |||||
| this.roleName = roleName; | |||||
| } | } | ||||
| public String getTenantId() { | public String getTenantId() { | ||||
| @@ -157,6 +163,24 @@ public class MallUserInfo implements Serializable { | |||||
| this.permission = permission; | this.permission = permission; | ||||
| } | } | ||||
| public String getNickName() { | |||||
| return nickName; | |||||
| } | |||||
| public void setNickName(String nickName) { | |||||
| this.nickName = nickName; | |||||
| } | |||||
| public Long getRoleId() { | |||||
| return roleId; | |||||
| } | |||||
| public void setRoleId(Long roleId) { | |||||
| this.roleId = roleId; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| @@ -14,7 +14,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin` | |||||
| `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -33,6 +33,11 @@ | |||||
| <if test=" null != username "> | <if test=" null != username "> | ||||
| and `username` like concat('%', #{username},'%') | and `username` like concat('%', #{username},'%') | ||||
| </if> | |||||
| <if test=" null != nick_name "> | |||||
| and `nick_name` like concat('%', #{nickName},'%') | |||||
| </if> | </if> | ||||
| <if test=" null != name "> | <if test=" null != name "> | ||||
| @@ -64,6 +69,7 @@ | |||||
| and `is_admin` = #{isAdmin} | and `is_admin` = #{isAdmin} | ||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||