|
|
@ -26,9 +26,13 @@ import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.dao.VactInfoDao; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.dao.VactOrgRelationDao; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.dao.VolunteerDao; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.entity.VactInfoEntity; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.entity.VactOrgRelationEntity; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.redis.VactInfoRedis; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.service.VactInfoService; |
|
|
|
import com.elink.esua.epdc.modules.volunteer.service.VactOrgRelationService; |
|
|
|
import com.elink.esua.epdc.volunteer.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -36,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -53,6 +58,15 @@ public class VactInfoServiceImpl extends BaseServiceImpl<VactInfoDao, VactInfoEn |
|
|
|
@Autowired |
|
|
|
private VactInfoRedis vactInfoRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private VactOrgRelationDao VactOrgRelationDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private VolunteerDao volunteerDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private VactOrgRelationService vactOrgRelationService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<VactPageInfoDTO> page(Map<String, Object> params) { |
|
|
|
// IPage<VactInfoEntity> page = baseDao.selectPage(
|
|
|
@ -134,9 +148,19 @@ public class VactInfoServiceImpl extends BaseServiceImpl<VactInfoDao, VactInfoEn |
|
|
|
if(StringUtils.isBlank(formDto.getId())){ |
|
|
|
insert(entity); |
|
|
|
}else{//修改
|
|
|
|
VactOrgRelationDao.deleteByVactId(formDto.getId()); |
|
|
|
entity.setReason(""); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
List<VactOrgRelationEntity> relationList = new ArrayList(); |
|
|
|
List<Long> orgIdList = volunteerDao.getOrgIdListByUserId(formDto.getUserId()); |
|
|
|
for(Long orgId : orgIdList){ |
|
|
|
VactOrgRelationEntity relationEntity = new VactOrgRelationEntity(); |
|
|
|
relationEntity.setVactId(entity.getId()); |
|
|
|
relationEntity.setVolunteerOrgId(orgId); |
|
|
|
relationList.add(relationEntity); |
|
|
|
} |
|
|
|
vactOrgRelationService.insertBatch(relationList); |
|
|
|
return new Result().ok("提交成功"); |
|
|
|
} |
|
|
|
|
|
|
|