dingxin 6 years ago
parent
commit
3470cae184
36 changed files with 2580 additions and 729 deletions
  1. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java
  2. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java
  3. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  4. 95
    3
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java
  5. 46
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ImageController.java
  6. 67
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java
  7. 18
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TdImagesMapper.java
  8. 21
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  9. 58
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TdImages.java
  10. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpActivity.java
  11. 95
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java
  12. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITdImagesService.java
  13. 35
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpActivityService.java
  14. 19
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java
  15. 15
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ImageServiceI.java
  16. 43
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/ImageServiceimpl.java
  17. 20
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TdTdImagesServiceImpl.java
  18. 190
    6
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  19. 47
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java
  20. 20
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/vo/ActivityVO.java
  21. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TdImagesMapper.xml
  22. 35
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml
  23. 72
    0
      VUECODE/smart-property-manage/src/api/activity.js
  24. 9
    0
      VUECODE/smart-property-manage/src/api/transaction.js
  25. 21
    0
      VUECODE/smart-property-manage/src/router/index.js
  26. 5
    1
      VUECODE/smart-property-manage/src/store/index.js
  27. 58
    0
      VUECODE/smart-property-manage/src/store/modules/activity.js
  28. 36
    0
      VUECODE/smart-property-manage/src/store/modules/transaction.js
  29. 206
    0
      VUECODE/smart-property-manage/src/views/social/activity/add/index.vue
  30. 210
    0
      VUECODE/smart-property-manage/src/views/social/activity/edi/index.vue
  31. 138
    52
      VUECODE/smart-property-manage/src/views/social/activity/index.vue
  32. 13
    0
      VUECODE/smart-property-manage/src/views/social/activity/info/index.vue
  33. 266
    7
      VUECODE/smart-property-manage/src/views/social/transaction/index.vue
  34. 376
    352
      文档/MYSQL/smartCommunity.pdb
  35. 316
    304
      文档/MYSQL/smartCommunity.pdm
  36. BIN
      文档/计划/V181228/智慧社区V181228计划.mpp

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java View File

@@ -495,7 +495,7 @@ public class HKOpenApi {
495 495
      *  * personName 卡号
496 496
      * @return
497 497
      */
498
-    public static String HKpersonGroupId(MultipartFile faceImg,Integer personId,Integer personNo,String personName,String cardNo) {
498
+    public static String HKpersonGroupId(MultipartFile faceImg,Integer personId,Long personNo,String personName,String cardNo) {
499 499
         byte [] fileByte = new byte[0];
500 500
         try {
501 501
             fileByte = faceImg.getBytes();

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

@@ -128,7 +128,7 @@ public class FaceServicelimpl implements FaceServiceI {
128 128
                 Integer faceNum = (Integer) jsonObject.get("face_num");
129 129
 
130 130
              /*推送海康*/
131
-            String data=HKOpenApi.HKpersonGroupId(uploadFile, user.getHkUserId(), user.getId(), user.getUserName(), user.getHkCardNo());
131
+            String data=HKOpenApi.HKpersonGroupId(uploadFile, user.getHkUserId(), user.getHkPersonNo(), user.getUserName(), user.getHkCardNo());
132 132
 
133 133
               /*boolean isA为true进行添加,为false进行修改*/
134 134
             if (0 == type && 1 == faceNum) {

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

@@ -477,6 +477,7 @@ public class TaUserServiceImpl implements ITaUserService {
477 477
         }
478 478
 
479 479
         TaUser user = new TaUser();
480
+        user.setHkPersonNo(idGen.nextId());
480 481
         user.setUserName(userName);
481 482
         user.setLoginName(phone);
482 483
         user.setGender(gender);
@@ -597,7 +598,7 @@ public class TaUserServiceImpl implements ITaUserService {
597 598
 
598 599
         // 添加人员
599 600
         Map<String,Object> parUser = Maps.newHashMap();
600
-        parUser.put("personNo",user.getHkPersonNo());
601
+        parUser.put("personNo", user.getHkPersonNo());
601 602
         parUser.put("personName",user.getUserName());
602 603
         parUser.put("phoneNo",user.getLoginName());
603 604
         parUser.put("deptUuid",deptUuid);

+ 95
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java View File

@@ -1,9 +1,20 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
4 6
 import com.community.huiju.common.base.BaseController;
5
-import org.springframework.web.bind.annotation.RequestMapping;
6
-import org.springframework.web.bind.annotation.RestController;
7
+import com.community.huiju.service.ITpActivityService;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.cloud.context.config.annotation.RefreshScope;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import javax.servlet.http.HttpSession;
17
+import java.util.List;
7 18
 
8 19
 /**
9 20
  * <p>
@@ -14,7 +25,88 @@ import org.springframework.web.bind.annotation.RestController;
14 25
  * @since 2018-12-28
15 26
  */
16 27
 @RestController
17
-@RequestMapping("/tp/activity")
28
+@RefreshScope
29
+@RequestMapping("/")
30
+@Api(value = "活动 Api", description = "活动 Api")
18 31
 public class ActivityController extends BaseController {
19 32
 
33
+    @Autowired
34
+    private ITpActivityService iTpActivityService;
35
+
36
+    @ApiOperation(value = "查询活动列表数据", notes = "根据条件查询活动列表")
37
+    @ApiImplicitParams({
38
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
39
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
40
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "pageNum第几页;" +
41
+                    "pageSize一页多少行;activityTitle活动标题;id活动编号")
42
+    })
43
+    @RequestMapping(value = "/activity/list", method = RequestMethod.POST)
44
+    public ResponseBean listQuery(@RequestBody String parameter, HttpSession session){
45
+        ResponseBean responseBean = new ResponseBean();
46
+        UserElement userElement = getUserElement(session);
47
+        responseBean = iTpActivityService.listQuery(parameter, userElement);
48
+        return responseBean;
49
+    }
50
+
51
+    @ApiOperation(value = "添加活动", notes = "添加活动")
52
+    @ApiImplicitParams({
53
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
54
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
55
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "activityTitle活动标题;" +
56
+                    "activityCarouselImg轮播图;activityContent活动详情;contentImg活动内容配图;signUpMax活动人数上限;" +
57
+                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿")
58
+    })
59
+    @RequestMapping(value = "/activity/add", method = RequestMethod.POST)
60
+    public ResponseBean addActivity(@RequestBody String parameter, HttpSession session) {
61
+        ResponseBean responseBean = new ResponseBean();
62
+        UserElement userElement = getUserElement(session);
63
+        responseBean = iTpActivityService.addActivity(parameter, userElement);
64
+        return responseBean;
65
+    }
66
+
67
+    @ApiOperation(value = "修改活动", notes = "修改活动")
68
+    @ApiImplicitParams({
69
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
70
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
71
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "id活动编号;activityTitle活动标题;" +
72
+                    "activityCarouselImg轮播图;activityContent活动详情;contentImg活动内容配图;signUpMax活动人数上限;" +
73
+                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿")
74
+    })
75
+    @RequestMapping(value = "/activity/update", method = RequestMethod.PUT)
76
+    public ResponseBean updateActivity(@RequestBody String parameter, HttpSession session) {
77
+        ResponseBean responseBean = new ResponseBean();
78
+        UserElement userElement = getUserElement(session);
79
+        responseBean = iTpActivityService.updateActivity(parameter, userElement);
80
+        return responseBean;
81
+    }
82
+
83
+    @ApiOperation(value = "活动作废", notes = "活动作废")
84
+    @ApiImplicitParams({
85
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
86
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
87
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "ids", value = "活动id集合")
88
+    })
89
+    @RequestMapping(value = "/activity/invalid", method = RequestMethod.PUT)
90
+    public ResponseBean invalidActivity(@RequestBody List<Integer> ids, HttpSession session){
91
+        ResponseBean responseBean = new ResponseBean();
92
+        UserElement userElement = getUserElement(session);
93
+        responseBean = iTpActivityService.updateStatusInvalid(ids, userElement);
94
+        return responseBean;
95
+    }
96
+
97
+
98
+    @ApiOperation(value = "活动详情", notes = "活动详情")
99
+    @ApiImplicitParams({
100
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
101
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
102
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "活动id")
103
+    })
104
+    @RequestMapping(value = "/activity/{id}", method = RequestMethod.GET)
105
+    public ResponseBean invalidActivity(@PathVariable(value = "id") Integer id, HttpSession session){
106
+        ResponseBean responseBean = new ResponseBean();
107
+        UserElement userElement = getUserElement(session);
108
+        responseBean = iTpActivityService.getById(id);
109
+        return responseBean;
110
+    }
111
+
20 112
 }

+ 46
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ImageController.java View File

@@ -0,0 +1,46 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.service.ImageServiceI;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiOperation;
8
+import io.swagger.annotations.ApiParam;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.cloud.context.config.annotation.RefreshScope;
11
+import org.springframework.web.bind.annotation.PostMapping;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import org.springframework.web.multipart.MultipartFile;
15
+
16
+import java.util.ArrayList;
17
+import java.util.List;
18
+
19
+/**
20
+ * @author weichaochao
21
+ * @Title: ImageController
22
+ * @Description: 图片上传以及获取url
23
+ * @date 2018/10/31
24
+ */
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "图片操作API", description = "图片操作API")
29
+public class ImageController extends BaseController {
30
+
31
+    @Autowired
32
+    private ImageServiceI imageService;
33
+
34
+    @ApiOperation(value = "图片上传以及获取url", notes = "图片上传以及获取url")
35
+    @PostMapping(value = "/uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-data")
36
+    public ResponseBean uploadImgAndGetUrl(@ApiParam(value = "uploadFiles" ,required = true) MultipartFile[] uploadFiles) throws Exception {
37
+        ResponseBean responseBean = new ResponseBean();
38
+        List<String> urls = new ArrayList<String>();
39
+        for (MultipartFile uploadFile : uploadFiles){
40
+            String url = imageService.getImageUrl(uploadFile);
41
+            urls.add(url);
42
+        }
43
+        responseBean.addSuccess(urls);
44
+        return responseBean;
45
+    }
46
+}

+ 67
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java View File

@@ -0,0 +1,67 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.common.base.BaseController;
7
+import com.community.huiju.model.TpTransaction;
8
+import com.community.huiju.service.ITransactionService;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.cloud.context.config.annotation.RefreshScope;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+import javax.servlet.http.HttpSession;
22
+
23
+/**
24
+ * <p>
25
+ * 物业web端二手交易表 前端控制器
26
+ * </p>
27
+ *
28
+ * @author jobob
29
+ * @since 2018-12-29
30
+ */
31
+@RestController
32
+@RefreshScope
33
+@RequestMapping("/")
34
+@Api(value = "二手租赁相关信息", description = "二手租赁相关信息Api")
35
+public class TransactionController extends BaseController {
36
+	
37
+	@Autowired
38
+	private ITransactionService transactionService;
39
+	
40
+	@ApiOperation(value = "根据搜索条件获取二手租赁列表", notes = "根据搜索条件获取二手租赁列表")
41
+	@ApiImplicitParams({
42
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "transactionId", value = "帖子编号"),
43
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题(模糊查询)"),
44
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "status", value = "发布状态"),
45
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "isReported", value = "是否被举报"),
46
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
47
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
48
+	})
49
+	@RequestMapping(value = "/transactions",method = RequestMethod.GET)
50
+	public ResponseBean getList(@RequestParam(value = "transactionId", required = false) Integer transactionId,
51
+	                            @RequestParam(value = "transactionTitle", required = false) String transactionTitle,
52
+	                            @RequestParam(value = "status", required = false) String status,
53
+	                            @RequestParam(value = "isReported", required = false) String isReported,
54
+	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
+	                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize, HttpSession session){
56
+		ResponseBean responseBean = new ResponseBean();
57
+		UserElement userElement = getUserElement(session);
58
+		TpTransaction tpTransaction = new TpTransaction();
59
+		tpTransaction.setId(transactionId);
60
+		tpTransaction.setTransactionTitle(transactionTitle);
61
+		tpTransaction.setStatus(status);
62
+		tpTransaction.setIsReported(isReported);
63
+		tpTransaction.setCommunityId(userElement.getCommunityId());
64
+		responseBean = transactionService.getTransactionList(tpTransaction,pageNum,pageSize);
65
+		return responseBean;
66
+	}
67
+}

+ 18
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TdImagesMapper.java View File

@@ -0,0 +1,18 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TdImages;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 图片表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author weiximei
13
+ * @since 2018-12-29
14
+ */
15
+@Mapper
16
+public interface TdImagesMapper extends BaseMapper<TdImages> {
17
+
18
+}

+ 21
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java View File

@@ -0,0 +1,21 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.community.huiju.model.TpTransaction;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * <p>
12
+ * 物业web端二手交易表 Mapper 接口
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2018-12-29
17
+ */
18
+public interface TpTransactionMapper extends BaseMapper<TpTransaction> {
19
+	
20
+	List<TpTransaction> selectListByParams(IPage page,@Param("tpTransaction") TpTransaction tpTransaction);
21
+}

+ 58
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TdImages.java View File

@@ -0,0 +1,58 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+
13
+/**
14
+ * <p>
15
+ * 图片表
16
+ * </p>
17
+ *
18
+ * @author weiximei
19
+ * @since 2018-12-29
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@TableName("td_images")
25
+public class TdImages implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+
32
+    /**
33
+     * 图片路径
34
+     */
35
+    private String imageUrl;
36
+
37
+    /**
38
+     * 图片关联的内容的id  根据类型来判断
39
+     */
40
+    private Integer uuid;
41
+
42
+    /**
43
+     *  服务:service, 公告:announcement , 活动:activity  租赁 : transaction可添加
44
+     */
45
+    private String type;
46
+
47
+    /**
48
+     * 创建人
49
+     */
50
+    private Integer createUser;
51
+
52
+    /**
53
+     * 创建时间
54
+     */
55
+    private LocalDateTime createTime;
56
+
57
+
58
+}

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpActivity.java View File

@@ -1,5 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -24,6 +26,9 @@ public class TpActivity implements Serializable {
24 26
 
25 27
     private static final long serialVersionUID = 1L;
26 28
 
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+
27 32
     /**
28 33
      * 小区id
29 34
      */

+ 95
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java View File

@@ -0,0 +1,95 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 物业web端二手交易表
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2018-12-29
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@TableName("tp_transaction")
23
+public class TpTransaction implements Serializable {
24
+
25
+    private static final long serialVersionUID = 1L;
26
+    
27
+    private Integer id;
28
+    
29
+    /**
30
+     * 小区id
31
+     */
32
+    private Integer communityId;
33
+
34
+    /**
35
+     * 住户app的用户id
36
+     */
37
+    private Integer taUserId;
38
+
39
+    /**
40
+     * 交易标题
41
+     */
42
+    private String transactionTitle;
43
+
44
+    /**
45
+     * 交易内容
46
+     */
47
+    private String transactionContent;
48
+
49
+    /**
50
+     * 查看人数
51
+     */
52
+    private Integer viewCount;
53
+
54
+    /**
55
+     * 0 是已作废 1 是已发布   
56
+     */
57
+    private String status;
58
+
59
+    /**
60
+     * 0 代表 二手(卖二手物品)  1 是代表 求购 (买二手物品) 2 是代表 租赁(租二手物品)
61
+     */
62
+    private String type;
63
+
64
+    /**
65
+     * 是否被举报 1是被举报 0或null是没被举报
66
+     */
67
+    private String isReported;
68
+
69
+    /**
70
+     * 创建人
71
+     */
72
+    private Integer createUser;
73
+
74
+    /**
75
+     * 创建时间
76
+     */
77
+    private LocalDateTime createDate;
78
+
79
+    /**
80
+     * 更新人
81
+     */
82
+    private Integer updateUser;
83
+
84
+    /**
85
+     * 更新时间
86
+     */
87
+    private LocalDateTime updateDate;
88
+    
89
+    /**
90
+     * 创建人
91
+     */
92
+    private String userName;
93
+
94
+
95
+}

+ 16
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITdImagesService.java View File

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TdImages;
5
+
6
+/**
7
+ * <p>
8
+ * 图片表 服务类
9
+ * </p>
10
+ *
11
+ * @author weiximei
12
+ * @since 2018-12-29
13
+ */
14
+public interface ITdImagesService extends IService<TdImages> {
15
+
16
+}

+ 35
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpActivityService.java View File

@@ -1,6 +1,8 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
4 6
 import com.community.huiju.model.TpActivity;
5 7
 
6 8
 import java.util.List;
@@ -18,8 +20,40 @@ public interface ITpActivityService extends IService<TpActivity> {
18 20
     /**
19 21
      * 根据条件查询 活动列表
20 22
      * @param parameter
23
+     * @param userElement 用户登录信息体
21 24
      * @return
22 25
      */
23
-    List<TpActivity> listQuery(String parameter);
26
+    ResponseBean listQuery(String parameter, UserElement userElement);
27
+
28
+    /**
29
+     * 添加活动列表
30
+     * @param parameter
31
+     * @param userElement
32
+     * @return
33
+     */
34
+    ResponseBean addActivity(String parameter, UserElement userElement);
35
+
36
+    /**
37
+     * 修改 活动
38
+     * @param parameter
39
+     * @param userElement
40
+     * @return
41
+     */
42
+    ResponseBean updateActivity(String parameter, UserElement userElement);
43
+
44
+    /**
45
+     * 根据 活动Id 查询
46
+     * @param id
47
+     * @return
48
+     */
49
+    ResponseBean getById(Integer id);
50
+
51
+    /**
52
+     * 批量活动 作废
53
+     * @param ids
54
+     * @param userElement 用户session信息体
55
+     * @return
56
+     */
57
+    ResponseBean updateStatusInvalid(List<Integer> ids, UserElement userElement);
24 58
 
25 59
 }

+ 19
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java View File

@@ -0,0 +1,19 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TpTransaction;
7
+
8
+/**
9
+ * <p>
10
+ * 物业web端二手交易表 服务类
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2018-12-29
15
+ */
16
+public interface ITransactionService extends IService<TpTransaction> {
17
+	
18
+	ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize);
19
+}

+ 15
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ImageServiceI.java View File

@@ -0,0 +1,15 @@
1
+package com.community.huiju.service;
2
+
3
+import org.springframework.web.multipart.MultipartFile;
4
+
5
+import java.io.IOException;
6
+
7
+/**
8
+ * @author admin
9
+ * @Title: ImageServiceI
10
+ * @Description: TODO
11
+ * @date 2018/11/5
12
+ */
13
+public interface ImageServiceI {
14
+    String getImageUrl(MultipartFile uploadFile) throws IOException;
15
+}

+ 43
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/ImageServiceimpl.java View File

@@ -0,0 +1,43 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.aliyun.oss.OSSClient;
4
+import com.community.huiju.service.ImageServiceI;
5
+import org.springframework.stereotype.Service;
6
+import org.springframework.web.multipart.MultipartFile;
7
+
8
+import java.io.ByteArrayInputStream;
9
+import java.io.IOException;
10
+import java.util.Date;
11
+
12
+/**
13
+ * @author weichaochao
14
+ * @Title: ImageServiceimpl
15
+ * @Description: 获取图片地址实现类
16
+ * @date 2018/11/5
17
+ */
18
+@Service("ImageService")
19
+public class ImageServiceimpl implements ImageServiceI {
20
+
21
+    private static String endpoint = "http://oss-cn-shanghai.aliyuncs.com";
22
+    private static String accessKeyId = "LTAIkc75dpkJw8Lb";
23
+    private static String accessKeySecret = "v4bvXCaix6vSDTCFfwSAdqV53iFEQw";
24
+    private static String bucketName = "jingcheng-h5temp";
25
+
26
+    @Override
27
+    public String getImageUrl(MultipartFile uploadFile) throws IOException {
28
+
29
+        String imgName = System.currentTimeMillis() + ".png";
30
+        // 创建OSSClient实例
31
+        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
32
+        // 上传
33
+        long time = System.currentTimeMillis();
34
+
35
+        ossClient.putObject(bucketName, imgName, new ByteArrayInputStream(uploadFile.getBytes()));
36
+
37
+        // 关闭client
38
+        ossClient.shutdown();
39
+        Date expiration = new Date(time + 3600 * 1000 * 24 * 365 * 10);
40
+        String url = ossClient.generatePresignedUrl(bucketName, imgName, expiration).toString();
41
+        return url;
42
+    }
43
+}

+ 20
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TdTdImagesServiceImpl.java View File

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.dao.TdImagesMapper;
5
+import com.community.huiju.model.TdImages;
6
+import com.community.huiju.service.ITdImagesService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 图片表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author weiximei
15
+ * @since 2018-12-29
16
+ */
17
+@Service
18
+public class TdTdImagesServiceImpl extends ServiceImpl<TdImagesMapper, TdImages> implements ITdImagesService {
19
+
20
+}

+ 190
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java View File

@@ -2,15 +2,31 @@ package com.community.huiju.service.impl;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
5 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import com.community.commom.mode.ResponseBean;
9
+import com.community.commom.session.UserElement;
10
+import com.community.commom.utils.BeanTools;
11
+import com.community.huiju.dao.TdImagesMapper;
7 12
 import com.community.huiju.dao.TpActivityMapper;
13
+import com.community.huiju.exception.WisdomException;
14
+import com.community.huiju.model.TdImages;
8 15
 import com.community.huiju.model.TpActivity;
16
+import com.community.huiju.model.User;
17
+import com.community.huiju.service.ITdImagesService;
9 18
 import com.community.huiju.service.ITpActivityService;
19
+import com.community.huiju.service.IUserService;
20
+import com.community.huiju.vo.ActivityVO;
21
+import com.google.common.collect.Maps;
22
+import org.springframework.beans.BeanUtils;
10 23
 import org.springframework.beans.factory.annotation.Autowired;
11 24
 import org.springframework.stereotype.Service;
12 25
 
26
+import java.time.LocalDateTime;
13 27
 import java.util.List;
28
+import java.util.Map;
29
+import java.util.stream.Collectors;
14 30
 
15 31
 /**
16 32
  * <p>
@@ -26,17 +42,185 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
26 42
     @Autowired
27 43
     private TpActivityMapper tpActivityMapper;
28 44
 
45
+    @Autowired
46
+    private TdImagesMapper tdImagesMapper;
47
+
48
+    @Autowired
49
+    private ITdImagesService iTdImagesService;
50
+
51
+    // 物业用户
52
+    @Autowired
53
+    private IUserService iUserService;
54
+
29 55
     @Override
30
-    public List<TpActivity> listQuery(String parameter) {
56
+    public ResponseBean listQuery(String parameter, UserElement userElement) {
57
+        ResponseBean responseBean = new ResponseBean();
31 58
 
32 59
         JSONObject jsonObject = JSONObject.parseObject(parameter);
33
-        TpActivity tpActivity = jsonObject.toJavaObject(TpActivity.class);
34
-        Integer pageNum = jsonObject.getInteger("pageNum");
35
-        Integer pageSize = jsonObject.getInteger("pageSize");
60
+        // TpActivity tpActivity = jsonObject.toJavaObject(TpActivity.class);
61
+        String id = jsonObject.getString("id");
62
+        String activityTitle = jsonObject.getString("activityTitle");
63
+        Long pageNum = jsonObject.getLong("pageNum") == null ? 1 : jsonObject.getLong("pageNum");
64
+        Long pageSize = jsonObject.getLong("pageSize") == null ? 10 : jsonObject.getLong("pageSize");
36 65
 
37
-        QueryWrapper<TpActivity> queryWrapper = new QueryWrapper<>();
38 66
         Page<TpActivity> page = new Page<>();
67
+        page.setCurrent(pageNum);
68
+        page.setSize(pageSize);
69
+
70
+        QueryWrapper<TpActivity> queryWrapper = new QueryWrapper<>();
71
+        queryWrapper.like(id != null && !"".equals(id),"id", id);
72
+        queryWrapper.like(activityTitle != null && !"".equals(activityTitle),"activity_title", activityTitle);
73
+        queryWrapper.eq("community_id", userElement.getCommunityId());
74
+        queryWrapper.orderByDesc("sort","create_date");
75
+
76
+        IPage<TpActivity> infoPage = tpActivityMapper.selectPage(page, queryWrapper);
77
+        List<TpActivity> activityList = infoPage.getRecords();
78
+        List<ActivityVO> activityVOList = activityList.stream().map(activity-> {
79
+            ActivityVO activityVO = new ActivityVO();
80
+            BeanUtils.copyProperties(activity, activityVO);
81
+            User createUser = iUserService.getById(activity.getCreateUser());
82
+            User updateUser = iUserService.getById(activity.getUpdateUser());
83
+            activityVO.setCrateUserName(createUser.getUserName());
84
+            activityVO.setUpdateUserName(updateUser.getUserName());
85
+            return activityVO;
86
+        }).collect(Collectors.toList());
87
+
88
+        Map<String, Object> map = Maps.newHashMap();
89
+        map.put("list", activityVOList);
90
+        map.put("total", infoPage.getTotal());
91
+        map.put("pageNum", infoPage.getCurrent());
92
+        map.put("pageSize", infoPage.getSize());
93
+
94
+        responseBean.addSuccess(map);
95
+
96
+        return responseBean;
97
+    }
98
+
99
+    @Override
100
+    public ResponseBean addActivity(String parameter, UserElement userElement) {
101
+
102
+        ResponseBean responseBean = new ResponseBean();
103
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
104
+        // 活动配图
105
+        String [] contentImgArray = (String[]) jsonObject.get("contentImg");
106
+        TpActivity tpActivity = jsonObject.toJavaObject(TpActivity.class);
107
+        tpActivity.setCommunityId(userElement.getCommunityId());
108
+        tpActivity.setUpdateDate(LocalDateTime.now());
109
+        tpActivity.setUpdateUser(userElement.getId());
110
+        tpActivity.setCreateDate(LocalDateTime.now());
111
+        tpActivity.setCreateUser(userElement.getId());
112
+
113
+        int row = tpActivityMapper.insert(tpActivity);
114
+
115
+        // 插入图片
116
+        insertImg(contentImgArray, userElement, tpActivity);
117
+
118
+        if (row <= 0) {
119
+            throw new WisdomException("操作失败!");
120
+        } else {
121
+            responseBean.addSuccess("操作成功!");
122
+        }
123
+
124
+        return responseBean;
125
+    }
126
+
127
+    /**
128
+     * 插入图片
129
+     * @param contentImgArray
130
+     * @param userElement
131
+     * @param tpActivity
132
+     */
133
+    private void insertImg(String [] contentImgArray, UserElement userElement, TpActivity tpActivity) {
134
+        if (contentImgArray == null) {
135
+            return;
136
+        }
137
+        for (String img : contentImgArray) {
138
+            TdImages tdImages = new TdImages();
139
+            tdImages.setCreateTime(LocalDateTime.now());
140
+            tdImages.setCreateUser(userElement.getId());
141
+            tdImages.setImageUrl(img);
142
+            tdImages.setType("activity");
143
+            tdImages.setUuid(tpActivity.getId());
144
+
145
+            tdImagesMapper.insert(tdImages);
146
+        }
147
+    }
148
+
149
+    @Override
150
+    public ResponseBean updateActivity(String parameter, UserElement userElement) {
151
+        ResponseBean responseBean = new ResponseBean();
152
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
153
+
154
+        // 活动配图
155
+        String [] contentImgArray = (String[]) jsonObject.get("contentImg");
156
+        TpActivity tpActivity = jsonObject.toJavaObject(TpActivity.class);
157
+
158
+        TpActivity selectTpActivity = tpActivityMapper.selectById(tpActivity.getId());
159
+        if (null == selectTpActivity) {
160
+            responseBean.addError("活动不存在!");
161
+            return responseBean;
162
+        }
163
+
164
+        BeanTools.copyProperties(tpActivity, selectTpActivity);
165
+
166
+        selectTpActivity.setUpdateDate(LocalDateTime.now());
167
+        selectTpActivity.setUpdateUser(userElement.getId());
168
+
169
+        int row = tpActivityMapper.updateById(selectTpActivity);
170
+
171
+        // 先将原图删除!
172
+        if (contentImgArray.length > 0) {
173
+            QueryWrapper<TdImages> queryWrapper = new QueryWrapper<>();
174
+            queryWrapper.eq("uuid", tpActivity.getId());
175
+            queryWrapper.eq("type", "activity");
176
+            tdImagesMapper.delete(queryWrapper);
177
+        }
178
+
179
+        // 插入图片
180
+        insertImg(contentImgArray, userElement, tpActivity);
181
+
182
+        if (row <= 0) {
183
+            throw new WisdomException("操作失败!");
184
+        } else {
185
+            responseBean.addSuccess("操作成功!");
186
+        }
187
+
188
+        return responseBean;
189
+    }
190
+
191
+    @Override
192
+    public ResponseBean getById(Integer id) {
193
+        ResponseBean responseBean = new ResponseBean();
194
+
195
+        TpActivity tpActivity = tpActivityMapper.selectById(id);
196
+
197
+        QueryWrapper<TdImages> queryWrapper = new QueryWrapper<>();
198
+        queryWrapper.eq("uuid", tpActivity.getId());
199
+        queryWrapper.eq("type", "activity");
200
+        List<TdImages> imagesList = tdImagesMapper.selectList(queryWrapper);
201
+
202
+        Map<String, Object> map = Maps.newHashMap();
203
+        map.put("info", tpActivity);
204
+        map.put("contentImg", imagesList);
205
+
206
+        responseBean.addSuccess(map);
207
+
208
+        return responseBean;
209
+    }
210
+
211
+    @Override
212
+    public ResponseBean updateStatusInvalid(List<Integer> ids, UserElement userElement) {
213
+
214
+        ResponseBean responseBean = new ResponseBean();
215
+        List<TpActivity> tpActivityList = (List<TpActivity>) listByIds(ids);
216
+        tpActivityList.stream().forEach(e-> {
217
+            e.setStatus("0");
218
+            e.setUpdateUser(userElement.getId());
219
+        });
220
+        updateBatchById(tpActivityList);
221
+
222
+        responseBean.addSuccess("操作成功!");
39 223
 
40
-        return null;
224
+        return responseBean;
41 225
     }
42 226
 }

+ 47
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java View File

@@ -0,0 +1,47 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import com.community.commom.mode.ResponseBean;
9
+import com.community.commom.session.UserElement;
10
+import com.community.huiju.dao.TpTransactionMapper;
11
+import com.community.huiju.model.TpBuildingOwnerInfo;
12
+import com.community.huiju.model.TpTransaction;
13
+import com.community.huiju.service.ITransactionService;
14
+import com.google.common.collect.Maps;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.stereotype.Service;
17
+
18
+import java.util.List;
19
+import java.util.Map;
20
+
21
+/**
22
+ * <p>
23
+ * 物业web端二手交易表 服务实现类
24
+ * </p>
25
+ *
26
+ * @author jobob
27
+ * @since 2018-12-29
28
+ */
29
+@Service
30
+public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpTransaction> implements ITransactionService {
31
+	
32
+	@Autowired
33
+	private TpTransactionMapper tpTransactionMapper;
34
+	
35
+	@Override
36
+	public ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize) {
37
+		ResponseBean responseBean = new ResponseBean();
38
+		Page page = new Page(pageNum,pageSize);
39
+		// 分页查询
40
+		List<TpTransaction> list = tpTransactionMapper.selectListByParams(page,tpTransaction);
41
+		Map<String, Object> map = Maps.newHashMap();
42
+		map.put("list",list);
43
+		map.put("total",page.getTotal());
44
+		responseBean.addSuccess(map);
45
+		return responseBean;
46
+	}
47
+}

+ 20
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/vo/ActivityVO.java View File

@@ -0,0 +1,20 @@
1
+package com.community.huiju.vo;
2
+
3
+import com.community.huiju.model.TpActivity;
4
+import lombok.Data;
5
+
6
+@Data
7
+public class ActivityVO extends TpActivity {
8
+
9
+    /**
10
+     * 创建人
11
+     */
12
+    private String crateUserName;
13
+
14
+    /**
15
+     * 更新人
16
+     */
17
+    private String updateUserName;
18
+
19
+
20
+}

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TdImagesMapper.xml View File

@@ -0,0 +1,5 @@
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.TdImagesMapper">
4
+
5
+</mapper>

+ 35
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml View File

@@ -0,0 +1,35 @@
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.TpTransactionMapper">
4
+    <select id="selectListByParams" resultType="com.community.huiju.model.TpTransaction">
5
+        SELECT
6
+            t.id,
7
+            t.community_id AS communityId,
8
+            t.transaction_title AS transactionTitle,
9
+            t.view_count AS viewCount,
10
+            t.`status`,
11
+            t.type,
12
+            t.is_reported AS isReported,
13
+            t.create_date AS createDate,
14
+            u.user_name AS userName
15
+        FROM
16
+            tp_transaction t
17
+            LEFT JOIN ta_user u ON t.ta_user_id = u.id
18
+            AND u.community_id = #{tpTransaction.communityId}
19
+        WHERE
20
+            1 = 1
21
+            AND t.community_id = #{tpTransaction.communityId}
22
+        <if test="tpTransaction.id != null and tpTransaction.id != ''">
23
+            and t.id = #{tpTransaction.id}
24
+        </if>
25
+        <if test="tpTransaction.transactionTitle != null and tpTransaction.transactionTitle != ''">
26
+            and t.transaction_title like concat('%',#{tpTransaction.transactionTitle,jdbcType=VARCHAR},'%')
27
+        </if>
28
+        <if test="tpTransaction.status != null and tpTransaction.status != ''">
29
+            and t.status = #{tpTransaction.status}
30
+        </if>
31
+        <if test="tpTransaction.isReported != null and tpTransaction.isReported != ''">
32
+            and t.is_reported = #{tpTransaction.isReported}
33
+        </if>
34
+    </select>
35
+</mapper>

+ 72
- 0
VUECODE/smart-property-manage/src/api/activity.js View File

@@ -0,0 +1,72 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询活动数据列表
4
+export function activityList(data) {
5
+  return request({
6
+    url: '/activity/list',
7
+    method: 'post',
8
+    data: {
9
+      id: data.id,
10
+      activityTitle: data.activityTitle,
11
+      pageNum: data.pageNum,
12
+      pageSize: data.pageSize
13
+    }
14
+  })
15
+}
16
+
17
+// 添加活动
18
+export function addActivity(data) {
19
+  return request({
20
+    url: '/activity/add',
21
+    method: 'post',
22
+    data: {
23
+      activityTitle: data.activityTitle,
24
+      activityCarouselImg: data.activityCarouselImg, // 轮播图
25
+      activityContent: data.activityContent, // 活动内容详细
26
+      contentImg: data.contentImg, // 活动内容配图
27
+      signUpMax: data.signUpMax, //  活动人数上限
28
+      registrationEndTime: data.registrationEndTime, // 报名活动结束时间
29
+      sort: data.sort, // 权重
30
+      status: data.status // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
31
+    }
32
+  })
33
+}
34
+
35
+// 修改活动
36
+export function updateActivity(data) {
37
+  return request({
38
+    url: '/activity/update',
39
+    method: 'put',
40
+    data: {
41
+      id: data.id,
42
+      activityTitle: data.activityTitle,
43
+      activityCarouselImg: data.activityCarouselImg, // 轮播图
44
+      activityContent: data.activityContent, // 活动内容详细
45
+      contentImg: data.contentImg, // 活动内容配图
46
+      signUpMax: data.signUpMax, //  活动人数上限
47
+      registrationEndTime: data.registrationEndTime, // 报名活动结束时间
48
+      sort: data.sort, // 权重
49
+      status: data.status // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
50
+    }
51
+  })
52
+}
53
+
54
+// 查询 活动详情
55
+export function activityById(id) {
56
+  return request({
57
+    url: '/activity/' + id,
58
+    method: 'get'
59
+  })
60
+}
61
+
62
+// 批量活动作废
63
+export function invalidActivity(data) {
64
+  return request({
65
+    url: '/activity/invalid',
66
+    method: 'put',
67
+    data: {
68
+      ids: data
69
+    }
70
+  })
71
+}
72
+

+ 9
- 0
VUECODE/smart-property-manage/src/api/transaction.js View File

@@ -0,0 +1,9 @@
1
+import request from '@/utils/request'
2
+
3
+export function fetchList(query) {
4
+  return request({
5
+    url: '/transactions',
6
+    method: 'get',
7
+    params: query
8
+  })
9
+}

+ 21
- 0
VUECODE/smart-property-manage/src/router/index.js View File

@@ -115,6 +115,27 @@ export const constantRouterMap = [
115 115
         component: () => import('@/views/social/transaction/index'),
116 116
         name: 'transaction-import',
117 117
         meta: { title: '二手求购租赁管理', icon: 'table' }
118
+      },
119
+      {
120
+        path: '/activity/add',
121
+        component: () => import('@/views/social/activity/add/index'),
122
+        name: 'activity-add',
123
+        hidden: true,
124
+        meta: { title: '添加活动', icon: 'table' }
125
+      },
126
+      {
127
+        path: '/activity/edi',
128
+        component: () => import('@/views/social/activity/edi/index'),
129
+        name: 'activity-edi',
130
+        hidden: true,
131
+        meta: { title: '修改活动', icon: 'table' }
132
+      },
133
+      {
134
+        path: '/activity/info',
135
+        component: () => import('@/views/social/activity/info/index'),
136
+        name: 'activity-info',
137
+        hidden: true,
138
+        meta: { title: '活动详情', icon: 'table' }
118 139
       }
119 140
     ]
120 141
   },

+ 5
- 1
VUECODE/smart-property-manage/src/store/index.js View File

@@ -6,9 +6,11 @@ import banner from './modules/banner'
6 6
 import community from './modules/community'
7 7
 import trunkIndex from './modules/trunkIndex'
8 8
 import batchImport from './modules/batchImport'
9
+import transaction from './modules/transaction'
9 10
 import getters from './getters'
10 11
 import announcement from './modules/announcement'
11 12
 import buildingOwnerInfo from './modules/buildingOwnerInfo'
13
+import activity from './modules/activity'
12 14
 
13 15
 Vue.use(Vuex)
14 16
 
@@ -21,7 +23,9 @@ const store = new Vuex.Store({
21 23
     trunkIndex,
22 24
     batchImport,
23 25
     buildingOwnerInfo,
24
-    announcement
26
+    announcement,
27
+    activity,
28
+    transaction
25 29
   },
26 30
   getters
27 31
 })

+ 58
- 0
VUECODE/smart-property-manage/src/store/modules/activity.js View File

@@ -0,0 +1,58 @@
1
+import { activityList, addActivity, updateActivity, activityById, invalidActivity  } from '@/api/activity'
2
+
3
+const activityInfo = {
4
+  state: {
5
+  },
6
+  mutations: {
7
+  },
8
+  actions: {
9
+    ActivityList({ commit, state }, data) { // 查询数据列表
10
+      return new Promise((resolve, reject) => {
11
+        activityList(data).then(response => {
12
+          resolve(response)
13
+        }).catch(error => {
14
+          reject(error)
15
+        })
16
+      })
17
+    },
18
+    AddActivity({ commit, state }, data) { // 添加活动
19
+      return new Promise((resolve, reject) => {
20
+        addActivity(data).then(response => {
21
+          resolve(response)
22
+        }).catch(error => {
23
+          reject(error)
24
+        })
25
+      })
26
+    },
27
+    UpdateActivity({ commit, state }, data) { // 修改活动
28
+      return new Promise((resolve, reject) => {
29
+        updateActivity(data).then(response => {
30
+          resolve(response)
31
+        }).catch(error => {
32
+          reject(error)
33
+        })
34
+      })
35
+    },
36
+    ActivityById({ commit, state }, data) { // 查询活动详情
37
+      return new Promise((resolve, reject) => {
38
+        activityById(data).then(response => {
39
+          resolve(response)
40
+        }).catch(error => {
41
+          reject(error)
42
+        })
43
+      })
44
+    },
45
+    InvalidActivity({ commit, state }, data) { // 批量活动作废
46
+      return new Promise((resolve, reject) => {
47
+        invalidActivity(data).then(response => {
48
+          resolve(response)
49
+        }).catch(error => {
50
+          reject(error)
51
+        })
52
+      })
53
+    }
54
+
55
+  }
56
+}
57
+
58
+export default activityInfo

+ 36
- 0
VUECODE/smart-property-manage/src/store/modules/transaction.js View File

@@ -0,0 +1,36 @@
1
+import { fetchList } from '@/api/transaction'
2
+
3
+const transaction = {
4
+  namespaced: true,
5
+  state: {
6
+    total: '',
7
+    transactionList: []
8
+  },
9
+
10
+  mutations: {
11
+    SET_LIST: (state, list) => {
12
+      state.transactionList = list
13
+    },
14
+    SET_TOTAL: (state, total) => {
15
+      state.total = total
16
+    }
17
+  },
18
+
19
+  actions: {
20
+    // fetchList,获取社区列表
21
+    FetchTransactionList({ commit }, listQuery) {
22
+      return new Promise((resolve, reject) => {
23
+        fetchList(listQuery).then(response => {
24
+          const data = response.data
25
+          commit('SET_LIST', data.list)
26
+          commit('SET_TOTAL', data.total)
27
+          resolve()
28
+        }).catch(error => {
29
+          reject(error)
30
+        })
31
+      })
32
+    }
33
+  }
34
+}
35
+
36
+export default transaction

+ 206
- 0
VUECODE/smart-property-manage/src/views/social/activity/add/index.vue View File

@@ -0,0 +1,206 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-position="top" label-width="150px" class="ruleForm">
4
+      <el-form-item label="活动标题" prop="activityTitle">
5
+        <el-input v-model="ruleForm.activityTitle" placeholder="15字以内"/>
6
+      </el-form-item>
7
+      <el-form-item label="活动轮播图" prop="activityCarouselImg">
8
+        <el-upload
9
+          :show-file-list="false"
10
+          :on-success="handleAvatarSuccess"
11
+          :before-upload="beforeAvatarUpload"
12
+          class="avatar-uploader"
13
+          name="uploadFiles"
14
+          action="http://localhost:8086/property-api/uploadimage">
15
+          <img v-if="imageUrl" :src="imageUrl" class="avatar">
16
+          <i v-else class="el-icon-plus avatar-uploader-icon"/>
17
+        </el-upload>
18
+      </el-form-item>
19
+      <el-form-item label="活动详细描述">
20
+        <el-input v-model="ruleForm.activityContent" :rows="10" type="textarea" placeholder="活动内容, 活动规则, 活动举办开始时间, 活动举办结束时间, 报名人数上限等"/>
21
+      </el-form-item>
22
+      <el-form-item label="活动配图">
23
+        <el-upload
24
+          :on-preview="handlePictureCardPreview"
25
+          :on-remove="handleRemove"
26
+          :on-success="handleSuccessContentImg"
27
+          name="uploadFiles"
28
+          action="http://localhost:8086/property-api/uploadimage"
29
+          list-type="picture-card">
30
+          <i class="el-icon-plus"/>
31
+        </el-upload>
32
+        <el-dialog :visible.sync="dialogVisible">
33
+          <img :src="dialogImageUrl" width="100%" alt="">
34
+        </el-dialog>
35
+      </el-form-item>
36
+      <el-form-item label="报名人数上限" prop="signUpMax">
37
+        <el-input v-model="ruleForm.signUpMax" placeholder="填写0则不限制报名人数"/>
38
+      </el-form-item>
39
+      <el-form-item label="报名截止时间" prop="registrationEndTime">
40
+        <el-date-picker
41
+          v-model="ruleForm.registrationEndTime"
42
+          type="date"
43
+          placeholder="选择日期"/>
44
+      </el-form-item>
45
+      <el-form-item label="权重值" prop="sort">
46
+        <el-input-number v-model="ruleForm.sort" :min="1" :max="10" label="权重值" @change="sortHandleChange"/>
47
+      </el-form-item>
48
+      <el-form-item>
49
+        <el-button @click="resetForm('ruleForm')">存为草稿</el-button>
50
+        <el-button type="primary" @click="submitForm('ruleForm')">发布</el-button>
51
+      </el-form-item>
52
+    </el-form>
53
+  </div>
54
+</template>
55
+
56
+<script>
57
+export default {
58
+  name: 'Index',
59
+  data() {
60
+    return {
61
+      ruleForm: {
62
+        activityTitle: '',
63
+        activityCarouselImg: '', // 轮播图
64
+        activityContent: '', // 活动内容详细
65
+        contentImg: [], // 活动内容配图
66
+        signUpMax: '', //  活动人数上限
67
+        registrationEndTime: '', // 报名活动结束时间
68
+        sort: 1, // 权重
69
+        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
70
+      },
71
+      imageUrl: '', // 轮播图预览
72
+      rules: {
73
+        activityTitle: [
74
+          { required: true, message: '请输入活动名称', trigger: 'blur' },
75
+          { min: 1, max: 15, message: '长度在 15 个字符以内', trigger: 'blur' }
76
+        ],
77
+        activityContent: [
78
+          { required: true, message: '活动详细描述', trigger: 'blur' }
79
+        ],
80
+        signUpMax: [
81
+          { required: true, message: '请输入报名人数上限', trigger: 'blur' }
82
+        ],
83
+        registrationEndTime: [
84
+          { type: 'date', required: true, message: '报名截止时间', trigger: 'change' }
85
+        ],
86
+        sort: [
87
+          { required: true, message: '请输入权重值', trigger: 'change' }
88
+        ]
89
+      }
90
+    }
91
+  },
92
+  methods: {
93
+    submitForm(formName) {
94
+      // 加载框
95
+      const loading = this.$loading({
96
+        lock: true,
97
+        text: 'Loading',
98
+        spinner: 'el-icon-loading',
99
+        background: 'rgba(0, 0, 0, 0.7)'
100
+      })
101
+      this.$refs[formName].validate((valid) => {
102
+        if (valid) {
103
+          if (this.ruleForm.activityContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
104
+            this.$message.error('活动内容描述 和 活动配图至少要存在一个!')
105
+            return false
106
+          }
107
+          this.ruleForm.status = 1 // 发布状态
108
+          this.$store.dispatch('AddActivity', this.ruleForm).then((res) => {
109
+            if (res.code === '0') {
110
+              this.$message({
111
+                message: res.message,
112
+                type: 'success'
113
+              })
114
+              this.$router.push({ name: 'activity-index' })
115
+              loading.close()
116
+              return
117
+            }
118
+            this.$message.error(res.message)
119
+            loading.close()
120
+          }).catch(() => {
121
+            console.log('error AddActivity')
122
+          })
123
+        } else {
124
+          console.log('error submit!!')
125
+          loading.close()
126
+          return false
127
+        }
128
+      })
129
+    },
130
+    resetForm(formName) {
131
+      this.$refs[formName].resetFields()
132
+    },
133
+    handleAvatarSuccess(res, file) { // 轮播图上传回调
134
+      this.ruleForm.activityCarouselImg = res.data[0]
135
+      this.imageUrl = URL.createObjectURL(file.raw)
136
+    },
137
+    beforeAvatarUpload(file) { // 轮播图上传前操作
138
+      // const isJPG = file.type === 'image/jpeg'
139
+      // const isLt2M = file.size / 1024 / 1024 < 2
140
+      //
141
+      // if (!isJPG) {
142
+      //   this.$message.error('上传头像图片只能是 JPG 格式!')
143
+      // }
144
+      // if (!isLt2M) {
145
+      //   this.$message.error('上传头像图片大小不能超过 2MB!')
146
+      // }
147
+      // return isJPG && isLt2M
148
+    },
149
+    handleRemove(file, fileList) { // 活动配图移除时
150
+      this.ruleForm.contentImg = []
151
+      for (let i = 0; i < fileList.length; i++) {
152
+        this.ruleForm.contentImg.push(fileList[i].response.data[0])
153
+      }
154
+      console.log(file, fileList)
155
+    },
156
+    handlePictureCardPreview(file) { // 点击活动配图文件列表中已上传的文件时的钩子
157
+      this.dialogImageUrl = file.url
158
+      this.dialogVisible = true
159
+    },
160
+    handleSuccessContentImg(response, file, fileList) { // 活动配图上传成功时回调
161
+      const resImg = response.data[0]
162
+      this.ruleForm.contentImg.push(resImg)
163
+      console.log('上传活动配图成功时回调!')
164
+    },
165
+    sortHandleChange(value) { // 权重值
166
+      this.ruleForm.sort = value
167
+      console.log(value)
168
+    }
169
+  }
170
+}
171
+</script>
172
+
173
+<style scoped>
174
+#root {
175
+  display: flex;
176
+}
177
+.ruleForm {
178
+  width: 800px;
179
+  margin-left: auto;
180
+  margin-right: auto;
181
+  margin-top: 50px;
182
+}
183
+.avatar-uploader .el-upload {
184
+  border: 1px dashed #d9d9d9;
185
+  border-radius: 6px;
186
+  cursor: pointer;
187
+  position: relative;
188
+  overflow: hidden;
189
+}
190
+.avatar-uploader .el-upload:hover {
191
+  border-color: #409EFF;
192
+}
193
+.avatar-uploader-icon {
194
+  font-size: 28px;
195
+  color: #8c939d;
196
+  width: 178px;
197
+  height: 178px;
198
+  line-height: 178px;
199
+  text-align: center;
200
+}
201
+.avatar {
202
+  width: 178px;
203
+  height: 178px;
204
+  display: block;
205
+}
206
+</style>

+ 210
- 0
VUECODE/smart-property-manage/src/views/social/activity/edi/index.vue View File

@@ -0,0 +1,210 @@
1
+<template>
2
+  <div id="root">
3
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-position="top" label-width="150px" class="ruleForm">
4
+      <el-form-item label="活动标题" prop="activityTitle">
5
+        <el-input v-model="ruleForm.activityTitle" placeholder="15字以内"/>
6
+      </el-form-item>
7
+      <el-form-item label="活动轮播图" prop="activityCarouselImg">
8
+        <el-upload
9
+          :show-file-list="false"
10
+          :on-success="handleAvatarSuccess"
11
+          :before-upload="beforeAvatarUpload"
12
+          class="avatar-uploader"
13
+          name="uploadFiles"
14
+          action="http://localhost:8086/property-api/uploadimage">
15
+          <img v-if="imageUrl" :src="imageUrl" class="avatar">
16
+          <i v-else class="el-icon-plus avatar-uploader-icon"/>
17
+        </el-upload>
18
+      </el-form-item>
19
+      <el-form-item label="活动详细描述">
20
+        <el-input v-model="ruleForm.activityContent" :rows="10" type="textarea" placeholder="活动内容, 活动规则, 活动举办开始时间, 活动举办结束时间, 报名人数上限等"/>
21
+      </el-form-item>
22
+      <el-form-item label="活动配图">
23
+        <el-upload
24
+          :on-preview="handlePictureCardPreview"
25
+          :on-remove="handleRemove"
26
+          :on-success="handleSuccessContentImg"
27
+          name="uploadFiles"
28
+          action="http://localhost:8086/property-api/uploadimage"
29
+          list-type="picture-card">
30
+          <i class="el-icon-plus"/>
31
+        </el-upload>
32
+        <el-dialog :visible.sync="dialogVisible">
33
+          <img :src="dialogImageUrl" width="100%" alt="">
34
+        </el-dialog>
35
+      </el-form-item>
36
+      <el-form-item label="报名人数上限" prop="signUpMax">
37
+        <el-input v-model="ruleForm.signUpMax" placeholder="填写0则不限制报名人数"/>
38
+      </el-form-item>
39
+      <el-form-item label="报名截止时间" prop="registrationEndTime">
40
+        <el-date-picker
41
+          v-model="ruleForm.registrationEndTime"
42
+          type="date"
43
+          placeholder="选择日期"/>
44
+      </el-form-item>
45
+      <el-form-item label="权重值" prop="sort">
46
+        <el-input-number v-model="ruleForm.sort" :min="1" :max="10" label="权重值" @change="sortHandleChange"/>
47
+      </el-form-item>
48
+      <el-form-item>
49
+        <el-button @click="resetForm('ruleForm')">存为草稿</el-button>
50
+        <el-button type="primary" @click="submitForm('ruleForm')">发布</el-button>
51
+      </el-form-item>
52
+    </el-form>
53
+  </div>
54
+</template>
55
+
56
+<script>
57
+export default {
58
+  name: 'Index',
59
+  data() {
60
+    return {
61
+      ruleForm: {
62
+        id: '',
63
+        activityTitle: '',
64
+        activityCarouselImg: '', // 轮播图
65
+        activityContent: '', // 活动内容详细
66
+        contentImg: [], // 活动内容配图
67
+        signUpMax: '', //  活动人数上限
68
+        registrationEndTime: '', // 报名活动结束时间
69
+        sort: 1, // 权重
70
+        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
71
+      },
72
+      imageUrl: '', // 轮播图预览
73
+      rules: {
74
+        activityTitle: [
75
+          { required: true, message: '请输入活动名称', trigger: 'blur' },
76
+          { min: 1, max: 15, message: '长度在 15 个字符以内', trigger: 'blur' }
77
+        ],
78
+        activityContent: [
79
+          { required: true, message: '活动详细描述', trigger: 'blur' }
80
+        ],
81
+        signUpMax: [
82
+          { required: true, message: '请输入报名人数上限', trigger: 'blur' }
83
+        ],
84
+        registrationEndTime: [
85
+          { type: 'date', required: true, message: '报名截止时间', trigger: 'change' }
86
+        ],
87
+        sort: [
88
+          { required: true, message: '请输入权重值', trigger: 'change' }
89
+        ]
90
+      }
91
+    }
92
+  },
93
+  methods: {
94
+    submitForm(formName) {
95
+      // 加载框
96
+      const loading = this.$loading({
97
+        lock: true,
98
+        text: 'Loading',
99
+        spinner: 'el-icon-loading',
100
+        background: 'rgba(0, 0, 0, 0.7)'
101
+      })
102
+      this.$refs[formName].validate((valid) => {
103
+        if (valid) {
104
+          if (this.ruleForm.activityContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
105
+            this.$message.error('活动内容描述 和 活动配图至少要存在一个!')
106
+            return false
107
+          }
108
+          this.ruleForm.status = 1 // 发布状态
109
+          this.$store.dispatch('UpdateActivity', this.ruleForm).then((res) => {
110
+            if (res.code === '0') {
111
+              this.$message({
112
+                message: res.message,
113
+                type: 'success'
114
+              })
115
+              this.$router.push({ name: 'activity-index' })
116
+              loading.close()
117
+              return
118
+            }
119
+            this.$message.error(res.message)
120
+            loading.close()
121
+          }).catch(() => {
122
+            console.log('error UpdateActivity')
123
+          })
124
+        } else {
125
+          console.log('error submit!!')
126
+          loading.close()
127
+          return false
128
+        }
129
+      })
130
+    },
131
+    resetForm(formName) {
132
+      this.$refs[formName].resetFields()
133
+    },
134
+    handleAvatarSuccess(res, file) { // 轮播图上传回调
135
+      this.ruleForm.activityCarouselImg = res.data[0]
136
+      this.imageUrl = URL.createObjectURL(file.raw)
137
+    },
138
+    beforeAvatarUpload(file) { // 轮播图上传前操作
139
+      // const isJPG = file.type === 'image/jpeg'
140
+      // const isLt2M = file.size / 1024 / 1024 < 2
141
+      //
142
+      // if (!isJPG) {
143
+      //   this.$message.error('上传头像图片只能是 JPG 格式!')
144
+      // }
145
+      // if (!isLt2M) {
146
+      //   this.$message.error('上传头像图片大小不能超过 2MB!')
147
+      // }
148
+      // return isJPG && isLt2M
149
+    },
150
+    handleRemove(file, fileList) { // 活动配图移除时
151
+      this.ruleForm.contentImg = []
152
+      for (let i = 0; i < fileList.length; i++) {
153
+        this.ruleForm.contentImg.push(fileList[i].response.data[0])
154
+      }
155
+      console.log(file, fileList)
156
+    },
157
+    handlePictureCardPreview(file) { // 点击活动配图文件列表中已上传的文件时的钩子
158
+      this.dialogImageUrl = file.url
159
+      this.dialogVisible = true
160
+    },
161
+    handleSuccessContentImg(response, file, fileList) { // 活动配图上传成功时回调
162
+      const resImg = response.data[0]
163
+      this.ruleForm.contentImg.push(resImg)
164
+      console.log('上传活动配图成功时回调!')
165
+    },
166
+    sortHandleChange(value) { // 权重值
167
+      this.ruleForm.sort = value
168
+      console.log(value)
169
+    },
170
+    getById() { // 根据 id 查询活动详情
171
+
172
+    }
173
+  }
174
+}
175
+</script>
176
+
177
+<style scoped>
178
+#root {
179
+  display: flex;
180
+}
181
+.ruleForm {
182
+  width: 800px;
183
+  margin-left: auto;
184
+  margin-right: auto;
185
+  margin-top: 50px;
186
+}
187
+.avatar-uploader .el-upload {
188
+  border: 1px dashed #d9d9d9;
189
+  border-radius: 6px;
190
+  cursor: pointer;
191
+  position: relative;
192
+  overflow: hidden;
193
+}
194
+.avatar-uploader .el-upload:hover {
195
+  border-color: #409EFF;
196
+}
197
+.avatar-uploader-icon {
198
+  font-size: 28px;
199
+  color: #8c939d;
200
+  width: 178px;
201
+  height: 178px;
202
+  line-height: 178px;
203
+  text-align: center;
204
+}
205
+.avatar {
206
+  width: 178px;
207
+  height: 178px;
208
+  display: block;
209
+}
210
+</style>

+ 138
- 52
VUECODE/smart-property-manage/src/views/social/activity/index.vue View File

@@ -1,81 +1,102 @@
1 1
 
2 2
 <template>
3 3
   <div id="root">
4
-    <el-form :inline="true" :model="formInline" class="form-inline">
4
+    <el-form :inline="true" :model="listQuery" class="form-inline">
5 5
       <el-form-item label="活动编号">
6
-        <el-input v-model="formInline.user" placeholder="活动编号"/>
6
+        <el-input v-model="listQuery.id" placeholder="活动编号"/>
7 7
       </el-form-item>
8 8
       <el-form-item label="活动标题">
9
-        <el-input v-model="formInline.user" placeholder="活动标题"/>
9
+        <el-input v-model="listQuery.activityTitle" placeholder="活动标题"/>
10 10
       </el-form-item>
11 11
       <!--<el-form-item label="活动内容">-->
12
-      <!--<el-input v-model="formInline.user" placeholder="审批人"/>-->
12
+      <!--<el-input v-model="formInline.user" placeholder="活动内容"/>-->
13 13
       <!--</el-form-item>-->
14 14
       <el-form-item>
15
-        <el-button type="info">清空</el-button>
15
+        <el-button type="info" @click="clearListQuery">清空</el-button>
16 16
         <el-button type="primary" @click="onSubmit">查询</el-button>
17 17
       </el-form-item>
18 18
     </el-form>
19 19
     <div class="operation">
20
-      <el-button type="primary">主要按钮</el-button>
21
-      <el-button type="warning">警告按钮</el-button>
22
-      <el-button type="danger">危险按钮</el-button>
20
+      <el-button type="primary" @click="addActivity">添加</el-button>
21
+      <el-button type="warning" @click="ediActivity">修改</el-button>
22
+      <el-button type="danger" >作废</el-button>
23 23
     </div>
24 24
     <el-table
25
+      v-loading="listLoading"
25 26
       ref="multipleTable"
26
-      :data="tableData3"
27
+      :data="list"
27 28
       tooltip-effect="dark"
28 29
       style="width: 100%; margin-top: 20px;"
29
-      border="true"
30
+      border
30 31
       @selection-change="handleSelectionChange">
31 32
       <el-table-column
32
-        type="selection"/>
33
+        type="selection"
34
+        align="center"/>
33 35
       <el-table-column
34
-        label="编号">
36
+        label="编号"
37
+        align="center">
35 38
         <template slot-scope="scope">{{ scope.row.id }}</template>
36 39
       </el-table-column>
37 40
       <el-table-column
38
-        prop="name"
39
-        label="标题"/>
41
+        prop="activityTitle"
42
+        label="标题"
43
+        align="center"/>
40 44
       <el-table-column
41
-        prop="address"
45
+        prop="viewCount"
42 46
         label="阅读量"
43
-        show-overflow-tooltip/>
47
+        show-overflow-tooltip
48
+        align="center"/>
44 49
       <el-table-column
45
-        prop="name"
46
-        label="报名上限"/>
50
+        prop="signUpMax"
51
+        label="报名上限"
52
+        align="center"/>
47 53
       <el-table-column
48
-        prop="name"
49
-        label="已报名人数"/>
54
+        prop="signUpCount"
55
+        label="已报名人数"
56
+        align="center"/>
50 57
       <el-table-column
51
-        prop="name"
52
-        label="状态"/>
58
+        prop="status"
59
+        label="状态"
60
+        align="center">
61
+        <template slot-scope="scope">{{ getStatus(scope.row.status) }}</template>
62
+      </el-table-column>
53 63
       <el-table-column
54
-        prop="name"
55
-        label="权重"/>
64
+        prop="sort"
65
+        label="权重"
66
+        align="center"/>
56 67
       <el-table-column
57
-        prop="name"
58
-        label="发布时间"/>
68
+        prop="createDate"
69
+        label="发布时间"
70
+        align="center">
71
+        <template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template>
72
+      </el-table-column>
59 73
       <el-table-column
60
-        prop="name"
74
+        prop="registrationEndTime"
61 75
         label="报名截止时间"
62
-        width="120"/>
76
+        align="center">
77
+        <template slot-scope="scope">{{ formatDate(scope.row.registrationEndTime) }}</template>
78
+      </el-table-column>
63 79
       <el-table-column
64
-        prop="name"
65
-        label="发布人"/>
80
+        prop="crateUserName"
81
+        label="发布人"
82
+        align="center"/>
66 83
       <el-table-column
67
-        prop="name"
68
-        label="修改时间"/>
84
+        prop="updateDate"
85
+        label="修改时间"
86
+        align="center">
87
+        <template slot-scope="scope">{{ formatDate(scope.row.updateDate) }}</template>
88
+      </el-table-column>
69 89
       <el-table-column
70
-        prop="name"
71
-        label="修改人"/>
90
+        prop="updateUserName"
91
+        label="修改人"
92
+        align="center"/>
72 93
     </el-table>
73 94
     <div class="block">
74 95
       <el-pagination
75
-        :current-page="currentPage4"
76
-        :page-sizes="[100, 200, 300, 400]"
77
-        :page-size="100"
78
-        :total="400"
96
+        :current-page.sync="listQuery.pageNum"
97
+        :page-sizes="[10, 20, 40, 100]"
98
+        :page-size.sync="listQuery.pageSize"
99
+        :total="total"
79 100
         layout="total, sizes, prev, pager, next, jumper"
80 101
         @size-change="handleSizeChange"
81 102
         @current-change="handleCurrentChange"/>
@@ -87,33 +108,98 @@ export default {
87 108
   name: 'Index',
88 109
   data() {
89 110
     return {
90
-      formInline: {
91
-        user: '',
92
-        region: '',
93
-        currentPage4: 4
111
+      listQuery: {
112
+        id: '',
113
+        activityTitle: '',
114
+        pageNum: 1,
115
+        pageSize: 10
94 116
       },
95
-      tableData3: [{
96
-        date: '2016-05-03',
97
-        name: '王小虎',
98
-        address: '上海市普陀区金沙江路 1518 弄'
99
-      }, {
100
-        date: '2016-05-02',
101
-        name: '王小虎',
102
-        address: '上海市普陀区金沙江路 1518 弄'
103
-      }]
117
+      total: 0, // 数据总数
118
+      list: [],
119
+      listLoading: true // 表格加载框
104 120
     }
105 121
   },
122
+  mounted() {
123
+    this.activityList()
124
+  },
106 125
   methods: {
107 126
     onSubmit() {
108
-      console.log('submit!')
127
+      this.listQuery.pageNum = 1
128
+      this.activityList()
129
+    },
130
+    clearListQuery() {
131
+      this.listQuery.pageNum = 1
132
+      this.listQuery.pageSize = 10
133
+      this.listQuery.id = ''
134
+      this.listQuery.activityTitle = ''
135
+      this.activityList()
109 136
     },
110 137
     handleSelectionChange(val) { // 表格选择
111 138
     },
112 139
     handleSizeChange(val) {
113 140
       console.log(`每页 ${val} 条`)
141
+      this.listQuery.pageNum = 1
142
+      this.listQuery.pageSize = val
143
+      this.activityList()
114 144
     },
115 145
     handleCurrentChange(val) {
116 146
       console.log(`当前页: ${val}`)
147
+      this.listQuery.pageNum = val
148
+      this.activityList()
149
+    },
150
+    activityList() { // 查询列表
151
+      this.listLoading = true
152
+      this.$store.dispatch('ActivityList', this.listQuery).then((res) => {
153
+        const resData = res.data
154
+        this.list = resData.list
155
+        this.listQuery.pageNum = resData.pageNum
156
+        this.listQuery.pageSize = resData.pageSize
157
+        this.total = resData.total
158
+        this.listLoading = false
159
+      }).catch(() => {
160
+        this.listLoading = false
161
+        console.log('error ActivityList get')
162
+      })
163
+    },
164
+    formatDate(val) {
165
+      var value = new Date(val)
166
+      var year = value.getFullYear()
167
+      var month = value.getMonth() + 1
168
+      var day = value.getDate()
169
+      // var hour = value.getHours()
170
+      // var minutes = value.getMinutes()
171
+      // var seconds = value.getSeconds()
172
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
173
+      return year + '-' + month + '-' + day
174
+    },
175
+    getStatus(status) { // 获取状态
176
+      let statusName = ''
177
+      switch (status) {
178
+        case '0':
179
+          statusName = '已作废'
180
+          break
181
+        case '1':
182
+          statusName = '已发布'
183
+          break
184
+        case '2':
185
+          statusName = '草稿'
186
+          break
187
+        case '3':
188
+          statusName = '已修改'
189
+          break
190
+        default:
191
+          statusName = '状态异常'
192
+      }
193
+      return statusName
194
+    },
195
+    addActivity() { // 添加活动
196
+      this.$router.push({ name: 'activity-add' })
197
+    },
198
+    ediActivity() { // 修改活动
199
+      this.$router.push({ name: 'activity-edi' })
200
+    },
201
+    infoActivity() { // 查看活动
202
+      this.$router.push({ name: 'activity-info' })
117 203
     }
118 204
   }
119 205
 }

+ 13
- 0
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue View File

@@ -0,0 +1,13 @@
1
+<template>
2
+  <div>查看</div>
3
+</template>
4
+
5
+<script>
6
+export default {
7
+  name: 'Index'
8
+}
9
+</script>
10
+
11
+<style scoped>
12
+
13
+</style>

+ 266
- 7
VUECODE/smart-property-manage/src/views/social/transaction/index.vue View File

@@ -1,13 +1,272 @@
1
-
2 1
 <template>
3
-  <div>二手求购租赁</div>
2
+  <div class="app-container">
3
+    <div class="filter-container">
4
+      <el-input v-model="listQuery.transactionId" placeholder="帖子编号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
5
+      <el-input v-model="listQuery.transactionTitle" placeholder="帖子标题" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
6
+      <el-select v-model="listQuery.status" placeholder="发布状态" style="width: 130px" class="filter-item">
7
+        <el-option label="已发布" value="1"/>
8
+        <el-option label="已作废" value="0"/>
9
+      </el-select>
10
+      <el-select v-model="listQuery.isReported" placeholder="是否被举报" class="filter-item" style="width: 130px">
11
+        <el-option label="无举报" value="0"/>
12
+        <el-option label="被举报" value="1"/>
13
+      </el-select>
14
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
15
+      <el-button v-waves class="filter-item" type="info" icon="el-icon-warning" @click="clearListQuery">清空</el-button>
16
+    </div>
17
+
18
+    <el-table
19
+      v-loading="listLoading"
20
+      :key="tableKey"
21
+      :data="transactionList"
22
+      border
23
+      fit
24
+      highlight-current-row
25
+      style="width: 100%; margin-top: 20px;"
26
+      @sort-change="sortChange">
27
+      <el-table-column
28
+        label="序号"
29
+        align="center"
30
+        type="index"
31
+        width="50"/>
32
+      <el-table-column label="编号" align="center">
33
+        <template slot-scope="scope">
34
+          <span>{{ scope.row.id }}</span>
35
+        </template>
36
+      </el-table-column>
37
+      <el-table-column label="类型" align="center">
38
+        <template slot-scope="scope">
39
+          <span v-if="scope.row.type === '0'">二手</span>
40
+          <span v-if="scope.row.type === '1'">求购</span>
41
+          <span v-if="scope.row.type === '2'">租赁</span>
42
+        </template>
43
+      </el-table-column>
44
+      <el-table-column label="标题" align="center">
45
+        <template slot-scope="scope">
46
+          <span>{{ scope.row.transactionTitle }}</span>
47
+        </template>
48
+      </el-table-column>
49
+      <el-table-column label="查看人数" align="center">
50
+        <template slot-scope="scope">
51
+          <span>{{ scope.row.viewCount }}</span>
52
+        </template>
53
+      </el-table-column>
54
+      <el-table-column label="发布人" align="center">
55
+        <template slot-scope="scope">
56
+          <span>{{ scope.row.userName }}</span>
57
+        </template>
58
+      </el-table-column>
59
+      <el-table-column label="发布时间" align="center">
60
+        <template slot-scope="scope">
61
+          <span>{{ formatDate(scope.row.createDate) }}</span>
62
+        </template>
63
+      </el-table-column>
64
+      <el-table-column label="发布状态" align="center">
65
+        <template slot-scope="scope">
66
+          <span v-if="scope.row.status === '0'">已作废</span>
67
+          <span v-if="scope.row.status === '1'">已发布</span>
68
+        </template>
69
+      </el-table-column>
70
+      <el-table-column label="举报状态" align="center">
71
+        <template slot-scope="scope">
72
+          <span>{{ scope.row.isReported === '1' ? "被举报" : "无举报" }}</span>
73
+        </template>
74
+      </el-table-column>
75
+    </el-table>
76
+
77
+    <!-- <pagination v-show="total>0" :total="total" :current-page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 20, 30]" @pagination="getList" /> -->
78
+    <el-pagination
79
+      :total="total"
80
+      :current-page="listQuery.pageNum"
81
+      :page-sizes="[5, 10, 20, 30]"
82
+      :page-size="listQuery.pageSize"
83
+      layout="total, sizes, prev, pager, next, jumper"
84
+      @size-change="handleSizeChange"
85
+      @current-change="handleCurrentChange"/>
86
+
87
+  </div>
4 88
 </template>
89
+
5 90
 <script>
91
+import { mapState, mapActions, mapMutations } from 'vuex'
92
+import waves from '@/directive/waves' // Waves directive
93
+import { parseTime } from '@/utils'
94
+
6 95
 export default {
7
-  name: 'Index'
96
+  computed: {
97
+    ...mapState('transaction', {
98
+      transactionList: s => s.transactionList,
99
+      total: s => s.total
100
+    })
101
+  },
102
+  directives: { waves },
103
+  data() {
104
+    var _self = this
105
+    return {
106
+      events: {
107
+        click: (e) => {
108
+          // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
109
+          _self.detail.longitude = e.lnglat.lng
110
+          _self.detail.latitude = e.lnglat.lat
111
+        }
112
+      },
113
+      markers: [],
114
+      searchOption: {
115
+        city: '南京',
116
+        citylimit: false
117
+      },
118
+      listLoading: true,
119
+      listQuery: {
120
+        pageNum: 1,
121
+        pageSize: 20,
122
+        transactionId: undefined,
123
+        transactionTitle: undefined,
124
+        status: undefined,
125
+        isReported: undefined
126
+      },
127
+      tableKey: 0,
128
+      downloadLoading: false
129
+    }
130
+  },
131
+  created() {
132
+    this.getList()
133
+  },
134
+  methods: {
135
+    ...mapMutations('transaction', {
136
+    }),
137
+    ...mapActions('transaction', [
138
+      'FetchTransactionList'
139
+    ]),
140
+    setCurrent(item) {
141
+      this.setDetail({ ...item })
142
+    },
143
+    getList() {
144
+      this.listLoading = true
145
+      this.FetchTransactionList(this.listQuery).then(() => {
146
+        this.listLoading = false
147
+      }).catch(() => {
148
+        this.loading = false
149
+        console.log('get list error')
150
+      })
151
+    },
152
+    clearListQuery() {
153
+      this.listQuery.pageNum = 1
154
+      this.listQuery.pageSize = 20
155
+      this.listQuery.transactionId = undefined
156
+      this.listQuery.transactionTitle = undefined
157
+      this.listQuery.status = undefined
158
+      this.listQuery.isReported = undefined
159
+      this.getList()
160
+    },
161
+    handleFilter() {
162
+      this.listQuery.pageNum = 1
163
+      this.getList()
164
+    },
165
+    handleModifyStatus(row, status) {
166
+      this.$message({
167
+        message: '操作成功',
168
+        type: 'success'
169
+      })
170
+      row.status = status
171
+    },
172
+    sortChange(data) {
173
+      const { prop, order } = data
174
+      if (prop === 'id') {
175
+        this.sortByID(order)
176
+      }
177
+    },
178
+    handleSizeChange(val) {
179
+      // console.log(`每页 ${val} 条`);
180
+      this.listQuery.pageSize = val
181
+      this.getList()
182
+    },
183
+    handleCurrentChange(val) {
184
+      // console.log(`当前页: ${val}`);
185
+      this.listQuery.pageNum = val
186
+      this.getList()
187
+    },
188
+    sortByID(order) {
189
+      if (order === 'ascending') {
190
+        this.listQuery.sort = '+id'
191
+      } else {
192
+        this.listQuery.sort = '-id'
193
+      }
194
+      this.handleFilter()
195
+    },
196
+    handleUpdate(row) {
197
+      this.setCurrent(row)
198
+      this.dialogStatus = 'update'
199
+      this.dialogFormVisible = true
200
+      this.$nextTick(() => {
201
+        this.$refs['dataForm'].clearValidate()
202
+      })
203
+      this.getEditCityList()
204
+      this.getEditDistrictList()
205
+    },
206
+    handleLook(row) {
207
+      this.setCurrent(row)
208
+      this.dialogLookFormVisible = true
209
+      this.$nextTick(() => {
210
+        this.$refs['dataForm'].clearValidate()
211
+      })
212
+      this.getEditCityList()
213
+      this.getEditDistrictList()
214
+    },
215
+    handleCreate() {
216
+      this.resetDetail()
217
+      this.dialogStatus = 'create'
218
+      this.dialogFormVisible = true
219
+      this.$nextTick(() => {
220
+        this.$refs['dataForm'].clearValidate()
221
+      })
222
+    },
223
+    handleDelete(row) {
224
+      this.$notify({
225
+        title: '成功',
226
+        message: '删除成功',
227
+        type: 'success',
228
+        duration: 2000
229
+      })
230
+      const index = this.list.indexOf(row)
231
+      this.list.splice(index, 1)
232
+    },
233
+    handleDownload() {
234
+      this.downloadLoading = true
235
+      import('@/vendor/Export2Excel').then(excel => {
236
+        const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
237
+        const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
238
+        const data = this.formatJson(filterVal, this.list)
239
+        excel.export_json_to_excel({
240
+          header: tHeader,
241
+          data,
242
+          filename: 'table-list'
243
+        })
244
+        this.downloadLoading = false
245
+      })
246
+    },
247
+    padDate(value) {
248
+      value = value < 10 ? '0' + value : value
249
+      return value
250
+    },
251
+    formatDate(val) {
252
+      var value = new Date(val)
253
+      var year = value.getFullYear()
254
+      var month = this.padDate(value.getMonth() + 1)
255
+      var day = this.padDate(value.getDate())
256
+      var hour = this.padDate(value.getHours())
257
+      var minutes = this.padDate(value.getMinutes())
258
+      var seconds = this.padDate(value.getSeconds())
259
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
260
+    },
261
+    formatJson(filterVal, jsonData) {
262
+      return jsonData.map(v => filterVal.map(j => {
263
+        if (j === 'timestamp') {
264
+          return parseTime(v[j])
265
+        } else {
266
+          return v[j]
267
+        }
268
+      }))
269
+    },
270
+  }
8 271
 }
9 272
 </script>
10
-
11
-<style scoped>
12
-
13
-</style>

+ 376
- 352
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
View File


+ 316
- 304
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
View File


BIN
文档/计划/V181228/智慧社区V181228计划.mpp View File