Browse Source

提交 修复活动报名

魏熙美 6 years ago
parent
commit
330d9acedc

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java View File

@@ -231,7 +231,6 @@ public class SocialController extends BaseController {
231 231
     @RequestMapping(value = "/activity/{communityId}", method = RequestMethod.GET)
232 232
     public ResponseBean findActivityDetail(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
233 233
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
234
-        Integer userId = userElement.getId();
235 234
         ResponseBean responseBean = new ResponseBean();
236 235
 
237 236
         if (!check(communityId)) {
@@ -239,7 +238,7 @@ public class SocialController extends BaseController {
239 238
             return responseBean;
240 239
         }
241 240
 
242
-        TpActivity activity = socialServiceI.findActivityDetail(activityId, communityId, userId);
241
+        TpActivity activity = socialServiceI.findActivityDetail(activityId, communityId, userElement);
243 242
         responseBean.addSuccess(activity);
244 243
         return responseBean;
245 244
     }

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java View File

@@ -56,9 +56,10 @@ public interface SocialServiceI {
56 56
 	 * 获取活动帖子详情
57 57
 	 * @param activityId
58 58
 	 * @param communityId
59
+	 * @param userElement
59 60
 	 * @return
60 61
 	 */
61
-	TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId);
62
+	TpActivity findActivityDetail(Integer activityId, Integer communityId, UserElement userElement);
62 63
 
63 64
 	/**
64 65
 	 * 活动报名

+ 8
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

@@ -198,9 +198,9 @@ public class SocialServiceImpl implements SocialServiceI {
198 198
      * @return
199 199
      */
200 200
     @Override
201
-    public TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId) {
201
+    public TpActivity findActivityDetail(Integer activityId, Integer communityId, UserElement userElement) {
202 202
         //更新查看次数
203
-        Integer allViewNum = updateSocialView(userId, Constant.ACTIVITY, communityId, activityId);
203
+        Integer allViewNum = updateSocialView(userElement.getId(), Constant.ACTIVITY, communityId, activityId);
204 204
         if (null != allViewNum) {
205 205
             TpActivity activity = new TpActivity();
206 206
             activity.setId(activityId);
@@ -217,12 +217,12 @@ public class SocialServiceImpl implements SocialServiceI {
217 217
             tpActivity.setUserName(tpUser.getUserName());
218 218
         }
219 219
         //查看当前人是否签到
220
-        TpActivitySignIn tpActivitySignIn = tpActivitySignInMapper.selectSing(activityId, userId,communityId);
220
+        TpActivitySignIn tpActivitySignIn = tpActivitySignInMapper.selectSing(activityId, userElement.getId(),communityId);
221 221
         Integer signType = tpActivitySignIn == null ? 0 : 1;
222 222
         tpActivity.setSignType(signType);
223 223
 
224 224
         //返回报名状态
225
-        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
225
+        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userElement.getUserVerifyId());
226 226
         String signStatus = signNum != 0 ? Constant.STATUS_SIGNED : Constant.STATUS_UNSIGN;
227 227
         tpActivity.setSignStatus(signStatus);
228 228
 
@@ -838,7 +838,10 @@ public class SocialServiceImpl implements SocialServiceI {
838 838
     public ResponseBean insertActivitySignUp(UserElement userElement, TpActivity tpActivity, Integer communityId, String remark) {
839 839
         ResponseBean responseBean = new ResponseBean();
840 840
         //判断是否已经报名
841
-        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userElement.getId());
841
+        /**
842
+         * 活动报名表:ta_user_id 字段存储 审核id,所以查询的时候,用户审核id
843
+         */
844
+        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userElement.getUserVerifyId());
842 845
         if (signNum != 0) {
843 846
             responseBean.addError("9996", "您已报名,请勿重复报名");
844 847
             return responseBean;

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/ToBannerMapper.xml View File

@@ -47,7 +47,7 @@
47 47
     <if test="communityId != null">
48 48
       and community_id = #{communityId}
49 49
     </if>
50
-    order by t.sort, t.eff_time
50
+    order by sort desc, update_date DESC
51 51
     <if test="num != null">
52 52
       limit #{num}
53 53
     </if>

+ 1
- 1
CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml View File

@@ -279,7 +279,7 @@
279 279
        and community_id = #{communityId,jdbcType=INTEGER}
280 280
       </if>
281 281
     </trim>
282
-    order by create_date DESC
282
+    order by sort desc, update_date DESC
283 283
   </select>
284 284
 
285 285
   <delete id="deleteBanchBanner" parameterType="list">