| | |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateTimeUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | import org.sxkj.common.model.TimeRange; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.common.utils.TimeRangeUtils; |
| | | import org.sxkj.resource.dto.AttachDto; |
| | | import org.sxkj.resource.dto.WaylineJobInfoQueryDto; |
| | | import org.sxkj.resource.dto.WaylineJobInfoQueryParam; |
| | | import org.sxkj.resource.entity.Attach; |
| | | import org.sxkj.resource.feign.IAttachClient; |
| | | import org.sxkj.resource.param.AttachPageParam; |
| | | import org.sxkj.resource.param.AttachParam; |
| | | import org.sxkj.resource.service.IAttachService; |
| | | import org.sxkj.resource.vo.*; |
| | | import org.sxkj.system.vo.TreeVo; |
| | |
| | | |
| | | private final IAttachService attachService; |
| | | |
| | | private final IAttachClient attachClient; |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "附件详情", notes = "传入attach") |
| | | public R<Attach> detail(Attach attach) { |
| | | Attach detail = attachService.getOne(Condition.getQueryWrapper(attach)); |
| | | public R<Attach> detail(AttachParam attach) { |
| | | Attach detail = attachService.getOne(Wrappers.lambdaQuery(Attach.class).eq(Attach::getId, attach.getId())); |
| | | return R.data(detail); |
| | | } |
| | | |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "附件分页", notes = "传入attach") |
| | | public R<IPage<AttachVO>> page(AttachVO attach, Query query) { |
| | | String areaCode = HeaderUtils.getAreaCode(); |
| | | attach.setAreaCode(areaCode); |
| | | public R<IPage<AttachVO>> page(AttachPageParam attach, Query query) { |
| | | IPage<AttachVO> pages = attachService.selectAttachPage(Condition.getPage(query), attach); |
| | | AttachVO.settingNickName(pages.getRecords()); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入attach") |
| | | public R submit(@Valid @RequestBody Attach attach) { |
| | | public R submit(@Valid @RequestBody AttachDto attachDto) { |
| | | Attach attach = Objects.requireNonNull(BeanUtil.copy(attachDto, Attach.class)); |
| | | return R.status(attachService.saveOrUpdate(attach)); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 分页 附件表 |
| | | */ |
| | | // @GetMapping("/list") |
| | | // @ApiOperationSupport(order = 2) |
| | | // @ApiOperation(value = "附件分页", notes = "传入attach") |
| | | // public R<IPage<Attach>> list(Attach attach, Query query) { |
| | | // List<String> wayLineJobIds = attach.getWayLineJobIds(); |
| | | // QueryWrapper<Attach> queryWrapper1 = Condition.getQueryWrapper(attach); |
| | | // QueryWrapper<Attach> queryWrapper = queryWrapper1.in(!CollectionUtils.isEmpty(wayLineJobIds), "wayline_job_id", wayLineJobIds); |
| | | // queryWrapper.eq("is_deleted", 0); |
| | | // IPage<Attach> pages = attachService.page(Condition.getPage(query), queryWrapper); |
| | | // return R.data(pages); |
| | | // } |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "附件分页", notes = "传入attach") |
| | | public R<IPage<Attach>> list(Attach attach, Query query) { |
| | | List<String> wayLineJobIds = attach.getWayLineJobIds(); |
| | | QueryWrapper<Attach> queryWrapper1 = Condition.getQueryWrapper(attach); |
| | | QueryWrapper<Attach> queryWrapper = queryWrapper1.in(!CollectionUtils.isEmpty(wayLineJobIds), "wayline_job_id", wayLineJobIds); |
| | | queryWrapper.eq("is_deleted", 0); |
| | | IPage<Attach> pages = attachService.page(Condition.getPage(query), queryWrapper); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 附件表 |
| | |
| | | /** |
| | | * 新增 附件表 |
| | | */ |
| | | // @PostMapping("/save") |
| | | // @ApiOperationSupport(order = 4) |
| | | // @ApiOperation(value = "新增", notes = "传入attach") |
| | | // public R save(@Valid @RequestBody Attach attach) { |
| | | // return R.status(attachService.save(attach)); |
| | | // } |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入attach") |
| | | public R save(@Valid @RequestBody Attach attach) { |
| | | return R.status(attachService.save(attach)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 附件表 |
| | | */ |
| | | // @PostMapping("/update") |
| | | // @ApiOperationSupport(order = 5) |
| | | // @ApiOperation(value = "修改", notes = "传入attach") |
| | | // public R update(@Valid @RequestBody Attach attach) { |
| | | // return R.status(attachService.updateById(attach)); |
| | | // } |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入attach") |
| | | public R update(@Valid @RequestBody Attach attach) { |
| | | return R.status(attachService.updateById(attach)); |
| | | } |
| | | |
| | | |
| | | |