魏超 5 years ago
parent
commit
59cf68392f

+ 4
- 34
pom.xml View File

142
 			</properties>
142
 			</properties>
143
 		</profile>
143
 		</profile>
144
 		<profile>
144
 		<profile>
145
-			<id>test</id>
145
+			<id>green</id>
146
 			<properties>
146
 			<properties>
147
-				<profiles.active>test</profiles.active>
147
+				<profiles.active>green</profiles.active>
148
 			</properties>
148
 			</properties>
149
 		</profile>
149
 		</profile>
150
 		<profile>
150
 		<profile>
154
 			</properties>
154
 			</properties>
155
 		</profile>
155
 		</profile>
156
 		<profile>
156
 		<profile>
157
-			<id>xs</id>
157
+			<id>blue</id>
158
 			<properties>
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
 			</properties>
160
 			</properties>
191
 		</profile>
161
 		</profile>
192
 	</profiles>
162
 	</profiles>

+ 20
- 31
src/main/java/com/huiju/estateagents/center/sysUser/controller/SysUserController.java View File

196
 
196
 
197
         //验证用户名密码是否正确
197
         //验证用户名密码是否正确
198
         TaChannelProxy taChannelProxy = iTaChannelProxyService.getOne(taChannelProxyQueryWrapper);
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
             return ResponseBean.error("用户名或密码错误", ResponseBean.ERROR_ILLEGAL_PARAMS);
201
             return ResponseBean.error("用户名或密码错误", ResponseBean.ERROR_ILLEGAL_PARAMS);
202
         }
202
         }
203
 
203
 
222
     }
222
     }
223
 
223
 
224
     @PostMapping("/center/changePassword")
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
     @PostMapping("/center/signout")
250
     @PostMapping("/center/signout")
262
     public ResponseBean signout(HttpServletRequest request) {
251
     public ResponseBean signout(HttpServletRequest request) {
263
         String token = JWTUtils.getToken(request);
252
         String token = JWTUtils.getToken(request);

+ 11
- 1
src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java View File

93
 	@Autowired
93
 	@Autowired
94
 	private ISysOrgParamsService iSysOrgParamsService;
94
 	private ISysOrgParamsService iSysOrgParamsService;
95
 
95
 
96
+	@Autowired
97
+	private TaChannelAppRelationMapper taChannelAppRelationMapper;
98
+
96
 	@Override
99
 	@Override
97
 	public IPage<Map<String,Object>> getPageList(IPage pg, Integer channelId) {
100
 	public IPage<Map<String,Object>> getPageList(IPage pg, Integer channelId) {
98
 		List<Map<String,Object>> taUserList = taUserMapper.getPageList(pg, channelId);
101
 		List<Map<String,Object>> taUserList = taUserMapper.getPageList(pg, channelId);
146
 			throw new Exception("生成用户公司信息失败");
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
 		addAndupdate(taUser.getSelectCityTree(),false,taOrg.getOrgId());
160
 		addAndupdate(taUser.getSelectCityTree(),false,taOrg.getOrgId());
151
 
161
 
352
 			taUser.setLoginName(taUser.getPhone());
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
 		if (null != taUserList && taUserList.size() > 0) {
366
 		if (null != taUserList && taUserList.size() > 0) {
357
 			throw new Exception("电话号码或登录名重复");
367
 			throw new Exception("电话号码或登录名重复");
358
 		}
368
 		}

+ 1
- 1
src/main/java/com/huiju/estateagents/channel/sysChannel/controller/SysUserChannelController.java View File

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

+ 5
- 0
src/main/java/com/huiju/estateagents/channel/sysChannel/entity/TaChannelProxy.java View File

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

+ 2
- 0
src/main/java/com/huiju/estateagents/channel/sysChannel/service/ITaChannelProxyService.java View File

7
 
7
 
8
 public interface ITaChannelProxyService extends IService<TaChannelProxy> {
8
 public interface ITaChannelProxyService extends IService<TaChannelProxy> {
9
     IPage<TaChannelProxy> getChannelList(IPage page);
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 View File

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;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import com.huiju.estateagents.center.taUser.entity.TaUser;
7
 import com.huiju.estateagents.channel.sysChannel.entity.TaChannelProxy;
8
 import com.huiju.estateagents.channel.sysChannel.entity.TaChannelProxy;
8
 import com.huiju.estateagents.channel.sysChannel.mapper.TaChannelProxyMapper;
9
 import com.huiju.estateagents.channel.sysChannel.mapper.TaChannelProxyMapper;
9
 import com.huiju.estateagents.channel.sysChannel.service.ITaChannelProxyService;
10
 import com.huiju.estateagents.channel.sysChannel.service.ITaChannelProxyService;
11
+import com.huiju.estateagents.common.MD5Utils;
10
 import com.huiju.estateagents.entity.TaChannelAppRelation;
12
 import com.huiju.estateagents.entity.TaChannelAppRelation;
11
 import com.huiju.estateagents.mapper.TaChannelAppRelationMapper;
13
 import com.huiju.estateagents.mapper.TaChannelAppRelationMapper;
12
 import org.apache.commons.collections.CollectionUtils;
14
 import org.apache.commons.collections.CollectionUtils;
35
         }
37
         }
36
         return taChannelProxyIPage;
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 View File

55
      */
55
      */
56
     private LocalDateTime createDate;
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 View File

79
             taBuildingIntention.setEventId(e.getEventId());
79
             taBuildingIntention.setEventId(e.getEventId());
80
             taBuildingIntention.setEventCode(e.getEventCode());
80
             taBuildingIntention.setEventCode(e.getEventCode());
81
             taBuildingIntention.setEventName(e.getEventName());
81
             taBuildingIntention.setEventName(e.getEventName());
82
-            taBuildingIntention.setIntention(1);
82
+            taBuildingIntention.setIntention(e.getPoints());
83
             taBuildingIntention.setCreateDate(LocalDateTime.now());
83
             taBuildingIntention.setCreateDate(LocalDateTime.now());
84
             taBuildingIntention.setBuildingId(buildingId);
84
             taBuildingIntention.setBuildingId(buildingId);
85
             taBuildingIntention.setStatus(1);
85
             taBuildingIntention.setStatus(1);

+ 0
- 8
src/main/java/com/huiju/estateagents/service/impl/TaMiniappServiceImpl.java View File

72
             throw new Exception("当前系统仅供维护"+ taChannelProxy.getAppMaxNum() +"个小程序,需要维护更多项目,请联系相关管理人员");
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
         TaMiniapp orign = this.getById(taMiniapp.getMiniappId());
75
         TaMiniapp orign = this.getById(taMiniapp.getMiniappId());
84
         if (null != orign) {
76
         if (null != orign) {
85
             if (!this.updateById(taMiniapp)) {
77
             if (!this.updateById(taMiniapp)) {

+ 5
- 3
src/main/resources/mapper/TaUserMapper.xml View File

27
             ta_user t
27
             ta_user t
28
             LEFT JOIN ta_org o ON t.org_id = o.org_id
28
             LEFT JOIN ta_org o ON t.org_id = o.org_id
29
             LEFT JOIN ta_miniapp m ON o.org_id = m.org_id
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
             left join ta_channel_proxy z on z.channel_id = n.channel_id
31
             left join ta_channel_proxy z on z.channel_id = n.channel_id
32
         WHERE
32
         WHERE
33
             t.is_admin =1
33
             t.is_admin =1
53
     FROM
53
     FROM
54
         ta_user
54
         ta_user
55
     WHERE
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
         OR login_Name = #{loginName})
60
         OR login_Name = #{loginName})
59
     </select>
61
     </select>
60
     <select id="seleUserList" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">
62
     <select id="seleUserList" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">