Browse Source

更新账号管理

liu 1 year ago
parent
commit
0cc885aed6

+ 1 - 1
src/main/java/com/template/api/WelcomeAccountControllerAPI.java

@@ -28,5 +28,5 @@ public interface WelcomeAccountControllerAPI {
 
     @GetMapping(value = "/listAccount")
     @ApiOperation(value = "查询账号", notes = "查询账号", httpMethod = "GET")
-    CommonResult listAccount(@RequestParam int currentPage, @RequestParam int pageCount);
+    CommonResult listAccount(@RequestParam int currentPage, @RequestParam int pageCount,Integer status,String keyWord,String startTime,String endTime);
 }

+ 5 - 0
src/main/java/com/template/api/WelcomeRoleControllerAPI.java

@@ -27,4 +27,9 @@ public interface WelcomeRoleControllerAPI {
     @GetMapping(value = "/listRole")
     @ApiOperation(value = "查询角色", notes = "查询角色", httpMethod = "GET")
     CommonResult listRole(@RequestParam int currentPage, @RequestParam int pageCount,String keyWord,String startTime,String endTime);
+
+    @GetMapping(value = "/roleGroup")
+    @ApiOperation(value = "角色分组", notes = "角色分组", httpMethod = "GET")
+    CommonResult roleGroup();
+
 }

+ 2 - 2
src/main/java/com/template/controller/WelcomeAccountController.java

@@ -87,8 +87,8 @@ public class WelcomeAccountController implements WelcomeAccountControllerAPI {
     }
 
     @Override
-    public CommonResult listAccount(int currentPage, int pageCount) {
-        PageUtils<WelcomeAccountVo> pageUtils= welcomeAccountService.listAccount(currentPage,pageCount);
+    public CommonResult listAccount(int currentPage, int pageCount,Integer status,String keyWord,String startTime,String endTime) {
+        PageUtils<WelcomeAccountVo> pageUtils= welcomeAccountService.listAccount(currentPage,pageCount,status,keyWord,startTime,endTime);
         List<WelcomeAccountVo> list = pageUtils.getList();
         for (WelcomeAccountVo record : list) {
             String collegeId = record.getCollegeId();

+ 6 - 0
src/main/java/com/template/controller/WelcomeRoleController.java

@@ -84,5 +84,11 @@ public class WelcomeRoleController implements WelcomeRoleControllerAPI {
         PageUtils<WelcomeRole> pageUtils= welcomeRoleService.listRole(currentPage,pageCount,keyWord,startTime,endTime);
         return CommonResult.ok(pageUtils);
     }
+
+    @Override
+    public CommonResult roleGroup() {
+        List<WelcomeRole> welcomeRoles=welcomeRoleService.roleGroup();
+        return CommonResult.ok(welcomeRoles);
+    }
 }
 

+ 2 - 1
src/main/java/com/template/mapper/WelcomeAccountMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.WelcomeAccount;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.template.model.vo.WelcomeAccountVo;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -18,5 +19,5 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface WelcomeAccountMapper extends BaseMapper<WelcomeAccount> {
 
-    IPage<WelcomeAccountVo> listAccount(Page<WelcomeAccountVo> page);
+    IPage<WelcomeAccountVo> listAccount(Page<WelcomeAccountVo> page, @Param("status") Integer status,@Param("keyWord") String keyWord,@Param("startTime") String startTime,@Param("endTime") String endTime);
 }

+ 7 - 1
src/main/java/com/template/model/pojo/WelcomeAccount.java

@@ -34,7 +34,7 @@ public class WelcomeAccount implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
-    @ApiModelProperty(value = "名称")
+    @ApiModelProperty(value = "真实名称")
     private String name;
 
     @ApiModelProperty(value = "账号")
@@ -49,6 +49,12 @@ public class WelcomeAccount implements Serializable {
     @ApiModelProperty(value = "学院id")
     private String collegeId;
 
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "状态 0:冻结 ,1正常")
+    private Integer status;
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;

+ 6 - 0
src/main/java/com/template/model/vo/WelcomeAccountVo.java

@@ -34,4 +34,10 @@ public class WelcomeAccountVo {
 
     @ApiModelProperty(value = "学院名称")
     private List<WelcomeOrg> welcomeOrgList;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "状态 0:冻结 ,1正常")
+    private Integer status;
 }

+ 1 - 1
src/main/java/com/template/services/WelcomeAccountService.java

@@ -28,6 +28,6 @@ public interface WelcomeAccountService extends IService<WelcomeAccount> {
     WelcomeAccount getDataByAccount(String account);
 
 
-    PageUtils<WelcomeAccountVo> listAccount(int currentPage, int pageCount);
+    PageUtils<WelcomeAccountVo> listAccount(int currentPage, int pageCount,Integer status,String keyWord,String startTime,String endTime);
 
 }

+ 4 - 0
src/main/java/com/template/services/WelcomeRoleService.java

@@ -4,6 +4,8 @@ import com.template.model.pojo.WelcomeRole;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -15,4 +17,6 @@ import com.template.model.result.PageUtils;
 public interface WelcomeRoleService extends IService<WelcomeRole> {
 
     PageUtils<WelcomeRole> listRole(int currentPage, int pageCount,String keyWord,String startTime ,String endTime);
+
+    List<WelcomeRole> roleGroup();
 }

+ 2 - 2
src/main/java/com/template/services/impl/WelcomeAccountServiceImpl.java

@@ -79,9 +79,9 @@ public class WelcomeAccountServiceImpl extends ServiceImpl<WelcomeAccountMapper,
     }
 
     @Override
-    public PageUtils<WelcomeAccountVo> listAccount(int currentPage, int pageCount) {
+    public PageUtils<WelcomeAccountVo> listAccount(int currentPage, int pageCount,Integer status,String keyWord,String startTime,String endTime) {
         Page<WelcomeAccountVo> page = new Page<>(currentPage, pageCount);
-        IPage<WelcomeAccountVo> result = welcomeAccountMapper.listAccount(page);
+        IPage<WelcomeAccountVo> result = welcomeAccountMapper.listAccount(page,status,keyWord,startTime,endTime);
         return new PageUtils<>(result);
     }
 

+ 11 - 1
src/main/java/com/template/services/impl/WelcomeRoleServiceImpl.java

@@ -15,6 +15,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -32,9 +34,17 @@ public class WelcomeRoleServiceImpl extends ServiceImpl<WelcomeRoleMapper, Welco
     @Override
     public PageUtils<WelcomeRole> listRole(int currentPage, int pageCount,String keyWord,String startTime ,String endTime) {
         LambdaQueryWrapper<WelcomeRole> wrapper=new LambdaQueryWrapper<>();
-        wrapper.eq(ObjectUtils.isNotEmpty(keyWord),WelcomeRole::getRoleName,keyWord)
+        wrapper.like(ObjectUtils.isNotEmpty(keyWord),WelcomeRole::getRoleName,keyWord)
                 .between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),WelcomeRole::getCreateTime,startTime,endTime);
         IPage<WelcomeRole> result = welcomeRoleMapper.selectPage(new Page<>(currentPage, pageCount), wrapper);
         return new PageUtils<>(result);
     }
+
+    @Override
+    public List<WelcomeRole> roleGroup() {
+        LambdaQueryWrapper<WelcomeRole> wrapper=new LambdaQueryWrapper<>();
+        wrapper.select(WelcomeRole::getId,WelcomeRole::getRoleName);
+        List<WelcomeRole> welcomeRoles = welcomeRoleMapper.selectList(wrapper);
+        return welcomeRoles;
+    }
 }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -16,7 +16,7 @@ spring:
   datasource:
     username: root
     password: Chuanghai2024.
-    url: jdbc:mysql://172.16.40.122:3306/welcome?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://172.16.40.126:3306/welcome?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
     driver-class-name: com.mysql.cj.jdbc.Driver
     cache:
       type: redis

+ 1 - 1
src/main/resources/application-prod.yml

@@ -16,7 +16,7 @@ spring:
   datasource:
     username: root
     password: Chuanghai2024.
-    url: jdbc:mysql://172.16.40.122:3306/welcome?characterEncoding=UTF-8&useSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://172.16.40.126:3306/welcome?characterEncoding=UTF-8&useSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     driver-class-name: com.mysql.cj.jdbc.Driver
     cache:
       type: redis

+ 1 - 1
src/main/resources/application.yml

@@ -18,7 +18,7 @@ spring:
   datasource:
     username: root
     password: Chuanghai2024.
-    url: jdbc:mysql://172.16.40.122:3306/welcome?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://172.16.40.126:3306/welcome?useUnicode=tru&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
     driver-class-name: com.mysql.cj.jdbc.Driver
     cache:
       type: redis

+ 9 - 0
src/main/resources/mapper/template/WelcomeAccountMapper.xml

@@ -12,6 +12,15 @@
                 AND wr.deleted = 0
         WHERE
             wa.deleted = 0
+        <if test="status != null and status != ''">
+            and wa.status= #{status}
+        </if>
+        <if test="keyWord != null and keyWord != ''">
+            and wa.name like '%' #{keyWord} '%'
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
+            and wa.create_time >= #{startTime} and #{endTime} >= wa.create_time
+        </if>
         ORDER BY
             wa.create_time
     </select>