Browse Source

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

# Conflicts:
#	CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java
傅行帆 6 years ago
parent
commit
a3eb8fc975
26 changed files with 1066 additions and 313 deletions
  1. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java
  2. 19
    21
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java
  3. 4
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  4. 18
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionLikeMapper.java
  5. 16
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReportMapper.java
  6. 22
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java
  7. 57
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionLike.java
  8. 46
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionReport.java
  9. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/User.java
  10. 10
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java
  11. 176
    40
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java
  12. 21
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  13. 77
    8
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java
  14. 14
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java
  15. 31
    23
      CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml
  16. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TransactionLikeMapper.xml
  17. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TransactionReportMapper.xml
  18. 1
    0
      VUECODE/smart-property-manage/src/api/activity.js
  19. 30
    0
      VUECODE/smart-property-manage/src/api/transaction.js
  20. 20
    0
      VUECODE/smart-property-manage/src/router/index.js
  21. 19
    1
      VUECODE/smart-property-manage/src/store/modules/transaction.js
  22. 15
    0
      VUECODE/smart-property-manage/src/views/building/audit/index.vue
  23. 11
    0
      VUECODE/smart-property-manage/src/views/social/activity/index.vue
  24. 15
    0
      VUECODE/smart-property-manage/src/views/social/activity/signIn/index.vue
  25. 237
    214
      VUECODE/smart-property-manage/src/views/social/transaction/index.vue
  26. 191
    0
      VUECODE/smart-property-manage/src/views/social/transaction/transactionAdd.vue

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

74
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
74
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
75
             @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "id活动编号;activityTitle活动标题;" +
75
             @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "id活动编号;activityTitle活动标题;" +
76
                     "activityCarouselImg轮播图;activityContent活动详情;contentImg活动内容配图;signUpMax活动人数上限;" +
76
                     "activityCarouselImg轮播图;activityContent活动详情;contentImg活动内容配图;signUpMax活动人数上限;" +
77
-                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿")
77
+                    "registrationEndTime报名活动结束时间;sort权重;status状态 0 是已作废 1 是已发布   2 是草稿,radio:1是需要二维码,2是不需要")
78
     })
78
     })
79
     @RequestMapping(value = "/activity/update", method = RequestMethod.PUT)
79
     @RequestMapping(value = "/activity/update", method = RequestMethod.PUT)
80
     public ResponseBean updateActivity(@RequestBody String parameter, HttpSession session) {
80
     public ResponseBean updateActivity(@RequestBody String parameter, HttpSession session) {

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

40
 	
40
 	
41
 	@ApiOperation(value = "根据搜索条件获取二手租赁列表", notes = "根据搜索条件获取二手租赁列表")
41
 	@ApiOperation(value = "根据搜索条件获取二手租赁列表", notes = "根据搜索条件获取二手租赁列表")
42
 	@ApiImplicitParams({
42
 	@ApiImplicitParams({
43
-			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "transactionId", value = "帖子编号"),
44
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "帖子标题(模糊查询)"),
45
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "status", value = "发布状态"),
46
-			@ApiImplicitParam(paramType = "query", dataType = "String", name = "isReported", value = "是否被举报"),
47
-			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
48
-			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
43
+			@ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "id:话题编号,transactionTitle:标题" +
44
+					"userName:发布人,status:状态,pageNum:总数,pageSize当前页"
45
+					)
49
 	})
46
 	})
50
-	@RequestMapping(value = "/transactions",method = RequestMethod.GET)
51
-	public ResponseBean getList(@RequestParam(value = "transactionId", required = false) Integer transactionId,
52
-	                            @RequestParam(value = "transactionTitle", required = false) String transactionTitle,
53
-	                            @RequestParam(value = "status", required = false) String status,
54
-	                            @RequestParam(value = "isReported", required = false) String isReported,
55
-	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
-	                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize, HttpSession session){
57
-		ResponseBean responseBean = new ResponseBean();
47
+	@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
48
+	@RequestMapping(value = "/transactions",method = RequestMethod.POST)
49
+	public ResponseBean getList(@RequestBody String parameter, HttpSession session){
58
 		UserElement userElement = getUserElement(session);
50
 		UserElement userElement = getUserElement(session);
59
-		TpTransaction tpTransaction = new TpTransaction();
60
-		tpTransaction.setId(transactionId);
61
-		tpTransaction.setTransactionTitle(transactionTitle);
62
-		tpTransaction.setStatus(status);
63
-		tpTransaction.setIsReported(isReported);
64
-		tpTransaction.setCommunityId(userElement.getCommunityId());
65
-		responseBean = transactionService.getTransactionList(tpTransaction,pageNum,pageSize);
51
+		ResponseBean responseBean = transactionService.getTransactionList(parameter,userElement.getCommunityId() );
66
 		return responseBean;
52
 		return responseBean;
67
 	}
53
 	}
68
 	
54
 	
93
 		responseBean = transactionService.updateTransactionById(id,userElement.getId());
79
 		responseBean = transactionService.updateTransactionById(id,userElement.getId());
94
 		return responseBean;
80
 		return responseBean;
95
 	}
81
 	}
82
+
83
+	@ApiOperation(value = "添加二手租赁",nickname ="添加二手租赁")
84
+	@ApiImplicitParams({
85
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value ="transactionTitle:话题标题," +
86
+					"type:0 代表 二手(卖二手物品)  1 是代表 求购 (买二手物品) 2 是代表 租赁(租二手物品)3其他话题,contentImg:图片,sort:权重值,status:'0 是已作废 1 是已发布  2 是草稿 ")})
87
+	@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
88
+	@RequestMapping(value="/transactions/add",method = RequestMethod.POST)
89
+	public ResponseBean transactionsAdd(@RequestBody String paramets, HttpSession session){
90
+		UserElement userElement = getUserElement(session);
91
+		ResponseBean  addAnnouncement= transactionService.transactionsAdd(paramets,userElement.getCommunityId(),userElement.getId());
92
+		return addAnnouncement;
93
+	}
96
 }
94
 }

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

2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.community.huiju.model.TpTicket;
5
 import com.community.huiju.model.TpTransaction;
7
 import com.community.huiju.model.TpTransaction;
6
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
7
 
9
 
16
  * @since 2018-12-29
18
  * @since 2018-12-29
17
  */
19
  */
18
 public interface TpTransactionMapper extends BaseMapper<TpTransaction> {
20
 public interface TpTransactionMapper extends BaseMapper<TpTransaction> {
19
-	
20
-	List<TpTransaction> selectListByParams(IPage page,@Param("tpTransaction") TpTransaction tpTransaction);
21
+
22
+	List<TpTransaction> selectListByParams(Page page, @Param("transactionTitle") String transactionTitle,@Param("userName") String userName, @Param("id")Integer id, @Param("status")Integer status,@Param("communityId") Integer communityId);
21
 }
23
 }

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

1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TransactionLike;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 二手租赁喜好表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-04-08
14
+ */
15
+@Mapper
16
+public interface TransactionLikeMapper extends BaseMapper<TransactionLike> {
17
+
18
+}

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

1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TransactionReport;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+
6
+/**
7
+ * <p>
8
+ * 二手交易举报表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-04-08
13
+ */
14
+public interface TransactionReportMapper extends BaseMapper<TransactionReport> {
15
+
16
+}

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

93
     @TableField(exist = false)
93
     @TableField(exist = false)
94
     private String userName;
94
     private String userName;
95
 
95
 
96
+    /**
97
+     * 喜欢的总数
98
+     */
99
+    @TableField(exist = false)
100
+   private Integer transactionLikeSum;
101
+
102
+    /**
103
+     * 不喜欢的总数
104
+     */
105
+    @TableField(exist = false)
106
+    private Integer transactionNoLikeSum;
96
 
107
 
108
+    /**
109
+     *帖子回复总数
110
+     */
111
+    @TableField(exist = false)
112
+    private Integer replySum;
113
+
114
+    /**
115
+     *帖子举报总数
116
+     */
117
+    @TableField(exist = false)
118
+    private Integer reportSum;
97
 }
119
 }

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

1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.time.LocalDateTime;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 二手租赁喜好表
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-04-08
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@TableName("tp_transaction_like")
22
+public class TransactionLike implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 小区ID
28
+     */
29
+    private Integer communityId;
30
+
31
+    /**
32
+     * 住户端App用户ID
33
+     */
34
+    private Integer taUserId;
35
+
36
+    /**
37
+     * 交易帖子ID
38
+     */
39
+    private Integer transactionId;
40
+
41
+    /**
42
+     * 1是喜欢 2是不喜欢
43
+     */
44
+    private String likeStatus;
45
+
46
+    /**
47
+     * 创建时间
48
+     */
49
+    private LocalDateTime createDate;
50
+
51
+    /**
52
+     * 更新时间
53
+     */
54
+    private LocalDateTime updateDate;
55
+
56
+
57
+}

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

1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import java.io.Serializable;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+import lombok.experimental.Accessors;
8
+
9
+/**
10
+ * <p>
11
+ * 二手交易举报表
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-04-08
16
+ */
17
+@Data
18
+@EqualsAndHashCode(callSuper = false)
19
+@Accessors(chain = true)
20
+@TableName("tp_transaction_report")
21
+public class TransactionReport implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 小区id
27
+     */
28
+    private Integer communityId;
29
+
30
+    /**
31
+     * 二手交易id
32
+     */
33
+    private Integer transactionId;
34
+
35
+    /**
36
+     * 举报原因id 对应 sys_report_reason 表
37
+     */
38
+    private String reportReasonId;
39
+
40
+    /**
41
+     * app用户端的举报者
42
+     */
43
+    private Integer reporterId;
44
+
45
+
46
+}

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

90
      */
90
      */
91
     private LocalDateTime updateDate;
91
     private LocalDateTime updateDate;
92
 
92
 
93
+    /**
94
+     * 在物业端app人员信息
95
+     */
96
+    private Integer taUserId;
97
+
93
 }
98
 }

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

15
  */
15
  */
16
 public interface ITransactionService extends IService<TpTransaction> {
16
 public interface ITransactionService extends IService<TpTransaction> {
17
 	
17
 	
18
-	ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize);
18
+	ResponseBean getTransactionList(String parameter,Integer communityId);
19
 	
19
 	
20
 	/**
20
 	/**
21
 	 * 获取交易信息详情
21
 	 * 获取交易信息详情
30
 	 * @return
30
 	 * @return
31
 	 */
31
 	 */
32
 	ResponseBean updateTransactionById(Integer id,Integer userId);
32
 	ResponseBean updateTransactionById(Integer id,Integer userId);
33
+
34
+	/**
35
+	 * 添加二手话题
36
+	 * @param paramets
37
+	 * @param communityId
38
+	 * @param id
39
+	 * @return
40
+	 */
41
+    ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id);
33
 }
42
 }

+ 176
- 40
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java View File

7
 import com.community.commom.mode.ResponseBean;
7
 import com.community.commom.mode.ResponseBean;
8
 import com.community.commom.session.UserElement;
8
 import com.community.commom.session.UserElement;
9
 import com.community.commom.utils.AccountValidatorUtil;
9
 import com.community.commom.utils.AccountValidatorUtil;
10
+
10
 import com.community.huiju.dao.TpBuildingMapper;
11
 import com.community.huiju.dao.TpBuildingMapper;
11
 import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
12
 import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
12
 import com.community.huiju.dao.TpLevelMapper;
13
 import com.community.huiju.dao.TpLevelMapper;
20
 import com.community.huiju.model.TpPhase;
21
 import com.community.huiju.model.TpPhase;
21
 import com.community.huiju.model.TpRoomNo;
22
 import com.community.huiju.model.TpRoomNo;
22
 import com.community.huiju.model.TpUnit;
23
 import com.community.huiju.model.TpUnit;
24
+
25
+import com.community.huiju.dao.*;
26
+import com.community.huiju.model.*;
27
+
23
 import com.community.huiju.service.BuildingTreeServiceI;
28
 import com.community.huiju.service.BuildingTreeServiceI;
29
+import jdk.nashorn.internal.ir.IfNode;
24
 import org.apache.ibatis.annotations.Mapper;
30
 import org.apache.ibatis.annotations.Mapper;
25
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
31
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
26
 import org.apache.poi.ss.usermodel.Row;
32
 import org.apache.poi.ss.usermodel.Row;
65
 	
71
 	
66
 	@Autowired
72
 	@Autowired
67
 	private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
73
 	private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
74
+	@Autowired
75
+	private TaUserVerifyMapper taUserVerifyMapper;
68
 	
76
 	
69
 	/**
77
 	/**
70
 	 * 获取整个小区的基础数据
78
 	 * 获取整个小区的基础数据
361
 			tpRoomNoMapper.insert(tpRoomNo);
369
 			tpRoomNoMapper.insert(tpRoomNo);
362
 		}
370
 		}
363
 		responseBean.addSuccess("成功");
371
 		responseBean.addSuccess("成功");
364
-		return null;
372
+		return responseBean;
365
 	}
373
 	}
366
 
374
 
367
 	@Override
375
 	@Override
368
 	public ResponseBean deleteNode(String parameter, Integer communityId) {
376
 	public ResponseBean deleteNode(String parameter, Integer communityId) {
369
 		ResponseBean responseBean= new ResponseBean();
377
 		ResponseBean responseBean= new ResponseBean();
378
+		//注意刪除当前节点,根据type判断当前节点的位置,删除时先删除当前节点的最小节点。
370
 		JSONObject  object= JSONObject.parseObject(parameter);
379
 		JSONObject  object= JSONObject.parseObject(parameter);
371
 		//当前节点id
380
 		//当前节点id
372
 		Integer id= object.getInteger("id");
381
 		Integer id= object.getInteger("id");
374
 		String type= object.getString("type");
383
 		String type= object.getString("type");
375
 		//当前输入的节点内容
384
 		//当前输入的节点内容
376
 		String nodeNumber= object.getString("nodeNumber");
385
 		String nodeNumber= object.getString("nodeNumber");
377
-		if(type.equals("end")){
386
+
387
+		//审核是否通过
388
+		InfoPass(type,id);
389
+		if (type.equals("end")) {
378
 			tpBuildingOwnerInfoMapper.deleteById(id);
390
 			tpBuildingOwnerInfoMapper.deleteById(id);
379
 		}
391
 		}
380
-
381
-
382
-
383
-
384
 		//删除楼层
392
 		//删除楼层
385
 		if(type.equals("roomNo")){
393
 		if(type.equals("roomNo")){
386
 			TpLevel tpLevel= tpLevelMapper.selectById(id);
394
 			TpLevel tpLevel= tpLevelMapper.selectById(id);
392
 			Info.eq("level_id", tpLevel.getId());
400
 			Info.eq("level_id", tpLevel.getId());
393
 			tpBuildingOwnerInfoMapper.delete(Info);
401
 			tpBuildingOwnerInfoMapper.delete(Info);
394
 			tpLevelMapper.deleteById(id);
402
 			tpLevelMapper.deleteById(id);
395
-			//删除楼层下面所有的房间
396
 		}
403
 		}
397
 
404
 
398
 		//删除单元
405
 		//删除单元
404
 			tpLevel.eq("community_id", tpUnit.getCommunityId());
411
 			tpLevel.eq("community_id", tpUnit.getCommunityId());
405
 			tpLevel.eq("building_id", tpUnit.getBuildingId());
412
 			tpLevel.eq("building_id", tpUnit.getBuildingId());
406
 			tpLevel.eq("unit_id", tpUnit.getId());
413
 			tpLevel.eq("unit_id", tpUnit.getId());
407
-			tpLevel.eq("name", nodeNumber);
408
 			//删除单元-楼层-下的房间
414
 			//删除单元-楼层-下的房间
409
-			//查询房间号
415
+			//查询楼层ID
416
+			Integer tpLevelID=null;
417
+
418
+			TpLevel levelevel = tpLevelMapper.selectOne(tpLevel);
410
 			QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
419
 			QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
411
 			Info.eq("community_id", tpUnit.getCommunityId());
420
 			Info.eq("community_id", tpUnit.getCommunityId());
412
 			Info.eq("phase_id", tpUnit.getPhaseId());
421
 			Info.eq("phase_id", tpUnit.getPhaseId());
413
 			Info.eq("building_id",tpUnit.getBuildingId());
422
 			Info.eq("building_id",tpUnit.getBuildingId());
414
 			Info.eq("unit_id", tpUnit.getId());
423
 			Info.eq("unit_id", tpUnit.getId());
415
-//			Info.eq("level_id", tpLevelToo.getId());
424
+			if (null!=levelevel) {
425
+				Info.eq("level_id", levelevel.getId());
426
+			}
427
+
416
 			//先删除所有房间
428
 			//先删除所有房间
417
 			tpBuildingOwnerInfoMapper.delete(Info);
429
 			tpBuildingOwnerInfoMapper.delete(Info);
418
 			//再删除所有楼层
430
 			//再删除所有楼层
422
 
434
 
423
 		}
435
 		}
424
 		//删除楼栋
436
 		//删除楼栋
425
-		if (type.equals("building")){
437
+		if (type.equals("unit")){
426
 			TpBuilding tpBuilding= tpBuildingMapper.selectById(id);
438
 			TpBuilding tpBuilding= tpBuildingMapper.selectById(id);
427
 			//删除单元-楼层-房间
439
 			//删除单元-楼层-房间
428
 			QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
440
 			QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
429
 			tpUnit.eq("community_id", tpBuilding.getCommunityId());
441
 			tpUnit.eq("community_id", tpBuilding.getCommunityId());
430
 			tpUnit.eq("phase_id", tpBuilding.getPhaseId());
442
 			tpUnit.eq("phase_id", tpBuilding.getPhaseId());
431
-			tpUnit.eq("building_id",tpBuilding.getId());
432
-			tpUnit.eq("unit_id", tpBuilding.getId());
433
-			tpUnit.eq("level_id", tpBuilding.getId());
434
-			//根据楼层
435
-			TpUnit unit= tpUnitMapper.selectById(id);
436
-			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
437
-			tpLevel.eq("phase_id", unit.getPhaseId());
438
-			tpLevel.eq("community_id", unit.getCommunityId());
439
-			tpLevel.eq("building_id", unit.getBuildingId());
440
-			tpLevel.eq("unit_id", unit.getId());
441
-			tpLevel.eq("name", nodeNumber);
442
-
443
+			tpUnit.eq("building_id", tpBuilding.getId());
444
+			
443
 			//删除单元-楼层-下的房间
445
 			//删除单元-楼层-下的房间
444
 			TpLevel tpLevelToo= tpLevelMapper.selectById(id);
446
 			TpLevel tpLevelToo= tpLevelMapper.selectById(id);
445
 				QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
447
 				QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
450
 			Info.eq("level_id", tpLevelToo.getId());
452
 			Info.eq("level_id", tpLevelToo.getId());
451
 			//先删除所有房间
453
 			//先删除所有房间
452
 			tpRoomNoMapper.delete(Info);
454
 			tpRoomNoMapper.delete(Info);
455
+			//先查询楼层
456
+			TpUnit unit= tpUnitMapper.selectOne(tpUnit);
457
+			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
458
+			if (null!=unit) {
459
+				tpLevel.eq("phase_id", unit.getPhaseId());
460
+				tpLevel.eq("community_id", unit.getCommunityId());
461
+				tpLevel.eq("building_id", unit.getBuildingId());
462
+				tpLevel.eq("unit_id", unit.getId());
463
+			}
464
+			//查询房间
465
+			List<TpLevel> levelList= tpLevelMapper.selectList(tpLevel);
466
+			QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
467
+			if (null!=levelList) {
468
+				for (TpLevel level:levelList) {
469
+					tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
470
+					tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
471
+					tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
472
+					tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
473
+					tpBuildingOwnerInfo.eq("level_id", level.getId());
474
+					//先删除所有房间
475
+					tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
476
+				}
477
+			}
478
+
453
 			//再删除所有楼层
479
 			//再删除所有楼层
454
 			tpLevelMapper.delete(tpLevel);
480
 			tpLevelMapper.delete(tpLevel);
455
 			//删除此单元
481
 			//删除此单元
456
-			tpUnitMapper.deleteById(id);
457
-
458
-
459
-
482
+			tpUnitMapper.delete(tpUnit);
483
+			//判断是否为单
484
+			tpBuildingMapper.deleteById(id);
485
+		}
460
 
486
 
487
+		if (type.equals("building")){
488
+			TpPhase phase= tpPhaseMapper.selectById(id);
461
 
489
 
490
+			TpBuilding tpBuilding= tpBuildingMapper.selectById(phase.getId());
491
+			//删除单元-楼层-房间
492
+			QueryWrapper<TpUnit> tpUnit = new QueryWrapper<>();
493
+			if (null!=tpBuilding) {
494
+				tpUnit.eq("community_id", tpBuilding.getCommunityId());
495
+				tpUnit.eq("phase_id", tpBuilding.getPhaseId());
496
+				tpUnit.eq("building_id", tpBuilding.getId());
497
+			}
498
+			//先查询楼层
499
+			List<TpUnit> unitList= tpUnitMapper.selectList(tpUnit);
500
+			QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
501
+			if (null!=unitList) {
502
+				for (TpUnit unit:unitList) {
503
+					tpLevel.eq("phase_id", unit.getPhaseId());
504
+					tpLevel.eq("community_id", unit.getCommunityId());
505
+					tpLevel.eq("building_id", unit.getBuildingId());
506
+					tpLevel.eq("unit_id", unit.getId());
462
 
507
 
463
-			//判断是否为单
508
+					//查询房间
509
+					TpLevel level= tpLevelMapper.selectOne(tpLevel);
510
+					if (null!=level) {
511
+						QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
512
+						tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
513
+						tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
514
+						tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
515
+						tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
516
+						tpBuildingOwnerInfo.eq("level_id", level.getId());
517
+						//先删除所有房间
518
+						tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
519
+				}
520
+					//再删除所有楼层
521
+					tpLevelMapper.delete(tpLevel);
522
+			 }
523
+			}
524
+			//删除此单元
464
 			tpUnitMapper.delete(tpUnit);
525
 			tpUnitMapper.delete(tpUnit);
526
+			//删除栋
527
+			QueryWrapper<TpBuilding> building= new QueryWrapper<>();
528
+			tpLevel.eq("phase_id", phase.getId());
529
+			tpLevel.eq("community_id", phase.getCommunityId());
530
+			tpBuildingMapper.delete(building);
531
+			//删除整个期
532
+			tpPhaseMapper.deleteById(id);
465
 		}
533
 		}
466
-
467
-//		if(type.equals("building")){
468
-//
469
-//			QueryWrapper<TpBuilding> tpBuilding = new QueryWrapper<>();
470
-//			tpBuilding.eq("phase_id", tpPhase.getId());
471
-//			tpBuilding.eq("community_id", tpPhase.getCommunityId());
472
-//			tpBuilding.eq("phase_id", tpPhase.getId());
473
-//			tpBuilding.eq("name", nodeNumber);
474
-//			tpBuildingMapper.delete(tpBuilding);
475
-//		}
476
-
477
-		return null;
534
+		responseBean.addSuccess("成功");
535
+		return responseBean;
478
 	}
536
 	}
479
 
537
 
480
 	private void saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
538
 	private void saveBuildingTreeData(Integer communityId, List<TpBuildingOwnerInfo> list) {
565
 			}
623
 			}
566
 		}
624
 		}
567
 	}
625
 	}
626
+	//删除当前节点判断是否有审核通过的
627
+	private ResponseBean InfoPass(String type,Integer id ) {
628
+		ResponseBean responseBean = new ResponseBean();
629
+		if (type.equals("end")) {
630
+			//判断书否有已审核人员
631
+			TpBuildingOwnerInfo info = tpBuildingOwnerInfoMapper.selectById(id);
632
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
633
+			taUserVerify.eq("community_id", info.getCommunityId())
634
+					.eq("phase_id", info.getPhaseId())
635
+					.eq("building_id", info.getBuildingId())
636
+					.eq("unit_id", info.getUnitId())
637
+					.eq("level_id", info.getLevelId())
638
+					.eq("room_no_id", id)
639
+					.eq("verify_status", 1);
640
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
641
+			if (null != taUserVerifyList) {
642
+				responseBean.addError("不可删除审核已通过人员");
643
+				return responseBean;
644
+			}
645
+		}
646
+		if (type.equals("roomNo")) {
647
+			TpLevel tpLevel = tpLevelMapper.selectById(id);
648
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
649
+			taUserVerify.eq("community_id", tpLevel.getCommunityId())
650
+					.eq("phase_id", tpLevel.getPhaseId())
651
+					.eq("building_id", tpLevel.getBuildingId())
652
+					.eq("unit_id", tpLevel.getUnitId())
653
+					.eq("level_id", tpLevel.getId())
654
+					.eq("verify_status", 1);
655
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
656
+			if (null != taUserVerifyList) {
657
+				responseBean.addError("不可删除审核已通过人员");
658
+				return responseBean;
659
+			}
660
+		}
661
+		if (type.equals("level")) {
662
+			TpUnit tpUnit = tpUnitMapper.selectById(id);
663
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
664
+			taUserVerify.eq("community_id", tpUnit.getCommunityId())
665
+					.eq("phase_id", tpUnit.getPhaseId())
666
+					.eq("building_id", tpUnit.getBuildingId())
667
+					.eq("verify_status", 1);
668
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
669
+			if (null != taUserVerifyList) {
670
+				responseBean.addError("不可删除审核已通过人员");
671
+				return responseBean;
672
+			}
673
+		}
674
+		if (type.equals("unit")) {
675
+			//判断书否有已审核人员
676
+			TpBuilding tpBuilding = tpBuildingMapper.selectById(id);
677
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
678
+			taUserVerify.eq("community_id", tpBuilding.getCommunityId())
679
+					.eq("phase_id", tpBuilding.getPhaseId())
680
+					.eq("building_id", tpBuilding.getId())
681
+					.eq("verify_status", 1);
682
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
683
+			if (null != taUserVerifyList) {
684
+				responseBean.addError("不可删除审核已通过人员");
685
+
686
+				return responseBean;
687
+			}
688
+		}
689
+		if (type.equals("building")) {
690
+			TpPhase phase = tpPhaseMapper.selectById(id);
691
+			QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
692
+			taUserVerify.eq("community_id", phase.getCommunityId())
693
+					.eq("phase_id", phase.getId())
694
+					.eq("verify_status", 1);
695
+			List<TaUserVerify> taUserVerifyList = taUserVerifyMapper.selectList(taUserVerify);
696
+			if (null != taUserVerifyList) {
697
+				responseBean.addError("不可删除审核已通过人员");
698
+				return responseBean;
699
+			}
700
+		}
701
+		responseBean.addError("成功");
702
+		return responseBean;
703
+	}
568
 }
704
 }

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

285
         // 活动配图
285
         // 活动配图
286
         JSONArray jsonArray = jsonObject.getJSONArray("contentImg");
286
         JSONArray jsonArray = jsonObject.getJSONArray("contentImg");
287
         String [] contentImgArray = jsonArray.toArray(new String[]{});
287
         String [] contentImgArray = jsonArray.toArray(new String[]{});
288
+        //是否需要签到二维码1:需要2不需要
289
+        int radio= jsonObject.getIntValue("radio");
288
 
290
 
289
         TpActivity selectTpActivity = tpActivityMapper.selectById(tpActivity.getId());
291
         TpActivity selectTpActivity = tpActivityMapper.selectById(tpActivity.getId());
290
         if (null == selectTpActivity) {
292
         if (null == selectTpActivity) {
334
          queryWrapper.eq("type", "activity");
336
          queryWrapper.eq("type", "activity");
335
          tdImagesMapper.delete(queryWrapper);
337
          tdImagesMapper.delete(queryWrapper);
336
 
338
 
339
+        if (radio==1){
340
+            try {
341
+                InputStream inputStream= QRCode.encode(tpActivity.getId()+"");
342
+                String codeUrl= imageServiceI.getImageUrl(inputStream);
343
+                TdImages tdImages= new TdImages();
344
+                tdImages.setImageUrl(codeUrl);
345
+                tdImages.setUuid(tpActivity.getId());
346
+                tdImages.setType(Constant.ACTIVITY);
347
+                tdImages.setCreateUser(userElement.getId());
348
+                tdImages.setCreateTime(LocalDateTime.now());
349
+                tdImagesMapper.insert(tdImages);
350
+            } catch (WriterException e) {
351
+                e.printStackTrace();
352
+            } catch (IOException e) {
353
+                e.printStackTrace();
354
+            }
355
+
356
+        }
357
+
337
 
358
 
338
         // 插入图片
359
         // 插入图片
339
         insertImg(contentImgArray, userElement, tpActivity);
360
         insertImg(contentImgArray, userElement, tpActivity);

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

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.alibaba.fastjson.JSONArray;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.alibaba.fastjson.JSONObject;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
9
 import com.community.commom.session.UserElement;
10
 import com.community.commom.session.UserElement;
10
 import com.community.huiju.dao.TdImagesMapper;
11
 import com.community.huiju.dao.TdImagesMapper;
11
 import com.community.huiju.dao.TpTransactionMapper;
12
 import com.community.huiju.dao.TpTransactionMapper;
12
-import com.community.huiju.model.TdImages;
13
-import com.community.huiju.model.TpBuildingOwnerInfo;
14
-import com.community.huiju.model.TpTransaction;
13
+import com.community.huiju.dao.TransactionLikeMapper;
14
+import com.community.huiju.dao.TransactionReportMapper;
15
+import com.community.huiju.model.*;
15
 import com.community.huiju.service.ITransactionService;
16
 import com.community.huiju.service.ITransactionService;
16
 import com.google.common.collect.Maps;
17
 import com.google.common.collect.Maps;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
40
 	
41
 	
41
 	@Autowired
42
 	@Autowired
42
 	private TdImagesMapper tdImagesMapper;
43
 	private TdImagesMapper tdImagesMapper;
43
-	
44
+
45
+	@Autowired
46
+	private TransactionLikeMapper transactionLikeMapper;
47
+
48
+	@Autowired
49
+	private TransactionReportMapper transactionReportMapper;
50
+
51
+
44
 	@Override
52
 	@Override
45
-	public ResponseBean getTransactionList(TpTransaction tpTransaction, Integer pageNum, Integer pageSize) {
53
+	public ResponseBean getTransactionList(String parameter,Integer communityId) {
46
 		ResponseBean responseBean = new ResponseBean();
54
 		ResponseBean responseBean = new ResponseBean();
47
-		Page page = new Page(pageNum,pageSize);
55
+		JSONObject object= JSONObject.parseObject(parameter);
56
+		String transactionTitle = object.getString("transactionTitle");
57
+		String userName = object.getString("userName");
58
+		Integer id = object.getInteger("id");
59
+		Integer status = object.getInteger("status");
60
+		Integer pageNum = object.getInteger("pageNum");
61
+		Integer pageSize = object.getInteger("pageSize");
62
+		Page<TpTicket> page = new Page<>();
63
+		page.setSize(pageSize == null ? 10 : pageSize);
64
+		page.setCurrent(pageNum == null ? 1 : pageNum);
48
 		// 分页查询
65
 		// 分页查询
49
-		List<TpTransaction> list = tpTransactionMapper.selectListByParams(page,tpTransaction);
66
+		List<TpTransaction> list = tpTransactionMapper.selectListByParams(page,transactionTitle,userName,id,status,communityId);
67
+
68
+		list = list.stream().map( e-> {
69
+
70
+			QueryWrapper<TransactionLike> transactionLike= new QueryWrapper<>();
71
+			transactionLike.eq("transaction_id",e.getId());
72
+			transactionLike.eq("like_status",2);
73
+			//不喜欢的总数
74
+			 Integer transactionLikeCount= transactionLikeMapper.selectCount(transactionLike);
75
+			e.setTransactionNoLikeSum(transactionLikeCount);
76
+
77
+			QueryWrapper<TransactionReport> TransactionReport= new QueryWrapper<>();
78
+			TransactionReport.eq("transaction_id",e.getId());
79
+			Integer TransactionReportCount= transactionReportMapper.selectCount(TransactionReport);
80
+			e.setReportSum(TransactionReportCount);
81
+
82
+			return e;
83
+		}).collect(Collectors.toList());
50
 		Map<String, Object> map = Maps.newHashMap();
84
 		Map<String, Object> map = Maps.newHashMap();
51
 		map.put("list",list);
85
 		map.put("list",list);
52
 		map.put("total",page.getTotal());
86
 		map.put("total",page.getTotal());
87
+		map.put("pageNum", page.getCurrent());
88
+		map.put("pageSize", page.getSize());
53
 		responseBean.addSuccess(map);
89
 		responseBean.addSuccess(map);
54
 		return responseBean;
90
 		return responseBean;
55
 	}
91
 	}
68
 		queryWrapper.eq("uuid", id);
104
 		queryWrapper.eq("uuid", id);
69
 		queryWrapper.eq("type", "transaction");
105
 		queryWrapper.eq("type", "transaction");
70
 		List<TdImages> imagesList = tdImagesMapper.selectList(queryWrapper);
106
 		List<TdImages> imagesList = tdImagesMapper.selectList(queryWrapper);
71
-		// 转换, 只保留 imageUrl 字段
107
+		// 转换, 只保留 imageUrl 字段·
72
 		List<String> stringList = imagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
108
 		List<String> stringList = imagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
73
 		Map<String,Object> map = Maps.newHashMap();
109
 		Map<String,Object> map = Maps.newHashMap();
74
 		map.put("tpTransaction",tpTransaction);
110
 		map.put("tpTransaction",tpTransaction);
99
 		responseBean.addError("作废出错");
135
 		responseBean.addError("作废出错");
100
 		return responseBean;
136
 		return responseBean;
101
 	}
137
 	}
138
+
139
+	@Override
140
+	public ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id) {
141
+		ResponseBean response = new ResponseBean();
142
+		JSONObject jsonobject = JSONObject.parseObject(paramets);
143
+		TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
144
+		tpTransaction.setCommunityId(communityId);
145
+		tpTransaction.setTaUserId(null);
146
+		tpTransaction.setCreateDate(LocalDateTime.now());
147
+		tpTransaction.setCreateUser(id);
148
+		tpTransaction.setViewCount(0);
149
+		JSONArray contentImg = jsonobject.getJSONArray("contentImg");
150
+		String[] contentImgArray = contentImg.toArray(new String[]{});
151
+		if (tpTransaction.getTransactionTitle() == null) {
152
+			response.addError("标题不能为空");
153
+			return response;
154
+		}
155
+		if (null == tpTransaction.getTransactionContent() && null == contentImg) {
156
+			response.addError("内容和图片必须填一个");
157
+			return response;
158
+		}
159
+		for (String img : contentImgArray) {
160
+			TdImages tdImages = new TdImages();
161
+			tdImages.setImageUrl(img);
162
+			tdImages.setType("transaction");
163
+			tdImages.setUuid(tpTransaction.getId());
164
+			tdImages.setCreateTime(LocalDateTime.now());
165
+			tdImages.setCreateUser(id);
166
+			tdImagesMapper.insert(tdImages);
167
+		}
168
+		return response;
169
+
170
+	}
102
 }
171
 }

+ 14
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java View File

59
     @Autowired
59
     @Autowired
60
     private  SysUserRoleMapper sysUserRoleMapper;
60
     private  SysUserRoleMapper sysUserRoleMapper;
61
 
61
 
62
+    @Autowired
63
+    private  TaUserMapper taUserMapper;
64
+
62
 
65
 
63
     @Override
66
     @Override
64
     public ResponseBean login(String phone, Integer communityId, String code) {
67
     public ResponseBean login(String phone, Integer communityId, String code) {
245
         JSONArray List = object.getJSONArray("menuArray");
248
         JSONArray List = object.getJSONArray("menuArray");
246
         Integer[] roleIdArray = List.toArray(new Integer[]{});
249
         Integer[] roleIdArray = List.toArray(new Integer[]{});
247
         String remark = object.getString("remark");
250
         String remark = object.getString("remark");
248
-
251
+       //时维护ta_user(发帖需要)
252
+        TaUser  taUser= new TaUser();
253
+        taUser.setLoginName(loginName)
254
+                .setCreateUser(userID)
255
+                .setCreateDate(LocalDateTime.now())
256
+                .setUserName(userName)
257
+                .setStatus("1");
258
+        taUserMapper.insert(taUser);
259
+        user.setTaUserId(taUser.getId());
249
         user.setUserName(userName);
260
         user.setUserName(userName);
250
         user.setLoginName(loginName);
261
         user.setLoginName(loginName);
251
         user.setRemark(remark);
262
         user.setRemark(remark);
252
-        user.setStatus("1");;
263
+        user.setStatus("1");
264
+
253
         user.setCreateUser(userID);
265
         user.setCreateUser(userID);
254
         user.setCreateDate(LocalDateTime.now());
266
         user.setCreateDate(LocalDateTime.now());
255
         user.setCommunityId(communityId);
267
         user.setCommunityId(communityId);

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

3
 <mapper namespace="com.community.huiju.dao.TpTransactionMapper">
3
 <mapper namespace="com.community.huiju.dao.TpTransactionMapper">
4
     <select id="selectListByParams" resultType="com.community.huiju.model.TpTransaction">
4
     <select id="selectListByParams" resultType="com.community.huiju.model.TpTransaction">
5
         SELECT
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
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.create_user,
13
+        t.is_reported AS isReported,
14
+        t.create_date AS createDate,
15
+        ta.user_name AS userName,
16
+        COUNT(li.transaction_id) AS  transactionLikeSum,
17
+        COUNT(re.transaction_id) AS replySum
15
         FROM
18
         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 != '' or tpTransaction.id ==0">
23
-            and t.id like concat('%',#{tpTransaction.id},'%')
19
+        tp_transaction t
20
+        LEFT JOIN ta_user ta ON  t.create_user = ta.id
21
+        LEFT JOIN ta_visitor v ON ta.id = v.ta_user_id
22
+        LEFT JOIN tp_transaction_like li ON t.id = li.transaction_id AND li.like_status=1
23
+        LEFT JOIN tp_transaction_reply re ON t.id = re.transaction_id
24
+        WHERE t.community_id =#{communityId}
25
+        <if test="id != null and id != '' or id ==0">
26
+            and t.id like concat('%',#{id},'%')
24
         </if>
27
         </if>
25
-        <if test="tpTransaction.transactionTitle != null and tpTransaction.transactionTitle != ''">
26
-            and t.transaction_title like concat('%',#{tpTransaction.transactionTitle,jdbcType=VARCHAR},'%')
28
+        <if test="transactionTitle != null and transactionTitle != ''">
29
+            and t.transaction_title like concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
27
         </if>
30
         </if>
28
-        <if test="tpTransaction.status != null and tpTransaction.status != ''">
29
-            and t.status = #{tpTransaction.status}
31
+        <if test="status != null and status != '' and status != '-1' ">
32
+            and t.status = #{status}
30
         </if>
33
         </if>
31
-        <if test="tpTransaction.isReported != null and tpTransaction.isReported != ''">
32
-            and t.is_reported = #{tpTransaction.isReported}
34
+        <if test="status != null and status != '' and status = '-1' ">
35
+            and  t.type in(0,1,2)
33
         </if>
36
         </if>
37
+        <if test="userName != null and userName != ''">
38
+            and ta.user_name like concat('%',#{userName,jdbcType=VARCHAR},'%')
39
+        </if>
40
+        GROUP BY
41
+        t.id
34
         ORDER BY t.create_date desc
42
         ORDER BY t.create_date desc
35
     </select>
43
     </select>
36
 </mapper>
44
 </mapper>

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

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.TransactionLikeMapper">
4
+
5
+</mapper>

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

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.mapper.TransactionReportMapper">
4
+
5
+</mapper>

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

39
     url: '/activity/update',
39
     url: '/activity/update',
40
     method: 'put',
40
     method: 'put',
41
     data: {
41
     data: {
42
+      radio: data.radio,
42
       id: data.id,
43
       id: data.id,
43
       activityTitle: data.activityTitle,
44
       activityTitle: data.activityTitle,
44
       activityCarouselImg: data.activityCarouselImg, // 轮播图
45
       activityCarouselImg: data.activityCarouselImg, // 轮播图

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

23
     method: 'post'
23
     method: 'post'
24
   })
24
   })
25
 }
25
 }
26
+
27
+export function transactionsList(data) {
28
+  return request({
29
+    url: '/transactions',
30
+    method: 'post',
31
+    data: {
32
+      transactionTitle: data.transactionTitle,
33
+      id: data.id,
34
+      userName: data.userName,
35
+      status: data.status,
36
+      pageNum: data.pageNum,
37
+      pageSize: data.pageSize
38
+    }
39
+  })
40
+}
41
+
42
+export function transactionsAdd(data) {
43
+  return request({
44
+    url: '/transactions/add',
45
+    method: 'post',
46
+    data: {
47
+      transactionTitle: data.transactionTitle,
48
+      id: data.id,
49
+      userName: data.userName,
50
+      status: data.status,
51
+      contentImg: data.contentImg,
52
+      announcementContent: data.announcementContent
53
+    }
54
+  })
55
+}

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

82
         name: 'building-edi',
82
         name: 'building-edi',
83
         hidden: true,
83
         hidden: true,
84
         meta: { title: '修改楼栋业主资料', icon: 'table' }
84
         meta: { title: '修改楼栋业主资料', icon: 'table' }
85
+      },
86
+      {
87
+        path: '/building/audit/index',
88
+        component: () => import('@/views/building/audit/index'),
89
+        name: 'building-audit-index',
90
+        meta: { title: '资料审核', icon: 'building' }
85
       }
91
       }
86
     ]
92
     ]
87
   },
93
   },
111
         name: 'transaction-import',
117
         name: 'transaction-import',
112
         meta: { title: '二手等管理', icon: 'table' }
118
         meta: { title: '二手等管理', icon: 'table' }
113
       },
119
       },
120
+      {
121
+        path: '/transaction/transaction',
122
+        component: () => import('@/views/social/transaction/transactionAdd'),
123
+        name: 'transaction-add',
124
+        hidden: true,
125
+        meta: { title: '添加二手求购', icon: 'table' }
126
+      },
114
       {
127
       {
115
         path: '/transaction/info',
128
         path: '/transaction/info',
116
         component: () => import('@/views/social/transaction/info/transactionInfo'),
129
         component: () => import('@/views/social/transaction/info/transactionInfo'),
166
         name: 'contentParticulars-details',
179
         name: 'contentParticulars-details',
167
         hidden: true,
180
         hidden: true,
168
         meta: { title: '公告详情', icon: 'table' }
181
         meta: { title: '公告详情', icon: 'table' }
182
+      },
183
+      {
184
+        path: '/activity/signIn/index',
185
+        component: () => import('@/views/social/activity/signIn/index'),
186
+        name: 'activity-signIn-index',
187
+        hidden: true,
188
+        meta: { title: '活动签到', icon: 'table' }
169
       }
189
       }
170
     ]
190
     ]
171
   },
191
   },

+ 19
- 1
VUECODE/smart-property-manage/src/store/modules/transaction.js View File

1
-import { fetchList, transactionById, updateTransactionById } from '@/api/transaction'
1
+import { fetchList, transactionById, updateTransactionById, transactionsList, transactionsAdd} from '@/api/transaction'
2
 
2
 
3
 const transaction = {
3
 const transaction = {
4
   namespaced: true,
4
   namespaced: true,
47
           reject(error)
47
           reject(error)
48
         })
48
         })
49
       })
49
       })
50
+    },
51
+    TransactionsList({ commit }, data) {
52
+      return new Promise((resolve, reject) => {
53
+        transactionsList(data).then(response => {
54
+          resolve(response)
55
+        }).catch(error => {
56
+          reject(error)
57
+        })
58
+      })
59
+    },
60
+    TransactionsAdd({ commit }, data) {
61
+      return new Promise((resolve, reject) => {
62
+        transactionsAdd(data).then(response => {
63
+          resolve(response)
64
+        }).catch(error => {
65
+          reject(error)
66
+        })
67
+      })
50
     }
68
     }
51
   }
69
   }
52
 }
70
 }

+ 15
- 0
VUECODE/smart-property-manage/src/views/building/audit/index.vue View File

1
+<template>
2
+  <div id="root">
3
+    审核资料
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'Audit'
10
+}
11
+</script>
12
+
13
+<style scoped>
14
+
15
+</style>

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

62
           <span style="color: #409EFF;cursor: pointer" @click="selectSignUpActivity(scope.row.id)" >{{ scope.row.signUpCount }}</span>
62
           <span style="color: #409EFF;cursor: pointer" @click="selectSignUpActivity(scope.row.id)" >{{ scope.row.signUpCount }}</span>
63
         </template>
63
         </template>
64
       </el-table-column>
64
       </el-table-column>
65
+      <el-table-column
66
+        prop="signInCount"
67
+        label="签到人数"
68
+        align="center">
69
+        <template slot-scope="scope">
70
+          <span style="color: #409EFF;cursor: pointer" @click="activitySignInIndex(scope.row.id)" >{{ scope.row.signInCount }}</span>
71
+        </template>
72
+      </el-table-column>
65
       <el-table-column
73
       <el-table-column
66
         prop="status"
74
         prop="status"
67
         label="状态"
75
         label="状态"
264
     },
272
     },
265
     selectSignUpActivity(id) {
273
     selectSignUpActivity(id) {
266
       this.$router.push({ name: 'signUp-info', params: { id: id }})
274
       this.$router.push({ name: 'signUp-info', params: { id: id }})
275
+    },
276
+    activitySignInIndex(id) {
277
+      this.$router.push({ name: 'activity-signIn-index', query: { id: id }})
267
     }
278
     }
268
   }
279
   }
269
 }
280
 }

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

1
+<template>
2
+  <div id="root">
3
+    签到管理
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'SignIn'
10
+}
11
+</script>
12
+
13
+<style scoped>
14
+
15
+</style>

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

1
+
1
 <template>
2
 <template>
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="info" @click="clearListQuery">清空</el-button>
15
-      <el-button v-waves class="filter-item" type="primary" @click="handleFilter">查询</el-button>
3
+  <div class="root">
4
+    <el-form :inline="true" :model="listQuery" class="form-listQuery">
5
+      <el-form-item class="filter-item" label="话题编号">
6
+        <el-input v-model.trim="listQuery.id" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="话题编号" />
7
+      </el-form-item>
8
+      <el-form-item class="filter-item" label="话题标题" >
9
+        <el-input v-model.trim="listQuery.transactionTitle" placeholder="话题标题" />
10
+      </el-form-item>
11
+      <el-form-item class="filter-item" label="话题发布人" >
12
+        <el-input v-model.trim="listQuery.userName" placeholder="话题发布人" />
13
+      </el-form-item>
14
+      <el-form-item class="filter-item" label="话题类型" >
15
+        <el-select v-model="listQuery.status" placeholder="请选择">
16
+         <el-option label="选择状态" value="" />
17
+         <el-option label="议事大厅" value="0"/>
18
+         <el-option label="友令互助" value="1"/>
19
+         <!-- -1包括,二手,租赁,求购 -->
20
+         <el-option label="二手租赁" value="-1"/>
21
+         <el-option label="其他" value="3"/>
22
+        </el-select>
23
+      </el-form-item>
24
+      <el-form-item>
25
+        <el-button type="info" class="filter-item" @click="handleFilter">清空</el-button>
26
+        <el-button type="primary" @click="search">查询</el-button>
27
+      </el-form-item>
28
+    </el-form>
29
+    <div class="button">
30
+      <el-button type="primary" @click="add">添加</el-button>
31
+      <el-button type="warning" @click="edit">修改</el-button>
32
+      <el-button type="danger" @click="deleteAnnouncement">作废</el-button>
16
     </div>
33
     </div>
17
-
18
     <el-table
34
     <el-table
19
       v-loading="listLoading"
35
       v-loading="listLoading"
20
-      :key="tableKey"
21
-      :data="transactionList"
36
+      ref="multipleTable"
37
+      :data="transactionsList"
22
       border
38
       border
23
-      fit
24
-      highlight-current-row
39
+      tooltip-effect="dark"
25
       style="width: 100%; margin-top: 20px;"
40
       style="width: 100%; margin-top: 20px;"
26
-      @sort-change="sortChange">
27
-      <el-table-column label="编号" align="center">
28
-        <template slot-scope="scope">
29
-          <span>{{ scope.row.id }}</span>
30
-        </template>
31
-      </el-table-column>
32
-      <el-table-column label="类型" align="center">
33
-        <template slot-scope="scope">
34
-          <span v-if="scope.row.type === '0'">二手</span>
35
-          <span v-if="scope.row.type === '1'">求购</span>
36
-          <span v-if="scope.row.type === '2'">租赁</span>
37
-        </template>
38
-      </el-table-column>
39
-      <el-table-column label="标题" align="center">
40
-        <template slot-scope="scope">
41
-          <span @click="handleLook(scope.row.id)" style="color: #409EFF;cursor: pointer">{{ scope.row.transactionTitle }}</span>
42
-        </template>
43
-      </el-table-column>
44
-      <el-table-column label="查看人数" align="center">
45
-        <template slot-scope="scope">
46
-          <span>{{ scope.row.viewCount }}</span>
47
-        </template>
48
-      </el-table-column>
49
-      <el-table-column label="发布人" align="center">
50
-        <template slot-scope="scope">
51
-          <span>{{ scope.row.userName }}</span>
52
-        </template>
53
-      </el-table-column>
54
-      <el-table-column label="发布时间" align="center">
55
-        <template slot-scope="scope">
56
-          <span>{{ formatDate(scope.row.createDate) }}</span>
57
-        </template>
58
-      </el-table-column>
59
-      <el-table-column label="发布状态" align="center">
60
-        <template slot-scope="scope">
61
-          <span v-if="scope.row.status === '0'">已作废</span>
62
-          <span v-if="scope.row.status === '1'">已发布</span>
63
-        </template>
64
-      </el-table-column>
65
-      <el-table-column label="举报状态" align="center">
66
-        <template slot-scope="scope">
67
-          <span>{{ scope.row.isReported === '1' ? "被举报" : "无举报" }}</span>
68
-        </template>
69
-      </el-table-column>
70
-    </el-table>
71
-
72
-    <!-- <pagination v-show="total>0" :total="total" :current-page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 20, 30]" @pagination="getList" /> -->
73
-    <el-pagination
74
-      :total="total"
75
-      :current-page="listQuery.pageNum"
76
-      :page-sizes="[5, 10, 20, 30]"
77
-      :page-size="listQuery.pageSize"
78
-      layout="total, sizes, prev, pager, next, jumper"
79
-      @size-change="handleSizeChange"
80
-      @current-change="handleCurrentChange"/>
41
+      @selection-change="handleSelectionChange">
42
+      <el-table-column
43
+        type="selection"
44
+        width="55"/>
45
+      <el-table-column prop="id" label="话题编号" align="center"/>
46
+       <el-table-column prop="type" label="话题类型" align="center"/>
47
+      <el-table-column prop="transactionTitle" label="话题标题" align="center"/>
48
+      <el-table-column prop="userName" label="发布人" align="center"/>
49
+      <el-table-column prop="createDate" label="发布时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
81
 
50
 
51
+      <el-table-column prop="viewCount" label="查看人数" align="center"/>
52
+      <el-table-column prop="transactionLikeSum" label="点赞数" align="center"/>
53
+      <el-table-column prop="transactionNoLikeSum" label="点衰数" align="center"/>
54
+      <el-table-column prop="replySum" label="回复数" align="center"/>
55
+      <el-table-column prop="reportSum" label="举报数量" align="center"/>
56
+    </el-table>
57
+    <div class="block">
58
+      <el-pagination
59
+        :current-page.sync="listQuery.pageNum"
60
+        :page-sizes="[10, 20, 50, 100]"
61
+        :page-size.sync="listQuery.pageSize"
62
+        :total="total"
63
+        layout="total, sizes, prev, pager, next, jumper"
64
+        @size-change="handleSizeChange"
65
+        @current-change="handleCurrentChange"/>
66
+    </div>
82
   </div>
67
   </div>
83
 </template>
68
 </template>
84
 
69
 
85
 <script>
70
 <script>
86
-import { mapState, mapActions, mapMutations } from 'vuex'
87
-import waves from '@/directive/waves' // Waves directive
88
-import { parseTime } from '@/utils'
71
+import { mapActions } from 'vuex'
89
 
72
 
90
 export default {
73
 export default {
91
-  computed: {
92
-    ...mapState('transaction', {
93
-      transactionList: s => s.transactionList,
94
-      total: s => s.total
95
-    })
96
-  },
97
-  directives: { waves },
98
   data() {
74
   data() {
99
-    var _self = this
100
     return {
75
     return {
101
-      events: {
102
-        click: (e) => {
103
-          // _self.postData.Coordinate = e.lnglat.lat + ',' + e.lnglat.lng
104
-          _self.detail.longitude = e.lnglat.lng
105
-          _self.detail.latitude = e.lnglat.lat
106
-        }
107
-      },
108
-      markers: [],
109
-      searchOption: {
110
-        city: '南京',
111
-        citylimit: false
112
-      },
113
-      listLoading: true,
114
       listQuery: {
76
       listQuery: {
77
+        communityId: '',
78
+				createDate:'',
79
+				createUser:'',
80
+				id:'',
81
+				isReported:'',
82
+				status:'',
83
+				taUserId:'',
84
+				transactionContent:'',
85
+				transactionTitle:'',
86
+				type:'',
87
+				updateDate:'',
88
+				updateUser:'',
89
+				userName:'',
90
+        viewCount:'',
115
         pageNum: 1,
91
         pageNum: 1,
116
-        pageSize: 20,
117
-        transactionId: undefined,
118
-        transactionTitle: undefined,
119
-        status: undefined,
120
-        isReported: undefined
92
+        pageSize: 10
121
       },
93
       },
122
-      tableKey: 0,
123
-      downloadLoading: false
94
+      total: 0, // 数据总数
95
+      transactionsList: [],
96
+      deleteIds: [], // 选择的id集合
97
+      listLoading: true // 加载圈
124
     }
98
     }
125
   },
99
   },
126
-  created() {
127
-    this.getList()
100
+  mounted() {
101
+    // 获取数据
102
+    this.dataQuery()
128
   },
103
   },
129
   methods: {
104
   methods: {
130
-    ...mapMutations('transaction', {
131
-    }),
132
-    ...mapActions('transaction', [
133
-      'FetchTransactionList'
105
+    ...mapActions('listAnnouncement', [
106
+      'BserPassCertification'
134
     ]),
107
     ]),
135
-    setCurrent(item) {
136
-      this.setDetail({ ...item })
108
+    handleSizeChange(val) {
109
+      console.log(`每页 ${val} 条`)
110
+      this.listQuery.pageSize = val
111
+      this.dataQuery()
112
+    },
113
+    handleCurrentChange(val) {
114
+      console.log(`当前页: ${val}`)
115
+      this.listQuery.pageNum = val
116
+      this.dataQuery()
117
+    },
118
+    padDate(value) {
119
+      value = value < 10 ? '0' + value : value
120
+      return value
137
     },
121
     },
138
-    getList() {
122
+    getStatus(row) { // 获取状态
123
+      let statusName = ''
124
+
125
+      // 判断状态
126
+      switch (row.status) {
127
+        case '0':
128
+          statusName = '已作废'
129
+          break
130
+        case '1':
131
+          statusName = '已发布'
132
+          break
133
+        case '2':
134
+          statusName = '草稿'
135
+          break
136
+      }
137
+
138
+      // 如果修改时间和创建时间不一致, 就显示已修改
139
+      if (row.status === '1' && (row.updateDate > row.createDate)) {
140
+        statusName = '已修改'
141
+      }
142
+
143
+      return statusName
144
+    },
145
+    dataQuery() { // 查询数据
146
+    
147
+    console.log('this.listQuery.transactionTitle',this.listQuery.transactionTitle)
139
       this.listLoading = true
148
       this.listLoading = true
140
-      this.FetchTransactionList(this.listQuery).then(() => {
149
+      this.$store.dispatch('transaction/TransactionsList', this.listQuery).then((res) => {
150
+        const resData = res.data
151
+        this.transactionsList = resData.list
152
+        this.listQuery.pageNum = resData.pageNum
153
+        this.listQuery.pageSize = resData.pageSize
154
+        this.total = resData.total
141
         this.listLoading = false
155
         this.listLoading = false
142
       }).catch(() => {
156
       }).catch(() => {
143
-        this.loading = false
144
-        console.log('get list error')
157
+        this.listLoading = false
158
+        console.log('error TransactionsList')
145
       })
159
       })
146
     },
160
     },
147
-    clearListQuery() {
161
+    handleSelectionChange(data) {
162
+      // 设置为 空
163
+      this.deleteIds = []
164
+      for (let i = 0; i < data.length; i++) {
165
+        this.deleteIds.push(data[i].id)
166
+      }
167
+    },
168
+	  search() {
148
       this.listQuery.pageNum = 1
169
       this.listQuery.pageNum = 1
149
-      this.listQuery.pageSize = 20
150
-      this.listQuery.transactionId = undefined
151
-      this.listQuery.transactionTitle = undefined
152
-      this.listQuery.status = undefined
153
-      this.listQuery.isReported = undefined
154
-      this.getList()
170
+      this.dataQuery()
155
     },
171
     },
156
     handleFilter() {
172
     handleFilter() {
157
       this.listQuery.pageNum = 1
173
       this.listQuery.pageNum = 1
158
-      this.getList()
174
+      this.listQuery.pageSize = 10
175
+      this.listQuery.ownerName =''
176
+      this.listQuery.id=''
177
+      this.listQuery.status=''
178
+      this.listQuery.userName=''
179
+      this.dataQuery()
159
     },
180
     },
160
-    handleModifyStatus(row, status) {
161
-      this.$message({
162
-        message: '操作成功',
163
-        type: 'success'
164
-      })
165
-      row.status = status
181
+    // 添加公告
182
+    add() {
183
+      this.$router.push({ name: 'transaction-add' })
166
     },
184
     },
167
-    sortChange(data) {
168
-      const { prop, order } = data
169
-      if (prop === 'id') {
170
-        this.sortByID(order)
185
+    edit(){// 编辑公告
186
+      const ids = this.deleteIds
187
+      if (ids.length > 1) {
188
+        this.$message.error('只能选择一行数据进行修改!')
189
+        return
171
       }
190
       }
172
-    },
173
-    handleSizeChange(val) {
174
-      // console.log(`每页 ${val} 条`);
175
-      this.listQuery.pageSize = val
176
-      this.getList()
177
-    },
178
-    handleCurrentChange(val) {
179
-      // console.log(`当前页: ${val}`);
180
-      this.listQuery.pageNum = val
181
-      this.getList()
182
-    },
183
-    sortByID(order) {
184
-      if (order === 'ascending') {
185
-        this.listQuery.sort = '+id'
186
-      } else {
187
-        this.listQuery.sort = '-id'
191
+      if (ids < 1) {
192
+        this.$message.error('请选择一行数据进行修改!')
193
+        return
188
       }
194
       }
189
-      this.handleFilter()
190
-    },
191
-    handleUpdate(row) {
192
-      this.setCurrent(row)
193
-      this.dialogStatus = 'update'
194
-      this.dialogFormVisible = true
195
-      this.$nextTick(() => {
196
-        this.$refs['dataForm'].clearValidate()
197
-      })
198
-      this.getEditCityList()
199
-      this.getEditDistrictList()
200
-    },
201
-    handleLook(id) {
202
-      this.$router.push({ name: 'transaction-info', params: { id: id }})
203
-    },
204
-    handleCreate() {
205
-      this.resetDetail()
206
-      this.dialogStatus = 'create'
207
-      this.dialogFormVisible = true
208
-      this.$nextTick(() => {
209
-        this.$refs['dataForm'].clearValidate()
210
-      })
211
-    },
212
-    handleDelete(row) {
213
-      this.$notify({
214
-        title: '成功',
215
-        message: '删除成功',
216
-        type: 'success',
217
-        duration: 2000
218
-      })
219
-      const index = this.list.indexOf(row)
220
-      this.list.splice(index, 1)
195
+       let ide= this.deleteIds[0]
196
+       this.listQuery.id = ide
197
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
198
+        const resData = res.data
199
+        const announcement = resData.tpAnnouncement
200
+        const imgList = resData.studentList
201
+        this.listQuery = announcement
202
+        this.listQuery.announcementTitle = ''
203
+        console.log("1",this.listQuery.status)
204
+        if(this.listQuery.status == 0){
205
+          this.$message.error('已作废不可以修改')
206
+          return
207
+        }
208
+       this.$router.push({ name: 'announcement-edit', params: { id: ids[0] }})
209
+      }) 
210
+      },
211
+    deleteAnnouncement(){
212
+       let ide= this.deleteIds[0]
213
+       this.listQuery.id = ide 
214
+      this.$store.dispatch('AnnouncementById', this.listQuery).then((res) => {
215
+        const resData = res.data
216
+        const announcement = resData.tpAnnouncement
217
+        const imgList = resData.studentList
218
+        this.listQuery.status= announcement.status
219
+        console.log("1",this.listQuery.status)
220
+        if(this.listQuery.status == 0){
221
+          this.$message.error('已作废不可以作废')
222
+          return
223
+        }
224
+        this.deleteId()     
225
+      })    
221
     },
226
     },
222
-    handleDownload() {
223
-      this.downloadLoading = true
224
-      import('@/vendor/Export2Excel').then(excel => {
225
-        const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
226
-        const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
227
-        const data = this.formatJson(filterVal, this.list)
228
-        excel.export_json_to_excel({
229
-          header: tHeader,
230
-          data,
231
-          filename: 'table-list'
232
-        })
233
-        this.downloadLoading = false
227
+
228
+    deleteId(){
229
+       const ids = this.deleteIds
230
+      this.listLoading = true
231
+      console.log(ids)
232
+      this.$store.dispatch('DeleteAnnouncement', ids).then((res) => {
233
+        this.listLoading = false
234
+        this.listQuery.announcementTitle = ''
235
+        this.dataQuery()
236
+      }).catch(() => {
237
+        this.listLoading = false
238
+        console.log('error DeleteAnnouncement')
234
       })
239
       })
235
     },
240
     },
236
-    padDate(value) {
237
-      value = value < 10 ? '0' + value : value
238
-      return value
241
+
242
+
243
+    clickTitle(id) {
244
+      this.$router.push({ name: 'contentParticulars-details', query: { id: id }})
239
     },
245
     },
240
     formatDate(val) {
246
     formatDate(val) {
247
+      if (val === null) {
248
+        return ''
249
+      }
241
       var value = new Date(val)
250
       var value = new Date(val)
242
       var year = value.getFullYear()
251
       var year = value.getFullYear()
243
-      var month = this.padDate(value.getMonth() + 1)
244
-      var day = this.padDate(value.getDate())
245
-      var hour = this.padDate(value.getHours())
246
-      var minutes = this.padDate(value.getMinutes())
247
-      var seconds = this.padDate(value.getSeconds())
248
-      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
249
-    },
250
-    formatJson(filterVal, jsonData) {
251
-      return jsonData.map(v => filterVal.map(j => {
252
-        if (j === 'timestamp') {
253
-          return parseTime(v[j])
254
-        } else {
255
-          return v[j]
256
-        }
257
-      }))
258
-    },
252
+      var month = value.getMonth() + 1
253
+      var day = value.getDate()
254
+      return year + '-' + month + '-' + day
255
+    }
259
   }
256
   }
260
 }
257
 }
261
 </script>
258
 </script>
259
+
260
+<style scoped>
261
+.root{
262
+  display: flex;
263
+  flex-flow: column;
264
+}
265
+.form-listQuery{
266
+  margin-top: 20px;
267
+  margin-left: 30px;
268
+}
269
+.operation{
270
+  display: flex;
271
+  justify-content: space-between;
272
+  margin-left: 20px;
273
+  margin-right: 20px;
274
+}
275
+.block{
276
+  display: flex;
277
+  justify-content: flex-end;
278
+  margin-top: 10px;
279
+}
280
+.button {
281
+  margin-left: 20px;
282
+}
283
+</style>
284
+

+ 191
- 0
VUECODE/smart-property-manage/src/views/social/transaction/transactionAdd.vue View File

1
+<template>
2
+  <div id="root">
3
+    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-position="top" label-width="150px" class="ruleForm">
4
+
5
+    <el-form-item class="filter-item" label="话题类型" >
6
+        <el-select v-model="ruleForm.status" placeholder="请选择">
7
+         <el-option label="选择状态" value="" />
8
+         <el-option label="议事大厅" value="0"/>
9
+         <el-option label="友令互助" value="1"/>
10
+         <!-- -1包括,二手,租赁,求购 -->
11
+         <el-option label="二手租赁" value="-1"/>
12
+         <el-option label="其他" value="3"/>
13
+        </el-select>
14
+      </el-form-item>
15
+      <el-form-item label="话题标题" prop="transactionTitle">
16
+        <el-input v-model="ruleForm.transactionTitle" placeholder="20字以内"/>
17
+      </el-form-item>
18
+      <el-form-item label="话题详细描述">
19
+        <el-input v-model="ruleForm.announcementContent" :rows="10" type="textarea" placeholder="内容,规则,时间等"/>
20
+      </el-form-item>
21
+      <el-form-item label="话题配图">
22
+        <el-upload
23
+          :on-preview="handlePictureCardPreview"
24
+          :on-remove="handleRemove"
25
+          :on-success="handleSuccessContentImg"
26
+          name="uploadFiles"
27
+          action="http://106.14.20.193:8086/property-api/uploadimage"
28
+          list-type="picture-card">
29
+          <i class="el-icon-plus"/>
30
+        </el-upload>
31
+        <el-dialog :visible.sync="dialogVisible">
32
+          <img :src="dialogImageUrl" width="100%" alt="">
33
+        </el-dialog>
34
+      </el-form-item>
35
+      <el-form-item label="权重值" prop="sort">
36
+        <el-input-number v-model="ruleForm.sort" label="权重值" @change="sortHandleChange"/>
37
+      </el-form-item>
38
+      <el-form-item>
39
+        <el-button @click="resetForm('ruleForm','2')">存为草稿</el-button>
40
+        <el-button type="primary" @click="submitForm('ruleForm','1')">发布</el-button>
41
+      </el-form-item>
42
+    </el-form>
43
+  </div>
44
+</template>
45
+
46
+<script>
47
+export default {
48
+  name: 'Index',
49
+  data() {
50
+    return {
51
+      ruleForm: {
52
+        sort: '',
53
+        communityId: '',
54
+        createDate:'',
55
+        createUser:'',
56
+        id:'',
57
+        isReported:'',
58
+        status:'',
59
+        taUserId:'',
60
+        transactionContent:'',
61
+        transactionTitle:'',
62
+        type:'',
63
+        updateDate:'',
64
+        updateUser:'',
65
+        userName:'',
66
+        viewCount:'',
67
+        announcementCarouselImg: '', // 轮播图
68
+        announcementContent: '', // 内容详细
69
+        contentImg: [], // 内容配图
70
+        sort: 1, // 权重
71
+        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
72
+      },
73
+      imageUrl: '', // 轮播图预览
74
+      dialogVisible: false, // 活动配图, 默认不显示 (以单张为单位)
75
+      dialogImageUrl: '', // 活动配图, 图片链接 (以单张为单位)
76
+      rules: {
77
+        announcementTitle: [
78
+          { required: true, message: '请输入公告名称', trigger: 'blur' },
79
+          { min: 1, max: 20, message: '长度在 15 个字符以内', trigger: 'blur' }
80
+        ],
81
+        announcementContent: [
82
+          { required: true, message: '公告详细描述', trigger: 'blur' }
83
+        ],
84
+        sort: [
85
+          { required: true, message: '请输入权重值', trigger: 'change' }
86
+        ]
87
+      }
88
+    }
89
+  },
90
+  methods: {
91
+    submitForm(formName, status) {
92
+      console.log(status)
93
+      // 加载框
94
+    //   const loading = this.$loading({
95
+    //     lock: true,
96
+    //     text: 'Loading',
97
+    //     spinner: 'el-icon-loading',
98
+    //     background: 'rgba(0, 0, 0, 0.7)'
99
+    //   })
100
+      this.$refs[formName].validate((valid) => {
101
+        if (valid) {
102
+          if (this.ruleForm.announcementContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
103
+            this.$message.error('公告内容描述 和 公告配图至少要存在一个!')
104
+            return
105
+          }
106
+          this.ruleForm.status = status // 发布状态
107
+          this.$store.dispatch('transaction/TransactionsAdd', this.ruleForm).then((res) => {
108
+            if (res.code === '0') {
109
+              this.$message({
110
+                message: res.message,
111
+                type: 'success'
112
+              })
113
+              this.$router.push({ name: 'announcement-index' })
114
+              loading.close()
115
+              return
116
+            }
117
+            this.$message.error(res.message)
118
+            loading.close()
119
+          }).catch(() => {
120
+            console.log('error AddActivity')
121
+          })
122
+        } else {
123
+          console.log('error submit!!')
124
+          loading.close()
125
+          return false
126
+        }
127
+      })
128
+      // 关闭加载框
129
+      loading.close()
130
+    },
131
+    resetForm(formName, status) {
132
+      console.log(status)
133
+      this.submitForm(formName, status)
134
+    },
135
+    handleRemove(file, fileList) { // 活动配图移除时
136
+      this.ruleForm.contentImg = []
137
+      for (let i = 0; i < fileList.length; i++) {
138
+        this.ruleForm.contentImg.push(fileList[i].response.data[0])
139
+      }
140
+      console.log(file, fileList)
141
+    },
142
+    handlePictureCardPreview(file) { // 点击活动配图文件列表中已上传的文件时的钩子
143
+      this.dialogImageUrl = file.url
144
+      this.dialogVisible = true
145
+    },
146
+    handleSuccessContentImg(response, file, fileList) { // 活动配图上传成功时回调
147
+      const resImg = response.data[0]
148
+      this.ruleForm.contentImg.push(resImg)
149
+    },
150
+    sortHandleChange(value) { // 权重值
151
+      this.ruleForm.sort = value
152
+      console.log(value)
153
+    }
154
+  }
155
+}
156
+</script>
157
+
158
+<style scoped>
159
+#root {
160
+  display: flex;
161
+}
162
+.ruleForm {
163
+  width: 800px;
164
+  margin-left: auto;
165
+  margin-right: auto;
166
+  margin-top: 50px;
167
+}
168
+.avatar-uploader .el-upload {
169
+  border: 1px dashed #d9d9d9;
170
+  border-radius: 6px;
171
+  cursor: pointer;
172
+  position: relative;
173
+  overflow: hidden;
174
+}
175
+.avatar-uploader .el-upload:hover {
176
+  border-color: #409EFF;
177
+}
178
+.avatar-uploader-icon {
179
+  font-size: 28px;
180
+  color: #8c939d;
181
+  width: 178px;
182
+  height: 178px;
183
+  line-height: 178px;
184
+  text-align: center;
185
+}
186
+.avatar {
187
+  width: 178px;
188
+  height: 178px;
189
+  display: block;
190
+}
191
+</style>