Kaynağa Gözat

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

魏熙美 6 yıl önce
ebeveyn
işleme
9aaec6c1a0

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Dosyayı Görüntüle

@@ -299,7 +299,7 @@ public class SocialController extends BaseController {
299 299
 
300 300
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
301 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 303
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题"),
304 304
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
305 305
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")}
@@ -369,7 +369,7 @@ public class SocialController extends BaseController {
369 369
         ResponseBean responseBean = new ResponseBean();
370 370
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
371 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 373
         return response;
374 374
     }
375 375
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java Dosyayı Görüntüle

@@ -23,7 +23,7 @@ public interface TpTransactionMapper {
23 23
 
24 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 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 Dosyayı Görüntüle

@@ -116,7 +116,7 @@ public interface SocialServiceI {
116 116
 	 * @param userId
117 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 Dosyayı Görüntüle

@@ -406,10 +406,9 @@ public class SocialServiceImpl implements SocialServiceI {
406 406
         }
407 407
     }
408 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 410
         ResponseBean responseBean = new ResponseBean();
411 411
         TaUser user=taUserMapper.selectByPrimaryKey(userId);
412
-         Integer communityId=user.getCommunityId();
413 412
 
414 413
         //判断身份是否为业主且状态为已停用
415 414
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
@@ -605,8 +604,10 @@ public class SocialServiceImpl implements SocialServiceI {
605 604
         ResponseBean response= new ResponseBean();
606 605
         JSONObject object= JSONObject.parseObject(paramets);
607 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 611
         TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
611 612
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
612 613
         tpTransactionReply.setTaUserId(userElement.getId());
@@ -622,14 +623,16 @@ public class SocialServiceImpl implements SocialServiceI {
622 623
         tpTransactionReply.setCreateDate(new Date());
623 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 637
         response.addSuccess("成功");
635 638
         return response;

+ 23
- 7
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Dosyayı Görüntüle

@@ -218,16 +218,32 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
218 218
   </select>
219 219
 
220 220
   <select id="selectTransaction" resultMap="BaseResultMap">
221
-    select
221
+    SELECT
222 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 239
     <if test="type != null and type != ''">
227
-      and type = #{type,jdbcType=INTEGER}
240
+      and  t.type = #{type,jdbcType=INTEGER}
228 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 247
   </select>
232 248
 
233 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 Dosyayı Görüntüle

@@ -36,14 +36,9 @@ public class QRCode {
36 36
      * @throws WriterException
37 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 43
         int width = 200;
49 44
         // 图像高度

+ 26
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/perproties/QRCodePerproties.java Dosyayı Görüntüle

@@ -0,0 +1,26 @@
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 Dosyayı Görüntüle

@@ -11,10 +11,12 @@ import io.swagger.annotations.Api;
11 11
 import io.swagger.annotations.ApiImplicitParam;
12 12
 import io.swagger.annotations.ApiImplicitParams;
13 13
 import io.swagger.annotations.ApiOperation;
14
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
14 15
 import org.springframework.beans.factory.annotation.Autowired;
15 16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
16 17
 import org.springframework.web.bind.annotation.*;
17 18
 
19
+import javax.servlet.http.HttpServletResponse;
18 20
 import javax.servlet.http.HttpSession;
19 21
 import java.util.List;
20 22
 
@@ -166,5 +168,19 @@ public class ActivityController extends BaseController {
166 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 Dosyayı Görüntüle

@@ -3,6 +3,9 @@ package com.community.huiju.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.community.commom.mode.ResponseBean;
5 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 11
  * <p>

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java Dosyayı Görüntüle

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

+ 4
- 0
CODE/smart-community/property-api/src/main/resources/application.yml Dosyayı Görüntüle

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

+ 2
- 0
VUECODE/smart-property-manage/package.json Dosyayı Görüntüle

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

+ 22
- 10
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue Dosyayı Görüntüle

@@ -16,7 +16,13 @@
16 16
     </div>
17 17
       <div style="padding-left:30%;">
18 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 26
       </div>
21 27
     <div class="progress">
22 28
       <div class="text-progress">
@@ -26,7 +32,7 @@
26 32
       </div>
27 33
       <div class="circular"/>
28 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 36
     </div>
31 37
     <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
32 38
     <div class="bom-button">
@@ -103,14 +109,20 @@ export default {
103 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 128
 </script>