通告功能
This commit is contained in:
parent
60ae11c7cb
commit
cd95151b58
@ -228,8 +228,7 @@ public class BusiNoticeController extends BaseController
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BusiNotice> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BusiNoticeVo> list = busiNoticeService.appFootprintList(query,page);
|
||||
List<BusiNoticeVo> list = busiNoticeService.appFootprintList(query);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,10 @@ public class BusiNotice extends DlBaseEntity
|
||||
private String province;
|
||||
/** 城市 */
|
||||
private String city;
|
||||
/**
|
||||
* 是否急招0否1是
|
||||
*/
|
||||
private String isUrgent;
|
||||
//是否平台结算
|
||||
private Integer isPlatformFree;
|
||||
/** 稿费下限 */
|
||||
|
@ -43,11 +43,10 @@ public class BusiNoticeSign extends DlBaseEntity
|
||||
private String nickname;
|
||||
|
||||
/** 报名用户头像 */
|
||||
@Excel(name = "报名用户头像")
|
||||
@Excel(name = "报名用户头像", cellType = Excel.ColumnType.IMAGE)
|
||||
private String avatar;
|
||||
|
||||
/** 是否超级报名 */
|
||||
@Excel(name = "是否超级报名")
|
||||
|
||||
private String isSuper;
|
||||
|
||||
/** 联系方式 */
|
||||
@ -59,18 +58,18 @@ public class BusiNoticeSign extends DlBaseEntity
|
||||
private String addrId;
|
||||
|
||||
/** 通告合作状态 */
|
||||
@Excel(name = "通告合作状态")
|
||||
|
||||
private String status;
|
||||
|
||||
/** 稿件内容 */
|
||||
private String content;
|
||||
|
||||
/** 稿件图片 */
|
||||
@Excel(name = "稿件图片")
|
||||
|
||||
private String images;
|
||||
|
||||
/** 已发布的文章链接 */
|
||||
@Excel(name = "已发布的文章链接")
|
||||
|
||||
private String articleRef;
|
||||
/**
|
||||
* 动态表单json
|
||||
|
@ -49,7 +49,7 @@ public interface BusiNoticeMapper extends BaseMapper<BusiNotice> {
|
||||
* @param query 查询条件
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
IPage<BusiNoticeVo> appFootprintList(@Param("entity") AppNoticeQuery query, Page<BusiNotice> page);
|
||||
List<BusiNoticeVo> appFootprintList(@Param("entity") AppNoticeQuery query, @Param("num") Integer num);
|
||||
|
||||
/**
|
||||
* 小程序端查询订阅通告列表
|
||||
|
@ -37,5 +37,11 @@ public class AppNoticeQuery {
|
||||
//'进行中', '已关闭'
|
||||
private String status;
|
||||
private String noticeId;
|
||||
//是否急招
|
||||
private String isUrgent;
|
||||
//是否平台结算
|
||||
private String isPlatformFree;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public interface IBusiNoticeService extends IService<BusiNotice>
|
||||
* @param query 查询条件
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
IPage<BusiNoticeVo> appFootprintList(AppNoticeQuery query, Page<BusiNotice> page);
|
||||
List<BusiNoticeVo> appFootprintList(AppNoticeQuery query);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -36,6 +36,7 @@ import com.ruoyi.member.domain.MemberApply;
|
||||
import com.ruoyi.member.domain.MemberUser;
|
||||
import com.ruoyi.member.service.IMemberApplyService;
|
||||
import com.ruoyi.member.service.IMemberCardService;
|
||||
import com.ruoyi.member.service.IMemberCouponService;
|
||||
import com.ruoyi.member.service.IMemberUserService;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
@ -83,6 +84,8 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
@Resource
|
||||
private IMemberCardService cardService;
|
||||
|
||||
@Autowired
|
||||
private IMemberCouponService memberCouponService;
|
||||
|
||||
@Override
|
||||
public IPage<BusiNoticeVo> queryListPage(BusiNoticeQuery query, Page<BusiNotice> page) {
|
||||
@ -216,7 +219,12 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
}else {
|
||||
this.saveVo(data);
|
||||
}
|
||||
cardService.dealMemberRights(userId,null,"add_notice",1);
|
||||
try {
|
||||
cardService.dealMemberRights(userId,null,"add_notice",1);
|
||||
}catch (Exception e){
|
||||
memberCouponService.saveCoupon( userId, "2", data.getId(), 1);
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data.getCustomForm())) {
|
||||
cardService.dealMemberRights(userId,null,"report_info_collect",1);
|
||||
}
|
||||
@ -346,16 +354,17 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
@Override
|
||||
public IPage<BusiNoticeVo> appFootprintList(AppNoticeQuery query, Page<BusiNotice> page) {
|
||||
public List<BusiNoticeVo> appFootprintList(AppNoticeQuery query) {
|
||||
query.setUserId(SecurityUtils.getUserId());
|
||||
IPage<BusiNoticeVo> pageList = busiNoticeMapper.appFootprintList(query,page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
Integer num = cardService.getCardRightsValue(SecurityUtils.getUserId(), "02", "history");
|
||||
List<BusiNoticeVo> pageList = busiNoticeMapper.appFootprintList(query,num);
|
||||
List<String> idList = pageList.stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
Map<String,String> categoryMap = categoryList.stream().collect(Collectors.toMap(BaseCategory::getCode,BaseCategory::getTitle));
|
||||
pageList.getRecords().forEach(item->{
|
||||
pageList.forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
|
@ -65,7 +65,7 @@ public class BusiNoticeSignServiceImpl extends ServiceImpl<BusiNoticeSignMapper,
|
||||
busiNoticeSign.setUserId(loginUser.getUserId());
|
||||
busiNoticeSign.setNickname(sysUser.getNickName());
|
||||
busiNoticeSign.setAvatar(sysUser.getAvatar());
|
||||
busiNoticeSign.setStatus("0");
|
||||
busiNoticeSign.setStatus("01");
|
||||
busiNoticeSign.setFormData(JSONArray.toJSONString(appNoticeSign.getCustomForm()));
|
||||
busiNoticeSign.setCardId(cardInfo.getString("id"));
|
||||
busiNoticeSign.setPrice(cardInfo.getBigDecimal("price"));
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户通告券变动记录Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-03-17
|
||||
*/
|
||||
@ -56,7 +56,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper,Memb
|
||||
if ("2".equals(type)){
|
||||
int initNum = getCoupon(userId);
|
||||
if (initNum == 0) {
|
||||
throw new Exception("当前暂无可用的通告券");
|
||||
throw new Exception("暂无可用报名次数");
|
||||
}
|
||||
}
|
||||
//查询当前用户最新变动记录
|
||||
|
@ -9,7 +9,7 @@
|
||||
select main.id, main.user_id, main.title, main.platform_code, main.province, main.city, main.fee_down, main.fee_up, main.is_self_price, main.gift_detail,
|
||||
main.gift_price, main.end_date, main.brand, main.is_show_brand, main.need_num, main.fans_down, main.fans_up, main.is_eligible, main.pic, main.collect, main.detail, main.images,
|
||||
main.blogger_types, main.is_show_tel, main.wechat, main.tel, main.group_image, main.is_use_coupon, main.approval_status, main.approval_user_id, main.approval_time,
|
||||
main.approval_remark, main.creator, main.create_time, main.updater, main.update_time, main.del_flag,
|
||||
main.approval_remark, main.creator, main.create_time, main.updater, main.update_time, main.del_flag,main.is_platform_free,main.is_urgent,
|
||||
uTable.nick_name as userNickName,auditTable.nick_name as approvalUserName,ifnull(noticeView.view_num,0) as viewNum,
|
||||
bTable.title as platformName
|
||||
from dl_busi_notice main
|
||||
@ -25,6 +25,8 @@
|
||||
<if test="entity.city != null "> and main.city = #{entity.city}</if>
|
||||
<if test="entity.title != null and entity.title != ''"> and main.title like concat('%', #{entity.title}, '%')</if>
|
||||
<if test="entity.platformCode != null and entity.platformCode != ''"> and main.platform_code = #{entity.platformCode}</if>
|
||||
<if test="entity.isUrgent != null and entity.isUrgent != ''"> and main.is_urgent = #{entity.isUrgent}</if>
|
||||
<if test="entity.isPlatformFree != null and entity.isPlatformFree != ''"> and main.is_platform_free = #{entity.isPlatformFree}</if>
|
||||
|
||||
<if test="entity.params.beginFeeDown != null and entity.params.beginFeeDown != ''">
|
||||
and main.fee_down <![CDATA[>= ]]> #{entity.params.beginFeeDown}
|
||||
@ -74,7 +76,7 @@ order by dbns.create_time desc
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
left join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
dbn.del_flag = 0 and dbn.end_date >= CURDATE()
|
||||
AND (dbn.approval_status = '1')
|
||||
<if test="entity.gift!=null and entity.gift!=''">
|
||||
AND ( dbn.gift_detail IS NOT NULL AND dbn.gift_detail != '' )
|
||||
@ -82,6 +84,8 @@ order by dbns.create_time desc
|
||||
<if test="entity.platformCode!=null and entity.platformCode!=''">
|
||||
AND ( dbn.platform_code =#{entity.platformCode} )
|
||||
</if>
|
||||
<if test="entity.isUrgent != null and entity.isUrgent != ''"> and dbn.is_urgent = #{entity.isUrgent}</if>
|
||||
<if test="entity.isPlatformFree != null and entity.isPlatformFree != ''"> and dbn.is_platform_free = #{entity.isPlatformFree}</if>
|
||||
<if test="entity.bloggerType!=null and entity.bloggerType!=''">
|
||||
AND ( dbn.blogger_types LIKE CONCAT('%',#{entity.bloggerType},'%') )
|
||||
</if>
|
||||
@ -109,20 +113,20 @@ order by dbns.create_time desc
|
||||
</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
-- 查最新的 --
|
||||
dbn.create_time DESC
|
||||
</when>
|
||||
<when test="entity.sortBy=='money'">
|
||||
-- 查高奖励 --
|
||||
dbn.fee_up DESC
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
-- 查最新的 --
|
||||
dbn.create_time DESC
|
||||
</when>
|
||||
<when test="entity.sortBy=='money'">
|
||||
-- 查高奖励 --
|
||||
dbn.fee_up DESC
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
<select id="selectByIdVo" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
|
||||
@ -159,6 +163,8 @@ order by dbns.create_time desc
|
||||
<if test="entity.platformCode!=null and entity.platformCode!=''">
|
||||
AND ( dbn.platform_code =#{entity.platformCode} )
|
||||
</if>
|
||||
<if test="entity.isUrgent != null and entity.isUrgent != ''"> and dbn.is_urgent = #{entity.isUrgent}</if>
|
||||
<if test="entity.isPlatformFree != null and entity.isPlatformFree != ''"> and dbn.is_platform_free = #{entity.isPlatformFree}</if>
|
||||
<if test="entity.bloggerType!=null and entity.bloggerType!=''">
|
||||
AND ( dbn.blogger_types LIKE CONCAT('%',#{entity.bloggerType},'%') )
|
||||
</if>
|
||||
@ -200,6 +206,7 @@ order by dbns.create_time desc
|
||||
dbn.create_time ASC
|
||||
</otherwise>
|
||||
</choose>
|
||||
limit #{num}
|
||||
</select>
|
||||
<select id="subscribeList" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
|
||||
SELECT
|
||||
@ -252,6 +259,8 @@ order by dbns.create_time desc
|
||||
<if test="entity.feeDown!=null">
|
||||
AND ( dbn.fee_down >=#{entity.feeDown} )
|
||||
</if>
|
||||
<if test="entity.isUrgent != null and entity.isUrgent != ''"> and dbn.is_urgent = #{entity.isUrgent}</if>
|
||||
<if test="entity.isPlatformFree != null and entity.isPlatformFree != ''"> and dbn.is_platform_free = #{entity.isPlatformFree}</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user