Pārlūkot izejas kodu

修改活动4480

dingxin 6 gadus atpakaļ
vecāks
revīzija
50514e497f

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java Parādīt failu

38
      * @return
38
      * @return
39
      */
39
      */
40
     List<TpActivity> selecttpActivity(@Param("id") Integer id, @Param("communityId") Integer communityId);
40
     List<TpActivity> selecttpActivity(@Param("id") Integer id, @Param("communityId") Integer communityId);
41
+
42
+    TpActivity selectActivity(@Param("activityId") Integer activityId);
41
 }
43
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivitySignInMapper.java Parādīt failu

24
      *
24
      *
25
      */
25
      */
26
     TpActivitySignIn selectSing(@Param("activityId") Integer activityId,@Param("userID") Integer userID);
26
     TpActivitySignIn selectSing(@Param("activityId") Integer activityId,@Param("userID") Integer userID);
27
+
27
 }
28
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivitySignupMapper.java Parādīt failu

1
 package com.community.huiju.dao;
1
 package com.community.huiju.dao;
2
 
2
 
3
 
3
 
4
+import com.community.huiju.model.TpActivitySignIn;
4
 import com.community.huiju.model.TpActivitySignup;
5
 import com.community.huiju.model.TpActivitySignup;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;

+ 11
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivity.java Parādīt failu

42
     private Date updateDate;
42
     private Date updateDate;
43
     
43
     
44
     private String userName;
44
     private String userName;
45
-    
45
+
46
+    private String signInCode;
47
+
48
+    public String getSignInCode() {
49
+        return signInCode;
50
+    }
51
+
52
+    public void setSignInCode(String signInCode) {
53
+        this.signInCode = signInCode;
54
+    }
55
+
46
     /**
56
     /**
47
      * 报名状态
57
      * 报名状态
48
      */
58
      */

+ 27
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Parādīt failu

645
     public ResponseBean tpActivitySignInAdd(String paramets, UserElement userElement) {
645
     public ResponseBean tpActivitySignInAdd(String paramets, UserElement userElement) {
646
         ResponseBean responseBean = new ResponseBean();
646
         ResponseBean responseBean = new ResponseBean();
647
         Integer activityId = JSONObject.parseObject(paramets).getInteger("activityId");
647
         Integer activityId = JSONObject.parseObject(paramets).getInteger("activityId");
648
+        // 校验扫码签到
649
+        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId,userElement.getCommunityId());
650
+        /*当前用户扫的是否是本小区的码*/
651
+        TpActivity activity = tpActivityMapper.selectActivity(activityId);
652
+        if (null!=activity && (!userElement.getCommunityId().equals(activity.getCommunityId()))){
653
+            responseBean.addError("活动不属于当前登录小区,请在个人中心切换小区");
654
+            return responseBean;
655
+        }
656
+        /*查看当前用户是否报名*/
657
+         TpActivitySignup signIn= tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId,userElement.getCommunityId(),userElement.getUserVerifyId());
658
+        if (signIn == null){
659
+            responseBean.addError("请先报名");
660
+            return responseBean;
661
+        }
662
+        /*活动不需要签到*/
663
+
664
+        if (null!=tpActivity && "2".equals(tpActivity.getSignInCode())){
665
+            responseBean.addError("活动已不能签到");
666
+            return responseBean;
667
+        }
668
+        /*活动作废*/
669
+        if (null!=tpActivity && "0".equals(tpActivity.getStatus())){
670
+            responseBean.addError("活动已被作废");
671
+            return responseBean;
672
+        }
673
+
648
         TpActivitySignIn tpActivitySignIn = new TpActivitySignIn();
674
         TpActivitySignIn tpActivitySignIn = new TpActivitySignIn();
649
         tpActivitySignIn.setActivityId(activityId);
675
         tpActivitySignIn.setActivityId(activityId);
650
         tpActivitySignIn.setCommunityId(userElement.getCommunityId());
676
         tpActivitySignIn.setCommunityId(userElement.getCommunityId());
787
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
813
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
788
         tpActivitySignup.setActivityId(tpActivity.getId());
814
         tpActivitySignup.setActivityId(tpActivity.getId());
789
         tpActivitySignup.setCommunityId(communityId);
815
         tpActivitySignup.setCommunityId(communityId);
790
-        tpActivitySignup.setTaUserId(userElement.getId());
816
+        tpActivitySignup.setTaUserId(userElement.getUserVerifyId());
791
         tpActivitySignup.setSignUpTime(new Date());
817
         tpActivitySignup.setSignUpTime(new Date());
792
         tpActivitySignup.setRemark(remark);
818
         tpActivitySignup.setRemark(remark);
793
 
819
 

+ 19
- 4
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml Parādīt failu

21
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
21
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
22
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
22
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
23
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
23
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
24
+    <result column="sign_in_code" property="signInCode" jdbcType="VARCHAR" />
25
+
24
   </resultMap>
26
   </resultMap>
25
   <sql id="Base_Column_List" >
27
   <sql id="Base_Column_List" >
26
     id, community_id, activity_title, activity_carousel_img, activity_content, sort, 
28
     id, community_id, activity_title, activity_carousel_img, activity_content, sort, 
27
     sign_up_count, sign_up_max, view_count, registration_start_time, registration_end_time, 
29
     sign_up_count, sign_up_max, view_count, registration_start_time, registration_end_time, 
28
     activity_start_time, activity_end_time, status, create_user, create_date, update_user, 
30
     activity_start_time, activity_end_time, status, create_user, create_date, update_user, 
29
-    update_date
31
+    update_date,sign_in_code
30
   </sql>
32
   </sql>
31
   <select id="selectByPrimaryKey" resultMap="BaseResultMap">
33
   <select id="selectByPrimaryKey" resultMap="BaseResultMap">
32
     select
34
     select
45
       registration_start_time, registration_end_time, 
47
       registration_start_time, registration_end_time, 
46
       activity_start_time, activity_end_time, 
48
       activity_start_time, activity_end_time, 
47
       status, create_user, create_date, 
49
       status, create_user, create_date, 
48
-      update_user, update_date)
50
+      update_user, update_date,sign_in_code,sign_in_code,sign_in_code)
49
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{activityTitle,jdbcType=VARCHAR}, 
51
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{activityTitle,jdbcType=VARCHAR}, 
50
       #{activityCarouselImg,jdbcType=VARCHAR}, #{activityContent,jdbcType=LONGVARCHAR}, #{sort,jdbcType=INTEGER},
52
       #{activityCarouselImg,jdbcType=VARCHAR}, #{activityContent,jdbcType=LONGVARCHAR}, #{sort,jdbcType=INTEGER},
51
       #{signUpCount,jdbcType=INTEGER}, #{signUpMax,jdbcType=INTEGER}, #{viewCount,jdbcType=INTEGER}, 
53
       #{signUpCount,jdbcType=INTEGER}, #{signUpMax,jdbcType=INTEGER}, #{viewCount,jdbcType=INTEGER}, 
52
       #{registrationStartTime,jdbcType=TIMESTAMP}, #{registrationEndTime,jdbcType=TIMESTAMP}, 
54
       #{registrationStartTime,jdbcType=TIMESTAMP}, #{registrationEndTime,jdbcType=TIMESTAMP}, 
53
       #{activityStartTime,jdbcType=TIMESTAMP}, #{activityEndTime,jdbcType=TIMESTAMP}, 
55
       #{activityStartTime,jdbcType=TIMESTAMP}, #{activityEndTime,jdbcType=TIMESTAMP}, 
54
       #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
56
       #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
55
-      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
57
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},#{signInCode,jdbcType=TIMESTAMP})
56
   </insert>
58
   </insert>
57
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpActivity" >
59
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpActivity" >
58
     insert into tp_activity
60
     insert into tp_activity
111
       <if test="updateDate != null" >
113
       <if test="updateDate != null" >
112
         update_date,
114
         update_date,
113
       </if>
115
       </if>
116
+      <if test="signInCode != null" >
117
+        sign_in_code
118
+      </if>
114
     </trim>
119
     </trim>
115
     <trim prefix="values (" suffix=")" suffixOverrides="," >
120
     <trim prefix="values (" suffix=")" suffixOverrides="," >
116
       <if test="id != null" >
121
       <if test="id != null" >
167
       <if test="updateDate != null" >
172
       <if test="updateDate != null" >
168
         #{updateDate,jdbcType=TIMESTAMP},
173
         #{updateDate,jdbcType=TIMESTAMP},
169
       </if>
174
       </if>
175
+      <if test="signInCode != null" >
176
+        #{signInCode,jdbcType=VARCHAR},
177
+      </if>
170
     </trim>
178
     </trim>
171
   </insert>
179
   </insert>
172
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpActivity" >
180
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpActivity" >
223
       <if test="updateDate != null" >
231
       <if test="updateDate != null" >
224
         update_date = #{updateDate,jdbcType=TIMESTAMP},
232
         update_date = #{updateDate,jdbcType=TIMESTAMP},
225
       </if>
233
       </if>
234
+      <if test="signInCode != null" >
235
+        sign_in_code = #{signInCode,jdbcType=VARCHAR}
236
+      </if>
226
     </set>
237
     </set>
227
     where id = #{id,jdbcType=INTEGER}
238
     where id = #{id,jdbcType=INTEGER}
228
   </update>
239
   </update>
244
       create_user = #{createUser,jdbcType=INTEGER},
255
       create_user = #{createUser,jdbcType=INTEGER},
245
       create_date = #{createDate,jdbcType=TIMESTAMP},
256
       create_date = #{createDate,jdbcType=TIMESTAMP},
246
       update_user = #{updateUser,jdbcType=INTEGER},
257
       update_user = #{updateUser,jdbcType=INTEGER},
247
-      update_date = #{updateDate,jdbcType=TIMESTAMP}
258
+      update_date = #{updateDate,jdbcType=TIMESTAMP},
259
+      sign_in_code = #{signInCode,jdbcType=VARCHAR}
248
     where id = #{id,jdbcType=INTEGER}
260
     where id = #{id,jdbcType=INTEGER}
249
   </update>
261
   </update>
250
 
262
 
290
     AND tr.community_id =#{communityId}
302
     AND tr.community_id =#{communityId}
291
     order by a.create_date desc
303
     order by a.create_date desc
292
   </select>
304
   </select>
305
+  <select id="selectActivity" resultMap="BaseResultMap">
306
+    select * from tp_activity where id = #{activityId}
307
+  </select>
293
 </mapper>
308
 </mapper>

+ 10
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivitySignInMapper.xml Parādīt failu

149
     and ta_user_id = #{userID,jdbcType=INTEGER}
149
     and ta_user_id = #{userID,jdbcType=INTEGER}
150
   </select>
150
   </select>
151
 
151
 
152
+  <select id="toSignUp" resultMap="BaseResultMap">
153
+    select
154
+    <include refid="Base_Column_List" />
155
+    from
156
+    tp_activity_sign_in
157
+    where
158
+    activity_id = #{activityId,jdbcType=INTEGER}
159
+    and ta_user_id = #{userVerifyId,jdbcType=INTEGER}
160
+    and community_id = #{communityId,jdbcType=INTEGER}
161
+  </select>
152
 </mapper>
162
 </mapper>