|
@ -1,6 +1,8 @@
|
|
|
package com.yihu.jw.base.endpoint.voluntary;
|
|
|
|
|
|
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentCompanyDao;
|
|
|
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentPeopleService;
|
|
|
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
|
|
|
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
@ -29,14 +31,25 @@ public class VoluntaryRecruitmentPeopleEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
|
private VoluntaryRecruitmentPeopleService peopleService;
|
|
|
|
|
|
@Autowired
|
|
|
private VoluntaryRecruitmentCompanyDao companyDao;
|
|
|
|
|
|
@PostMapping(value = "delete")
|
|
|
@ApiOperation(value = "删除")
|
|
|
public Envelop delete(
|
|
|
@ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
|
|
|
@RequestParam(value = "ids") String ids) {
|
|
|
String[] idsTmp = ids.split(",");
|
|
|
List<VoluntaryRecruitmentPeopleDO> List = peopleService.getRepository().queryByIdIn(idsTmp);
|
|
|
peopleService.delete(ids.split(","));
|
|
|
for (VoluntaryRecruitmentPeopleDO tmp:List){
|
|
|
VoluntaryRecruitmentCompanyDO companyDO = companyDao.findOne(tmp.getCompanyId());
|
|
|
if (null !=companyDO ){
|
|
|
Integer count = peopleService.getRepository().findByCompanyId(tmp.getCompanyId());
|
|
|
companyDO.setNum(count);
|
|
|
companyDao.save(companyDO);
|
|
|
}
|
|
|
}
|
|
|
return success("删除成功");
|
|
|
}
|
|
|
|
|
@ -50,6 +63,12 @@ public class VoluntaryRecruitmentPeopleEndpoint extends EnvelopRestEndpoint {
|
|
|
return failed("ID不能为空", ObjEnvelop.class);
|
|
|
}
|
|
|
appVersion = peopleService.save(appVersion);
|
|
|
VoluntaryRecruitmentCompanyDO companyDO = companyDao.findOne(appVersion.getCompanyId());
|
|
|
if (null !=companyDO ){
|
|
|
Integer count = peopleService.getRepository().findByCompanyId(appVersion.getCompanyId());
|
|
|
companyDO.setNum(count);
|
|
|
companyDao.save(companyDO);
|
|
|
}
|
|
|
return success(appVersion, VoluntaryRecruitmentPeopleDO.class);
|
|
|
}
|
|
|
|