|  |  |  | 
|---|
|  |  |  | 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.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.MemberImport; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.MemberQueryDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.MemberReduceImport; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Member; | 
|---|
|  |  |  | import com.doumee.dao.business.model.MemberInsurance; | 
|---|
|  |  |  | import com.doumee.service.business.MemberService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import io.swagger.annotations.*; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import org.springframework.web.multipart.MultipartFile; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.File; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | * @date 2024/01/15 11:15 | 
|---|
|  |  |  | * @date 2024/01/16 10:03 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Api(tags = "用工信息表") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:member:query") | 
|---|
|  |  |  | public ApiResponse<PageData<Member>> findPage (@RequestBody PageWrap<Member> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.findPage(pageWrap)); | 
|---|
|  |  |  | public ApiResponse<PageData<Member>> findPage (@RequestBody PageWrap<MemberQueryDTO> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.findPageForCompany(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:member:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<Member> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(Member.class).export(memberService.findPage(pageWrap).getRecords(), "用工信息表", response); | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<MemberQueryDTO> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(Member.class).exportWithFirstAndEnd( memberService.findPageForCompany(pageWrap).getRecords(), "员工列表详单","员工列表详单",null, response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @RequiresPermissions("business:member:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.findById(id)); | 
|---|
|  |  |  | return ApiResponse.success(memberService.findDetailById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("数据列表") | 
|---|
|  |  |  | @PostMapping("/findListByDTO") | 
|---|
|  |  |  | @RequiresPermissions("business:member:query") | 
|---|
|  |  |  | public ApiResponse<List<Member>> findListByDTO (@RequestBody MemberQueryDTO memberQueryDTO) { | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | if(loginUserInfo.getType().equals(Constants.ONE)){ | 
|---|
|  |  |  | memberQueryDTO.setCompanyId(loginUserInfo.getCompanyId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ApiResponse.success(memberService.findListByDTO(memberQueryDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "人员信息导入" ,notes = "保单申请") | 
|---|
|  |  |  | @PostMapping("/importExcel") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequiresPermissions("business:member:importExcel") | 
|---|
|  |  |  | public ApiResponse<List<MemberImport>> importExcel (@ApiParam(value = "file") MultipartFile file,Integer  solutionId) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.importBatch(file,solutionId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation(value = "人员减保信息导入" ,notes = "保单申请") | 
|---|
|  |  |  | @PostMapping("/importReuduceExcel") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequiresPermissions("business:member:importExcel") | 
|---|
|  |  |  | public ApiResponse<List<MemberReduceImport>> importReuduceExcel (@ApiParam(value = "file") MultipartFile file, Integer  applyId) { | 
|---|
|  |  |  | return ApiResponse.success(memberService.importReduceBatch(file,applyId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|