上一版代码处理包无指令情况

This commit is contained in:
1378012178@qq.com 2026-02-24 15:39:44 +08:00
parent abd4a76a35
commit cd71f4f2d9
3 changed files with 16 additions and 7 deletions

View File

@ -66,6 +66,9 @@ public class CareDirectivePlanServiceImpl extends ServiceImpl<CareDirectivePlanM
groupList.stream().forEach(item -> {
if ("Y".equals(item.getIzPackage())) {
List<DirectiveEntity> directives = packageMap.get(item.getDirectiveId()).getDirectives();
if (CollectionUtils.isEmpty(directives)) {
directives = List.of();
}
item.setDirectivesList(BeanUtil.copyToList(directives, CareDirectivePlan.class));
}
});

View File

@ -64,6 +64,9 @@ public class InvoicingDirectivePlanServiceImpl extends ServiceImpl<InvoicingDire
groupList.stream().forEach(item -> {
if ("Y".equals(item.getIzPackage())) {
List<DirectiveEntity> directives = packageMap.get(item.getDirectiveId()).getDirectives();
if (CollectionUtils.isEmpty(directives)) {
directives = List.of();
}
item.setDirectivesList(BeanUtil.copyToList(directives, InvoicingDirectivePlan.class));
}
});

View File

@ -25,7 +25,7 @@ import java.util.stream.Collectors;
/**
* @Description: 后勤服务指令计划
* @Author: caolei
* @Date: 2026-1-6
* @Date: 2026-1-6
* @Version: V1.0
*/
@Service
@ -64,6 +64,9 @@ public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDire
groupList.stream().forEach(item -> {
if ("Y".equals(item.getIzPackage())) {
List<DirectiveEntity> directives = packageMap.get(item.getDirectiveId()).getDirectives();
if (CollectionUtils.isEmpty(directives)) {
directives = List.of();
}
item.setDirectivesList(BeanUtil.copyToList(directives, LogisticsDirectivePlan.class));
}
});
@ -81,7 +84,7 @@ public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDire
@Override
public LogisticsDirectiveEntity addDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
BeanUtils.copyProperties(logisticsDirectiveEntity,logisticsDirectivePlan);
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
baseMapper.insert(logisticsDirectivePlan);
//TODO 增加日志
@ -94,7 +97,7 @@ public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDire
@Override
public void editDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
BeanUtils.copyProperties(logisticsDirectiveEntity,logisticsDirectivePlan);
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
LogisticsDirectivePlan entity = baseMapper.selectById(logisticsDirectiveEntity.getId());
// baseMapper.updateById(logisticsDirectivePlan);
baseMapper.deleteByIdPhysic(logisticsDirectiveEntity.getId());
@ -107,7 +110,7 @@ public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDire
@Override
public void deleteDirective(LogisticsDirectiveEntity logisticsDirectiveEntity) {
LogisticsDirectivePlan logisticsDirectivePlan = new LogisticsDirectivePlan();
BeanUtils.copyProperties(logisticsDirectiveEntity,logisticsDirectivePlan);
BeanUtils.copyProperties(logisticsDirectiveEntity, logisticsDirectivePlan);
String id = logisticsDirectivePlan.getId();
//调用方法删除数据池中的数据
dataPoolServiceImpl.deleteDataPool(logisticsDirectivePlan);
@ -121,9 +124,9 @@ public class LogisticsDirectivePlanServiceImpl extends ServiceImpl<LogisticsDire
dto.setNuId(dto_.getNuId());
dto.setQueryType("instant");
List<LogisticsDirectivePlan> list = baseMapper.list(dto);
if(!CollectionUtils.isEmpty(list)){
return BeanUtil.copyToList(list,DirectiveOrderEntity.class);
}else{
if (!CollectionUtils.isEmpty(list)) {
return BeanUtil.copyToList(list, DirectiveOrderEntity.class);
} else {
return List.of();
}
}