| | |
| | | **/ |
| | | public interface ProjectPerformanceDetailRepository extends JpaRepository<ProjectPerformanceDetail, Long>, JpaSpecificationExecutor<ProjectPerformanceDetail> { |
| | | |
| | | Optional<ProjectPerformanceDetail> findByProjectIdAndUserIdAndYearMonth(Long projectId, Long key, Timestamp yearMonth); |
| | | Optional<ProjectPerformanceDetail> findByProjectIdAndUserIdAndYearMonthLessThan(Long projectId, Long key, Timestamp yearMonth); |
| | | } |
| | |
| | | projectPerformanceDetailService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/complianceWork") |
| | | @Log("查询某月已达标工时") |
| | | @ApiOperation("查询某月已达标工时") |
| | | @PreAuthorize("@el.check('projectPerformanceDetail:list')") |
| | | public ResponseEntity<Object> queryComplianceWork(ProjectPerformanceDetailQueryCriteria criteria){ |
| | | return new ResponseEntity<>(projectPerformanceDetailService.queryComplianceWork(criteria),HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<ProjectPerformanceDetailDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 查询绩效工时 |
| | | * @param criteria 条件 |
| | | */ |
| | | Double queryComplianceWork(ProjectPerformanceDetailQueryCriteria criteria); |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.project.service.impl; |
| | | |
| | | import me.zhengjie.modules.project.domain.Project; |
| | | import me.zhengjie.modules.project.domain.ProjectPerformance; |
| | | import me.zhengjie.modules.project.domain.ProjectPerformanceDetail; |
| | | import me.zhengjie.modules.project.repository.ProjectRepository; |
| | | import me.zhengjie.modules.project.service.dto.ProjectPerformanceDto; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.project.domain.Project; |
| | | import me.zhengjie.modules.project.domain.ProjectPerformanceDetail; |
| | | import me.zhengjie.modules.project.repository.ProjectPerformanceDetailRepository; |
| | | import me.zhengjie.modules.project.repository.ProjectRepository; |
| | | import me.zhengjie.modules.project.service.ProjectPerformanceDetailService; |
| | | import me.zhengjie.modules.project.service.dto.ProjectPerformanceDetailDto; |
| | | import me.zhengjie.modules.project.service.dto.ProjectPerformanceDetailQueryCriteria; |
| | | import me.zhengjie.modules.project.service.mapstruct.ProjectPerformanceDetailMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import me.zhengjie.utils.PageUtil; |
| | | import me.zhengjie.utils.QueryHelp; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.function.Function; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Double queryComplianceWork(ProjectPerformanceDetailQueryCriteria criteria){ |
| | | // 已达标工时 |
| | | Double complianceWork = 0D; |
| | | // 获取本月绩效列表 |
| | | List<ProjectPerformanceDetail> projectPerformanceDetailList = projectPerformanceDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); |
| | | // 判断是否有本月绩效 |
| | | for (ProjectPerformanceDetail projectPerformanceDetail : projectPerformanceDetailList) { |
| | | complianceWork += projectPerformanceDetail.getPerformanceHours(); |
| | | } |
| | | // 已达标工时 |
| | | return complianceWork; |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<ProjectPerformanceDetailDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ProjectPerformanceDto create(ProjectPerformance resources) { |
| | | //判断项目名称是否存在 |
| | | getInfo(resources,null); |
| | | return projectPerformanceMapper.toDto(projectPerformanceRepository.save(resources)); |
| | | |
| | | List<TaskDailyInterface> taskDailyInterfaceList = taskDaliyRepository.collectCostByProjectIdAndFillDateLessThanGroupUserAndTaskId(resources.getProjectId(), resources.getEndDate()); |
| | | Map<Long, Double> userPerformanceMap = new HashMap<Long, Double>(); |
| | | for (TaskDailyInterface taskDailyInterface : taskDailyInterfaceList) { |
| | | TaskUser taskUser = taskUserRepository.findByTaskIdAndUserId(taskDailyInterface.getTaskId(), taskDailyInterface.getUserId()); |
| | | userPerformanceMap.put(taskDailyInterface.getUserId(), userPerformanceMap.getOrDefault(taskDailyInterface.getUserId(), 0.0) + (taskUser.getTaskHours() * taskDailyInterface.getTaskProgress() / 100)); |
| | | } |
| | | |
| | | // @Override |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // public ProjectPerformanceDto create(ProjectPerformance resources) { |
| | | // |
| | | // List<TaskDailyInterface> taskDailyInterfaceList = taskDaliyRepository.collectCostByProjectIdAndFillDateBetweenGroupUserAndTaskId(resources.getProjectId(), resources.getStartDate(), resources.getEndDate()); |
| | | // Map<Long, Double> userPerformanceMap = new HashMap<Long, Double>(); |
| | | // for (TaskDailyInterface taskDailyInterface : taskDailyInterfaceList) { |
| | | // TaskUser taskUser = taskUserRepository.findByTaskIdAndUserId(taskDailyInterface.getTaskId(), taskDailyInterface.getUserId()); |
| | | // userPerformanceMap.put(taskDailyInterface.getUserId(), userPerformanceMap.getOrDefault(taskDailyInterface.getUserId(), 0.0) + (taskUser.getTaskHours() * taskDailyInterface.getTaskProgress() / 100)); |
| | | // } |
| | | // |
| | | // DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | // |
| | | // ProjectPerformance projectPerformance = new ProjectPerformance(); |
| | | // projectPerformance.setProjectId(resources.getProjectId()); |
| | | // |
| | | // projectPerformance.setStartDate(resources.getStartDate()); |
| | | // projectPerformance.setEndDate(resources.getEndDate()); |
| | | // |
| | | // projectPerformance.setYearMonth(resources.getYearMonth()); |
| | | // projectPerformanceRepository.save(projectPerformance); |
| | | // |
| | | // for (Entry<Long, Double> entry : userPerformanceMap.entrySet()) { |
| | | // |
| | | // ProjectPerformanceDetail projectPerformanceDetailLast = |
| | | // projectPerformanceDetailRepository.findByProjectIdAndUserIdAndYearMonth(resources.getProjectId(), entry.getKey(), resources.getYearMonth()).orElse(ProjectPerformanceDetail::new); |
| | | // |
| | | // ProjectPerformanceDetail projectPerformanceDetail = new ProjectPerformanceDetail(); |
| | | // |
| | | // projectPerformanceDetail.setProjectId(resources.getProjectId()); |
| | | // projectPerformanceDetail.setYearMonth(projectPerformance.getYearMonth()); |
| | | // projectPerformanceDetail.setUserId(entry.getKey()); |
| | | // |
| | | // if (projectPerformanceDetailLast.getPerformanceHours() == null) { |
| | | // projectPerformanceDetail.setPerformanceHours(entry.getValue()); |
| | | // } else { |
| | | // projectPerformanceDetail.setPerformanceHours(entry.getValue() - projectPerformanceDetailLast.getPerformanceHours()); |
| | | // } |
| | | // |
| | | // projectPerformanceDetailRepository.save(projectPerformanceDetail); |
| | | // } |
| | | // |
| | | // return projectPerformanceMapper.toDto(projectPerformanceRepository.save(resources)); |
| | | // } |
| | | // 绩效登录 |
| | | projectPerformanceRepository.save(resources); |
| | | |
| | | // public Double queryComplianceWork(Long userId, String yearMonth) { |
| | | // // 已达标工时 |
| | | // Double complianceWork = 0D; |
| | | // |
| | | // List<ProjectPerformanceDetail> projectPerformanceDetailList = projectPerformanceDetailRepository.findByUserIdAndYearMonth(userId, yearMonth); |
| | | // for (ProjectPerformanceDetail projectPerformanceDetail : projectPerformanceDetailList) { |
| | | // complianceWork += projectPerformanceDetail.getPerformanceHours(); |
| | | // } |
| | | // return complianceWork; |
| | | // } |
| | | for (Entry<Long, Double> entry : userPerformanceMap.entrySet()) { |
| | | |
| | | ProjectPerformanceDetail projectPerformanceDetailLast = |
| | | projectPerformanceDetailRepository.findByProjectIdAndUserIdAndYearMonthLessThan(resources.getProjectId(), entry.getKey(), resources.getYearMonth()).orElseGet(ProjectPerformanceDetail::new); |
| | | |
| | | ProjectPerformanceDetail projectPerformanceDetail = new ProjectPerformanceDetail(); |
| | | |
| | | projectPerformanceDetail.setProjectId(resources.getProjectId()); |
| | | projectPerformanceDetail.setYearMonth(resources.getYearMonth()); |
| | | projectPerformanceDetail.setUserId(entry.getKey()); |
| | | |
| | | if (projectPerformanceDetailLast.getPerformanceHours() == null) { |
| | | projectPerformanceDetail.setPerformanceHours(entry.getValue()); |
| | | } else { |
| | | projectPerformanceDetail.setPerformanceHours(entry.getValue() - projectPerformanceDetailLast.getPerformanceHours()); |
| | | } |
| | | |
| | | projectPerformanceDetailRepository.save(projectPerformanceDetail); |
| | | } |
| | | |
| | | return projectPerformanceMapper.toDto(projectPerformanceRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(ProjectPerformance resources) { |
| | | ProjectPerformance projectPerformance = projectPerformanceRepository.findById(resources.getId()).orElseGet(ProjectPerformance::new); |
| | | ValidationUtil.isNull( projectPerformance.getId(),"ProjectPerformance","id",resources.getId()); |
| | | //判断项目名称是否存在 |
| | | getInfo(resources,projectPerformance); |
| | | projectPerformance.copy(resources); |
| | | projectPerformanceRepository.save(projectPerformance); |
| | | } |
| | | |
| | | /** |
| | | * 重名验证 |
| | | * @param / |
| | | */ |
| | | public void getInfo(ProjectPerformance resources, ProjectPerformance projectPerformance){ |
| | | //查询项目绩效表 |
| | | ProjectPerformance projectPerformance1 = projectPerformanceRepository.findByProjectId(resources.getProjectId()); |
| | | if(ObjectUtils.isNotEmpty(resources.getId())){ |
| | | if(projectPerformance1 != null && projectPerformance1.getId() != projectPerformance.getId()){ |
| | | throw new BadRequestException("项目名称已存在"); |
| | | } |
| | | }else{ |
| | | if(projectPerformance1 != null){ |
| | | throw new BadRequestException("标题项目名称已存在"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.function.Function; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | import me.zhengjie.modules.system.repository.DictDetailRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.RoleService; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.modules.task.domain.Task; |
| | | import me.zhengjie.modules.task.repository.TaskRepository; |
| | | import me.zhengjie.modules.task.repository.TaskUserRepository; |
| | |
| | | import me.zhengjie.utils.FileUtil; |
| | | import me.zhengjie.utils.PageUtil; |
| | | import me.zhengjie.utils.QueryHelp; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.enums.DataScopeEnum; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | |
| | | private final UserRepository userRepository; |
| | | private final DictDetailRepository dictDetailRepository; |
| | | private final ProjectTaskRepository projectTaskRepository; |
| | | private final TaskService taskService; |
| | | private final RoleService roleService; |
| | | private final TaskUserRepository taskUserRepository; |
| | | private final ProjectCostRepository projectCostRepository; |
| | |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(ProjectQueryCriteria criteria, Pageable pageable){ |
| | | |
| | | if (criteria.getLiableUserId() == null) { |
| | | // 获取当前用户ID |
| | | Long userId = SecurityUtils.getCurrentUserId(); |
| | | // 查询用户角色 |
| | | List<RoleSmallDto> roleSet = roleService.findByUsersId(userId); |
| | | if (roleSet.stream().anyMatch(role -> DataScopeEnum.find(role.getDataScope()) == DataScopeEnum.THIS_LEVEL)) { |
| | | criteria.setLiableUserId(userId); |
| | | } |
| | | } |
| | | |
| | | Page<Project> page = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | // 将实体类转换为DTO(重写) |
| | | Function<Project, ProjectDto> func = new Function<Project, ProjectDto>(){ |
| | |
| | | |
| | | @Override |
| | | public List<ProjectDto> queryAll(ProjectQueryCriteria criteria){ |
| | | if (criteria.getLiableUserId() == null) { |
| | | // 获取当前用户ID |
| | | Long userId = SecurityUtils.getCurrentUserId(); |
| | | // 查询用户角色 |
| | | List<RoleSmallDto> roleSet = roleService.findByUsersId(userId); |
| | | if (roleSet.stream().anyMatch(role -> DataScopeEnum.find(role.getDataScope()) == DataScopeEnum.THIS_LEVEL)) { |
| | | criteria.setLiableUserId(userId); |
| | | } |
| | | } |
| | | return projectMapper.toDto(projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | |
| | | import me.zhengjie.modules.project.service.dto.ProjectDto; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.DictDetailRepository; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.enums.DataScopeEnum; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.project.repository.ProjectTaskRepository; |
| | |
| | | import org.springframework.data.domain.Pageable; |
| | | import me.zhengjie.utils.PageUtil; |
| | | import me.zhengjie.utils.QueryHelp; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | |
| | | // 节假日列表 |
| | | sysConfigHoliday = sysConfigHolidayRepository.findByHolidayDate(strTodayDate); |
| | | } |
| | | // 获取当前日期类 |
| | | Calendar calAttendanceDate = Calendar.getInstance(); |
| | | calAttendanceDate.setTime(Timestamp.valueOf(ObjectUtils.isEmpty(attendDate) ? strTodayDate + " 00:00:00" : strAttendDate + " 00:00:00")); |
| | | // 遍历用户列表 |
| | | for (User user : userList) { |
| | | // 用户钉钉号不为null |
| | |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_WAITFOR); |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_WAITFOR); |
| | | // 当前日期类是否是周末、节假日、工作日 |
| | | if (sysConfigHoliday == null && (calTodayDay.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calTodayDay.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)) { |
| | | if (sysConfigHoliday == null && (calAttendanceDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendanceDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)) { |
| | | // 考勤记录:日期类型-双休 |
| | | attendance.setDateType(Constant.DATE_TYPE_WEEKEND); |
| | | } else if (sysConfigHoliday != null && sysConfigHoliday.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) { |
| | |
| | | import me.zhengjie.modules.attendance.service.AttendanceService; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceQueryCriteria; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.project.service.ProjectPerformanceDetailService; |
| | | import me.zhengjie.modules.project.service.dto.ProjectPerformanceDetailQueryCriteria; |
| | | import me.zhengjie.modules.salary.domain.Salary; |
| | | import me.zhengjie.modules.system.domain.SysConfigHoliday; |
| | | import me.zhengjie.modules.system.domain.User; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | private final AttendanceService attendanceService; |
| | | private final TaskDaliyService taskDaliyService; |
| | | private final SysConfigIndividualIncomeTaxService sysConfigIndividualIncomeTaxService; |
| | | private final ProjectPerformanceDetailService projectPerformanceDetailService; |
| | | // ==================== 以上为定时生成工资记录主要依赖 ==================== |
| | | |
| | | @Override |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void userSalarySettlement(Long userId, String targetYearMonth) { |
| | | // 判断用户ID是否为空 |
| | | if (userId != null && !"".equals(userId)) { |
| | | if (userId != null) { |
| | | // 单个用户工资结算 |
| | | singleUserSalarySettlement(userId, targetYearMonth); |
| | | } else { |
| | |
| | | // 获取达标工时 |
| | | private Salary getComplianceWork(Long userId, String targetYearMonth, Salary salary) { |
| | | // 任务日报查询类 |
| | | TaskDaliyQueryCriteria taskDaliyQueryCriteria = new TaskDaliyQueryCriteria(); |
| | | ProjectPerformanceDetailQueryCriteria taskDaliyQueryCriteria = new ProjectPerformanceDetailQueryCriteria(); |
| | | taskDaliyQueryCriteria.setUserId(userId); |
| | | taskDaliyQueryCriteria.setTargetYearMonth(targetYearMonth); |
| | | taskDaliyQueryCriteria.setYearMonth(Timestamp.valueOf(targetYearMonth + " 00:00:00")); |
| | | // 查询某月已达标工时 |
| | | Double complianceWork = taskDaliyService.queryComplianceWork(taskDaliyQueryCriteria); |
| | | Double complianceWork = projectPerformanceDetailService.queryComplianceWork(taskDaliyQueryCriteria); |
| | | // 实达标团队工时 |
| | | salary.setActualComplianceTeamHours(complianceWork); |
| | | // 返回 |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.config.RsaProperties; |
| | | import me.zhengjie.modules.project.service.dto.ProjectQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.Dept; |
| | | import me.zhengjie.modules.system.service.DataService; |
| | | import me.zhengjie.modules.system.domain.User; |
| | |
| | | import me.zhengjie.modules.system.domain.vo.UserPassVo; |
| | | import me.zhengjie.modules.system.service.DeptService; |
| | | import me.zhengjie.modules.system.service.RoleService; |
| | | import me.zhengjie.modules.system.service.dto.DeptDto; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.modules.system.service.dto.UserDto; |
| | | import me.zhengjie.modules.system.service.dto.UserQueryCriteria; |
| | |
| | | return new ResponseEntity<>(userService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/approval") |
| | | @Log("查询用户") |
| | | @ApiOperation("查询用户") |
| | | @PreAuthorize("@el.check('user:list')") |
| | | public ResponseEntity<Object> queryApprovalUser(UserQueryCriteria criteria) { |
| | | // 当前用户 |
| | | UserDto user = userService.findByName(SecurityUtils.getCurrentUsername()); |
| | | List<Long> deptList = new ArrayList<Long>(); |
| | | // 当前部门 |
| | | DeptDto deptDto = deptService.findById(user.getDept().getId()); |
| | | // 然后把父节点的ID都加入到集合中 |
| | | deptList.addAll(deptService.getSuperior(deptDto, new ArrayList<Dept>()).stream().map(dept -> dept.getId()).collect(Collectors.toList())); |
| | | // 父部门加入检索条件 |
| | | criteria.getDeptIds().addAll(deptList); |
| | | |
| | | RoleSmallDto role = user.getRoles().stream().findFirst().orElseGet(RoleSmallDto::new); |
| | | // 数据权限是全体的场合,包含自己,否则不包含自己 |
| | | if ("全部".equals(role.getDataScope())) { |
| | | criteria.setLevel(role.getLevel()); |
| | | } else { |
| | | criteria.setLevelNq(role.getLevel()); |
| | | } |
| | | return new ResponseEntity<>(userService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @ApiOperation("查询用户") |
| | | @GetMapping |
| | | @PreAuthorize("@el.check('user:list')") |
| | |
| | | } |
| | | // 数据权限 |
| | | List<Long> dataScopes = dataService.getDeptIds(userService.findByName(SecurityUtils.getCurrentUsername())); |
| | | List<Long> totalScopes = new ArrayList<Long>(dataScopes); |
| | | for (Long dataScope : dataScopes) { |
| | | // 先查找是否存在子节点 |
| | | List<Dept> data = deptService.findByPid(dataScope); |
| | | // 然后把子节点的ID都加入到集合中 |
| | | totalScopes.addAll(deptService.getDeptChildren(data)); |
| | | } |
| | | // criteria.getDeptIds() 不为空并且数据权限不为空则取交集 |
| | | if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)){ |
| | | if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(totalScopes)){ |
| | | // 取交集 |
| | | criteria.getDeptIds().retainAll(dataScopes); |
| | | criteria.getDeptIds().retainAll(totalScopes); |
| | | if(!CollectionUtil.isEmpty(criteria.getDeptIds())){ |
| | | return new ResponseEntity<>(userService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | } else { |
| | | // 否则取并集 |
| | | criteria.getDeptIds().addAll(dataScopes); |
| | | criteria.getDeptIds().addAll(totalScopes); |
| | | return new ResponseEntity<>(userService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | return new ResponseEntity<>(PageUtil.toPage(null,0),HttpStatus.OK); |
| | |
| | | @Query(propName = "id", type = Query.Type.IN, joinName = "dept") |
| | | private Set<Long> deptIds = new HashSet<>(); |
| | | |
| | | @Query(propName = "level", type = Query.Type.LESS_THAN_NQ, joinName = "roles") |
| | | private Integer levelNq; |
| | | |
| | | @Query(propName = "level", type = Query.Type.LESS_THAN, joinName = "roles") |
| | | private Integer level; |
| | | |
| | | @Query(blurry = "email,username,nickName") |
| | | private String blurry; |
| | | |
| | |
| | | * @param taskId |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT user_id AS userId, task_id AS taskId, COALESCE(MAX(task_progress), 0) AS taskProgress FROM task_daliy WHERE project_id = ?1 AND fill_date BETWEEN ?2 AND ?3 GROUP BY user_id, task_id", nativeQuery = true) |
| | | List<TaskDailyInterface> collectCostByProjectIdAndFillDateBetweenGroupUserAndTaskId(Long projectId, Timestamp sdate, Timestamp edate); |
| | | @Query(value = "SELECT user_id AS userId, task_id AS taskId, COALESCE(MAX(task_progress), 0) AS taskProgress FROM task_daliy WHERE project_id = ?1 AND fill_date <= ?2 GROUP BY user_id, task_id", nativeQuery = true) |
| | | List<TaskDailyInterface> collectCostByProjectIdAndFillDateLessThanGroupUserAndTaskId(Long projectId, Timestamp edate); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据多任务ID查询 |
| | | * @param userId |
| | | * @param taskIds |
| | | * @return |
| | | */ |
| | | List<TaskUser> findByUserIdAndTaskIdIn(Long userId, List<Long> taskIds); |
| | | |
| | | /** |
| | | * 根据多任务ID查询 |
| | | * @param taskIds |
| | | * @return |
| | | */ |
| | |
| | | public ResponseEntity<Object> queryCompletedWork(TaskDaliyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskDaliyService.queryCompletedWork(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/complianceWork") |
| | | @Log("查询某月已达标工时") |
| | | @ApiOperation("查询某月已达标工时") |
| | | @PreAuthorize("@el.check('taskDaliy:list')") |
| | | public ResponseEntity<Object> queryComplianceWork(TaskDaliyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskDaliyService.queryComplianceWork(criteria),HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | * @return List<TaskDaliyDto> |
| | | */ |
| | | Double queryCompletedWork(TaskDaliyQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 查询某月已达标工时 |
| | | * @param criteria 条件参数 |
| | | * @return List<TaskDaliyDto> |
| | | */ |
| | | Double queryComplianceWork(TaskDaliyQueryCriteria criteria); |
| | | } |
| | |
| | | private final UserRepository userRepository; |
| | | private final DictDetailRepository dictDetailRepository; |
| | | private final TaskUserRepository taskUserRepository; |
| | | private final ProjectProgressRepository projectProgressRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(TaskDaliyQueryCriteria criteria, Pageable pageable){ |
| | |
| | | // 判断是否有本月任务日报 |
| | | if (taskDaliyMonthList.size() != 0) { |
| | | // 获取本月任务日报中所有任务ID |
| | | List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).collect(Collectors.toList()); |
| | | List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).distinct().collect(Collectors.toList()); |
| | | // 获取本月任务分配列表 |
| | | List<TaskUser> taskUserMonthList = taskUserRepository.findByTaskIdIn(taskIds); |
| | | List<TaskUser> taskUserMonthList = taskUserRepository.findByUserIdAndTaskIdIn(criteria.getUserId(), taskIds); |
| | | // 日历类 |
| | | Calendar cal = setUpCalendar(targetYearMonth); |
| | | // 获取本月最大天数 |
| | |
| | | return completedWork; |
| | | } |
| | | |
| | | @Override |
| | | public Double queryComplianceWork(TaskDaliyQueryCriteria criteria){ |
| | | // 已达标工时 |
| | | Double complianceWork = 0D; |
| | | // 国际时间转中国时间 |
| | | String targetYearMonth = DateUtil.internationalTimeToChinaTime(criteria.getTargetYearMonth()); |
| | | // 任务日报检索类 |
| | | criteria.setFillDateLike(targetYearMonth.substring(0,7)); |
| | | // 获取本月任务日报列表 |
| | | List<TaskDaliy> taskDaliyMonthList = taskDaliyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); |
| | | // 判断是否有本月任务日报 |
| | | if (taskDaliyMonthList.size() != 0) { |
| | | // 获取本月任务日报中所有任务ID |
| | | List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).collect(Collectors.toList()); |
| | | // 获取本月任务日报中所有项目ID |
| | | List<Long> projectIds = taskDaliyMonthList.stream().map(item -> item.getProjectId()).collect(Collectors.toList()); |
| | | // 获取本月任务分配列表 |
| | | List<TaskUser> taskUserMonthList = taskUserRepository.findByTaskIdIn(taskIds); |
| | | // 日历类 |
| | | Calendar cal = setUpCalendar(targetYearMonth); |
| | | // 获取本月最大天数 |
| | | int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | // 设置本月最大天数 |
| | | cal.set(Calendar.DAY_OF_MONTH, lastDay); |
| | | // 获取本月最大周数 |
| | | int lastWeek = cal.get(Calendar.WEEK_OF_YEAR); |
| | | // 获取本月最大任务进度列表 |
| | | List<ProjectProgress> projectProgressLastList = projectProgressRepository.findByBelongYearAndBelongWeekAndProjectIdIn(Integer.valueOf(targetYearMonth.substring(0,4)), lastWeek, projectIds); |
| | | // 循环本月最大天数 |
| | | for (int i = 1; i <= lastDay; i ++) { |
| | | // 设置天数 |
| | | cal.set(Calendar.DAY_OF_MONTH, i); |
| | | // 获取本日任务日报列表 |
| | | List<TaskDaliy> taskDaliyDayList = taskDaliyMonthList.stream().filter(item -> item.getFillDate().getTime() == cal.getTime().getTime()).collect(Collectors.toList()); |
| | | // 循环本日任务日报列表 |
| | | for (int j = 0; j < taskDaliyDayList.size(); j ++) { |
| | | // 本日任务日报 |
| | | TaskDaliy taskDaliyDay = taskDaliyDayList.get(j); |
| | | // 本日任务分配列表 |
| | | List<TaskUser> taskUserDayList = taskUserMonthList.stream().filter(item -> item.getTaskId() == taskDaliyDay.getTaskId()).collect(Collectors.toList()); |
| | | // 判断本日任务分配列表数量 |
| | | if (taskUserDayList.size() > 1) { |
| | | throw new BadRequestException("任务存在多次分配同一人情况!"); |
| | | } else if (taskUserDayList.size() == 0) { |
| | | throw new BadRequestException("未找到任务分配记录!"); |
| | | } |
| | | // 本日任务分配 |
| | | TaskUser taskUserDay = taskUserDayList.get(0); |
| | | // 本日最大任务进度列表 |
| | | List<ProjectProgress> projectProgressLastDayList = projectProgressLastList.stream().filter(item -> item.getProject().getId() == taskDaliyDay.getProjectId()).collect(Collectors.toList()); |
| | | // 判断本日最大任务进度列表 |
| | | if (projectProgressLastDayList.size() > 1) { |
| | | throw new BadRequestException("任务进度存在多条同年同周情况!"); |
| | | } else if (projectProgressLastDayList.size() == 0) { |
| | | throw new BadRequestException("未找到任务进度记录!"); |
| | | } |
| | | // 本日最大任务进度 |
| | | ProjectProgress projectProgressLastDay = projectProgressLastDayList.get(0); |
| | | // 判断本日最大任务进度是否未承认 |
| | | if (Constant.APPROVE_STATUS_UNRECOGNIZED.equals(projectProgressLastDay.getApproveStatus())) { |
| | | throw new BadRequestException("任务进度未承认!"); |
| | | } |
| | | // 判断本日最大任务进度是否达标 |
| | | if (projectProgressLastDay.getProjectProgress() < projectProgressLastDay.getEstimatedProgress()) { |
| | | // 跳过当前循环 |
| | | continue; |
| | | } |
| | | // 根据项目ID、任务ID、用户ID查询填报日期前最近的任务日报信息 |
| | | TaskDaliy taskDaliyHistory = taskDaliyRepository.findPreviousByProjectIdAndTaskIdAndAndUserId(taskDaliyDay.getProjectId(), taskDaliyDay.getTaskId(), taskDaliyDay.getUserId(), taskDaliyDay.getFillDate()); |
| | | // 本日任务日报进度 |
| | | Double taskDaliyDayProgress = taskDaliyDay.getTaskProgress(); |
| | | // 判断最近的任务日报是否为空 |
| | | if (taskDaliyHistory != null) { |
| | | // 本日任务日报相关历史进度 |
| | | Double taskDaliyHistoryProgress = taskDaliyHistory.getTaskProgress(); |
| | | // 判断进度是否正常 |
| | | if (taskDaliyDayProgress - taskDaliyHistoryProgress <= 0) { |
| | | throw new BadRequestException("任务日报进度计算存在异常!"); |
| | | } |
| | | // 本日任务日报进度 |
| | | taskDaliyDayProgress = taskDaliyDayProgress - taskDaliyHistoryProgress; |
| | | } |
| | | // 已达标工时 |
| | | complianceWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100); |
| | | } |
| | | } |
| | | } |
| | | // 已达标工时 |
| | | return complianceWork; |
| | | } |
| | | |
| | | /** |
| | | * 设置日历类 |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll } |
| | | export function complianceWork(params) { |
| | | return request({ |
| | | url: 'api/projectPerformanceDetail/complianceWork', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, complianceWork } |
| | |
| | | }) |
| | | } |
| | | |
| | | export function get(params) { |
| | | return request({ |
| | | url: 'api/users', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export function getApprovalUsers(params) { |
| | | return request({ |
| | | url: 'api/users/approval', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: 'api/users', |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del } |
| | | export default { getAll, add, edit, del, get, getApprovalUsers } |
| | |
| | | /** |
| | | * @description 是否显示logo |
| | | */ |
| | | sidebarLogo: true, |
| | | sidebarLogo: false, |
| | | /** |
| | | * 是否显示设置的底部信息 |
| | | */ |
| | | showFooter: true, |
| | | showFooter: false, |
| | | /** |
| | | * 底部文字,支持html语法 |
| | | */ |
| | | footerTxt: '© 2018-2022 Zheng Jie <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License 2.0</a>', |
| | | footerTxt: '', |
| | | /** |
| | | * 备案号 |
| | | */ |
| | |
| | | <el-form-item label="审批人" prop="approvalUserId"> |
| | | <el-select v-model="makeUpCardForm.approvalUserId" clearable filterable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | <el-form-item label="审批员工" prop="approvalUserId"> |
| | | <el-select v-model="goOutForm.approvalUserId" filterable clearable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | <el-form-item label="审批员工" prop="approvalUserId"> |
| | | <el-select v-model="bussForm.approvalUserId" filterable clearable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '考勤记录', url: 'api/attendance', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendance }}) |
| | | return CRUD({ title: '考勤记录', url: 'api/attendance', idField: 'id', sort: 'attendanceDate,desc', crudMethod: { ...crudAttendance }}) |
| | | }, |
| | | // 数据字典 |
| | | dicts: [constant.ATTENDANCE_STATE, constant.DATE_TYPE, constant.LOCATION_RESULTS, constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS, constant.LEAVE_TIME_TYPE, constant.GO_OUT_TYPE], |
| | |
| | | dictStartEarly: constant.ATTENDANCE_STATE_EARLY, |
| | | dictStartLate: constant.ATTENDANCE_STATE_LATE, |
| | | users: [], |
| | | approvalUsers: [], |
| | | makeUpCardVisible: false, |
| | | makeUpCardLoading: false, |
| | | makeUpCardTitle: '', |
| | |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | this.getUsers() |
| | | this.getApprovalUsers() |
| | | return true |
| | | }, |
| | | // 查询员工 |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | | this.approvalUsers = res |
| | | }) |
| | | }, |
| | | // 获取表格上下班排班时间 |
| | | getRosteTime(data) { |
| | | if (data.userId !== null && data.attendanceDate !== null) { |
| | |
| | | <el-form-item label="审批者" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | ] |
| | | }, |
| | | users: [], |
| | | approvalUsers: [], |
| | | dictBussinessStatus: constant.BUSSINESS_APPROVE_STATUS, |
| | | dictGoOutAppRev: constant.BUSSINESS_APPROVE_STATUS_REVIEWED, |
| | | dictGoOutAgree: constant.BUSSINESS_APPROVE_STATUS_AGREE, |
| | |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | created() { |
| | | this.getUsers() |
| | | this.getApprovalUsers() |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | | this.approvalUsers = res |
| | | }) |
| | | }, |
| | | // 计算时长 |
| | | checkTime() { |
| | | var data = JSON.stringify({ |
| | |
| | | <el-form-item label="审批者" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" clearable filterable placeholder="请选择" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | ] |
| | | }, |
| | | users: [], |
| | | approvalUsers: [], |
| | | makeUpCardVisible: false, |
| | | successLoading: false, |
| | | dictCardApproveStatus: constant.CARD_APPROVE_STATUS, |
| | |
| | | // 用户最大角色级别 |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | this.getUsers() |
| | | this.getApprovalUsers() |
| | | return true |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | | this.approvalUsers = res |
| | | }) |
| | | }, |
| | | // 审批页面赋值 |
| | | toApprove(data) { |
| | | this.makeUpCardVisible = true |
| | |
| | | <el-form-item label="审批者" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | ] |
| | | }, |
| | | users: [], |
| | | approvalUsers: [], |
| | | dictLeaveTimeType: constant.LEAVE_TIME_TYPE, |
| | | dictLeaveTimeTypeHour: constant.LEAVE_TIME_TYPE_HOUR, |
| | | dictGoOutTypr: constant.GO_OUT_TYPE, |
| | |
| | | }, |
| | | created() { |
| | | this.getUsers() |
| | | this.getApprovalUsers() |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | | this.approvalUsers = res |
| | | }) |
| | | }, |
| | | // 计算时长 |
| | | checkTime() { |
| | | this.form.durationUnit = this.dictLeaveTimeTypeHour |
| | |
| | | <el-form-item label="审批者" prop="approvalUserId"> |
| | | <el-select v-model="form.approvalUserId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in approvalUsers" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | ] |
| | | }, |
| | | users: [], |
| | | approvalUsers: [], |
| | | dictLeaveType: constant.LEAVE_TYPE, |
| | | dictLeaveTypeAnnualLeave: constant.LEAVE_TYPE_ANNUAL_LEAVE, |
| | | dictLeaveTypeCompassionateLeave: constant.LEAVE_TYPE_COMPASSIONATE_LEAVE, |
| | |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // 角色级别: 总经理 |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL } |
| | | roleLevelGenerl: constant.ROLE_LEVEL_GENERAL |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | |
| | | }, |
| | | created() { |
| | | this.getUsers() |
| | | this.getApprovalUsers() |
| | | // this.getUserTimes() |
| | | }, |
| | | methods: { |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | | this.approvalUsers = res |
| | | }) |
| | | }, |
| | | checkLeaveTime() { |
| | | // 根据请假类型改变时间单位 |
| | | if (this.form.leaveType === this.dictLeaveTypeAnnualLeave || this.form.leaveType === this.dictLeaveTypeCompassionateLeave) { |
| | |
| | | <template> |
| | | <div class="dashboard-container"> |
| | | <div class="dashboard-editor-container"> |
| | | <github-corner class="github-corner" /> |
| | | |
| | | <panel-group @handleSetLineChartData="handleSetLineChartData" /> |
| | | |
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> |
| | | <line-chart :chart-data="lineChartData" /> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import GithubCorner from '@/components/GithubCorner' |
| | | import PanelGroup from './dashboard/PanelGroup' |
| | | import LineChart from './dashboard/LineChart' |
| | | import RadarChart from '@/components/Echarts/RadarChart' |
| | |
| | | export default { |
| | | name: 'Dashboard', |
| | | components: { |
| | | GithubCorner, |
| | | PanelGroup, |
| | | LineChart, |
| | | RadarChart, |
| | |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <el-input v-model="query.name" clearable placeholder="名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> |
| | | <el-select v-model="query.projectTypeId" clearable filterable placeholder="项目类型" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in projectTypeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.projectDistinguish" clearable filterable placeholder="项目区分" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in dict[projectDistinguish]" |
| | |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.liableUserId" clearable filterable placeholder="责任人" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-select v-model="query.projectTypeId" clearable filterable placeholder="项目类型" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in projectTypeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.liableUserId" v-permission="permission.master" clearable filterable placeholder="责任人" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.id" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="requirement" label="需求说明" width="140" /> |
| | | <el-table-column v-if="userRolesLevelMin != roleLevelOrdinary" :show-overflow-tooltip="true" prop="contractPrice" label="合同总金额" width="100"> |
| | | <el-table-column v-permission="permission.master" :show-overflow-tooltip="true" prop="contractPrice" label="合同总金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.contractPrice != null && scope.row.contractPrice != '' ? crud.toMoney(scope.row.contractPrice) : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="totalTaskTime" label="任务总工时" width="100" /> |
| | | <el-table-column v-if="userRolesLevelMin != roleLevelOrdinary" label="报价"> |
| | | <el-table-column v-permission="permission.master" label="报价"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="quotationPrice" label="单金" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.quotationPrice) }} |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import { mapGetters } from 'vuex' |
| | | import moneyInput from '../../assembly/moneyInput/index.vue' |
| | | import constant from '../../../utils/constant' |
| | | import moneyInput from '@/views/assembly/moneyInput/index.vue' |
| | | import constant from '@/utils/constant' |
| | | |
| | | const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, liableUserId: null, planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | |
| | | download: ['admin', 'project:download'], |
| | | admit: ['admin', 'project:admit'], |
| | | seeTask: ['admin', 'project:seeTask'], |
| | | seeCost: ['admin', 'project:seeCost'] |
| | | seeCost: ['admin', 'project:seeCost'], |
| | | master: ['admin', 'project:master'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | |
| | | type="month" |
| | | style="width: 200px;" |
| | | placeholder="请选择" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :disabled="disabledFlagByApprove" |
| | | @change="getUserLevel" |
| | | /> |
| | |
| | | import crudUserLevelOther from '@/api/system/userLevelOther' |
| | | import crudAttendance from '@/api/attendance/attendance' |
| | | import crudTaskDaliy from '@/api/task/taskDaliy' |
| | | import crudProjectPerformanceDetail from '@/api/project/projectPerformanceDetail' |
| | | import crudSysConfigIndividualIncomeTax from '@/api/system/configIndividualIncomeTax' |
| | | |
| | | const defaultForm = { id: null, userId: null, salaryYearMonth: null, levelWage: null, basicWageProportion: null, basicWage: null, fullDays: null, absenceDays: null, actualBasicWage: null, achievementsWageProportion: null, achievementsWage: null, needCompletedAchievementsHours: null, alreadyCompletedAchievementsHours: null, actualAchievementsWage: null, performanceWageProportion: null, performanceWage: null, personalPerformanceProportion: null, needCompletedPerformanceHours: null, alreadyCompletedPerformanceHours: null, actualPerformanceWage: null, teamWageProportion: null, teamWage: null, actualComplianceTeamHours: null, alreadyCompletedTeamHours: null, actualTeamWage: null, accumulationRadix: null, accumulationPersonalProportion: null, accumulationPersonalAmount: null, accumulationCompanyProportion: null, accumulationCompanyAmount: null, pensionRadix: null, pensionPersonalProportion: null, pensionPersonalAmount: null, pensionCompanyProportion: null, pensionCompanyAmount: null, medicalRadix: null, medicalPersonalProportion: null, medicalPersonalAmount: null, medicalCompanyProportion: null, medicalCompanyAmount: null, unemploymentRadix: null, unemploymentPersonalProportion: null, unemploymentPersonalAmount: null, unemploymentCompanyProportion: null, unemploymentCompanyAmount: null, maternityRadix: null, maternityPersonalProportion: null, maternityPersonalAmount: null, maternityCompanyProportion: null, maternityCompanyAmount: null, industrialInjuryRadix: null, industrialInjuryPersonalProportion: null, industrialInjuryPersonalAmount: null, industrialInjuryCompanyProportion: null, industrialInjuryCompanyAmount: null, preTaxAmount: null, individualIncomeTax: null, afterTaxAmount: null, remarks: null, publicityStatus: constant.PUBLICITY_STATUS_NOT, approveStatus: constant.APPROVE_STATUS_UNRECOGNIZED, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | |
| | | getComplianceWork() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取达标工时 |
| | | crudTaskDaliy.complianceWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | crudProjectPerformanceDetail.complianceWork({ userId: this.form.userId, yearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 实达标团队工时 |
| | | this.form.actualComplianceTeamHours = Number(res.toFixed(2)) |
| | | // 成功 |
| | |
| | | // 判断预计团队工资、实达标团队工时是否为空 |
| | | if (this.form.teamWage != null && this.form.teamWage !== '' && this.form.actualComplianceTeamHours != null && this.form.actualComplianceTeamHours !== '') { |
| | | // 实际团队工资 |
| | | this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / res)).toFixed(2) : 0) |
| | | this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.needCompletedAchievementsHours)).toFixed(2) : 0) |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 清空团队定时器 |
| | |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '节日配置', url: 'api/sysConfigHoliday', idField: 'id', sort: 'id,desc', crudMethod: { ...crudConfigHoliday }}) |
| | | return CRUD({ title: '节日配置', url: 'api/sysConfigHoliday', idField: 'id', sort: 'holidayDate,desc', crudMethod: { ...crudConfigHoliday }}) |
| | | }, |
| | | // 数据字典 |
| | | dicts: [constant.DATE_TYPE], |