系统配置参数修改,新增空小板错误提示更改

This commit is contained in:
liuzhaotian
2024-07-24 17:20:26 +08:00
parent 320b6966fc
commit 9ce3d2e57a
6 changed files with 24 additions and 12 deletions
@@ -63,7 +63,7 @@ import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConsta
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
import static com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService.ORDER_PLATE_MODEL;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PLATE_NOT_EXISTS;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
* 生产单板件 Service 实现类
@@ -261,6 +261,12 @@ public class PlateServiceImpl implements PlateService {
@Transactional(rollbackFor = Exception.class)
public List<Long> createNewPlate(OptimizationSavePlateReqVO reqVO) {
if(reqVO.getRoomId() == null || reqVO.getBodyId() == null){
throw exception(THE_CURRENT_BOARD_IS_NOT_SELECTED);
}
List<PlateDO> plateDOS = new ArrayList<>();
for (int i = 0; i < reqVO.getMultiple(); i++) {
@@ -229,6 +229,7 @@ public interface ErrorCodeConstants {
//=========== 板材信息 1-002-032-000 ============
ErrorCode PLATE_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_002_032_001, "导入板材数据不能为空!");
ErrorCode PLATE_EXISTS = new ErrorCode(1_002_032_002, "板材存在");
ErrorCode THE_CURRENT_BOARD_IS_NOT_SELECTED = new ErrorCode(1_002_032_003, "当前板材没有选择房间和柜体,请选择");
//=========== 板材信息 1-002-033-000 ============
ErrorCode REMAIN_PLATE_NOT_EXISTS = new ErrorCode(1_002_032_002, "板材不存在");
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.controller.admin.setting;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.controller.admin.setting.vo.PackageConfigReqVO;
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
import com.cf.imes.module.system.service.setting.SettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -53,7 +54,7 @@ public class SettingController {
@GetMapping("/select")
@Operation(summary = "查看当前用户的配置信息")
@Parameter(name = "type", description = "配置类型", required = true)
public CommonResult<PackageConfigReqVO> selectSetting( @RequestParam("type") Integer type ) {
public CommonResult<PackageConfigDO> selectSetting(@RequestParam("type") Integer type ) {
return success(settingService.selectSetting(type));
@@ -19,12 +19,12 @@ public class PackageConfigReqVO {
private Long id;
@Schema(description = "组织ID")
private Long organId;
@Schema(description = "用户ID")
private Long userId;
// @Schema(description = "组织ID")
// private Long organId;
//
//
// @Schema(description = "用户ID")
// private Long userId;
@Schema(description = "配置类型: 1 预打包,2 打包", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.service.setting;
import com.cf.imes.module.system.controller.admin.setting.vo.PackageConfigReqVO;
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
import org.springframework.stereotype.Service;
public interface SettingService {
@@ -12,5 +13,5 @@ public interface SettingService {
Long updateSetting(PackageConfigReqVO reqVO);
PackageConfigReqVO selectSetting(Integer type);
PackageConfigDO selectSetting(Integer type);
}
@@ -13,6 +13,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
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.*;
@@ -64,7 +65,7 @@ public class SettingServiceImpl implements SettingService{
@Override
public PackageConfigReqVO selectSetting(Integer type) {
public PackageConfigDO selectSetting(Integer type) {
LoginUser loginUser = getLoginUser();
@@ -74,9 +75,11 @@ public class SettingServiceImpl implements SettingService{
throw exception(CURRENTLY_NO_CONFIGURATION_AVAILABLE);
}
packageConfigDO.setSetting(JsonUtils.unzipString(packageConfigDO.getSetting()));
return BeanUtils.toBean(packageConfigDO,PackageConfigReqVO.class);
packageConfigDO.setSetting(unzipString(packageConfigDO.getSetting()));
return packageConfigDO;
}