mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
1、分堆打包mycat环境分堆异常修复;2、包裹详情入参格式修改;3、分堆打包配置自增修复;
This commit is contained in:
-42
@@ -1,42 +0,0 @@
|
||||
package com.cf.imes.module.system.api.setting;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.enums.UserSettingTypeEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.module.system.api.setting.dto.PackageConfigDTO;
|
||||
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
|
||||
import com.cf.imes.module.system.dal.mysql.setting.PackageConfigMapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.CURRENTLY_NO_CONFIGURATION_AVAILABLE;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class SettingApiImpl implements SettingApi{
|
||||
|
||||
|
||||
@Resource
|
||||
private PackageConfigMapper packageConfigMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public PackageConfigDTO getUserSetting(Integer type) {
|
||||
|
||||
LoginUser loginUser = getLoginUser();
|
||||
assert loginUser != null;
|
||||
PackageConfigDO packageConfigDO = packageConfigMapper.selectSetting(type, loginUser.getId(), loginUser.getOrganId());
|
||||
|
||||
if(packageConfigDO == null){
|
||||
throw new ServiceException(CURRENTLY_NO_CONFIGURATION_AVAILABLE, type == 1 ? UserSettingTypeEnum.HEAPSPLIT.getName() : UserSettingTypeEnum.PACKAGED.getName());
|
||||
}
|
||||
|
||||
return BeanUtils.toBean(packageConfigDO,PackageConfigDTO.class);
|
||||
|
||||
}
|
||||
}
|
||||
+11
-7
@@ -1,8 +1,5 @@
|
||||
package com.cf.imes.module.system.service.setting;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.enums.UserSettingTypeEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.module.system.controller.admin.setting.vo.PackageConfigReqVO;
|
||||
@@ -15,7 +12,6 @@ import jakarta.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.unzipString;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.CURRENTLY_NO_CONFIGURATION_AVAILABLE;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -56,9 +52,18 @@ public class SettingServiceImpl implements SettingService{
|
||||
// 更新
|
||||
PackageConfigDO packageConfigDO = packageConfigMapper.selectSetting(reqVO.getType(), loginUser.getId(), loginUser.getOrganId());
|
||||
if (packageConfigDO == null) {
|
||||
throw new ServiceException(CURRENTLY_NO_CONFIGURATION_AVAILABLE, reqVO.getType() == 1 ? UserSettingTypeEnum.HEAPSPLIT.getName() : UserSettingTypeEnum.PACKAGED.getName());
|
||||
// 新增
|
||||
PackageConfigDO newPackageConfigDO = PackageConfigDO.builder()
|
||||
.userId(loginUser.getId())
|
||||
.organId(loginUser.getOrganId())
|
||||
.setting(JsonUtils.zipString(reqVO.getSetting().toJSONString()))
|
||||
.type(reqVO.getType())
|
||||
.build();
|
||||
|
||||
packageConfigMapper.insert(newPackageConfigDO);
|
||||
return newPackageConfigDO.getId();
|
||||
}
|
||||
if(reqVO.getSetting() != null) {
|
||||
if (reqVO.getSetting() != null) {
|
||||
packageConfigDO.setSetting(JsonUtils.zipString(reqVO.getSetting().toJSONString()));
|
||||
}
|
||||
packageConfigMapper.updateById(packageConfigDO);
|
||||
@@ -77,7 +82,6 @@ public class SettingServiceImpl implements SettingService{
|
||||
PackageConfigDO packageConfigDO = packageConfigMapper.selectSetting(type, loginUser.getId(), loginUser.getOrganId());
|
||||
|
||||
if (packageConfigDO == null) {
|
||||
// throw new ServiceException(CURRENTLY_NO_CONFIGURATION_AVAILABLE,type == 1 ? UserSettingTypeEnum.PREPACKAGED.getName(): UserSettingTypeEnum.PACKAGED.getName());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user