|
@@ -13,14 +13,20 @@ import com.fdkankan.sale.exception.BusinessException;
|
|
|
import com.fdkankan.sale.mapper.IRepairInvoiceMapper;
|
|
|
import com.fdkankan.sale.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.sale.util.StatusUtil;
|
|
|
import com.fdkankan.sale.vo.request.RepairInvoiceParam;
|
|
|
import com.fdkankan.sale.vo.response.RepairInvoiceVo;
|
|
|
+import com.fdkankan.sale.vo.response.RepairerVo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -41,6 +47,8 @@ public class RepairInvoiceServiceImpl extends ServiceImpl<IRepairInvoiceMapper,
|
|
|
FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
@Autowired
|
|
|
ICustomerService customerService;
|
|
|
+ @Autowired
|
|
|
+ IPriceListService priceListService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -53,6 +61,20 @@ public class RepairInvoiceServiceImpl extends ServiceImpl<IRepairInvoiceMapper,
|
|
|
@Override
|
|
|
public Page<RepairInvoiceVo> pageList(RepairInvoiceParam param) {
|
|
|
Page<RepairInvoiceVo> voList = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
+ List<RepairerVo> list = new ArrayList<>();
|
|
|
+ for (RepairInvoiceVo record : voList.getRecords()) {
|
|
|
+ RepairerVo vo = new RepairerVo();
|
|
|
+ BeanUtils.copyProperties(record,vo);
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ HashMap<String, BigDecimal> amountMap = priceListService.getAmountByRepairIds(list);
|
|
|
+ for (RepairInvoiceVo record : voList.getRecords()) {
|
|
|
+ if(StatusUtil.getWarranty(record.getWarrantyType())){
|
|
|
+ record.setInvoiceAmount(BigDecimal.ZERO);
|
|
|
+ }else {
|
|
|
+ record.setInvoiceAmount(amountMap.get(record.getRepairId()) == null ?BigDecimal.ZERO: amountMap.get(record.getRepairId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
return voList;
|
|
|
}
|
|
|
|