bug修复
This commit is contained in:
parent
b377c3b650
commit
4237b1b721
@ -124,8 +124,7 @@ public class BusiNoticeController extends BaseController
|
||||
*/
|
||||
@Log(title = "通告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BusiNotice busiNotice)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody BusiNotice busiNotice) throws Exception {
|
||||
busiNoticeService.updateByIdVo(busiNotice);
|
||||
return success();
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public class BusiNotice extends DlBaseEntity
|
||||
/**
|
||||
* 是否急招0否1是
|
||||
*/
|
||||
@Excel(name = "是否急招", readConverterExp = "0=,否=|1是")
|
||||
private String isUrgent;
|
||||
//是否平台结算
|
||||
private Integer isPlatformFree;
|
||||
@ -162,6 +163,7 @@ public class BusiNotice extends DlBaseEntity
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date approvalTime;
|
||||
@Excel(name = "三方链接")
|
||||
//三方链接
|
||||
private String thirdUrl;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public interface IBusiNoticeService extends IService<BusiNotice>
|
||||
* 更新
|
||||
* @param data 保存参数
|
||||
*/
|
||||
JSONObject updateByIdVo(BusiNotice data);
|
||||
JSONObject updateByIdVo(BusiNotice data) throws Exception;
|
||||
JSONObject saveOrUpdateVo(BusiNotice data) throws Exception;
|
||||
void removeByIdsVo(List<String> ids);
|
||||
|
||||
|
@ -164,15 +164,16 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
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);
|
||||
}
|
||||
}
|
||||
//若是急招扣除对应急招券
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
//保存表单数据
|
||||
if (CollectionUtil.isNotEmpty(data.getCustomForm())){
|
||||
@ -196,13 +197,19 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject updateByIdVo(BusiNotice data) {
|
||||
|
||||
@Transactional
|
||||
public JSONObject updateByIdVo(BusiNotice data) throws Exception {
|
||||
BusiNotice oldData = this.getById(data.getId());
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("code",0);
|
||||
result.put("msg","自动审核通过,发布成功");
|
||||
//获取当前登录用户
|
||||
data.setUserId(SecurityUtils.getUserId());
|
||||
if (StringUtils.isNotEmpty(data.getApprovalStatus())&&data.getApprovalStatus().equals("8")){
|
||||
//草稿数据直接保存
|
||||
this.updateById(data);
|
||||
result.put("code",100);
|
||||
result.put("msg","草稿数据暂存成功");
|
||||
}else {
|
||||
//判断 内容重复度 是否大于70%
|
||||
//先获取 当前系统中截止日期之前的
|
||||
@ -216,18 +223,26 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
data.setApprovalTime(new Date());
|
||||
//遍历 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){
|
||||
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.getSimilarityIds())){
|
||||
//删除结尾的最后一个逗号
|
||||
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);
|
||||
}
|
||||
//先删除表单数据
|
||||
@ -243,7 +258,8 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
busiNoticeFormService.save(noticeForm);
|
||||
}
|
||||
}
|
||||
return new JSONObject();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -450,7 +466,7 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
detail.setCustomForm(customForm.stream().map(BusiNoticeForm::getLabelTitle).collect(Collectors.toList()));
|
||||
//获取城市id
|
||||
LambdaQueryWrapper<BaseCity> queryWrapperCity = new LambdaQueryWrapper<>();
|
||||
queryWrapperCity.eq(BaseCity::getName,detail.getCity());
|
||||
queryWrapperCity.eq(BaseCity::getName,detail.getCity()).ne(BaseCity::getParentId,"0");
|
||||
List<BaseCity> list = cityService.list(queryWrapperCity);
|
||||
for (BaseCity baseCity : list) {
|
||||
queryWrapperCity = new LambdaQueryWrapper<>();
|
||||
|
@ -18,6 +18,7 @@ import com.ruoyi.member.service.IMemberCardService;
|
||||
import com.ruoyi.member.service.IMemberUserService;
|
||||
import com.ruoyi.member.vo.MemberUserVO;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -70,7 +71,7 @@ public class BusiNoticeSignServiceImpl extends ServiceImpl<BusiNoticeSignMapper,
|
||||
|
||||
LambdaQueryWrapper<BusiNoticeSign> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusiNoticeSign::getNoticeId, appNoticeSign.getNoticeId());
|
||||
if(busiNoticeSignMapper.selectCount(queryWrapper)>=busiNotice.getNeedNum()){
|
||||
if(null!=busiNotice.getNeedNum()&&busiNoticeSignMapper.selectCount(queryWrapper)>=busiNotice.getNeedNum()){
|
||||
throw new Exception("报名人数已满!");
|
||||
}
|
||||
SysUser sysUser = userService.selectUserById(loginUser.getUserId());
|
||||
|
@ -164,7 +164,7 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper, MemberU
|
||||
//赠送的报名次数
|
||||
MemberUserVO memberUserVO = memberUserMapper.queryByUserId(userId, "02");
|
||||
|
||||
result.setReport(report+memberUserVO.getReport());
|
||||
result.setReport(report+Integer.parseInt(memberUserVO.getSendReportNum().toString()));
|
||||
} else {
|
||||
//通告券
|
||||
result.setCoupon(couponService.getCoupon(userId));
|
||||
|
@ -98,11 +98,13 @@
|
||||
main.trecipient_name AS trecipientName,
|
||||
main.trecipient_image AS trecipientImage,
|
||||
main.bpoints AS bpoints,
|
||||
main.send_report_num as sendReportNum,
|
||||
su.nick_name AS nickName,
|
||||
su.status AS status,
|
||||
su.avatar AS avatar,
|
||||
su.user_name AS userName,
|
||||
su.phonenumber AS phonenumber,
|
||||
|
||||
GROUP_CONCAT(mc.card_name SEPARATOR ', ') AS memberCardName
|
||||
from dl_member_user main
|
||||
LEFT JOIN sys_user su ON main.user_id = su.user_id AND su.del_flag = 0
|
||||
@ -121,4 +123,4 @@
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user