变更
This commit is contained in:
@@ -187,7 +187,7 @@ public class IndustryStepController extends BaseController
|
|||||||
public AjaxResult resource(IndustryMaterial industryMaterial){
|
public AjaxResult resource(IndustryMaterial industryMaterial){
|
||||||
|
|
||||||
return AjaxResult.success(industryStepService.createStep(industryMaterial));
|
return AjaxResult.success(industryStepService.createStep(industryMaterial));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,5 +52,10 @@ public class IndustryTechnology extends BaseEntity
|
|||||||
/** 删除标志 */
|
/** 删除标志 */
|
||||||
private Long delFlag;
|
private Long delFlag;
|
||||||
|
|
||||||
|
/** 直径 */
|
||||||
|
private Double diameter;
|
||||||
|
|
||||||
|
@Excel(name = "规格")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public interface IIndustryMaterialService
|
|||||||
* @param industryMaterial batchId state=1
|
* @param industryMaterial batchId state=1
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String resourceToWorkAndCreateStep(IndustryMaterial industryMaterial);
|
IndustryMaterialVo resourceToWorkAndCreateStep(IndustryMaterial industryMaterial);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常料切换
|
* 异常料切换
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public String resourceToWorkAndCreateStep(IndustryMaterial industryMaterial) {
|
public IndustryMaterialVo resourceToWorkAndCreateStep(IndustryMaterial industryMaterial) {
|
||||||
IndustryMaterialVo industryMaterialVo = new IndustryMaterialVo();
|
IndustryMaterialVo industryMaterialVo = new IndustryMaterialVo();
|
||||||
industryMaterialVo.setBatchId(industryMaterial.getBatchId());
|
industryMaterialVo.setBatchId(industryMaterial.getBatchId());
|
||||||
// 获得该批次的所有原料
|
// 获得该批次的所有原料
|
||||||
@@ -658,7 +658,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
IndustryMaterialVo firstIndustryMaterial = industryMaterialVos.get(0);
|
IndustryMaterialVo firstIndustryMaterial = industryMaterialVos.get(0);
|
||||||
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
||||||
if (!Objects.equals(firstIndustryMaterial.getTechnology(), materialVo.getTechnology())) {
|
if (!Objects.equals(firstIndustryMaterial.getTechnology(), materialVo.getTechnology())) {
|
||||||
return "0";
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
||||||
@@ -666,9 +666,9 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
updateIndustryMaterial(materialVo);
|
updateIndustryMaterial(materialVo);
|
||||||
}
|
}
|
||||||
// 到了这里表示工艺都相同返回1
|
// 到了这里表示工艺都相同返回1
|
||||||
return firstIndustryMaterial.getTechnology();
|
return firstIndustryMaterial;
|
||||||
} else {
|
} else {
|
||||||
return "0";
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -141,16 +141,12 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<IndustryStepVo> selectIndustryStepListByProcess(IndustryStep industryStep) {
|
public List<IndustryStepVo> selectIndustryStepListByProcess(IndustryStep industryStep) {
|
||||||
String materialId = industryStep.getMaterialId();
|
|
||||||
Long batchId = industryStep.getBatchId();
|
|
||||||
industryStep.setMaterialId(materialId);
|
|
||||||
industryStep.setBatchId(batchId);
|
|
||||||
List<IndustryStepVo> industryStepVos = industryStepMapper.selectIndustryStepList(industryStep);
|
List<IndustryStepVo> industryStepVos = industryStepMapper.selectIndustryStepList(industryStep);
|
||||||
if (industryStepVos.isEmpty()) {
|
if (industryStepVos.isEmpty()) {
|
||||||
// 表示该批次没有出现道次 直接return
|
// 表示该批次没有出现道次 直接return
|
||||||
industryStep = new IndustryStep();
|
industryStep = new IndustryStep();
|
||||||
industryStep.setMaterialId(materialId);
|
industryStep.setMaterialId(industryStep.getMaterialId());
|
||||||
industryStep.setBatchId(batchId);
|
industryStep.setBatchId(industryStep.getBatchId());
|
||||||
return industryStepMapper.selectIndustryStepList(industryStep);
|
return industryStepMapper.selectIndustryStepList(industryStep);
|
||||||
}
|
}
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
@@ -257,14 +253,6 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
// nextStepFlag为切换道次的标志位,当其为1时需要进行切换道次,否则不用切换道次
|
// nextStepFlag为切换道次的标志位,当其为1时需要进行切换道次,否则不用切换道次
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// s7PLC.writeBoolean("DB15.1.2", true);
|
|
||||||
// while (!s7PLC.readBoolean("DB15.1.2")) {
|
|
||||||
// Threads.sleep(500);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// if (s7PLC.readBoolean("DB15.1.2")) {
|
|
||||||
Threads.sleep(5000);
|
Threads.sleep(5000);
|
||||||
// 更新该批次中的全部道次的 "操作中" 字段为0
|
// 更新该批次中的全部道次的 "操作中" 字段为0
|
||||||
IndustryStep step = new IndustryStep();
|
IndustryStep step = new IndustryStep();
|
||||||
@@ -329,6 +317,7 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
IndustryStep industryStep = new IndustryStep();
|
IndustryStep industryStep = new IndustryStep();
|
||||||
industryStep.setDelFlag(1L);
|
industryStep.setDelFlag(1L);
|
||||||
industryStep.setState(0L);
|
industryStep.setState(0L);
|
||||||
|
industryStep.setBatchId(industryMaterial.getBatchId());
|
||||||
List<IndustryStepVo> industryStepVos = industryStepMapper.selectErrorIndustryStepList(industryStep);
|
List<IndustryStepVo> industryStepVos = industryStepMapper.selectErrorIndustryStepList(industryStep);
|
||||||
IndustryStep smallStep = industryStepVos.get(0);
|
IndustryStep smallStep = industryStepVos.get(0);
|
||||||
|
|
||||||
@@ -415,12 +404,14 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int createStep(IndustryMaterial industryMaterial) {
|
public int createStep(IndustryMaterial industryMaterial) {
|
||||||
String success = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial);
|
IndustryMaterialVo success = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial);
|
||||||
if (!Objects.equals(success, "0")) {
|
if (Objects.nonNull(success)) {
|
||||||
// 进入这里说明工艺没问题接下里根据工艺表创建道次
|
// 进入这里说明工艺没问题接下里根据工艺表创建道次
|
||||||
// 判断当前是粗轧还是精轧
|
// 判断当前是粗轧还是精轧
|
||||||
IndustryTechnology industryTechnology = new IndustryTechnology();
|
IndustryTechnology industryTechnology = new IndustryTechnology();
|
||||||
industryTechnology.setTechnologyId(success);
|
industryTechnology.setTechnologyId(success.getTechnology());
|
||||||
|
industryTechnology.setDiameter(success.getDiameter());
|
||||||
|
industryTechnology.setSpecification(success.getSpecification());
|
||||||
if (Objects.equals(mode, "0")) {
|
if (Objects.equals(mode, "0")) {
|
||||||
// 粗轧
|
// 粗轧
|
||||||
industryTechnology.setState(0L);
|
industryTechnology.setState(0L);
|
||||||
@@ -431,7 +422,6 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
List<IndustryMaterialVo> industryMaterialVos = industryMaterialService.selectIndustryMaterialByBatchId(industryMaterial.getBatchId());
|
List<IndustryMaterialVo> industryMaterialVos = industryMaterialService.selectIndustryMaterialByBatchId(industryMaterial.getBatchId());
|
||||||
// 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面
|
// 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面
|
||||||
if (industryTechnologyVos.isEmpty()) {
|
if (industryTechnologyVos.isEmpty()) {
|
||||||
|
|
||||||
// 把状态改回去
|
// 把状态改回去
|
||||||
if (Objects.nonNull(industryMaterialVos.get(0))) {
|
if (Objects.nonNull(industryMaterialVos.get(0))) {
|
||||||
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
for (IndustryMaterialVo materialVo : industryMaterialVos) {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@
|
|||||||
<where>
|
<where>
|
||||||
|
|
||||||
<if test="step != null ">and step = #{step}</if>
|
<if test="step != null ">and step = #{step}</if>
|
||||||
<if test="delFlag == null and delFlag ==''">and del_flag = 0</if>
|
<if test="delFlag == null">and del_flag = 0</if>
|
||||||
<if test="delFlag != null and delFlag !=''">and del_flag = #{delFlag}</if>
|
<if test="delFlag != null">and del_flag = #{delFlag}</if>
|
||||||
<if test="reduction != null ">and reduction = #{reduction}</if>
|
<if test="reduction != null ">and reduction = #{reduction}</if>
|
||||||
<if test="setValue != null ">and set_value = #{setValue}</if>
|
<if test="setValue != null ">and set_value = #{setValue}</if>
|
||||||
<if test="angle != null ">and angle = #{angle}</if>
|
<if test="angle != null ">and angle = #{angle}</if>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<include refid="selectIndustryStepVo"/>
|
<include refid="selectIndustryStepVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="step != null ">and step = #{step}</if>
|
<if test="step != null ">and step = #{step}</if>
|
||||||
<if test="delFlag != null and delFlag !=''">and del_flag = #{delFlag}</if>
|
<if test="delFlag != null">and del_flag = #{delFlag}</if>
|
||||||
<if test="reduction != null ">and reduction = #{reduction}</if>
|
<if test="reduction != null ">and reduction = #{reduction}</if>
|
||||||
<if test="setValue != null ">and set_value = #{setValue}</if>
|
<if test="setValue != null ">and set_value = #{setValue}</if>
|
||||||
<if test="angle != null ">and angle = #{angle}</if>
|
<if test="angle != null ">and angle = #{angle}</if>
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="diameter" column="diameter" />
|
||||||
|
<result property="specification" column="specification" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectIndustryTechnologyVo">
|
<sql id="selectIndustryTechnologyVo">
|
||||||
select id, technology_id, step, reduction, thickness_front, thickness_behind, angle, set_value, state, del_flag, remark, create_time, create_by, update_time, update_by from industry_technology
|
select id, technology_id, step, reduction, thickness_front, thickness_behind, angle, set_value, state, del_flag, remark, create_time, create_by, update_time, update_by,diameter,specification from industry_technology
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectIndustryTechnologyList" parameterType="IndustryTechnology" resultMap="IndustryTechnologyResult">
|
<select id="selectIndustryTechnologyList" parameterType="IndustryTechnology" resultMap="IndustryTechnologyResult">
|
||||||
@@ -37,6 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="angle != null "> and angle = #{angle}</if>
|
<if test="angle != null "> and angle = #{angle}</if>
|
||||||
<if test="setValue != null "> and set_value = #{setValue}</if>
|
<if test="setValue != null "> and set_value = #{setValue}</if>
|
||||||
<if test="state != null "> and state = #{state}</if>
|
<if test="state != null "> and state = #{state}</if>
|
||||||
|
<if test="diameter != null "> and diameter = #{diameter}</if>
|
||||||
|
<if test="specification != null "> and specification = #{specification}</if>
|
||||||
</where>
|
</where>
|
||||||
order by step
|
order by step
|
||||||
</select>
|
</select>
|
||||||
@@ -63,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="diameter != null">diameter,</if>
|
||||||
|
<if test="specification != null">specification,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="technologyId != null">#{technologyId},</if>
|
<if test="technologyId != null">#{technologyId},</if>
|
||||||
@@ -79,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="diameter != null">#{diameter},</if>
|
||||||
|
<if test="specification != null">#{specification},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -99,6 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="diameter != null">diameter = #{diameter},</if>
|
||||||
|
<if test="specification != null">specification = #{specification},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
Reference in New Issue
Block a user