| | |
| | | */ |
| | | package org.springblade.modules.shareholder.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.information.excel.InforExcel; |
| | | import org.springblade.modules.information.excel.InforImporter; |
| | | import org.springblade.modules.shareholder.entity.Shareholder; |
| | | import org.springblade.modules.shareholder.vo.ShareholderVO; |
| | | import org.springblade.modules.shareholder.excel.shareExcel; |
| | | import org.springblade.modules.shareholder.excel.shareImporter; |
| | | import org.springblade.modules.shareholder.service.IShareholderService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.modules.shareholder.vo.ShareholderVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入shareholder") |
| | | public R save(@Valid @RequestBody Shareholder shareholder) { |
| | | public R save(@Valid @RequestBody Shareholder shareholder) throws Exception { |
| | | //arg arg = new arg(); |
| | | //arg.test01(arg.url+"/shareholder/save",shareholder); |
| | | return R.status(shareholderService.save(shareholder)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入shareholder") |
| | | public R update(@Valid @RequestBody Shareholder shareholder) { |
| | | public R update(@Valid @RequestBody Shareholder shareholder) throws Exception { |
| | | //arg.test01(arg.url+"/shareholder/update",shareholder); |
| | | return R.status(shareholderService.updateById(shareholder)); |
| | | } |
| | | |
| | |
| | | return R.status(shareholderService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 出资人信息 |
| | | * @param shareholderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectShareholderInfo") |
| | | public R<IPage<ShareholderVO>> selectShareholderInfo(ShareholderVO shareholderVO, Query query) { |
| | | IPage<ShareholderVO> pages=shareholderService.selectShareholderInfo(Condition.getPage(query), shareholderVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 导入投资人信息 |
| | | */ |
| | | @PostMapping("import-share") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入投资人", notes = "传入excel") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | shareImporter shareImporter = new shareImporter(shareholderService, false); |
| | | ExcelUtil.save(file, shareImporter, shareExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | } |