| 
														
															@@ -1,10 +1,19 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package com.fs.store.service.impl; 
														 | 
														
														 | 
														
															 package com.fs.store.service.impl; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.math.BigDecimal; 
														 | 
														
														 | 
														
															 import java.math.BigDecimal; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.util.Date; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.util.concurrent.CompletableFuture; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.binarywang.wx.miniapp.api.WxMaService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.hutool.core.date.DateTime; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.hutool.core.util.ObjectUtil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import cn.hutool.json.JSONUtil; 
														 | 
														
														 | 
														
															 import cn.hutool.json.JSONUtil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.common.core.domain.R; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.common.utils.DateUtils; 
														 | 
														
														 | 
														
															 import com.fs.common.utils.DateUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.common.utils.IpUtil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.domain.FsStoreOrder; 
														 | 
														
														 | 
														
															 import com.fs.store.domain.FsStoreOrder; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.domain.FsStoreOrderItem; 
														 | 
														
														 | 
														
															 import com.fs.store.domain.FsStoreOrderItem; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.domain.FsUserBill; 
														 | 
														
														 | 
														
															 import com.fs.store.domain.FsUserBill; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -13,21 +22,33 @@ import com.fs.store.enums.BillDetailEnum; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.mapper.FsStoreOrderMapper; 
														 | 
														
														 | 
														
															 import com.fs.store.mapper.FsStoreOrderMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.mapper.FsStoreProductAttrValueMapper; 
														 | 
														
														 | 
														
															 import com.fs.store.mapper.FsStoreProductAttrValueMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.mapper.FsUserTuiMoneyRankMapper; 
														 | 
														
														 | 
														
															 import com.fs.store.mapper.FsUserTuiMoneyRankMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.store.param.LoginMpWxParam; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.service.IFsUserBillService; 
														 | 
														
														 | 
														
															 import com.fs.store.service.IFsUserBillService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.store.utils.JwtUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.vo.FsUserListVO; 
														 | 
														
														 | 
														
															 import com.fs.store.vo.FsUserListVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.vo.FsUserVO; 
														 | 
														
														 | 
														
															 import com.fs.store.vo.FsUserVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.vo.FsCompanyUserListQueryVO; 
														 | 
														
														 | 
														
															 import com.fs.store.vo.FsCompanyUserListQueryVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.vo.FsUserShareVO; 
														 | 
														
														 | 
														
															 import com.fs.store.vo.FsUserShareVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.vo.FsUserTuiVO; 
														 | 
														
														 | 
														
															 import com.fs.store.vo.FsUserTuiVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.wx.miniapp.config.WxMaConfiguration; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.wx.miniapp.config.WxMaProperties; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import me.chanjar.weixin.common.error.WxErrorException; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import me.chanjar.weixin.mp.api.WxMpService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import org.apache.commons.lang3.StringUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.slf4j.Logger; 
														 | 
														
														 | 
														
															 import org.slf4j.Logger; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.slf4j.LoggerFactory; 
														 | 
														
														 | 
														
															 import org.slf4j.LoggerFactory; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import org.springframework.aop.framework.AopContext; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
														
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import org.springframework.context.annotation.EnableAspectJAutoProxy; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import org.springframework.scheduling.annotation.Async; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
														
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.mapper.FsUserMapper; 
														 | 
														
														 | 
														
															 import com.fs.store.mapper.FsUserMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.domain.FsUser; 
														 | 
														
														 | 
														
															 import com.fs.store.domain.FsUser; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.service.IFsUserService; 
														 | 
														
														 | 
														
															 import com.fs.store.service.IFsUserService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.transaction.annotation.Transactional; 
														 | 
														
														 | 
														
															 import org.springframework.transaction.annotation.Transactional; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import javax.annotation.PostConstruct; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import static com.fs.store.enums.BillDetailEnum.CATEGORY_1; 
														 | 
														
														 | 
														
															 import static com.fs.store.enums.BillDetailEnum.CATEGORY_1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import static com.fs.store.enums.BillDetailEnum.CATEGORY_3; 
														 | 
														
														 | 
														
															 import static com.fs.store.enums.BillDetailEnum.CATEGORY_3; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -38,6 +59,7 @@ import static com.fs.store.enums.BillDetailEnum.CATEGORY_3; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * @date 2022-03-15 
														 | 
														
														 | 
														
															  * @date 2022-03-15 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  */ 
														 | 
														
														 | 
														
															  */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @Service 
														 | 
														
														 | 
														
															 @Service 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+@EnableAspectJAutoProxy(exposeProxy = true, proxyTargetClass = true) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 public class FsUserServiceImpl implements IFsUserService 
														 | 
														
														 | 
														
															 public class FsUserServiceImpl implements IFsUserService 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 { 
														 | 
														
														 | 
														
															 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -51,7 +73,20 @@ public class FsUserServiceImpl implements IFsUserService 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private FsStoreOrderMapper storeOrderMapper; 
														 | 
														
														 | 
														
															     private FsStoreOrderMapper storeOrderMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private WxMaProperties maProperties; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private WxMpService wxMpService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private JwtUtils jwtUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     Logger logger =  LoggerFactory.getLogger(FsUserServiceImpl.class); 
														 | 
														
														 | 
														
															     Logger logger =  LoggerFactory.getLogger(FsUserServiceImpl.class); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /** 
														 | 
														
														 | 
														
															     /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 查询用户 
														 | 
														
														 | 
														
															      * 查询用户 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 
														 | 
														
														 | 
														
															      * 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -312,6 +347,11 @@ public class FsUserServiceImpl implements IFsUserService 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return fsUserMapper.selectFsUserByMaOpenId(openid); 
														 | 
														
														 | 
														
															         return fsUserMapper.selectFsUserByMaOpenId(openid); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public FsUser selectFsUserByMaOpenIdNew(String openid) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return fsUserMapper.selectFsUserByMaOpenIdNew(openid); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public FsUser selectFsUserByMpOpenId(String openid) { 
														 | 
														
														 | 
														
															     public FsUser selectFsUserByMpOpenId(String openid) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return fsUserMapper.selectFsUserByMpOpenId(openid); 
														 | 
														
														 | 
														
															         return fsUserMapper.selectFsUserByMpOpenId(openid); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -322,6 +362,11 @@ public class FsUserServiceImpl implements IFsUserService 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return fsUserMapper.selectFsUserByUnionId(unionId); 
														 | 
														
														 | 
														
															         return fsUserMapper.selectFsUserByUnionId(unionId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public FsUser selectFsUserByUnionIdNew(String unionId) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return fsUserMapper.selectFsUserByUnionIdNew(unionId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public FsUser selectFsUserByUserCode(String userCode) { 
														 | 
														
														 | 
														
															     public FsUser selectFsUserByUserCode(String userCode) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return fsUserMapper.selectFsUserByUserCode(userCode); 
														 | 
														
														 | 
														
															         return fsUserMapper.selectFsUserByUserCode(userCode); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -337,5 +382,73 @@ public class FsUserServiceImpl implements IFsUserService 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return fsUserTuiMoneyRankMapper.selectFsUserShareList(type); 
														 | 
														
														 | 
														
															         return fsUserTuiMoneyRankMapper.selectFsUserShareList(type); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public R loginByMiniApp(LoginMpWxParam param) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (StringUtils.isBlank(param.getCode())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return R.error("code不存在"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            WxMaService wxService = WxMaConfiguration.getMaService(maProperties.getConfigs().get(0).getAppid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            FsUser user=fsUserMapper.selectFsUserByMaOpenIdOrUnionId(session.getOpenid(),session.getUnionid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            String ip = IpUtil.getRequestIp(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(ObjectUtil.isNull(user)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                // 保存用户信息 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                user = saveUser(param, wxService, session, ip); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                // 异步更新用户IP信息 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                FsUser finalUser = user; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                CompletableFuture.runAsync(() -> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        updateUserLastIp(finalUser, ip, session); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } catch (Exception e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        logger.error("更新用户IP异常", e); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            String token = jwtUtils.generateToken(user.getUserId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return R.ok("登录成功").put("token",token).put("user", user); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } catch (WxErrorException e) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return R.error("授权失败,"+e.getMessage()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private FsUser saveUser(LoginMpWxParam param, WxMaService wxService, WxMaJscode2SessionResult session, String ip) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        FsUser user; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        // 解密 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        WxMaPhoneNumberInfo phoneNoInfo = wxService.getUserService().getPhoneNoInfo(session.getSessionKey(), param.getEncryptedData(), param.getIv()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //写入 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user=new FsUser(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setPhone(phoneNoInfo.getPhoneNumber()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setNickname("微信用户"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setStatus(1); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setMaOpenId(session.getOpenid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setLastIp(ip); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setIsWeixinAuth(0); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        user.setCreateTime(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(StringUtils.isNotEmpty(session.getUnionid())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            user.setUnionId(session.getUnionid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.insertFsUser(user); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return user; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public void updateUserLastIp(FsUser user, String ip, WxMaJscode2SessionResult session) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        FsUser userMap=new FsUser(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        userMap.setUserId(user.getUserId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        userMap.setUpdateTime(new DateTime()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        userMap.setLastIp(ip); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(StringUtils.isNotEmpty(session.getUnionid())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            userMap.setUnionId(session.getUnionid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(StringUtils.isNotBlank(session.getOpenid())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            userMap.setMaOpenId(session.getOpenid()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.updateFsUser(userMap); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 |