| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.CleanerDTO; |
| | | import com.ruoyi.system.dto.ProjectDeptDTO; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TCleanerService; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-cleaner") |
| | | public class TCleanerController { |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | |
| | | |
| | | @ApiOperation(value = "保洁员分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<CleanerListVO>> pageList(@RequestBody CleanerListQuery query) { |
| | | return R.ok(cleanerService.pageList(query)); |
| | | } |
| | | @Log(title = "新增保洁员", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增保洁员") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody CleanerDTO dto) { |
| | | cleanerService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑保洁员", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑保洁员") |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody CleanerDTO dto) { |
| | | cleanerService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "详情保洁员") |
| | | @PostMapping(value = "/detail") |
| | | public R<TCleaner> detail(@RequestParam String id) { |
| | | return R.ok(cleanerService.getById(id)); |
| | | } |
| | | @Log(title = "批量删除保洁员", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除保洁员") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<Boolean> edit(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | cleanerService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.DeptDTO; |
| | | import com.ruoyi.system.dto.KnowledgeDTO; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TKnowledge; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.query.KnowledgeListQuery; |
| | | import com.ruoyi.system.service.TDeptService; |
| | | import com.ruoyi.system.service.TKnowledgeService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.KnowledgeListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目部 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-05-28 |
| | | */ |
| | | @Api(tags = "部门管理") |
| | | @RestController |
| | | @RequestMapping("/t-project-dept") |
| | | public class TDeptController { |
| | | @Resource |
| | | private TDeptService deptService; |
| | | |
| | | |
| | | @ApiOperation(value = "部门分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<DeptListVO>> pageList(@RequestBody DeptListQuery query) { |
| | | return R.ok(deptService.pageList(query)); |
| | | } |
| | | @Log(title = "新增部门", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增部门") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody DeptDTO dto) { |
| | | deptService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑部门", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑部门") |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody DeptDTO dto) { |
| | | deptService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "批量删除部门", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除部门") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<Boolean> edit(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | deptService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "启用/禁用部门", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "启用/禁用部门") |
| | | @DeleteMapping(value = "/editStatus") |
| | | public R<Boolean> editStatus(@RequestParam String id) { |
| | | TDept byId = deptService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else{ |
| | | byId.setStatus(1); |
| | | } |
| | | deptService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | knowledgeService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "详情环卫知识") |
| | | @PostMapping(value = "/detail") |
| | | public R<TKnowledge> detail(@RequestParam String id) { |
| | | |
| | | return R.ok(knowledgeService.getById(id)); |
| | | } |
| | | @Log(title = "批量删除环卫知识", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量环卫知识") |
| | | @DeleteMapping(value = "/delete") |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.query.LeaveListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TLeaveService; |
| | | import com.ruoyi.system.vo.system.LeaveListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-leave-audit") |
| | | public class TLeaveAuditController { |
| | | |
| | | @Resource |
| | | private TLeaveService leaveService; |
| | | @ApiOperation(value = "请假记录分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<LeaveListVO>> pageList(@RequestBody LeaveListQuery query) { |
| | | return R.ok(leaveService.pageList(query)); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.dto.DeptDTO; |
| | | import com.ruoyi.system.dto.ProjectDeptDTO; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TDeptService; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListNoLimitVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-05-28 |
| | | */ |
| | | @Api(tags = "项目部") |
| | | @Api(tags = "项目部管理") |
| | | @RestController |
| | | @RequestMapping("/t-project-dept") |
| | | public class TProjectDeptController { |
| | | @Resource |
| | | private TProjectDeptService deptService; |
| | | |
| | | |
| | | @ApiOperation(value = "项目部分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<ProjectDeptListVO>> pageList(@RequestBody ProjectDeptListQuery query) { |
| | | return R.ok(deptService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "选择项目部/片区不分页列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<ProjectDeptListNoLimitVO>> list() { |
| | | List<TProjectDept> list = deptService.list(new LambdaQueryWrapper<TProjectDept>() |
| | | .eq(TProjectDept::getParentId, "0") |
| | | .eq(TProjectDept::getStatus, 1)); |
| | | List<ProjectDeptListNoLimitVO> projectDeptListNoLimitVOS = new ArrayList<>(); |
| | | for (TProjectDept tProjectDept : list) { |
| | | ProjectDeptListNoLimitVO projectDeptListNoLimitVO = new ProjectDeptListNoLimitVO(); |
| | | BeanUtils.copyProperties(tProjectDept,projectDeptListNoLimitVO); |
| | | List<TProjectDept> list1 = deptService.list(new LambdaQueryWrapper<TProjectDept>() |
| | | .eq(TProjectDept::getParentId, tProjectDept.getId()) |
| | | .eq(TProjectDept::getStatus, 1)); |
| | | List<ProjectDeptListNoLimitVO> projectDeptListNoLimitVOS1 = new ArrayList<>(); |
| | | for (TProjectDept projectDept : list1) { |
| | | ProjectDeptListNoLimitVO projectDeptListNoLimitVO1 = new ProjectDeptListNoLimitVO(); |
| | | BeanUtils.copyProperties(projectDept,projectDeptListNoLimitVO1); |
| | | projectDeptListNoLimitVOS1.add(projectDeptListNoLimitVO1); |
| | | } |
| | | projectDeptListNoLimitVO.setChildren(projectDeptListNoLimitVOS1); |
| | | projectDeptListNoLimitVOS.add(projectDeptListNoLimitVO); |
| | | } |
| | | return R.ok(projectDeptListNoLimitVOS); |
| | | } |
| | | @Log(title = "新增项目部", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增项目部") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody ProjectDeptDTO dto) { |
| | | deptService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑项目部", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑项目部") |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody ProjectDeptDTO dto) { |
| | | deptService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "批量删除项目部", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除项目部") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<Boolean> edit(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | deptService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "启用/禁用项目部", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "启用/禁用项目部") |
| | | @DeleteMapping(value = "/editStatus") |
| | | public R<Boolean> editStatus(@RequestParam String id) { |
| | | TProjectDept byId = deptService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else{ |
| | | byId.setStatus(1); |
| | | } |
| | | deptService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | systemBulletinService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "详情系统公告") |
| | | @PostMapping(value = "/detail") |
| | | public R<TSystemBulletin> detail(@RequestParam String id) { |
| | | |
| | | return R.ok(systemBulletinService.getById(id)); |
| | | } |
| | | @Log(title = "批量删除系统公告", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除系统公告") |
| | | @DeleteMapping(value = "/delete") |
| | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @ApiOperation(value = "状态修改") |
| | | @ApiOperation(value = "状态修改/启用禁用") |
| | | @Log(title = "用户信息-状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUserUpdateStatusDTO dto) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | |
| | | /** 角色排序 */ |
| | | //@Excel(name = "角色排序") |
| | | private Integer roleSort; |
| | | @TableField(value = "role_type") |
| | | @ApiModelProperty("所属类型 1项目部 2公司/部门") |
| | | private Integer roleType; |
| | | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | //@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | |
| | | * 角色人数 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("角色人数") |
| | | private Integer userCount; |
| | | |
| | | public Integer getPostType() { |
| | |
| | | /** 部门ID */ |
| | | //@Excel(name = "部门编号", type = Type.IMPORT) |
| | | @ApiModelProperty(value = "部门id") |
| | | private Long deptId; |
| | | private String deptId; |
| | | |
| | | /** 用户账号 */ |
| | | //@Excel(name = "登录名称") |
| | | @ApiModelProperty(value = "登录名称") |
| | | private String userName; |
| | | @TableField("dept_type") |
| | | @ApiModelProperty(value = "部门类型 1项目部 2部门") |
| | | private String deptType; |
| | | @TableField("templateId") |
| | | @ApiModelProperty(value = "部门类型 1项目部 2部门") |
| | | private String templateId; |
| | | |
| | | /** 用户昵称 */ |
| | | //@Excel(name = "用户名称") |
| | |
| | | private Integer districtId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("角色名称") |
| | | private String roleName; |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | public String getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | public void setDeptId(String deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "保洁员新增编辑DTO") |
| | | public class CleanerDTO extends TCleaner { |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TKnowledge; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "部门新增编辑DTO") |
| | | public class DeptDTO extends TDept { |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目部新增编辑DTO") |
| | | public class ProjectDeptDTO extends TProjectDept { |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | List<SysUser> selectAllList(); |
| | | |
| | | List<SysUserVO> pageList(@Param("query")SysUserQuery query, @Param("pageInfo")PageInfo<SysUserVO> pageInfo); |
| | | List<SysUserVO> pageList(@Param("query")SysUserQuery query); |
| | | |
| | | void updatePassword(@Param("id") Long id,@Param("s") String s); |
| | | |
| | |
| | | */ |
| | | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); |
| | | |
| | | SysUserRole selectUserRole(@Param("userId")Long userId); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCleanerMapper extends BaseMapper<TCleaner> { |
| | | |
| | | List<CleanerListVO> pageList(@Param("query")CleanerListQuery query, @Param("pageInfo")PageInfo<CleanerListVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | { |
| | | |
| | | |
| | | List<DeptListVO> pageList(@Param("query")DeptListQuery query, @Param("pageInfo")PageInfo<DeptListVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.query.LeaveListQuery; |
| | | import com.ruoyi.system.vo.system.LeaveListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TLeaveMapper extends BaseMapper<TLeave> { |
| | | |
| | | List<LeaveListVO> pageList(@Param("query")LeaveListQuery query,@Param("pageInfo")PageInfo<LeaveListVO> pageInfo); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TProjectDeptMapper extends BaseMapper<TProjectDept> { |
| | | |
| | | List<ProjectDeptListVO> pageList(@Param("query")ProjectDeptListQuery query, @Param("pageInfo")PageInfo<ProjectDeptListVO> pageInfo); |
| | | |
| | | } |
| | |
| | | @TableField("cleaner_name") |
| | | private String cleanerName; |
| | | |
| | | @ApiModelProperty(value = "项目部id") |
| | | @TableField("projectId") |
| | | @ApiModelProperty(value = "项目部/所属片区id") |
| | | @TableField("project_id") |
| | | private String projectId; |
| | | |
| | | |
| | |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "审批人id或抄送人id,抄送人id逗号拼接") |
| | | @ApiModelProperty(value = "审批人id和抄送人id,逗号拼接") |
| | | @TableField("audit_id") |
| | | private String auditId; |
| | | |
| | |
| | | @TableField("project_name") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "上级id 为0表示片区") |
| | | @ApiModelProperty(value = "上级id 为0表示项目部") |
| | | @TableField("parent_id") |
| | | private String parentId; |
| | | |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "保洁员分页列表query") |
| | | public class CleanerListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "保洁员编号") |
| | | private String cleanerCode; |
| | | @ApiModelProperty(value = "保洁员名称") |
| | | private Integer cleanerName; |
| | | @ApiModelProperty(value = "所属片区id") |
| | | private Integer projectId; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "部门分页列表query") |
| | | public class DeptListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | private Integer status; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "请假记录分页列表query") |
| | | public class LeaveListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "员工名称") |
| | | private String nickName; |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty(value = "部门ids") |
| | | private List<String> deptIds; |
| | | @ApiModelProperty(value = "开始时间 yyyy-MM-dd") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间 yyyy-MM-dd") |
| | | private String endTime; |
| | | @ApiModelProperty(value = "审核状态 1待审核 2通过 3驳回") |
| | | private Integer auditStatus; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目部门分页列表query") |
| | | public class ProjectDeptListQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "项目部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | private Integer status; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public class SysUserQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String nickNameOrPhone; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private List<Integer> roleIds; |
| | | |
| | | @ApiModelProperty(value = "部门id集合") |
| | | private List<String> deptIds; |
| | | |
| | | private String nickName; |
| | | @ApiModelProperty(value = "电话") |
| | | private String phonenumber; |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty(value = "角色id 全部不传") |
| | | private Long roleId; |
| | | @ApiModelProperty(value = "状态 0=正常 1=停用") |
| | | private String status; |
| | | @ApiModelProperty(value = "引用状态") |
| | | private String templateId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCleanerService extends IService<TCleaner> { |
| | | |
| | | PageInfo<CleanerListVO> pageList(CleanerListQuery query); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TNoticeSet; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TDeptService extends IService<TDept> { |
| | | |
| | | PageInfo<DeptListVO> pageList(DeptListQuery query); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.query.LeaveListQuery; |
| | | import com.ruoyi.system.vo.system.LeaveListVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TLeaveService extends IService<TLeave> { |
| | | |
| | | PageInfo<LeaveListVO> pageList(LeaveListQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TProjectDeptService extends IService<TProjectDept> { |
| | | |
| | | PageInfo<ProjectDeptListVO> pageList(ProjectDeptListQuery query); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanValidators; |
| | |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.validation.Validator; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | return userMapper.selectAllList(); |
| | | } |
| | | |
| | | @Autowired |
| | | private TProjectDeptMapper projectDeptMapper; |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @Autowired |
| | | private TLeaveMapper leaveMapper; |
| | | |
| | | @Override |
| | | public PageInfo<SysUserVO> pageList(SysUserQuery query) { |
| | | PageInfo<SysUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<SysUserVO> list = userMapper.pageList(query,pageInfo); |
| | | |
| | | |
| | | List<SysUserVO> list = userMapper.pageList(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<Long> userIds = list.stream().map(SysUserVO::getUserId).collect(Collectors.toList()); |
| | | for (SysUserVO sysUserVO : list) { |
| | | TLeave tLeave = leaveMapper.selectOne(new LambdaQueryWrapper<TLeave>() |
| | | .eq(TLeave::getLeavePerson, sysUserVO.getUserId()) |
| | | .eq(TLeave::getAuditStatus, 2) |
| | | .ge(TLeave::getStartTime, DateUtils.getNowDate()) |
| | | .le(TLeave::getEndTime, DateUtils.getNowDate()) |
| | | .last("limit 1")); |
| | | if (tLeave!=null){ |
| | | sysUserVO.setLeaveName("请假中"); |
| | | LocalDateTime startTime = tLeave.getStartTime(); |
| | | LocalDateTime endTime = tLeave.getEndTime(); |
| | | // 转化为yyyy-MM-dd字符串格式 |
| | | sysUserVO.setLeaveTime(startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))+"至"+endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | }else{ |
| | | sysUserVO.setLeaveName("正常"); |
| | | } |
| | | // todo 查询请假状态 |
| | | SysUserRole temp = sysUserRoleMapper.selectUserRole(sysUserVO.getUserId()); |
| | | if (temp!=null){ |
| | | SysRole sysRole = roleMapper.selectRoleById(temp.getRoleId()); |
| | | if (sysRole!=null){ |
| | | sysUserVO.setRoleName(sysRole.getRoleName()); |
| | | } |
| | | } |
| | | String deptType = sysUserVO.getDeptType(); |
| | | if (org.springframework.util.StringUtils.hasLength(deptType)){ |
| | | if ("1".equals(deptType)){ |
| | | TProjectDept tProjectDept = projectDeptMapper.selectById(sysUserVO.getDeptId()); |
| | | if (!tProjectDept.getParentId().equals("0")){ |
| | | TProjectDept tProjectDept1 = projectDeptMapper.selectById(tProjectDept.getParentId()); |
| | | sysUserVO.setDeptName(tProjectDept1.getProjectName()+">"+tProjectDept.getProjectName()); |
| | | }else{ |
| | | sysUserVO.setDeptName(tProjectDept.getProjectName()); |
| | | } |
| | | }else{ |
| | | TDept tDept = deptMapper.selectById(sysUserVO.getDeptId()); |
| | | sysUserVO.setDeptName(tDept.getDeptName()); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setTotal(list.size()); |
| | | if (org.springframework.util.StringUtils.hasLength(query.getDeptName())){ |
| | | List<SysUserVO> collect = list.stream().filter(sysUserVO -> sysUserVO.getDeptName().contains(query.getDeptName())).collect(Collectors.toList()); |
| | | pageInfo.setTotal(collect.size()); |
| | | // 手动分页 |
| | | list = collect.stream().skip((long) (query.getPageNum() - 1) * query.getPageSize()).limit(query.getPageSize()).collect(Collectors.toList()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TCleanerMapper; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.service.TCleanerService; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TCleanerServiceImpl extends ServiceImpl<TCleanerMapper, TCleaner> implements TCleanerService { |
| | | |
| | | @Override |
| | | public PageInfo<CleanerListVO> pageList(CleanerListQuery query) { |
| | | PageInfo<CleanerListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<CleanerListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.mapper.TSysConfigMapper; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TSysConfig; |
| | | import com.ruoyi.system.query.DeptListQuery; |
| | | import com.ruoyi.system.service.TDeptService; |
| | | import com.ruoyi.system.service.TSysConfigService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.KnowledgeListVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TDeptServiceImpl extends ServiceImpl<TDeptMapper, TDept> implements TDeptService { |
| | | |
| | | @Override |
| | | public PageInfo<DeptListVO> pageList(DeptListQuery query) { |
| | | PageInfo<DeptListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<DeptListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.mapper.TLeaveMapper; |
| | | import com.ruoyi.system.mapper.TProjectDeptMapper; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.LeaveListQuery; |
| | | import com.ruoyi.system.service.TLeaveService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.LeaveListVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TLeaveServiceImpl extends ServiceImpl<TLeaveMapper, TLeave> implements TLeaveService { |
| | | |
| | | @Autowired |
| | | private TProjectDeptMapper projectDeptMapper; |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | @Override |
| | | public PageInfo<LeaveListVO> pageList(LeaveListQuery query) { |
| | | if (StringUtils.hasLength(query.getDeptName())){ |
| | | List<String> collect = projectDeptMapper.selectList(new LambdaQueryWrapper<TProjectDept>().like(TProjectDept::getProjectName, query.getDeptName())) |
| | | .stream().map(TProjectDept::getId).collect(Collectors.toList()); |
| | | List<String> collect1 = deptMapper.selectList(new LambdaQueryWrapper<TDept>().like(TDept::getDeptName, query.getDeptName())) |
| | | .stream().map(TDept::getId).collect(Collectors.toList()); |
| | | collect.addAll(collect1); |
| | | if (collect.isEmpty()){ |
| | | collect.add("0"); |
| | | } |
| | | query.setDeptIds(collect); |
| | | } |
| | | |
| | | PageInfo<LeaveListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<LeaveListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (LeaveListVO leaveListVO : list) { |
| | | String start = leaveListVO.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | String end = leaveListVO.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | leaveListVO.setLeaveTime(start+"至"+end); |
| | | if (leaveListVO.getDeptType() == 1){ |
| | | TProjectDept tProjectDept = projectDeptMapper.selectById(leaveListVO.getDeptId()); |
| | | if (!tProjectDept.getParentId().equals("0")){ |
| | | TProjectDept tProjectDept1 = projectDeptMapper.selectById(tProjectDept.getParentId()); |
| | | leaveListVO.setDeptName(tProjectDept1.getProjectName()+">"+tProjectDept.getProjectName()); |
| | | }else{ |
| | | leaveListVO.setDeptName(tProjectDept.getProjectName()); |
| | | } |
| | | }else{ |
| | | TDept tDept = deptMapper.selectById(leaveListVO.getDeptId()); |
| | | leaveListVO.setDeptName(tDept.getDeptName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TProjectDeptMapper; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.DeptListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TProjectDeptServiceImpl extends ServiceImpl<TProjectDeptMapper, TProjectDept> implements TProjectDeptService { |
| | | |
| | | @Override |
| | | public PageInfo<ProjectDeptListVO> pageList(ProjectDeptListQuery query) { |
| | | PageInfo<ProjectDeptListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<ProjectDeptListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo.system; |
| | | |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "保洁员列表VO") |
| | | public class CleanerListVO extends TCleaner { |
| | | |
| | | @ApiModelProperty("所属项目部/片区") |
| | | private String projectName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo.system; |
| | | |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TKnowledge; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "部门列表VO") |
| | | public class DeptListVO extends TDept { |
| | | |
| | | @ApiModelProperty("部门人数") |
| | | private Integer userCount; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo.system; |
| | | |
| | | import com.ruoyi.system.model.TLeave; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "请假记录列表分页VO") |
| | | public class LeaveListVO extends TLeave { |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty("巡查员名称") |
| | | private String nickName; |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | @ApiModelProperty("请假日期") |
| | | private String leaveTime; |
| | | @ApiModelProperty("审核人名称") |
| | | private String auditName; |
| | | @ApiModelProperty("部门类型 前端忽略") |
| | | private Integer deptType; |
| | | @ApiModelProperty("部门id 前端忽略") |
| | | private Integer deptId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo.system; |
| | | |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目部门列表不分页VO") |
| | | public class ProjectDeptListNoLimitVO extends TProjectDept { |
| | | |
| | | @ApiModelProperty("下级片区") |
| | | private List<ProjectDeptListNoLimitVO> children; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo.system; |
| | | |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目部门列表不分页VO") |
| | | public class ProjectDeptListVO extends TProjectDept { |
| | | |
| | | @ApiModelProperty("部门人数") |
| | | private Integer userCount; |
| | | } |
| | |
| | | private Integer companyType; |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String companyName; |
| | | @ApiModelProperty(value = "部门") |
| | | private List<String> deptList; |
| | | @ApiModelProperty(value = "角色") |
| | | private String roleName; |
| | | @ApiModelProperty(value = "所属项目/部门") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty(value = "引用模板") |
| | | private String templateName; |
| | | @ApiModelProperty(value = "请假状态") |
| | | private String leaveName; |
| | | @ApiModelProperty(value = "请假时间") |
| | | private String leaveTime; |
| | | |
| | | } |
| | |
| | | select a.role_id AS roleId, a.role_name AS roleName, a.role_key AS roleKey, a.role_sort AS roleSort, a.data_scope AS dataScope, |
| | | a.menu_check_strictly AS menuCheckStrictly, a.dept_check_strictly AS deptCheckStrictly,a.status AS status, a.del_flag AS delFlag, |
| | | a.create_time AS createTime,a.create_by AS createBy,a.postType AS postType,a.removeDays AS removeDays, |
| | | r.role_type as roleType |
| | | IFNULL(b.userCount,0) as userCount |
| | | from sys_role a |
| | | LEFT JOIN |
| | |
| | | FROM sys_role r |
| | | LEFT JOIN sys_user_role ur ON r.role_id = ur.role_id |
| | | where r.del_flag = 0 |
| | | and r.role_id !=1 |
| | | GROUP BY r.role_id) b on a.role_id = b.roleId |
| | | <where> |
| | | <if test="query.roleName != null and query.roleName != ''"> |
| | |
| | | select * from sys_user |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.SysUserVO"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar,u.disable_remark AS disableRemark, |
| | | select u.user_id AS userId, u.deptId AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar,u.disable_remark AS disableRemark, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp,u.operating_time AS operatingTime,u.operating_person AS operatingPerson, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId, |
| | | r.role_id AS roleId, r.role_name AS roleName, r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status,u.deptName as deptName, |
| | | u.business_dept_id AS businessDeptId |
| | | u.business_dept_id AS businessDeptId,u.deptType,t1.template_name as templateName |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | LEFT JOIN t_template t1 on t1.id = u.templateId |
| | | WHERE u.del_flag = 0 |
| | | <if test="query.nickNameOrPhone != null and query.nickNameOrPhone != ''"> |
| | | AND (u.nick_name LIKE concat('%',#{query.nickNameOrPhone},'%') |
| | | OR u.phonenumber LIKE concat('%',#{query.nickNameOrPhone},'%')) |
| | | |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND u.nick_name LIKE concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.phonenumber != null and query.phonenumber != ''"> |
| | | AND u.phonenumber LIKE concat('%',#{query.phonenumber},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND u.status = #{query.status} |
| | | </if> |
| | | <if test="query.deptIds != null and query.deptIds.size()>0"> |
| | | AND u.user_id IN (select DISTINCT user_id from t_dept_to_user where dept_id IN |
| | | <foreach collection="query.deptIds" close=")" open="(" item="deptId" separator=","> |
| | | #{deptId} |
| | | </foreach>) |
| | | <if test="query.templateId != null and query.templateId != ''"> |
| | | AND u.templateId = #{query.templateId} |
| | | </if> |
| | | <if test="query.roleIds != null and query.roleIds.size()>0"> |
| | | AND r.role_id IN |
| | | <foreach collection="query.roleIds" close=")" open="(" item="roleId" separator=","> |
| | | #{roleId} |
| | | </foreach> |
| | | <if test="query.roleId != null and query.roleId != ''"> |
| | | AND ur.role_id = #{query.roleId} |
| | | </if> |
| | | <if test="query.businessDeptId != null and query.businessDeptId != '' and query.businessDeptId != 0"> |
| | | AND u.business_dept_id = #{query.businessDeptId} |
| | | </if> |
| | | |
| | | |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | <select id="selectIdByPhone" resultType="java.lang.Long"> |
| | |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="businessDeptId != null">business_dept_id,</if> |
| | | <if test="deptId != null">deptId,</if> |
| | | <if test="deptType != null">deptType,</if> |
| | | <if test="templateId != null">templateId,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="districtId != null">#{districtId},</if> |
| | | <if test="businessDeptId != null">#{businessDeptId},</if> |
| | | <if test="deptId != null">#{deptId},</if> |
| | | <if test="deptType != null">#{deptType},</if> |
| | | <if test="templateId != null">#{templateId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="operatingTime != null">operating_time = #{operatingTime},</if> |
| | | <if test="operatingPerson != null">operating_person = #{operatingPerson},</if> |
| | | <if test="businessDeptId != null">business_dept_id = #{businessDeptId},</if> |
| | | <if test="deptId != null">deptId=#{deptId},</if> |
| | | <if test="deptType != null">deptType=#{deptType},</if> |
| | | <if test="templateId != null">templateId=#{templateId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | |
| | | <select id="countUserRoleByRoleId" resultType="Integer"> |
| | | select count(1) from sys_user_role where role_id=#{roleId} |
| | | </select> |
| | | |
| | | <delete id="deleteUserRole" parameterType="Long"> |
| | | <select id="selectUserRole" resultType="com.ruoyi.system.domain.SysUserRole"> |
| | | select * from sys_user_role |
| | | where user_id = #{userId} |
| | | limit 1 |
| | | </select> |
| | | |
| | | <delete id="deleteUserRole" parameterType="Long"> |
| | | delete from sys_user_role where user_id in |
| | | <foreach collection="ids" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, create_time, update_time, create_by, update_by, disabled, cleaner_code, cleaner_name, projectId |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.CleanerListVO"> |
| | | select t1.* from t_cleaner t1 |
| | | <where> |
| | | <if test="query.cleanerCode != null and query.cleanerCode != ''"> |
| | | and t1.cleaner_code like concat('%', #{query.cleanerCode}, '%') |
| | | </if> |
| | | <if test="query.cleanerName != null and query.cleanerName != ''"> |
| | | and t1.cleaner_name like concat('%', #{query.cleanerName}, '%') |
| | | </if> |
| | | <if test="query.projectId != null and query.projectId != ''"> |
| | | and t1.projectId = #{query.projectId} |
| | | </if> |
| | | </where> |
| | | and t1.disabled = = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.ruoyi.system.mapper.TDeptMapper"> |
| | | |
| | | |
| | | |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.DeptListVO"> |
| | | select t1.*,count(t2.user_id) as userCount from |
| | | t_dept t1 |
| | | left join sys_user t2 on t2.deptId = t1.id |
| | | where 1=1 |
| | | <if test="query.deptName != null and query.deptName != ''"> |
| | | and t1.dept_name like concat('%',#{query.deptName},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | and t2.deptType =2 |
| | | and t1.`disabled` = = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | group by t1.id |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TLeave"> |
| | | <id column="id" property="id" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="disabled" property="disabled" /> |
| | | <result column="leave_person" property="leavePerson" /> |
| | | <result column="start_time" property="startTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="leave_type" property="leaveType" /> |
| | | <result column="leave_day" property="leaveDay" /> |
| | | <result column="leave_cause" property="leaveCause" /> |
| | | <result column="pictures" property="pictures" /> |
| | | <result column="audit_status" property="auditStatus" /> |
| | | <result column="audit_id" property="auditId" /> |
| | | <result column="audit_time" property="auditTime" /> |
| | | <result column="audit_remark" property="auditRemark" /> |
| | | <id column="id" property="id"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="disabled" property="disabled"/> |
| | | <result column="leave_person" property="leavePerson"/> |
| | | <result column="start_time" property="startTime"/> |
| | | <result column="end_time" property="endTime"/> |
| | | <result column="leave_type" property="leaveType"/> |
| | | <result column="leave_day" property="leaveDay"/> |
| | | <result column="leave_cause" property="leaveCause"/> |
| | | <result column="pictures" property="pictures"/> |
| | | <result column="audit_status" property="auditStatus"/> |
| | | <result column="audit_id" property="auditId"/> |
| | | <result column="audit_time" property="auditTime"/> |
| | | <result column="audit_remark" property="auditRemark"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, create_time, update_time, create_by, update_by, disabled, leave_person, start_time, end_time, leave_type, leave_day, leave_cause, pictures, audit_status, audit_id, audit_time, audit_remark |
| | | id |
| | | , create_time, update_time, create_by, update_by, disabled, leave_person, start_time, end_time, leave_type, leave_day, leave_cause, pictures, audit_status, audit_id, audit_time, audit_remark |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.LeaveListVO"> |
| | | select t1.*, t2.nick_name as nickName, t2.phonenumber as phone,t2.deptType |
| | | from t_leave t1 |
| | | left join sys_user t2 on t1.leave_person = t2.id |
| | | where |
| | | t1.disabled = = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and t2.nick_name like concat('%', #{query.nickName}, '%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and t2.phonenumber like concat('%', #{query.phone}, '%') |
| | | </if> |
| | | <if test="query.auditStatus != null"> |
| | | and t1.audit_status = #{query.auditStatus} |
| | | </if> |
| | | <if test="query.auditStatus != null"> |
| | | and (t1.start_time between #{startTime} and #{endTime}) |
| | | and (t1.end_time between #{startTime} and #{endTime}) |
| | | </if> |
| | | <if test="query.deptIds != null and query.deptIds.size()>0"> |
| | | AND t2.deptId IN |
| | | <foreach collection="query.deptIds" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, create_time, update_time, create_by, update_by, disabled, project_name, parent_id, status |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.system.ProjectDeptListVO"> |
| | | select t1.*,count(t2.user_id) as userCount from |
| | | t_project_dept t1 |
| | | left join sys_user t2 on t2.deptId = t1.id |
| | | where 1=1 |
| | | <if test="query.deptName != null and query.deptName != ''"> |
| | | and t1.dept_name like concat('%',#{query.deptName},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | and t1.`disabled` = = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | and t2.deptType =1 |
| | | group by t1.id |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |