| | |
| | | // 合同费用类型:合同收入 |
| | | public static final String CONTRACR_REVENUE = "contract_revenue"; |
| | | |
| | | // 绩效类型 |
| | | public static final String PERFORMANCE_TYPE = "performance_type"; |
| | | // 绩效类型:非绩效对象 |
| | | public static final String PERFORMANCE_TYPE_OFF = "0"; |
| | | // 绩效类型:绩效对象 |
| | | public static final String PERFORMANCE_TYPE_ON = "1"; |
| | | |
| | | public static final String DAILY_PAYROLL_EXPEND = "工资流水支出"; |
| | | public static final String ASSET_FLOW_EXPEND_G = "固定资产支出"; |
| | | public static final String ASSET_FLOW_EXPEND_L = "流动资产支出"; |
| | |
| | | @ApiModelProperty(value = "任务分类") |
| | | private String taskClassification; |
| | | |
| | | @Column(name = "`performance_type`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "绩效类型") |
| | | private String performanceType; |
| | | |
| | | @Column(name = "`description`") |
| | | @ApiModelProperty(value = "描述") |
| | | private String description; |
| | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description / |
| | |
| | | /** 任务分类 */ |
| | | private String taskClassification; |
| | | |
| | | /** 绩效类型 */ |
| | | private String performanceType; |
| | | |
| | | /** 描述 */ |
| | | private String description; |
| | | |
| | |
| | | checkAddOrUpdateOrDelete(resources); |
| | | // 新增修改验证 |
| | | checkAddOrUpdate(resources); |
| | | |
| | | TaskUser taskUser = taskUserRepository.findByTaskIdAndUserId(resources.getTaskId(), resources.getUserId()); |
| | | if (Constant.TASK_STATUS_NOT_STARTED.equals(taskUser.getTaskStatus())) { |
| | | taskUser.setTaskStatus(Constant.TASK_STATUS_IN_HAND); |
| | | taskUserRepository.save(taskUser); |
| | | } |
| | | return taskDaliyMapper.toDto(taskDaliyRepository.save(resources)); |
| | | } |
| | | |
| | |
| | | // 新增修改验证 |
| | | checkAddOrUpdate(resources); |
| | | taskDaliy.copy(resources); |
| | | |
| | | TaskUser taskUser = taskUserRepository.findByTaskIdAndUserId(resources.getTaskId(), resources.getUserId()); |
| | | if (Constant.TASK_STATUS_NOT_STARTED.equals(taskUser.getTaskStatus())) { |
| | | taskUser.setTaskStatus(Constant.TASK_STATUS_IN_HAND); |
| | | taskUserRepository.save(taskUser); |
| | | } |
| | | |
| | | taskDaliyRepository.save(taskDaliy); |
| | | } |
| | | |
| | |
| | | // 根据项目ID、任务ID、用户ID查询填报日期后最近的任务日报信息 |
| | | TaskDaliy nextTaskDaliy = taskDaliyRepository.findNextByProjectIdAndTaskIdAndAndUserId(resources.getProjectId(), resources.getTaskId(), resources.getUserId(), resources.getFillDate()); |
| | | // 判断任务进度是否比前一次多,比后一次少 |
| | | if ((previousTaskDaliy != null && resources.getTaskProgress() <= previousTaskDaliy.getTaskProgress()) || (nextTaskDaliy != null && resources.getTaskProgress() >= nextTaskDaliy.getTaskProgress())) { |
| | | if ((previousTaskDaliy != null && resources.getTaskProgress() < previousTaskDaliy.getTaskProgress()) || (nextTaskDaliy != null && resources.getTaskProgress() > nextTaskDaliy.getTaskProgress())) { |
| | | throw new BadRequestException("任务进度必须比前一次多且比后一次少!"); |
| | | } |
| | | } |
| | |
| | | if (taskDaliyMonthList.size() != 0) { |
| | | // 获取本月任务日报中所有任务ID |
| | | List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).distinct().collect(Collectors.toList()); |
| | | // 获取对应的任务 |
| | | Map<Long, Task> taskMap = taskRepository.findAllById(taskIds).stream().collect(Collectors.toMap(Task::getId,Function.identity())); |
| | | // 获取本月任务分配列表 |
| | | List<TaskUser> taskUserMonthList = taskUserRepository.findByUserIdAndTaskIdIn(criteria.getUserId(), taskIds); |
| | | // 日历类 |
| | |
| | | // 本日任务日报 |
| | | TaskDaliy taskDaliyDay = taskDaliyDayList.get(j); |
| | | // 本日任务分配列表 |
| | | List<TaskUser> taskUserDayList = taskUserMonthList.stream().filter(item -> item.getTaskId() == taskDaliyDay.getTaskId()).collect(Collectors.toList()); |
| | | List<TaskUser> taskUserDayList = taskUserMonthList.stream().filter(item -> item.getTaskId().equals(taskDaliyDay.getTaskId())).collect(Collectors.toList()); |
| | | // 判断本日任务分配列表数量 |
| | | if (taskUserDayList.size() > 1) { |
| | | throw new BadRequestException("任务存在多次分配同一人情况!"); |
| | |
| | | } |
| | | // 本日任务分配 |
| | | TaskUser taskUserDay = taskUserDayList.get(0); |
| | | // 根据项目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("任务日报进度计算存在异常!"); |
| | | } |
| | | Task task = taskMap.get(taskUserDay.getTaskId()); |
| | | if (Constant.PERFORMANCE_TYPE_ON.equals(task.getPerformanceType())) { |
| | | // 根据项目ID、任务ID、用户ID查询填报日期前最近的任务日报信息 |
| | | TaskDaliy taskDaliyHistory = taskDaliyRepository.findPreviousByProjectIdAndTaskIdAndAndUserId(taskDaliyDay.getProjectId(), taskDaliyDay.getTaskId(), taskDaliyDay.getUserId(), taskDaliyDay.getFillDate()); |
| | | // 本日任务日报进度 |
| | | taskDaliyDayProgress = taskDaliyDayProgress - taskDaliyHistoryProgress; |
| | | Double taskDaliyDayProgress = taskDaliyDay.getTaskProgress(); |
| | | // 判断最近的任务日报是否为空 |
| | | if (taskDaliyHistory != null) { |
| | | // 本日任务日报相关历史进度 |
| | | Double taskDaliyHistoryProgress = taskDaliyHistory.getTaskProgress(); |
| | | // 判断进度是否正常 |
| | | if (taskDaliyDayProgress - taskDaliyHistoryProgress <= 0) { |
| | | throw new BadRequestException("任务日报进度计算存在异常!"); |
| | | } |
| | | // 本日任务日报进度 |
| | | taskDaliyDayProgress = taskDaliyDayProgress - taskDaliyHistoryProgress; |
| | | } |
| | | // 已完成工时 |
| | | completedWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100); |
| | | } else { |
| | | // 已完成工时 |
| | | completedWork += taskDaliyDay.getConsumedHours(); |
| | | } |
| | | // 已完成工时 |
| | | completedWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100); |
| | | |
| | | // 本日任务日报 |
| | | taskDaliyDay.setSettlementStatus(Constant.SETTLEMENT_STATUS_SETTLED); |
| | | // 保存本日任务日报 |
| | |
| | | // 任务分类:障碍 |
| | | export const TASK_CLASSIFICATION_OBSTACLE = 'task_classification_obstacle' |
| | | |
| | | // 绩效类型 |
| | | export const PERFORMANCE_TYPE = 'performance_type' |
| | | |
| | | // 考勤状态 |
| | | export const ATTENDANCE_STATE = 'attendance_state' |
| | | // 考勤状态:等待 |
| | |
| | | TAST_CLASSIFICATION, |
| | | TASk_CLASSIFICATION_FUNCTION, |
| | | TASK_CLASSIFICATION_OBSTACLE, |
| | | PERFORMANCE_TYPE, |
| | | ATTENDANCE_STATE, |
| | | ATTENDANCE_STATE_WAITFOR, |
| | | ATTENDANCE_STATE_NORMAL, |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="合同总金额" prop="contractPrice"> |
| | | <money-input :key="random" v-model="form.contractPrice" :width="200" :disabled="disabledFlagByApprove" /> |
| | | <money-input :key="random" v-model="form.contractPrice" :width="200" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划开始日期" prop="planStartDate"> |
| | | <el-date-picker v-model="form.planStartDate" type="date" :picker-options="pickerOptionsStart" placeholder="选择日期" style="width: 200px;" /> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table ref="table" v-loading="crud.loading" show-summary :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="projectName" label="所属项目" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table ref="table" v-loading="crud.loading" show-summary :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column show-overflow-tooltip prop="name" label="名称" width="180" /> |
| | | <el-table-column show-overflow-tooltip prop="projectName" label="所属项目" width="180"> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="绩效类型" prop="performanceType"> |
| | | <el-select v-model="form.performanceType" filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in dict[performanceType]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="描述"> |
| | | <el-input v-model="form.description" :rows="3" type="textarea" style="width: 340px;" /> |
| | | </el-form-item> |
| | |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskClassification" label="任务分类" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[taskClassification][scope.row.taskClassification] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="performanceType" label="绩效类型" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[performanceType][scope.row.performanceType] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="description" label="描述" width="140" /> |
| | |
| | | import crudProject from '@/api/project/project' |
| | | import crudUser from '@/api/system/user' |
| | | |
| | | const defaultForm = { id: null, name: null, projectId: null, pid: null, priority: null, taskClassification: null, description: null, planStartTime: null, planEndTime: null, planHours: null, planWorkload: null, planWorkloadUnit: null, taskStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, name: null, projectId: null, pid: null, priority: null, taskClassification: null, performanceType: null, description: null, planStartTime: null, planEndTime: null, planHours: null, planWorkload: null, planWorkloadUnit: null, taskStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'Task', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.PRIORITY, constant.TAST_CLASSIFICATION, constant.STANDARD_WORKLOAD_UNIT, constant.TASK_STATUS], |
| | | dicts: [constant.PRIORITY, constant.TAST_CLASSIFICATION, constant.PERFORMANCE_TYPE, constant.STANDARD_WORKLOAD_UNIT, constant.TASK_STATUS], |
| | | cruds() { |
| | | return CRUD({ title: '任务', url: 'api/task', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTask }}) |
| | | }, |
| | |
| | | priority: constant.PRIORITY, |
| | | // 字典:任务分类 |
| | | taskClassification: constant.TAST_CLASSIFICATION, |
| | | // 字典: 绩效类型 |
| | | performanceType: constant.PERFORMANCE_TYPE, |
| | | // 字典:标准工作量单位 |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:任务状态 |