Commit f6224073 authored by liwei's avatar liwei

修改了bug

parent 1e2e8592
...@@ -119,7 +119,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder ...@@ -119,7 +119,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
//增加操作 //增加操作
int line = 1; int line = 1;
//添加实名判断 //添加实名判断
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
//加redis锁 //加redis锁
boolean isGetLock = false; boolean isGetLock = false;
RLock lock = redissonClient.getLock(RedisCons.ACTIVITY_INFO + cmsOrder.getGoodsId()); RLock lock = redissonClient.getLock(RedisCons.ACTIVITY_INFO + cmsOrder.getGoodsId());
...@@ -132,9 +132,9 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder ...@@ -132,9 +132,9 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
if (detail!=null){ if (detail!=null){
CmsActivity info = JSON.parseObject(JSON.toJSONString(detail), CmsActivity.class); CmsActivity info = JSON.parseObject(JSON.toJSONString(detail), CmsActivity.class);
if (info.getEndTime().before(new Date())) if (info.getEndTime().before(new Date()))
throw new CyServiceException("活动已结束,不允许报名"); throw new CyServiceException("活动已结束,不允许报名!");
if (info.getStartTime().before(new Date())) if (info.getStartTime().before(new Date()))
throw new CyServiceException("活动进行中,不允许报名"); throw new CyServiceException("活动进行中,不允许报名!");
//判断人数是否强制 //判断人数是否强制
CmsOrder orderInfo = new CmsOrder(); CmsOrder orderInfo = new CmsOrder();
// if (info.getIsRestrictions().equals(0)){ // if (info.getIsRestrictions().equals(0)){
...@@ -209,7 +209,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder ...@@ -209,7 +209,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
} }
// return orderInfo; // return orderInfo;
} else } else
throw new CyServiceException("超出人数限制,报名失败"); throw new CyServiceException("超出人数限制,报名失败!");
} }
//初始化redis 活动数 //初始化redis 活动数
......
...@@ -126,6 +126,13 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> { ...@@ -126,6 +126,13 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
*/ */
MemInfo selectByOpenId(String openId); MemInfo selectByOpenId(String openId);
/**
* 根据userId查询用户信息
* @param userId
* @return
*/
MemInfo selectByUserId(String userId);
/** /**
* 关注 * 关注
*/ */
......
...@@ -600,7 +600,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -600,7 +600,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel update(MemInfo memInfo){ public CyPersistModel update(MemInfo memInfo){
MemInfo info = baseMapper.selectByOpenId(memInfo.getWxOpenid()); String userId = CyUserUtil.getAuthenBusinessId();
MemInfo info = baseMapper.selectByUserId(userId);
//手机号、身份证存储加密 //手机号、身份证存储加密
if (StringUtils.isNotBlank(memInfo.getMemPhone())) if (StringUtils.isNotBlank(memInfo.getMemPhone()))
memInfo.setMemPhone(CyAESUtils.encrypt(memInfo.getMemPhone())); memInfo.setMemPhone(CyAESUtils.encrypt(memInfo.getMemPhone()));
...@@ -671,7 +672,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -671,7 +672,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
//获取当前登录用户id //获取当前登录用户id
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
//添加实名判断 //添加实名判断
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
//获取当前日期 例2025/2/20 获取02和20 用来存redis //获取当前日期 例2025/2/20 获取02和20 用来存redis
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MM"); DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MM");
...@@ -716,7 +717,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -716,7 +717,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
Integer payCount = Integer.valueOf(dictData4.getDictValue()); Integer payCount = Integer.valueOf(dictData4.getDictValue());
MemInfo memInfo = memInfoRepository.selectByOpenId(likeDTO.getWxOpenid()); MemInfo memInfo = memInfoRepository.selectByOpenId(likeDTO.getWxOpenid());
if (memInfo.getGoldCoinsCount() - payCount < 0){ if (memInfo.getGoldCoinsCount() - payCount < 0){
throw new CyServiceException(1003,"金币余额不足,请先充值"); throw new CyServiceException(1003,"金币不足,请先充值");
} }
memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount); memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount);
memInfoRepository.updateById(memInfo); memInfoRepository.updateById(memInfo);
...@@ -824,11 +825,11 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -824,11 +825,11 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
Integer targetId = memUserTaskDTO.getTargetId(); Integer targetId = memUserTaskDTO.getTargetId();
MemInfo targetInfo = memInfoRepository.getUserInfo(String.valueOf(targetId)); MemInfo targetInfo = memInfoRepository.getUserInfo(String.valueOf(targetId));
MemInfo memInfo = memInfoRepository.selectByOpenId(memUserTaskDTO.getWxOpenid()); MemInfo memInfo = memInfoRepository.selectByOpenId(memUserTaskDTO.getWxOpenid());
if (StringUtils.isEmpty(targetInfo.getMemWxCode())){
throw new CyServiceException(1005,"对方还未填写微信号,不能交换");
}
if (StringUtils.isEmpty(memInfo.getMemWxCode())){ if (StringUtils.isEmpty(memInfo.getMemWxCode())){
throw new CyServiceException(1006,"还未完善个人微信号,不能交换"); throw new CyServiceException(1006,"还未完善个人微信号,不能交换!");
}
if (StringUtils.isEmpty(targetInfo.getMemWxCode())){
throw new CyServiceException(1005,"对方还未填写微信号,不能交换!");
} }
Integer createBy = Integer.valueOf(CyUserUtil.getAuthenBusinessId()); Integer createBy = Integer.valueOf(CyUserUtil.getAuthenBusinessId());
memUserTaskDTO.setCreateBy(createBy); memUserTaskDTO.setCreateBy(createBy);
...@@ -851,7 +852,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -851,7 +852,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if (isGetLock) { if (isGetLock) {
//查询用户信息 //查询用户信息
if (memInfo.getGoldCoinsCount() - acceptGoldCoinCount < 0){ if (memInfo.getGoldCoinsCount() - acceptGoldCoinCount < 0){
throw new CyServiceException(1003,"金币余额不足,请先充值"); throw new CyServiceException(1003,"金币不足,请先充值!");
} }
//添加索要微信任务 //添加索要微信任务
memUserTaskDTO.setStatus("0"); memUserTaskDTO.setStatus("0");
...@@ -862,7 +863,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -862,7 +863,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memGoldCoinFlow.setCount(acceptGoldCoinCount); memGoldCoinFlow.setCount(acceptGoldCoinCount);
memGoldCoinFlow.setEndCount(memInfo.getGoldCoinsCount() - acceptGoldCoinCount); memGoldCoinFlow.setEndCount(memInfo.getGoldCoinsCount() - acceptGoldCoinCount);
memGoldCoinFlow.setType("2"); memGoldCoinFlow.setType("2");
memGoldCoinFlow.setActionType("24"); memGoldCoinFlow.setActionType("23");
memGoldCoinFlowRepository.insert(memGoldCoinFlow); memGoldCoinFlowRepository.insert(memGoldCoinFlow);
//修改用户金币数量 //修改用户金币数量
memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - acceptGoldCoinCount); memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - acceptGoldCoinCount);
...@@ -893,7 +894,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -893,7 +894,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if (isGetLock) { if (isGetLock) {
//查询用户信息 //查询用户信息
if (memInfo.getGoldCoinsCount() - requestGoldCoinCount < 0){ if (memInfo.getGoldCoinsCount() - requestGoldCoinCount < 0){
throw new CyServiceException(1003,"金币余额不足,请先充值"); throw new CyServiceException(1003,"金币不足,请先充值!");
} }
//修改微信任务 //修改微信任务
line = baseMapper.updateWeChatTask(memUserTaskDTO); line = baseMapper.updateWeChatTask(memUserTaskDTO);
...@@ -903,7 +904,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -903,7 +904,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memGoldCoinFlow.setCount(requestGoldCoinCount); memGoldCoinFlow.setCount(requestGoldCoinCount);
memGoldCoinFlow.setEndCount(memInfo.getGoldCoinsCount() - requestGoldCoinCount); memGoldCoinFlow.setEndCount(memInfo.getGoldCoinsCount() - requestGoldCoinCount);
memGoldCoinFlow.setType("2"); memGoldCoinFlow.setType("2");
memGoldCoinFlow.setActionType("23"); memGoldCoinFlow.setActionType("24");
memGoldCoinFlowRepository.insert(memGoldCoinFlow); memGoldCoinFlowRepository.insert(memGoldCoinFlow);
//修改用户金币数量 //修改用户金币数量
memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - requestGoldCoinCount); memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - requestGoldCoinCount);
......
...@@ -87,7 +87,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -87,7 +87,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
public CyPersistModel leaveMessage(MemLeaveMessage memLeaveMessage) { public CyPersistModel leaveMessage(MemLeaveMessage memLeaveMessage) {
//添加实名判断 //添加实名判断
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
//获取当前日期 例2025/2/20 获取02和20 //获取当前日期 例2025/2/20 获取02和20
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MM"); DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MM");
...@@ -132,7 +132,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -132,7 +132,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
Integer payCount = Integer.valueOf(dictData4.getDictValue()); Integer payCount = Integer.valueOf(dictData4.getDictValue());
MemInfo memInfo = memInfoRepository.selectByOpenId(memLeaveMessage.getWxOpenid()); MemInfo memInfo = memInfoRepository.selectByOpenId(memLeaveMessage.getWxOpenid());
if (memInfo.getGoldCoinsCount() - payCount < 0){ if (memInfo.getGoldCoinsCount() - payCount < 0){
throw new CyServiceException(1003,"金币余额不足,请先充值"); throw new CyServiceException(1003,"金币不足,请先充值!");
} }
memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount); memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount);
memInfoRepository.updateById(memInfo); memInfoRepository.updateById(memInfo);
...@@ -155,7 +155,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -155,7 +155,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
} }
} else { } else {
//不进行留言 //不进行留言
throw new CyServiceException(1001,"今日对该用户留言次数已达上限,请明日再试!"); throw new CyServiceException(1001,"今日留言次数已达上限,请明日再试!");
} }
} }
//先插入到留言表 //先插入到留言表
...@@ -233,7 +233,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -233,7 +233,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
} }
return new CyPersistModel(line); return new CyPersistModel(line);
} else { } else {
throw new CyServiceException(1001,"今日对该用户留言次数已达上限,请明日再试!"); throw new CyServiceException(1001,"今日留言次数已达上限,请明日再试!");
} }
} else if (redisLeaveMessageCountAll == null){ } else if (redisLeaveMessageCountAll == null){
//当天第一次进行留言 //当天第一次进行留言
...@@ -273,7 +273,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -273,7 +273,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
return new CyPersistModel(line1); return new CyPersistModel(line1);
} else { } else {
//超出总次数限制 //超出总次数限制
throw new CyServiceException(1002,"今日留言次数已达上限,请明日再试"); throw new CyServiceException(1002,"今日留言次数已达上限,请明日再试!");
} }
} }
......
...@@ -24,4 +24,8 @@ public class ArticleCommentDTO { ...@@ -24,4 +24,8 @@ public class ArticleCommentDTO {
private Integer createBy; private Integer createBy;
//修改人 //修改人
private Integer updateBy; private Integer updateBy;
//审核状态 0未审核,1审核通过,2驳回,3自动驳回
private String examStatus;
//备注
private String remarks;
} }
...@@ -89,7 +89,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -89,7 +89,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public CyPersistModel persist(OpmArticle opmArticle){ public CyPersistModel persist(OpmArticle opmArticle){
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
//1、实名判断 //1、实名判断
userUtil.checkUserAuth("请先进行实名认证"); userUtil.checkUserAuth("请先实名认证!");
//2、判断今日发布动态的数量限制 //2、判断今日发布动态的数量限制
//获取当天时间 例2025/2/20 后获取0220 //获取当天时间 例2025/2/20 后获取0220
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
...@@ -110,7 +110,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -110,7 +110,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
Object redisCount = cyRedisServiceImpl.get(OpmArticleRedisBean.USER_ARTICLE_COUNT + date + ":" + userId); Object redisCount = cyRedisServiceImpl.get(OpmArticleRedisBean.USER_ARTICLE_COUNT + date + ":" + userId);
if (redisCount != null && (int)redisCount >= publishCountAll){ if (redisCount != null && (int)redisCount >= publishCountAll){
//超出最大数量 //超出最大数量
throw new CyServiceException(1001,"今日发布动态总次数已达上限"); throw new CyServiceException(1001,"今日发布动态次数已达上限!");
} else if (redisCount == null){ } else if (redisCount == null){
//当天第一次发布动态 //当天第一次发布动态
cyRedisServiceImpl.set(OpmArticleRedisBean.USER_ARTICLE_COUNT + date + ":" + userId,1,48*60*60L); cyRedisServiceImpl.set(OpmArticleRedisBean.USER_ARTICLE_COUNT + date + ":" + userId,1,48*60*60L);
...@@ -130,7 +130,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -130,7 +130,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
if (isGetLock) { if (isGetLock) {
MemInfo memInfo = memInfoRepository.selectByOpenId(opmArticle.getWxOpenid()); MemInfo memInfo = memInfoRepository.selectByOpenId(opmArticle.getWxOpenid());
if (memInfo.getGoldCoinsCount() - payCount < 0){ if (memInfo.getGoldCoinsCount() - payCount < 0){
throw new CyServiceException(1003,"金币余额不足,请先充值"); throw new CyServiceException(1003,"金币不足,请先充值!");
} }
memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount); memInfo.setGoldCoinsCount(memInfo.getGoldCoinsCount() - payCount);
memInfoRepository.updateById(memInfo); memInfoRepository.updateById(memInfo);
...@@ -154,7 +154,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -154,7 +154,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
} }
} else { } else {
//不进行发表动态 //不进行发表动态
throw new CyServiceException(1002,"今日发表动态免费次数超出限制"); throw new CyServiceException(1002,"今日发表动态次数已达上限!");
} }
} else { } else {
//没超过免费次数限制 //没超过免费次数限制
...@@ -426,7 +426,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -426,7 +426,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public CyPersistModel likeAdd(Integer articleId,String praiseType){ public CyPersistModel likeAdd(Integer articleId,String praiseType){
//添加实名判断 //添加实名判断
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
int line = 0; int line = 0;
if (praiseType.equals("praise")){ if (praiseType.equals("praise")){
//点赞 //点赞
...@@ -460,7 +460,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -460,7 +460,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public CyPersistModel likeCommentAdd(Integer commentId,String praiseType){ public CyPersistModel likeCommentAdd(Integer commentId,String praiseType){
//添加实名判断 //添加实名判断
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
int line = 0; int line = 0;
if (praiseType.equals("praise")){ if (praiseType.equals("praise")){
//点赞 //点赞
...@@ -490,10 +490,10 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -490,10 +490,10 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
*/ */
@Override @Override
public CyPersistModel addComment(ArticleCommentDTO dto) { public CyPersistModel addComment(ArticleCommentDTO dto) {
//添加实名判断 //1、实名判断
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
userUtil.checkUserAuth("请先进行实名认证!"); userUtil.checkUserAuth("请先实名认证!");
//校验 超过规定的时间不能评论 计算天数对应的秒数 //2、校验 超过规定的时间不能评论 计算天数对应的秒数
List<DictData> articleConfig = dictionaryService.selectByTypes("article_config"); List<DictData> articleConfig = dictionaryService.selectByTypes("article_config");
DictData dictData = articleConfig.stream().filter(item -> item.getDictLabel().equals("comment_limit_days")).findFirst().orElse(null); DictData dictData = articleConfig.stream().filter(item -> item.getDictLabel().equals("comment_limit_days")).findFirst().orElse(null);
Integer limitDays = Integer.valueOf(dictData.getDictValue()); Integer limitDays = Integer.valueOf(dictData.getDictValue());
...@@ -516,8 +516,27 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm ...@@ -516,8 +516,27 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
//3、进行审核 从redis获取动态审核配置 0:自动审核,1:人工审核
//校验通过 进行插入评论数据 List<DictData> sysConfig = dictionaryService.selectByTypes("sys_config");
String style = sysConfig.get(0).getDictValue();
if ("0".equals(style)) {
//调用百度,自动审核
boolean flag = true;
List<String> msg = new ArrayList<>();
if (StringUtils.isNotBlank(dto.getCommentContent())) {
CensorResult result = contentCensorService.getCommonTextCensorResult(dto.getCommentContent());
flag = result.getIsPass();
if (!flag)
msg.addAll(result.getErrorMsg());
}
if (flag)
dto.setExamStatus("1");
else {
dto.setExamStatus("3");
dto.setRemarks(msg.toString());
}
}
//4、校验通过 进行插入评论数据
dto.setCommentedUserId(Integer.valueOf(CyUserUtil.getAuthenBusinessId())); dto.setCommentedUserId(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
dto.setUpdateDate(new Date()); dto.setUpdateDate(new Date());
......
...@@ -576,6 +576,10 @@ ...@@ -576,6 +576,10 @@
parameterType="java.lang.String"> parameterType="java.lang.String">
select * from mem_info where wx_openid = #{openId} and del_flag = 0 select * from mem_info where wx_openid = #{openId} and del_flag = 0
</select> </select>
<select id="selectByUserId" resultType="org.rcisoft.business.memInfo.entity.MemInfo"
parameterType="java.lang.String">
select * from mem_info where user_id = #{userId} and del_flag = 0
</select>
<select id="getIsFollow" resultType="org.rcisoft.business.memInfo.entity.MemFollowDTO" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO"> <select id="getIsFollow" resultType="org.rcisoft.business.memInfo.entity.MemFollowDTO" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO">
SELECT SELECT
COALESCE( COALESCE(
......
...@@ -381,18 +381,21 @@ ...@@ -381,18 +381,21 @@
mi.mem_code as memCode, mi.mem_code as memCode,
mi.mem_nick_name as memNickName, mi.mem_nick_name as memNickName,
mi.avatar as avatarId, mi.avatar as avatarId,
oi.url as avatarUrl,
CASE CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0 WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike END AS isLike
FROM opm_article_comment opc FROM opm_article_comment opc
LEFT JOIN mem_info mi ON mi.user_id = opc.create_by LEFT JOIN mem_info mi ON mi.user_id = opc.create_by
left join oss_info oi on oi.business_id = mi.avatar LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId}
LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId}
WHERE 1 = 1 WHERE 1 = 1
AND opc.del_flag = '0' AND opc.del_flag = '0'
AND opc.parent_id is null AND opc.parent_id is null
AND opc.article_id = #{articleId} AND opc.article_id = 6
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
OR (obl.user_id = opc.user_id AND obl.target_id = #{loginUserId})
)
</select> </select>
<select id="selectArticleChildrenComment" resultType="org.rcisoft.business.opmArticle.entity.ArticleCommentVO"> <select id="selectArticleChildrenComment" resultType="org.rcisoft.business.opmArticle.entity.ArticleCommentVO">
SELECT SELECT
...@@ -409,19 +412,22 @@ ...@@ -409,19 +412,22 @@
mi2.mem_code as commentedMemCode, mi2.mem_code as commentedMemCode,
mi2.mem_nick_name as commentedMemNickName, mi2.mem_nick_name as commentedMemNickName,
mi.avatar as avatarId, mi.avatar as avatarId,
oi.url as avatarUrl,
CASE CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0 WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike END AS isLike
FROM opm_article_comment opc FROM opm_article_comment opc
LEFT JOIN mem_info mi ON mi.user_id = opc.create_by LEFT JOIN mem_info mi ON mi.user_id = opc.create_by
LEFT JOIN oss_info oi on oi.business_id = mi.avatar
LEFT JOIN mem_info mi2 ON mi2.user_id = opc.user_id LEFT JOIN mem_info mi2 ON mi2.user_id = opc.user_id
LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId} LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId}
WHERE 1 = 1 WHERE 1 = 1
AND opc.del_flag = '0' AND opc.del_flag = '0'
AND opc.article_id = #{articleId} AND opc.article_id = #{articleId}
and opc.parent_id = #{parentId} and opc.parent_id = #{parentId}
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
OR (obl.user_id = opc.user_id AND obl.target_id = #{loginUserId})
)
</select> </select>
<delete id="deleteComment"> <delete id="deleteComment">
update opm_article_comment set del_flag = '1' where business_id = #{businessId} update opm_article_comment set del_flag = '1' where business_id = #{businessId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment