|
|
@ -24,8 +24,10 @@ import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.SystemMsgFormDTO; |
|
|
|
import com.epmet.dto.form.UserMessageFormDTO; |
|
|
|
import com.epmet.dto.form.WxSubscribeMessageFormDTO; |
|
|
|
import com.epmet.dto.form.demand.SubCodeFormDTO; |
|
|
|
import com.epmet.dto.form.work.*; |
|
|
|
import com.epmet.dto.result.ActSponsorResultDTO; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.dto.result.work.*; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
@ -39,12 +41,10 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 描述一下 |
|
|
@ -54,7 +54,7 @@ import java.util.UUID; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class WorkActServiceImpl implements WorkActService { |
|
|
|
private Logger logger = LogManager.getLogger(WorkActServiceImpl.class); |
|
|
|
private final Logger logger = LogManager.getLogger(WorkActServiceImpl.class); |
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
@ -95,9 +95,19 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
private UserKindnessTimeLogDao userKindnessTimeLogDao; |
|
|
|
@Autowired |
|
|
|
private LatestActInfoDao latestActInfoDao; |
|
|
|
@Resource |
|
|
|
private IcPartyActivityService icPartyActivityService; |
|
|
|
@Resource |
|
|
|
private IcResiDemandDictService icResiDemandDictService; |
|
|
|
@Resource |
|
|
|
private IcPartyUnitService icPartyUnitService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 服务事项code |
|
|
|
*/ |
|
|
|
private static final String SERVICE_MATTER_CODE = "1010"; |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @author yinzuomei |
|
|
|
* @description 发布活动-删除历史活动草稿 |
|
|
|
* @Date 2020/7/20 18:15 |
|
|
@ -182,9 +192,55 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
|
|
|
|
return publishActResultDTO; |
|
|
|
} |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public PublishActResultDTO publishActV2(PublishActInfoFormDTO formDTO) { |
|
|
|
//构造属性保存活动属性,活动内容
|
|
|
|
ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); |
|
|
|
//校验参数
|
|
|
|
|
|
|
|
//校验 活动报名截止时间应该大于当前时间
|
|
|
|
if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ |
|
|
|
throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); |
|
|
|
} |
|
|
|
this.checkPublishFormDTO(actInfoEntity); |
|
|
|
PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); |
|
|
|
//内容审核(活动标题、招募要求、活动内容图文)
|
|
|
|
this.auditAct(formDTO); |
|
|
|
logger.info("发布活动,审核成功"); |
|
|
|
|
|
|
|
actInfoDao.insert(actInfoEntity); |
|
|
|
//如果用户之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
|
|
|
|
if(StringUtils.isNotBlank(formDTO.getActDraftId())){ |
|
|
|
logger.info("更新latest_act_info表的act_info_id字段"); |
|
|
|
latestActInfoDao.updateActInfoId(formDTO.getActDraftId(),actInfoEntity.getId()); |
|
|
|
} |
|
|
|
List<ActContentEntity> actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); |
|
|
|
for(ActContentEntity actContentEntity:actContentEntityList){ |
|
|
|
actContentDao.insert(actContentEntity); |
|
|
|
} |
|
|
|
//插入一条操作日志
|
|
|
|
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); |
|
|
|
actOperationRecEntity.setActId(actInfoEntity.getId()); |
|
|
|
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); |
|
|
|
actOperationRecEntity.setNoticeUser(false); |
|
|
|
actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); |
|
|
|
actOperationRecDao.insert(actOperationRecEntity); |
|
|
|
|
|
|
|
//删除所有的草稿
|
|
|
|
this.deleteDraft(); |
|
|
|
publishActResultDTO.setActId(actInfoEntity.getId()); |
|
|
|
|
|
|
|
//添加信息到ic_party_activity
|
|
|
|
if (ActConstant.PARTY.equals(formDTO.getActType())) { |
|
|
|
IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity); |
|
|
|
icPartyActivityService.insert(activity); |
|
|
|
} |
|
|
|
|
|
|
|
return publishActResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @param actInfoEntity |
|
|
|
* @author yinzuomei |
|
|
|
* @description 第一次发布 |
|
|
@ -207,23 +263,6 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
try { |
|
|
|
Date yesterDate=format.parse("2020-07-26 13:00:00"); |
|
|
|
Date today=format.parse("2020-07-27 13:00:00"); |
|
|
|
Date tommorrow=format.parse("2020-07-28 13:00:00"); |
|
|
|
Date today1=format.parse("2020-07-27 13:00:00"); |
|
|
|
System.out.println(yesterDate.compareTo(today)); |
|
|
|
System.out.println(tommorrow.compareTo(today)); |
|
|
|
System.out.println(today.compareTo(today1)); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
* @param formDTO |
|
|
@ -718,7 +757,10 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
if (wxmpMsg.success()) { |
|
|
|
logger.info("给审核通过的用户推送微信订阅消息成功"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//取消活动,删除ic_party_activity对应的活动
|
|
|
|
icPartyActivityService.deleteByActId(formDTO.getActId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -730,7 +772,7 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
* @Date 2020/7/26 18:00 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public CanceledActDetailResultDTO canceledDetail(String actId) { |
|
|
|
public CanceledActDetailResultDTO canceledDetail(String customerId, String actId) { |
|
|
|
CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId); |
|
|
|
if(null!=canceledActDetailResultDTO){ |
|
|
|
canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId)); |
|
|
@ -739,6 +781,20 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
}else{ |
|
|
|
canceledActDetailResultDTO.setIsMyPublish(false); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) { |
|
|
|
//获取服务事项
|
|
|
|
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); |
|
|
|
codeFormDTO.setCustomerId(customerId); |
|
|
|
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); |
|
|
|
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) { |
|
|
|
//获取单位名称
|
|
|
|
IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId()); |
|
|
|
canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName()); |
|
|
|
} |
|
|
|
} |
|
|
|
return canceledActDetailResultDTO; |
|
|
|
} |
|
|
@ -783,6 +839,20 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
}else{ |
|
|
|
resultDTO.setIsMyPublish(false); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { |
|
|
|
//获取服务事项
|
|
|
|
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); |
|
|
|
codeFormDTO.setCustomerId(customerId); |
|
|
|
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); |
|
|
|
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getUnitId())) { |
|
|
|
//获取单位名称
|
|
|
|
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); |
|
|
|
resultDTO.setUnitName(unitDTO.getUnitName()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
@ -795,7 +865,7 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
* @Date 2020/7/26 21:34 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public InProgressActDetailResultDTO inProgressDetail(String actId) { |
|
|
|
public InProgressActDetailResultDTO inProgressDetail(String customerId, String actId) { |
|
|
|
InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId); |
|
|
|
if (null != resultDTO) { |
|
|
|
Date nowDate=new Date(); |
|
|
@ -851,6 +921,19 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
}else{ |
|
|
|
resultDTO.setIsMyPublish(false); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { |
|
|
|
//获取服务事项
|
|
|
|
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); |
|
|
|
codeFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); |
|
|
|
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getUnitId())) { |
|
|
|
//获取单位名称
|
|
|
|
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); |
|
|
|
resultDTO.setUnitName(unitDTO.getUnitName()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
@ -1096,6 +1179,15 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
//拒绝发放积分总人数
|
|
|
|
actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY)); |
|
|
|
actStatisticalService.save(actStatisticalDTO); |
|
|
|
|
|
|
|
//保存服务人数
|
|
|
|
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId); |
|
|
|
if (null != dto) { |
|
|
|
IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity(); |
|
|
|
actInfoEntity.setId(dto.getId()); |
|
|
|
actInfoEntity.setPeopleCount(actStatisticalDTO.getSignedInUserNum()); |
|
|
|
icPartyActivityService.updateById(actInfoEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1189,6 +1281,15 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
//更新act_info表的SUMMARY_FLAG=true
|
|
|
|
actInfoDTO.setSummaryFlag(true); |
|
|
|
actInfoService.update(actInfoDTO); |
|
|
|
|
|
|
|
//保存活动结果
|
|
|
|
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId()); |
|
|
|
if (null != dto) { |
|
|
|
IcPartyActivityEntity actInfoEntity = new IcPartyActivityEntity(); |
|
|
|
actInfoEntity.setId(dto.getId()); |
|
|
|
actInfoEntity.setResult(getContent(formDTO.getActSummary())); |
|
|
|
icPartyActivityService.updateById(actInfoEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1199,7 +1300,7 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
* @Date 2020/7/27 13:36 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public ReEditActInfoResultDTO getActInfo(String actId) { |
|
|
|
public ReEditActInfoResultDTO getActInfo(String customerId, String actId) { |
|
|
|
ActInfoDTO actInfoDTO=actInfoService.get(actId); |
|
|
|
if(null==actInfoDTO){ |
|
|
|
logger.error("act_info is null"); |
|
|
@ -1215,6 +1316,21 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
resultDTO.setActId(actId); |
|
|
|
List<ActPreviewContentResultDTO> actContent=actContentDao.selectByActId(actId); |
|
|
|
resultDTO.setActContent(actContent); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { |
|
|
|
//获取服务事项
|
|
|
|
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); |
|
|
|
codeFormDTO.setCustomerId(customerId); |
|
|
|
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); |
|
|
|
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getUnitId())) { |
|
|
|
//获取单位名称
|
|
|
|
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId()); |
|
|
|
resultDTO.setUnitName(unitDTO.getUnitName()); |
|
|
|
} |
|
|
|
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
@ -1276,5 +1392,108 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
return publishActResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO) { |
|
|
|
ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId()); |
|
|
|
if(null==originalActInfo){ |
|
|
|
logger.error("act_info is null"); |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} |
|
|
|
if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ |
|
|
|
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); |
|
|
|
} |
|
|
|
if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){ |
|
|
|
throw new RenException("只有进行中的活动才可以编辑"); |
|
|
|
} |
|
|
|
//构造属性保存活动属性,活动内容
|
|
|
|
ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); |
|
|
|
//校验参数
|
|
|
|
this.checkPublishFormDTO(newActInfoEntity); |
|
|
|
PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); |
|
|
|
//内容审核(活动标题、招募要求、活动内容图文)
|
|
|
|
this.auditRePublishAct(rePublishFormDTO); |
|
|
|
logger.info("重新发布活动,审核成功"); |
|
|
|
|
|
|
|
newActInfoEntity.setId(rePublishFormDTO.getActId()); |
|
|
|
actInfoDao.updateById(newActInfoEntity); |
|
|
|
//删除原来的
|
|
|
|
actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId()); |
|
|
|
//插入编辑后的活动详情
|
|
|
|
List<ActContentEntity> actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId()); |
|
|
|
for(ActContentEntity actContentEntity:actContentEntityList){ |
|
|
|
actContentDao.insert(actContentEntity); |
|
|
|
} |
|
|
|
//插入一条操作日志
|
|
|
|
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); |
|
|
|
actOperationRecEntity.setActId(rePublishFormDTO.getActId()); |
|
|
|
actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE); |
|
|
|
actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople()); |
|
|
|
actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); |
|
|
|
actOperationRecDao.insert(actOperationRecEntity); |
|
|
|
|
|
|
|
//删除所有的草稿
|
|
|
|
this.deleteDraft(); |
|
|
|
publishActResultDTO.setActId(rePublishFormDTO.getActId()); |
|
|
|
//发送消息通知-暂时不做了,前端默认串的是不通知
|
|
|
|
//如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
|
|
|
|
if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){ |
|
|
|
latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
//添加信息到ic_party_activity
|
|
|
|
if (ActConstant.PARTY.equals(rePublishFormDTO.getActType())) { |
|
|
|
IcPartyActivityDTO activityDTO = icPartyActivityService.getActivityByActId(newActInfoEntity.getId()); |
|
|
|
if (null != activityDTO) { |
|
|
|
IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity); |
|
|
|
activity.setId(activityDTO.getId()); |
|
|
|
icPartyActivityService.updateById(activity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return publishActResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 构建联建活动对象 |
|
|
|
* @Param formDTO |
|
|
|
* @Return {@link IcPartyActivityEntity} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2021/12/23 14:32 |
|
|
|
*/ |
|
|
|
private IcPartyActivityEntity getPartyActivityEntity(PublishActInfoFormDTO formDTO, ActInfoEntity actInfoEntity) { |
|
|
|
IcPartyActivityEntity entity = new IcPartyActivityEntity(); |
|
|
|
entity.setCustomerId(actInfoEntity.getCustomerId()); |
|
|
|
entity.setAgencyId(actInfoEntity.getSponsorId()); |
|
|
|
Result<CustomerAgencyDTO> result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); |
|
|
|
if(result.success()&&null!=result.getData()){ |
|
|
|
entity.setPids(result.getData().getPids()); |
|
|
|
}else{ |
|
|
|
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())); |
|
|
|
entity.setPeopleCount(NumConstant.ZERO); |
|
|
|
entity.setActivityTime(actInfoEntity.getActStartTime()); |
|
|
|
entity.setAddress(actInfoEntity.getActAddress()); |
|
|
|
entity.setLongitude(actInfoEntity.getActLongitude().toPlainString()); |
|
|
|
entity.setLatitude(actInfoEntity.getActLatitude().toPlainString()); |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
private String getContent(List<PublishActContentFormDTO> actContent) { |
|
|
|
AtomicReference<String> content = new AtomicReference<>(""); |
|
|
|
actContent.forEach(i -> { |
|
|
|
if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(i.getContentType())) { |
|
|
|
content.set(content.get().concat("<p>").concat(i.getContent()).concat("</p>")); |
|
|
|
} else { |
|
|
|
content.set(content.get().concat("<p>").concat("<img src=\"").concat(i.getContent()).concat("\"/>").concat("</p>")); |
|
|
|
} |
|
|
|
}); |
|
|
|
return content.get(); |
|
|
|
} |
|
|
|
} |
|
|
|