mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、分堆打包mycat环境分堆异常修复;2、包裹详情入参格式修改;3、分堆打包配置自增修复;
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ public class PackController {
|
||||
@PostMapping("/getPageOrderPack")
|
||||
@Operation(summary = "查看生产订单对应的包裹信息-分页")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:pack-details')")
|
||||
public CommonResult<PageResult<OrderPackageVO>> getPageOrderPack(@Valid PackageDetailsReqVO reqVO) {
|
||||
public CommonResult<PageResult<OrderPackageVO>> getPageOrderPack(@Valid @RequestBody PackageDetailsReqVO reqVO) {
|
||||
return success(packService.getPageOrderPack(reqVO));
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -9,7 +9,6 @@ import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.organ.OrganApi;
|
||||
import com.cf.imes.module.system.api.permission.PermissionApi;
|
||||
import com.cf.imes.module.system.api.setting.SettingApi;
|
||||
import com.cf.imes.module.system.api.systemconfig.SystemConfigApi;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@@ -21,7 +20,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class,
|
||||
FileApi.class, FileApi.class, DataSourceApi.class, ApplicationApi.class,
|
||||
OrganApi.class, SystemConfigApi.class, CustomPlateNoSeqApi.class, PermissionApi.class, SettingApi.class,
|
||||
AssemblyConfigApi.class})
|
||||
OrganApi.class, SystemConfigApi.class, CustomPlateNoSeqApi.class, PermissionApi.class, AssemblyConfigApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.cf.imes.module.system.api.setting;
|
||||
|
||||
|
||||
import com.cf.imes.module.system.api.setting.dto.PackageConfigDTO;
|
||||
import com.cf.imes.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 系统配置")
|
||||
public interface SettingApi {
|
||||
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/setting";
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/getUserSetting")
|
||||
@Operation(summary = "查看当前用户的配置信息")
|
||||
@Parameter(name = "type", description = "配置配型", required = true, example = "1")
|
||||
PackageConfigDTO getUserSetting(@RequestParam("type") Integer type);
|
||||
|
||||
|
||||
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package com.cf.imes.module.system.api.setting.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PackageConfigDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
private Long organId;
|
||||
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Schema(description = "配置类型: 1 分堆,2 打包", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "配置信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String setting;
|
||||
|
||||
|
||||
}
|
||||
-5
@@ -253,11 +253,6 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode REMAIN_PLATE_COUNT_MAX = new ErrorCode(1_002_038_009, "remain.plate.count.max");
|
||||
|
||||
|
||||
//=========== 用户的系统配置 1-002-039-000 ============
|
||||
public static final ErrorCode CURRENTLY_NO_CONFIGURATION_AVAILABLE = new ErrorCode(1_002_039_001, "currently.no.configuration.available");
|
||||
|
||||
|
||||
|
||||
//=========== 系统配置 1-002-040-000 ============
|
||||
public static final ErrorCode SYSTEM_CONFIG_NOT_EXISTS = new ErrorCode(1_002_040_001, "system.config.not_exists");
|
||||
public static final ErrorCode SYSTEM_CONFIG_TYPE_NOT_SUPPORT = new ErrorCode(1_002_040_002, "system.config.type_not_support");
|
||||
|
||||
-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