| | |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.resource.entity.Attach; |
| | | import org.springblade.modules.resource.service.IAttachService; |
| | | import org.springblade.modules.resource.vo.AttachVO; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 附件表 控制器 |
| | |
| | | public class AttachController extends BladeController { |
| | | |
| | | private final IAttachService attachService; |
| | | |
| | | private final MyAsyncService myAsyncService; |
| | | /** |
| | | * 详情 |
| | | */ |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入attach") |
| | | public R<IPage<Attach>> list(Attach attach, Query query, String deptid, String type) { |
| | | public R<IPage<Attach>> list(Attach attach, Query query, String deptid, String type,String cardid) { |
| | | attach.setDeptid(deptid); |
| | | attach.setType(type); |
| | | attach.setCardid(cardid); |
| | | IPage<Attach> pages = attachService.page(Condition.getPage(query), Condition.getQueryWrapper(attach)); |
| | | return R.data(pages); |
| | | } |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入attach") |
| | | public R<IPage<AttachVO>> page(AttachVO attach, Query query) { |
| | | IPage<AttachVO> pages = attachService.selectAttachPage(Condition.getPage(query), attach); |
| | | public R<IPage<AttachVO>> page(AttachVO attach, Query query,String deptid, String type,String cardid) { |
| | | IPage<AttachVO> pages = attachService.selectAttachPage(Condition.getPage(query), attach,type,cardid); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | //内网删除 |
| | | List<Long> list = Func.toLongList(ids); |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from blade_attach where id = " + "'" + id + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | }); |
| | | return R.status(attachService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |