瀏覽代碼

改了电话

dingxin 6 年之前
父節點
當前提交
b026edd9dc

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

2
 
2
 
3
 import com.community.commom.constant.Constant;
3
 import com.community.commom.constant.Constant;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
5
 import com.community.huiju.model.TpActivity;
6
 import com.community.huiju.model.TpActivity;
6
 import com.community.huiju.model.TpAnnouncement;
7
 import com.community.huiju.model.TpAnnouncement;
7
 import com.community.huiju.model.TpMessage;
8
 import com.community.huiju.model.TpMessage;
9
+import com.community.huiju.model.TpTransaction;
8
 import com.community.huiju.service.SocialServiceI;
10
 import com.community.huiju.service.SocialServiceI;
9
 import io.swagger.annotations.Api;
11
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.ApiImplicitParam;
12
 import io.swagger.annotations.ApiImplicitParam;
14
 import org.springframework.cloud.context.config.annotation.RefreshScope;
16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
15
 import org.springframework.web.bind.annotation.*;
17
 import org.springframework.web.bind.annotation.*;
16
 
18
 
19
+import javax.servlet.http.HttpSession;
17
 import java.util.List;
20
 import java.util.List;
18
 
21
 
19
 /**
22
 /**
103
         return responseBean;
106
         return responseBean;
104
     }
107
     }
105
 
108
 
109
+    @ApiOperation(value = "二手租赁详情", notes = "二手租赁详情")
110
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
111
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
112
+    @RequestMapping(value = "/secondHand/{communityId}", method = RequestMethod.GET)
113
+    public ResponseBean findUsedDetails(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
114
+        ResponseBean responseBean = new ResponseBean();
115
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
116
+        Integer userId=userElement.getId();
117
+        TpTransaction activity = socialServiceI.findUsedDetails(activityId, communityId,userId);
118
+        responseBean.addSuccess(activity);
119
+        return responseBean;
120
+    }
121
+
106
 }
122
 }

+ 14
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java 查看文件

11
 import io.swagger.annotations.ApiImplicitParam;
11
 import io.swagger.annotations.ApiImplicitParam;
12
 import io.swagger.annotations.ApiImplicitParams;
12
 import io.swagger.annotations.ApiImplicitParams;
13
 import io.swagger.annotations.ApiOperation;
13
 import io.swagger.annotations.ApiOperation;
14
+import org.apache.catalina.User;
14
 import org.springframework.beans.BeanUtils;
15
 import org.springframework.beans.BeanUtils;
15
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
17
 import org.springframework.cloud.context.config.annotation.RefreshScope;
55
         return responseBean;
56
         return responseBean;
56
 
57
 
57
     }
58
     }
58
-
59
+    @ApiOperation(value = "修改手机号", notes = "修改手机号")
60
+    @ApiImplicitParams({
61
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "登陆(手机号)"),
62
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
63
+    })
64
+            @RequestMapping(value = "/user/phone",method = RequestMethod.PUT)
65
+    public ResponseBean update(@RequestParam(value = "phone") String phone,@RequestParam(value = "code")String code,HttpSession session){
66
+        ResponseBean responseBean = new ResponseBean();
67
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
68
+        Integer userId=userElement.getId();
69
+        ResponseBean response=iTaUserService.selectloginName(userId,phone,code);
70
+        return response;
71
+    }
59
 
72
 
60
 
73
 
61
 }
74
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java 查看文件

32
      * @return 用户
32
      * @return 用户
33
      */
33
      */
34
     TaUser selectByLoginName(Map<String, Object> map);
34
     TaUser selectByLoginName(Map<String, Object> map);
35
+
36
+    /**
37
+     * 更新当前用户电话
38
+     * @param record
39
+     * @return
40
+     */
41
+    TaUser ubdateLongName(TaUser record);
35
 }
42
 }

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java 查看文件

2
 
2
 
3
 import com.community.huiju.model.TpTransaction;
3
 import com.community.huiju.model.TpTransaction;
4
 import org.apache.ibatis.annotations.Mapper;
4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5
 
6
 
6
 @Mapper
7
 @Mapper
7
 public interface TpTransactionMapper {
8
 public interface TpTransactionMapper {
11
 
12
 
12
     int insertSelective(TpTransaction record);
13
     int insertSelective(TpTransaction record);
13
 
14
 
14
-    TpTransaction selectByPrimaryKey(Integer id);
15
+    TpTransaction selectByPrimaryKey(@Param("id") Integer id,@Param("communityId")  Integer communityId);
15
 
16
 
16
     int updateByPrimaryKeySelective(TpTransaction record);
17
     int updateByPrimaryKeySelective(TpTransaction record);
17
 
18
 

+ 7
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java 查看文件

2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
 import com.community.huiju.model.TaUser;
4
 import com.community.huiju.model.TaUser;
5
-import org.springframework.web.bind.annotation.RequestParam;
6
 
5
 
7
 /**
6
 /**
8
  * 用户业务 接口
7
  * 用户业务 接口
33
      */
32
      */
34
     ResponseBean register(TaUser user);
33
     ResponseBean register(TaUser user);
35
 
34
 
35
+    /**
36
+     * 查询当前用户信息
37
+     * @param id
38
+     * @return
39
+     */
40
+    ResponseBean selectloginName(Integer id, String phone, String code);
41
+
36
 
42
 
37
 
43
 
38
 }
44
 }

+ 9
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
-import com.community.huiju.model.TaUser;
5
-import com.community.huiju.model.TpActivity;
6
-import com.community.huiju.model.TpAnnouncement;
7
-import com.community.huiju.model.TpSocialView;
4
+import com.community.huiju.model.*;
8
 
5
 
9
 import java.util.List;
6
 import java.util.List;
10
 
7
 
53
 	TpActivity findActivityDetail(Integer activityId, Integer communityId);
50
 	TpActivity findActivityDetail(Integer activityId, Integer communityId);
54
 
51
 
55
 	ResponseBean findTaUserInfo(Integer id, Integer communityId);
52
 	ResponseBean findTaUserInfo(Integer id, Integer communityId);
53
+
54
+	/**
55
+	 * 获取二手租赁详情
56
+	 * @param activityId
57
+	 * @param communityId
58
+	 * @return
59
+	 */
60
+	TpTransaction findUsedDetails(Integer activityId, Integer communityId, Integer userId);
56
 }
61
 }

+ 17
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

2
 
2
 
3
 import com.community.commom.constant.Constant;
3
 import com.community.commom.constant.Constant;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.commom.utils.DateUtils;
6
 import com.community.huiju.dao.*;
5
 import com.community.huiju.dao.*;
7
-import com.community.huiju.model.TaUser;
8
-import com.community.huiju.model.TpActivity;
9
-import com.community.huiju.model.TpAnnouncement;
10
-import com.community.huiju.model.TpSocialView;
6
+import com.community.huiju.model.*;
11
 import com.community.huiju.service.SocialServiceI;
7
 import com.community.huiju.service.SocialServiceI;
12
 import com.github.pagehelper.PageHelper;
8
 import com.github.pagehelper.PageHelper;
13
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
39
 
35
 
40
     @Autowired
36
     @Autowired
41
     private TpActivitySignupMapper tpActivitySignupMapper;
37
     private TpActivitySignupMapper tpActivitySignupMapper;
38
+
39
+    @Autowired
40
+    private TpTransactionMapper tpTransactionMapper;
42
     
41
     
43
     @Override
42
     @Override
44
     @Transactional
43
     @Transactional
168
 //        //身份为业主,状态为已停用
167
 //        //身份为业主,状态为已停用
169
         return null;
168
         return null;
170
     }
169
     }
170
+
171
+    @Override
172
+    public TpTransaction findUsedDetails(Integer activityId, Integer communityId, Integer userId) {
173
+        Integer num = updateSocialView(userId,Constant.LEASE,communityId,activityId);
174
+        if (null != num){
175
+            TpTransaction transaction = new TpTransaction();
176
+            transaction.setId(activityId);
177
+            transaction.setViewCount(num);
178
+            tpTransactionMapper.updateByPrimaryKeySelective(transaction);
179
+        }
180
+        return tpTransactionMapper.selectByPrimaryKey(activityId,communityId);
181
+
182
+    }
171
 }
183
 }

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java 查看文件

137
         response.addSuccess(taUserVO);
137
         response.addSuccess(taUserVO);
138
         return response;
138
         return response;
139
     }
139
     }
140
+
141
+    @Override
142
+    public ResponseBean selectloginName(Integer id, String phone, String code) {
143
+        ResponseBean response = new ResponseBean();
144
+        TaUser user=taUserMapper.selectByPrimaryKey(id);
145
+        //系统验证码
146
+        String  codes= (String) AppkeyCache.getCache(user.getLoginName());
147
+        //用户电话
148
+            /*String  phones=user.getLoginName();*/
149
+        if(codes.equals(code)){
150
+            TaUser taUser=new TaUser();
151
+            taUser.setLoginName(phone);
152
+            taUser.setId(user.getId());
153
+            taUserMapper.ubdateLongName(taUser);
154
+             response.addSuccess("修改成功");
155
+            AppkeyCache.setCache(user.getLoginName(),"null");
156
+            return response;
157
+        }else {
158
+            response.addError("验证码错误");
159
+            return response;
160
+        }
161
+
162
+
163
+
164
+    }
165
+
140
 }
166
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml 查看文件

258
     where login_name=#{loginName}
258
     where login_name=#{loginName}
259
   </select>
259
   </select>
260
 
260
 
261
+  <select id="ubdateLongName" parameterType="com.community.huiju.model.TaUser" resultMap="BaseResultMap">
262
+    update ta_user
263
+    set
264
+    login_name = #{loginName,jdbcType=VARCHAR}
265
+    where id = #{id,jdbcType=INTEGER}
266
+  </select>
267
+
261
 </mapper>
268
 </mapper>

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

29
     select 
29
     select 
30
     <include refid="Base_Column_List" />
30
     <include refid="Base_Column_List" />
31
     from tp_transaction
31
     from tp_transaction
32
-    where id = #{id,jdbcType=INTEGER}
32
+    where id = #{id,jdbcType=INTEGER} and #{communityId,jdbcType=INTEGER}
33
   </select>
33
   </select>
34
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
34
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
35
     delete from tp_transaction
35
     delete from tp_transaction