魏超 5 年前
父节点
当前提交
59cf68392f

+ 4
- 34
pom.xml 查看文件

@@ -142,9 +142,9 @@
142 142
 			</properties>
143 143
 		</profile>
144 144
 		<profile>
145
-			<id>test</id>
145
+			<id>green</id>
146 146
 			<properties>
147
-				<profiles.active>test</profiles.active>
147
+				<profiles.active>green</profiles.active>
148 148
 			</properties>
149 149
 		</profile>
150 150
 		<profile>
@@ -154,39 +154,9 @@
154 154
 			</properties>
155 155
 		</profile>
156 156
 		<profile>
157
-			<id>xs</id>
157
+			<id>blue</id>
158 158
 			<properties>
159
-				<profiles.active>xs</profiles.active>
160
-			</properties>
161
-		</profile>
162
-		<profile>
163
-			<id>rc</id>
164
-			<properties>
165
-				<profiles.active>rc</profiles.active>
166
-			</properties>
167
-		</profile>
168
-		<profile>
169
-			<id>nj</id>
170
-			<properties>
171
-				<profiles.active>nj</profiles.active>
172
-			</properties>
173
-		</profile>
174
-		<profile>
175
-			<id>hj</id>
176
-			<properties>
177
-				<profiles.active>hj</profiles.active>
178
-			</properties>
179
-		</profile>
180
-		<profile>
181
-			<id>gzysd</id>
182
-			<properties>
183
-				<profiles.active>gzysd</profiles.active>
184
-			</properties>
185
-		</profile>
186
-		<profile>
187
-			<id>jj</id>
188
-			<properties>
189
-				<profiles.active>jj</profiles.active>
159
+				<profiles.active>blue</profiles.active>
190 160
 			</properties>
191 161
 		</profile>
192 162
 	</profiles>

+ 20
- 31
src/main/java/com/huiju/estateagents/center/sysUser/controller/SysUserController.java 查看文件

@@ -196,8 +196,8 @@ public class SysUserController extends BaseController {
196 196
 
197 197
         //验证用户名密码是否正确
198 198
         TaChannelProxy taChannelProxy = iTaChannelProxyService.getOne(taChannelProxyQueryWrapper);
199
-        String defaultPsw = MD5Utils.md5("abc@123");
200
-        if (taChannelProxy == null || !defaultPsw.equals(params.getString("password"))) {
199
+        String defaultPsw = MD5Utils.md5(params.getString("password"));
200
+        if (taChannelProxy == null || !defaultPsw.equals(taChannelProxy.getPassword())) {
201 201
             return ResponseBean.error("用户名或密码错误", ResponseBean.ERROR_ILLEGAL_PARAMS);
202 202
         }
203 203
 
@@ -222,42 +222,31 @@ public class SysUserController extends BaseController {
222 222
     }
223 223
 
224 224
     @PostMapping("/center/changePassword")
225
-    public ResponseBean changePassword(@RequestBody String paramStr) {
226
-        JSONObject params = JSONObject.parseObject(paramStr);
227
-        if (params == null) {
228
-            return ResponseBean.error("非法参数", ResponseBean.ERROR_MISSING_PARAMS);
229
-        }
230
-        String loginPassword = params.get("loginPassword").toString();
231
-        String newPassword = params.get("newPassword").toString();
232
-        String confirmPassword = params.get("confirmPassword").toString();
225
+    public ResponseBean changePassword(@RequestParam String originalPassword,
226
+                                       @RequestParam String newPassword,HttpServletRequest request) {
233 227
 
234
-        //校验密码
235
-        QueryWrapper<TaUser> taUserQueryWrapper = new QueryWrapper<>();
236
-        taUserQueryWrapper.eq("user_id", params.get("userId"));
237
-        TaUser taUser = iTaUserService.getOne(taUserQueryWrapper);
228
+        if (org.apache.commons.lang3.StringUtils.isBlank(newPassword) || newPassword.length() < 6) {
229
+            return ResponseBean.error("新密不能小于6位", ResponseBean.ERROR_UNAVAILABLE);
230
+        }
238 231
 
239
-        if (!taUser.getLoginPassword().equals(MD5Utils.md5(MD5Utils.md5(loginPassword)))){
240
-            return ResponseBean.error("旧密码错误,请重新输入", ResponseBean.ERROR_UNAVAILABLE);
241
-        };
232
+        Integer channelId = getChannelId(request);
242 233
 
243
-        if (StringUtils.isEmpty(newPassword) || StringUtils.isEmpty(confirmPassword)){
244
-            return ResponseBean.error("请输入新密码", ResponseBean.ERROR_UNAVAILABLE);
234
+        // 校验当前旧密码是否正确
235
+        String password = MD5Utils.md5(MD5Utils.md5(originalPassword));
236
+        TaChannelProxy taChannelProxy = iTaChannelProxyService.getById(channelId);
237
+        if (!password.equals(taChannelProxy.getPassword())){
238
+            return ResponseBean.error("旧密码错误,请重新输入", ResponseBean.ERROR_UNAVAILABLE);
245 239
         }
246 240
 
247
-        if (!newPassword.equals(confirmPassword)){
248
-            return ResponseBean.error("两次密码不一致,请确认重新输入", ResponseBean.ERROR_UNAVAILABLE);
241
+        try {
242
+            iTaChannelProxyService.resetPassword(channelId, newPassword);
243
+            return ResponseBean.success("操作成功!");
244
+        } catch (Exception e) {
245
+            e.printStackTrace();
246
+            return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
249 247
         }
250
-
251
-        //重置密码
252
-        QueryWrapper<TaUser> updateWrapper = new QueryWrapper<>();
253
-        TaUser user = new TaUser();
254
-        user.setLoginPassword(MD5Utils.md5(MD5Utils.md5(newPassword)));
255
-        updateWrapper.eq("user_id", params.get("userId"));
256
-        iTaUserService.update(user, updateWrapper);
257
-
258
-        return ResponseBean.success("设置成功");
259 248
     }
260
-    
249
+
261 250
     @PostMapping("/center/signout")
262 251
     public ResponseBean signout(HttpServletRequest request) {
263 252
         String token = JWTUtils.getToken(request);

+ 11
- 1
src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java 查看文件

@@ -93,6 +93,9 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
93 93
 	@Autowired
94 94
 	private ISysOrgParamsService iSysOrgParamsService;
95 95
 
96
+	@Autowired
97
+	private TaChannelAppRelationMapper taChannelAppRelationMapper;
98
+
96 99
 	@Override
97 100
 	public IPage<Map<String,Object>> getPageList(IPage pg, Integer channelId) {
98 101
 		List<Map<String,Object>> taUserList = taUserMapper.getPageList(pg, channelId);
@@ -146,6 +149,13 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
146 149
 			throw new Exception("生成用户公司信息失败");
147 150
 		}
148 151
 
152
+		//维护渠道和小程序关系
153
+		TaChannelAppRelation taChannelAppRelation = new TaChannelAppRelation();
154
+		taChannelAppRelation.setChannelId(channelId);
155
+		taChannelAppRelation.setOrgId(taOrg.getOrgId());
156
+		taChannelAppRelation.setCreateTime(LocalDateTime.now());
157
+		taChannelAppRelationMapper.insert(taChannelAppRelation);
158
+
149 159
 		// 维护当前城市所在城市
150 160
 		addAndupdate(taUser.getSelectCityTree(),false,taOrg.getOrgId());
151 161
 
@@ -352,7 +362,7 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
352 362
 			taUser.setLoginName(taUser.getPhone());
353 363
 		}
354 364
 		
355
-		List<TaUser> taUserList = taUserMapper.getUserList(taUser.getPhone(),taUser.getLoginName(),taUser.getOrgId());
365
+		List<TaUser> taUserList = taUserMapper.getUserList(taUser.getPhone(),taUser.getLoginName(),null);
356 366
 		if (null != taUserList && taUserList.size() > 0) {
357 367
 			throw new Exception("电话号码或登录名重复");
358 368
 		}

+ 1
- 1
src/main/java/com/huiju/estateagents/channel/sysChannel/controller/SysUserChannelController.java 查看文件

@@ -179,7 +179,7 @@ public class SysUserChannelController extends BaseController {
179 179
                 responseBean.addError("手机号已存在");
180 180
                 return responseBean;
181 181
             }
182
-
182
+            taChannelProxy.setPassword(MD5Utils.md5(MD5Utils.md5("abc@123")));
183 183
             taChannelProxy.setStatus(1);
184 184
             taChannelProxy.setCreateTime(LocalDateTime.now());
185 185
             iTaChannelProxyService.save(taChannelProxy);

+ 5
- 0
src/main/java/com/huiju/estateagents/channel/sysChannel/entity/TaChannelProxy.java 查看文件

@@ -1,6 +1,8 @@
1 1
 package com.huiju.estateagents.channel.sysChannel.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
3 4
 import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
6 8
 import lombok.experimental.Accessors;
@@ -11,6 +13,7 @@ import java.time.LocalDateTime;
11 13
 @EqualsAndHashCode(callSuper = false)
12 14
 @Accessors(chain = true)
13 15
 public class TaChannelProxy {
16
+    @TableId(value = "channel_id", type = IdType.AUTO)
14 17
     private Integer channelId;
15 18
 
16 19
     private String channelProxyName;
@@ -23,6 +26,8 @@ public class TaChannelProxy {
23 26
 
24 27
     private String userName;
25 28
 
29
+    private String password;
30
+
26 31
     private LocalDateTime expireDate;
27 32
 
28 33
     private Integer status;

+ 2
- 0
src/main/java/com/huiju/estateagents/channel/sysChannel/service/ITaChannelProxyService.java 查看文件

@@ -7,4 +7,6 @@ import com.huiju.estateagents.channel.sysChannel.entity.TaChannelProxy;
7 7
 
8 8
 public interface ITaChannelProxyService extends IService<TaChannelProxy> {
9 9
     IPage<TaChannelProxy> getChannelList(IPage page);
10
+
11
+    void resetPassword(Integer id, String newPass) throws Exception;
10 12
 }

+ 19
- 0
src/main/java/com/huiju/estateagents/channel/sysChannel/service/impl/TaChannelProxyServiceImpl.java 查看文件

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import com.huiju.estateagents.center.taUser.entity.TaUser;
7 8
 import com.huiju.estateagents.channel.sysChannel.entity.TaChannelProxy;
8 9
 import com.huiju.estateagents.channel.sysChannel.mapper.TaChannelProxyMapper;
9 10
 import com.huiju.estateagents.channel.sysChannel.service.ITaChannelProxyService;
11
+import com.huiju.estateagents.common.MD5Utils;
10 12
 import com.huiju.estateagents.entity.TaChannelAppRelation;
11 13
 import com.huiju.estateagents.mapper.TaChannelAppRelationMapper;
12 14
 import org.apache.commons.collections.CollectionUtils;
@@ -35,4 +37,21 @@ public class TaChannelProxyServiceImpl extends ServiceImpl<TaChannelProxyMapper,
35 37
         }
36 38
         return taChannelProxyIPage;
37 39
     }
40
+
41
+    @Override
42
+    public void resetPassword(Integer id, String newPass) throws Exception {
43
+        TaChannelProxy taChannelProxy = this.getById(id);
44
+        if (null == taChannelProxy) {
45
+            throw new Exception("未找到有效的渠道信息");
46
+        }
47
+
48
+        String encryptPass = MD5Utils.md5(MD5Utils.md5(newPass));
49
+        TaChannelProxy proxy = new TaChannelProxy();
50
+        proxy.setPassword(encryptPass);
51
+        proxy.setChannelId(id);
52
+
53
+        if (!this.updateById(proxy)) {
54
+            throw new Exception("重置渠道密码失败");
55
+        }
56
+    }
38 57
 }

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/TdBizEvent.java 查看文件

@@ -55,6 +55,10 @@ public class TdBizEvent implements Serializable {
55 55
      */
56 56
     private LocalDateTime createDate;
57 57
 
58
+    /**
59
+     * 分数
60
+     */
61
+    private Integer points;
58 62
     /**
59 63
      * 意向值
60 64
      */

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaBuildingIntentionServiceImpl.java 查看文件

@@ -79,7 +79,7 @@ public class TaBuildingIntentionServiceImpl extends ServiceImpl<TaBuildingIntent
79 79
             taBuildingIntention.setEventId(e.getEventId());
80 80
             taBuildingIntention.setEventCode(e.getEventCode());
81 81
             taBuildingIntention.setEventName(e.getEventName());
82
-            taBuildingIntention.setIntention(1);
82
+            taBuildingIntention.setIntention(e.getPoints());
83 83
             taBuildingIntention.setCreateDate(LocalDateTime.now());
84 84
             taBuildingIntention.setBuildingId(buildingId);
85 85
             taBuildingIntention.setStatus(1);

+ 0
- 8
src/main/java/com/huiju/estateagents/service/impl/TaMiniappServiceImpl.java 查看文件

@@ -72,14 +72,6 @@ public class TaMiniappServiceImpl extends ServiceImpl<TaMiniappMapper, TaMiniapp
72 72
             throw new Exception("当前系统仅供维护"+ taChannelProxy.getAppMaxNum() +"个小程序,需要维护更多项目,请联系相关管理人员");
73 73
         }
74 74
 
75
-        //维护渠道和小程序关系
76
-        TaChannelAppRelation taChannelAppRelation = new TaChannelAppRelation();
77
-        taChannelAppRelation.setChannelId(channelId);
78
-        taChannelAppRelation.setOrgId(taMiniapp.getOrgId());
79
-        taChannelAppRelation.setCreateTime(LocalDateTime.now());
80
-        taChannelAppRelationMapper.insert(taChannelAppRelation);
81
-
82
-
83 75
         TaMiniapp orign = this.getById(taMiniapp.getMiniappId());
84 76
         if (null != orign) {
85 77
             if (!this.updateById(taMiniapp)) {

+ 5
- 3
src/main/resources/mapper/TaUserMapper.xml 查看文件

@@ -27,7 +27,7 @@
27 27
             ta_user t
28 28
             LEFT JOIN ta_org o ON t.org_id = o.org_id
29 29
             LEFT JOIN ta_miniapp m ON o.org_id = m.org_id
30
-            left join ta_channel_app_relation n on m.org_id = n.org_id
30
+            left join ta_channel_app_relation n on o.org_id = n.org_id
31 31
             left join ta_channel_proxy z on z.channel_id = n.channel_id
32 32
         WHERE
33 33
             t.is_admin =1
@@ -53,8 +53,10 @@
53 53
     FROM
54 54
         ta_user
55 55
     WHERE
56
-          org_id = #{orgId}
57
-        and (phone = #{phone}
56
+    <if test="orgId != null and orgId != ''">
57
+        org_id = #{orgId} and
58
+    </if>
59
+         (phone = #{phone}
58 60
         OR login_Name = #{loginName})
59 61
     </select>
60 62
     <select id="seleUserList" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">