通告功能
This commit is contained in:
parent
36e8829024
commit
975050e5d6
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
<description>通告快接管理后台</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>3.8.9</ruoyi.version>
|
||||
|
@ -27,7 +27,7 @@ public class WxApi {
|
||||
@Anonymous
|
||||
public Map<String, String> getCodeUrl(String userType, String url) {
|
||||
Map<String, String> res = new HashMap<>();
|
||||
res.put("codeUrl", weChatUtils.getCodeUrl("https://www.ddtg.site/#/" + url, userType));
|
||||
res.put("codeUrl", weChatUtils.getCodeUrl("https://www.ddtg.site/" + url, userType));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -122,11 +122,11 @@ public class WeChatMessageServiceImpl implements IWeChatMessageService {
|
||||
String bzHtml = "https://www.ddtg.site/#/pages/mine/member/member-card?userType=02";
|
||||
String jqStr = "<a href=\""+jqHtml+"\">1、进群</a>";
|
||||
String xsStr = "<a href=\""+xsHtml+"\">2、新手教程</a>";
|
||||
String tgzStr = "<a href=\""+tgzHtml+"\">3、通告主卡</a>";
|
||||
String bzStr = "<a href=\""+bzHtml+"\">4、博主VIP</a>";
|
||||
String tgzStr = "<a href=\""+tgzHtml+"\">1、通告主卡</a>";
|
||||
String bzStr = "<a href=\""+bzHtml+"\">2、博主VIP</a>";
|
||||
contentMessage.append(contentStr).append("\n")
|
||||
.append(jqStr).append("\n")
|
||||
.append(xsStr).append("\n")
|
||||
// .append(jqStr).append("\n")
|
||||
// .append(xsStr).append("\n")
|
||||
.append(tgzStr).append("\n")
|
||||
.append(bzStr).append("\n");
|
||||
if (msgType.equals("event")) {
|
||||
|
@ -41,6 +41,8 @@ public class AppNoticeQuery {
|
||||
private String isUrgent;
|
||||
//是否平台结算
|
||||
private String isPlatformFree;
|
||||
private String cityId;
|
||||
private String cityName;
|
||||
|
||||
|
||||
|
||||
|
@ -100,7 +100,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
* @param data 通告对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveVo(BusiNotice data) throws Exception {
|
||||
//获取当前登录用户
|
||||
data.setUserId(SecurityUtils.getUserId());
|
||||
@ -143,13 +142,13 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
}
|
||||
this.save(data);
|
||||
try {
|
||||
cardService.dealMemberRights(data.getUserId(),null,"add_notice",1);
|
||||
cardService.dealMemberRights2(data.getUserId(),null,"add_notice",1);
|
||||
}catch (Exception e){
|
||||
memberCouponService.saveCoupon( data.getUserId(), "2", data.getId(), 1);
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(data.getCustomForm())) {
|
||||
cardService.dealMemberRights(data.getUserId(),null,"report_info_collect",1);
|
||||
cardService.dealMemberRights2(data.getUserId(),null,"report_info_collect",1);
|
||||
}
|
||||
}
|
||||
//保存表单数据
|
||||
@ -168,7 +167,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateByIdVo(BusiNotice data) {
|
||||
|
||||
//获取当前登录用户
|
||||
@ -222,8 +220,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String saveOrUpdateVo(BusiNotice data) throws Exception {
|
||||
//获取当前登录用户id
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if(ObjectUtil.isNotEmpty(data.getCityId())){
|
||||
//转换城市名称
|
||||
LambdaQueryWrapper<BaseCity> queryWrapper =new LambdaQueryWrapper<>();
|
||||
@ -343,6 +339,10 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
**/
|
||||
@Override
|
||||
public IPage<BusiNoticeVo> queryAppListPage(AppNoticeQuery query, Page<BusiNotice> page) {
|
||||
if (ObjectUtil.isNotEmpty(query.getCityId())){
|
||||
BaseCity city = cityService.getById(query.getCityId());
|
||||
query.setCityName(city.getName());
|
||||
}
|
||||
IPage<BusiNoticeVo> pageList = busiNoticeMapper.queryAppListPage(query,page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
|
@ -5,6 +5,8 @@ import java.util.List;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.busi.domain.BusiNotice;
|
||||
import com.ruoyi.busi.mapper.BusiNoticeMapper;
|
||||
import com.ruoyi.busi.query.AppNoticeSign;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
@ -39,6 +41,8 @@ public class BusiNoticeSignServiceImpl extends ServiceImpl<BusiNoticeSignMapper,
|
||||
private ISysUserService userService;
|
||||
@Resource
|
||||
private IMemberCardService cardService;
|
||||
@Autowired
|
||||
private BusiNoticeMapper noticeMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BusiNoticeSign> queryListPage(BusiNoticeSign pageReqVO, Page<BusiNoticeSign> page) {
|
||||
@ -57,6 +61,14 @@ public class BusiNoticeSignServiceImpl extends ServiceImpl<BusiNoticeSignMapper,
|
||||
if(busiNoticeSignMapper.selectOne(new LambdaQueryWrapper<BusiNoticeSign>().eq(BusiNoticeSign::getNoticeId, appNoticeSign.getNoticeId()).eq(BusiNoticeSign::getUserId, loginUser.getUserId()).last("limit 1"))!=null){
|
||||
throw new Exception("请勿重复报名!");
|
||||
}
|
||||
//判断报名是否到上线
|
||||
BusiNotice busiNotice = noticeMapper.selectById(appNoticeSign.getNoticeId());
|
||||
|
||||
LambdaQueryWrapper<BusiNoticeSign> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusiNoticeSign::getNoticeId, appNoticeSign.getNoticeId());
|
||||
if(busiNoticeSignMapper.selectCount(queryWrapper)>=busiNotice.getNeedNum()){
|
||||
throw new Exception("报名人数已满!");
|
||||
}
|
||||
SysUser sysUser = userService.selectUserById(loginUser.getUserId());
|
||||
int i = 0;
|
||||
for (JSONObject cardInfo : appNoticeSign.getCardList()) {
|
||||
|
@ -73,7 +73,7 @@ public interface IMemberCardService extends IService<MemberCard> {
|
||||
* @param deplete 扣的值
|
||||
**/
|
||||
void dealMemberRights(Long userId,String noticeId,String rightsCode,Integer deplete) throws Exception;
|
||||
|
||||
void dealMemberRights2(Long userId,String noticeId,String rightsCode,Integer deplete) throws Exception;
|
||||
/**
|
||||
* 查某用户某身份类型的会员卡到期时间,如果没有开通会员,那么返回null
|
||||
*
|
||||
|
@ -290,6 +290,36 @@ public class MemberCardServiceImpl extends ServiceImpl<MemberCardMapper, MemberC
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param userId 用户id
|
||||
* @param rightsCode 权益编码
|
||||
* @param noticeId 通告id
|
||||
* @param deplete 扣的值
|
||||
* @author PQZ
|
||||
* @date 14:23 2025/4/17
|
||||
**/
|
||||
@Override
|
||||
public void dealMemberRights2(Long userId,String noticeId, String rightsCode, Integer deplete) throws Exception {
|
||||
//查询当前用户有无正在服役的通告主卡
|
||||
List<MemberCard> memberCards = getMemberCards(userId,null);
|
||||
if (memberCards.isEmpty()){
|
||||
throw new Exception("无正在服役的会员卡");
|
||||
}
|
||||
if ("unlock_notice".equals(rightsCode)) {
|
||||
if (noticeId == null){
|
||||
throw new Exception("无法识别当前通告");
|
||||
}
|
||||
//true表示有浏览记录,false表示没有浏览记录;如果当前用户在足迹表中未发现该通告。
|
||||
if (footprintService.checkFoot(noticeId,userId)){
|
||||
rightsService.dealMemberRights(userId,memberCards,rightsCode,deplete);
|
||||
}
|
||||
} else {
|
||||
rightsService.dealMemberRights(userId,memberCards,rightsCode,deplete);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 查某用户某身份类型的会员卡到期时间,如果没有开通会员,那么返回null
|
||||
*
|
||||
|
@ -113,7 +113,7 @@ public class SwaggerConfig
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:若依管理系统_接口文档")
|
||||
.title("标题:通告快接管理后台_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// 作者信息
|
||||
|
@ -81,6 +81,9 @@ order by dbns.create_time desc
|
||||
<if test="entity.gift!=null and entity.gift!=''">
|
||||
AND ( dbn.gift_detail IS NOT NULL AND dbn.gift_detail != '' )
|
||||
</if>
|
||||
<if test="entity.cityName!=null and entity.cityName!=''">
|
||||
AND dbn.city =#{entity.cityName}
|
||||
</if>
|
||||
<if test="entity.platformCode!=null and entity.platformCode!=''">
|
||||
AND ( dbn.platform_code =#{entity.platformCode} )
|
||||
</if>
|
||||
|
Loading…
Reference in New Issue
Block a user