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