Explorar el Código

/、update

release_toaliyun_real
xhxu hace 4 años
padre
commit
a18db59df7
Se han modificado 3 ficheros con 43 adiciones y 18 borrados
  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 Ver fichero

@@ -149,14 +149,14 @@ public class WxAppinfoController extends BaseController {
@GetMapping("/getAppMouldType")
public ResultData getAppMouldType(Integer plat) {
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);
}

@@ -167,11 +167,12 @@ public class WxAppinfoController extends BaseController {
if(appinfo == null || appinfo.getId() == null || appinfo.getMouldType() == 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();
}



+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxAppinfoService.java Ver fichero

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

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 Ver fichero

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

import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -41,11 +42,11 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
public WxAppinfo getCAppInfo(TenantEntity tenantEntity,EnumAppPlat appPlat) {
WxAppinfo appInfo = null;
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.setType(EnumAppType.C.getCode());
@@ -164,6 +165,19 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
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){
WxAppinfo record = this.getById(id);
if(record != null){
@@ -174,6 +188,9 @@ public class WxAppinfoServiceImpl implements WxAppinfoService {
String key3 = Constant.appinfoPrev + record.getTenantId()
+ "-" + EnumAppPlat.getByCode(record.getPlat()) + "-" + record.getType();
RedisCacheUtils.removeCache(wxAppinfoRedisTemplate, key3);
String key4 = Constant.appinfoPrev + record.getTenantId()
+ "-" + null + "-" + record.getType();
RedisCacheUtils.removeCache(wxAppinfoRedisTemplate, key4);
}
}
}

Cargando…
Cancelar
Guardar