Commit e3ca0dd7 authored by liwei's avatar liwei

修改了活动报名

parent b7c0a691
......@@ -41,5 +41,7 @@ public interface CmsActivityRepository extends CyBaseMapper<CmsActivity> {
Integer getIsApplication(@Param("userId") String userId, @Param("activityId") Integer activityId);
//增加活动报名人数
Integer addApplicationCount(@Param("businessId") Integer businessId);
//查询活动报名人数
Integer selectByActivityId(Integer businessId);
}
......@@ -223,6 +223,13 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
private void extracted(Integer businessId, CmsActivity info) {
Set<String> map = redisTemplate.keys(RedisCons.ORDER_ACTIVITY + ":" + businessId + ":" +"*");
if (CollectionUtils.isEmpty(map)){
//根据活动id查询报名信息
Integer count = baseMapper.selectByActivityId(businessId);
if (count > 0){
throw new CyServiceException("活动已经报名,不允许取消发布");
}
}
if (CollectionUtils.isNotEmpty(map)) //报名人数和实际剩余报名人数不等
throw new CyServiceException("活动已经报名,不允许取消发布");
if ("0".equals(info.getPublishStatus()))
......
......@@ -203,6 +203,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
application.setActivityId(info.getBusinessId());
application.setStatus("1");
application.setApplicationFee(BigDecimal.ZERO);
application.setCreateDate(new Date());
applicationRepository.insert(application);
//设置价格
orderInfo.setPrice(BigDecimal.ZERO);
......
......@@ -608,5 +608,10 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
*/
@TableField(exist = false)
private String wxNickName;
/**
* 学历认证图片url
*/
private String memEducationUrl;
}
......@@ -439,9 +439,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel likeAdd(Integer articleId,String praiseType){
//添加实名判断
String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先实名认证!");
int line = 0;
if (praiseType.equals("praise")){
//点赞
......@@ -473,9 +471,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel likeCommentAdd(Integer commentId,String praiseType){
//添加实名判断
String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先实名认证!");
int line = 0;
if (praiseType.equals("praise")){
//点赞
......
......@@ -245,4 +245,10 @@
AND ca.flag = '1'
AND ca.del_flag = '0'
</select>
<select id="selectByActivityId" resultType="java.lang.Integer">
select count(*)
from cms_application
where 1=1
and activity_id = #{businessId}
</select>
</mapper>
......@@ -213,25 +213,11 @@
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike
# oi.url AS memAvatar,
# GROUP_CONCAT(DISTINCT pic_urls.url ORDER BY pic_urls.url SEPARATOR ',') AS url
FROM
opm_article opa
LEFT JOIN opm_topic opt ON opa.topic_id = opt.business_id
LEFT JOIN mem_info mi ON opa.create_by = mi.user_id
# LEFT JOIN oss_info oi ON mi.avatar = oi.business_id
LEFT JOIN opm_article_like oal on oal.article_id = opa.business_id and oal.user_id = #{entity.loginUserId}
# LEFT JOIN (
# SELECT
# opm_article.business_id,
# CAST(JSON_UNQUOTE(JSON_EXTRACT(picture_id, CONCAT('$.id[', jt_ids.idx - 1, ']'))) AS UNSIGNED) AS picture_id
# FROM
# opm_article,
# JSON_TABLE(JSON_EXTRACT(opm_article.picture_id, '$.id'), '$[*]' COLUMNS (idx FOR ORDINALITY)) AS jt_ids
# WHERE
# opm_article.del_flag = '0'
# ) AS pic_ids ON opa.business_id = pic_ids.business_id
# LEFT JOIN oss_info pic_urls ON pic_ids.picture_id = pic_urls.business_id
WHERE 1=1
and opa.del_flag = '0'
and opa.flag = '1'
......@@ -256,10 +242,46 @@
#{item}
</foreach>
</if>
GROUP BY
opa.business_id
ORDER BY
opa.create_date DESC
UNION ALL(
SELECT
opa.business_id,
opa.flag,
opa.del_flag,
opa.comment_count,
opa.like_count,
opa.exam_status,
opa.is_article,
opa.create_date,
opa.content,
opa.create_by AS userId,
opa.picture_id,
opt.topic_name AS topic,
mi.mem_code,
mi.mem_nick_name,
mi.mem_sex,
mi.mem_birthday,
mi.mem_residence_province,
mi.mem_residence_city,
mi.mem_max_education,
mi.mem_career,
mi.mem_wx_code,
mi.business_id AS memberId,
mi.avatar AS avatarId,
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike
FROM
opm_article opa
LEFT JOIN opm_topic opt ON opa.topic_id = opt.business_id
LEFT JOIN mem_info mi ON opa.create_by = mi.user_id
LEFT JOIN opm_article_like oal on oal.article_id = opa.business_id and oal.user_id = #{entity.loginUserId}
WHERE 1=1
and opa.del_flag = '0'
and opa.flag = '1'
and opa.exam_status = '0'
and opa.create_by = #{entity.loginUserId}
)
ORDER BY create_date DESC
</select>
<select id="queryUserArticlePaged" resultType="org.rcisoft.business.opmArticle.entity.OpmArticle">
SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment