Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c50f276928
|
|
@ -866,27 +866,32 @@ public class RepairServiceImpl implements RepairService {
|
||||||
repairMapper.updateRepairedNumTwo(bean.getId(), repairNum, loginUser.getUserid());
|
repairMapper.updateRepairedNumTwo(bean.getId(), repairNum, loginUser.getUserid());
|
||||||
|
|
||||||
// 编码管理--外部返厂维修
|
// 编码管理--外部返厂维修
|
||||||
RepairApplyRecord repairApplyRecord = new RepairApplyRecord().setId(bean.getId()).setTaskId(bean.getTaskId()).setMaId(bean.getMaId())
|
if(partList!=null && partList.size()>0){
|
||||||
.setTypeId(bean.getTypeId()).setRepairType(RepairTypeEnum.RETURN_FACTORY.getTypeId())
|
for (int i = 0; i < partList.size(); i++) {
|
||||||
.setPartName(partList.get(0).getPartName())
|
RepairApplyRecord repairApplyRecord = new RepairApplyRecord().setId(bean.getId()).setTaskId(bean.getTaskId()).setMaId(bean.getMaId())
|
||||||
.setPartType(partList.get(0).getPartType())
|
.setTypeId(bean.getTypeId()).setRepairType(RepairTypeEnum.RETURN_FACTORY.getTypeId())
|
||||||
.setRepairContent(partList.get(0).getRepairContent()).setPartNum(partList.get(0).getPartNum());
|
.setPartName(partList.get(i).getPartName())
|
||||||
|
.setPartType(partList.get(i).getPartType())
|
||||||
|
.setRepairContent(partList.get(i).getRepairContent()).setPartNum(partList.get(i).getPartNum());
|
||||||
|
|
||||||
if (null == partList.get(0).getSupplierId()) {
|
if (null == partList.get(i).getSupplierId()) {
|
||||||
throw new ServiceException("请选择返厂厂家");
|
throw new ServiceException("请选择返厂厂家");
|
||||||
|
}
|
||||||
|
repairApplyRecord.setSupplierId(partList.get(i).getSupplierId());
|
||||||
|
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(i).getBackCost()).orElse(BigDecimal.ZERO));
|
||||||
|
// 新增【维修记录表】
|
||||||
|
repairMapper.addRecord(repairApplyRecord);
|
||||||
|
|
||||||
|
// 配件费用计算
|
||||||
|
BigDecimal sfCosts = partList.get(i).getBackCost() != null ? partList.get(i).getBackCost() : BigDecimal.ZERO;
|
||||||
|
|
||||||
|
// TODO: 判断是否是收费配件,因数据存在多条,可能有些是免费配件 有些收费,所以这里用价格统一做处理,后续讨论
|
||||||
|
// SQL: 新增【维修费用记录表】
|
||||||
|
repairApplyRecord.setRepairNum(partList.get(i).getPartNum() != null ? BigDecimal.valueOf(partList.get(i).getPartNum()) : BigDecimal.ZERO);
|
||||||
|
repairMapper.addRepairCost(repairApplyRecord, sfCosts, partList.get(i).getPartType().toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
repairApplyRecord.setSupplierId(partList.get(0).getSupplierId());
|
|
||||||
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(0).getBackCost()).orElse(BigDecimal.ZERO));
|
|
||||||
// 新增【维修记录表】
|
|
||||||
repairMapper.addRecord(repairApplyRecord);
|
|
||||||
|
|
||||||
// 配件费用计算
|
|
||||||
BigDecimal sfCosts = partList.get(0).getBackCost() != null ? partList.get(0).getBackCost() : BigDecimal.ZERO;
|
|
||||||
|
|
||||||
// TODO: 判断是否是收费配件,因数据存在多条,可能有些是免费配件 有些收费,所以这里用价格统一做处理,后续讨论
|
|
||||||
// SQL: 新增【维修费用记录表】
|
|
||||||
repairApplyRecord.setRepairNum(partList.get(0).getPartNum() != null ? BigDecimal.valueOf(partList.get(0).getPartNum()) : BigDecimal.ZERO);
|
|
||||||
repairMapper.addRepairCost(repairApplyRecord, sfCosts, partList.get(0).getPartType().toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是报废类型,进行上传附件相关处理
|
// 如果是报废类型,进行上传附件相关处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue