|
@@ -7,12 +7,18 @@ import com.hz.employmentsite.filter.exception.BaseResponse;
|
|
|
import com.hz.employmentsite.filter.exception.RespGenerstor;
|
|
|
import com.hz.employmentsite.services.service.AccountService;
|
|
|
import com.hz.employmentsite.services.service.jobUserManager.JobuserService;
|
|
|
+import com.hz.employmentsite.util.DateUtils;
|
|
|
+import com.hz.employmentsite.util.ExcelHelper;
|
|
|
+import com.hz.employmentsite.vo.companyService.PostVo;
|
|
|
import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
|
|
|
import com.hz.employmentsite.vo.jobUserManager.JobhuntVo;
|
|
|
import com.hz.employmentsite.vo.taskAndLog.DotaskVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
|
|
@@ -24,14 +30,16 @@ public class JobuserController {
|
|
|
private JobuserService jobuserService;
|
|
|
@Autowired
|
|
|
private AccountService accountService;
|
|
|
+ @Autowired
|
|
|
+ private DateUtils dateUtils;
|
|
|
|
|
|
@ResponseBody
|
|
|
@GetMapping("/getList")
|
|
|
public BaseResponse getList(@RequestParam("page") int pageIndex, @RequestParam("limit") int pageSize,
|
|
|
- @RequestParam(required = false) String name, @RequestParam(required = false) String siteId, @RequestParam(required = false) Integer jobStatus, @RequestParam(required = false) Integer sexId,
|
|
|
+ @RequestParam(required = false) String name, @RequestParam(required = false) String siteID, @RequestParam(required = false) String jobStatus, @RequestParam(required = false) Integer sexId,
|
|
|
@RequestParam(required = false) Integer educationTypeId, @RequestParam(required = false) Integer emphasisTypeId) {
|
|
|
|
|
|
- PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteId, jobStatus, sexId, educationTypeId, emphasisTypeId);
|
|
|
+ PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteID, jobStatus, sexId, educationTypeId, emphasisTypeId);
|
|
|
return RespGenerstor.success(result);
|
|
|
}
|
|
|
|
|
@@ -77,4 +85,44 @@ public class JobuserController {
|
|
|
return RespGenerstor.success(1);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/export")
|
|
|
+ public BaseResponse export(HttpServletResponse response, @RequestParam(required = false) Boolean isExport,
|
|
|
+ @RequestParam("page") int pageIndex, @RequestParam("limit") int pageSize,
|
|
|
+ @RequestParam(required = false) String name, @RequestParam(required = false) String siteId, @RequestParam(required = false) String jobStatus,
|
|
|
+ @RequestParam(required = false) Integer sexId,@RequestParam(required = false) Integer educationTypeId,
|
|
|
+ @RequestParam(required = false) Integer emphasisTypeId) throws Exception {
|
|
|
+ PageInfo<JobUserVo> result = jobuserService.getList(pageIndex, pageSize, null, name, siteId, jobStatus, sexId, educationTypeId, emphasisTypeId);
|
|
|
+
|
|
|
+ if(isExport == null || !isExport){
|
|
|
+ return RespGenerstor.success(result);
|
|
|
+ }else{
|
|
|
+ ExcelHelper excelHelper = new ExcelHelper();
|
|
|
+ ExcelHelper.ExcelData data = excelHelper.new ExcelData();
|
|
|
+ data.setTitles(Arrays.asList(new String[]{"序号", "姓名", "公民身份号码","性别", "民族", "联系电话", "所属驿站", "出生日期", "文化程度", "地址", "就业状态", "重点人员类别"}));
|
|
|
+ int i = 0;
|
|
|
+ List<List<Object>> rowDatas = new ArrayList();
|
|
|
+ for (JobUserVo item : result.getList()) {
|
|
|
+ List<Object> row = new ArrayList();
|
|
|
+ ++i;
|
|
|
+ row.add(i);
|
|
|
+ row.add(item.getName());
|
|
|
+ row.add(item.getIdentityNumber());
|
|
|
+ row.add(item.getGenderName());
|
|
|
+ row.add(item.getNation());
|
|
|
+ row.add(item.getUserMobile());
|
|
|
+ row.add(item.siteName);
|
|
|
+ row.add(dateUtils.dateToStr(item.getBirthDay()));
|
|
|
+ row.add(item.cultureName);
|
|
|
+ row.add(item.getAddress());
|
|
|
+ row.add(item.jobStatusName);
|
|
|
+ row.add(item.keyTypeName);
|
|
|
+ rowDatas.add(row);
|
|
|
+ }
|
|
|
+ data.setRows(rowDatas);
|
|
|
+ excelHelper.exportExcel(response, data);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|