| | |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.applet.dto.*; |
| | | import com.ruoyi.system.applet.query.AppealListQuery; |
| | | import com.ruoyi.system.applet.query.KnowledgeListUserQuery; |
| | | import com.ruoyi.system.applet.query.LeaveListUserQuery; |
| | | import com.ruoyi.system.applet.query.TaskUserListQuery; |
| | | import com.ruoyi.system.applet.query.*; |
| | | import com.ruoyi.system.applet.vo.*; |
| | | import com.ruoyi.system.dto.KnowledgeDTO; |
| | | import com.ruoyi.system.dto.TTaskAuditBatchDTO; |
| | |
| | | private TFeedbackService feedbackService; |
| | | @Resource |
| | | private TProblemEscalationService problemEscalationService; |
| | | |
| | | @Resource |
| | | private TNoticeService noticeService; |
| | | @ApiOperation(value = "消息通知列表") |
| | | @PostMapping(value = "/noticeList") |
| | | public R<PageInfo<NoticeListVO>> noticeList(@RequestBody NoticeListQuery query) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setUserId(userId+""); |
| | | return R.ok(noticeService.noticeList(query)); |
| | | } |
| | | /** |
| | | * 生成数据 |
| | | * @param id |
| | |
| | | |
| | | @GetMapping(value = "/testData") |
| | | public R<AppealDetailVO> testData(@RequestParam String id) { |
| | | List<TAppeal> tAppeals = new ArrayList<>(); |
| | | for (int i = 0; i < 25; i++) { |
| | | TAppeal tAppeal = new TAppeal(); |
| | | tAppeal.setTaskId("1938536771253641217"); |
| | | tAppeal.setAppealPerson("152"); |
| | | tAppeal.setStatus(1); |
| | | tAppeal.setAppealContent("申诉"); |
| | | tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | tAppeals.add(tAppeal); |
| | | } |
| | | appealService.saveBatch(tAppeals); |
| | | List<TAppeal> tAppeals1 = new ArrayList<>(); |
| | | for (int i = 0; i < 25; i++) { |
| | | TAppeal tAppeal = new TAppeal(); |
| | | tAppeal.setTaskId("1938536771253641217"); |
| | | tAppeal.setAppealPerson("152"); |
| | | tAppeal.setStatus(2); |
| | | tAppeal.setAppealContent("申诉"); |
| | | tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | tAppeal.setAuditPerson("162"); |
| | | tAppeal.setAuditRemark("备注"); |
| | | tAppeal.setAuditTime(LocalDateTime.now()); |
| | | tAppeals1.add(tAppeal); |
| | | } |
| | | appealService.saveBatch(tAppeals1); |
| | | List<TAppeal> tAppeals2 = new ArrayList<>(); |
| | | for (int i = 0; i < 25; i++) { |
| | | TAppeal tAppeal = new TAppeal(); |
| | | tAppeal.setTaskId("1938536771253641217"); |
| | | tAppeal.setAppealPerson("152"); |
| | | tAppeal.setStatus(3); |
| | | tAppeal.setAppealContent("申诉"); |
| | | tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | tAppeal.setAuditPerson("162"); |
| | | tAppeal.setAuditRemark("备注"); |
| | | tAppeal.setAuditTime(LocalDateTime.now()); |
| | | tAppeals2.add(tAppeal); |
| | | } |
| | | appealService.saveBatch(tAppeals2); |
| | | List<TAppeal> tAppeals3 = new ArrayList<>(); |
| | | for (int i = 0; i < 25; i++) { |
| | | TAppeal tAppeal = new TAppeal(); |
| | | tAppeal.setTaskId("1938536771253641217"); |
| | | tAppeal.setAppealPerson("152"); |
| | | tAppeal.setStatus(4); |
| | | tAppeal.setAppealContent("申诉"); |
| | | tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | |
| | | tAppeals3.add(tAppeal); |
| | | |
| | | } |
| | | appealService.saveBatch(tAppeals3); |
| | | // List<TAppeal> tAppeals = new ArrayList<>(); |
| | | // for (int i = 0; i < 25; i++) { |
| | | // TAppeal tAppeal = new TAppeal(); |
| | | // tAppeal.setTaskId("1938536771253641217"); |
| | | // tAppeal.setAppealPerson("152"); |
| | | // tAppeal.setStatus(1); |
| | | // tAppeal.setAppealContent("申诉"); |
| | | // tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | // tAppeals.add(tAppeal); |
| | | // } |
| | | // appealService.saveBatch(tAppeals); |
| | | // List<TAppeal> tAppeals1 = new ArrayList<>(); |
| | | // for (int i = 0; i < 25; i++) { |
| | | // TAppeal tAppeal = new TAppeal(); |
| | | // tAppeal.setTaskId("1938536771253641217"); |
| | | // tAppeal.setAppealPerson("152"); |
| | | // tAppeal.setStatus(2); |
| | | // tAppeal.setAppealContent("申诉"); |
| | | // tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | // tAppeal.setAuditPerson("162"); |
| | | // tAppeal.setAuditRemark("备注"); |
| | | // tAppeal.setAuditTime(LocalDateTime.now()); |
| | | // tAppeals1.add(tAppeal); |
| | | // } |
| | | // appealService.saveBatch(tAppeals1); |
| | | // List<TAppeal> tAppeals2 = new ArrayList<>(); |
| | | // for (int i = 0; i < 25; i++) { |
| | | // TAppeal tAppeal = new TAppeal(); |
| | | // tAppeal.setTaskId("1938536771253641217"); |
| | | // tAppeal.setAppealPerson("152"); |
| | | // tAppeal.setStatus(3); |
| | | // tAppeal.setAppealContent("申诉"); |
| | | // tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | // tAppeal.setAuditPerson("162"); |
| | | // tAppeal.setAuditRemark("备注"); |
| | | // tAppeal.setAuditTime(LocalDateTime.now()); |
| | | // tAppeals2.add(tAppeal); |
| | | // } |
| | | // appealService.saveBatch(tAppeals2); |
| | | // List<TAppeal> tAppeals3 = new ArrayList<>(); |
| | | // for (int i = 0; i < 25; i++) { |
| | | // TAppeal tAppeal = new TAppeal(); |
| | | // tAppeal.setTaskId("1938536771253641217"); |
| | | // tAppeal.setAppealPerson("152"); |
| | | // tAppeal.setStatus(4); |
| | | // tAppeal.setAppealContent("申诉"); |
| | | // tAppeal.setPictures("https://bjxj.oss-cn-guangzhou.aliyuncs.com/bjxj/88d2d5614fe6492bba5666a7ab01e76b.png"); |
| | | // |
| | | // tAppeals3.add(tAppeal); |
| | | // |
| | | // } |
| | | // appealService.saveBatch(tAppeals3); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | taskDetailVO.setLocationIcon(byId2.getLocationIcon()); |
| | | taskDetailVO.setLocationName(byId2.getLocationName()); |
| | | TTaskDetail tTaskDetail = list.stream().filter(e -> e.getHandleType() == 1).findFirst().orElse(null); |
| | | TTaskDetail tTaskDetailFinish = list.stream().filter(e -> e.getHandleType() == 2).findFirst().orElse(null); |
| | | if (tTaskDetail!=null && tTaskDetail.getUnqualified()!=null){ |
| | | TDictData byId3 = dictDataService.getById(tTaskDetail.getUnqualified()); |
| | | if (byId3!=null){ |
| | | tTaskDetail.setUnqualifiedName(byId3.getDataContent()); |
| | | } |
| | | } |
| | | if (tTaskDetailFinish!=null){ |
| | | tTaskDetailFinish.setFinishTime(tTaskDetailFinish.getCreateTime()); |
| | | } |
| | | taskDetailVO.setTaskDetail(tTaskDetail); |
| | | taskDetailVO.setRecords(list); |
| | |
| | | Long userRole = sysUserService.getUserRole(userId); |
| | | SysRole sysRole = roleService.selectRoleById(userRole); |
| | | List<SysUser> sysUsers = sysUserService.selectAllList(); |
| | | |
| | | sysRole.setRoleName("项目负责人"); |
| | | SysUser auditPerson = sysUserService.selectUserById(999L); |
| | | //项目负责人、部门负责人、公司成员提交由最终审批人审批; |
| | | if (user.getDeptType()==2 ||sysRole.getRoleName().contains("项目负责人")||sysRole.getRoleName().contains("部门负责人")){ |
| | |
| | | tLeaveAudit.setAvatar(auditPerson.getAvatar()); |
| | | tLeaveAudit.setNickName(auditPerson.getNickName()); |
| | | res.setAuditPerson(tLeaveAudit); |
| | | res.setAuditPersonId("999"); |
| | | }else if (!sysRole.getRoleName().equals("部门助理")){ |
| | | // 审批人根据当前角色类型来 |
| | | if (sysRole.getRoleName().contains("现场负责人")||sysRole.getRoleName().contains("组长")){ |
| | |
| | | tLeaveAudit.setAvatar(sysUser.getAvatar()); |
| | | tLeaveAudit.setNickName(sysUser.getNickName()); |
| | | res.setAuditPerson(tLeaveAudit); |
| | | res.setAuditPersonId(sysUser.getUserId()+""); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | tLeaveAudit.setAvatar(sysUser.getAvatar()); |
| | | tLeaveAudit.setNickName(sysUser.getNickName()); |
| | | res.setAuditPerson(tLeaveAudit); |
| | | res.setAuditPersonId(sysUser.getUserId()+""); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | // 生成随机数字6位 |
| | | String format = simpleDateFormat.format(date); |
| | | leaveDTO.setCode(format+ RandomUtil.randomNumbers(6)); |
| | | leaveDTO.setTemplateId(user.getTemplateId()); |
| | | leaveDTO.setLeavePerson(userId+""); |
| | | leaveService.save(leaveDTO); |
| | | sysRole.setRoleName("项目负责人"); |
| | | //项目负责人、部门负责人、公司成员提交由最终审批人审批; |
| | | if (user.getDeptType()==2 ||sysRole.getRoleName().contains("项目负责人")||sysRole.getRoleName().contains("部门负责人")){ |
| | | TLeaveAudit tLeaveAudit1 = new TLeaveAudit(); |
| | |
| | | @ApiOperation(value = "我的审批-详情") |
| | | @GetMapping(value = "/leaveDetail") |
| | | public R<LeaveUserDetailVO> leaveDetail(@RequestParam String id) { |
| | | TLeave leave = leaveService.getById(id); |
| | | LeaveUserDetailVO leaveUserDetailVO = new LeaveUserDetailVO(); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(leaveUserDetailVO.getLeavePerson())); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(leave.getLeavePerson())); |
| | | Long userRole = sysUserService.getUserRole(sysUser.getUserId()); |
| | | SysRole sysRole = roleService.selectRoleById(userRole); |
| | | sysRole.setRoleName("项目负责人"); |
| | | if (sysRole.getRoleName().contains("现场负责人")||sysRole.getRoleName().equals("组长")){ |
| | | if (sysUser.getDeptType() == 1){ |
| | | TProjectDept tProjectDept = projectDeptService.getById(sysUser.getDeptId()); |
| | |
| | | TDept byId = deptService.getById(sysUser.getDeptId()); |
| | | leaveUserDetailVO.setDeptName(byId.getDeptName()); |
| | | } |
| | | TLeave leave = leaveService.getById(id); |
| | | leaveUserDetailVO.setLeavePersonName(sysUser.getNickName()); |
| | | LeaveAuditListVO leaveAuditListVO = new LeaveAuditListVO(); |
| | | List<TLeaveAudit> list = leaveAuditService.list(new LambdaQueryWrapper<TLeaveAudit>() |
| | | .eq(TLeaveAudit::getAuditId, leave.getId())); |
| | | .eq(TLeaveAudit::getLeaveId, leave.getId())); |
| | | for (TLeaveAudit tLeaveAudit : list) { |
| | | if (tLeaveAudit.getAuditType()==1){ |
| | | LeaveAuditVO leaveAuditVO = new LeaveAuditVO(); |