bug修复
This commit is contained in:
parent
6273d05022
commit
c0a93a7ae1
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
@ -106,6 +108,28 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
return busiNoticeMapper.queryListPage(query, page);
|
||||
}
|
||||
|
||||
// 方法用于提取URL中的eid参数值
|
||||
public static String getEidFromUrl(String url) throws URISyntaxException {
|
||||
URI uri = new URI(url);
|
||||
String query = uri.getQuery();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
for (String param : query.split("&")) {
|
||||
String[] pair = param.split("=");
|
||||
params.put(pair[0], pair.length > 1 ? pair[1] : null);
|
||||
}
|
||||
return params.get("eid");
|
||||
}
|
||||
// 判断两个URL中的eid是否相等
|
||||
public static boolean isEidEqual(String url1, String url2) throws URISyntaxException {
|
||||
try {
|
||||
String eid1 = getEidFromUrl(url1);
|
||||
String eid2 = getEidFromUrl(url2);
|
||||
return eid1 != null && eid1.equals(eid2);
|
||||
}catch (Exception e){
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 新增通告
|
||||
* @param data 通告对象
|
||||
@ -137,11 +161,26 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
for (BusiNotice busiNotice : list) {
|
||||
if (StringUtils.isNotEmpty(data.getThirdUrl())&&StringUtils.isNotEmpty(busiNotice.getThirdUrl())){
|
||||
if (data.getThirdUrl().equals(busiNotice.getThirdUrl())){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
//两条thirdurl相等
|
||||
data.setApprovalStatus("8");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","通告查重,下次早点上传哦!");
|
||||
}else if (busiNotice.getThirdUrl().contains(data.getThirdUrl())||data.getThirdUrl().contains(busiNotice.getThirdUrl())){
|
||||
//两条thirdurl存在包含情况
|
||||
data.setApprovalStatus("8");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","通告查重,下次早点上传哦!");
|
||||
}else if (isEidEqual(data.getThirdUrl(),busiNotice.getThirdUrl())){
|
||||
//两条thirdurl都存在eid且eid相等
|
||||
data.setApprovalStatus("8");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","通告查重,下次早点上传哦!");
|
||||
}
|
||||
if (data.getApprovalStatus().equals("8")){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -234,11 +273,28 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
//删除结尾的最后一个逗号
|
||||
data.setSimilarityIds(data.getSimilarityIds().substring(0, data.getSimilarityIds().length() - 1));
|
||||
}
|
||||
//若是急招扣除对应急招券
|
||||
if (data.getApprovalStatus().equals("1")&&(StringUtils.isEmpty(oldData.getIsUrgent())||oldData.getIsUrgent().equals("0"))&&StringUtils.isNotEmpty(data.getIsUrgent())&&data.getIsUrgent().equals("1")){
|
||||
memberCouponService.saveCoupon( data.getUserId(), "2", data.getId(), 1);
|
||||
}
|
||||
this.updateById(data);
|
||||
MemberUserVO memberUserVO = memberUserService.queryByUserId(SecurityUtils.getUserId(), "01");
|
||||
if(data.getApprovalStatus().equals("1")&&!oldData.getApprovalStatus().equals("1") ){
|
||||
if (StringUtils.isNotEmpty(memberUserVO.getIdentityType()) && memberUserVO.getIdentityType().equals("05")){
|
||||
//如果审核通过
|
||||
//从配置表中获取积分
|
||||
MemberPoints memberPoints = new MemberPoints();
|
||||
memberPoints.setUserId(SecurityUtils.getUserId());
|
||||
memberPoints.setType("1");
|
||||
memberPoints.setFromCode("fbgg");
|
||||
memberPointsService.savePoints(memberPoints);
|
||||
}
|
||||
//若是急招扣除对应急招券
|
||||
if (StringUtils.isNotEmpty(data.getIsUrgent())&&data.getIsUrgent().equals("1")){
|
||||
memberCouponService.saveCoupon( data.getUserId(), "2", data.getId(), 1);
|
||||
}
|
||||
cardService.dealMemberRights2(data.getUserId(),null,"add_notice",1);
|
||||
if (CollectionUtil.isNotEmpty(data.getCustomForm())) {
|
||||
cardService.dealMemberRights2(data.getUserId(),null,"report_info_collect",1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//先删除表单数据
|
||||
busiNoticeFormService.remove(new LambdaQueryWrapper<BusiNoticeForm>().eq(BusiNoticeForm::getNoticeId,data.getId()));
|
||||
@ -405,16 +461,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
//打乱records的排列顺序
|
||||
List<String> idList = pageList.getRecords().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->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
@ -439,17 +490,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
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.forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
@ -575,16 +620,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
|
||||
List<String> idList = pageList.getRecords().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->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
@ -612,16 +652,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.loveList(query, page);
|
||||
List<String> idList = pageList.getRecords().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->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
@ -644,16 +679,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.myNoticeList(query, page);
|
||||
List<String> idList = pageList.getRecords().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->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
@ -672,16 +702,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.myPublishNoticeList(query, page);
|
||||
List<String> idList = pageList.getRecords().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.getRecords().forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ public class MemberApplyController extends BaseController {
|
||||
try{
|
||||
memberApplyService.toApply(memberApply);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage());
|
||||
return error(e.getMessage());
|
||||
}
|
||||
return success();
|
||||
|
@ -69,12 +69,12 @@ order by dbns.create_time desc
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum
|
||||
-- count(sign.id) as reportNum
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.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
|
||||
<if test="entity.userId!=null and entity.userId!=''">
|
||||
left join dl_member_blacklist blacklist on blacklist.black_user_id = dbn.user_id and blacklist.del_flag = 0 and blacklist.user_id = #{entity.userId}
|
||||
</if>
|
||||
@ -85,7 +85,7 @@ order by dbns.create_time desc
|
||||
and blacklist.id is null
|
||||
</if>
|
||||
<if test="entity.gift!=null and entity.gift!=''">
|
||||
AND ( dbn.gift_detail IS NOT NULL AND dbn.gift_detail != '' )
|
||||
AND (( dbn.fee_down is null or dbn.fee_down = 0 ) and dbn.fee_up = 0)
|
||||
</if>
|
||||
<if test="entity.cityName!=null and entity.cityName!=''">
|
||||
AND dbn.city =#{entity.cityName}
|
||||
@ -108,18 +108,46 @@ order by dbns.create_time desc
|
||||
<if test="entity.rewardType=='gift'">
|
||||
AND ( dbn.have_gift = '1' )
|
||||
</if>
|
||||
<if test="entity.fansUp!=null">
|
||||
AND ( dbn.fans_up <= #{entity.fansUp} )
|
||||
</if>
|
||||
<if test="entity.fansDown!=null">
|
||||
AND ( dbn.fans_down <= #{entity.fansDown} )
|
||||
</if>
|
||||
<if test="entity.feeUp!=null">
|
||||
AND ( dbn.fee_up <= #{entity.feeUp} )
|
||||
</if>
|
||||
<if test="entity.feeDown!=null">
|
||||
AND ( dbn.fee_down <=#{entity.feeDown} )
|
||||
</if>
|
||||
<choose>
|
||||
<!-- 情况一:同时填写了下限和上限 -->
|
||||
<when test="entity.fansDown != null and entity.fansUp != null">
|
||||
AND (
|
||||
dbn.fans_down <![CDATA[ <= ]]> #{entity.fansUp}
|
||||
AND (dbn.fans_up IS NULL OR dbn.fans_up >= #{entity.fansDown})
|
||||
)
|
||||
</when>
|
||||
|
||||
<!-- 情况二:只填写了下限 -->
|
||||
<when test="entity.fansDown != null">
|
||||
AND (dbn.fans_up IS NULL OR dbn.fans_up >= #{entity.fansDown})
|
||||
</when>
|
||||
|
||||
<!-- 情况三:只填写了上限 -->
|
||||
<when test="entity.fansUp != null">
|
||||
AND dbn.fans_down <![CDATA[ <= ]]> #{entity.fansUp}
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
<choose>
|
||||
<!-- 情况一:同时填写了下限和上限 -->
|
||||
<when test="entity.feeDown != null and entity.feeUp != null">
|
||||
AND (
|
||||
dbn.fee_down <![CDATA[ <= ]]> #{entity.feeUp}
|
||||
AND (dbn.fee_up IS NULL OR dbn.fee_up >= #{entity.feeDown})
|
||||
)
|
||||
</when>
|
||||
|
||||
<!-- 情况二:只填写了下限 -->
|
||||
<when test="entity.feeDown != null">
|
||||
AND (dbn.fee_up IS NULL OR dbn.fee_up >= #{entity.feeDown})
|
||||
</when>
|
||||
|
||||
<!-- 情况三:只填写了上限 -->
|
||||
<when test="entity.feeUp != null">
|
||||
AND dbn.fee_down <![CDATA[ <= ]]> #{entity.feeUp}
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
@ -201,20 +229,10 @@ 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 ASC
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
-- 默认正序排列 --
|
||||
footprint.create_time desc
|
||||
|
||||
limit #{num}
|
||||
</select>
|
||||
<select id="subscribeList" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
|
||||
|
@ -81,7 +81,7 @@
|
||||
<if test="entity.identityType != null and entity.identityType != ''">and main.identity_type =
|
||||
#{entity.identityType}
|
||||
</if>
|
||||
<if test="entity.nickName != null and entity.nickName != '' ">and su.nack_name = #{entity.nickName}</if>
|
||||
<if test="entity.nickName != null and entity.nickName != '' ">and su.nick_name like concat('%',#{entity.nickName},'%') </if>
|
||||
<if test="entity.userId != null "> and su.invite_id = #{entity.userId}</if>
|
||||
<if test="entity.tel != null and entity.tel !='' "> and main.tel like CONCAT('%',#{entity.tel},'%') </if>
|
||||
</where>
|
||||
|
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
AND u.nick_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
|
Loading…
Reference in New Issue
Block a user