| | |
| | | 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)); |
| | | } |
| | | |