|
@@ -41,30 +41,36 @@ public class CompanyMemberController {
|
|
|
|
|
|
@ApiOperation(value="读取企业人员列表")
|
|
|
@RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
- @ApiImplicitParams({
|
|
|
-// @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String")
|
|
|
- })
|
|
|
- public MessageResult<Map> list(//@RequestParam(value="companyId",defaultValue="") String companyId,
|
|
|
+ public MessageResult<List<CompanyMember>> list(
|
|
|
HttpServletRequest request){
|
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
|
Company company = companyService.findByCreateBy(principal.getName());
|
|
|
|
|
|
- MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+ MessageResult<List<CompanyMember>> msgResult = new MessageResult<>();
|
|
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
- searchParams.put("delFlag",false);
|
|
|
+ try {
|
|
|
+ if (company==null){
|
|
|
+ throw new Exception("当前用户未填写企业信息!");
|
|
|
+ }
|
|
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("delFlag", false);
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(company.getId())) {
|
|
|
- searchParams.put("companyId",company.getId());
|
|
|
- }
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time", "asc"));
|
|
|
|
|
|
- Page<CompanyMember> page = companyMemberService.pageSearch(searchParams,1,1000,sortList);
|
|
|
+ searchParams.put("companyId", company.getId());
|
|
|
|
|
|
- msgResult.setResult(true);
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ Page<CompanyMember> page = companyMemberService.pageSearch(searchParams, 1, 1000, sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(page.getResult());
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ msgResult.setResult(false);
|
|
|
+ }
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
@@ -72,10 +78,12 @@ public class CompanyMemberController {
|
|
|
@ApiOperation(value="读取企业人员分页列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
-// @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String")
|
|
|
+ @ApiImplicitParam(name = "memberName",value = "人员姓名", required = false, paramType = "form",dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "jobsId",value = "岗位编号", required = false, paramType = "form",dataType = "String")
|
|
|
})
|
|
|
public MessageResult<Map> pageList(
|
|
|
-// @RequestParam(value="companyId",defaultValue="") String companyId,
|
|
|
+ @RequestParam(value="memberName",defaultValue="") String memberName,
|
|
|
+ @RequestParam(value="jobsId",defaultValue="") String jobsId,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
HttpServletRequest request){
|
|
@@ -84,20 +92,37 @@ public class CompanyMemberController {
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
- searchParams.put("delFlag",false);
|
|
|
+ try {
|
|
|
+ if (company == null) {
|
|
|
+ throw new Exception("当前用户未填写企业信息!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("delFlag", false);
|
|
|
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time", "asc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(company.getId())) {
|
|
|
- searchParams.put("companyId",company.getId());
|
|
|
- }
|
|
|
+ searchParams.put("companyId", company.getId());
|
|
|
|
|
|
- Page<CompanyMember> page = companyMemberService.pageSearch(searchParams,pageIndex,pageSize,sortList);
|
|
|
+ if(StringUtils.isNotEmpty(jobsId)) {
|
|
|
+ searchParams.put("jobsId", jobsId);
|
|
|
+ }
|
|
|
|
|
|
- msgResult.setResult(true);
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ if(StringUtils.isNotEmpty(memberName)){
|
|
|
+ searchParams.put("memberName", "%" + memberName + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<CompanyMember> page = companyMemberService.pageSearch(searchParams, pageIndex, pageSize, sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ msgResult.setResult(false);
|
|
|
+ }
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
@@ -109,12 +134,11 @@ public class CompanyMemberController {
|
|
|
@ApiImplicitParam(name = "name",value = "姓名", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "cardType",value = "证件类型", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "cardNo",value = "证件编号", required = true, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "sex",value = "性别", required = true, paramType = "form",dataType = "Boolean"),
|
|
|
+ @ApiImplicitParam(name = "sex",value = "性别(男:true,女:false)", required = true, paramType = "form",dataType = "Boolean"),
|
|
|
@ApiImplicitParam(name = "age",value = "年龄", required = true, paramType = "form",dataType = "int"),
|
|
|
@ApiImplicitParam(name = "jobsId",value = "行业ID", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "healthStatus",value = "健康状态", required = true, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "cardFiles",value = "身份证件附件", required = false, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "status",value = "状态", required = true, paramType = "form",dataType = "String")
|
|
|
+ @ApiImplicitParam(name = "cardFiles",value = "身份证件附件", required = false, paramType = "form",dataType = "String")
|
|
|
})
|
|
|
public MessageResult<CompanyMember> add(//@RequestParam(value="companyId",defaultValue="") String companyId,
|
|
|
@RequestParam(value="name",defaultValue="") String name,
|
|
@@ -125,7 +149,6 @@ public class CompanyMemberController {
|
|
|
@RequestParam(value="jobsId",defaultValue="") String jobsId,
|
|
|
@RequestParam(value="healthStatus",defaultValue="") String healthStatus,
|
|
|
@RequestParam(value="cardFiles",defaultValue="") String cardFiles,
|
|
|
- @RequestParam(value="status",defaultValue="") String status,
|
|
|
HttpServletRequest request){
|
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
|
Company company = companyService.findByCreateBy(principal.getName());
|
|
@@ -144,7 +167,7 @@ public class CompanyMemberController {
|
|
|
if(StringUtils.isNotEmpty(jobsId)) companyMember.setJobsId(jobsId);
|
|
|
if(StringUtils.isNotEmpty(healthStatus)) companyMember.setHealthStatus(healthStatus);
|
|
|
if(StringUtils.isNotEmpty(cardFiles)) companyMember.setCardFiles(cardFiles);
|
|
|
- if(StringUtils.isNotEmpty(status)) companyMember.setStatus(status);
|
|
|
+// if(StringUtils.isNotEmpty(status)) companyMember.setStatus(status);
|
|
|
companyMember.setDelFlag(false);
|
|
|
companyMember.setCreateBy(principal.getName());
|
|
|
companyMember.setCreateTime(new Date());
|
|
@@ -170,11 +193,11 @@ public class CompanyMemberController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="获取企业人员")
|
|
|
- @RequestMapping(value = "edit",method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "detail",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id",value = "编号", required = true, paramType = "form",dataType = "String")
|
|
|
})
|
|
|
- public MessageResult<CompanyMember> edit(@RequestParam(value="id",defaultValue="") String id){
|
|
|
+ public MessageResult<CompanyMember> detail(@RequestParam(value="id",defaultValue="") String id){
|
|
|
MessageResult<CompanyMember> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
@@ -202,16 +225,14 @@ public class CompanyMemberController {
|
|
|
@PostMapping("update")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id",value = "编号", required = true, paramType = "form",dataType = "String"),
|
|
|
-// @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "name",value = "姓名", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "cardType",value = "证件类型", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "cardNo",value = "证件编号", required = true, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "sex",value = "性别", required = true, paramType = "form",dataType = "Boolean"),
|
|
|
+ @ApiImplicitParam(name = "sex",value = "性别(男:true,女:false)", required = true, paramType = "form",dataType = "Boolean"),
|
|
|
@ApiImplicitParam(name = "age",value = "年龄", required = true, paramType = "form",dataType = "int"),
|
|
|
@ApiImplicitParam(name = "jobsId",value = "行业ID", required = true, paramType = "form",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "healthStatus",value = "健康状态", required = true, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "cardFiles",value = "身份证件附件", required = false, paramType = "form",dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "status",value = "状态", required = true, paramType = "form",dataType = "String")
|
|
|
+ @ApiImplicitParam(name = "cardFiles",value = "身份证件附件", required = false, paramType = "form",dataType = "String")
|
|
|
})
|
|
|
public MessageResult<CompanyMember> update(@RequestParam(value="id",defaultValue="") String id,
|
|
|
// @RequestParam(value="companyId",defaultValue="") String companyId,
|
|
@@ -223,7 +244,6 @@ public class CompanyMemberController {
|
|
|
@RequestParam(value="jobsId",defaultValue="") String jobsId,
|
|
|
@RequestParam(value="healthStatus",defaultValue="") String healthStatus,
|
|
|
@RequestParam(value="cardFiles",defaultValue="") String cardFiles,
|
|
|
- @RequestParam(value="status",defaultValue="") String status,
|
|
|
HttpServletRequest request){
|
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
|
Company company = companyService.findByCreateBy(principal.getName());
|
|
@@ -242,7 +262,7 @@ public class CompanyMemberController {
|
|
|
if(StringUtils.isNotEmpty(jobsId)) companyMember.setJobsId(jobsId);
|
|
|
if(StringUtils.isNotEmpty(healthStatus)) companyMember.setHealthStatus(healthStatus);
|
|
|
if(StringUtils.isNotEmpty(cardFiles)) companyMember.setCardFiles(cardFiles);
|
|
|
- if(StringUtils.isNotEmpty(status)) companyMember.setStatus(status);
|
|
|
+// if(StringUtils.isNotEmpty(status)) companyMember.setStatus(status);
|
|
|
companyMember.setUpdateBy(principal.getName());
|
|
|
companyMember.setUpdateTime(new Date());
|
|
|
|