Browse Source

APP关注列表BUG修复

anderx 8 years ago
parent
commit
b5ebfec9a1

+ 0 - 3
src/main/java/com/goafanti/achievement/service/impl/AchievementInterestServiceImpl.java

@@ -90,9 +90,6 @@ public class AchievementInterestServiceImpl extends BaseMybatisDao<AchievementIn
 
 	@Override
 	public String saveInterest(String uid,Integer type,String objectId,String interest) {
-		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
-			 uid=TokenManager.getUserId();
-		}
 		int i=0; 
 		if (type==InterestType.POLICY.getCode()) {
 			NewsInterest n=new NewsInterest();

+ 2 - 0
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -748,6 +748,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
 			params.put("ownerId", TokenManager.getUserId());
 		}
+		params.put("ownerId", "46433140-0a90-471e-a32f-6bc89c562e3d");
+		
 		return (Pagination<AchievementPartnerListBo>) findPage("findMyAchievementListByPage", "findMyAchievementCount",
 				params,pNo, pSize);
 	}

+ 1 - 0
src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java

@@ -63,6 +63,7 @@ public class AppAchievementDemandController extends BaseApiController {
 		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
 			uid=TokenManager.getUserId();
 		}
+		
 		if (Integer.valueOf(interest)==0) {
 			res.setData(achievementInterestService.saveInterest( uid, type, objectId,interest));
 		}else {

+ 1 - 1
src/main/java/com/goafanti/common/dao/DemandInterestMapper.java

@@ -25,7 +25,7 @@ public interface DemandInterestMapper {
 
 	int deleteInterest(@Param("uid")String uid, @Param("objectId")String objectId);
 
-	int  checkCount(String uid);
+	int  checkCount(@Param("uid")String uid);
 
 	
 }

+ 8 - 8
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1716,14 +1716,14 @@
   	
   	 <select id="findMyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
   	select 
-  		a.id, a.boutique,a.name, a.category,a.release_date
-  	from achievement a
-  	where deleted_sign = 0 
+	  a.id, a.boutique,a.name, a.audit_status as auditStatus,
+	  a.release_date as releaseDate
+	from  achievement a 
+	where a.deleted_sign = 0
   	<if test="ownerId != null">
   	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
-  	order by serial_number desc
-	<if test="page_sql!=null">
+  	<if test="page_sql!=null">
 			${page_sql}
 	</if>
   </select>
@@ -1731,10 +1731,10 @@
   <select id="findMyAchievementCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)
-  	from achievement a
-  	where deleted_sign = 0 
+  	from  achievement a 
+	where a.deleted_sign = 0
 	<if test="ownerId != null">
-  	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
+  	and i.uid = #{ownerId,jdbcType=VARCHAR}
   	</if>
   	</select>
   	

+ 1 - 1
src/main/java/com/goafanti/common/mapper/DemandInterestMapper.xml

@@ -147,7 +147,7 @@
   <select id="checkCount" resultType="Integer">
   		select count(0) from demand_interest where 1=1
   		<if test="uid != null">
-  	       and uid = #{uid,jdbcType=VARCHAR}
+  	      and demand_id = #{uid,jdbcType=VARCHAR}
   	    </if>
   	    
   </select>

+ 4 - 4
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -1584,7 +1584,7 @@
   	select	n.id,n.title as name,n.create_time as createTime
 	from news_interest ni
 	LEFT  join news n on ni.new_id=n.id
-	where uid=#{uid,jdbcType=VARCHAR}
+	where ni.uid=#{uid,jdbcType=VARCHAR}
 	order by createTime desc
   	<if test="page_sql!=null">
 		${page_sql}
@@ -1595,7 +1595,7 @@
   		select count(1)
 	from news_interest ni
 	LEFT  join news n on ni.new_id=n.id
-	where uid=#{uid,jdbcType=VARCHAR}
+	where ni.uid=#{uid,jdbcType=VARCHAR}
 	</select>
 	
 	<select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
@@ -1615,11 +1615,11 @@
 	where  from_uid=#{uid,jdbcType=VARCHAR}
 	</select>
 	
-	<select id="findAppDemandInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
+	<select id="findAppDemandInterestByPage"  resultType="com.goafanti.demand.bo.ObjectInterestListBo">
   	select d.id ,d.name,t.create_time as createTime
 	from demand_interest t
 	left join  demand d on t.demand_id=d.id
-	where  uid=#{uid,jdbcType=VARCHAR}
+	where  t.uid=#{uid,jdbcType=VARCHAR}
   	<if test="page_sql!=null">
 		${page_sql}
 	</if>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/NewsInterestMapper.xml

@@ -278,6 +278,6 @@
   <select id="countInterest" resultType="java.lang.Integer">
   	select count(0) from news_interest
 	where 
-  	uid = #{uid,jdbcType=VARCHAR}
+  	new_id = #{uid,jdbcType=VARCHAR}
   </select>
 </mapper>

+ 5 - 5
src/main/java/com/goafanti/demand/bo/ObjectInterestListBo.java

@@ -10,7 +10,7 @@ public class ObjectInterestListBo {
 	/**
 	 * ID
 	 */
-	private String ID;
+	private String id;
 	/**
 	 * 类型
 	 */
@@ -60,11 +60,11 @@ public class ObjectInterestListBo {
 	public void setCountInterest(String countInterest) {
 		this.countInterest = countInterest;
 	}
-	public String getID() {
-		return ID;
+	public String getId() {
+		return id;
 	}
-	public void setID(String iD) {
-		ID = iD;
+	public void setId(String id) {
+		this.id = id;
 	}
 	public String getUid() {
 		return uid;

+ 5 - 4
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -870,11 +870,12 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		if (StringUtils.isNotBlank(TokenManager.getUserId())) {
 			params.put("uid", TokenManager.getUserId());
 		}
+		
 		if (type==InterestType.POLICY.getCode()) {
 			Pagination<ObjectInterestListBo> p=(Pagination<ObjectInterestListBo>) findPage("findAppNewsInterestByPage", "findAppNewsInterestCount", params, pNo, pSize);
 			List<ObjectInterestListBo> l=(List<ObjectInterestListBo>) p.getList();
 			for (ObjectInterestListBo o : l) {
-				int i=newsInterestMapper.countInterest(o.getUid());
+				int i=newsInterestMapper.countInterest(o.getId());
 				o.setCountInterest(String.valueOf(i));
 				o.setType(type);
 			}
@@ -884,7 +885,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			Pagination<ObjectInterestListBo> p=(Pagination<ObjectInterestListBo>) findPage("findAppUserInterestByPage", "findAppUserInterestCount", params, pNo, pSize);
 			List<ObjectInterestListBo> l=(List<ObjectInterestListBo>) p.getList();
 			for (ObjectInterestListBo o : l) {
-				int i=userInterestMapper.countInterest(o.getUid());
+				int i=userInterestMapper.countInterest(o.getId());
 				o.setCountInterest(String.valueOf(i));
 				o.setType(type);
 			}
@@ -894,7 +895,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			Pagination<ObjectInterestListBo> p=(Pagination<ObjectInterestListBo>) findPage("findAppDemandInterestByPage", "findAppDemandInterestCount", params, pNo, pSize);
 			List<ObjectInterestListBo> l=(List<ObjectInterestListBo>) p.getList();
 			for (ObjectInterestListBo o : l) {
-				int i=demandInterestMapper.checkCount(o.getUid());
+				int i=demandInterestMapper.checkCount(o.getId());
 				o.setCountInterest(String.valueOf(i));
 				o.setType(type);
 			}
@@ -904,7 +905,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			Pagination<ObjectInterestListBo> p=(Pagination<ObjectInterestListBo>) findPage("findAppAchievementInterestByPage", "findAppAchievementInterestCount", params, pNo, pSize);
 			List<ObjectInterestListBo> l=(List<ObjectInterestListBo>) p.getList();
 			for (ObjectInterestListBo o : l) {
-				int i=achievementMapper.countInterest(o.getUid());
+				int i=achievementMapper.countInterest(o.getId());
 				o.setCountInterest(String.valueOf(i));
 				o.setType(type);
 			}