diff --git a/mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java index 286d2ef8c..9eeabfb8b 100755 --- a/mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java @@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; +import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -60,7 +61,7 @@ public class WxUserGrantController extends BaseController { */ @AuthIgnore @PostMapping("/login") - @ApiOperation(value="用户登录", notes="{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\"}") + @ApiOperation(value="用户登录", notes="{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\"}") public ResultData userLogin(@RequestBody Map map) { logger.debug(map.toString()); @@ -69,6 +70,8 @@ public class WxUserGrantController extends BaseController { String appId = map.get("appId"); String code = map.get("code"); String sceneAddress = map.get("sceneAddress"); + String longitude = map.get("longtitude"); + String latitude = map.get("latitude"); //登录凭证不能为空 if (StringUtils.isBlank(appId)) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); @@ -112,6 +115,8 @@ public class WxUserGrantController extends BaseController { user1.setSessionKey(session_key); if (user1.getSceneAddress() == null) user1.setSceneAddress(sceneAddress); + user.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); + user.setLatitude(BigDecimal.valueOf(Double.valueOf(latitude))); // TODO 成长值 wxCUserService.saveOrUpdate(user1); resultMap.put("token", token); @@ -123,6 +128,8 @@ public class WxUserGrantController extends BaseController { if (user.getSceneAddress() == null) user.setSceneAddress(sceneAddress); user.setSessionKey(session_key); + user.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); + user.setLatitude(BigDecimal.valueOf(Double.valueOf(latitude))); // TODO 成长值 wxCUserService.saveOrUpdate(user); resultMap.put("token", token); diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java b/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java index cb05dea3b..f4d1ef70f 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCUser.java @@ -116,6 +116,12 @@ public class WxCUser implements Serializable { /*用户过期时间**/ @io.swagger.annotations.ApiModelProperty(value="用户过期时间",name="expireTime") private Date expireTime; + /*经度**/ + @io.swagger.annotations.ApiModelProperty(value="经度",name="longitude") + private BigDecimal longitude; + /*纬度**/ + @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") + private BigDecimal latitude; //渠道名称 @Transient @@ -275,35 +281,51 @@ public class WxCUser implements Serializable { expireTime = _expireTime; } + public BigDecimal getLongitude() { + return longitude; + } + + public void setLongitude(BigDecimal longitude) { + this.longitude = longitude; + } + public BigDecimal getLatitude() { + return latitude; + } + + public void setLatitude(BigDecimal latitude) { + this.latitude = latitude; + } public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") - ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") - ,OpenId_ASC("`open_id` ASC"),OpenId_DESC("`open_id` DESC") - ,UnionId_ASC("`union_id` ASC"),UnionId_DESC("`union_id` DESC") - ,NickName_ASC("`nick_name` ASC"),NickName_DESC("`nick_name` DESC") - ,Gender_ASC("`gender` ASC"),Gender_DESC("`gender` DESC") - ,AvatarUrl_ASC("`avatar_url` ASC"),AvatarUrl_DESC("`avatar_url` DESC") - ,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC") - ,PurePhone_ASC("`pure_phone` ASC"),PurePhone_DESC("`pure_phone` DESC") - ,City_ASC("`city` ASC"),City_DESC("`city` DESC") - ,Province_ASC("`province` ASC"),Province_DESC("`province` DESC") - ,Language_ASC("`language` ASC"),Language_DESC("`language` DESC") - ,CountryCode_ASC("`country_code` ASC"),CountryCode_DESC("`country_code` DESC") - ,RegisterIp_ASC("`register_ip` ASC"),RegisterIp_DESC("`register_ip` DESC") - ,VerifyCodePhone_ASC("`verify_code_phone` ASC"),VerifyCodePhone_DESC("`verify_code_phone` DESC") - ,QrcodeSource_ASC("`qrcode_source` ASC"),QrcodeSource_DESC("`qrcode_source` DESC") - ,Scene_ASC("`scene` ASC"),Scene_DESC("`scene` DESC") - ,SceneAddress_ASC("`scene_address` ASC"),SceneAddress_DESC("`scene_address` DESC") - ,SessionKey_ASC("`session_key` ASC"),SessionKey_DESC("`session_key` DESC") - ,Score_ASC("`score` ASC"),Score_DESC("`score` DESC") - ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") - ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") - ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") - ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") - ,ExpireTime_ASC("`expire_time` ASC"),ExpireTime_DESC("`expire_time` DESC") + ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") + ,OpenId_ASC("`open_id` ASC"),OpenId_DESC("`open_id` DESC") + ,UnionId_ASC("`union_id` ASC"),UnionId_DESC("`union_id` DESC") + ,NickName_ASC("`nick_name` ASC"),NickName_DESC("`nick_name` DESC") + ,Gender_ASC("`gender` ASC"),Gender_DESC("`gender` DESC") + ,AvatarUrl_ASC("`avatar_url` ASC"),AvatarUrl_DESC("`avatar_url` DESC") + ,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC") + ,PurePhone_ASC("`pure_phone` ASC"),PurePhone_DESC("`pure_phone` DESC") + ,City_ASC("`city` ASC"),City_DESC("`city` DESC") + ,Province_ASC("`province` ASC"),Province_DESC("`province` DESC") + ,Language_ASC("`language` ASC"),Language_DESC("`language` DESC") + ,CountryCode_ASC("`country_code` ASC"),CountryCode_DESC("`country_code` DESC") + ,RegisterIp_ASC("`register_ip` ASC"),RegisterIp_DESC("`register_ip` DESC") + ,VerifyCodePhone_ASC("`verify_code_phone` ASC"),VerifyCodePhone_DESC("`verify_code_phone` DESC") + ,QrcodeSource_ASC("`qrcode_source` ASC"),QrcodeSource_DESC("`qrcode_source` DESC") + ,Scene_ASC("`scene` ASC"),Scene_DESC("`scene` DESC") + ,SceneAddress_ASC("`scene_address` ASC"),SceneAddress_DESC("`scene_address` DESC") + ,SessionKey_ASC("`session_key` ASC"),SessionKey_DESC("`session_key` DESC") + ,Score_ASC("`score` ASC"),Score_DESC("`score` DESC") + ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") + ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") + ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") + ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") + ,ExpireTime_ASC("`expire_time` ASC"),ExpireTime_DESC("`expire_time` DESC") + ,Longitude_ASC("`longitude` ASC"),Longitude_DESC("`longitude` DESC") + ,Latitude_ASC("`latitude` ASC"),Latitude_DESC("`latitude` DESC") ; private String value; Field(String value){