瀏覽代碼

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 6 年之前
父節點
當前提交
9aaec6c1a0

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

299
 
299
 
300
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
300
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
301
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
301
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
302
-            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
302
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型0 代表 议事大厅 1 是邻里互助 2 是二手/租赁 3 是其他话题"),
303
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题"),
303
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题"),
304
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
304
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
305
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")}
305
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")}
369
         ResponseBean responseBean = new ResponseBean();
369
         ResponseBean responseBean = new ResponseBean();
370
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
370
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
371
         Integer userId = userElement.getId();
371
         Integer userId = userElement.getId();
372
-        ResponseBean response = socialServiceI.selectAllTransaction(userId, pageNum, pageSize,type);
372
+        ResponseBean response = socialServiceI.selectAllTransaction(userId, pageNum, pageSize,type,userElement.getCommunityId());
373
         return response;
373
         return response;
374
     }
374
     }
375
 
375
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java 查看文件

23
 
23
 
24
     List<TpTransaction> findAllTransaction(@Param("communityId") Integer communityId, @Param("transactionTitle") String transactionTitle, @Param("type") String type);
24
     List<TpTransaction> findAllTransaction(@Param("communityId") Integer communityId, @Param("transactionTitle") String transactionTitle, @Param("type") String type);
25
 
25
 
26
-    List<TpTransaction> selectTransaction(@Param("userId")Integer userId, @Param("communityId")Integer communityId,@Param("type") Integer type);
26
+    List<TpTransaction> selectTransaction(@Param("id")Integer userId, @Param("communityId")Integer communityId,@Param("type") Integer type);
27
 
27
 
28
     void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId);
28
     void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId);
29
 
29
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

116
 	 * @param userId
116
 	 * @param userId
117
 	 * @return
117
 	 * @return
118
 	 */
118
 	 */
119
-	ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer pageSize,Integer type);
119
+	ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer pageSize,Integer type,Integer communityId);
120
 
120
 
121
 	/**
121
 	/**
122
 	 * 修改当前帖子
122
 	 * 修改当前帖子

+ 15
- 12
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

406
         }
406
         }
407
     }
407
     }
408
     @Override
408
     @Override
409
-    public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize,Integer type) {
409
+    public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize,Integer type,Integer communityId) {
410
         ResponseBean responseBean = new ResponseBean();
410
         ResponseBean responseBean = new ResponseBean();
411
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
411
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
412
-         Integer communityId=user.getCommunityId();
413
 
412
 
414
         //判断身份是否为业主且状态为已停用
413
         //判断身份是否为业主且状态为已停用
415
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
414
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
605
         ResponseBean response= new ResponseBean();
604
         ResponseBean response= new ResponseBean();
606
         JSONObject object= JSONObject.parseObject(paramets);
605
         JSONObject object= JSONObject.parseObject(paramets);
607
         JSONArray array= object.getJSONArray("imgArr");
606
         JSONArray array= object.getJSONArray("imgArr");
608
-        String[]	reply= array.toArray(new String[]{});
609
-
607
+        String[] reply = null;
608
+        if (null!=array) {
609
+            reply= array.toArray(new String[]{});
610
+        }
610
         TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
611
         TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
611
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
612
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
612
         tpTransactionReply.setTaUserId(userElement.getId());
613
         tpTransactionReply.setTaUserId(userElement.getId());
622
         tpTransactionReply.setCreateDate(new Date());
623
         tpTransactionReply.setCreateDate(new Date());
623
         tpTransactionReplyMapper.insert(tpTransactionReply);
624
         tpTransactionReplyMapper.insert(tpTransactionReply);
624
 
625
 
625
-        for (String img:reply){
626
-            TdImages tdImages= new TdImages();
627
-            tdImages.setImageUrl(img);
628
-            tdImages.setType("reply");
629
-            tdImages.setUuid(tpTransactionReply.getId());
630
-            tdImages.setCreateTime(new Date());
631
-            tdImages.setCreateUser(userElement.getId());
632
-            tdImagesMapper.insert(tdImages);
626
+        if (null!=array) {
627
+            for (String img : reply) {
628
+                TdImages tdImages = new TdImages();
629
+                tdImages.setImageUrl(img);
630
+                tdImages.setType("reply");
631
+                tdImages.setUuid(tpTransactionReply.getId());
632
+                tdImages.setCreateTime(new Date());
633
+                tdImages.setCreateUser(userElement.getId());
634
+                tdImagesMapper.insert(tdImages);
635
+            }
633
         }
636
         }
634
         response.addSuccess("成功");
637
         response.addSuccess("成功");
635
         return response;
638
         return response;

+ 23
- 7
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

218
   </select>
218
   </select>
219
 
219
 
220
   <select id="selectTransaction" resultMap="BaseResultMap">
220
   <select id="selectTransaction" resultMap="BaseResultMap">
221
-    select
221
+    SELECT
222
     <include refid="Base_Column_List" />
222
     <include refid="Base_Column_List" />
223
-    from tp_transaction
224
-    where community_id = #{communityId,jdbcType=INTEGER}
225
-    and ta_user_id = #{userId,jdbcType=INTEGER}
223
+    FROM
224
+    tp_transaction t
225
+    WHERE t.create_user=#{id,jdbcType=INTEGER}
226
+    AND t.community_id=#{communityId,jdbcType=INTEGER}
227
+    UNION ALL
228
+    SELECT
229
+    <include refid="Base_Column_List" />
230
+    FROM
231
+    tp_transaction t
232
+    INNER JOIN(SELECT
233
+    y.transaction_id
234
+    FROM
235
+    tp_transaction_reply y
236
+    LEFT JOIN tp_transaction t ON y.transaction_id = t.id
237
+    WHERE
238
+    y.ta_user_id = #{id,jdbcType=INTEGER}
226
     <if test="type != null and type != ''">
239
     <if test="type != null and type != ''">
227
-      and type = #{type,jdbcType=INTEGER}
240
+      and  t.type = #{type,jdbcType=INTEGER}
228
     </if>
241
     </if>
229
-    and status = 1
230
-    order by update_date DESC, create_date DESC
242
+    AND y.community_id = #{communityId,jdbcType=INTEGER}
243
+    AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND t.community_id = #{communityId,jdbcType=INTEGER}  )
244
+    GROUP BY
245
+    y.transaction_id) a ON a.transaction_id = t.id
246
+    order by create_date DESC
231
   </select>
247
   </select>
232
 
248
 
233
   <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction" >
249
   <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction" >

+ 2
- 7
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/base/QRCode.java 查看文件

36
      * @throws WriterException
36
      * @throws WriterException
37
      * @throws IOException
37
      * @throws IOException
38
      */
38
      */
39
-    public static InputStream encode(String tpActivityId) throws WriterException, IOException {
40
-        JSONObject json = new JSONObject();
41
-//        json.put(
42
-//                "zxing",
43
-//                "https://github.com/zxing/zxing/tree/zxing-3.0.0/javase/src/main/java/com/google/zxing");
44
-        json.put("activityId", tpActivityId);
39
+    public static InputStream encode(String url, String tpActivityId) throws WriterException, IOException {
45
         // 内容
40
         // 内容
46
-        String content = json.toJSONString();
41
+        String content = url + tpActivityId;
47
         // 图像宽度
42
         // 图像宽度
48
         int width = 200;
43
         int width = 200;
49
         // 图像高度
44
         // 图像高度

+ 26
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/perproties/QRCodePerproties.java 查看文件

1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * version V1.0
11
+ * class_name: $METHOD_NAME$
12
+ * param: $METHOD_PARAM$
13
+ * describe: TODO
14
+ * creat_user:fannaixi
15
+ * creat_time: 2019/4/12
16
+ **/
17
+@Data
18
+@AllArgsConstructor
19
+@NoArgsConstructor
20
+@ConfigurationProperties(prefix = "qr-code")
21
+@Component
22
+public class QRCodePerproties {
23
+
24
+    private String url;
25
+
26
+}

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java 查看文件

11
 import io.swagger.annotations.ApiImplicitParam;
11
 import io.swagger.annotations.ApiImplicitParam;
12
 import io.swagger.annotations.ApiImplicitParams;
12
 import io.swagger.annotations.ApiImplicitParams;
13
 import io.swagger.annotations.ApiOperation;
13
 import io.swagger.annotations.ApiOperation;
14
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
14
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.cloud.context.config.annotation.RefreshScope;
16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
16
 import org.springframework.web.bind.annotation.*;
17
 import org.springframework.web.bind.annotation.*;
17
 
18
 
19
+import javax.servlet.http.HttpServletResponse;
18
 import javax.servlet.http.HttpSession;
20
 import javax.servlet.http.HttpSession;
19
 import java.util.List;
21
 import java.util.List;
20
 
22
 
166
         return responseBean;
168
         return responseBean;
167
     }
169
     }
168
 
170
 
171
+    @ApiOperation(value = "获取活动二维码图片", notes = "获取活动二维码图片")
172
+    @ApiImplicitParams({
173
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "活动id"),
174
+    })
175
+    @RequestMapping(value = "/activity/code/{id}", method = RequestMethod.GET)
176
+    public void getActivityCode(@PathVariable("id") Integer activityId, HttpServletRequest request, HttpServletResponse response,
177
+                                        @RequestParam("filename") String filename, @RequestParam("imgName") String imgName) {
178
+
179
+
180
+
181
+    }
182
+
183
+
184
+
169
 
185
 
170
 }
186
 }

+ 3
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpActivitySignInService.java 查看文件

3
 import com.baomidou.mybatisplus.extension.service.IService;
3
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
 import com.community.huiju.model.TpActivitySignIn;
5
 import com.community.huiju.model.TpActivitySignIn;
6
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
7
+
8
+import javax.servlet.http.HttpServletResponse;
6
 
9
 
7
 /**
10
 /**
8
  * <p>
11
  * <p>

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java 查看文件

11
 import com.community.commom.session.UserElement;
11
 import com.community.commom.session.UserElement;
12
 import com.community.commom.utils.BeanTools;
12
 import com.community.commom.utils.BeanTools;
13
 import com.community.huiju.common.base.QRCode;
13
 import com.community.huiju.common.base.QRCode;
14
+import com.community.huiju.common.perproties.QRCodePerproties;
14
 import com.community.huiju.dao.MessageMapper;
15
 import com.community.huiju.dao.MessageMapper;
15
 import com.community.huiju.dao.TaUserMapper;
16
 import com.community.huiju.dao.TaUserMapper;
16
 import com.community.huiju.dao.TdImagesMapper;
17
 import com.community.huiju.dao.TdImagesMapper;
70
 
71
 
71
     @Autowired
72
     @Autowired
72
     private ImageServiceI imageServiceI;
73
     private ImageServiceI imageServiceI;
74
+
75
+    @Autowired
76
+    private QRCodePerproties qrCodePerproties;
77
+
73
     @Override
78
     @Override
74
     public ResponseBean listQuery(String parameter, UserElement userElement) {
79
     public ResponseBean listQuery(String parameter, UserElement userElement) {
75
         ResponseBean responseBean = new ResponseBean();
80
         ResponseBean responseBean = new ResponseBean();
340
 
345
 
341
         if (radio==1){
346
         if (radio==1){
342
             try {
347
             try {
343
-                InputStream inputStream= QRCode.encode(tpActivity.getId()+"");
348
+                InputStream inputStream= QRCode.encode(qrCodePerproties.getUrl(), tpActivity.getId()+"");
344
                 String codeUrl= imageServiceI.getImageUrl(inputStream);
349
                 String codeUrl= imageServiceI.getImageUrl(inputStream);
345
                 TdImages tdImages= new TdImages();
350
                 TdImages tdImages= new TdImages();
346
                 tdImages.setImageUrl(codeUrl);
351
                 tdImages.setImageUrl(codeUrl);

+ 4
- 0
CODE/smart-community/property-api/src/main/resources/application.yml 查看文件

11
   configuration:
11
   configuration:
12
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
12
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
13
   mapper-locations: classpath:mapper/*.xml
13
   mapper-locations: classpath:mapper/*.xml
14
+
15
+# 二维码生成地址
16
+qr-code:
17
+  url: http://jhhhhh?activeId=

+ 2
- 0
VUECODE/smart-property-manage/package.json 查看文件

14
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
14
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
15
   },
15
   },
16
   "dependencies": {
16
   "dependencies": {
17
+    "add": "^2.0.6",
17
     "axios": "0.18.0",
18
     "axios": "0.18.0",
18
     "element-ui": "2.4.6",
19
     "element-ui": "2.4.6",
19
     "file-saver": "^2.0.0-rc.4",
20
     "file-saver": "^2.0.0-rc.4",
21
+    "html2canvas": "^1.0.0-rc.1",
20
     "jquery": "^2.2.3",
22
     "jquery": "^2.2.3",
21
     "js-cookie": "2.2.0",
23
     "js-cookie": "2.2.0",
22
     "normalize.css": "7.0.0",
24
     "normalize.css": "7.0.0",

+ 22
- 10
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue 查看文件

16
     </div>
16
     </div>
17
       <div style="padding-left:30%;">
17
       <div style="padding-left:30%;">
18
         <div><img :src="ruleForm.activityCode" width="200" height="200" ></div>
18
         <div><img :src="ruleForm.activityCode" width="200" height="200" ></div>
19
-        <div><el-button type="primary" style="float:left;" @click=" downloadCodeImg()">查看签到名单</el-button> </div>
19
+        
20
+        <a :href="ruleForm.activityCode" download="图片">
21
+      <img :src="ruleForm.activityCode" alt="图片">
22
+        </a>
23
+
24
+        <!-- <a download="图片" :href="ruleForm.activityCode + 'admin/miniProgram.jpg'">点击下载</a>
25
+        <div><el-button type="primary" style="float:left;" @click=" downloadCodeImg()">查看签到名单</el-button> </div> -->
20
       </div>
26
       </div>
21
     <div class="progress">
27
     <div class="progress">
22
       <div class="text-progress">
28
       <div class="text-progress">
26
       </div>
32
       </div>
27
       <div class="circular"/>
33
       <div class="circular"/>
28
       <div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
34
       <div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
29
-      <el-button type="primary" style="float: left;" @click="lockSignUp">查看报名名单</el-button>
35
+      <a type="primary" style="float: left;" @click="lockSignUp">查看报名名单</a>
30
     </div>
36
     </div>
31
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
37
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
32
     <div class="bom-button">
38
     <div class="bom-button">
103
       this.$router.push({ name: 'activity-signIn-index', query: { id: this.ruleForm.id }})
109
       this.$router.push({ name: 'activity-signIn-index', query: { id: this.ruleForm.id }})
104
     },
110
     },
105
     // 下载图片
111
     // 下载图片
106
-     downloadCodeImg(){
107
-      console.log('下载图片')
108
-      var a = document.createElement('a')
109
-      a.download = this.ruleForm.activityCode
110
-       // 设置图片地址
111
-      a.href = this.ruleForm.activityCode
112
-      a.click();
113
-            }
112
+//      downloadCodeImg(){
113
+//       var a = document.createElement('a')
114
+//       a.download = this.ruleForm.activityCode
115
+//        // 设置图片地址
116
+//       a.href = this.ruleForm.activityCode
117
+//       a.click();
118
+//     }
119
+   downloadCodeImg(){
120
+  var alink = document.createElement("a");
121
+  alink.href = this.ruleForm.activityCode;
122
+  alink.download = "pic"; //图片名
123
+  alink.click();
124
+  }
125
+  
114
 }
126
 }
115
   }
127
   }
116
 </script>
128
 </script>