提交 9de5db46 作者: zhenjie

Merge branch 'develop'

......@@ -26,6 +26,10 @@ public class ReleaseReportDTO {
private Integer postsReleaseCount;
@ApiModelProperty(value = "话题发布数量")
private Integer topicReleaseCount;
@ApiModelProperty(value = "新闻发布数量")
private Integer newsReleaseCount;
@ApiModelProperty(value = "招标信息数量")
private Integer tenderReleaseCount;
@ApiModelProperty(value = "订单金额")
private BigDecimal serviceOrderAmount;
}
......@@ -32,6 +32,9 @@ public class UserTopicDynamicsQO {
@ApiModelProperty(value = "用户id",example = "1")
private Integer userAccountId;
@ApiModelProperty(value = "token用户id",hidden = true)
private Integer userId;
/**
* 初始化起始查询行并返回当前页
......
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims
newTag: 3091f41e782f14c17c403ad8e5eb91d761ada7b4
newTag: 3b66b1c259021cdfab3b75cb9dd8f0c4489bf08b
......@@ -135,12 +135,16 @@ public class GambitController extends BaseController{
@ApiOperation(value = "我的关注")
@PostMapping("/myInterestList")
public ResultBody<MyAttentionDO> myInterestList(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){
Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
userTopicDynamicsQO.setUserId(userId);
return ResultBody.success(gambitService.myInterestList(userTopicDynamicsQO));
}
@ApiOperation(value = "我的粉丝")
@PostMapping("/myFansList")
public ResultBody<MyFansDO> myFansList(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){
Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
userTopicDynamicsQO.setUserId(userId);
return ResultBody.success(gambitService.myFansList(userTopicDynamicsQO));
}
......
......@@ -187,6 +187,8 @@ public interface DynamicDao {
List<ForumGambitDO> selectGambit(Integer id);
List<ForumGambitDO> selectGambitBack(Integer id);
void insertforumFirstLevelReview(ForumFirstLevelReviewDO forumFirstLevelReviewDO);
......
......@@ -63,4 +63,8 @@ public interface TenderDao {
List<Integer> listApplyTenderInfoIds(List<Integer> tenderInfoIds, Integer applyUserId);
TenderInfoDO getInfoById(Integer id);
int getNewsReleaseCount();
int getTenderReleaseCount();
}
......@@ -84,6 +84,8 @@ public interface GambitDao {
void updateAttentionExchange(Integer userAccountId, Integer attentionUserAccountId);
void updateAttentionExchanges(Integer userAccountId, Integer attentionUserAccountId,Integer userAccountId1, Integer attentionUserAccountId1);
ForumAttentionDO selectAttentionMessage(Integer userAccountId, Integer attentionUserAccountId);
List<ForumDynamicGambitDO> appGambitList(TopicDynamicsQO topicDynamicsQO);
......@@ -108,11 +110,19 @@ public interface GambitDao {
List<ForumDynamicGambitDO> likedList(UserTopicDynamicsQO userTopicDynamicsQO);
int myInterestListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestListCounts(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestList(UserTopicDynamicsQO userTopicDynamicsQO);
int myFansListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestLists(UserTopicDynamicsQO userTopicDynamicsQO);
ForumCountDO selectUserCount(Integer userAccountId);
List<MyFansDO> myFansListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyFansDO> myFansListCounts(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyFansDO> myFansList(UserTopicDynamicsQO userTopicDynamicsQO);
......@@ -128,6 +138,8 @@ public interface GambitDao {
int selectCountAttentions(Integer userAccountId,Integer userId);
int selectCountAttentionMutualAttention(Integer userAccountId,Integer userId);
int selectGambitAndDynamic(Integer id);
Integer selectStatus(Integer id, Integer userId);
......@@ -135,4 +147,8 @@ public interface GambitDao {
List<DynamicGambitDO> selectDynamicGambit(Integer dynamicId);
void updateGambits(Integer gambitId);
List<MyFansDO> myFansLists(UserTopicDynamicsQO userTopicDynamicsQO);
List<ForumAttentionDO> selectAttentionCount(Integer userAccountId, Integer userId);
}
......@@ -42,6 +42,9 @@ public class ForumCountDO implements Serializable {
@ApiModelProperty(value = "是否关注",example = "true表示已关注 null没有关注")
private Boolean status;
@ApiModelProperty(value = "是否关注",example = "true表示已关注 null没有关注")
private Boolean statusList;
@ApiModelProperty(value = "实名认证的用户信息")
private UserAccountMessageVo userAccountMessageVo;
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,11 @@ public class MyAttentionDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
@ApiModelProperty(value = "前端忽略此字段",hidden = true)
private Integer attentionUserAccountId;
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,10 @@ public class MyFansDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
@ApiModelProperty(value = "前端忽略此字段",hidden = true)
private Integer attentionUserAccountId;
......
......@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.data.dto.ReleaseReportDTO;
import com.mmc.csf.release.dao.DynamicDao;
import com.mmc.csf.release.dao.RequirementsDao;
import com.mmc.csf.release.dao.TenderDao;
import com.mmc.csf.release.service.data.ReleaseReportService;
import org.springframework.stereotype.Service;
......@@ -21,6 +22,8 @@ public class ReleaseReportServiceImpl implements ReleaseReportService {
private RequirementsDao requirementsDao;
@Resource
private DynamicDao dynamicDao;
@Resource
private TenderDao tenderDao;
@Override
public ResultBody<ReleaseReportDTO> getReleaseReportData() {
......@@ -34,8 +37,14 @@ public class ReleaseReportServiceImpl implements ReleaseReportService {
// 获取话题发布总数
int gambitReleaseCount = dynamicDao.getGambitReleaseCount();
releaseReportDTO.setTopicReleaseCount(gambitReleaseCount);
// 获取新闻发布总数
int newsReleaseCount = tenderDao.getNewsReleaseCount();
releaseReportDTO.setNewsReleaseCount(newsReleaseCount);
// 获取招标信息总数
int tenderReleaseCount = tenderDao.getTenderReleaseCount();
releaseReportDTO.setTenderReleaseCount(tenderReleaseCount);
// 信息发布总数
releaseReportDTO.setReleaseCount(orderCount + dynamicCount + gambitReleaseCount);
releaseReportDTO.setReleaseCount(orderCount + dynamicCount + gambitReleaseCount + newsReleaseCount + tenderReleaseCount);
// 获取订单金额
BigDecimal serviceOrderAmount = requirementsDao.getServiceOrderAmount();
releaseReportDTO.setServiceOrderAmount(serviceOrderAmount);
......
......@@ -81,7 +81,7 @@ public class BackstageForumServiceImpl implements BackstageForumService {
for (ForumDynamicDO forumDynamicDO : dynamicList) {
Integer id = forumDynamicDO.getDynamicId();
ArrayList<String> list = new ArrayList<>();
List<ForumGambitDO> gambitDOS = dynamicDao.selectGambit(id);
List<ForumGambitDO> gambitDOS = dynamicDao.selectGambitBack(id);
for (ForumGambitDO gambitDO : gambitDOS) {
list.add(gambitDO.getGambitName());
}
......
......@@ -27,6 +27,7 @@ import com.mmc.csf.release.dao.LikeDAO;
import com.mmc.csf.release.dao.gambit.GambitDao;
import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.entity.forum.ForumReviewDO;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.forum.vo.*;
......@@ -294,6 +295,7 @@ public class DynamicServiceImpl implements DynamicService {
public PageResult dynamicList(
Integer pageNo, Integer pageSize, Integer userId, HttpServletRequest request, Integer gambitId,Integer dynId,Integer userAccountIds,
String description,List<String> gambitName) {
Integer tokenUserId =userId;
int count = dynamicDao.countDynamicList(dynId,userAccountIds,description);
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, 0);
......@@ -445,9 +447,38 @@ public class DynamicServiceImpl implements DynamicService {
for (DynamicVO dynamicVO : dynamicVOList) {
Integer userAccountId = dynamicVO.getUserAccountId();
int countAttention= gambitDao.selectCountAttentions(userAccountId,userId);
if (countAttention!=0){
// int countA=gambitDao.selectCountAttentions(userId,userAccountId);
List<ForumAttentionDO> forumAttentionDOS = gambitDao.selectAttentionCount(userAccountId, userId);
if (countAttention!=0){
dynamicVO.setStatus(true);
}
}
// if (countA!=0){
// dynamicVO.setStatus(true);
// }
System.out.println(userId);
for (ForumAttentionDO forumAttentionDO : forumAttentionDOS) {
if (forumAttentionDO!=null){
Integer userAccountId1 = dynamicVO.getUserAccountId();
if (userAccountId1.equals(userId)&& forumAttentionDO.getMutualAttention().equals(false)){
if (forumAttentionDO.getAttentionUserAccountId().equals(dynamicVO.getUserAccountId())||
forumAttentionDO.getUserAccountId().equals(dynamicVO.getUserAccountId())
){
dynamicVO.setStatus(true);
}
}
if (forumAttentionDO.getMutualAttention().equals(true)){
if (forumAttentionDO.getAttentionUserAccountId().equals(dynamicVO.getUserAccountId())||
forumAttentionDO.getUserAccountId().equals(dynamicVO.getUserAccountId())
){
dynamicVO.setStatus(true);
}
}
}
}
if (tokenUserId.equals(dynamicVO.getUserAccountId())){
dynamicVO.setStatus(null);
}
}
return PageResult.buildPage(pageNo, pageSize, count, dynamicVOList);
}
......
......@@ -248,6 +248,24 @@
AND fdg.dynamic_id = #{id}
</select>
<select id="selectGambitBack" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO">
SELECT DISTINCT
gf.id,
gf.gambit_name,
gf.gambit_icon,
gf.gambit_cover,
gf.post_count,
gf.gambit_property,
gf.user_account_id,
gf.discussion_count
FROM
forum_dynamic_gambit fdg
INNER JOIN forum_gambit gf
WHERE
fdg.gambit_id = gf.id
AND fdg.dynamic_id = #{id}
</select>
<select id="selectGambitDTO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT DISTINCT
......
......@@ -70,8 +70,9 @@
<resultMap id="myInterestListMap" type="com.mmc.csf.release.entity.forum.MyAttentionDO">
<result property="id" column="id"/>
<result property="userAccountId" column="attention_user_account_id" />
<result property="userAccountId" column="user_account_id" />
<result property="mutualAttention" column="mutual_attention"/>
<result property="attentionUserAccountId" column="attention_user_account_id"/>
<collection property="dynamicCount" ofType="java.lang.Integer"
select="selectCountUser" column="{userAccountId=user_account_id}">
</collection>
......@@ -80,10 +81,12 @@
</collection>
</resultMap>
<resultMap id="myFansListMap" type="com.mmc.csf.release.entity.forum.MyFansDO">
<result property="id" column="id"/>
<result property="userAccountId" column="attention_user_account_id" />
<result property="userAccountId" column="user_account_id" />
<result property="mutualAttention" column="mutual_attention"/>
<result property="attentionUserAccountId" column="attention_user_account_id"/>
<collection property="dynamicCount" ofType="java.lang.Integer"
select="selectCountUser" column="{userAccountId=user_account_id}">
</collection>
......@@ -197,6 +200,14 @@
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId}
</select>
<select id="selectCountAttentionMutualAttention" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="selectAttentionCount" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
select user_account_id,attention_user_account_id,mutual_attention from forum_attention where attention_user_account_id=#{userId} or user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} or user_account_id=#{userId} and mutual_attention=1
</select>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select>
......@@ -556,6 +567,14 @@
where user_account_id=#{userAccountId} and attention_user_account_id=#{attentionUserAccountId}
</update>
<update id="updateAttentionExchanges">
update forum_attention set user_account_id=#{userAccountId1} ,
attention_user_account_id=#{attentionUserAccountId1},
mutual_attention=false,
update_time=NOW()
where user_account_id=#{attentionUserAccountId} and attention_user_account_id=#{userAccountId}
</update>
<select id="appGambitList" resultMap="appGambitListMap">
SELECT DISTINCT
fd.id,
......@@ -647,20 +666,49 @@
limit #{pageNo}, #{pageSize}
</select>
<select id="myInterestListCount" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userAccountId}
<select id="myInterestListCount" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
</select>
<select id="myInterestListCounts" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId} or user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="myInterestList" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id from forum_attention where attention_user_account_id=#{userAccountId}
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myInterestLists" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId} or user_account_id=#{userAccountId} and mutual_attention=1
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myFansListCount" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userAccountId}
<select id="myFansListCount" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where user_account_id=#{userAccountId}
</select>
<select id="myFansListCounts" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where
user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="myFansList" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myFansLists" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where
user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} and mutual_attention=1
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
......
......@@ -43,8 +43,8 @@
<insert id="addTenderNewsDO" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.csf.release.entity.tender.TenderNewsDO">
insert into tender_news(tender_name, is_using, port, create_time,url)
values (#{tenderName}, #{using}, #{port}, NOW(),#{url})
insert into tender_news(tender_name, is_using, port, create_time, url)
values (#{tenderName}, #{using}, #{port}, NOW(), #{url})
</insert>
<insert id="batchAddTenderInfo" useGeneratedKeys="true"
......@@ -312,7 +312,7 @@
<select id="listNewListTenderInfo" resultType="com.mmc.csf.release.entity.tender.TenderInfoDO">
select
ti.id, ti.tender_news_id, ti.tender_price, ti.tender_info_no, ti.tender_title, ti.is_deleted, ti.create_time,
ti.update_time, ti.tender_content
ti.update_time, ti.tender_content
from tender_news tn INNER JOIN tender_info ti ON tn.id = ti.tender_news_id
where
tn.is_deleted = 0 and tn.is_using = 1 and ti.is_deleted = 0
......@@ -346,20 +346,28 @@
</select>
<select id="getInfoById" resultType="com.mmc.csf.release.entity.tender.TenderInfoDO">
SELECT
id,
tender_news_id,
tender_price,
tender_info_no,
tender_title,
is_deleted,
create_time,
update_time,
tender_content
FROM
tender_info
WHERE
is_deleted = 0 and id = #{id}
SELECT id,
tender_news_id,
tender_price,
tender_info_no,
tender_title,
is_deleted,
create_time,
update_time,
tender_content
FROM tender_info
WHERE is_deleted = 0
and id = #{id}
</select>
<select id="getNewsReleaseCount" resultType="java.lang.Integer">
select count(*)
from industry_news
where is_deleted = 0
</select>
<select id="getTenderReleaseCount" resultType="java.lang.Integer">
select count(*)
from tender_info
where is_deleted = 0
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论