Bladeren bron

客户释放修改

anderx 1 jaar geleden
bovenliggende
commit
3686bffea3

+ 3 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -3,6 +3,7 @@ package com.goafanti.common.dao;
 import com.goafanti.admin.bo.OutFinanceCount;
 import com.goafanti.admin.bo.OutFinanceCount;
 import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.model.PublicRelease;
+import com.goafanti.customer.bo.MyUserDetailsBo;
 import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.bo.*;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -71,4 +72,6 @@ public interface PublicReleaseMapper {
     int selectCountByUnaudited(String aid);
     int selectCountByUnaudited(String aid);
 
 
     int selectCountByOtherUnaudited(String aid);
     int selectCountByOtherUnaudited(String aid);
+
+    List<MyUserDetailsBo> selectByUid(String id);
 }
 }

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

@@ -22,7 +22,7 @@ public interface UserFollowMapper {
 
 
 	int pushUserGuidance(@Param("id")String id, @Param("guidance")Integer guidance);
 	int pushUserGuidance(@Param("id")String id, @Param("guidance")Integer guidance);
 
 
-	List<UserFollow> selectbyUid(@Param("uid")String uid, @Param("aid")String aid);
+	List<UserFollow> selectByUidAndUid(@Param("uid")String uid, @Param("aid")String aid);
 
 
 
 
     Integer selectByaidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
     Integer selectByaidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);

+ 6 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -854,4 +854,10 @@
           and a.status =1
           and a.status =1
           and e.aid =  #{aid}
           and e.aid =  #{aid}
     </select>
     </select>
+    <select id="selectByUid" resultType="com.goafanti.customer.bo.MyUserDetailsBo">
+        select  a.id ,c.name  aname,a.release_start as releaseStart
+        from public_release a  left join admin c on a.aid =c.id
+        where  a.status in  (2) and a.type in (0,1,2)
+          and a.id in (select prid from public_release_details where uid = #{uid})
+    </select>
 </mapper>
 </mapper>

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

@@ -206,13 +206,15 @@
         set a.guidance= #{guidance}
         set a.guidance= #{guidance}
         where a.id=b.uid and b.id= #{id}
         where a.id=b.uid and b.id= #{id}
     </update>
     </update>
-    <select id="selectbyUid" resultMap="BaseResultMap">
+    <select id="selectByUidAndUid" resultMap="BaseResultMap">
 
 
         select
         select
         <include refid="Base_Column_List" />
         <include refid="Base_Column_List" />
         from user_follow a
         from user_follow a
         where a.uid= #{uid}
         where a.uid= #{uid}
-        and a.aid= #{aid}
+          <if test="aid !=null">
+              and a.aid= #{aid}
+          </if>
     </select>
     </select>
 
 
 
 

+ 39 - 0
src/main/java/com/goafanti/customer/bo/MyUserDetailsBo.java

@@ -0,0 +1,39 @@
+package com.goafanti.customer.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+public class MyUserDetailsBo {
+
+    private String id;
+
+    private Date releaseStart;
+
+    private String aname;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    public Date getReleaseStart() {
+        return releaseStart;
+    }
+
+    public void setReleaseStart(Date releaseStart) {
+        this.releaseStart = releaseStart;
+    }
+
+    public String getAname() {
+        return aname;
+    }
+
+    public void setAname(String aname) {
+        this.aname = aname;
+    }
+}

+ 25 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2725,7 +2725,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	@Override
 	@Override
 	public boolean checkChannel(List<String> uids) {
 	public boolean checkChannel(List<String> uids) {
 		for (String uid : uids) {
 		for (String uid : uids) {
-			List<UserFollow> list = userFollowMapper.selectbyUid(uid, TokenManager.getAdminId());
+			List<UserFollow> list = userFollowMapper.selectByUidAndUid(uid, TokenManager.getAdminId());
 			if (!list.isEmpty()) {
 			if (!list.isEmpty()) {
 				return true;
 				return true;
 			}
 			}
@@ -3192,8 +3192,30 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 
 	@Override
 	@Override
 	public Object selectMyUserDetails(String id) {
 	public Object selectMyUserDetails(String id) {
-//		publicReleaseLogMapper
-		return null;
+		Map<String, Object> params = new LinkedHashMap<>();
+		List<MyUserDetailsBo> publicReleases = publicReleaseMapper.selectByUid(id);
+		MyUserDetailsBo  maxPr = new MyUserDetailsBo();
+		MyUserDetailsBo  minPr = new MyUserDetailsBo();
+		for (MyUserDetailsBo  e : publicReleases) {
+				if (maxPr.getReleaseStart()==null)maxPr=e;
+				if (maxPr.getReleaseStart().before(e.getReleaseStart()))maxPr=e;
+				if (minPr.getReleaseStart()==null)minPr=e;
+				if (minPr.getReleaseStart().after(e.getReleaseStart()))minPr=e;
+		}
+		List<UserFollow> userFollows = userFollowMapper.selectByUidAndUid(id, null);
+		Optional<UserFollow> latestFollow = userFollows.stream()
+				.max(Comparator.comparing(UserFollow::getCreateTime));
+		params.put("count",publicReleases.size());
+		params.put("minPublicRelease",minPr);
+		params.put("maxPublicRelease",maxPr);
+        latestFollow.ifPresent(userFollow -> {
+			Map<String, Object> map = new LinkedHashMap<>();
+			map.put("id",userFollow.getId());
+			map.put("followTime",DateUtils.formatDate(userFollow.getCreateTime(),AFTConstants.YYYYMMDD));
+			map.put("followName",userFollow.getFollowName());
+			params.put("latestFollow",map);
+		});
+		return params;
 	}
 	}
 
 
 }
 }