|
@@ -3,6 +3,7 @@ import com.fdkankan.sale.entity.OrderReceiving;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.fdkankan.sale.entity.CustomerAddress;
|
|
|
import com.fdkankan.sale.entity.Customer;
|
|
|
+import com.fdkankan.sale.util.DateUtil;
|
|
|
import com.fdkankan.sale.vo.response.RepairRegisterVo;
|
|
|
import com.fdkankan.sale.entity.RepairTest;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -18,6 +19,8 @@ import com.fdkankan.sale.vo.response.*;
|
|
|
|
|
|
import com.fdkankan.sale.common.ResultCode;
|
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.omg.CORBA.INTERNAL;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -25,6 +28,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
@@ -240,16 +244,24 @@ public class RepairInfoService {
|
|
|
vo.setRepairRemark(repairDetailVo.getRepairRegisterVo().getRemark());
|
|
|
vo.setCheckDate(repairDetailVo.getRepairRegisterVo().getCreateTime());
|
|
|
vo.setCheckResult(repairDetailVo.getRepairRegisterVo().getCheckResult());
|
|
|
-
|
|
|
vo.setLastRepairId(repairDetailVo.getLastRepairId());
|
|
|
|
|
|
+ String warrantyDate = repairDetailVo.getRepairerVo().getWarrantyDate();
|
|
|
+ if(StringUtils.isNotBlank(warrantyDate)){
|
|
|
+ Date dateByStr = DateUtil.getDateByStr(warrantyDate);
|
|
|
+ Date date = DateUtil.dateAddOneYear( DateUtil.dateAddOne(dateByStr,-7), -1);
|
|
|
+ vo.setBuyDate(DateUtil.getDate(date));
|
|
|
+ }
|
|
|
|
|
|
List<PriceList> priceList = repairDetailVo.getPriceList();
|
|
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
String priceData = "";
|
|
|
List<PriceListExcelVo> excelVos = new ArrayList<>();
|
|
|
+ int i = 0;
|
|
|
for (PriceList list : priceList) {
|
|
|
+ i ++;
|
|
|
PriceListExcelVo excelVo = new PriceListExcelVo();
|
|
|
+ excelVo.setSort(i);
|
|
|
BeanUtils.copyProperties(list,excelVo);
|
|
|
if(list.getDiscount() == 0){
|
|
|
excelVo.setPriceDiscount(list.getPrice());
|
|
@@ -264,6 +276,7 @@ public class RepairInfoService {
|
|
|
}
|
|
|
if(repairDetailVo.getRepairerVo().getWarrantyType() == 0){
|
|
|
PriceListExcelVo excelVo = new PriceListExcelVo();
|
|
|
+ excelVo.setSort(excelVos.size() + 1);
|
|
|
excelVo.setName("保内维修");
|
|
|
excelVo.setAmount(totalAmount.negate());
|
|
|
excelVos.add(excelVo);
|