| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | private TFeedbackService feedbackService; |
| | | @Resource |
| | | private TProblemEscalationService problemEscalationService; |
| | | |
| | | /** |
| | | * 生成数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "测试接口不要调") |
| | | |
| | | @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); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "个人中心-首页") |
| | | @PostMapping(value = "/userIndex") |
| | |
| | | @ApiOperation(value = "申诉记录分页列表") |
| | | @PostMapping(value = "/appealList") |
| | | public R<PageInfo<AppealListVO>> pageListUser(@RequestBody AppealListQuery query) { |
| | | query.setUserId(tokenService.getLoginUserApplet().getUserId()+""); |
| | | return R.ok(appealService.pageListUser(query)); |
| | | } |
| | | @ApiOperation(value = "详情申诉记录") |
| | |
| | | appealDetailVO.setLocationIcon(byId2.getLocationIcon()); |
| | | appealDetailVO.setLocationName(byId2.getLocationName()); |
| | | appealDetailVO.setTaskId(byId.getId()); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson())); |
| | | if (sysUser!=null){ |
| | | appealDetailVO.setAuditPersonName(sysUser.getUserName()); |
| | | if (StringUtils.hasLength(appeal.getAuditPerson())){ |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson())); |
| | | if (sysUser!=null){ |
| | | appealDetailVO.setAuditPersonName(sysUser.getUserName()); |
| | | } |
| | | } |
| | | appealDetailVO.setTaskName(byId.getTaskName()); |
| | | appealDetailVO.setTaskCode(byId.getTaskCode()); |
| | | return R.ok(appealDetailVO); |
| | | } |
| | | |
| | | @Log(title = "取消申诉记录", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "取消申诉记录") |
| | | @GetMapping(value = "/cancelAppeal") |
| | |
| | | @ApiOperation(value = "上传督察任务") |
| | | @PostMapping(value = "/addInspector") |
| | | public R<Boolean> addInspector(@RequestBody InspectorAddDTO dto) { |
| | | dto.setCommitPerson(tokenService.getLoginUser().getUserId()+""); |
| | | dto.setCommitPerson(tokenService.getLoginUserApplet().getUserId()+""); |
| | | if (dto.getClearStatus()==1){ |
| | | dto.setStatus(4); |
| | | }else{ |
| | |
| | | @ApiOperation(value = "上传意见反馈") |
| | | @PostMapping(value = "/addFeedback") |
| | | public R<Boolean> addFeedback(@RequestBody FeedbackDTO dto) { |
| | | dto.setFeedbackPerson(tokenService.getLoginUser().getUserId()+""); |
| | | dto.setFeedbackPerson(tokenService.getLoginUserApplet().getUserId()+""); |
| | | feedbackService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "上传问题上报") |
| | | @PostMapping(value = "/addProblem") |
| | | public R<Boolean> addProblem(@RequestBody ProblemDTO dto) { |
| | | dto.setEscalationId(tokenService.getLoginUser().getUserId()+""); |
| | | dto.setEscalationId(tokenService.getLoginUserApplet().getUserId()+""); |
| | | problemEscalationService.save(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | @GetMapping(value = "/leaveAuditList") |
| | | public R<LeaveAuditListVO> leaveAuditList() { |
| | | LeaveAuditListVO res = new LeaveAuditListVO(); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | SysUser user = sysUserService.selectUserById(userId); |
| | | Long userRole = sysUserService.getUserRole(userId); |
| | | SysRole sysRole = roleService.selectRoleById(userRole); |
| | |
| | | res.setCopyPerson(leaveAuditVOS); |
| | | return R.ok(res); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String temp = "2025-06-30 00:00:00"; |
| | | // 轉化爲localdateTime |
| | | LocalDateTime parse = LocalDateTime.parse(temp, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | System.out.println(parse); |
| | | } |
| | | @ApiOperation(value = "发起请假") |
| | | @PostMapping(value = "/addLeave") |
| | | public R addLeave(@RequestBody LeaveDTO leaveDTO) { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | // String startTime1 = leaveDTO.getStartTime1(); |
| | | // // 轉化爲LocalDateTime類型 |
| | | // leaveDTO.setStartTime(LocalDateTime.parse(startTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | // String endTime1 = leaveDTO.getEndTime1(); |
| | | // // 轉化爲LocalDateTime類型 |
| | | // leaveDTO.setStartTime(LocalDateTime.parse(endTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | SysUser user = sysUserService.selectUserById(userId); |
| | | Long userRole = sysUserService.getUserRole(userId); |
| | | SysRole sysRole = roleService.selectRoleById(userRole); |
| | |
| | | @ApiOperation(value = "我的审批-我的申请") |
| | | @PostMapping(value = "/leaveList") |
| | | public R<PageInfo<LeaveUserListVO>> leaveList(@RequestBody LeaveListUserQuery query) { |
| | | query.setUserId(tokenService.getLoginUser().getUserId()+""); |
| | | query.setUserId(tokenService.getLoginUserApplet().getUserId()+""); |
| | | return R.ok( leaveService.leaveList(query)); |
| | | } |
| | | @ApiOperation(value = "我的审批-审批") |
| | | @PostMapping(value = "/auditLeave") |
| | | public R<Boolean> auditLeave(@RequestBody LeaveAuditDTO dto) { |
| | | dto.setAuditId(tokenService.getLoginUser().getUserId()+""); |
| | | dto.setAuditId(tokenService.getLoginUserApplet().getUserId()+""); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | leaveService.updateById(dto); |
| | | return R.ok(); |