|
@@ -49,6 +49,8 @@ public class RepairSupplyService {
|
|
|
IRepairRegisterPartService repairRegisterPartService;
|
|
|
@Autowired
|
|
|
IPartService partService;
|
|
|
+ @Autowired
|
|
|
+ IPriceListService priceListService;
|
|
|
|
|
|
/**
|
|
|
* 维修备件管理 供应链
|
|
@@ -65,24 +67,30 @@ public class RepairSupplyService {
|
|
|
}
|
|
|
|
|
|
public List<RepairRegisterPartVo> partInfo(String repairId,Integer type) {
|
|
|
- LambdaQueryWrapper<RepairRegisterPart> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(RepairRegisterPart::getRepairId,repairId);
|
|
|
+ LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(PriceList::getRepairId,repairId);
|
|
|
+ wrapper.eq(PriceList::getStatus,1);
|
|
|
+ wrapper.eq(PriceList::getType,0);
|
|
|
+
|
|
|
if(type == 0){
|
|
|
- wrapper.eq(RepairRegisterPart::getStatus,0);
|
|
|
+ wrapper.eq(PriceList::getOutStatus,0);
|
|
|
}
|
|
|
- if(type == 1){
|
|
|
- wrapper.eq(RepairRegisterPart::getRecoveryStatus,0);
|
|
|
+ if(type == 0){
|
|
|
+ wrapper.eq(PriceList::getRecoveryStatus,0);
|
|
|
}
|
|
|
- List<RepairRegisterPart> list = repairRegisterPartService.list(wrapper);
|
|
|
+ List<PriceList> list = priceListService.list(wrapper);
|
|
|
+
|
|
|
List<RepairRegisterPartVo> parts = new ArrayList<>();
|
|
|
- for (RepairRegisterPart repairRegisterPart : list) {
|
|
|
- Part part = partService.getById(repairRegisterPart.getPartId());
|
|
|
+ for (PriceList priceList : list) {
|
|
|
+ Part part = partService.getById(priceList.getPartId());
|
|
|
if(part == null){
|
|
|
continue;
|
|
|
}
|
|
|
RepairRegisterPartVo vo = new RepairRegisterPartVo();
|
|
|
+ vo.setPartName(priceList.getName());
|
|
|
+ vo.setPartCount(priceList.getCount());
|
|
|
BeanUtils.copyProperties(part,vo);
|
|
|
- BeanUtils.copyProperties(repairRegisterPart,vo);
|
|
|
+ BeanUtils.copyProperties(priceList,vo);
|
|
|
parts.add(vo);
|
|
|
}
|
|
|
return parts;
|
|
@@ -101,7 +109,7 @@ public class RepairSupplyService {
|
|
|
for (RepairRegisterPartVo partVo : partVoList) {
|
|
|
partService.outStock(partVo.getPartId(),partVo.getPartCount(),userId,repair.getRepairId());
|
|
|
}
|
|
|
- repairRegisterPartService.updateStatus(repair.getRepairId(),1);
|
|
|
+ priceListService.outStock(repair.getRepairId());
|
|
|
|
|
|
repairLogService.saveBySysUser(userId,param.getRepairId(),6,"备件出库");
|
|
|
}
|
|
@@ -119,7 +127,7 @@ public class RepairSupplyService {
|
|
|
for (RepairRegisterPartVo partVo : partVoList) {
|
|
|
partService.recovery(partVo.getPartId(),partVo.getPartCount(),userId,repair.getRepairId());
|
|
|
}
|
|
|
- repairRegisterPartService.updateRecoveryStatus(repair.getRepairId(),1);
|
|
|
+ priceListService.recoveryPart(repair.getRepairId());
|
|
|
|
|
|
repairLogService.saveBySysUser(userId,param.getRepairId(),7,"备件回收");
|
|
|
}
|