Browse Source

MES 齐套检查——>获取齐套检查标识后端

master_hella_20240701
gaojs 1 year ago
parent
commit
db9431f313
  1. 13
      win-module-mes/win-module-mes-api/src/main/java/com/win/module/mes/enums/ErrorCodeConstants.java
  2. 36
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/controller/completeInspection/CompleteInspectionController.java
  3. 42
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/controller/completeInspection/vo/MesConfigInfoBaseVO.java
  4. 63
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/dal/dataobject/completeInspection/MesConfigInfoDO.java
  5. 27
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/dal/mysql/completeInspection/MesConfigInfoMapper.java
  6. 11
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/service/completeInspection/CompleteInspectService.java
  7. 30
      win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/service/completeInspection/CompleteInspectServiceImpl.java

13
win-module-mes/win-module-mes-api/src/main/java/com/win/module/mes/enums/ErrorCodeConstants.java

@ -44,7 +44,7 @@ public interface ErrorCodeConstants {
ErrorCode MES_ORDER_MONTH_SUB_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_006_000_028, "订单月计划子计划数据内容为空!");
ErrorCode ORDER_SCHEDULED = new ErrorCode(1_006_000_029, "计划已排产,无法删除!");
// ========== 能力配置 2-001-001-000 ==========
// ========== 能力配置 1-006-001-000 ==========
ErrorCode ABILITY_INFO_LIST_IS_EMPTY = new ErrorCode(1_006_001_001, "能力矩阵信息不存在!");
ErrorCode ABILITY_INFO_IS_EXIT = new ErrorCode(1_006_001_002, "已存在能力矩阵编码!");
ErrorCode ABILITY_INFO_IS_NOT_EXIT = new ErrorCode(1_006_001_006, "能力矩阵编码不存在!");
@ -64,7 +64,7 @@ public interface ErrorCodeConstants {
ErrorCode ABILITY_STUDY_DECIMAL_POINT = new ErrorCode(1_006_001_016, "学习时长小数位不能超过1");
ErrorCode HR_PERSON_ABILITY_INPUT3 = new ErrorCode(1_006_001_017, "能力编码不能为空!");
// ========== 操作步骤 2-001-002-000 ==========
// ========== 操作步骤 1-006-002-000 ==========
ErrorCode OPERSTEPS_TYPE_NOT_EXISTS = new ErrorCode(1_006_002_001, "操作步骤类型不存在!");
ErrorCode OPERSTEPS_TYPE_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_006_002_002, "导入操作步骤类型数据为空!");
ErrorCode OPERSTEPS_TYPE_IS_EXISTS = new ErrorCode(1_006_002_003, "操作步骤类型已经存在!");
@ -78,7 +78,7 @@ public interface ErrorCodeConstants {
ErrorCode HOLIDAY_SETTING_NOT_EXISTS = new ErrorCode(1_006_003_001, "节假日不存在!");
ErrorCode HOLIDAY_SETTING_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_006_003_002, "节假日导入数据内容为空!");
// ========== 质检 2-001-004-000 ==========
// ========== 质检 1-006-004-000 ==========
ErrorCode QUALITYCLASS_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_006_004_001, "质量类别基本信息不存在");
ErrorCode QUALITYCLASS_LIST_IS_EXIT = new ErrorCode(1_006_004_002, "已存在质量类别编码");
ErrorCode QUALITYCLASS_ERRORMODE = new ErrorCode(1_006_004_003, "未知的导入模式");
@ -92,9 +92,10 @@ public interface ErrorCodeConstants {
ErrorCode QUALITYFORMDETAIL_NOT_EXISTS = new ErrorCode(1_006_004_011, "质检表单明细基本信息不存在");
ErrorCode QUALITYFORMDETAIL_IS_LASTONE = new ErrorCode(1_006_004_012, "至少有一项质检表单明细");
ErrorCode QUALITYITEM_IS_NOCHANGE = new ErrorCode(1_006_004_013, "质检项目无变化");
ErrorCode QUALITYITEM_IS_ONE = new ErrorCode(1_006_004_039, "请选择这一条数据");
ErrorCode QUALITYITEM_IS_ONE = new ErrorCode(1_006_004_014, "请选择这一条数据");
ErrorCode MES_CONFIG_INFO_NOT_EXISTS = new ErrorCode(1_006_004_015, "MES基本参数配置信息不存在");
// ========== 单件批量返工返修配置 2-001-005-000 ==========
// ========== 单件批量返工返修配置 1-006-005-000 ==========
ErrorCode REWORK_SINGLE_NOT_EXISTS = new ErrorCode(1_006_005_040, "单件返工登记信息不存在");
ErrorCode SYSTEM_ERROR = new ErrorCode(1_006_005_043, "系统异常");
ErrorCode REWORK_BATCH_NOT_EXISTS = new ErrorCode(1_006_005_044, "批量返工登记信息不存在");
@ -103,7 +104,7 @@ public interface ErrorCodeConstants {
ErrorCode DISMANTLING_DETAIL_NOT_EXISTS = new ErrorCode(1_006_005_049, "报废拆解工单明细不存在");
ErrorCode DISMANTLING_DETAIL_CREATE_MATERIAL_STATUS = new ErrorCode(1_006_005_050, "报废拆解新增明细工单处理状态不能为已完成");
// ========== 模具配置 2-001-006-000 ==========
// ========== 模具配置 1-006-006-000 ==========
ErrorCode PATTERN_TYPE_NOT_EXISTS = new ErrorCode(1_006_006_001, "模具类型信息不存在");
ErrorCode PATTERN_TYPE_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_006_006_002, "模具类型信息为空");
ErrorCode PATTERN_TYPE_ERROR = new ErrorCode(1_006_006_003, "模具类型模块异常");

36
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/controller/completeInspection/CompleteInspectionController.java

@ -0,0 +1,36 @@
package com.win.module.mes.controller.completeInspection;
import com.win.framework.common.pojo.CommonResult;
import com.win.module.mes.controller.completeInspection.vo.MesConfigInfoBaseVO;
import com.win.module.mes.dal.dataobject.completeInspection.MesConfigInfoDO;
import com.win.module.mes.service.completeInspection.CompleteInspectService;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.win.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 齐套检查")
@RestController
@RequestMapping("/mes/complete-inspect")
@Validated
public class CompleteInspectionController {
@Resource
CompleteInspectService completeInspectService;
@GetMapping("/get")
@Operation(summary = "获得齐套检查标识")
@Parameter(name = "paramCode", description = "参数编码", required = true)
public CommonResult<String> getCompleteInspectionMark(@RequestParam("paramCode") String paramCode) {
MesConfigInfoBaseVO mesConfigInfoBaseVO = new MesConfigInfoBaseVO();
mesConfigInfoBaseVO.setParamCode(paramCode);
List<MesConfigInfoDO> mesConfigList = completeInspectService.getMesConfigList(mesConfigInfoBaseVO);
return success(mesConfigList.get(0).getEnabled());
}
}

42
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/controller/completeInspection/vo/MesConfigInfoBaseVO.java

@ -0,0 +1,42 @@
package com.win.module.mes.controller.completeInspection.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
public class MesConfigInfoBaseVO {
@Schema(description = "删除时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime deleteTime;
@Schema(description = "状态")
private String status;
@Schema(description = "并发乐观锁", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer concurrencyStamp;
@Schema(description = "备注")
private String remark;
@Schema(description = "删除用户名")
private String deleter;
@Schema(description = "位置ID")
private Integer siteId;
@Schema(description = "配置参数编码")
private String paramCode;
@Schema(description = "配置参数名称")
private String paramName;
@Schema(description = "是否启用")
private String enabled;
}

63
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/dal/dataobject/completeInspection/MesConfigInfoDO.java

@ -0,0 +1,63 @@
package com.win.module.mes.dal.dataobject.completeInspection;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.win.framework.mybatis.core.dataobject.BaseDO;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@TableName("strategy_mes_config")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MesConfigInfoDO extends BaseDO {
/**
* 删除时间
*/
private LocalDateTime deleteTime;
/**
* 主键
*/
@TableId
private Integer id;
/**
* 状态
*/
private String status;
/**
* 并发乐观锁
*/
private Integer concurrencyStamp;
/**
* 备注
*/
private String remark;
/**
* 删除用户名
*/
private String deleter;
/**
* 位置ID
*/
private Integer siteId;
/**
* 配置参数编码
*/
private String paramCode;
/**
* 配置参数名称
*/
private String paramName;
/**
* 是否启用
*/
private String enabled;
}

27
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/dal/mysql/completeInspection/MesConfigInfoMapper.java

@ -0,0 +1,27 @@
package com.win.module.mes.dal.mysql.completeInspection;
import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.module.mes.controller.completeInspection.vo.MesConfigInfoBaseVO;
import com.win.module.mes.dal.dataobject.completeInspection.MesConfigInfoDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface MesConfigInfoMapper extends BaseMapperX<MesConfigInfoDO> {
default List<MesConfigInfoDO> selectList(MesConfigInfoBaseVO reqVO) {
return selectList(new LambdaQueryWrapperX<MesConfigInfoDO>()
.eqIfPresent(MesConfigInfoDO::getStatus, reqVO.getStatus())
.eqIfPresent(MesConfigInfoDO::getConcurrencyStamp, reqVO.getConcurrencyStamp())
.eqIfPresent(MesConfigInfoDO::getRemark, reqVO.getRemark())
.eqIfPresent(MesConfigInfoDO::getDeleter, reqVO.getDeleter())
.eqIfPresent(MesConfigInfoDO::getSiteId, reqVO.getSiteId())
.eqIfPresent(MesConfigInfoDO::getParamCode, reqVO.getParamCode())
.likeIfPresent(MesConfigInfoDO::getParamName, reqVO.getParamName())
.eqIfPresent(MesConfigInfoDO::getEnabled, reqVO.getEnabled())
.orderByDesc(MesConfigInfoDO::getId));
}
}

11
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/service/completeInspection/CompleteInspectService.java

@ -0,0 +1,11 @@
package com.win.module.mes.service.completeInspection;
import com.win.module.mes.controller.completeInspection.vo.MesConfigInfoBaseVO;
import com.win.module.mes.dal.dataobject.completeInspection.MesConfigInfoDO;
import java.util.List;
public interface CompleteInspectService {
List<MesConfigInfoDO> getMesConfigList(MesConfigInfoBaseVO baseVO);
}

30
win-module-mes/win-module-mes-biz/src/main/java/com/win/module/mes/service/completeInspection/CompleteInspectServiceImpl.java

@ -0,0 +1,30 @@
package com.win.module.mes.service.completeInspection;
import cn.hutool.core.collection.CollUtil;
import com.win.module.mes.controller.completeInspection.vo.MesConfigInfoBaseVO;
import com.win.module.mes.dal.dataobject.completeInspection.MesConfigInfoDO;
import com.win.module.mes.dal.mysql.completeInspection.MesConfigInfoMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.mes.enums.ErrorCodeConstants.*;
@Service
@Validated
public class CompleteInspectServiceImpl implements CompleteInspectService{
@Resource
MesConfigInfoMapper mesConfigInfoMapper;
@Override
public List<MesConfigInfoDO> getMesConfigList(MesConfigInfoBaseVO baseVO) {
List<MesConfigInfoDO> mesConfigInfoDOS = mesConfigInfoMapper.selectList(baseVO);
if(CollUtil.isEmpty(mesConfigInfoDOS)){
throw exception(MES_CONFIG_INFO_NOT_EXISTS);
}
return mesConfigInfoDOS;
}
}
Loading…
Cancel
Save