|
|
|
@@ -4,6 +4,8 @@ import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -45,7 +47,11 @@ public class WxLevelConfigController extends BaseController { |
|
|
|
public ResultData list(@ModelAttribute WxLevelConfig wxLevelConfig, Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxLevelConfigController::list"); |
|
|
|
if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); |
|
|
|
wxLevelConfig.updateTenantInfo(getTenantInfo()); |
|
|
|
if(StringUtils.isNotBlank(getTenantInfo().getParentTenantId())){ |
|
|
|
wxLevelConfig.setTenantId(getTenantInfo().getParentTenantId()); |
|
|
|
}else{ |
|
|
|
wxLevelConfig.setTenantId(getTenantInfo().getTenantId()); |
|
|
|
} |
|
|
|
wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); |
|
|
|
final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(wxLevelConfig, pageNum, pageSize); |
|
|
|
return new ResultData(page); |
|
|
|
@@ -57,6 +63,9 @@ public class WxLevelConfigController extends BaseController { |
|
|
|
public ResultData add(@RequestBody List<WxLevelConfig> levelConfigs) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); |
|
|
|
try { |
|
|
|
if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { |
|
|
|
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); |
|
|
|
} |
|
|
|
wxLevelConfigService.batchSave(getTenantInfo(), levelConfigs); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
@@ -71,6 +80,9 @@ public class WxLevelConfigController extends BaseController { |
|
|
|
public ResultData updateCapabilities(@RequestBody List<WxLevelConfig> levelConfigs) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); |
|
|
|
try { |
|
|
|
if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { |
|
|
|
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); |
|
|
|
} |
|
|
|
wxLevelConfigService.batchUpdateCapabilities(getTenantInfo(), levelConfigs); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
@@ -84,6 +96,9 @@ public class WxLevelConfigController extends BaseController { |
|
|
|
@SystemControllerLog(description = "会员等级权益-删除") |
|
|
|
public ResultData delete(@RequestBody WxLevelConfig wxLevelConfig) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxLevelConfigController::delete"); |
|
|
|
if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { |
|
|
|
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); |
|
|
|
} |
|
|
|
wxLevelConfigService.deleteById(wxLevelConfig.getId()); |
|
|
|
return new ResultData(Result.SUCCESS, "删除成功", null); |
|
|
|
} |
|
|
|
|