Your Name 3 anos atrás
pai
commit
191d133b34

+ 1
- 1
pom.xml Ver arquivo

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>marketing</artifactId>
13
-	<version>v1.0.13</version>
13
+	<version>v1.0.15</version>
14 14
 	<name>marketing-cloud</name>
15 15
 	<description>新联康营销云</description>
16 16
 

+ 3
- 0
src/main/java/com/yunzhi/marketing/common/AliOSSUtils.java Ver arquivo

@@ -57,6 +57,9 @@ public class AliOSSUtils {
57 57
             preURL += "/";
58 58
         }
59 59
 
60
+        // 转换空格与单引号
61
+        fname = fname.replaceAll("\\+", "20%").replaceAll(" ", "%20").replaceAll("'", "%27");
62
+
60 63
         return preURL + fname;
61 64
     }
62 65
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/controller/TaBuildingDynamicController.java Ver arquivo

@@ -589,7 +589,7 @@ public class TaBuildingDynamicController extends BaseController {
589 589
             LambdaQueryWrapper<TaBuildingDynamic> lambdaQueryWrapper = new LambdaQueryWrapper<>();
590 590
             lambdaQueryWrapper.eq(TaBuildingDynamic::getStatus,1);
591 591
             lambdaQueryWrapper.eq(TaBuildingDynamic::getType,"look");
592
-            lambdaQueryWrapper.eq(TaBuildingDynamic::getBuilding,dynamic.getBuildingId());
592
+            lambdaQueryWrapper.eq(TaBuildingDynamic::getBuildingId,dynamic.getBuildingId());
593 593
             List<TaBuildingDynamic> list = iBuildingDynamicService.list(lambdaQueryWrapper);
594 594
             if (list.size() > 0){
595 595
                 responseBean.addError("相同的项目看房团只能发布一个");

+ 157
- 0
src/main/java/com/yunzhi/marketing/controller/TaMiniappMessagePersonController.java Ver arquivo

@@ -0,0 +1,157 @@
1
+package com.yunzhi.marketing.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.marketing.base.BaseController;
7
+import com.yunzhi.marketing.base.ResponseBean;
8
+import com.yunzhi.marketing.common.StringUtils;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiOperation;
11
+import io.swagger.annotations.ApiParam;
12
+import org.slf4j.Logger;
13
+import org.slf4j.LoggerFactory;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.PathVariable;
16
+import org.springframework.web.bind.annotation.RequestBody;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RequestParam;
20
+import com.yunzhi.marketing.service.ITaMiniappMessagePersonService;
21
+import com.yunzhi.marketing.entity.TaMiniappMessagePerson;
22
+import org.springframework.web.bind.annotation.RestController;
23
+
24
+import javax.servlet.http.HttpServletRequest;
25
+import java.time.LocalDateTime;
26
+
27
+/**
28
+ * <p>
29
+    * 消息订阅人员 前端控制器
30
+    * </p>
31
+ *
32
+ * @author yansen
33
+ * @since 2021-08-13
34
+ */
35
+
36
+@Api(tags = "消息订阅人员")
37
+@RestController
38
+@RequestMapping("/api")
39
+public class TaMiniappMessagePersonController extends BaseController {
40
+
41
+    private final Logger logger = LoggerFactory.getLogger(TaMiniappMessagePersonController.class);
42
+
43
+    @Autowired
44
+    public ITaMiniappMessagePersonService iTaMiniappMessagePersonService;
45
+
46
+
47
+    /**
48
+     * 分页查询列表
49
+     * @param pageNum
50
+     * @param pageSize
51
+     * @return
52
+     */
53
+    @RequestMapping(value="/wx/miniapp-message",method= RequestMethod.GET)
54
+    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
55
+    public ResponseBean taMiniappMessagePersonList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
+                                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+                                                   @ApiParam("人员") @RequestParam(value ="personId", required = false) String personId,
58
+                                                   @ApiParam("楼盘") @RequestParam(value ="buildingId", required = false) String buildingId,
59
+                                                   @ApiParam("消息类型") @RequestParam(value ="messageType", required = false) String messageType,
60
+                                                   HttpServletRequest request) throws Exception{
61
+        Integer orgId = getOrgId(request);
62
+
63
+        IPage<TaMiniappMessagePerson> pg = new Page<>(pageNum, pageSize);
64
+        QueryWrapper<TaMiniappMessagePerson> queryWrapper = new QueryWrapper<>();
65
+        queryWrapper.eq("org_id", orgId);
66
+        queryWrapper.eq(!StringUtils.isEmpty(personId), "person_id", personId);
67
+        queryWrapper.eq(!StringUtils.isEmpty(buildingId), "building_id", buildingId);
68
+        queryWrapper.eq(!StringUtils.isEmpty(messageType), "message_type", messageType);
69
+        queryWrapper.orderByDesc("create_date");
70
+
71
+        IPage<TaMiniappMessagePerson> result = iTaMiniappMessagePersonService.page(pg, queryWrapper);
72
+        return ResponseBean.success(result);
73
+    }
74
+
75
+    /**
76
+     * 保存对象
77
+     * @param taMiniappMessagePerson 实体对象
78
+     * @return
79
+     */
80
+    @RequestMapping(value="/wx/miniapp-message",method= RequestMethod.POST)
81
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
82
+    public ResponseBean taMiniappMessagePersonAdd(@ApiParam("保存内容") @RequestBody TaMiniappMessagePerson taMiniappMessagePerson,
83
+                                                  HttpServletRequest request) throws Exception {
84
+        Integer orgId = getOrgId(request);
85
+        String personId = getPersonId(request);
86
+        String buildingId = taMiniappMessagePerson.getBuildingId();
87
+        String messageType = taMiniappMessagePerson.getMessageType();
88
+
89
+        if (StringUtils.isEmpty(messageType)) {
90
+            return ResponseBean.error("请设置订阅消息类型", ResponseBean.ERROR_UNAVAILABLE);
91
+        }
92
+
93
+        QueryWrapper<TaMiniappMessagePerson> queryWrapper = new QueryWrapper<>();
94
+        queryWrapper.eq("org_id", orgId);
95
+        queryWrapper.eq("person_id", personId);
96
+        queryWrapper.eq(StringUtils.isEmpty(buildingId),"building_id", buildingId);
97
+        queryWrapper.eq("message_type", messageType);
98
+
99
+        int count = iTaMiniappMessagePersonService.count(queryWrapper);
100
+        if (count > 0) {
101
+            // 如果已经订阅过改消息类型, 则不处理
102
+            return ResponseBean.success("");
103
+        }
104
+
105
+        taMiniappMessagePerson.setOrgId(orgId);
106
+        taMiniappMessagePerson.setPersonId(personId);
107
+        taMiniappMessagePerson.setCreateDate(LocalDateTime.now());
108
+
109
+        if (iTaMiniappMessagePersonService.save(taMiniappMessagePerson)){
110
+            return ResponseBean.success("");
111
+        }else {
112
+            return ResponseBean.error("订阅失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
113
+        }
114
+    }
115
+
116
+//    /**
117
+//     * 根据id删除对象
118
+//     * @param id  实体ID
119
+//     */
120
+//    @RequestMapping(value="/taMiniappMessagePerson/{id}", method= RequestMethod.DELETE)
121
+//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
122
+//    public ResponseBean taMiniappMessagePersonDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
123
+//        if(iTaMiniappMessagePersonService.removeById(id)){
124
+//            return ResponseBean.success("success");
125
+//        }else {
126
+//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
127
+//        }
128
+//    }
129
+//
130
+//    /**
131
+//     * 修改对象
132
+//     * @param id  实体ID
133
+//     * @param taMiniappMessagePerson 实体对象
134
+//     * @return
135
+//     */
136
+//    @RequestMapping(value="/taMiniappMessagePerson/{id}",method= RequestMethod.PUT)
137
+//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
138
+//    public ResponseBean taMiniappMessagePersonUpdate(@ApiParam("对象ID") @PathVariable Integer id,
139
+//                                        @ApiParam("更新内容") @RequestBody TaMiniappMessagePerson taMiniappMessagePerson) throws Exception{
140
+//
141
+//        if (iTaMiniappMessagePersonService.updateById(taMiniappMessagePerson)){
142
+//            return ResponseBean.success(iTaMiniappMessagePersonService.getById(id));
143
+//        }else {
144
+//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
145
+//        }
146
+//    }
147
+//
148
+//    /**
149
+//     * 根据id查询对象
150
+//     * @param id  实体ID
151
+//     */
152
+//    @RequestMapping(value="/taMiniappMessagePerson/{id}",method= RequestMethod.GET)
153
+//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
154
+//    public ResponseBean taMiniappMessagePersonGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
155
+//        return ResponseBean.success(iTaMiniappMessagePersonService.getById(id));
156
+//    }
157
+}

+ 49
- 0
src/main/java/com/yunzhi/marketing/entity/TaMiniappMessagePerson.java Ver arquivo

@@ -0,0 +1,49 @@
1
+package com.yunzhi.marketing.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 消息订阅人员
16
+ * </p>
17
+ *
18
+ * @author yansen
19
+ * @since 2021-08-13
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@ApiModel(value="TaMiniappMessagePerson对象", description="消息订阅人员")
25
+public class TaMiniappMessagePerson implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @ApiModelProperty(value = "序号")
30
+    @TableId(value = "serial_no", type = IdType.AUTO)
31
+    private Integer serialNo;
32
+
33
+    @ApiModelProperty(value = "人员ID")
34
+    private String personId;
35
+
36
+    @ApiModelProperty(value = "消息类型")
37
+    private String messageType;
38
+
39
+    @ApiModelProperty(value = "关联楼盘")
40
+    private String buildingId;
41
+
42
+    @ApiModelProperty(value = "组织ID")
43
+    private Integer orgId;
44
+
45
+    @ApiModelProperty(value = "创建时间")
46
+    private LocalDateTime createDate;
47
+
48
+
49
+}

+ 18
- 0
src/main/java/com/yunzhi/marketing/mapper/TaMiniappMessagePersonMapper.java Ver arquivo

@@ -0,0 +1,18 @@
1
+package com.yunzhi.marketing.mapper;
2
+
3
+import com.yunzhi.marketing.entity.TaMiniappMessagePerson;
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 yansen
13
+ * @since 2021-08-13
14
+ */
15
+@Mapper
16
+public interface TaMiniappMessagePersonMapper extends BaseMapper<TaMiniappMessagePerson> {
17
+
18
+}

+ 16
- 0
src/main/java/com/yunzhi/marketing/service/ITaMiniappMessagePersonService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.yunzhi.marketing.service;
2
+
3
+import com.yunzhi.marketing.entity.TaMiniappMessagePerson;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 消息订阅人员 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2021-08-13
13
+ */
14
+public interface ITaMiniappMessagePersonService extends IService<TaMiniappMessagePerson> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaMiniappMessagePersonServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.yunzhi.marketing.service.impl;
2
+
3
+import com.yunzhi.marketing.entity.TaMiniappMessagePerson;
4
+import com.yunzhi.marketing.mapper.TaMiniappMessagePersonMapper;
5
+import com.yunzhi.marketing.service.ITaMiniappMessagePersonService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 消息订阅人员 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2021-08-13
16
+ */
17
+@Service
18
+public class TaMiniappMessagePersonServiceImpl extends ServiceImpl<TaMiniappMessagePersonMapper, TaMiniappMessagePerson> implements ITaMiniappMessagePersonService {
19
+
20
+}

+ 1
- 1
src/main/resources/mapper/TaLiveActivityMapper.xml Ver arquivo

@@ -83,7 +83,7 @@
83 83
             t.live_activity_title AS title,
84 84
             t.live_start_date AS start_time,
85 85
             t.live_end_date AS end_time,
86
-            t.detail_img as images,
86
+            IFNULL(t.list_img, t.detail_img) as images,
87 87
             a.building_name,
88 88
             b.NAME AS city_name,
89 89
             "live" as type

+ 5
- 0
src/main/resources/mapper/TaMiniappMessagePersonMapper.xml Ver arquivo

@@ -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.yunzhi.marketing.mapper.TaMiniappMessagePersonMapper">
4
+
5
+</mapper>