Browse Source

党群1+1 点赞bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
f235ac62fb
  1. 7
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java
  2. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

7
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java

@ -61,7 +61,12 @@ public class PartyGroupController {
PartyGroupDTO data = partyGroupService.get(id);
String[] allDeptIds = data.getAllDeptIds().split(",");
List<String> deptIdList = new ArrayList<>(2);
Collections.addAll(deptIdList,allDeptIds[1],allDeptIds[2]);
//防止之前选择街道报错
if(allDeptIds.length == 3){
Collections.addAll(deptIdList,allDeptIds[1],allDeptIds[2]);
}else{
Collections.addAll(deptIdList,allDeptIds[1]);
}
data.setDeptIdList(deptIdList);
return new Result<PartyGroupDTO>().ok(data);
}

8
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

@ -172,9 +172,9 @@
t.COMMENT_NUM,
t.TOPIC_ADDRESS,
t6.IDENTITY_FLAG,
<if test='userId != "" and userId != null'>
if( t1.ATTITUDE_FLAG='0',1,0)likeFlag,
</if>
<if test='userId != "" and userId != null'>
if( t1.ATTITUDE_FLAG='0',1,0)likeFlag,
</if>
t2.IMG_URL,
t3.ID as commentId,
t3.USERNAME as username,
@ -187,7 +187,7 @@
(if(find_in_set(t7.DEPT_ID,t6.ALL_DEPT_IDS)>0,'1','0'))as thisCommunity
from epdc_party_topic t
<if test='userId != "" and userId != null'>
left join (select * from epdc_party_topic_user_attitude group by PARTY_TOPIC_ID)t1 on t.ID = t1.PARTY_TOPIC_ID and t1.DEL_FLAG='0' and t1.USER_ID = #{userId}
left join (select * from epdc_party_topic_user_attitude)t1 on t.ID = t1.PARTY_TOPIC_ID and t1.DEL_FLAG='0' and t1.USER_ID = #{userId}
</if>
left join epdc_party_topic_img t2 on t.ID = t2.REFERENCE_ID and t2.DEL_FLAG='0'
left join (select ID,USERNAME,USER_FACE,PARTY_MEMBER,CONTENT,TOPIC_ID,DEL_FLAG,CREATED_TIME from epdc_party_topic_comment order by CREATED_TIME desc) t3 on t.ID = t3.TOPIC_ID and t3.DEL_FLAG='0'

Loading…
Cancel
Save