|
@ -87,6 +87,35 @@ public class MyTemplateServiceImpl implements MyTemplateService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//工单信息-批量删除工单 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> deleteTemplateBatch(List<String> templateIds){ |
|
|
|
|
|
|
|
|
|
|
|
//收藏表信息删除成功与否标识 |
|
|
|
|
|
boolean collectionFlage = deleteCollection(templateIds); |
|
|
|
|
|
|
|
|
|
|
|
//删除工单参数 |
|
|
|
|
|
boolean workorderGeneralSteponeFlag = deleteGeneralStepOne(templateIds);//常规参数-工序卡1 |
|
|
|
|
|
boolean workorderGeneralSteptwoFlag = deleteGeneralStepTwo(templateIds);//常规参数-工序卡2 |
|
|
|
|
|
boolean workorderGeneralStepthreeFlag = deleteGeneralStepThree(templateIds);//常规参数-工序卡3 |
|
|
|
|
|
boolean workorderGeneralStepfourFlag = deleteGeneralStepFour(templateIds);//常规参数-工序卡4 |
|
|
|
|
|
|
|
|
|
|
|
//检查项目参数 |
|
|
|
|
|
boolean workorderParamSteponeFlag = deleteParamStepOne(templateIds);//检查项目参数-工序卡1 |
|
|
|
|
|
boolean workorderParamSteptwoFlag = deleteParamStepTwo(templateIds);//检查项目参数-工序卡2 |
|
|
|
|
|
boolean workorderParamStepthreeFlag = deleteParamStepThree(templateIds);//检查项目参数-工序卡3 |
|
|
|
|
|
boolean workorderParamStepfourFlag = deleteParamStepFour(templateIds);//检查项目参数-工序卡4 |
|
|
|
|
|
|
|
|
|
|
|
//删除工单信息 |
|
|
|
|
|
boolean templateFlag = workorderTemplateService.removeBatchByIds(templateIds); |
|
|
|
|
|
|
|
|
|
|
|
if(templateFlag){ |
|
|
|
|
|
return Result.OK("工单批量删除成功!"); |
|
|
|
|
|
}else { |
|
|
|
|
|
return Result.error("工单批量删除失败!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/******************************************工单删除*****************************************************************/ |
|
|
/******************************************工单删除*****************************************************************/ |
|
|
//删除工单收藏信息 |
|
|
//删除工单收藏信息 |
|
|
public boolean deleteCollection(String templateId){ |
|
|
public boolean deleteCollection(String templateId){ |
|
@ -308,4 +337,227 @@ public class MyTemplateServiceImpl implements MyTemplateService { |
|
|
|
|
|
|
|
|
return flag; |
|
|
return flag; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**************************************批量删除工单*****************************************************************/ |
|
|
|
|
|
//删除工单收藏信息 |
|
|
|
|
|
public boolean deleteCollection(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//收藏工单获取 |
|
|
|
|
|
List<String> collectionIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderCollection> collectionList = workorderCollectionService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderCollection::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单是否被收藏,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == collectionList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
//收藏工单id获取 |
|
|
|
|
|
for (WorkorderCollection collection : collectionList) { |
|
|
|
|
|
collectionIds.add(collection.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除工单收藏 |
|
|
|
|
|
flag = workorderCollectionService.removeByIds(collectionIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单常规参数-工序卡1 |
|
|
|
|
|
public boolean deleteGeneralStepOne(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//常规参数-工序卡1 |
|
|
|
|
|
List<String> workorderGeneralSteponeIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderGeneralStepone> workorderGeneralSteponeList = workorderGeneralSteponeService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderGeneralStepone::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单有无常规参数,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == workorderGeneralSteponeList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
//参数id获取 |
|
|
|
|
|
for (WorkorderGeneralStepone generalStepone : workorderGeneralSteponeList) { |
|
|
|
|
|
workorderGeneralSteponeIds.add(generalStepone.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderGeneralSteponeService.removeByIds(workorderGeneralSteponeIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单常规参数-工序卡2 |
|
|
|
|
|
public boolean deleteGeneralStepTwo(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//常规参数-工序卡2 |
|
|
|
|
|
List<String> workorderGeneralSteptwoIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderGeneralSteptwo> workorderGeneralSteptwoList = workorderGeneralSteptwoService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderGeneralSteptwo::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单有无常规参数,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == workorderGeneralSteptwoList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
//参数id获取 |
|
|
|
|
|
for (WorkorderGeneralSteptwo generalSteptwo : workorderGeneralSteptwoList) { |
|
|
|
|
|
workorderGeneralSteptwoIds.add(generalSteptwo.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderGeneralSteptwoService.removeByIds(workorderGeneralSteptwoIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单常规参数-工序卡3 |
|
|
|
|
|
public boolean deleteGeneralStepThree(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//常规参数-工序卡3 |
|
|
|
|
|
List<String> workorderGeneralStepthreeIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderGeneralStepthree> workorderGeneralStepthreeList = workorderGeneralStepthreeService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderGeneralStepthree::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单有无常规参数,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == workorderGeneralStepthreeList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
//参数id获取 |
|
|
|
|
|
for (WorkorderGeneralStepthree generalStepthree : workorderGeneralStepthreeList) { |
|
|
|
|
|
workorderGeneralStepthreeIds.add(generalStepthree.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderGeneralStepthreeService.removeByIds(workorderGeneralStepthreeIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单常规参数-工序卡4 |
|
|
|
|
|
public boolean deleteGeneralStepFour(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//常规参数-工序卡4 |
|
|
|
|
|
List<String> workorderGeneralStepfourIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderGeneralStepfour> workorderGeneralStepfourList = workorderGeneralStepfourService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderGeneralStepfour::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单有无常规参数,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == workorderGeneralStepfourList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
//参数id获取 |
|
|
|
|
|
for (WorkorderGeneralStepfour generalStepfour : workorderGeneralStepfourList) { |
|
|
|
|
|
workorderGeneralStepfourIds.add(generalStepfour.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderGeneralStepfourService.removeByIds(workorderGeneralStepfourIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单检查项目参数-工序卡1 |
|
|
|
|
|
public boolean deleteParamStepOne(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//检查项目参数-工序卡1 |
|
|
|
|
|
List<String> workorderParamSteponeIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderParamStepone> workorderParamSteponeList = workorderParamSteponeService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderParamStepone::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
//判断该工单有无检查参数,有则删除,无则默认删除成功 |
|
|
|
|
|
if(0 == workorderParamSteponeList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
for (WorkorderParamStepone paramStepone : workorderParamSteponeList) { |
|
|
|
|
|
workorderParamSteponeIds.add(paramStepone.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderParamSteponeService.removeByIds(workorderParamSteponeIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单检查项目参数-工序卡2 |
|
|
|
|
|
public boolean deleteParamStepTwo(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//检查项目参数-工序卡2 |
|
|
|
|
|
List<String> workorderParamSteptwoIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderParamSteptwo> workorderParamSteptwoList = workorderParamSteptwoService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderParamSteptwo::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
if(0 == workorderParamSteptwoList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
for (WorkorderParamSteptwo paramSteptwo : workorderParamSteptwoList) { |
|
|
|
|
|
workorderParamSteptwoIds.add(paramSteptwo.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderParamSteptwoService.removeByIds(workorderParamSteptwoIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单检查项目参数-工序卡3 |
|
|
|
|
|
public boolean deleteParamStepThree(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//检查项目参数-工序卡3 |
|
|
|
|
|
List<String> workorderParamStepThreeIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderParamStepthree> workorderParamStepthreeList = workorderParamStepthreeService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderParamStepthree::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
if(0 == workorderParamStepthreeList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
for (WorkorderParamStepthree paramStepthree : workorderParamStepthreeList) { |
|
|
|
|
|
workorderParamStepThreeIds.add(paramStepthree.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderParamStepthreeService.removeByIds(workorderParamStepThreeIds); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除关联工单检查项目参数-工序卡4 |
|
|
|
|
|
public boolean deleteParamStepFour(List<String> templateIds){ |
|
|
|
|
|
//执行结果 |
|
|
|
|
|
boolean flag = false; |
|
|
|
|
|
//检查项目参数-工序卡4 |
|
|
|
|
|
List<String> workorderParamStepfourIds = new ArrayList<>(); |
|
|
|
|
|
List<WorkorderParamStepfour> workorderParamStepfourList = workorderParamStepfourService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.in(WorkorderParamStepfour::getTemplateId, templateIds) |
|
|
|
|
|
.list(); |
|
|
|
|
|
if(0 == workorderParamStepfourList.size()){ |
|
|
|
|
|
flag = true; |
|
|
|
|
|
}else { |
|
|
|
|
|
for (WorkorderParamStepfour paramStepfour : workorderParamStepfourList) { |
|
|
|
|
|
workorderParamStepfourIds.add(paramStepfour.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
flag = workorderParamStepfourService.removeByIds(workorderParamStepfourIds); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return flag; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |