Browse Source

添加资产编号

5 years ago
parent
commit
4742fe8e83

+ 0 - 1
pcbms/src/main/java/com/hssx/pcbms/controller/UserController.java

@@ -73,7 +73,6 @@ public class UserController {
     /**
     /**
      * 用户列表
      * 用户列表
      * 参数:deptId 部门id ,
      * 参数:deptId 部门id ,
-     *      pageNum:当前页,pageSize:每页多少条
      * @return
      * @return
      */
      */
     @ApiOperation(value = "用户列表", notes = "用户列表方法")
     @ApiOperation(value = "用户列表", notes = "用户列表方法")

+ 3 - 3
pcbms/src/main/java/com/hssx/pcbms/entity/User.java

@@ -47,7 +47,7 @@ public class User extends Model<User> {
      * 部门id
      * 部门id
      */
      */
     @TableField("dept_id")
     @TableField("dept_id")
-    private Integer deptId;
+    private String deptId;
 
 
     /**
     /**
      * 审核是否通过 0-未通过 1-通过
      * 审核是否通过 0-未通过 1-通过
@@ -160,11 +160,11 @@ public class User extends Model<User> {
         this.phone = phone;
         this.phone = phone;
     }
     }
 
 
-    public Integer getDeptId() {
+    public String getDeptId() {
         return deptId;
         return deptId;
     }
     }
 
 
-    public void setDeptId(Integer deptId) {
+    public void setDeptId(String deptId) {
         this.deptId = deptId;
         this.deptId = deptId;
     }
     }
 
 

+ 17 - 0
pcbms/src/main/java/com/hssx/pcbms/entity/vo/DepartmentVO.java

@@ -0,0 +1,17 @@
+package com.hssx.pcbms.entity.vo;
+
+import com.hssx.pcbms.entity.Department;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 11 - 06 9:55
+ * Description:<描述>
+ * Version: 1.0
+ */
+@Data
+public class DepartmentVO extends Department {
+    private List<UserVO> userVOS;
+}

+ 3 - 0
pcbms/src/main/java/com/hssx/pcbms/mapper/UserMapper.java

@@ -2,6 +2,7 @@ package com.hssx.pcbms.mapper;
 
 
 import com.hssx.pcbms.entity.User;
 import com.hssx.pcbms.entity.User;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hssx.pcbms.entity.vo.DepartmentVO;
 import com.hssx.pcbms.entity.vo.UserVO;
 import com.hssx.pcbms.entity.vo.UserVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -20,4 +21,6 @@ public interface UserMapper extends BaseMapper<User> {
     UserVO selectUserRolesAndPermisssuons(@Param("user") User systemUser);
     UserVO selectUserRolesAndPermisssuons(@Param("user") User systemUser);
 
 
     List<UserVO> selectListByCondition(@Param("userVO") UserVO userVO);
     List<UserVO> selectListByCondition(@Param("userVO") UserVO userVO);
+
+    List<DepartmentVO> selectDeptUserListByCondition(UserVO userVO);
 }
 }

+ 5 - 4
pcbms/src/main/java/com/hssx/pcbms/service/impl/UserServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import com.hssx.pcbms.entity.*;
 import com.hssx.pcbms.entity.*;
+import com.hssx.pcbms.entity.vo.DepartmentVO;
 import com.hssx.pcbms.entity.vo.UserVO;
 import com.hssx.pcbms.entity.vo.UserVO;
 import com.hssx.pcbms.mapper.*;
 import com.hssx.pcbms.mapper.*;
 import com.hssx.pcbms.service.UserService;
 import com.hssx.pcbms.service.UserService;
@@ -105,10 +106,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Override
     @Override
     public HttpRespMsg getList(UserVO userVO,PageUtil page) {
     public HttpRespMsg getList(UserVO userVO,PageUtil page) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
-        PageHelper.startPage(page.getPageNum(),page.getPageSize());
-        List<UserVO> list = userMapper.selectListByCondition(userVO);
-        PageInfo<UserVO> info = new PageInfo<>(list);
-        msg.data = info;
+//        PageHelper.startPage(page.getPageNum(),page.getPageSize());
+        List<DepartmentVO> list = userMapper.selectDeptUserListByCondition(userVO);
+//        PageInfo<UserVO> info = new PageInfo<>(list);
+        msg.data = list;
         return msg;
         return msg;
     }
     }
 
 

+ 1 - 1
pcbms/src/main/java/com/hssx/pcbms/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("user");
+        strategy.setInclude("department");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);
         strategy.setControllerMappingHyphenStyle(true);

+ 3 - 0
pcbms/src/main/java/com/hssx/pcbms/util/ExcelUtil.java

@@ -130,6 +130,9 @@ public class ExcelUtil {
                     start++;
                     start++;
                 }
                 }
             }
             }
+            String headStr = "attachment; filename=\"" + fileName + "\"";
+            response.setContentType("APPLICATION/OCTET-STREAM");//返回格式为流
+            response.setHeader("Content-Disposition", headStr);
             OutputStream os = response.getOutputStream();//在线下载
             OutputStream os = response.getOutputStream();//在线下载
             File dir = null;
             File dir = null;
             dir = new File(downloadPath);
             dir = new File(downloadPath);

+ 10 - 1
pcbms/src/main/resources/mapper/UserMapper.xml

@@ -32,6 +32,12 @@
         <association property="score" resultMap="BaseResultMapScore">
         <association property="score" resultMap="BaseResultMapScore">
         </association>
         </association>
     </resultMap>
     </resultMap>
+    <resultMap id="BaseResultMapDeptVO" type="com.hssx.pcbms.entity.vo.DepartmentVO">
+        <result column="department_guid" property="departmentGuid" />
+        <result column="department_name" property="departmentName" />
+        <association property="score" resultMap="BaseResultMapScore">
+        </association>
+    </resultMap>
 
 
     <resultMap id="BaseResultMapScore" type="com.hssx.pcbms.entity.Score">
     <resultMap id="BaseResultMapScore" type="com.hssx.pcbms.entity.Score">
         <id column="score_id" property="scoreId" />
         <id column="score_id" property="scoreId" />
@@ -53,7 +59,10 @@
         SELECT
         SELECT
             u.id,  u.name, u.phone, u.dept_id,sr.rolename role_name,(SELECT total FROM score  WHERE uid = u.id AND scoring_year_month = DATE_FORMAT(NOW(),'%Y-%m')) total
             u.id,  u.name, u.phone, u.dept_id,sr.rolename role_name,(SELECT total FROM score  WHERE uid = u.id AND scoring_year_month = DATE_FORMAT(NOW(),'%Y-%m')) total
         FROM
         FROM
-            USER u
+        department dt
+        left join
+        USER u
+        ON u.dept_id = dt.department_guid
         LEFT JOIN user_role ur
         LEFT JOIN user_role ur
         ON u.id = ur.user_id
         ON u.id = ur.user_id
         LEFT JOIN sys_role sr
         LEFT JOIN sys_role sr