Просмотр исходного кода

/、update

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
a18db59df7
3 измененных файлов: 43 добавлений и 18 удалений
  1. +14
    -13
      mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java
  2. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java
  3. +22
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java

+ 14
- 13
mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java Просмотреть файл

@@ -149,14 +149,14 @@ public class WxAppinfoController extends BaseController {
@GetMapping("/getAppMouldType") @GetMapping("/getAppMouldType")
public ResultData getAppMouldType(Integer plat) { public ResultData getAppMouldType(Integer plat) {
logger.debug("[" + getIpAddr() + "] WxAppinfoController::getAppMouldType"); logger.debug("[" + getIpAddr() + "] WxAppinfoController::getAppMouldType");
if(plat == null){
plat = EnumAppPlat.WX.getCode();
}
EnumAppPlat byCode = EnumAppPlat.getByCode(plat);
if(byCode == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
}
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(ifParentUpdateAloneTenantInfo().getTenantId(), byCode);
// if(plat == null){
// plat = EnumAppPlat.WX.getCode();
// }
// EnumAppPlat byCode = EnumAppPlat.getByCode(plat);
// if(byCode == null){
// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR);
// }
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(ifParentUpdateAloneTenantInfo().getTenantId(), null);
return new ResultData(cAppInfo); return new ResultData(cAppInfo);
} }


@@ -167,11 +167,12 @@ public class WxAppinfoController extends BaseController {
if(appinfo == null || appinfo.getId() == null || appinfo.getMouldType() == null){ if(appinfo == null || appinfo.getId() == null || appinfo.getMouldType() == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
} }
WxAppinfo updateAppinfo = new WxAppinfo();
updateAppinfo.setId(appinfo.getId());
updateAppinfo.setMouldType(appinfo.getMouldType());
updateAppinfo.updateTenantInfo(ifParentUpdateAloneTenantInfo());
wxAppinfoService.saveOrUpdate(updateAppinfo);
// WxAppinfo updateAppinfo = new WxAppinfo();
// updateAppinfo.setId(appinfo.getId());
// updateAppinfo.setMouldType(appinfo.getMouldType());
// updateAppinfo.updateTenantInfo(ifParentUpdateAloneTenantInfo());
// wxAppinfoService.saveOrUpdate(updateAppinfo);
wxAppinfoService.updateCMouldType(ifParentUpdateAloneTenantInfo(),appinfo.getMouldType());
return new ResultData(); return new ResultData();
} }




+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java Просмотреть файл

@@ -82,4 +82,11 @@ public interface WxAppinfoService {
WxAppinfo getByIdFromRedis(Long id); WxAppinfo getByIdFromRedis(Long id);


WxAppinfo getCAppInfoFromRedis(String tenantId, EnumAppPlat appPlat); WxAppinfo getCAppInfoFromRedis(String tenantId, EnumAppPlat appPlat);

/**
* 修改所有C端风格
*
* @param
*/
void updateCMouldType(TenantEntity tenantEntity, Integer mouldType);
} }

+ 22
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java Просмотреть файл

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations; import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@@ -41,11 +42,11 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
public WxAppinfo getCAppInfo(TenantEntity tenantEntity,EnumAppPlat appPlat) { public WxAppinfo getCAppInfo(TenantEntity tenantEntity,EnumAppPlat appPlat) {
WxAppinfo appInfo = null; WxAppinfo appInfo = null;
WxAppinfo appinfoQ = new WxAppinfo(); WxAppinfo appinfoQ = new WxAppinfo();
if (null == appPlat) {
appinfoQ.setPlat(EnumAppPlat.WX.getCode());
}else {
appinfoQ.setPlat(appPlat.getCode());
}
// if (null == appPlat) {
// appinfoQ.setPlat(EnumAppPlat.WX.getCode());
// }else {
// appinfoQ.setPlat(appPlat.getCode());
// }
appinfoQ.updateTenantInfo(tenantEntity); appinfoQ.updateTenantInfo(tenantEntity);
appinfoQ.setType(EnumAppType.C.getCode()); appinfoQ.setType(EnumAppType.C.getCode());
@@ -164,6 +165,19 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
return record; return record;
} }


@Override
@Transactional(rollbackFor = {Exception.class})
public void updateCMouldType(TenantEntity tenantEntity, Integer mouldType) {
WxAppinfo appinfoQ = new WxAppinfo();
appinfoQ.updateTenantInfo(tenantEntity);
appinfoQ.setType(EnumAppType.C.getCode());
List<WxAppinfo> appList = wxAppinfoMapper.selectList(new QueryWrapper(appinfoQ));
for (WxAppinfo appinfo:appList) {
appinfo.setMouldType(mouldType);
this.saveOrUpdate(appinfo);
}
}

private void deleteRedis(Long id){ private void deleteRedis(Long id){
WxAppinfo record = this.getById(id); WxAppinfo record = this.getById(id);
if(record != null){ if(record != null){
@@ -174,6 +188,9 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
String key3 = Constant.appinfoPrev + record.getTenantId() String key3 = Constant.appinfoPrev + record.getTenantId()
+ "-" + EnumAppPlat.getByCode(record.getPlat()) + "-" + record.getType(); + "-" + EnumAppPlat.getByCode(record.getPlat()) + "-" + record.getType();
RedisCacheUtils.removeCache(wxAppinfoRedisTemplate, key3); RedisCacheUtils.removeCache(wxAppinfoRedisTemplate, key3);
String key4 = Constant.appinfoPrev + record.getTenantId()
+ "-" + null + "-" + record.getType();
RedisCacheUtils.removeCache(wxAppinfoRedisTemplate, key4);
} }
} }
} }

Загрузка…
Отмена
Сохранить