|
@@ -2,12 +2,15 @@ package com.fdkankan.sale.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.fdkankan.sale.entity.PartLog;
|
|
import com.fdkankan.sale.entity.PriceList;
|
|
import com.fdkankan.sale.entity.PriceList;
|
|
import com.fdkankan.sale.mapper.IPriceListMapper;
|
|
import com.fdkankan.sale.mapper.IPriceListMapper;
|
|
|
|
+import com.fdkankan.sale.service.IPartLogService;
|
|
import com.fdkankan.sale.service.IPriceListService;
|
|
import com.fdkankan.sale.service.IPriceListService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fdkankan.sale.vo.response.RepairInfoExportVo;
|
|
import com.fdkankan.sale.vo.response.RepairInfoExportVo;
|
|
import com.fdkankan.sale.vo.response.RepairerVo;
|
|
import com.fdkankan.sale.vo.response.RepairerVo;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -27,6 +30,8 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceList> implements IPriceListService {
|
|
public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceList> implements IPriceListService {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ IPartLogService partLogService;
|
|
@Override
|
|
@Override
|
|
public List<PriceList> getByRepairId(String repairId) {
|
|
public List<PriceList> getByRepairId(String repairId) {
|
|
LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -135,7 +140,23 @@ public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceLis
|
|
|
|
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
- private void setMapAmount( HashMap<String,BigDecimal> map,List<PriceList> priceLists){
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean checkPartOut(List<PriceList> collect, String repairId) {
|
|
|
|
+ Boolean flag = true;
|
|
|
|
+ HashMap<Integer, PartLog> outMap = partLogService.getByRepairId(repairId, 1);
|
|
|
|
+ if(!outMap.isEmpty()){
|
|
|
|
+ for (PriceList priceList : collect) {
|
|
|
|
+ PartLog partLog = outMap.get(priceList.getPartId());
|
|
|
|
+ if(partLog == null || !partLog.getCount().equals(priceList.getCount())){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return flag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void setMapAmount(HashMap<String,BigDecimal> map, List<PriceList> priceLists){
|
|
for (PriceList priceList : priceLists) {
|
|
for (PriceList priceList : priceLists) {
|
|
map.putIfAbsent(priceList.getRepairId(), BigDecimal.ZERO);
|
|
map.putIfAbsent(priceList.getRepairId(), BigDecimal.ZERO);
|
|
BigDecimal payAmount = map.get(priceList.getRepairId());
|
|
BigDecimal payAmount = map.get(priceList.getRepairId());
|
|
@@ -144,4 +165,5 @@ public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceLis
|
|
map.put(priceList.getRepairId(),payAmount);
|
|
map.put(priceList.getRepairId(),payAmount);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|