package com.doumee.api.business;
|
|
import com.doumee.api.BaseController;
|
import com.doumee.core.annotation.excel.ExcelExporter;
|
import com.doumee.core.annotation.pr.PreventRepeat;
|
import com.doumee.core.model.ApiResponse;
|
import com.doumee.core.model.PageWrap;
|
import com.doumee.core.model.PageData;
|
import com.doumee.dao.business.model.Company;
|
import com.doumee.dao.business.model.CompanyChange;
|
import com.doumee.service.business.CompanyChangeService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.File;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* @author 江蹄蹄
|
* @date 2023/02/15 08:55
|
*/
|
@Api(tags = "企业变更信息记录表")
|
@RestController
|
@RequestMapping("/business/companyChange")
|
public class CompanyChangeController extends BaseController {
|
|
@Autowired
|
private CompanyChangeService companyChangeService;
|
|
@PreventRepeat
|
@ApiOperation("企业变更信息")
|
@PostMapping("/create")
|
@RequiresPermissions("business:companychange:create")
|
public ApiResponse create(@RequestBody CompanyChange companyChange) {
|
return ApiResponse.success(companyChangeService.create(companyChange));
|
}
|
|
@ApiOperation("根据ID删除")
|
@GetMapping("/delete/{id}")
|
@RequiresPermissions("business:companychange:delete")
|
public ApiResponse deleteById(@PathVariable Integer id) {
|
companyChangeService.deleteById(id);
|
return ApiResponse.success(null);
|
}
|
|
@ApiOperation("批量删除")
|
@GetMapping("/delete/batch")
|
@RequiresPermissions("business:companychange:delete")
|
public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
|
String [] idArray = ids.split(",");
|
List<Integer> idList = new ArrayList<>();
|
for (String id : idArray) {
|
idList.add(Integer.valueOf(id));
|
}
|
companyChangeService.deleteByIdInBatch(idList);
|
return ApiResponse.success(null);
|
}
|
|
@ApiOperation("根据ID修改")
|
@PostMapping("/updateById")
|
@RequiresPermissions("business:companychange:update")
|
public ApiResponse updateById(@RequestBody CompanyChange companyChange) {
|
companyChangeService.updateById(companyChange);
|
return ApiResponse.success(null);
|
}
|
|
@ApiOperation("分页查询")
|
@PostMapping("/page")
|
@RequiresPermissions("business:companychange:query")
|
public ApiResponse<PageData<CompanyChange>> findPage (@RequestBody PageWrap<CompanyChange> pageWrap) {
|
return ApiResponse.success(companyChangeService.findCompanyChangePage( pageWrap));
|
}
|
|
@ApiOperation("导出Excel")
|
@PostMapping("/exportExcel")
|
@RequiresPermissions("business:companychange:exportExcel")
|
public void exportExcel (@RequestBody PageWrap<CompanyChange> pageWrap, HttpServletResponse response) {
|
ExcelExporter.build(CompanyChange.class).export(companyChangeService.findPage(pageWrap).getRecords(), "企业变更信息记录表", response);
|
}
|
|
@ApiOperation("根据ID查询")
|
@GetMapping("/{id}")
|
@RequiresPermissions("business:companychange:query")
|
public ApiResponse<CompanyChange> findById(@PathVariable Integer id) {
|
return ApiResponse.success(companyChangeService.findById(id));
|
}
|
|
@ApiOperation("分页企业变更记录查询")
|
@PostMapping("/findCompanyChangePage")
|
public ApiResponse<PageData<CompanyChange>> findCompanyChangePage(@RequestBody PageWrap<CompanyChange> pageWrap){
|
return ApiResponse.success(companyChangeService.findCompanyChangePage(pageWrap));
|
}
|
|
|
@ApiOperation("获取最新用户变更记录")
|
@GetMapping("/getCompanyChance")
|
public ApiResponse<CompanyChange> getCompanyChance(@RequestParam Integer companyId){
|
return ApiResponse.success(companyChangeService.getCompanyChance(companyId));
|
};
|
|
|
|
@ApiOperation("企业变更审批")
|
@PostMapping("/checkCompanyChang")
|
public ApiResponse CheckCompanyChang(@RequestBody CompanyChange companyChange){
|
companyChangeService.checkCompanyChang(companyChange);
|
return ApiResponse.success(null);
|
};
|
}
|