| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | |
| | | |
| | | @ApiOperation("获取同行人") |
| | | @GetMapping("/peerList") |
| | | public AjaxResult peerList(String nickName, String deptId) |
| | | @Cacheable(value = "sysUser:peerList") |
| | | public AjaxResult peerList(String nickName, Long deptId) |
| | | { |
| | | String queryScope = " (dept_id = {} OR dept_id IN ( SELECT dept_id FROM sys_dept WHERE find_in_set({}, ancestors) )) "; |
| | | if (deptId==null){ |
| | | deptId = deptService.getCheckDeptIdByLoginDeptId(SecurityUtils.getDeptId()); |
| | | } else { |
| | | deptId = deptService.getCheckDeptIdByLoginDeptId(deptId); |
| | | } |
| | | List<SysUser> list = userService.list(userService.lq() |
| | | .ne(SysUser::getUserType,"02") |
| | | .ne(SysUser::getUserName,"admin") |
| | | .ne(SysUser::getUserId, SecurityUtils.getUserId()) |
| | | .eq(StringUtils.isNotEmpty(nickName), SysUser::getNickName,nickName) |
| | | .eq(deptId!=null, SysUser::getDeptId,deptId) |
| | | .likeRight(StringUtils.isNotEmpty(nickName), SysUser::getNickName,nickName) |
| | | .apply( StringUtils.format(queryScope, deptId, deptId)) |
| | | ); |
| | | list.forEach(user->{ |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | |
| | | @GetMapping("/commonList") |
| | | public TableDataInfo commonList(EnforceOrderQueryBo bo) |
| | | { |
| | | Long loginDeptId = SecurityUtils.getDeptId(); |
| | | if (bo.getCheckDeptId()==null && !loginDeptId.equals(100L) && loginDeptId.equals(101L)) |
| | | { |
| | | bo.setCheckDeptId(deptService.getCheckDeptIdByLoginDeptId(loginDeptId)); |
| | | } |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.queryCommonList(bo); |
| | | return getDataTable(list); |
| | |
| | | @PostMapping("/doScanOrder/{orderId}") |
| | | public AjaxResult doScanOrder(@PathVariable("orderId") Long orderId) |
| | | { |
| | | return AjaxResult.success(iEnforceOrderService.doScanOrder(orderId)); |
| | | return toAjax(iEnforceOrderService.doScanOrder(orderId)); |
| | | } |
| | | |
| | | @ApiOperation("上报结果") |
| | |
| | | @ApiOperation("执法单投诉") |
| | | @Log(title = "执法单投诉", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/orderComplaint") |
| | | public AjaxResult orderComplaint(OrderComplaintBo bo) |
| | | public AjaxResult orderComplaint(@RequestBody OrderComplaintBo bo) |
| | | { |
| | | return AjaxResult.success(iEnforceOrderService.orderComplaint(bo)); |
| | | return toAjax(iEnforceOrderService.orderComplaint(bo)); |
| | | } |
| | | |
| | | @ApiOperation("执法单投诉节点") |
| | |
| | | { |
| | | return toAjax(iEnforceOrderService.deleteByIds(Arrays.asList(orderIds)) ? 1 : 0); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("企业确认——执法单") |
| | | //@PreAuthorize("@ss.hasPermi('enforce:order:remove')") |
| | | @Log(title = "企业确认执法单" , businessType = BusinessType.UPDATE) |
| | | @PostMapping("/confirm/{orderId}") |
| | | @RepeatSubmit |
| | | public AjaxResult remove(@PathVariable Long orderId) |
| | | { |
| | | return toAjax(iEnforceOrderService.confirm(orderId) ? 1 : 0); |
| | | } |
| | | } |