parent
7d699304f2
commit
4c8c065dd4
39 changed files with 1013 additions and 93 deletions
@ -0,0 +1,22 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
@Api(value = "个人档案管理",tags = "个人档案管理") |
||||
public interface PersonalFileControllerApi { |
||||
|
||||
@ApiOperation(value = "用户的全部档案",notes = "用户的全部档案") |
||||
R list(Integer userid); |
||||
|
||||
@ApiOperation(value = "添加用户个人档案",notes = "添加用户个人档案") |
||||
R save(PersonalFileEntity personalFileEntity); |
||||
|
||||
@ApiOperation(value = "修改用户个人档案",notes = "修改用户个人档案") |
||||
R update(PersonalFileEntity personalFileEntity); |
||||
|
||||
@ApiOperation(value = "删除用户个人档案",notes = "删除用户个人档案") |
||||
R delete(Long[] ids); |
||||
} |
@ -0,0 +1,12 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
@Api(value = "用户_实验学习",tags = "用户_实验学习") |
||||
public interface ProjectControllerApi { |
||||
|
||||
@ApiOperation(value = "用户_实验学习实验项目",notes = "用户_实验学习实验项目") |
||||
R list(Integer userid); |
||||
} |
@ -0,0 +1,31 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.ProjectRecordEntity; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
@Api(value = "实验报告",tags = "实验报告") |
||||
public interface ProjectRcordControllerApi { |
||||
|
||||
@ApiOperation(value = "服务端实验报告",notes = "服务端实验报告") |
||||
R list( Integer page, Integer size,Integer month,String startTime,String endTime, |
||||
Integer recordState,String condition); |
||||
|
||||
@ApiOperation(value = "用户端实验记录",notes = "用户端实验记录") |
||||
R queryUserRecord(Integer page,Integer size,Integer userid); |
||||
|
||||
@ApiOperation(value = "个人实验概览",notes = "个人实验概览") |
||||
R getUserScore(Integer userid); |
||||
|
||||
@ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出") |
||||
void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception; |
||||
|
||||
@ApiOperation(value = "修改实验报告分数",notes = "修改实验报告分数") |
||||
R update(ProjectRecordEntity projectRecord); |
||||
|
||||
@ApiOperation(value = "删除实验报告",notes = "删除实验报告") |
||||
R delete(Integer[] recordids); |
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.UserEntity; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
@Api(value = "用户个人中心",tags = "用户个人中心信息展示,信息修改") |
||||
public interface UserControllerApi { |
||||
|
||||
@ApiOperation(value = "个人中心信息展示",notes = "个人中心信息展示") |
||||
R userInfo(Integer id); |
||||
|
||||
@ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") |
||||
R update(UserEntity userEntity); |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.msdw.tms.common.utils.date; |
||||
|
||||
import java.time.Instant; |
||||
import java.time.LocalDateTime; |
||||
import java.time.ZoneId; |
||||
import java.time.format.DateTimeFormatter; |
||||
import java.util.Date; |
||||
|
||||
public class DateUtils { |
||||
|
||||
public static String handleTime(Date date) { |
||||
Instant instant = date.toInstant(); |
||||
ZoneId zoneId = ZoneId.systemDefault(); |
||||
LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime(); |
||||
return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); // 当前日期和时间
|
||||
} |
||||
} |
@ -0,0 +1,73 @@ |
||||
package com.msdw.tms.controller; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import com.msdw.tms.entity.vo.PersonalFileVo; |
||||
import com.msdw.tms.service.PersonalFileService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
@RestController |
||||
@RequestMapping("tms/personalFile") |
||||
public class PersonalFileController { |
||||
|
||||
@Autowired |
||||
private PersonalFileService personalFileService; |
||||
|
||||
|
||||
/** |
||||
* 列表 |
||||
*/ |
||||
@GetMapping("/list/{userId}") |
||||
public R list(@PathVariable("userId") Integer userid){ |
||||
List<PersonalFileVo> personalFileVos = personalFileService.queryPage(userid); |
||||
|
||||
return R.ok().put("data", personalFileVos); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 信息 |
||||
*/ |
||||
@GetMapping("/info/{id}") |
||||
public R info(@PathVariable("id") Long id){ |
||||
PersonalFileEntity personalFileEntity = personalFileService.getById(id); |
||||
|
||||
return R.ok().put("growthChangeHistory", personalFileEntity); |
||||
} |
||||
|
||||
/** |
||||
* 保存 |
||||
*/ |
||||
@PostMapping("/save") |
||||
public R save(@RequestBody PersonalFileEntity personalFileEntity){ |
||||
personalFileService.save(personalFileEntity); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody PersonalFileEntity personalFileEntity){ |
||||
personalFileService.updateById(personalFileEntity); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@DeleteMapping("/delete") |
||||
public R delete(@RequestBody Long[] ids){ |
||||
personalFileService.removeByIds(Arrays.asList(ids)); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,81 @@ |
||||
package com.msdw.tms.controller; |
||||
|
||||
import com.msdw.tms.api.UserControllerApi; |
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.entity.UserEntity; |
||||
import com.msdw.tms.entity.vo.UserEntityVo; |
||||
import com.msdw.tms.service.UserService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.Map; |
||||
|
||||
@RestController |
||||
@RequestMapping("tms/user") |
||||
public class UserController implements UserControllerApi { |
||||
|
||||
@Autowired |
||||
private UserService userService; |
||||
|
||||
/** |
||||
* 列表 |
||||
*/ |
||||
@GetMapping("/list") |
||||
public R list(@RequestParam Map<String, Object> params){ |
||||
PageUtils page = userService.queryPage(params); |
||||
|
||||
return R.ok().put("page", page); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 信息 |
||||
*/ |
||||
@GetMapping("/info/{id}") |
||||
public R info(@PathVariable("id") Long id){ |
||||
UserEntity userEntity = userService.getById(id); |
||||
|
||||
return R.ok().put("growthChangeHistory", userEntity); |
||||
} |
||||
|
||||
@GetMapping("/userinfo/{id}") |
||||
public R userInfo(@PathVariable("id") Integer id){ |
||||
UserEntityVo userEntityVo = userService.queryUserId(id); |
||||
return R.ok().put("data",userEntityVo); |
||||
} |
||||
|
||||
/** |
||||
* 保存 |
||||
*/ |
||||
@RequestMapping("/save") |
||||
public R save(@RequestBody UserEntity userEntity){ |
||||
userService.save(userEntity); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 修改 |
||||
*/ |
||||
@PutMapping("/update") |
||||
public R update(@RequestBody UserEntity userEntity){ |
||||
userService.updateById(userEntity); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
*/ |
||||
@DeleteMapping("/delete") |
||||
public R delete(@RequestBody Long[] ids){ |
||||
userService.removeByIds(Arrays.asList(ids)); |
||||
|
||||
return R.ok(); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.msdw.tms.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import com.msdw.tms.entity.vo.PersonalFileVo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Mapper |
||||
public interface PersonalFileDao extends BaseMapper<PersonalFileEntity> { |
||||
|
||||
List<PersonalFileVo> getPersonalfiles(PersonalFileEntity PersonalFileEntity); |
||||
|
||||
} |
@ -0,0 +1,15 @@ |
||||
package com.msdw.tms.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.msdw.tms.entity.UserEntity; |
||||
import com.msdw.tms.entity.vo.UserEntityVo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface UserDao extends BaseMapper<UserEntity> { |
||||
|
||||
UserEntityVo getByUserId(UserEntity userEntity); |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.msdw.tms.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@TableName("hr_personal_file") |
||||
public class PersonalFileEntity implements Serializable { |
||||
|
||||
/** |
||||
* 个人档案id |
||||
*/ |
||||
@TableId |
||||
private Integer personalfileid; |
||||
/** |
||||
* 个人职业id(1、学生 2、老师) |
||||
*/ |
||||
private Integer personalcareerid; |
||||
/** |
||||
* 学校id |
||||
*/ |
||||
private Integer schoolid; |
||||
/** |
||||
* 绑定学科id |
||||
*/ |
||||
private Integer disciplineid; |
||||
/** |
||||
* 绑定专业类id |
||||
*/ |
||||
private Integer professionalclassid; |
||||
/** |
||||
* 绑定专业id |
||||
*/ |
||||
private Integer professionalid; |
||||
/** |
||||
* 绑定专业id |
||||
*/ |
||||
private Integer userid; |
||||
|
||||
} |
@ -0,0 +1,41 @@ |
||||
package com.msdw.tms.entity.request; |
||||
|
||||
import com.msdw.tms.common.utils.poi.ExcelAttribute; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class ProjectRecordImportRequest { |
||||
|
||||
/** |
||||
* 实验项目名称 |
||||
*/ |
||||
@ExcelAttribute(sort = 0) |
||||
private String projectName; |
||||
/** |
||||
* 状态 |
||||
*/ |
||||
@ExcelAttribute(sort = 1) |
||||
private String userRecordstate; |
||||
|
||||
private Integer recordstate; |
||||
/** |
||||
* 得分 |
||||
*/ |
||||
@ExcelAttribute(sort = 2) |
||||
private Integer score; |
||||
/** |
||||
* 耗时 |
||||
*/ |
||||
@ExcelAttribute(sort = 3) |
||||
private Integer timeSum; |
||||
/** |
||||
* 起始时间 |
||||
*/ |
||||
@ExcelAttribute(sort = 4) |
||||
private String startTime; |
||||
/** |
||||
* 结束时间 |
||||
*/ |
||||
@ExcelAttribute(sort = 5) |
||||
private String endTime; |
||||
} |
@ -0,0 +1,28 @@ |
||||
package com.msdw.tms.entity.vo; |
||||
|
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
public class PersonalFileVo extends PersonalFileEntity implements Serializable { |
||||
|
||||
/** |
||||
* 学校名称 |
||||
*/ |
||||
private String schoolName; |
||||
/** |
||||
* 学科名称 |
||||
*/ |
||||
private String disciplineName; |
||||
/** |
||||
* 专业类名称 |
||||
*/ |
||||
private String professionalClassName; |
||||
/** |
||||
* 专业名称 |
||||
*/ |
||||
private String professionalName; |
||||
|
||||
} |
@ -1,9 +0,0 @@ |
||||
package com.msdw.tms.entity.vo; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
public class ProjectEntityVo implements Serializable { |
||||
|
||||
private Integer RoleId; |
||||
|
||||
} |
@ -0,0 +1,59 @@ |
||||
package com.msdw.tms.entity.vo; |
||||
|
||||
import com.msdw.tms.entity.ProjectRecordEntity; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
public class ProjectRecordVo extends ProjectRecordEntity implements Serializable { |
||||
|
||||
/** |
||||
* 实验项目名称 |
||||
*/ |
||||
private String projectName; |
||||
/** |
||||
* 学校名称 |
||||
*/ |
||||
private String SchoolName; |
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
private String userName; |
||||
/** |
||||
* 实验次数 |
||||
*/ |
||||
private Integer experimentNumber; |
||||
/** |
||||
* 总耗时 |
||||
*/ |
||||
private Integer totalTime; |
||||
/** |
||||
* 平均分 |
||||
*/ |
||||
private double avgScore; |
||||
/** |
||||
* 几个月 |
||||
*/ |
||||
private Integer month; |
||||
/** |
||||
* 查询条件 |
||||
*/ |
||||
private String condition; |
||||
/** |
||||
* 开始时间 |
||||
*/ |
||||
private String startTime; |
||||
/** |
||||
* 结束时间 |
||||
*/ |
||||
private String endTime; |
||||
/** |
||||
* 完成数量 |
||||
*/ |
||||
private Integer complete; |
||||
/** |
||||
* 待评分 |
||||
*/ |
||||
private Integer tobescored; |
||||
} |
@ -0,0 +1,13 @@ |
||||
package com.msdw.tms.feign; |
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import com.msdw.tms.common.utils.R; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
||||
@FeignClient |
||||
public interface UserEntityFeignService { |
||||
|
||||
@RequestMapping("userInfo/queryUserInfo") |
||||
public R getUser(); |
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
package com.msdw.tms.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import com.msdw.tms.entity.vo.PersonalFileVo; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface PersonalFileService extends IService<PersonalFileEntity> { |
||||
|
||||
List<PersonalFileVo> queryPage(Integer userid); |
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.msdw.tms.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.entity.UserEntity; |
||||
import com.msdw.tms.entity.vo.UserEntityVo; |
||||
|
||||
import java.util.Map; |
||||
|
||||
public interface UserService extends IService<UserEntity> { |
||||
|
||||
PageUtils queryPage(Map<String, Object> params); |
||||
|
||||
UserEntityVo queryUserId(Integer userId); |
||||
|
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.msdw.tms.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.msdw.tms.dao.PersonalFileDao; |
||||
import com.msdw.tms.entity.PersonalFileEntity; |
||||
import com.msdw.tms.entity.vo.PersonalFileVo; |
||||
import com.msdw.tms.service.PersonalFileService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Service("personalFileService") |
||||
public class PersonalFileServiceImpl extends ServiceImpl<PersonalFileDao,PersonalFileEntity> implements PersonalFileService { |
||||
|
||||
@Override |
||||
public List<PersonalFileVo> queryPage(Integer userid) { |
||||
PersonalFileDao baseMapper = this.getBaseMapper(); |
||||
PersonalFileEntity entity = new PersonalFileEntity(); |
||||
entity.setUserid(userid); |
||||
List<PersonalFileVo> personalfiles = baseMapper.getPersonalfiles(entity); |
||||
return personalfiles; |
||||
} |
||||
|
||||
} |
@ -1,29 +1,95 @@ |
||||
package com.msdw.tms.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.msdw.tms.common.utils.Constant; |
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.common.utils.Query; |
||||
import com.msdw.tms.common.utils.poi.ExcelExportUtil; |
||||
import com.msdw.tms.dao.ProjectRecordDao; |
||||
import com.msdw.tms.entity.ProjectRecordEntity; |
||||
import com.msdw.tms.entity.request.ProjectRecordImportRequest; |
||||
import com.msdw.tms.entity.vo.ProjectRecordVo; |
||||
import com.msdw.tms.service.ProjectRecordService; |
||||
import org.apache.poi.ss.formula.functions.T; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.core.io.ClassPathResource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Map; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.FileInputStream; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
|
||||
@Service("projectRecordService") |
||||
public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, ProjectRecordEntity> implements ProjectRecordService { |
||||
|
||||
@Autowired |
||||
private ProjectRecordDao baseMapper; |
||||
|
||||
@Override |
||||
public PageUtils queryPage(Integer page,Integer size,Integer userid) { |
||||
|
||||
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userid).setIsdel(Constant.IsDel.NOT_DEL.getType()); |
||||
|
||||
//分页对象
|
||||
Page<T> page1 = new Page<>(page, size); |
||||
|
||||
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecord(page1,projectRecord); |
||||
|
||||
PageUtils questionsPage = new PageUtils(projectRecordVos); |
||||
|
||||
return questionsPage; |
||||
} |
||||
|
||||
@Override |
||||
public PageUtils queryPage(Map<String, Object> params) { |
||||
IPage<ProjectRecordEntity> page = this.page( |
||||
new Query<ProjectRecordEntity>().getPage(params), |
||||
new QueryWrapper<ProjectRecordEntity>() |
||||
); |
||||
public ProjectRecordVo queryUserScore(Integer userId) { |
||||
|
||||
return new PageUtils(page); |
||||
Integer isdel = Constant.IsDel.NOT_DEL.getType(); |
||||
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId ,isdel); |
||||
|
||||
return projectRecordVo; |
||||
} |
||||
|
||||
@Override |
||||
public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{ |
||||
//获取数据
|
||||
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); |
||||
|
||||
List<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); |
||||
|
||||
List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { |
||||
ProjectRecordImportRequest request = new ProjectRecordImportRequest(); |
||||
BeanUtils.copyProperties(project, request); |
||||
request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分"); |
||||
return request; |
||||
}).collect(Collectors.toList()); |
||||
|
||||
//2.加载模板流数据
|
||||
org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/实验报告导出模板.xlsx"); |
||||
FileInputStream fis = new FileInputStream(resource.getFile()); |
||||
|
||||
//3、通过工具类下载文件
|
||||
new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.STARTING_ROW, Constant.STYLE_INDEX). |
||||
export(response, fis, importRequests, "实验报告导出.xlsx"); |
||||
} |
||||
|
||||
@Override |
||||
public PageUtils querySchoolRecord(Integer page, Integer size, ProjectRecordVo projectRecord) { |
||||
|
||||
//分页对象
|
||||
Page<T> page1 = new Page<>(page, size); |
||||
projectRecord.setIsdel(Constant.IsDel.NOT_DEL.getType()); |
||||
IPage<ProjectRecordVo> schoolRecord = this.baseMapper.getBySchoolRecord(page1, projectRecord); |
||||
PageUtils pageUtils = new PageUtils(schoolRecord); |
||||
return pageUtils; |
||||
} |
||||
|
||||
@Override |
||||
public boolean updateUserRecord(ProjectRecordEntity projectRecord) { |
||||
boolean result = this.baseMapper.updateUserRecord(projectRecord); |
||||
return result; |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.msdw.tms.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.msdw.tms.common.utils.Constant; |
||||
import com.msdw.tms.common.utils.PageUtils; |
||||
import com.msdw.tms.common.utils.Query; |
||||
import com.msdw.tms.dao.UserDao; |
||||
import com.msdw.tms.entity.UserEntity; |
||||
import com.msdw.tms.entity.vo.UserEntityVo; |
||||
import com.msdw.tms.service.UserService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Map; |
||||
|
||||
@Service("userService") |
||||
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService { |
||||
|
||||
@Override |
||||
public PageUtils queryPage(Map<String, Object> params) { |
||||
|
||||
IPage<UserEntity> page = this.page( |
||||
new Query<UserEntity>().getPage(params), |
||||
new QueryWrapper<UserEntity>() |
||||
); |
||||
return new PageUtils(page); |
||||
} |
||||
|
||||
@Override |
||||
public UserEntityVo queryUserId(Integer userId) { |
||||
|
||||
UserDao userDao = this.getBaseMapper(); |
||||
UserEntity userEntity = new UserEntity(); |
||||
userEntity.setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); |
||||
UserEntityVo vo = userDao.getByUserId(userEntity); |
||||
return vo; |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,32 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="com.msdw.tms.dao.PersonalFileDao"> |
||||
|
||||
|
||||
<select id="getPersonalfiles" parameterType="com.msdw.tms.entity.PersonalFileEntity" resultType="com.msdw.tms.entity.vo.PersonalFileVo"> |
||||
SELECT |
||||
personalFileId, |
||||
personalCareerId, |
||||
schoolName, |
||||
disciplineName, |
||||
professionalClassName, |
||||
professionalName |
||||
FROM |
||||
hr_personal_file pr, |
||||
professional pro, |
||||
professional_class proc, |
||||
discipline dis, |
||||
school sc |
||||
WHERE |
||||
pr.userId = #{userid} |
||||
AND pro.professionalClassId = proc.professionalClassId |
||||
AND proc.disciplineId = dis.disciplineId |
||||
AND pr.professionalId = pro.professionalId |
||||
AND pr.professionalClassId = proc.professionalClassId |
||||
AND pr.disciplineId = dis.disciplineId |
||||
AND pr.schoolId = sc.schoolId |
||||
AND sc.isdel= 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,38 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="com.msdw.tms.dao.UserDao"> |
||||
|
||||
<select id="getByUserId" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo"> |
||||
SELECT |
||||
userName, |
||||
sex, |
||||
countries, |
||||
p.provinceName as provinceName, |
||||
c.cityName as provinceName, |
||||
IDNumber, |
||||
educationDegree, |
||||
schoolName, |
||||
account, |
||||
phone, |
||||
email, |
||||
weChatID, |
||||
'password' |
||||
FROM |
||||
hr_user_info u, |
||||
province p, |
||||
city c, |
||||
school s |
||||
WHERE |
||||
u.userId = #{userid} |
||||
AND u.provinceId = p.provinceId |
||||
AND p.provinceId = c.provinceId |
||||
AND c.cityId = u.cityId |
||||
AND u.schoolId = s.schoolId |
||||
AND p.isdel = #{isdel} |
||||
AND c.isdel = #{isdel} |
||||
AND s.isdel = #{isdel} |
||||
</select> |
||||
|
||||
|
||||
</mapper> |
Loading…
Reference in new issue