Переглянути джерело

//city

release_toaliyun_real
xhxu 3 роки тому
джерело
коміт
3eb1fb8e95
3 змінених файлів з 30 додано та 1 видалено
  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 Переглянути файл

@@ -269,6 +269,22 @@ public class BaseController {
return null; 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() { public String getIpAddr() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String ipaddress = IPUtil.getIpAddr(request); String ipaddress = IPUtil.getIpAddr(request);


+ 13
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java Переглянути файл

@@ -334,6 +334,18 @@ public class WxUserGrantController extends BaseController {
if (!StringUtils.isBlank(city)) if (!StringUtils.isBlank(city))
user.setLocateCity(city); user.setLocateCity(city);
cuserFactory.getCUserService(user.getAppPlat()).updateLBS(user); 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(); return new ResultData();
} }


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


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



} }

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Переглянути файл

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


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




Завантаження…
Відмінити
Зберегти