feat(mapper): 完善参数重复检查
- 在SegmentTotalMapper.xml中添加根据入库钢卷号查询最新一段total_values_json的方法 - 为SetupFurTempServiceImpl添加钢种参数重复检查机制 - 为SetupTensionServiceImpl添加厚度和屈服强度参数重复检查机制 - 为SetupTlServiceImpl添加钢种、屈服强度和厚度参数重复检查机制 - 为SetupTmBendforceServiceImpl添加宽度和轧制力参数重复检查机制 - 为SetupTmMeshServiceImpl添加钢种、屈服强度和厚度参数重复检查机制 - 为SetupTmRollforceServiceImpl添加钢种、屈服强度、厚度和延伸率参数重复检查机制
This commit is contained in:
@@ -53,6 +53,10 @@ public class SetupFurTempServiceImpl implements ISetupFurTempService
|
||||
@Override
|
||||
public int insertSetupFurTemp(SetupFurTemp setupFurTemp)
|
||||
{
|
||||
//如果 String steelGrade 存在则不能新增
|
||||
if (setupFurTempMapper.selectSetupFurTempBySteelGrade(setupFurTemp.getSteelGrade()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupFurTemp.setCreateTime(DateUtils.getNowDate());
|
||||
return setupFurTempMapper.insertSetupFurTemp(setupFurTemp);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupTensionServiceImpl implements ISetupTensionService
|
||||
@Override
|
||||
public int insertSetupTension(SetupTension setupTension)
|
||||
{
|
||||
//如果thick 和 yield_stren已存在那么就不需要插入
|
||||
if(setupTensionMapper.selectSetupTensionByThick(setupTension.getThick(), setupTension.getYieldStren()) != null){
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupTension.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTensionMapper.insertSetupTension(setupTension);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupTlServiceImpl implements ISetupTlService
|
||||
@Override
|
||||
public int insertSetupTl(SetupTl setupTl)
|
||||
{
|
||||
//如果thick 和 yield_stren已存在那么就不需要插入
|
||||
if(setupTlMapper.selectSetupTlBySteelGrade(setupTl.getSteelGrade(), setupTl.getYieldStren(), setupTl.getThick()) != null){
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupTl.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTlMapper.insertSetupTl(setupTl);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupTmBendforceServiceImpl implements ISetupTmBendforceService
|
||||
@Override
|
||||
public int insertSetupTmBendforce(SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
// 如果width 和 rollForce 在表里已存在则不能新增
|
||||
if (setupTmBendforceMapper.selectSetupTmBendforceByWidth(setupTmBendforce.getWidth(),setupTmBendforce.getRollForce()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupTmBendforce.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmBendforceMapper.insertSetupTmBendforce(setupTmBendforce);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupTmMeshServiceImpl implements ISetupTmMeshService
|
||||
@Override
|
||||
public int insertSetupTmMesh(SetupTmMesh setupTmMesh)
|
||||
{
|
||||
// 如果steelGrade,yieldStren,thick 在表里已存在则不能新增
|
||||
if (setupTmMeshMapper.selectSetupTmMeshBySteelGrade(setupTmMesh.getSteelGrade(), setupTmMesh.getYieldStren(), setupTmMesh.getThick()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupTmMesh.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmMeshMapper.insertSetupTmMesh(setupTmMesh);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupTmRollforceServiceImpl implements ISetupTmRollforceService
|
||||
@Override
|
||||
public int insertSetupTmRollforce(SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
//如果steelGrade,yieldStren,thick,elong 在表里已存在则不能新增
|
||||
if (setupTmRollforceMapper.selectSetupTmRollforceBySteelGrade(setupTmRollforce.getSteelGrade(), setupTmRollforce.getYieldStren(), setupTmRollforce.getThick(), setupTmRollforce.getElong()) != null) {
|
||||
throw new RuntimeException("该数据已存在");
|
||||
}
|
||||
setupTmRollforce.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmRollforceMapper.insertSetupTmRollforce(setupTmRollforce);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.fizz.business.mapper.SegmentTotalMapper">
|
||||
<select id="getLatestRecord" resultType="com.fizz.business.domain.SegmentTotal">
|
||||
SELECT * FROM cpg_segment_total where id=(SELECT max(id) FROM cpg_segment_total)
|
||||
|
||||
<!-- 根据入库钢卷号查询最新一段的 total_values_json -->
|
||||
<select id="selectLatestTotalValuesJsonByCoilId"
|
||||
parameterType="java.lang.String"
|
||||
resultType="java.lang.String">
|
||||
SELECT
|
||||
total_values_json
|
||||
FROM cpl_segment_total
|
||||
WHERE en_coil_id = #{coilId}
|
||||
ORDER BY seg_no DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user