Commit 0b1e66d7 by yao.xiao

增加-客户文章跟踪/文章阅读数量

parent 38175b57
......@@ -45,6 +45,7 @@ public class AgmsPractitionerServiceImpl implements AgmsPractitionerService {
mdDropOptionIds=(Long[]) ConvertUtils.convert(requestVO.getMdDropOptionId().split(","),Long.class);
}
PageInfo<PractitionerFileSharing> practitionerFileShares = agmsPractitionerDALService.practitionerFileSharingList(requestVO.getId(),
requestVO.getPractitionerId(),
requestVO.getShareCode(),
mdDropOptionIds,
requestVO.getIsActive(),
......
......@@ -64,6 +64,10 @@ public class PractitionerFileSharing {
*/
private String coverUrl;
private Long totalNum;
private Long num;
/**
* 获取 serial id
......@@ -317,11 +321,27 @@ public class PractitionerFileSharing {
this.coverUrl = coverUrl;
}
public Long getTotalNum() {
return totalNum;
}
public void setTotalNum(Long totalNum) {
this.totalNum = totalNum;
}
public Long getNum() {
return num;
}
public void setNum(Long num) {
this.num = num;
}
@Override
public String toString() {
return "PractitionerFileSharing{" +
"id=" + id +
", mdDropOptionId=" + mdDropOptionId +
", mdDropOptionId='" + mdDropOptionId + '\'' +
", fileContent='" + fileContent + '\'' +
", isActive=" + isActive +
", createdAt='" + createdAt + '\'' +
......@@ -334,6 +354,8 @@ public class PractitionerFileSharing {
", digest='" + digest + '\'' +
", author='" + author + '\'' +
", coverUrl='" + coverUrl + '\'' +
", totalNum=" + totalNum +
", num=" + num +
'}';
}
}
......@@ -15,6 +15,8 @@ public class PractitionerFileSharingListRequestVO {
private Integer isActive;
private Long practitionerId;
private PageInfo<PractitionerFileSharing> practitionerFileShares;
/**
......@@ -87,6 +89,14 @@ public class PractitionerFileSharingListRequestVO {
this.shareCode = shareCode;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
@Override
public String toString() {
return "PractitionerFileSharingListRequestVO{" +
......@@ -94,6 +104,7 @@ public class PractitionerFileSharingListRequestVO {
", shareCode='" + shareCode + '\'' +
", mdDropOptionId='" + mdDropOptionId + '\'' +
", isActive=" + isActive +
", practitionerId=" + practitionerId +
", practitionerFileShares=" + practitionerFileShares +
'}';
}
......
......@@ -4,12 +4,12 @@ import com.yd.api.practitioner.service.PractitionerArticleService;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
import com.yd.api.result.JsonResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -19,6 +19,9 @@ public class PractitionerArticleController {
@Autowired
private PractitionerArticleService practitionerArticleService;
/**
* 分享文章保存
*/
@RequestMapping("/articleShareCodeSave")
public Object articleShareCodeSave(@RequestBody ArticleShareCodeSaveRequestVO requestVO){
JsonResult result = new JsonResult();
......@@ -28,6 +31,9 @@ public class PractitionerArticleController {
return result;
}
/**
* 客户文章跟踪信息保存
*/
@RequestMapping("/articleTrackSave")
public Object articleTrackSave(@RequestBody ArticleTrackSaveRequestVO requestVO){
JsonResult result = new JsonResult();
......@@ -36,4 +42,17 @@ public class PractitionerArticleController {
result.setData(responseVO);
return result;
}
/**
* 客户文章跟踪信息查询
*/
@RequestMapping(value = "/articleTrackQuery",method = RequestMethod.GET)
public Object articleTrackQuery(@RequestParam("practitionerId") Long practitionerId,
@RequestParam("sharingId") Long sharingId ){
JsonResult result = new JsonResult();
ArticleTrackQueryResponseVO responseVO = practitionerArticleService.articleTrackQuery(practitionerId,sharingId);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
......@@ -3,10 +3,13 @@ package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
public interface PractitionerArticleService {
ArticleShareCodeSaveResponseVO articleShareCodeSave(ArticleShareCodeSaveRequestVO requestVO);
ArticleTrackSaveResponseVO articleTrackSave(ArticleTrackSaveRequestVO requestVO);
ArticleTrackQueryResponseVO articleTrackQuery(Long practitionerId,Long sharingId);
}
......@@ -4,12 +4,15 @@ import com.yd.api.practitioner.service.PractitionerArticleService;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AclCustomerObjectShare;
import com.yd.dal.entity.customer.AclCustomerObjectShareTrack;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import com.yd.dal.service.customer.AclCustomerObjectShareDALService;
import com.yd.dal.service.customer.AclCustomerObjectShareTrackDALService;
import com.yd.dal.service.practitioner.PractitionerArticleDALService;
import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig;
import org.springframework.beans.BeanUtils;
......@@ -17,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("practitionerArticleService")
public class PractitionerArticleServiceImpl implements PractitionerArticleService {
......@@ -24,7 +28,8 @@ public class PractitionerArticleServiceImpl implements PractitionerArticleServic
private AclCustomerObjectShareDALService aclCustomerObjectShareDALService;
@Autowired
private AclCustomerObjectShareTrackDALService aclCustomerObjectShareTrackDALService;
@Autowired
private PractitionerArticleDALService practitionerArticleDALService;
@Override
public ArticleShareCodeSaveResponseVO articleShareCodeSave(ArticleShareCodeSaveRequestVO requestVO) {
ArticleShareCodeSaveResponseVO responseVO = new ArticleShareCodeSaveResponseVO();
......@@ -61,4 +66,14 @@ public class PractitionerArticleServiceImpl implements PractitionerArticleServic
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
@Override
public ArticleTrackQueryResponseVO articleTrackQuery(Long practitionerId,Long sharingId) {
ArticleTrackQueryResponseVO responseVO = new ArticleTrackQueryResponseVO();
//通过经纪人id和文章id查询 客户跟踪信息
List<ArticleTrackQueryInfo> articleTrackQueryInfos = practitionerArticleDALService.articleTrackQuery(practitionerId,sharingId);
responseVO.setArticleTrackQueryInfos(articleTrackQueryInfos);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
}
package com.yd.api.practitioner.vo.article;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import java.util.List;
public class ArticleTrackQueryResponseVO {
private List<ArticleTrackQueryInfo> articleTrackQueryInfos;
private CommonResult commonResult;
public List<ArticleTrackQueryInfo> getArticleTrackQueryInfos() {
return articleTrackQueryInfos;
}
public void setArticleTrackQueryInfos(List<ArticleTrackQueryInfo> articleTrackQueryInfos) {
this.articleTrackQueryInfos = articleTrackQueryInfos;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.dal.entity.practitioner.article;
public class ArticleTrackQueryInfo {
private String imagePath;
private String nickName;
private String trackInTime;
private Long gender;
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getTrackInTime() {
return trackInTime;
}
public void setTrackInTime(String trackInTime) {
this.trackInTime = trackInTime;
}
public Long getGender() {
return gender;
}
public void setGender(Long gender) {
this.gender = gender;
}
}
......@@ -15,7 +15,11 @@ public interface AgmsPractitionerMapper {
* @param isActive 是否启用
* @return
*/
Page<PractitionerFileSharing> practitionerFileSharingList(@Param("id")Long id,@Param("shareCode") String shareCode,@Param("mdDropOptionIds") Long[] mdDropOptionIds ,@Param("isActive") Integer isActive);
Page<PractitionerFileSharing> practitionerFileSharingList(@Param("id")Long id,
@Param("practitionerId") Long practitionerId,
@Param("shareCode") String shareCode,
@Param("mdDropOptionIds") Long[] mdDropOptionIds ,
@Param("isActive") Integer isActive);
SharePractitionerInfo findSharePractitioner(String shareCode);
}
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PractitionerArticleMapper {
List<ArticleTrackQueryInfo> articleTrackQuery(@Param("practitionerId") Long practitionerId,@Param("sharingId") Long sharingId);
}
......@@ -16,7 +16,7 @@ public interface AgmsPractitionerDALService {
* @param size 每页的数量
* @return 查询结果
*/
PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,String shareCode,Long[] mdDropOptionId, Integer isActive, int pageNum, int size);
PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,Long practitionerId,String shareCode,Long[] mdDropOptionId, Integer isActive, int pageNum, int size);
SharePractitionerInfo findSharePractitioner(String shareCode);
}
......@@ -20,11 +20,10 @@ public class AgmsPractitionerDALServiceImpl implements AgmsPractitionerDALServic
@Autowired
private AgmsPractitionerMapper mapper;
@Override
public PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,String shareCode,Long[] mdDropOptionIds, Integer isActive, int pageNum, int size) {
public PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,Long practitionerId ,String shareCode,Long[] mdDropOptionIds, Integer isActive, int pageNum, int size) {
PageHelper.startPage(pageNum, size);
Page<PractitionerFileSharing> practitionerFileShares = mapper.practitionerFileSharingList(id,shareCode,mdDropOptionIds,isActive);
PageInfo<PractitionerFileSharing> pageInfo = new PageInfo<>(practitionerFileShares);
return pageInfo;
Page<PractitionerFileSharing> practitionerFileShares = mapper.practitionerFileSharingList(id,practitionerId,shareCode,mdDropOptionIds,isActive);
return new PageInfo<>(practitionerFileShares);
}
@Override
......
package com.yd.dal.service.practitioner;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import java.util.List;
public interface PractitionerArticleDALService {
List<ArticleTrackQueryInfo> articleTrackQuery(Long practitionerId, Long sharingId);
}
package com.yd.dal.service.practitioner.impl;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import com.yd.dal.mapper.practitioner.PractitionerArticleMapper;
import com.yd.dal.service.practitioner.PractitionerArticleDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("practitionerArticleDALService")
public class PractitionerArticleDALServiceImpl implements PractitionerArticleDALService {
@Resource
private PractitionerArticleMapper mapper;
@Override
public List<ArticleTrackQueryInfo> articleTrackQuery(Long practitionerId, Long sharingId) {
return mapper.articleTrackQuery(practitionerId,sharingId);
}
}
......@@ -3,7 +3,7 @@
<mapper namespace="com.yd.dal.mapper.agms.AgmsPractitionerMapper">
<select id="practitionerFileSharingList" resultType="com.yd.api.agms.vo.practitioner.PractitionerFileSharing">
select s.id id,
SELECT s.id id,
s.md_drop_option_id mdDropOptionId,
s.file_content fileContent,
s.is_active isActive,
......@@ -16,12 +16,26 @@
s.title title,
s.digest digest,
s.author author,
s.cover_url coverUrl
from ag_acl_practitioner_file_sharing s
left join ag_md_drop_options o on o.id = s.md_drop_option_id
left join ag_acl_user uc on uc.id = s.created_by
left join ag_acl_user uu on uu.id = s.created_by
LEFT JOIN ag_acl_customer_object_share os on os.item_id = s.id
s.cover_url coverUrl,
count(ost.id) totalNum
<if test="practitionerId != null">
,(SELECT count(aost.id)
FROM ag_acl_customer_object_share_track aost
WHERE aost.share_id IN (
SELECT aos.id
FROM ag_acl_customer_object_share aos
WHERE aos.item_id = s.id
AND aos.item_type = 1
AND aos.practitioner_id = #{practitionerId,jdbcType=BIGINT}
)) num
</if>
FROM ag_acl_practitioner_file_sharing s
LEFT JOIN ag_md_drop_options o on o.id = s.md_drop_option_id
LEFT JOIN ag_acl_user uc on uc.id = s.created_by
LEFT JOIN ag_acl_user uu on uu.id = s.created_by
LEFT JOIN ag_acl_customer_object_share os
LEFT JOIN ag_acl_customer_object_share_track ost ON ost.share_id = os.id
ON os.item_id = s.id
<where>
<if test="mdDropOptionIds != null">
<foreach collection="mdDropOptionIds" item="mdDropOptionId" index="index" open="(" close=")" separator="or">
......@@ -29,18 +43,18 @@
</foreach>
</if>
<if test="id != null">
and s.id = #{id,jdbcType=BIGINT}
AND s.id = #{id,jdbcType=BIGINT}
</if>
<if test="shareCode != null">
and os.item_type = 1
and os.share_code = #{shareCode,jdbcType=VARCHAR}
AND os.item_type = 1
AND os.share_code = #{shareCode,jdbcType=VARCHAR}
</if>
<if test="isActive != null">
and s.is_active = #{isActive,jdbcType=INTEGER}
AND s.is_active = #{isActive,jdbcType=INTEGER}
</if>
</where>
group by s.id
ORDER BY s.id desc
GROUP BY s.id
ORDER BY s.id DESC
</select>
<resultMap id="BaseResultMap" type="com.yd.api.agms.vo.practitioner.SharePractitionerInfo">
<result column="customerId" jdbcType="BIGINT" property="customerId" />
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.practitioner.PractitionerArticleMapper">
<select id="articleTrackQuery" resultType="com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo">
SELECT ost.image_path imagePath,
ost.nickname nickName,
date_format(ost.track_in_time,'%Y-%m-%d %H:%i:%s') trackInTime,
ost.gender gender
FROM ag_acl_customer_object_share_track ost
WHERE share_id IN (SELECT os.id
FROM ag_acl_customer_object_share os
WHERE os.practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND item_type = 1
AND item_id = #{sharingId,jdbcType=BIGINT})
</select>
</mapper>
\ No newline at end of file
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