| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | |
| | | public ResponseEntity<Object> getAllTaskUser(){ |
| | | return new ResponseEntity<>(taskUserService.getAllTaskUser(SecurityUtils.getCurrentUserId()),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/changeStatus") |
| | | public ResponseEntity<Object> changeStatus(String[] changesId){ |
| | | taskUserService.changeStatus(changesId); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | List<TaskUserMongoDto> getTaskNotStarted(); |
| | | |
| | | List<TaskUserMongoDto> getAllTaskUser(Long userId); |
| | | |
| | | void changeStatus(String[] ids); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void changeStatus(String[] ids) { |
| | | Arrays.stream(ids).forEach(item -> { |
| | | TaskUserMongo mongoTemplateById = mongoTemplate.findById(item, TaskUserMongo.class); |
| | | mongoTemplateById.setTaskStatus("task_status_completed"); |
| | | mongoTemplate.save(mongoTemplateById); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void addTaskUser(String taskId) { |
| | | //如果有用户认领了这个任务 |
| | | |
| | |
| | | taskUserMongoDto.setId(taskUserMongo.getId()); |
| | | taskUserMongoDto.setName(taskUserMongo.getName()); |
| | | taskUserMongoDto.setOld_id(taskUserMongo.getTask().getOld_id()); |
| | | |
| | | if(taskUserMongo.getTaskStatus().equals("task_status_completed")){ |
| | | taskUserMongoDto.setIs_ok(true); |
| | | } |
| | | if (taskUserMongo.getUserId() != null) { |
| | | taskUserMongoDto.setUserId(taskUserMongo.getUserId()); |
| | | UserDto userDto = userService.findById(taskUserMongo.getUserId()); |
| | |
| | | Double coefficientByUserId; |
| | | if(resources.isIs_ok()){ |
| | | taskUserMongo.setTaskStatus("task_status_completed"); |
| | | }else { |
| | | taskUserMongo.setTaskStatus("task_status_in_hand"); |
| | | } |
| | | |
| | | if (resources.getUserId() == null) { |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, calcHours, getTaskUserIds, getSum, addTaskUser, getAdventTasks, getOngoingTasks, getTaskNotStarted, getAllTaskUser } |
| | | export function changeStatus(params) { |
| | | return request({ |
| | | url: 'api/taskUser/changeStatus?changesId=' + params, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, calcHours, getTaskUserIds, getSum, addTaskUser, getAdventTasks, getOngoingTasks, getTaskNotStarted, getAllTaskUser, changeStatus } |
| | |
| | | </el-form-item> |
| | | <el-form-item v-if="form.newTaskProgress === 100" label="任务状态"> |
| | | <el-switch |
| | | v-model="form.Is_ok" |
| | | v-model="form.is_ok" |
| | | v-permission="permission.list" |
| | | active-text="已完成" |
| | | /> |
| | |
| | | <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table |
| | | ref="table" |
| | | v-loading="crud.loading" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="performanceHours" label="绩效工时" width="80" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="newTaskProgress" label="任务进度" width="80" /> |
| | | <el-table-column :show-overflow-tooltip="true" label="任务进度" width="80"> |
| | | <template slot-scope="scope"> |
| | | <span style="margin-left: 10px">{{ scope.row.newTaskProgress }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[taskStatus][scope.row.taskStatus] }}</el-tag> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--表格渲染--> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | <!--表单组件--> |
| | |
| | | import { mapGetters } from 'vuex' |
| | | import constant from '@/utils/constant' |
| | | import UploadExcelComponent from '@/components/UploadExcel/index.vue' |
| | | const defaultForm = { id: null, userId: null, projectId: null, task: { id: null }, taskStartDate: null, taskEndDate: null, taskHours: null, newTaskProgress: null, taskStatus: null, remarks: null, divideUserIds: [], Is_ok: false } |
| | | const defaultForm = { id: null, userId: null, projectId: null, task: { id: null }, taskStartDate: null, taskEndDate: null, taskHours: null, newTaskProgress: null, taskStatus: null, remarks: null, divideUserIds: [], is_ok: null } |
| | | export default { |
| | | name: 'TaskUser', |
| | | // eslint-disable-next-line vue/no-unused-components |
| | |
| | | }) |
| | | }, |
| | | taskCompleted() { |
| | | |
| | | const selectData = this.$refs.table.selection |
| | | var changesId = [] |
| | | for (var i = 0; i < selectData.length; i++) { |
| | | if (selectData[i].newTaskProgress !== 100) { |
| | | this.$notify.error({ |
| | | title: '任务进度未达到100%' |
| | | }) |
| | | return |
| | | } |
| | | changesId.push(selectData[i].id) |
| | | } |
| | | // 当程序执行到这里时,说明选择的都是已经达到100的任务 |
| | | crudTaskUser.changeStatus(changesId).then(res => { |
| | | this.crud.toQuery() |
| | | this.$notify.success({ |
| | | title: '确认成功' |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |