bug尝试修复
This commit is contained in:
@@ -233,7 +233,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
redisCache.setCacheObject("materialFlag", 1L, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("materialFlag", 1L, 100, TimeUnit.HOURS);
|
||||||
redisCache.setCacheObject("nextStepFlag", 0L, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("nextStepFlag", 0L, 100, TimeUnit.HOURS);
|
||||||
|
|
||||||
// TODO PLC
|
// TODO MOM
|
||||||
// for (IndustryMaterialVo industryMaterialVo : industryMaterialVos) {
|
// for (IndustryMaterialVo industryMaterialVo : industryMaterialVos) {
|
||||||
// MomResource momResource = getMomResource(industryMaterialVo);
|
// MomResource momResource = getMomResource(industryMaterialVo);
|
||||||
// momService.processPowerOn(momResource);
|
// momService.processPowerOn(momResource);
|
||||||
@@ -411,7 +411,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
|
|
||||||
Long flag = checkFirstOrLast(firstMaterial);
|
Long flag = checkFirstOrLast(firstMaterial);
|
||||||
|
|
||||||
// 记录materialFlagError为升序
|
// 记录 materialFlagError 为升序
|
||||||
redisCache.setCacheObject("materialFlagError", flag, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("materialFlagError", flag, 100, TimeUnit.HOURS);
|
||||||
redisCache.setCacheObject("nextStepFlagError", 0L, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("nextStepFlagError", 0L, 100, TimeUnit.HOURS);
|
||||||
|
|
||||||
@@ -527,9 +527,9 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Long materialFlag = redisCache.getCacheObject("materialFlagError");
|
Long materialFlagError = redisCache.getCacheObject("materialFlagError");
|
||||||
// 处理是向上走还是向下走
|
// 处理是向上走还是向下走
|
||||||
if (materialFlag == 0L) {
|
if (materialFlagError == 0L) {
|
||||||
// 降序
|
// 降序
|
||||||
// 表示走到了最后一个了
|
// 表示走到了最后一个了
|
||||||
if (start == pos) {
|
if (start == pos) {
|
||||||
@@ -588,10 +588,10 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
industryMaterialDto.setOperation(0L);
|
industryMaterialDto.setOperation(0L);
|
||||||
updateIndustryMaterial(industryMaterialDto);
|
updateIndustryMaterial(industryMaterialDto);
|
||||||
IndustryMaterialVo industryMaterialVo;
|
IndustryMaterialVo industryMaterialVo;
|
||||||
Long materialFlag = redisCache.getCacheObject("materialFlagError");
|
Long materialFlagError = redisCache.getCacheObject("materialFlagError");
|
||||||
// 处理是向上走还是向下走
|
// 处理是向上走还是向下走
|
||||||
int next = -1;
|
int next = -1;
|
||||||
if (materialFlag == 0L) {
|
if (materialFlagError == 0L) {
|
||||||
// 找到上一个正常的
|
// 找到上一个正常的
|
||||||
for (int i = pos - 1; i >= 0; i--) {
|
for (int i = pos - 1; i >= 0; i--) {
|
||||||
if (industryMaterialVos.get(i).getState() == 5L && industryMaterialVos.get(i).getIndustryStepVo().getState() == 0L) {
|
if (industryMaterialVos.get(i).getState() == 5L && industryMaterialVos.get(i).getIndustryStepVo().getState() == 0L) {
|
||||||
@@ -850,6 +850,7 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
|||||||
private Long checkFirstOrLast(IndustryMaterialVo firstMaterial) {
|
private Long checkFirstOrLast(IndustryMaterialVo firstMaterial) {
|
||||||
IndustryMaterialVo industryMaterialVo = new IndustryMaterialVo();
|
IndustryMaterialVo industryMaterialVo = new IndustryMaterialVo();
|
||||||
industryMaterialVo.setState(firstMaterial.getState());
|
industryMaterialVo.setState(firstMaterial.getState());
|
||||||
|
industryMaterialVo.setBatchId(firstMaterial.getBatchId());
|
||||||
List<IndustryMaterialVo> industryMaterialVos = selectAbnormalList(industryMaterialVo);
|
List<IndustryMaterialVo> industryMaterialVos = selectAbnormalList(industryMaterialVo);
|
||||||
|
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
|
|||||||
@@ -301,8 +301,9 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
|||||||
s7PLC.writeInt32("M854", Math.toIntExact(num - newStep));
|
s7PLC.writeInt32("M854", Math.toIntExact(num - newStep));
|
||||||
|
|
||||||
Long materialFlagError = redisCache.getCacheObject("materialFlagError");
|
Long materialFlagError = redisCache.getCacheObject("materialFlagError");
|
||||||
|
long safeFlag = (materialFlagError != null && materialFlagError == 1L) ? 0L : 1L;
|
||||||
redisCache.setCacheObject("nextStepFlagError", 0L, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("nextStepFlagError", 0L, 100, TimeUnit.HOURS);
|
||||||
redisCache.setCacheObject("materialFlagError", materialFlagError == 1L ? 0L : 1L, 100, TimeUnit.HOURS);
|
redisCache.setCacheObject("materialFlagError", safeFlag, 100, TimeUnit.HOURS);
|
||||||
|
|
||||||
s7PLC.writeBoolean("DB15.1.2", false);
|
s7PLC.writeBoolean("DB15.1.2", false);
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,8 @@
|
|||||||
<if test="angle != null ">and angle = #{angle}</if>
|
<if test="angle != null ">and angle = #{angle}</if>
|
||||||
<if test="operation != null ">and operation = #{operation}</if>
|
<if test="operation != null ">and operation = #{operation}</if>
|
||||||
<if test="state != null ">and state = #{state}</if>
|
<if test="state != null ">and state = #{state}</if>
|
||||||
<if test="materialId != null and materialId != ''">and material_id = #{materialId}</if>
|
<if test="materialId != null">and material_id = #{materialId}</if>
|
||||||
<if test="batchId != null and batchId != ''">and batch_id = #{batchId}</if>
|
<if test="batchId != null">and batch_id = #{batchId}</if>
|
||||||
</where>
|
</where>
|
||||||
order by step
|
order by step
|
||||||
</select>
|
</select>
|
||||||
@@ -224,7 +224,6 @@
|
|||||||
<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>
|
||||||
|
|
||||||
</trim>
|
</trim>
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
Reference in New Issue
Block a user