Jelajahi Sumber

班表人员管理页面调整,bug修复

yejian016332 4 tahun lalu
induk
melakukan
94b8a353b5

+ 5 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/dao/AuthUserMapper.java

@@ -9,6 +9,9 @@ import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * Mapper 接口
@@ -25,4 +28,6 @@ public interface AuthUserMapper extends SuperMapper<AuthUser> {
      * 分页
      */
     IPage<AuthUser> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<AuthUser> queryWrapper);
+
+    List<Map> selectUserList(long orgId);
 }

+ 2 - 5
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/dao/ScheduleUserMapper.java

@@ -1,15 +1,12 @@
 package com.github.zuihou.business.classSchedule.dao;
 
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
 import com.github.zuihou.business.classSchedule.entity.ScheduleUser;
 
-import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -25,7 +22,7 @@ public interface ScheduleUserMapper extends SuperMapper<ScheduleUser> {
 
     List<ScheduleUser> pageList();
 
-    List<ScheduleUser> getScheduleUserList(ScheduleUser bean);
+    List<Map> getScheduleUserList(ScheduleUser bean);
 
     List<ScheduleUser> getScheduleUserChangeList();
 }

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/service/AuthUserService.java

@@ -5,6 +5,9 @@ import com.github.zuihou.base.service.SuperService;
 import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 业务接口
@@ -20,4 +23,9 @@ public interface AuthUserService extends SuperService<AuthUser> {
      * 分页
      */
     IPage<AuthUser> pageList(IPage page, LbqWrapper<AuthUser> wrapper);
+
+    /**
+     * 所有用户
+     */
+    List<Map> selectUserList(long orgId);
 }

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/service/ScheduleUserService.java

@@ -7,6 +7,7 @@ import com.github.zuihou.business.classSchedule.entity.ScheduleUser;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -21,7 +22,7 @@ public interface ScheduleUserService extends SuperService<ScheduleUser> {
 
     List<ScheduleUser> pageList();
 
-    List<ScheduleUser> getScheduleUserList(ScheduleUser bean);
+    List<Map> getScheduleUserList(ScheduleUser bean);
 
     /**
      * 保存

+ 11 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/service/impl/AuthUserServiceImpl.java

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.classSchedule.service.impl;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.business.classSchedule.dao.AuthUserMapper;
 import com.github.zuihou.business.classSchedule.entity.AuthUser;
@@ -9,8 +10,12 @@ import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.injection.annonation.InjectionResult;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 业务实现类
@@ -30,4 +35,10 @@ public class AuthUserServiceImpl extends SuperServiceImpl<AuthUserMapper, AuthUs
     public IPage<AuthUser> pageList(IPage page, LbqWrapper<AuthUser> wrapper) {
         return baseMapper.pageList(page, wrapper);
     }
+
+    @Override
+    @InjectionResult
+    public List<Map> selectUserList(long orgId) {
+        return baseMapper.selectUserList(orgId);
+    }
 }

+ 4 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/service/impl/ScheduleUserServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 import static com.github.zuihou.utils.BizAssert.isFalse;
@@ -34,11 +35,13 @@ import static com.github.zuihou.utils.BizAssert.isFalse;
 @Service
 public class ScheduleUserServiceImpl extends SuperServiceImpl<ScheduleUserMapper, ScheduleUser> implements ScheduleUserService {
 
+    @Override
     public List<ScheduleUser> pageList() {
         return baseMapper.pageList();
     }
 
-    public List<ScheduleUser> getScheduleUserList(ScheduleUser bean){
+    @Override
+    public List<Map> getScheduleUserList(ScheduleUser bean){
         return baseMapper.getScheduleUserList(bean);
     }
 

+ 7 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/classSchedule/AuthUserMapper.xml

@@ -11,7 +11,7 @@
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="account" jdbcType="VARCHAR" property="account"/>
         <result column="name" jdbcType="VARCHAR" property="name"/>
-        <result column="org_id" jdbcType="BIGINT" property="org"/>
+        <result column="org_id" jdbcType="BIGINT" property="orgId"/>
         <result column="station_id" jdbcType="BIGINT" property="station"/>
         <result column="readonly" jdbcType="BIT" property="readonly"/>
         <result column="email" jdbcType="VARCHAR" property="email"/>
@@ -36,7 +36,6 @@
         account, name, org_id, station_id, readonly, email, mobile, sex, status, avatar, nation, education, position_status, work_describe, password_error_last_time, password_error_num, password_expire_time, password, last_login_time
     </sql>
 
-
     <!-- 分页 -->
     <select id="pageList" resultType="com.github.zuihou.business.classSchedule.entity.AuthUser">
         SELECT a.id,a.id as userId,a.name,b.schedule_flag as scheduleFlag from c_auth_user a
@@ -44,4 +43,10 @@
          ${ew.customSqlSegment}
     </select>
 
+    <select id="selectUserList" parameterType="java.lang.Long" resultType="Map">
+        SELECT a.id as 'key',a.name as label from c_auth_user a
+        <if test="orgId != null">
+            and a.org_id = ${orgId, jdbcType=BIGINT}
+        </if>
+    </select>
 </mapper>

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/classSchedule/ScheduleUserMapper.xml

@@ -32,8 +32,8 @@
         where a.schedule_flag=1 and not exists (select * from imcs_s_schedule_user where schedule_flag =0 )
     </select>
 
-    <select id="getScheduleUserList" resultType="com.github.zuihou.business.classSchedule.entity.ScheduleUser">
-      select a.*,b.name from imcs_s_schedule_user a
+    <select id="getScheduleUserList" parameterType="com.github.zuihou.business.classSchedule.entity.ScheduleUser" resultType="java.util.Map">
+      select a.user_id as 'key' from imcs_s_schedule_user a
       left join c_auth_user b on a.user_id = b.id
         where 1=1
         <if test="scheduleFlag != null and scheduleFlag != ''">

+ 9 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/classSchedule/AuthUserController.java

@@ -2,6 +2,7 @@ package com.github.zuihou.business.controller.classSchedule;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import com.github.zuihou.business.classSchedule.dto.AuthUserSaveDTO;
@@ -21,6 +22,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import com.github.zuihou.security.annotation.PreAuth;
 import org.springframework.web.bind.annotation.RestController;
@@ -57,10 +59,16 @@ public class AuthUserController extends SuperController<AuthUserService, Long, A
         baseService.pageList(page, wrapper);
     }
 
-
     @ApiOperation(value = "所有人员", notes = "所有人员")
     @PostMapping("/getList")
     public R<List<AuthUser>> getList() {
         return success(baseService.list());
     }
+
+    @ApiOperation(value = "所有人员", notes = "所有人员")
+    @PostMapping("/selectUserList")
+    public R<List<AuthUser>> selectUserList(@RequestBody AuthUser authUser) {
+        List<AuthUser> useList = baseService.list(Wrappers.<AuthUser>lambdaQuery().eq(AuthUser::getOrgId, authUser.getOrgId()));
+        return success(useList);
+    }
 }

+ 1 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/classSchedule/ScheduleUserController.java

@@ -56,7 +56,7 @@ public class ScheduleUserController extends SuperController<ScheduleUserService,
 
     @ApiOperation(value = "已选择用户数据", notes = "已选择用户数据")
     @PostMapping("/getScheduleUserList")
-    public R<List<ScheduleUser>> getScheduleUserList(@ApiParam(name="排班人员",value="传入json格式",required = true)
+    public R<List<Map>> getScheduleUserList(@ApiParam(name="排班人员",value="传入json格式",required = true)
                                                          @RequestBody(required = true) ScheduleUser bean) {
         //return success(baseService.list(Wraps.<ScheduleUser>lbQ().eq(ScheduleUser::getScheduleFlag, bean.getScheduleFlag())));
         return success(baseService.getScheduleUserList(bean));

+ 15 - 4
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/classSchedule/entity/AuthUser.java

@@ -2,6 +2,8 @@ package com.github.zuihou.business.classSchedule.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
 import static com.github.zuihou.common.constant.InjectionFieldConstants.ORG_ID_CLASS;
 import static com.github.zuihou.common.constant.InjectionFieldConstants.STATION_ID_CLASS;
 import com.github.zuihou.injection.annonation.InjectionField;
@@ -130,7 +132,16 @@ public class AuthUser extends Entity<Long> {
     private String mobile;
 
     /**
-     * 状态 
+     * 性别
+     */
+    @ApiModelProperty(value = "性别")
+    @Length(max = 1, message = "性别长度不能超过1")
+    @TableField(value = "mobile", condition = EQUAL)
+    @Excel(name = "性别")
+    private String sex;
+
+    /**
+     * 状态
      * 1启用 0禁用
      */
     @ApiModelProperty(value = "状态")
@@ -150,7 +161,7 @@ public class AuthUser extends Entity<Long> {
     /**
      * 民族
      * @InjectionField(api = DICTIONARY_ITEM_CLASS, method = DICTIONARY_ITEM_METHOD, dictType = DictionaryType.NATION) RemoteData<String, String>
-     * 
+     *
      */
     @ApiModelProperty(value = "民族")
     @Length(max = 20, message = "民族长度不能超过20")
@@ -240,10 +251,10 @@ public class AuthUser extends Entity<Long> {
     private String scheduleFlag;
 
     @Builder
-    public AuthUser(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, 
+    public AuthUser(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime,
                     String account, String name, Long orgId, RemoteData<Long, String> stationId, Boolean readonly,
                     String email, String mobile,  Boolean status, String avatar, RemoteData<String, String> nation,
-                    RemoteData<String, String> education, RemoteData<String, String> positionStatus, String workDescribe, LocalDateTime passwordErrorLastTime, Integer passwordErrorNum, LocalDateTime passwordExpireTime, 
+                    RemoteData<String, String> education, RemoteData<String, String> positionStatus, String workDescribe, LocalDateTime passwordErrorLastTime, Integer passwordErrorNum, LocalDateTime passwordExpireTime,
                     String password, LocalDateTime lastLoginTime) {
         this.id = id;
         this.createUser = createUser;