解决服务矩阵编排时 izmulti没处理
This commit is contained in:
parent
4f8d0fe75e
commit
59f2a9f88d
|
|
@ -256,6 +256,8 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
CareDirectivePlan careDirectivePlan = new CareDirectivePlan();
|
||||
BeanUtils.copyProperties(careDirectiveEntity, careDirectivePlan);
|
||||
CareDirectivePlan entity = baseMapper.selectById(careDirectiveEntity.getId());
|
||||
|
||||
boolean cycleTypeChanged = false;
|
||||
//需要先判断是挪动 还是其它
|
||||
//挪动的话会修改
|
||||
if (!entity.getPositioning().equals(careDirectiveEntity.getPositioning()) || !entity.getPositioningLong().equals(careDirectiveEntity.getPositioningLong())) {
|
||||
|
|
@ -271,6 +273,7 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
|
||||
baseMapper.update(upData, uw);
|
||||
} else {
|
||||
cycleTypeChanged = true;
|
||||
baseMapper.deleteByIdPhysic(careDirectiveEntity.getId());
|
||||
if ("5".equals(careDirectivePlan.getCycleTypeId()) && StringUtils.isBlank(careDirectivePlan.getCycleValue())) {
|
||||
//临时一次 需要处理 执行时间(定时更新快照任务处理的服务指令最近时间(目前是6分钟) + 5秒) 如果当前时间比startTime+执行时间早 则今天执行 否则明天执行
|
||||
|
|
@ -318,10 +321,9 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
baseMapper.insert(careDirectivePlan);
|
||||
}
|
||||
|
||||
//这个单元格内所有一起挪动 只能挪到空单元格 所以不需要考虑这个逻辑↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
//如果nuId+分类标签+单元格坐标下是否已有数据 需要将所有数据改为指令集 否则设置为非指令集
|
||||
// {
|
||||
// //处理旧的单元格
|
||||
if (cycleTypeChanged) {
|
||||
//处理旧的单元格 ( 指令集不存在只挪动其中一个服务 只会整个都挪走)
|
||||
// {
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
|
|
@ -343,29 +345,29 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
|
|||
// baseMapper.update(upData, uw);
|
||||
// }
|
||||
// }
|
||||
// //处理新的单元格
|
||||
// {
|
||||
// QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
// qw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
// qw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
// qw.eq("positioning", careDirectivePlan.getPositioning());
|
||||
// qw.eq("positioning_long", careDirectivePlan.getPositioningLong());
|
||||
// List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
// UpdateWrapper<CareDirectivePlan> uw = new UpdateWrapper<>();
|
||||
// uw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
// uw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
// uw.eq("positioning", careDirectivePlan.getPositioning());
|
||||
// uw.eq("positioning_long", careDirectivePlan.getPositioningLong());
|
||||
// CareDirectivePlan upData = new CareDirectivePlan();
|
||||
// if (CollectionUtils.isEmpty(list) || list.size() == 1) {
|
||||
// upData.setIzMulti("N");
|
||||
// baseMapper.update(upData, uw);
|
||||
// } else {
|
||||
// upData.setIzMulti("Y");
|
||||
// baseMapper.update(upData, uw);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//处理新的单元格
|
||||
{
|
||||
QueryWrapper<CareDirectivePlan> qw = new QueryWrapper<>();
|
||||
qw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
qw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
qw.eq("positioning", careDirectivePlan.getPositioning());
|
||||
qw.eq("positioning_long", careDirectivePlan.getPositioningLong());
|
||||
List<CareDirectivePlan> list = baseMapper.selectList(qw);
|
||||
UpdateWrapper<CareDirectivePlan> uw = new UpdateWrapper<>();
|
||||
uw.eq("nu_id", careDirectivePlan.getNuId());
|
||||
uw.eq("instruction_tag_id", careDirectivePlan.getInstructionTagId());
|
||||
uw.eq("positioning", careDirectivePlan.getPositioning());
|
||||
uw.eq("positioning_long", careDirectivePlan.getPositioningLong());
|
||||
CareDirectivePlan upData = new CareDirectivePlan();
|
||||
if (CollectionUtils.isEmpty(list) || list.size() == 1) {
|
||||
upData.setIzMulti("N");
|
||||
baseMapper.update(upData, uw);
|
||||
} else {
|
||||
upData.setIzMulti("Y");
|
||||
baseMapper.update(upData, uw);
|
||||
}
|
||||
}
|
||||
}
|
||||
//调用方法先删除数据池中的数据,再生成数据池中的数据
|
||||
// dataPoolServiceImpl.editDataPool(entity);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue