7 changed files with 216 additions and 6 deletions
@ -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()); |
|||
} |
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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)); |
|||
} |
|||
} |
@ -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); |
|||
} |
@ -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…
Reference in new issue