优化生产修改开料状态逻辑,参数修改,添加小板数量查询修改

This commit is contained in:
liuzhaotian
2025-01-20 11:58:04 +08:00
parent bb5843e320
commit 59083285de
8 changed files with 146 additions and 339 deletions
@@ -2,11 +2,8 @@ package com.cf.imes.module.system.controller.admin.setting;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.module.system.controller.admin.setting.vo.PackageConfigReqVO;
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigRespVO;
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
import com.cf.imes.module.system.service.setting.SettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -62,23 +59,4 @@ public class SettingController {
}
@GetMapping("/selectDefault")
@Operation(summary = "获取默认的智能分线配置")
public CommonResult<ConfigRespVO> selectDefaultBranching() {
SystemConfigDO systemConfigDO = settingService.selectDefaultBranching();
return success(BeanUtils.toBean(systemConfigDO, ConfigRespVO.class));
}
@GetMapping("/selectScheme")
@Operation(summary = "根据加工方案ID获取加工方案的所有配置")
public CommonResult<ConfigRespVO> getProcessScheme(@RequestParam Long id) {
SystemConfigDO systemConfigDO = settingService.selectDefaultBranching();
return success(BeanUtils.toBean(systemConfigDO, ConfigRespVO.class));
}
}
@@ -3,7 +3,6 @@ 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 com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
public interface SettingService {
@@ -14,6 +13,4 @@ public interface SettingService {
Long updateSetting(PackageConfigReqVO reqVO);
PackageConfigDO selectSetting(Integer type);
SystemConfigDO selectDefaultBranching();
}
@@ -2,12 +2,10 @@ package com.cf.imes.module.system.service.setting;
import com.cf.imes.framework.common.enums.UserSettingTypeEnum;
import com.cf.imes.framework.common.util.Assert.AssertUtils;
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;
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
import com.cf.imes.module.system.dal.mysql.setting.PackageConfigMapper;
import com.cf.imes.module.system.dal.mysql.systemconfig.SystemConfigMapper;
import org.springframework.stereotype.Service;
@@ -18,7 +16,7 @@ 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.*;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.CURRENTLY_NO_CONFIGURATION_AVAILABLE;
@Service
@@ -90,16 +88,4 @@ public class SettingServiceImpl implements SettingService{
return packageConfigDO;
}
@Override
public SystemConfigDO selectDefaultBranching() {
SystemConfigDO systemConfigDO = systemConfigMapper.selectDefaultBranching();
AssertUtils.notEmpty(systemConfigDO,BRANCHING_DEFAULT_SETTING_ERROR);
return systemConfigDO;
}
}
@@ -1,10 +1,8 @@
package com.cf.imes.module.system.service.systemconfig.factory.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.enums.CommonStatusEnum;
import com.cf.imes.framework.common.exception.ServiceException;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigDeleteReqVO;
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigPageReqVO;
@@ -13,16 +11,11 @@ import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigUpdateSt
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
import com.cf.imes.module.system.dal.mysql.systemconfig.SystemConfigMapper;
import com.cf.imes.module.system.service.systemconfig.factory.service.AbstractSystemConfigServiceHandler;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.BRANCHING_SETTING_RULE_SAVE_CHECK_ERROR;
import static com.cf.imes.module.system.enums.ErrorCodeConstants.BRANCHING_SETTING_SAVE_ERROR;
/**
* @author 智能分线生成服务
@@ -48,23 +41,8 @@ public class IntellectBranchingService extends AbstractSystemConfigServiceHandle
@Override
public void checkValid(String setting) {
//
// JSONArray jsonArray = JSON.parseArray(setting);
//
// for (int i = 0; i < jsonArray.size(); i++) {
//
// JSONObject jsonObject = jsonArray.getJSONObject(i);
//
// checkMachineId(jsonObject.getString("machineId"));
// String machineName = jsonObject.getString("machineName");
// checkMachineName(machineName);
// checkMachineConfig(jsonObject.get("machineConfig"),machineName);
// }
//
// if(jsonArray.size() < 2){
// throw new ServiceException(BRANCHING_SETTING_COUNT_ERROR);
// }
// todo checkValid
}
@@ -109,39 +87,5 @@ public class IntellectBranchingService extends AbstractSystemConfigServiceHandle
}
/**
* 校验 机台ID
*
*/
private void checkMachineId(String machineId) {
if (StringUtils.isBlank(machineId)) {
throw new ServiceException(BRANCHING_SETTING_RULE_SAVE_CHECK_ERROR);
}
}
/**
* 校验 机台名称
*
*/
private void checkMachineName(String machineName) {
if (StringUtils.isBlank(machineName)) {
throw new ServiceException(BRANCHING_SETTING_RULE_SAVE_CHECK_ERROR);
}
}
/**
* 校验 机台分流条件
*
*/
private void checkMachineConfig(Object machineConfig,String machineName) {
if (ObjectUtil.isEmpty(machineConfig)) {
throw exception(BRANCHING_SETTING_SAVE_ERROR,machineName);
}
}
}