|  |  | @ -33,7 +33,6 @@ import com.epmet.entity.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.EpmetMessageOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.GovOrgOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.*; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.collections4.MapUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.logging.log4j.LogManager; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.logging.log4j.Logger; | 
			
		
	
	
		
			
				
					|  |  | @ -44,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  | import java.util.*; | 
			
		
	
		
			
				
					|  |  |  | import java.util.concurrent.atomic.AtomicInteger; | 
			
		
	
		
			
				
					|  |  |  | import java.util.concurrent.atomic.AtomicReference; | 
			
		
	
		
			
				
					|  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -102,6 +102,10 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |     private IcPartyUnitService icPartyUnitService; | 
			
		
	
		
			
				
					|  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |     private IcServiceItemDictService icServiceItemDictService; | 
			
		
	
		
			
				
					|  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |     private IcActivityUnitRelationService icActivityUnitRelationService; | 
			
		
	
		
			
				
					|  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |     private IcActivityServiceRelationService icActivityServiceRelationService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
	
		
			
				
					|  |  | @ -232,6 +236,36 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |         if (ActConstant.PARTY.equals(formDTO.getActType())) { | 
			
		
	
		
			
				
					|  |  |  |             IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity); | 
			
		
	
		
			
				
					|  |  |  |             icPartyActivityService.insert(activity); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             //保存活动与单位关系
 | 
			
		
	
		
			
				
					|  |  |  |             icActivityUnitRelationService.deleteByActivity(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |             AtomicInteger i = new AtomicInteger(NumConstant.ONE); | 
			
		
	
		
			
				
					|  |  |  |             List<IcActivityUnitRelationEntity> unitRelationList = formDTO.getUnitIdList().stream().map(unitId -> { | 
			
		
	
		
			
				
					|  |  |  |                 IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity(); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setCustomerId(activity.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setAgencyId(activity.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setPids(activity.getPids()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setActivityId(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setUnitId(unitId); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setSort(i.getAndIncrement()); | 
			
		
	
		
			
				
					|  |  |  |                 return relation; | 
			
		
	
		
			
				
					|  |  |  |             }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |             icActivityUnitRelationService.insertBatch(unitRelationList); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             //保存活动与服务关系
 | 
			
		
	
		
			
				
					|  |  |  |             icActivityServiceRelationService.deleteByActivity(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |             AtomicInteger j = new AtomicInteger(NumConstant.ONE); | 
			
		
	
		
			
				
					|  |  |  |             List<IcActivityServiceRelationEntity> serviceRelationList = formDTO.getServiceMatterList().stream().map(service -> { | 
			
		
	
		
			
				
					|  |  |  |                 IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity(); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setCustomerId(activity.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setAgencyId(activity.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setPids(activity.getPids()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setActivityId(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setServiceMatter(service); | 
			
		
	
		
			
				
					|  |  |  |                 relation.setSort(j.getAndIncrement()); | 
			
		
	
		
			
				
					|  |  |  |                 return relation; | 
			
		
	
		
			
				
					|  |  |  |             }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |             icActivityServiceRelationService.insertBatch(serviceRelationList); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return publishActResultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -779,17 +813,26 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |                 canceledActDetailResultDTO.setIsMyPublish(false); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                 List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                 canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ? | 
			
		
	
		
			
				
					|  |  |  |                         categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取单位名称
 | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId()); | 
			
		
	
		
			
				
					|  |  |  |                 canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName()); | 
			
		
	
		
			
				
					|  |  |  |             if (ActConstant.PARTY.equals(canceledActDetailResultDTO.getActType())) { | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId); | 
			
		
	
		
			
				
					|  |  |  |                 if (null != dto) { | 
			
		
	
		
			
				
					|  |  |  |                     //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                     List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> services = icActivityServiceRelationService.getServiceList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     canceledActDetailResultDTO.setServiceMatterList(services); | 
			
		
	
		
			
				
					|  |  |  |                     canceledActDetailResultDTO.setServiceMatterNameList(serviceNames); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                     //获取联建单位
 | 
			
		
	
		
			
				
					|  |  |  |                     IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); | 
			
		
	
		
			
				
					|  |  |  |                     unitDTO.setAgencyId(dto.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     canceledActDetailResultDTO.setUnitIdList(unitIds); | 
			
		
	
		
			
				
					|  |  |  |                     canceledActDetailResultDTO.setUnitNameList(unitNames); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return canceledActDetailResultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -835,17 +878,26 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |             }else{ | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setIsMyPublish(false); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                 List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(resultDTO.getUnitId())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取单位名称
 | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setUnitName(unitDTO.getUnitName()); | 
			
		
	
		
			
				
					|  |  |  |             if (ActConstant.PARTY.equals(resultDTO.getActType())) { | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId()); | 
			
		
	
		
			
				
					|  |  |  |                 if (null != dto) { | 
			
		
	
		
			
				
					|  |  |  |                     //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                     List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> services = icActivityServiceRelationService.getServiceList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setServiceMatterList(services); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setServiceMatterNameList(serviceNames); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                     //获取联建单位
 | 
			
		
	
		
			
				
					|  |  |  |                     IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); | 
			
		
	
		
			
				
					|  |  |  |                     unitDTO.setAgencyId(dto.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setUnitIdList(unitIds); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setUnitNameList(unitNames); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -915,16 +967,26 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |             }else{ | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setIsMyPublish(false); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                 List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(resultDTO.getUnitId())) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取单位名称
 | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setUnitName(unitDTO.getUnitName()); | 
			
		
	
		
			
				
					|  |  |  |             if (ActConstant.PARTY.equals(resultDTO.getActType())) { | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId); | 
			
		
	
		
			
				
					|  |  |  |                 if (null != dto) { | 
			
		
	
		
			
				
					|  |  |  |                     //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                     List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> services = icActivityServiceRelationService.getServiceList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setServiceMatterList(services); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setServiceMatterNameList(serviceNames); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                     //获取联建单位
 | 
			
		
	
		
			
				
					|  |  |  |                     IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); | 
			
		
	
		
			
				
					|  |  |  |                     unitDTO.setAgencyId(dto.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setUnitIdList(unitIds); | 
			
		
	
		
			
				
					|  |  |  |                     resultDTO.setUnitNameList(unitNames); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -1309,16 +1371,26 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |         List<ActPreviewContentResultDTO> actContent=actContentDao.selectByActId(actId); | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setActContent(actContent); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { | 
			
		
	
		
			
				
					|  |  |  |             //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |             List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |             Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |             resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if (StringUtils.isNotBlank(resultDTO.getUnitId())) { | 
			
		
	
		
			
				
					|  |  |  |             //获取单位名称
 | 
			
		
	
		
			
				
					|  |  |  |             IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); | 
			
		
	
		
			
				
					|  |  |  |             resultDTO.setUnitName(unitDTO.getUnitName()); | 
			
		
	
		
			
				
					|  |  |  |         if (ActConstant.PARTY.equals(resultDTO.getActType())) { | 
			
		
	
		
			
				
					|  |  |  |             IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId); | 
			
		
	
		
			
				
					|  |  |  |             if (null != dto) { | 
			
		
	
		
			
				
					|  |  |  |                 //获取服务事项
 | 
			
		
	
		
			
				
					|  |  |  |                 List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                 List<String> services = icActivityServiceRelationService.getServiceList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setServiceMatterList(services); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setServiceMatterNameList(serviceNames); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 //获取联建单位
 | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); | 
			
		
	
		
			
				
					|  |  |  |                 unitDTO.setAgencyId(dto.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
			
		
	
		
			
				
					|  |  |  |                 List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setUnitIdList(unitIds); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setUnitNameList(unitNames); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -1438,6 +1510,36 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |                 IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity); | 
			
		
	
		
			
				
					|  |  |  |                 activity.setId(activityDTO.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 icPartyActivityService.updateById(activity); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 //保存活动与单位关系
 | 
			
		
	
		
			
				
					|  |  |  |                 icActivityUnitRelationService.deleteByActivity(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 AtomicInteger i = new AtomicInteger(NumConstant.ONE); | 
			
		
	
		
			
				
					|  |  |  |                 List<IcActivityUnitRelationEntity> unitRelationList = rePublishFormDTO.getUnitIdList().stream().map(unitId -> { | 
			
		
	
		
			
				
					|  |  |  |                     IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity(); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setCustomerId(activity.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setAgencyId(activity.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setPids(activity.getPids()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setActivityId(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setUnitId(unitId); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setSort(i.getAndIncrement()); | 
			
		
	
		
			
				
					|  |  |  |                     return relation; | 
			
		
	
		
			
				
					|  |  |  |                 }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                 icActivityUnitRelationService.insertBatch(unitRelationList); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 //保存活动与服务关系
 | 
			
		
	
		
			
				
					|  |  |  |                 icActivityServiceRelationService.deleteByActivity(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                 AtomicInteger j = new AtomicInteger(NumConstant.ONE); | 
			
		
	
		
			
				
					|  |  |  |                 List<IcActivityServiceRelationEntity> serviceRelationList = rePublishFormDTO.getServiceMatterList().stream().map(service -> { | 
			
		
	
		
			
				
					|  |  |  |                     IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity(); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setCustomerId(activity.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setAgencyId(activity.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setPids(activity.getPids()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setActivityId(activity.getId()); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setServiceMatter(service); | 
			
		
	
		
			
				
					|  |  |  |                     relation.setSort(j.getAndIncrement()); | 
			
		
	
		
			
				
					|  |  |  |                     return relation; | 
			
		
	
		
			
				
					|  |  |  |                 }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                 icActivityServiceRelationService.insertBatch(serviceRelationList); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -1462,8 +1564,6 @@ public class WorkActServiceImpl implements WorkActService { | 
			
		
	
		
			
				
					|  |  |  |             logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         entity.setActId(actInfoEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  |         entity.setUnitId(actInfoEntity.getUnitId()); | 
			
		
	
		
			
				
					|  |  |  |         entity.setServiceMatter(actInfoEntity.getServiceMatter()); | 
			
		
	
		
			
				
					|  |  |  |         entity.setTitle(actInfoEntity.getTitle()); | 
			
		
	
		
			
				
					|  |  |  |         entity.setTarget(actInfoEntity.getTarget()); | 
			
		
	
		
			
				
					|  |  |  |         entity.setContent(getContent(formDTO.getActContent())); | 
			
		
	
	
		
			
				
					|  |  | 
 |