| 
					
				 | 
			
			
				@ -1,11 +1,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.jw.base.endpoint.voluntary; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentPeopleDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentCompanyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.Envelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ObjEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.PageEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.StringUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -30,6 +33,8 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private VoluntaryRecruitmentService voluntaryRecruitmentService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private VoluntaryRecruitmentCompanyService companyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private VoluntaryRecruitmentPeopleDao peopleDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @PostMapping(value = "add") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "企业报名") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -38,8 +43,11 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         @RequestParam String jsonData){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            VoluntaryRecruitmentCompanyDO companyDO = toEntity(jsonData, VoluntaryRecruitmentCompanyDO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            voluntaryRecruitmentService.add(companyDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("报名成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String result = voluntaryRecruitmentService.add(companyDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtil.isBlank(result)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return success("报名成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           return Envelop.getError(result,-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedException2(e); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -70,5 +78,59 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "existsByPhone") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "人员是否已报名") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop existsByPhone ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "phone", value = "联系人手机") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "phone", required = true) String phone){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("查找成功",peopleDao.existsByPhone(phone)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  ObjEnvelop.getError("查询失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "findByContactsAndPhone") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "查找单个企业") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop<VoluntaryRecruitmentCompanyDO> findByContactsAndPhone ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "contacts", value = "联系人姓名") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "contacts", required = true) String contacts, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "phone", value = "联系人手机") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "phone", required = true) String phone){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            VoluntaryRecruitmentCompanyDO companyDO = voluntaryRecruitmentService.findByContactsAndPhone(contacts,phone); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(companyDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               return ObjEnvelop.getError("未找到关联企业"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("查找成功",companyDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  ObjEnvelop.getError("查询失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @PostMapping(value = "arrange") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "人员安排") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop arrange ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "companyId", value = "联系人姓名") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "companyId", required = true) String companyId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "day", value = "服务日期") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "day", required = true) String day, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "time", value = "服务时间段") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "time", required = true) String time, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "peoples", value = "服务人员 id+姓名逗号间隔。例:1:测试1,2:测试2") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "peoples", required = true) String peoples, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "station", value = "服务站") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "station", required = true) String station){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            voluntaryRecruitmentService.arrange(companyId, day, time, peoples, station); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("报名成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedException2(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |