魏超 6 år sedan
förälder
incheckning
c43593a806

+ 0
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Visa fil

@@ -46,7 +46,6 @@ public class SocialController {
46 46
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "communityId", value = "小区Id") })
47 47
     public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId){
48 48
         ResponseBean responseBean = new ResponseBean();
49
-
50 49
         return responseBean;
51 50
     }
52 51
     

+ 21
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivitySignupMapper.java Visa fil

@@ -0,0 +1,21 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TpActivitySignup;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+public interface TpActivitySignupMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(TpActivitySignup record);
11
+
12
+    int insertSelective(TpActivitySignup record);
13
+
14
+    TpActivitySignup selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(TpActivitySignup record);
17
+
18
+    int updateByPrimaryKey(TpActivitySignup record);
19
+
20
+    Integer sumActivitySignUpNum(@Param("id")Integer id, @Param("communityId")Integer communityId);
21
+}

+ 65
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivitySignup.java Visa fil

@@ -0,0 +1,65 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpActivitySignup {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private Integer activityId;
11
+
12
+    private Integer taUserId;
13
+
14
+    private Date signUpTime;
15
+
16
+    private String remark;
17
+
18
+    public Integer getId() {
19
+        return id;
20
+    }
21
+
22
+    public void setId(Integer id) {
23
+        this.id = id;
24
+    }
25
+
26
+    public Integer getCommunityId() {
27
+        return communityId;
28
+    }
29
+
30
+    public void setCommunityId(Integer communityId) {
31
+        this.communityId = communityId;
32
+    }
33
+
34
+    public Integer getActivityId() {
35
+        return activityId;
36
+    }
37
+
38
+    public void setActivityId(Integer activityId) {
39
+        this.activityId = activityId;
40
+    }
41
+
42
+    public Integer getTaUserId() {
43
+        return taUserId;
44
+    }
45
+
46
+    public void setTaUserId(Integer taUserId) {
47
+        this.taUserId = taUserId;
48
+    }
49
+
50
+    public Date getSignUpTime() {
51
+        return signUpTime;
52
+    }
53
+
54
+    public void setSignUpTime(Date signUpTime) {
55
+        this.signUpTime = signUpTime;
56
+    }
57
+
58
+    public String getRemark() {
59
+        return remark;
60
+    }
61
+
62
+    public void setRemark(String remark) {
63
+        this.remark = remark == null ? null : remark.trim();
64
+    }
65
+}

+ 4
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Visa fil

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.TaUser;
3 5
 import com.community.huiju.model.TpActivity;
4 6
 import com.community.huiju.model.TpAnnouncement;
5 7
 import com.community.huiju.model.TpSocialView;
@@ -49,4 +51,6 @@ public interface SocialServiceI {
49 51
 	 * @return
50 52
 	 */
51 53
 	TpActivity findActivityDetail(Integer activityId, Integer communityId);
54
+
55
+	ResponseBean findTaUserInfo(Integer id, Integer communityId);
52 56
 }

+ 29
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Visa fil

@@ -1,11 +1,13 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.utils.DateUtils;
4 6
 import com.community.huiju.dao.*;
5
-import com.community.huiju.model.*;
6
-import com.community.huiju.service.SocialServiceI;
7
-import com.community.huiju.dao.TpAnnouncementMapper;
7
+import com.community.huiju.model.TaUser;
8
+import com.community.huiju.model.TpActivity;
8 9
 import com.community.huiju.model.TpAnnouncement;
10
+import com.community.huiju.model.TpSocialView;
9 11
 import com.community.huiju.service.SocialServiceI;
10 12
 import com.github.pagehelper.PageHelper;
11 13
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +15,6 @@ import org.springframework.stereotype.Service;
13 15
 import org.springframework.transaction.annotation.Transactional;
14 16
 
15 17
 import java.util.Date;
16
-
17 18
 import java.util.List;
18 19
 
19 20
 /**
@@ -36,7 +37,8 @@ public class SocialServiceImpl implements SocialServiceI {
36 37
     @Autowired
37 38
     private TpCarouselSettingMapper tpCarouselSettingMapper;
38 39
 
39
-
40
+    @Autowired
41
+    private TpActivitySignupMapper tpActivitySignupMapper;
40 42
     
41 43
     @Override
42 44
     @Transactional
@@ -115,4 +117,26 @@ public class SocialServiceImpl implements SocialServiceI {
115 117
     public TpActivity findActivityDetail(Integer activityId, Integer communityId) {
116 118
         return null;
117 119
     }
120
+
121
+    @Override
122
+    public ResponseBean findTaUserInfo(Integer id, Integer communityId) {
123
+//        ResponseBean responseBean = new ResponseBean();
124
+//        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(id);
125
+//        //判断是否已经过了报名截至时间
126
+//        Date registrEndTime = tpActivity.getRegistrationEndTime();
127
+//        if (registrEndTime.compareTo(new Date()) < 0){
128
+//            return responseBean.addError("9999", "已过报名截止时间");
129
+//        }
130
+//
131
+//        //报名是否超过人数上限
132
+//        Integer signUpNum = tpActivitySignupMapper.sumActivitySignUpNum(id, communityId);
133
+//        if (signUpNum > tpActivity.getSignUpMax()){
134
+//            return responseBean.addError("9998", "报名人数已满");
135
+//        }
136
+//
137
+//        //已登陆,身份未知,状态未知
138
+//
139
+//        //身份为业主,状态为已停用
140
+        return null;
141
+    }
118 142
 }

+ 114
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivitySignupMapper.xml Visa fil

@@ -0,0 +1,114 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpActivitySignupMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpActivitySignup" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="activity_id" property="activityId" jdbcType="INTEGER" />
8
+    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
9
+    <result column="sign_up_time" property="signUpTime" jdbcType="TIMESTAMP" />
10
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
11
+  </resultMap>
12
+  <sql id="Base_Column_List" >
13
+    id, community_id, activity_id, ta_user_id, sign_up_time, remark
14
+  </sql>
15
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
16
+    select 
17
+    <include refid="Base_Column_List" />
18
+    from tp_activity_sign_up
19
+    where id = #{id,jdbcType=INTEGER}
20
+  </select>
21
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
22
+    delete from tp_activity_sign_up
23
+    where id = #{id,jdbcType=INTEGER}
24
+  </delete>
25
+  <insert id="insert" parameterType="com.community.huiju.model.TpActivitySignup" >
26
+    insert into tp_activity_sign_up (id, community_id, activity_id, 
27
+      ta_user_id, sign_up_time, remark
28
+      )
29
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, 
30
+      #{taUserId,jdbcType=INTEGER}, #{signUpTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
31
+      )
32
+  </insert>
33
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpActivitySignup" >
34
+    insert into tp_activity_sign_up
35
+    <trim prefix="(" suffix=")" suffixOverrides="," >
36
+      <if test="id != null" >
37
+        id,
38
+      </if>
39
+      <if test="communityId != null" >
40
+        community_id,
41
+      </if>
42
+      <if test="activityId != null" >
43
+        activity_id,
44
+      </if>
45
+      <if test="taUserId != null" >
46
+        ta_user_id,
47
+      </if>
48
+      <if test="signUpTime != null" >
49
+        sign_up_time,
50
+      </if>
51
+      <if test="remark != null" >
52
+        remark,
53
+      </if>
54
+    </trim>
55
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
56
+      <if test="id != null" >
57
+        #{id,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="communityId != null" >
60
+        #{communityId,jdbcType=INTEGER},
61
+      </if>
62
+      <if test="activityId != null" >
63
+        #{activityId,jdbcType=INTEGER},
64
+      </if>
65
+      <if test="taUserId != null" >
66
+        #{taUserId,jdbcType=INTEGER},
67
+      </if>
68
+      <if test="signUpTime != null" >
69
+        #{signUpTime,jdbcType=TIMESTAMP},
70
+      </if>
71
+      <if test="remark != null" >
72
+        #{remark,jdbcType=VARCHAR},
73
+      </if>
74
+    </trim>
75
+  </insert>
76
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpActivitySignup" >
77
+    update tp_activity_sign_up
78
+    <set >
79
+      <if test="communityId != null" >
80
+        community_id = #{communityId,jdbcType=INTEGER},
81
+      </if>
82
+      <if test="activityId != null" >
83
+        activity_id = #{activityId,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="taUserId != null" >
86
+        ta_user_id = #{taUserId,jdbcType=INTEGER},
87
+      </if>
88
+      <if test="signUpTime != null" >
89
+        sign_up_time = #{signUpTime,jdbcType=TIMESTAMP},
90
+      </if>
91
+      <if test="remark != null" >
92
+        remark = #{remark,jdbcType=VARCHAR},
93
+      </if>
94
+    </set>
95
+    where id = #{id,jdbcType=INTEGER}
96
+  </update>
97
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpActivitySignup" >
98
+    update tp_activity_sign_up
99
+    set community_id = #{communityId,jdbcType=INTEGER},
100
+      activity_id = #{activityId,jdbcType=INTEGER},
101
+      ta_user_id = #{taUserId,jdbcType=INTEGER},
102
+      sign_up_time = #{signUpTime,jdbcType=TIMESTAMP},
103
+      remark = #{remark,jdbcType=VARCHAR}
104
+    where id = #{id,jdbcType=INTEGER}
105
+  </update>
106
+
107
+  <select id="sumActivitySignUpNum" resultMap="java.lang.Integer">
108
+    select
109
+    count(*)
110
+    from tp_activity_sign_up
111
+    where activity_id = #{id,jdbcType=INTEGER} and community_id = #{communityId}
112
+  </select>
113
+
114
+</mapper>