feat(pltcm): 添加工艺模型配置模块及核心功能
- 新增 klp-pltcm 模块到项目根目录 - 在 klp-admin 中添加对 klp-pltcm 的依赖引用 - 实现策略关联 (ModStrategy) 的完整CRUD功能 - 实现厚度分类 (ModThickClass) 的完整CRUD功能 - 实现宽度分类 (ModWidthClass) 的完整CRUD功能 - 实现屈服强度分类 (ModYieldStressClass) 的完整CRUD功能 - 实现比例表 (SchRatio) 的完整CRUD功能 - 添加相应的控制器、服务接口、实现类和数据传输对象 - 配置 MyBatis 映射文件和数据库实体类 - 提供 Excel 导出功能和分页查询支持
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package com.klp.pltcm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pltcm.domain.bo.ModStrategyBo;
|
||||
import com.klp.pltcm.domain.vo.ModStrategyVo;
|
||||
import com.klp.pltcm.domain.ModStrategy;
|
||||
import com.klp.pltcm.mapper.ModStrategyMapper;
|
||||
import com.klp.pltcm.service.IModStrategyService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 策略关联Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ModStrategyServiceImpl implements IModStrategyService {
|
||||
|
||||
private final ModStrategyMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ModStrategyVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ModStrategyVo> queryPageList(ModStrategyBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ModStrategy> lqw = buildQueryWrapper(bo);
|
||||
Page<ModStrategyVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModStrategyVo> queryList(ModStrategyBo bo) {
|
||||
LambdaQueryWrapper<ModStrategy> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ModStrategy> buildQueryWrapper(ModStrategyBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ModStrategy> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getClassId() != null, ModStrategy::getClassId, bo.getClassId());
|
||||
lqw.eq(bo.getRatioTableid() != null, ModStrategy::getRatioTableid, bo.getRatioTableid());
|
||||
lqw.eq(bo.getStrategyId() != null, ModStrategy::getStrategyId, bo.getStrategyId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ModStrategyBo bo) {
|
||||
ModStrategy add = BeanUtil.toBean(bo, ModStrategy.class);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ModStrategyBo bo) {
|
||||
ModStrategy update = BeanUtil.toBean(bo, ModStrategy.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.klp.pltcm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pltcm.domain.bo.ModThickClassBo;
|
||||
import com.klp.pltcm.domain.vo.ModThickClassVo;
|
||||
import com.klp.pltcm.domain.ModThickClass;
|
||||
import com.klp.pltcm.mapper.ModThickClassMapper;
|
||||
import com.klp.pltcm.service.IModThickClassService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 厚度分类Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ModThickClassServiceImpl implements IModThickClassService {
|
||||
|
||||
private final ModThickClassMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ModThickClassVo queryById(Long classId) {
|
||||
return baseMapper.selectVoById(classId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ModThickClassVo> queryPageList(ModThickClassBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ModThickClass> lqw = buildQueryWrapper(bo);
|
||||
Page<ModThickClassVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModThickClassVo> queryList(ModThickClassBo bo) {
|
||||
LambdaQueryWrapper<ModThickClass> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ModThickClass> buildQueryWrapper(ModThickClassBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ModThickClass> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getClassId() != null, ModThickClass::getClassId, bo.getClassId());
|
||||
lqw.eq(bo.getBorder() != null, ModThickClass::getBorder, bo.getBorder());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDescription()), ModThickClass::getDescription, bo.getDescription());
|
||||
lqw.orderByAsc(ModThickClass::getClassId);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ModThickClassBo bo) {
|
||||
ModThickClass add = BeanUtil.toBean(bo, ModThickClass.class);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setClassId(add.getClassId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ModThickClassBo bo) {
|
||||
ModThickClass update = BeanUtil.toBean(bo, ModThickClass.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.klp.pltcm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pltcm.domain.bo.ModWidthClassBo;
|
||||
import com.klp.pltcm.domain.vo.ModWidthClassVo;
|
||||
import com.klp.pltcm.domain.ModWidthClass;
|
||||
import com.klp.pltcm.mapper.ModWidthClassMapper;
|
||||
import com.klp.pltcm.service.IModWidthClassService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 宽度分类Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ModWidthClassServiceImpl implements IModWidthClassService {
|
||||
|
||||
private final ModWidthClassMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ModWidthClassVo queryById(Long classId) {
|
||||
return baseMapper.selectVoById(classId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ModWidthClassVo> queryPageList(ModWidthClassBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ModWidthClass> lqw = buildQueryWrapper(bo);
|
||||
Page<ModWidthClassVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModWidthClassVo> queryList(ModWidthClassBo bo) {
|
||||
LambdaQueryWrapper<ModWidthClass> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ModWidthClass> buildQueryWrapper(ModWidthClassBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ModWidthClass> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getClassId() != null, ModWidthClass::getClassId, bo.getClassId());
|
||||
lqw.eq(bo.getBorder() != null, ModWidthClass::getBorder, bo.getBorder());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDescription()), ModWidthClass::getDescription, bo.getDescription());
|
||||
lqw.orderByAsc(ModWidthClass::getClassId);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ModWidthClassBo bo) {
|
||||
ModWidthClass add = BeanUtil.toBean(bo, ModWidthClass.class);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setClassId(add.getClassId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ModWidthClassBo bo) {
|
||||
ModWidthClass update = BeanUtil.toBean(bo, ModWidthClass.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.klp.pltcm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pltcm.domain.bo.ModYieldStressClassBo;
|
||||
import com.klp.pltcm.domain.vo.ModYieldStressClassVo;
|
||||
import com.klp.pltcm.domain.ModYieldStressClass;
|
||||
import com.klp.pltcm.mapper.ModYieldStressClassMapper;
|
||||
import com.klp.pltcm.service.IModYieldStressClassService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 屈服强度分类Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ModYieldStressClassServiceImpl implements IModYieldStressClassService {
|
||||
|
||||
private final ModYieldStressClassMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ModYieldStressClassVo queryById(Long classId) {
|
||||
return baseMapper.selectVoById(classId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ModYieldStressClassVo> queryPageList(ModYieldStressClassBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ModYieldStressClass> lqw = buildQueryWrapper(bo);
|
||||
Page<ModYieldStressClassVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModYieldStressClassVo> queryList(ModYieldStressClassBo bo) {
|
||||
LambdaQueryWrapper<ModYieldStressClass> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ModYieldStressClass> buildQueryWrapper(ModYieldStressClassBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ModYieldStressClass> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getClassId() != null, ModYieldStressClass::getClassId, bo.getClassId());
|
||||
lqw.eq(bo.getBorder() != null, ModYieldStressClass::getBorder, bo.getBorder());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDescription()), ModYieldStressClass::getDescription, bo.getDescription());
|
||||
lqw.orderByAsc(ModYieldStressClass::getClassId);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ModYieldStressClassBo bo) {
|
||||
ModYieldStressClass add = BeanUtil.toBean(bo, ModYieldStressClass.class);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setClassId(add.getClassId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ModYieldStressClassBo bo) {
|
||||
ModYieldStressClass update = BeanUtil.toBean(bo, ModYieldStressClass.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.klp.pltcm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pltcm.domain.bo.SchRatioBo;
|
||||
import com.klp.pltcm.domain.vo.SchRatioVo;
|
||||
import com.klp.pltcm.domain.SchRatio;
|
||||
import com.klp.pltcm.mapper.SchRatioMapper;
|
||||
import com.klp.pltcm.service.ISchRatioService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 比例表Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SchRatioServiceImpl implements ISchRatioService {
|
||||
|
||||
private final SchRatioMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public SchRatioVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SchRatioVo> queryPageList(SchRatioBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SchRatio> lqw = buildQueryWrapper(bo);
|
||||
Page<SchRatioVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchRatioVo> queryList(SchRatioBo bo) {
|
||||
LambdaQueryWrapper<SchRatio> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SchRatio> buildQueryWrapper(SchRatioBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SchRatio> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRatioIndex() != null, SchRatio::getRatioIndex, bo.getRatioIndex());
|
||||
lqw.eq(bo.getRatioTableid() != null, SchRatio::getRatioTableid, bo.getRatioTableid());
|
||||
lqw.eq(bo.getThickId() != null, SchRatio::getThickId, bo.getThickId());
|
||||
lqw.eq(bo.getRatio() != null, SchRatio::getRatio, bo.getRatio());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(SchRatioBo bo) {
|
||||
SchRatio add = BeanUtil.toBean(bo, SchRatio.class);
|
||||
// 替代Oracle触发器: 计算STAND0-STAND9的合计值
|
||||
calculateTotal(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(SchRatioBo bo) {
|
||||
SchRatio update = BeanUtil.toBean(bo, SchRatio.class);
|
||||
// 替代Oracle触发器: 计算STAND0-STAND9的合计值
|
||||
calculateTotal(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算STAND0-STAND9之和 (替代Oracle触发器 TRG_BEF_SCH_RATIO)
|
||||
*/
|
||||
private void calculateTotal(SchRatio entity) {
|
||||
double total = nvl(entity.getStand0()) + nvl(entity.getStand1())
|
||||
+ nvl(entity.getStand2()) + nvl(entity.getStand3())
|
||||
+ nvl(entity.getStand4()) + nvl(entity.getStand5())
|
||||
+ nvl(entity.getStand6()) + nvl(entity.getStand7())
|
||||
+ nvl(entity.getStand8()) + nvl(entity.getStand9());
|
||||
entity.setTotal(total);
|
||||
}
|
||||
|
||||
private double nvl(Double val) {
|
||||
return val != null ? val : 0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user