Browse Source

//city

release_toaliyun_real
xhxu 3 years ago
parent
commit
3eb1fb8e95
3 changed files with 30 additions and 1 deletions
  1. +16
    -0
      mallinkCApi/src/main/java/com/iformall/controller/BaseController.java
  2. +13
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java

+ 16
- 0
mallinkCApi/src/main/java/com/iformall/controller/BaseController.java View File

@@ -269,6 +269,22 @@ public class BaseController {
return null;
}

public int syncBasicInfoCity(WxCUserBasicInfo basicInfo,String city){
if(basicInfo == null || StringUtils.isBlank(city)){
return 0;
}
if(city.equals(basicInfo.getLocateCity())){
return 0;
}
WxCUserBasicInfo record = new WxCUserBasicInfo();
record.setId(basicInfo.getId());
record.setFinalTenantId(basicInfo.getFinalTenantId());
record.setLocateCity(city);
wxCUserBasicInfoService.update(record);
removeCacheMember(basicInfo.getId());
return 1;
}

public String getIpAddr() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String ipaddress = IPUtil.getIpAddr(request);


+ 13
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java View File

@@ -334,6 +334,18 @@ public class WxUserGrantController extends BaseController {
if (!StringUtils.isBlank(city))
user.setLocateCity(city);
cuserFactory.getCUserService(user.getAppPlat()).updateLBS(user);

if(StringUtils.isNotBlank(city)){
try {
int i = syncBasicInfoCity(getCacheMember(),city);
if(i > 0){
//todo同步猫酷

}
}catch(Exception e){}

}

return new ResultData();
}

@@ -698,7 +710,6 @@ public class WxUserGrantController extends BaseController {
record.setWeight(wxCUserBasicInfo.getWeight());
record.setHeight(wxCUserBasicInfo.getHeight());
record.setAddress(wxCUserBasicInfo.getAddress());
record.setUpdateDate(new Date());
record.setFinalTenantId(tenantEntity.getFinalTenantId());
wxCUserBasicInfoService.update(record);

@@ -796,4 +807,5 @@ public class WxUserGrantController extends BaseController {
}
}


}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java View File

@@ -784,6 +784,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc

@Override
public void update(WxCUserBasicInfo record) {
record.setUpdateDate(new Date());
wxCUserBasicInfoMapper.updateById(record);
}



Loading…
Cancel
Save