添加小板查询更改,柜体删除逻辑更改,修改开料状态逻辑更改

This commit is contained in:
liuzhaotian
2025-01-16 12:32:40 +08:00
parent 1cede97b42
commit 87c4a3ecce
11 changed files with 183 additions and 122 deletions
@@ -37,6 +37,9 @@ public interface SystemConfigApi {
@Operation(summary = "获取排单下的加工方案组的配置信息")
CommonResult<List<SystemConfigRespDTO>> getProcessByIds(@RequestParam("processIds") List<Long> processIds);
@GetMapping(PREFIX + "/organ/process-config-size")
@Operation(summary = "获取方案组对应的配置数量")
CommonResult<Integer> getProcessSizeByIds(@RequestParam("processIds") List<Long> processIds);
@GetMapping(PREFIX + "/organ/default-process-config")
@Operation(summary = "获取默认的加工方案组的配置信息")
@@ -343,6 +343,8 @@ public class ErrorCodeConstants {
public static final ErrorCode PLAN_PLATE_OPTIMIZE_DATA_ERROR = new ErrorCode(1_002_041_037, "当前排单对应的优化数据异常,请重新进行优化");
public static final ErrorCode THIS_ORDER_PLATE_DATA_ERROR = new ErrorCode(1_002_041_038, "当前选择的生产单数据为空,请检查生产单信息或者重新导入生产单");
public static final ErrorCode THIS_PLAN_PLATE_DATA_ERROR = new ErrorCode(1_002_041_039, "当前排单对应的板材数据为空,请重新进行排单或检查生产单对应的板材信息");
public static final ErrorCode PLAN_PROCESS_CONFIG_IS_NULL = new ErrorCode(1_002_041_040, "排单:{} 对应的方案组为空,请进行配置");
public static final ErrorCode PLAN_PROCESS_CONFIG_ALL_IS_NULL = new ErrorCode(1_002_041_041, "当前所选排单对应的方案组配置均为空,请重新进行方案组配置");
@@ -26,10 +26,12 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.common.pojo.CommonResult.success;
import static com.cf.imes.framework.common.util.json.JsonUtils.*;
import static com.cf.imes.framework.common.util.json.JsonUtils.parseArray;
import static com.cf.imes.framework.common.util.json.JsonUtils.unzipString;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
/**
@@ -82,6 +84,43 @@ public class SystemConfigApiImpl implements SystemConfigApi {
return success(BeanUtils.toBean(systemConfigDOS,SystemConfigRespDTO.class));
}
@Override
public CommonResult<Integer> getProcessSizeByIds(List<Long> processIds) {
List<SystemConfigDO> systemConfigDOS = systemConfigMapper.selectList(new LambdaQueryWrapperX<SystemConfigDO>()
.eq(SystemConfigDO::getOrganId, OrganContextHolder.getOrganId())
.in(SystemConfigDO::getId, processIds)
.select(SystemConfigDO::getId,SystemConfigDO::getSetting));
if(CollUtil.isEmpty(systemConfigDOS)){
throw exception(PLAN_PROCESS_CONFIG_ALL_IS_NULL);
}
AtomicReference<Integer> processSize = new AtomicReference<>(0);
systemConfigDOS.forEach(f->{
try {
List<ProcessSchemeConfig> processSchemeConfigs = parseArray(f.getSetting(), ProcessSchemeConfig.class);
processSize.updateAndGet(v -> v + processSchemeConfigs.size());
}catch (Exception e){
log.error(e.getMessage());
throw exception(SYSTEM_PROCESS_SCHEME_CONFIG_FIELD_ERROR);
}
});
if(processSize.get() == 0){
throw exception(PLAN_PROCESS_CONFIG_ALL_IS_NULL);
}
return success(processSize.get());
}
@Override
public CommonResult<SystemConfigRespDTO> getDefaultProcessConfig() {