Commit a121681f authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 7b653de2 0a94bc8c
...@@ -2,11 +2,12 @@ package com.yeejoin.amos.boot.module.jg.biz.reminder.service; ...@@ -2,11 +2,12 @@ package com.yeejoin.amos.boot.module.jg.biz.reminder.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderField;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto;
import com.yeejoin.amos.boot.module.jg.api.entity.TzsJgColumnReminderRule; import com.yeejoin.amos.boot.module.jg.api.entity.TzsJgColumnReminderRule;
import com.yeejoin.amos.boot.module.jg.biz.reminder.core.ReminderFieldDiff; import com.yeejoin.amos.boot.module.jg.biz.reminder.core.ReminderFieldDiff;
import com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto; import com.yeejoin.amos.boot.module.jg.biz.reminder.dto.MatchItemDto;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderField;
import com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.TzsJgColumnReminderRuleServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.TzsJgColumnReminderRuleServiceImpl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -35,18 +36,22 @@ public class ReminderFieldDiffImpl implements ReminderFieldDiff { ...@@ -35,18 +36,22 @@ public class ReminderFieldDiffImpl implements ReminderFieldDiff {
@Override @Override
public List<ReminderItemDto> getReminderItemList(List<ReminderItemDto> equips, MatchItemDto matchItem) { public List<ReminderItemDto> getReminderItemList(List<ReminderItemDto> equips, MatchItemDto matchItem) {
equips.forEach(reminderItemDto -> { equips.forEach(reminderItemDto -> {
reminderItemDto.setItems(this.buildRemindItem(reminderItemDto, matchItem)); reminderItemDto.setItems(this.buildRemindItemGrade(reminderItemDto, matchItem));
}); });
return equips; return equips;
} }
private List<ReminderField> buildRemindItem(ReminderItemDto reminderItemDto, MatchItemDto matchItem) { private List<ReminderField> buildRemindItemGrade(ReminderItemDto reminderItemDto, MatchItemDto matchItem) {
// regType默认0-新增,不同regType对应不同字段时,配置多行 // regType默认0-新增,不同regType对应不同字段时,配置多行
List<TzsJgColumnReminderRule> rules = reminderRuleService.list(new LambdaQueryWrapper<TzsJgColumnReminderRule>() List<TzsJgColumnReminderRule> rules = reminderRuleService.list(new LambdaQueryWrapper<TzsJgColumnReminderRule>()
.eq(TzsJgColumnReminderRule::getBizType, matchItem.getBizType()) .eq(TzsJgColumnReminderRule::getBizType, matchItem.getBizType())
.eq(StringUtils.isNotEmpty(matchItem.getRegType()), TzsJgColumnReminderRule::getRegType, matchItem.getRegType()) .eq(StringUtils.isNotEmpty(matchItem.getRegType()), TzsJgColumnReminderRule::getRegType, matchItem.getRegType())
.eq(TzsJgColumnReminderRule::getWhetherVehicleCylinder, matchItem.getWhetherVehicleCylinder()) .eq(TzsJgColumnReminderRule::getWhetherVehicleCylinder, matchItem.getWhetherVehicleCylinder())
.eq(matchItem.getIsRegister() != null, TzsJgColumnReminderRule::getIsRegister, matchItem.getIsRegister())); .eq(matchItem.getIsRegister() != null, TzsJgColumnReminderRule::getIsRegister, matchItem.getIsRegister()));
return getReminderFieldList(reminderItemDto, matchItem, rules);
}
private List<ReminderField> getReminderFieldList(ReminderItemDto reminderItemDto, MatchItemDto matchItem, List<TzsJgColumnReminderRule> rules) {
List<TzsJgColumnReminderRule> equCategoryMatch = new ArrayList<>(); List<TzsJgColumnReminderRule> equCategoryMatch = new ArrayList<>();
List<TzsJgColumnReminderRule> equListMatch = new ArrayList<>(); List<TzsJgColumnReminderRule> equListMatch = new ArrayList<>();
// 特殊不一样的配置设备类别 // 特殊不一样的配置设备类别
...@@ -68,6 +73,17 @@ public class ReminderFieldDiffImpl implements ReminderFieldDiff { ...@@ -68,6 +73,17 @@ public class ReminderFieldDiffImpl implements ReminderFieldDiff {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private List<ReminderField> buildRemindItem(ReminderItemDto reminderItemDto, MatchItemDto matchItem) {
// regType默认0-新增,不同regType对应不同字段时,配置多行
List<TzsJgColumnReminderRule> rules = reminderRuleService.list(new LambdaQueryWrapper<TzsJgColumnReminderRule>()
.eq(TzsJgColumnReminderRule::getBizType, matchItem.getBizType())
.eq(StringUtils.isNotEmpty(matchItem.getRegType()), TzsJgColumnReminderRule::getRegType, matchItem.getRegType())
.eq(TzsJgColumnReminderRule::getWhetherVehicleCylinder, matchItem.getWhetherVehicleCylinder())
.eq(BaseEntity::getIsDelete, false)
.eq(matchItem.getIsRegister() != null, TzsJgColumnReminderRule::getIsRegister, matchItem.getIsRegister()));
return getReminderFieldList(reminderItemDto, matchItem, rules);
}
private boolean containKeyAndValue(Map<String, Object> detailData, String columnKey) { private boolean containKeyAndValue(Map<String, Object> detailData, String columnKey) {
return Arrays.stream(columnKey.split(",")).anyMatch(k -> detailData.containsKey(k) && ObjectUtils.isNotEmpty(detailData.get(k))); return Arrays.stream(columnKey.split(",")).anyMatch(k -> detailData.containsKey(k) && ObjectUtils.isNotEmpty(detailData.get(k)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment