Browse Source

latest_act_info新增act_info_id

dev_shibei_match
yinzuomei 5 years ago
parent
commit
795ac1120e
  1. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  3. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java
  4. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  5. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  6. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  7. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
  8. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -209,4 +209,8 @@ public class LatestActInfoDTO implements Serializable {
*/
private String delFlag;
/**
* 数据库新增ACT_INFO_ID字段act_info.id
*/
private String actInfoId;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -32,6 +32,11 @@ public class RePublishFormDTO implements Serializable {
@Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class})
private List<PublishActContentFormDTO> actContent;
/**
* 发布之前如果点击了预览此列有值
*/
private String actDraftId;
/**
* 活动id
*/

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.result.work.ActPreviewResultDTO;
import com.epmet.dto.result.work.LatestDraftActInfoResultDTO;
import com.epmet.entity.LatestActInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 最近一次编辑的活动信息
@ -67,4 +68,14 @@ public interface LatestActInfoDao extends BaseDao<LatestActInfoEntity> {
* @Date 2020/7/27 17:10
**/
int updateToDelById(String id);
/**
* @return int
* @param actDraftId
* @param actInfoId
* @author yinzuomei
* @description
* @Date 2020/8/4 15:26
**/
int updateActInfoId(@Param("actDraftId") String actDraftId, @Param("actInfoId") String actInfoId);
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java

@ -178,5 +178,8 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 审核开关1报名人员需要人工审核0不需要
*/
private Boolean auditSwitch;
/**
* 数据库新增ACT_INFO_ID字段act_info.id
*/
private String actInfoId;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -165,6 +165,11 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
logger.info("修改活动草稿actDraftId",formDTO.getActDraftId());
latestActInfoDTO.setId(formDTO.getActDraftId());
}
//如果是重新编辑活动进来的,保存草稿的时候,记录活动id的关系
if(StringUtils.isNotBlank(formDTO.getActId())){
logger.info("重新编辑活动act_id="+formDTO.getActId());
latestActInfoDTO.setActInfoId(formDTO.getActId());
}
latestActInfoDTO.setCustomerId(formDTO.getCustomerId());
//活动标题
latestActInfoDTO.setTitle(formDTO.getTitle());

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -93,6 +93,9 @@ public class WorkActServiceImpl implements WorkActService {
private ActGrantPointLogDao actGrantPointLogDao;
@Autowired
private UserKindnessTimeLogDao userKindnessTimeLogDao;
@Autowired
private LatestActInfoDao latestActInfoDao;
/**
* @return void
* @author yinzuomei
@ -151,7 +154,11 @@ public class WorkActServiceImpl implements WorkActService {
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);
@ -1216,6 +1223,10 @@ public class WorkActServiceImpl implements WorkActService {
/*if(rePublishFormDTO.getNoticePassedPeople()){
this.noticePassedPeople(originalActInfo,newActInfoEntity);
}*/
//如果用户在重新发布之前点击了预览,需要去更新草稿表里的act_info_id,记录草稿和活动的关系
if(StringUtils.isNotBlank(rePublishFormDTO.getActDraftId())){
latestActInfoDao.updateActInfoId(rePublishFormDTO.getActDraftId(),newActInfoEntity.getId());
}
return publishActResultDTO;
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql

@ -11,7 +11,7 @@
Target Server Version : 50728
File Encoding : 65001
Date: 31/07/2020 17:50:23
Date: 04/08/2020 15:40:16
*/
SET NAMES utf8mb4;
@ -420,6 +420,7 @@ CREATE TABLE `latest_act_info` (
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识',
`ACT_INFO_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'act_info.id',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '最近一次编辑的活动信息' ROW_FORMAT = Compact;

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

@ -39,6 +39,7 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="actInfoId" column="ACT_INFO_ID"/>
</resultMap>
<!-- 查询当前用户保留的活动记录 -->
@ -50,6 +51,7 @@
WHERE
lai.DEL_FLAG = '0'
AND lai.CREATED_BY = #{userId}
AND (lai.act_info_id is null or trim(lai.act_info_id) ='')
</select>
<resultMap type="com.epmet.dto.result.work.LatestDraftActInfoResultDTO" id="LatestDraftActInfoResultMap">
@ -123,4 +125,11 @@
<update id="updateToDelById" parameterType="java.lang.String">
update latest_act_info set DEL_FLAG='1' where id=#{id}
</update>
<!-- 发布活动成功后,更新草稿表里的活动id -->
<update id="updateActInfoId" parameterType="map">
UPDATE latest_act_info
SET ACT_INFO_ID = #{actInfoId}
WHERE id = #{actDraftId}
</update>
</mapper>
Loading…
Cancel
Save