| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> mapData = new ArrayList<>(); |
| | | map.put("children", mapList); |
| | | map.put("value", 0); |
| | | map.put("label", firstEnterpriseName); |
| | | map.put("id", 0); |
| | | map.put("department", firstEnterpriseName); |
| | | mapData.add(map); |
| | | return mapData; |
| | | } |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | # url: jdbc:mysql://192.168.110.209:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | # username: user |
| | | url: jdbc:mysql://localhost:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: root |
| | | url: jdbc:mysql://192.168.110.209:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: user |
| | | password: 123456 |
| | | druid: |
| | | # Druidæ°æ®æºé
ç½® |
| | |
| | | # redisæ°æ®åºç´¢å¼(é»è®¤ä¸º0)ï¼æä»¬ä½¿ç¨ç´¢å¼ä¸º3çæ°æ®åºï¼é¿å
åå
¶ä»æ°æ®åºå²çª |
| | | database: 0 |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | # host: 192.168.110.209 |
| | | host: localhost |
| | | host: 192.168.110.209 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6380 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.service.RoleService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-07 |
| | | */ |
| | | @Api(tags = "ç¨æ·æ¨¡å") |
| | | @RestController |
| | | @RequestMapping("/role") |
| | | public class RoleController { |
| | | |
| | | @Autowired |
| | | private RoleService roleService; |
| | | |
| | | @ApiOperation("æ°å¢ç¨æ·-->è·åç¨æ·æéå表") |
| | | @GetMapping("/list") |
| | | public Result<?> getUserRoleList(){ |
| | | //æ ¹æ®tokenè·åç¨æ·ä¿¡æ¯ |
| | | // Map<String,Object> data = roleService.getUserRoleList(); |
| | | // if (data != null){ |
| | | // return Result.success(data); |
| | | // } |
| | | return Result.fail(202,"ç¨æ·ç»å½ä¿¡æ¯æ æï¼è¯·éæ°ç»å½"); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.utils.SpringUtil; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NewPersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PagePersonnelVo; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import com.yuanchu.limslaboratory.pojo.vo.UpdatePersonnelVo; |
| | | import io.swagger.annotations.*; |
| | |
| | | @ApiImplicitParam(name = "status", value = "å¨èç¶æ", dataTypeClass = Integer.class) |
| | | }) |
| | | public Result<Map<String, Object>> getNewPersonnelPage(Integer pageNo, Integer pageSize, String name, Integer status) { |
| | | IPage<PagePersonnelVo> PageList = userService.getNewPersonnelPage(name, new Page<Objects>(pageNo, pageSize), status); |
| | | IPage<Map<String, Object>> PageList = userService.getNewPersonnelPage(name, new Page<Objects>(pageNo, pageSize), status); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", PageList.getRecords()); |
| | | map.put("total", PageList.getTotal()); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PagePersonnelVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public interface UserMapper extends BaseMapper<User> { |
| | | Map<String, String> selectUserByUserId(int userId); |
| | | |
| | | IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page, Integer status); |
| | | IPage<Map<String, Object>> getNewPersonnelPage(String name, Page page, Integer status); |
| | | |
| | | List<Map<String,Object>> selectUser(); |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NewPersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PagePersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.UpdatePersonnelVo; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page, Integer status); |
| | | IPage<Map<String, Object>> getNewPersonnelPage(String name, Page page, Integer status); |
| | | |
| | | /** |
| | | * ç»å½è·åç¨æ·åºæ¬ä¿¡æ¯ä¸ç³»ç»è¶
æ¶æ¶é´æé |
| | |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NewPersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PagePersonnelVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.UpdatePersonnelVo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page, Integer status) { |
| | | public IPage<Map<String, Object>> getNewPersonnelPage(String name, Page page, Integer status) { |
| | | MyUtil.PrintLog(name + status + "============="); |
| | | return userMapper.getNewPersonnelPage(name, page, status); |
| | | } |
| | |
| | | AND u.id = #{userId} |
| | | </select> |
| | | |
| | | <resultMap id="PagePersonnelVoMap" type="com.yuanchu.limslaboratory.pojo.vo.PagePersonnelVo"> |
| | | <result property="id" column="id"/> |
| | | <result property="username" column="username"/> |
| | | <result property="roleName" column="roleName"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="age" column="age"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="email" column="email"/> |
| | | <result property="jobState" column="job_state"/> |
| | | <result property="department" column="department"/> |
| | | </resultMap> |
| | | <select id="getNewPersonnelPage" resultMap="PagePersonnelVoMap"> |
| | | SELECT u.`id`, u.`name` username, r.`name` roleName, u.`create_time`, u.`age`, |
| | | u.`phone`, u.`email`, u.`job_state`, o.`department` |
| | | |
| | | <select id="getNewPersonnelPage" resultType="map"> |
| | | SELECT u.`id`, u.`name` username, r.`name` roleName, DATE_FORMAT(u.`create_time`, '%Y-%m-%d') createTime, u.`age`, |
| | | u.`phone`, u.`email`, u.`job_state` jobState, o.`department`, u.`account`, o.`id` departmentId |
| | | FROM `user` u |
| | | LEFT JOIN role r |
| | | ON u.`role_id` = r.`id` AND r.`state` = 1 |