| | |
| | | import com.project.common.annotation.RepeatSubmit; |
| | | import com.project.common.core.controller.BaseController; |
| | | import com.project.common.core.domain.AjaxResult; |
| | | import com.project.common.core.domain.entity.SysDept; |
| | | import com.project.common.core.domain.entity.SysUser; |
| | | import com.project.common.core.page.TableDataInfo; |
| | | import com.project.common.enums.BusinessType; |
| | | import com.project.common.utils.SecurityUtils; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.utils.poi.ExcelUtil; |
| | | import com.project.enforce.domain.bo.editBo.EnforceOrderBo; |
| | | import com.project.enforce.domain.bo.editBo.OrderComplaintBo; |
| | | import com.project.enforce.domain.bo.editBo.OrderResultBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceOrderQueryBo; |
| | | import com.project.enforce.domain.bo.queryBo.OrderCheckedQueryBo; |
| | | import com.project.enforce.domain.vo.EnforceOrderVo; |
| | | import com.project.enforce.domain.vo.OrderNodeVo; |
| | | import com.project.enforce.service.IEnforceOrderService; |
| | | import com.project.system.service.ISysDeptService; |
| | | import com.project.system.service.ISysUserService; |
| | | import io.swagger.annotations.Api; |
| | | 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; |
| | |
| | | public class EnforceOrderController extends BaseController { |
| | | |
| | | private final IEnforceOrderService iEnforceOrderService; |
| | | private final ISysUserService userService; |
| | | private final ISysDeptService deptService; |
| | | |
| | | @ApiOperation("获取同行人") |
| | | @GetMapping("/peerList") |
| | | @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()) |
| | | .likeRight(StringUtils.isNotEmpty(nickName), SysUser::getNickName,nickName) |
| | | .apply( StringUtils.format(queryScope, deptId, deptId)) |
| | | ); |
| | | list.forEach(user->{ |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | | sysDept.setDeptName(deptService.getDeptAllName(sysDept.getDeptId())); |
| | | user.setDept(sysDept); |
| | | }); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation("查询执法单列表") |
| | | @ApiOperation("列表——无特殊查询") |
| | | @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); |
| | | } |
| | | |
| | | @ApiOperation("列表——企业执法记录") |
| | | @GetMapping("/companyList") |
| | | public TableDataInfo companyList(EnforceOrderQueryBo bo) |
| | | { |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.queryCompanyList(bo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("列表——执法申请单") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EnforceOrderQueryBo bo) |
| | | { |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("列表——执法执行单") |
| | | @GetMapping("/execute/list") |
| | | public TableDataInfo executeList(EnforceOrderQueryBo bo) |
| | | { |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.getExecuteList(bo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("查询执法单待审批列表") |
| | | @ApiOperation("列表——信息公式") |
| | | @GetMapping("/showList") |
| | | public TableDataInfo showList() |
| | | { |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.showList(); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("列表——审批人待审批") |
| | | @GetMapping("/checkList") |
| | | public TableDataInfo checkList(EnforceOrderQueryBo bo) |
| | | { |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("列表——审批记录") |
| | | @GetMapping("/checkedList") |
| | | public TableDataInfo checkedList(OrderCheckedQueryBo bo) |
| | | { |
| | | startPage(); |
| | | List<EnforceOrderVo> list = iEnforceOrderService.queryCheckedList(bo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation("执法人扫码") |
| | | @GetMapping("/getScanList") |
| | | public AjaxResult scan(@RequestParam("companyCode") String companyCode) |
| | | { |
| | | List<EnforceOrderVo> list = iEnforceOrderService.getScanList(companyCode); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation("确认执法") |
| | | @Log(title = "执法队员确认执法", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/doScanOrder/{orderId}") |
| | | public AjaxResult doScanOrder(@PathVariable("orderId") Long orderId) |
| | | { |
| | | return toAjax(iEnforceOrderService.doScanOrder(orderId)); |
| | | } |
| | | |
| | | @ApiOperation("上报结果") |
| | | @Log(title = "执法队员上报结果", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/doResultOrder") |
| | | public AjaxResult doResultOrder(@RequestBody OrderResultBo resultBo) |
| | | { |
| | | return AjaxResult.success(iEnforceOrderService.doResultOrder(resultBo)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("执法单节点") |
| | | @GetMapping("/orderNodeList") |
| | | public AjaxResult orderNodeList(@RequestParam("orderId") Long orderId) |
| | | { |
| | | List<OrderNodeVo> list = iEnforceOrderService.orderNodeList(orderId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation("执法单投诉") |
| | | @Log(title = "执法单投诉", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/orderComplaint") |
| | | public AjaxResult orderComplaint(@RequestBody OrderComplaintBo bo) |
| | | { |
| | | return toAjax(iEnforceOrderService.orderComplaint(bo)); |
| | | } |
| | | |
| | | @ApiOperation("执法单投诉节点") |
| | | @GetMapping("/orderComplaintNodeList") |
| | | public AjaxResult orderComplaintNodeList(@RequestParam("orderId") Long orderId) |
| | | { |
| | | List<OrderNodeVo> list = iEnforceOrderService.orderComplaintNodeList(orderId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation("导出执法单列表") |
| | | //@PreAuthorize("@ss.hasPermi('enforce:order:export')") |
| | |
| | | { |
| | | return AjaxResult.success(iEnforceOrderService.queryById(orderId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @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); |
| | | } |
| | | } |