新增工艺确实导致进入系统后异常,修改删除数据
摄像头后操作数据库
This commit is contained in:
@@ -210,12 +210,26 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
||||
|
||||
@Override
|
||||
public int delIndustryMaterialById(String id) {
|
||||
|
||||
|
||||
IndustryMaterialVo industryMaterialVo = industryMaterialMapper.selectIndustryMaterialById(id);
|
||||
Long batchId = industryMaterialVo.getBatchId();
|
||||
IndustryBatchVo industryBatchVo = industryBatchService.selectIndustryBatchById(batchId);
|
||||
industryBatchVo.setBatchSize(industryBatchVo.getBatchSize() - 1);
|
||||
industryBatchService.updateIndustryBatch(industryBatchVo);
|
||||
// 删除此数据
|
||||
// 删除此数据: 先清理摄像头放置删除后立马被写入
|
||||
// leftId和rightId
|
||||
// 判断左摄像头的id是否与当前删除的相同如果相同则删除此缓存
|
||||
if (id.equals(redisCache.getCacheObject("leftId"))) {
|
||||
redisCache.deleteObject("leftId");
|
||||
s7PLC.writeString("DB4.30","\u0000\u0000\u0000\u0000");
|
||||
|
||||
}
|
||||
if (id.equals(redisCache.getCacheObject("rightId"))) {
|
||||
redisCache.deleteObject("rightId");
|
||||
|
||||
s7PLC.writeString("DB44.30","\u0000\u0000\u0000\u0000");
|
||||
}
|
||||
industryMaterialMapper.deleteIndustryMaterialById(id);
|
||||
List<IndustryMaterialVo> industryMaterialVos = industryMaterialMapper.selectIndustryMaterialByBatchId(batchId);
|
||||
// 进行重新排列
|
||||
@@ -234,18 +248,6 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
|
||||
redisCache.setCacheObject("sort",sort);
|
||||
redisCache.setCacheObject("size",size);
|
||||
|
||||
// 接下来处理左右摄像头数据
|
||||
// leftId和rightId
|
||||
// 判断左摄像头的id是否与当前删除的相同如果相同则删除此缓存
|
||||
if (id.equals(redisCache.getCacheObject("leftId"))) {
|
||||
redisCache.deleteObject("leftId");
|
||||
s7PLC.writeString("DB4.30","\u0000\u0000\u0000\u0000");
|
||||
|
||||
}
|
||||
if (id.equals(redisCache.getCacheObject("rightId"))) {
|
||||
redisCache.deleteObject("rightId");
|
||||
s7PLC.writeString("DB44.30","\u0000\u0000\u0000\u0000");
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -441,6 +441,8 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
||||
|
||||
@Override
|
||||
public int createStep(IndustryMaterial industryMaterial) {
|
||||
|
||||
// 将状态改为了轧制中
|
||||
List<IndustryMaterialVo> successList = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial);
|
||||
if (Objects.nonNull(successList) && !successList.isEmpty()) {
|
||||
// 20250809 为了将不同工艺的物料生成不同工艺的道次,此处应该根据每一快物料生成对应的道次数据
|
||||
@@ -459,16 +461,15 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
|
||||
}
|
||||
// 拿到第一个物料对应的工艺要生成的所有道次
|
||||
List<IndustryTechnologyVo> industryTechnologyVos = industryTechnologyService.selectIndustryTechnologyList(industryTechnology);
|
||||
// List<IndustryMaterialVo> industryMaterialVos = industryMaterialService.selectIndustryMaterialByBatchId(industryMaterial.getBatchId());
|
||||
// 添加特判 当工艺表为空时通知前端无此工艺不可进入轧制页面
|
||||
// if (industryTechnologyVos.isEmpty()) {
|
||||
// // 把状态改回去
|
||||
// success.setState(0L);
|
||||
// industryMaterialMapper.updateIndustryMaterial(success);
|
||||
// return Constants.NOT_HAVE_TECHNOLOGY;
|
||||
// }
|
||||
|
||||
// TODO 将道次为空的也放入异常
|
||||
// 校验是否都存在道次 如果有一个不存在此工艺直接返回不做任何操作
|
||||
if (industryTechnologyVos.isEmpty()) {
|
||||
// 把状态改回去
|
||||
success.setState(0L);
|
||||
industryMaterialMapper.updateIndustryMaterial(success);
|
||||
return Constants.NOT_HAVE_TECHNOLOGY;
|
||||
}
|
||||
|
||||
// 也就是说这里不管下面的物料是否为此工艺也按照此工艺生成道次只不过不需要操作
|
||||
for (IndustryTechnologyVo industryTechnologyVo : industryTechnologyVos) {
|
||||
|
||||
Reference in New Issue
Block a user