bug修复
This commit is contained in:
parent
bafb970fc4
commit
10cbfb8d6a
@ -139,16 +139,14 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
data.setApprovalTime(new Date());
|
||||
//遍历 list的每条数据与data对比,如果两条数据相似度大于70% 提出预警
|
||||
for (BusiNotice busiNotice : list) {
|
||||
String tempDetail1 = data.getDetail().replaceAll("<br>","").replaceAll("\n","");
|
||||
String tempDetail2 = busiNotice.getDetail().replaceAll("<br>","").replaceAll("\n","");
|
||||
double v2 = NoticeUtils.computeJaccardSimilarity(tempDetail1, tempDetail2);
|
||||
if (v2>=0.7){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setApprovalTime(null);
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","该通告已被人抢先一步上传,等待平台审核");
|
||||
if (StringUtils.isNotEmpty(data.getThirdUrl())&&StringUtils.isNotEmpty(busiNotice.getThirdUrl())){
|
||||
if (data.getThirdUrl().equals(busiNotice.getThirdUrl())){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","该通告已被人抢先一步上传,等待平台审核");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(data.getSimilarityIds())){
|
||||
@ -158,14 +156,16 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
data.setCreateTime(new Date());
|
||||
this.save(data);
|
||||
MemberUserVO memberUserVO = memberUserService.queryByUserId(SecurityUtils.getUserId(), "01");
|
||||
if(data.getApprovalStatus().equals("1")&&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(data.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);
|
||||
@ -208,8 +208,7 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
//获取当前登录用户
|
||||
data.setUserId(SecurityUtils.getUserId());
|
||||
if (StringUtils.isNotEmpty(data.getApprovalStatus())&&data.getApprovalStatus().equals("8")){
|
||||
//草稿数据直接保存
|
||||
this.updateById(data);
|
||||
|
||||
result.put("code",100);
|
||||
result.put("msg","草稿数据暂存成功");
|
||||
}else {
|
||||
@ -225,16 +224,14 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
data.setApprovalTime(new Date());
|
||||
//遍历 list的每条数据与data对比,如果两条数据相似度大于70% 提出预警
|
||||
for (BusiNotice busiNotice : list) {
|
||||
String tempDetail1 = data.getDetail().replaceAll("<br>","").replaceAll("\n","");
|
||||
String tempDetail2 = busiNotice.getDetail().replaceAll("<br>","").replaceAll("\n","");
|
||||
double v2 = NoticeUtils.computeJaccardSimilarity(tempDetail1, tempDetail2);
|
||||
if (v2>=0.7){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setApprovalTime(null);
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","该通告已被人抢先一步上传,等待平台审核");
|
||||
if (StringUtils.isNotEmpty(data.getThirdUrl())&&StringUtils.isNotEmpty(busiNotice.getThirdUrl())){
|
||||
if (data.getThirdUrl().equals(busiNotice.getThirdUrl())){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
result.put("code",500);
|
||||
result.put("msg","该通告已被人抢先一步上传,等待平台审核");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(data.getSimilarityIds())){
|
||||
@ -260,7 +257,7 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
busiNoticeFormService.save(noticeForm);
|
||||
}
|
||||
}
|
||||
|
||||
result.put("noticeId",data.getId());
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -329,12 +326,12 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
data.setApprovalStatus("1");
|
||||
//遍历 list的每条数据与data对比,如果两条数据相似度大于70% 提出预警
|
||||
for (BusiNotice busiNotice : list) {
|
||||
double v1 = NoticeUtils.computeJaccardSimilarity(data.getTitle(), busiNotice.getTitle());
|
||||
double v2 = NoticeUtils.computeJaccardSimilarity(data.getDetail(), busiNotice.getDetail());
|
||||
if (v1>=0.7&&v2>=0.7){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
if (StringUtils.isNotEmpty(data.getThirdUrl())&&StringUtils.isNotEmpty(busiNotice.getThirdUrl())){
|
||||
if (data.getThirdUrl().equals(busiNotice.getThirdUrl())){
|
||||
//title 和 detail 相似度大于70% 待审核
|
||||
data.setApprovalStatus("0");
|
||||
data.setSimilarityIds(Optional.ofNullable(data.getSimilarityIds()).orElse("")+busiNotice.getId()+",");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(data.getSimilarityIds())){
|
||||
@ -393,10 +390,14 @@ 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());
|
||||
LambdaQueryWrapper<BaseCity> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BaseCity::getCityId,query.getCityId()).last("limit 1");
|
||||
BaseCity city = cityService.getOne(queryWrapper);
|
||||
query.setCityName(city.getName());
|
||||
}
|
||||
IPage<BusiNoticeVo> pageList = busiNoticeMapper.queryAppListPage(query,page);
|
||||
//打乱records的排列顺序
|
||||
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查博主类型字典
|
||||
|
@ -127,7 +127,7 @@ order by dbns.create_time desc
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
RAND()
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
|
@ -117,7 +117,7 @@ public class SecurityConfig
|
||||
.antMatchers("/base/category/getByCodeInfo").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/system/config/configKey/isOpenZf","/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
.antMatchers("/cos/sts").permitAll()
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated();
|
||||
|
Loading…
Reference in New Issue
Block a user