朋友圈详情相关接口提交;

1 parent 0d3d3535
package com.linkwechat.web.controller.wecom;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.constants.SynchRecordConstants;
import com.linkwechat.wecom.domain.WeMessagePush;
import com.linkwechat.wecom.domain.WeMoments;
import com.linkwechat.wecom.service.IWeMomentsService;
import com.linkwechat.wecom.service.IWeSynchRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -52,6 +48,20 @@ public class WeMomentsController extends BaseController {
/**
* 获取朋友圈详情
* @param momentId
* @return
*/
@GetMapping("/findMomentsDetail/{momentId}")
public AjaxResult findMomentsDetail(@PathVariable String momentId){
return AjaxResult.success(
iWeMomentsService.findMomentsDetail(momentId)
);
}
/**
* 新增或者编辑朋友圈
* @return
*/
......
......@@ -18,7 +18,7 @@ import java.util.List;
* 朋友圈
*/
@Data
@TableName("we_moments")
@TableName(value ="we_moments",autoResultMap = true)
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -79,6 +79,23 @@ public class WeMoments extends BaseEntity {
private Integer pointNum;
//评论员工名
@TableField(exist = false)
private String momentUserName;
//点赞员工名
@TableField(exist = false)
private String pointUserName;
//评论客户名
@TableField(exist = false)
private String momentCustomerName;
//点赞客户名
@TableField(exist = false)
private String pointCustomerName;
@Data
......
......@@ -9,4 +9,6 @@ import java.util.List;
public interface WeMomentsMapper extends BaseMapper<WeMoments> {
List<WeMoments> findMoments(WeMoments weMoments);
WeMoments findMomentsDetail(@Param("momentId") String momentId);
}
......@@ -3,6 +3,7 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeMoments;
import com.linkwechat.wecom.mapper.WeMomentsMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -15,4 +16,6 @@ public interface IWeMomentsService extends IService<WeMoments> {
void synchPersonMoments(Integer filterType);
void synchEnterpriseMoments(Integer filterType);
WeMoments findMomentsDetail(String momentId);
}
......@@ -267,10 +267,20 @@ public class WeMomentsServiceImpl extends ServiceImpl<WeMomentsMapper, WeMoments
/**
* 同步朋友圈
* 朋友圈详情
* @param momentId
* @return
*/
@Override
public WeMoments findMomentsDetail(String momentId) {
return this.baseMapper.findMomentsDetail(momentId);
}
/**
* 同步朋友圈
*/
private void synchMoments(Integer filterType) {
List<MomentsListDetailResultDto.Moment> moments=new ArrayList<>();
......
......@@ -34,4 +34,42 @@
</select>
<resultMap id="MomentsDetailMapper" type="com.linkwechat.wecom.domain.WeMoments">
<result column="content" property="content"></result>
<result column="other_content" property="otherContent" typeHandler="com.linkwechat.wecom.handler.GenericTypeHandler"></result>
<result column="noAddUserName" property="noAddUserName"></result>
<result column="addUserName" property="addUserName"></result>
<result column="momentUserName" property="momentUserName"></result>
<result column="pointUserName" property="pointUserName"></result>
<result column="momentCustomerName" property="momentCustomerName"></result>
<result column="pointCustomerName" property="pointCustomerName"></result>
</resultMap>
<select id="findMomentsDetail" resultMap="MomentsDetailMapper">
SELECT
wm.content,
wm.other_content,
(SELECT GROUP_CONCAT(wu.user_name) FROM we_user wu WHERE FIND_IN_SET(wu.user_id,wm.no_add_user)) as noAddUserName,
(SELECT GROUP_CONCAT(wu.user_name) FROM we_user wu WHERE FIND_IN_SET(wu.user_id,wm.add_user)) as addUserName,
(SELECT GROUP_CONCAT(wu.user_name) FROM we_user wu
LEFT JOIN we_moments_interacte wmi ON wu.user_id=wmi.interacte_user_id WHERE wmi.interacte_type=0 and wmi.interacte_user_type=0
and wmi.moment_id=wm.moment_id
) as momentUserName,
(SELECT GROUP_CONCAT(wu.user_name) FROM we_user wu
LEFT JOIN we_moments_interacte wmi ON wu.user_id=wmi.interacte_user_id WHERE wmi.interacte_type=1 and wmi.interacte_user_type=0
and wmi.moment_id=wm.moment_id
) as pointUserName,
(SELECT GROUP_CONCAT(DISTINCT wu.`name`) FROM we_customer wu
LEFT JOIN we_moments_interacte wmi ON wu.external_userid=wmi.interacte_user_id WHERE wmi.interacte_type=0 and wmi.interacte_user_type=1
and wmi.moment_id=wm.moment_id
) as momentCustomerName,
(SELECT GROUP_CONCAT(DISTINCT wu.`name`) FROM we_customer wu
LEFT JOIN we_moments_interacte wmi ON wu.external_userid=wmi.interacte_user_id WHERE wmi.interacte_type=1 and wmi.interacte_user_type=1
and wmi.moment_id=wm.moment_id
) as pointCustomerName
FROM
we_moments wm
where wm.moment_id=#{momentId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!