jz.kai преди 1 година
родител
ревизия
59329ef989

+ 0 - 1
common/src/main/java/com/jpsoft/employment/modules/base/dao/ParticipateProjectInfoDAO.java

@@ -18,5 +18,4 @@ public interface ParticipateProjectInfoDAO {
 	List<ParticipateProjectInfo> list();
 	List<ParticipateProjectInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 	ParticipateProjectInfo getByIds(@Param(value="regUserId") String regUserId, @Param(value="feedbackId") String feedbackId, @Param(value="loveProjectId") String loveProjectId);
-	List<ParticipateProjectInfo> findByIds(@Param(value="regUserId") String regUserId);
 }

+ 0 - 1
common/src/main/java/com/jpsoft/employment/modules/base/service/ParticipateProjectInfoService.java

@@ -16,5 +16,4 @@ public interface ParticipateProjectInfoService {
 	List<ParticipateProjectInfo> list();
 	Page<ParticipateProjectInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	ParticipateProjectInfo getByIds(String regUserId, String feedbackId, String loveProjectId);
-	List<ParticipateProjectInfo> findByIds(String regUserId);
 }

+ 0 - 6
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/ParticipateProjectInfoServiceImpl.java

@@ -73,10 +73,4 @@ public class ParticipateProjectInfoServiceImpl implements ParticipateProjectInfo
 		// TODO Auto-generated method stub
 		return participateProjectInfoDAO.getByIds(regUserId, feedbackId, loveProjectId);
 	}
-
-	@Override
-	public List<ParticipateProjectInfo> findByIds(String regUserId) {
-		// TODO Auto-generated method stub
-		return participateProjectInfoDAO.findByIds(regUserId);
-	}
 }

+ 1 - 1
common/src/main/resources/mapper/base/LoveProject.xml

@@ -102,7 +102,7 @@
 		select count(*) from base_love_project where id_=#{0}
 	</select>
 	<select id="countByType" parameterType="string" resultType="int">
-		SELECT COUNT(*) FROM SELECT * FROM base_participate_project_info a
+		SELECT COUNT(*) FROM base_participate_project_info a
 		LEFT JOIN base_love_project b ON a.love_project_id = b.id_
 		WHERE a.del_flag = 0
 		AND b.del_flag = 0

+ 3 - 7
common/src/main/resources/mapper/base/ParticipateProjectInfo.xml

@@ -124,6 +124,9 @@
 		]]>
 		<where>
 			a.del_flag = false
+			<if test="searchParams.regUserId != null">
+				and a.reg_user_id = #{searchParams.regUserId}
+			</if>
 			<if test="searchParams.regUserName != null">
 				and b.real_name like #{searchParams.regUserName}
 			</if>
@@ -138,11 +141,4 @@
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
-	<select id="findByIds" parameterType="string" resultMap="ParticipateProjectInfoMap">
-		SELECT * FROM base_participate_project_info
-		WHERE del_flag = 0
-		AND reg_user_id = #{regUserId}
-<!--		AND feedback_id = #{feedbackId}-->
-<!--		AND love_project_id = #{loveProjectId}-->
-	</select>
 </mapper>

+ 14 - 5
web/src/main/java/com/jpsoft/employment/modules/base/api/ChartApi.java

@@ -3,10 +3,8 @@ package com.jpsoft.employment.modules.base.api;
 import com.github.pagehelper.Page;
 import com.jpsoft.employment.modules.base.entity.FeedbackMethod;
 import com.jpsoft.employment.modules.base.entity.LoveProject;
-import com.jpsoft.employment.modules.base.service.FeedbackMethodService;
-import com.jpsoft.employment.modules.base.service.LoveProjectService;
-import com.jpsoft.employment.modules.base.service.StudentAspirationsService;
-import com.jpsoft.employment.modules.base.service.WishInfoUserRecordService;
+import com.jpsoft.employment.modules.base.entity.ParticipateProjectInfo;
+import com.jpsoft.employment.modules.base.service.*;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
@@ -37,6 +35,8 @@ public class ChartApi {
     private LoveProjectService loveProjectService;
     @Autowired
     private WishInfoUserRecordService wishInfoUserRecordService;
+    @Autowired
+    private ParticipateProjectInfoService participateProjectInfoService;
 
     @ApiOperation(value="数据统计")
     @RequestMapping(value = "dataTotal",method = RequestMethod.POST)
@@ -63,8 +63,17 @@ public class ChartApi {
         String subject = (String)request.getAttribute("subject");
         Map<String,Object> map = new HashMap<>();
 
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("regUserId",subject);
+        searchParams.put("status","2");
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time","desc"));
+
+        Page<ParticipateProjectInfo> page = participateProjectInfoService.pageSearch(searchParams,1,100,false,sortList);
+
         Integer countWishRecord = wishInfoUserRecordService.countByUser(subject);
-        Integer countGood = 0;
+        Integer countGood = page.getResult().size();
 
         map.put("countWishRecord",countWishRecord);
         map.put("countGood",countGood);

+ 13 - 4
web/src/main/java/com/jpsoft/employment/modules/base/api/ParticipateApi.java

@@ -114,19 +114,28 @@ public class ParticipateApi {
 
     @ApiOperation(value="公益行动")
     @RequestMapping(value = "myList",method = RequestMethod.POST)
-    public MessageResult myList(HttpServletRequest request){
+    public MessageResult myList(String status, HttpServletRequest request){
         MessageResult msgResult = new MessageResult<>();
         String subject = (String)request.getAttribute("subject");
 
         try {
-            List<ParticipateProjectInfo> participateProjectInfoList = participateProjectInfoService.findByIds(subject);
-            for(ParticipateProjectInfo item : participateProjectInfoList){
+            Map<String,Object> searchParams = new HashMap<>();
+            searchParams.put("regUserId",subject);
+            if (StringUtils.isNotEmpty(status)) {
+                searchParams.put("status",status);
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time","desc"));
+
+            Page<ParticipateProjectInfo> page = participateProjectInfoService.pageSearch(searchParams,1,100,false,sortList);
+            for(ParticipateProjectInfo item : page.getResult()){
                 item.setFeedbackMethod(feedbackMethodService.get(item.getFeedbackId()));
                 item.setLoveProject(loveProjectService.get(item.getLoveProjectId()));
             }
 
             msgResult.setResult(true);
-            msgResult.setData(participateProjectInfoList);
+            msgResult.setData(page.getResult());
         }
         catch(Exception ex){
             logger.error(ex.getMessage(),ex);