This commit is contained in:
Vinjor 2024-10-25 18:51:32 +08:00
parent 47f55f5ce1
commit 637a1124bb
2 changed files with 10 additions and 4 deletions

View File

@ -108,7 +108,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
public void createRepairSo(DlRepairSoRespVO repairSoRespVO) {
repairSoRespVO.setSoTime(new Date());
//保存供应商
if (repairSoRespVO.getSupplierId() == null){
if (StringUtils.isEmpty(repairSoRespVO.getSupplierId())){
//采购单中录入供应商或无供应商情况
if (StringUtils.isNotEmpty(repairSoRespVO.getSupplierName())){
//没有选择直接录入的情况

View File

@ -70,8 +70,7 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.common.BaseConstants.ORDER_TENANT_NAME;
import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_RECORDS_TYPE;
import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_TYPE;
import static cn.iocoder.yudao.common.RepairCons.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
@ -299,9 +298,16 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
// 取配件
List<DlRepairTitemReqVO> wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(wares)) {
// 单位字典
List<DictDataRespDTO> recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT);
Map<String,String> unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel));
Set<String> ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet());
List<RepairWares> repairWares = waresService.listByIds(ids);
items.forEach(item -> repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare));
items.forEach(item -> {
repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare);
item.setItemUnit(unitMap.get(item.getItemUnit()));
});
}
result.setWares(wares);
// 取附加