|
@ -17,11 +17,54 @@ |
|
|
|
|
|
|
|
|
package com.epmet.modules.act.service.impl; |
|
|
package com.epmet.modules.act.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
|
|
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
|
|
|
|
import com.epmet.commons.tools.scan.param.ImgTaskDTO; |
|
|
|
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
|
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
|
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
|
|
import com.epmet.dto.result.GridInfoResultDTO; |
|
|
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
|
|
import com.epmet.modules.act.dao.ActOperationRecordDao; |
|
|
|
|
|
import com.epmet.modules.act.dao.ActReadRecordDao; |
|
|
|
|
|
import com.epmet.modules.act.dao.GroupActContentDao; |
|
|
import com.epmet.modules.act.dao.GroupActInfoDao; |
|
|
import com.epmet.modules.act.dao.GroupActInfoDao; |
|
|
|
|
|
import com.epmet.modules.act.entity.ActOperationRecordEntity; |
|
|
|
|
|
import com.epmet.modules.act.entity.ActReadRecordEntity; |
|
|
|
|
|
import com.epmet.modules.act.entity.GroupActContentEntity; |
|
|
import com.epmet.modules.act.entity.GroupActInfoEntity; |
|
|
import com.epmet.modules.act.entity.GroupActInfoEntity; |
|
|
|
|
|
import com.epmet.modules.act.service.ActCategoryDictService; |
|
|
import com.epmet.modules.act.service.GroupActInfoService; |
|
|
import com.epmet.modules.act.service.GroupActInfoService; |
|
|
|
|
|
import com.epmet.modules.constant.GroupActConstant; |
|
|
|
|
|
import com.epmet.modules.group.service.ResiGroupService; |
|
|
|
|
|
import com.epmet.modules.member.service.ResiGroupMemberService; |
|
|
|
|
|
import com.epmet.resi.group.dto.act.GroupActIdDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.act.form.ActDetailFormDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.act.form.PublishGroupActFormDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.group.ResiGroupDTO; |
|
|
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 组织活动信息 |
|
|
* 组织活动信息 |
|
@ -29,8 +72,296 @@ import org.springframework.stereotype.Service; |
|
|
* @author generator generator@elink-cn.com |
|
|
* @author generator generator@elink-cn.com |
|
|
* @since v1.0.0 2021-04-16 |
|
|
* @since v1.0.0 2021-04-16 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
@Service |
|
|
@Service |
|
|
public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, GroupActInfoEntity> implements GroupActInfoService { |
|
|
public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, GroupActInfoEntity> implements GroupActInfoService { |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupMemberService resiGroupMemberService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupService resiGroupService; |
|
|
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
|
|
private String scanApiUrl; |
|
|
|
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
|
|
|
private String textSyncScanMethod; |
|
|
|
|
|
@Value("${openapi.scan.method.imgSyncScan}") |
|
|
|
|
|
private String imgSyncScanMethod; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ActOperationRecordDao actOperationRecordDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ActCategoryDictService actCategoryDictService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private GroupActContentDao groupActContentDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ActReadRecordDao actReadRecordDao; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 003、发布(编辑)组织活动 |
|
|
|
|
|
* |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return com.epmet.resi.group.dto.act.GroupActIdDTO |
|
|
|
|
|
*/ |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
@Override |
|
|
|
|
|
public GroupActIdDTO publishGroupAct(PublishGroupActFormDTO formDTO) { |
|
|
|
|
|
|
|
|
|
|
|
ResiGroupDTO groupDTO = resiGroupService.get(formDTO.getGroupId()); |
|
|
|
|
|
formDTO.setGridId(groupDTO.getGridId()); |
|
|
|
|
|
//参数校验
|
|
|
|
|
|
this.checkPublishGroupActFormDTO(formDTO); |
|
|
|
|
|
//内容审核
|
|
|
|
|
|
this.scanActContent(formDTO.getTitle(), formDTO.getTextList(), formDTO.getImgList()); |
|
|
|
|
|
|
|
|
|
|
|
//返参
|
|
|
|
|
|
GroupActIdDTO result=new GroupActIdDTO(); |
|
|
|
|
|
|
|
|
|
|
|
//组织活动信息
|
|
|
|
|
|
GroupActInfoEntity groupActInfoEntity = constructGroupActInfoEntity(formDTO); |
|
|
|
|
|
//1、插入活修改活动信息表
|
|
|
|
|
|
if (StringUtils.isNotBlank(groupActInfoEntity.getId())) { |
|
|
|
|
|
//删除group_act_content、删除act_read_record
|
|
|
|
|
|
groupActContentDao.updateToDel(groupActInfoEntity.getId(), formDTO.getPublishUserId()); |
|
|
|
|
|
actReadRecordDao.deleteByActId(groupActInfoEntity.getId()); |
|
|
|
|
|
baseDao.updateById(groupActInfoEntity); |
|
|
|
|
|
} else { |
|
|
|
|
|
baseDao.insert(groupActInfoEntity); |
|
|
|
|
|
} |
|
|
|
|
|
//要放在插入或者更新之后,才能拿到插入的主键
|
|
|
|
|
|
//构造操作日志
|
|
|
|
|
|
ActOperationRecordEntity operRecEntity = constructOperRec(groupActInfoEntity.getId(), formDTO); |
|
|
|
|
|
//构造活动内容表
|
|
|
|
|
|
List<GroupActContentEntity> contentList = constructText(groupActInfoEntity.getId(), formDTO.getCustomerId(), formDTO.getTextList()); |
|
|
|
|
|
List<GroupActContentEntity> imgList = constructImg(groupActInfoEntity.getId(), formDTO.getCustomerId(), formDTO.getImgList()); |
|
|
|
|
|
List<ActReadRecordEntity> readRecordEntityList=constructReadRec(groupActInfoEntity.getId(), |
|
|
|
|
|
formDTO.getCustomerId(), |
|
|
|
|
|
formDTO.getGroupId(), |
|
|
|
|
|
formDTO.getPublishUserId()); |
|
|
|
|
|
//2、插入活动内容
|
|
|
|
|
|
contentList.forEach(textContentEntity->{ |
|
|
|
|
|
groupActContentDao.insert(textContentEntity); |
|
|
|
|
|
}); |
|
|
|
|
|
imgList.forEach(imgContent->{ |
|
|
|
|
|
groupActContentDao.insert(imgContent); |
|
|
|
|
|
}); |
|
|
|
|
|
//3、插入操作日志
|
|
|
|
|
|
actOperationRecordDao.insert(operRecEntity); |
|
|
|
|
|
//4、插入应读记录表
|
|
|
|
|
|
readRecordEntityList.forEach(readRecordEntity->{ |
|
|
|
|
|
actReadRecordDao.insert(readRecordEntity); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
result.setGroupActId(groupActInfoEntity.getId()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private List<ActReadRecordEntity> constructReadRec(String groupActId, String customerId, String groupId,String publishUserId) { |
|
|
|
|
|
List<ActReadRecordEntity> list=new ArrayList<>(); |
|
|
|
|
|
List<ResiGroupMemberDTO> memberDTOList=resiGroupMemberService.getMemberList(groupId); |
|
|
|
|
|
memberDTOList.forEach(memberDTO->{ |
|
|
|
|
|
ActReadRecordEntity actReadRecordEntity=new ActReadRecordEntity(); |
|
|
|
|
|
actReadRecordEntity.setCustomerId(customerId); |
|
|
|
|
|
actReadRecordEntity.setGroupActId(groupActId); |
|
|
|
|
|
if(publishUserId.equals(memberDTO.getCustomerUserId())){ |
|
|
|
|
|
//发布人默认是已读
|
|
|
|
|
|
actReadRecordEntity.setRead(GroupActConstant.READ); |
|
|
|
|
|
}else{ |
|
|
|
|
|
actReadRecordEntity.setRead(GroupActConstant.UN_READ); |
|
|
|
|
|
} |
|
|
|
|
|
actReadRecordEntity.setUserId(memberDTO.getCustomerUserId()); |
|
|
|
|
|
actReadRecordEntity.setShouldBeRead(Constant.YES); |
|
|
|
|
|
list.add(actReadRecordEntity); |
|
|
|
|
|
}); |
|
|
|
|
|
return list; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private GroupActInfoEntity constructGroupActInfoEntity(PublishGroupActFormDTO formDTO) { |
|
|
|
|
|
GroupActInfoEntity entity = ConvertUtils.sourceToTarget(formDTO, GroupActInfoEntity.class); |
|
|
|
|
|
entity.setId(formDTO.getGroupActId()); |
|
|
|
|
|
entity.setAllCategoryName(actCategoryDictService.queryAllCategoryName(formDTO.getCategoryCode(), formDTO.getCustomerId())); |
|
|
|
|
|
String startTimeStr = formDTO.getStartTime().concat(":00"); |
|
|
|
|
|
entity.setStartTime(DateUtils.parse(startTimeStr, DateUtils.DATE_TIME_PATTERN)); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(formDTO.getGroupActId())) { |
|
|
|
|
|
entity.setStatus(GroupActConstant.CHANGED); |
|
|
|
|
|
entity.setChangedTime(new Date()); |
|
|
|
|
|
GroupActInfoEntity orginalEntity=baseDao.selectById(formDTO.getGroupActId()); |
|
|
|
|
|
entity.setSignInStartTime(orginalEntity.getSignInStartTime()); |
|
|
|
|
|
entity.setSignInEndTime(orginalEntity.getSignInEndTime()); |
|
|
|
|
|
entity.setSummaryFlag(orginalEntity.getSummaryFlag()); |
|
|
|
|
|
entity.setSignedInNum(orginalEntity.getSignedInNum()); |
|
|
|
|
|
} else { |
|
|
|
|
|
//发布新活动
|
|
|
|
|
|
entity.setStatus(GroupActConstant.PUBLISHED); |
|
|
|
|
|
entity.setChangedTime(new Date()); |
|
|
|
|
|
entity.setSummaryFlag(NumConstant.ZERO); |
|
|
|
|
|
entity.setSignedInNum(NumConstant.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Result<GridInfoResultDTO> gridInfoRes = govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId()); |
|
|
|
|
|
if (!gridInfoRes.success() || null == gridInfoRes.getData()) { |
|
|
|
|
|
throw new RenException("网格信息查询失败,griId="+formDTO.getGridId()); |
|
|
|
|
|
} |
|
|
|
|
|
entity.setAgencyId(gridInfoRes.getData().getParentAgencyId()); |
|
|
|
|
|
entity.setGridPids(gridInfoRes.getData().getPids()); |
|
|
|
|
|
return entity; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkPublishGroupActFormDTO(PublishGroupActFormDTO formDTO) { |
|
|
|
|
|
//只有组长才能发布、编辑活动
|
|
|
|
|
|
ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getLeaderMember(formDTO.getGroupId()); |
|
|
|
|
|
if (!formDTO.getPublishUserId().equals(groupMemberDTO.getCustomerUserId())) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getCode(), EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(formDTO.getGroupActId())) { |
|
|
|
|
|
//已取消或者已关闭的活动不允许修改
|
|
|
|
|
|
GroupActInfoEntity originalAct = baseDao.selectById(formDTO.getGroupActId()); |
|
|
|
|
|
if (null == originalAct) { |
|
|
|
|
|
throw new RenException(String.format("活动已删除,group_act_info.id=%s", formDTO.getGroupActId())); |
|
|
|
|
|
} |
|
|
|
|
|
if (GroupActConstant.CANCELED.equals(originalAct.getStatus())) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_CANCELED_CAN_NOT_EDIT.getCode(), EpmetErrorCode.GROUP_ACT_CANCELED_CAN_NOT_EDIT.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
if (GroupActConstant.CLOSED.equals(originalAct.getStatus())) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_CLOSED_CAN_NOT_EDIT.getCode(), EpmetErrorCode.GROUP_ACT_CLOSED_CAN_NOT_EDIT.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//文本内容、图片列表至少选择一个
|
|
|
|
|
|
if (CollectionUtils.isEmpty(formDTO.getTextList()) && CollectionUtils.isEmpty(formDTO.getImgList())) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.PLEASE_INPUT_ACT_CONTENT.getCode(), EpmetErrorCode.PLEASE_INPUT_ACT_CONTENT.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
if (!CollectionUtils.isEmpty(formDTO.getTextList())) { |
|
|
|
|
|
//活动文本内容,目前只有一段,限制1000字
|
|
|
|
|
|
if (formDTO.getTextList().get(NumConstant.ZERO).length() > 1000) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_CONTENT_MAX.getCode(), EpmetErrorCode.GROUP_ACT_CONTENT_MAX.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!CollectionUtils.isEmpty(formDTO.getImgList())) { |
|
|
|
|
|
//最多选择3张图片
|
|
|
|
|
|
if (formDTO.getTextList().get(NumConstant.ZERO).length() > NumConstant.THREE) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.GROUP_ACT_IMG_MAX.getCode(), EpmetErrorCode.GROUP_ACT_IMG_MAX.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param title 活动标题 |
|
|
|
|
|
* @param textList 活动内容列表 |
|
|
|
|
|
* @param imgList 活动图片列表 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author yinzuomei |
|
|
|
|
|
* @description |
|
|
|
|
|
* @Date 2021/4/19 16:39 |
|
|
|
|
|
**/ |
|
|
|
|
|
private void scanActContent(String title, List<String> textList, List<String> imgList) { |
|
|
|
|
|
//活动标题
|
|
|
|
|
|
if (StringUtils.isNotBlank(title)) { |
|
|
|
|
|
//创建话题内容审核
|
|
|
|
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
|
|
taskDTO.setContent(title); |
|
|
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
|
|
textScanParamDTO.getTasks().add(taskDTO); |
|
|
|
|
|
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); |
|
|
|
|
|
if (!textSyncScanResult.success()) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
if (!textSyncScanResult.getData().isAllPass()) { |
|
|
|
|
|
log.warn(String.format("活动标题审核失败【%s】", title)); |
|
|
|
|
|
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//活动内容
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(textList)) { |
|
|
|
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
|
|
textList.forEach(content -> { |
|
|
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
|
|
taskDTO.setContent(content); |
|
|
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
|
|
textScanParamDTO.getTasks().add(taskDTO); |
|
|
|
|
|
}); |
|
|
|
|
|
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); |
|
|
|
|
|
if (!textSyncScanResult.success()) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
if (!textSyncScanResult.getData().isAllPass()) { |
|
|
|
|
|
log.warn(String.format("活动内容审核失败【%s】", JSON.toJSONString(textList))); |
|
|
|
|
|
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//活动图片
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(imgList)) { |
|
|
|
|
|
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); |
|
|
|
|
|
imgList.forEach(url -> { |
|
|
|
|
|
ImgTaskDTO task = new ImgTaskDTO(); |
|
|
|
|
|
task.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
|
|
task.setUrl(url); |
|
|
|
|
|
imgScanParamDTO.getTasks().add(task); |
|
|
|
|
|
}); |
|
|
|
|
|
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); |
|
|
|
|
|
if (!imgScanResult.success()) { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
|
|
} else { |
|
|
|
|
|
if (!imgScanResult.getData().isAllPass()) { |
|
|
|
|
|
log.warn("活动图片审核失败"); |
|
|
|
|
|
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActOperationRecordEntity constructOperRec(String groupActId, PublishGroupActFormDTO formDTO) { |
|
|
|
|
|
ActOperationRecordEntity actOperationRecordEntity = new ActOperationRecordEntity(); |
|
|
|
|
|
actOperationRecordEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
actOperationRecordEntity.setOperateUserId(formDTO.getPublishUserId()); |
|
|
|
|
|
actOperationRecordEntity.setGroupActId(groupActId); |
|
|
|
|
|
actOperationRecordEntity.setOperationType(StringUtils.isNotBlank(formDTO.getGroupActId()) ? GroupActConstant.CHANGE : GroupActConstant.PUBLISH); |
|
|
|
|
|
return actOperationRecordEntity; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private List<GroupActContentEntity> constructImg(String groupActId, String customerId, List<String> imgList) { |
|
|
|
|
|
List<GroupActContentEntity> list = new ArrayList<>(); |
|
|
|
|
|
int imgSort = NumConstant.ONE; |
|
|
|
|
|
for (String img : imgList) { |
|
|
|
|
|
GroupActContentEntity entity = new GroupActContentEntity(); |
|
|
|
|
|
entity.setGroupActId(groupActId); |
|
|
|
|
|
entity.setContent(img); |
|
|
|
|
|
entity.setContentType(GroupActConstant.IMG); |
|
|
|
|
|
entity.setCustomerId(customerId); |
|
|
|
|
|
entity.setSort(imgSort); |
|
|
|
|
|
imgSort++; |
|
|
|
|
|
} |
|
|
|
|
|
return list; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private List<GroupActContentEntity> constructText(String groupActId, String customerId, List<String> textList) { |
|
|
|
|
|
List<GroupActContentEntity> list = new ArrayList<>(); |
|
|
|
|
|
int textSort = NumConstant.ONE; |
|
|
|
|
|
for (String text : textList) { |
|
|
|
|
|
GroupActContentEntity entity = new GroupActContentEntity(); |
|
|
|
|
|
entity.setGroupActId(groupActId); |
|
|
|
|
|
entity.setContent(text); |
|
|
|
|
|
entity.setContentType(GroupActConstant.TEXT); |
|
|
|
|
|
entity.setCustomerId(customerId); |
|
|
|
|
|
entity.setSort(textSort); |
|
|
|
|
|
textSort++; |
|
|
|
|
|
} |
|
|
|
|
|
return list; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 004、活动详情 |
|
|
|
|
|
* |
|
|
|
|
|
* @param actDetailFormDTO |
|
|
|
|
|
* @return com.epmet.resi.group.dto.act.result.ActDetailResultDTO |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public ActDetailResultDTO queryActDetail(ActDetailFormDTO actDetailFormDTO) { |
|
|
|
|
|
//todo
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |