fix:硬件维保时间计算bug处理
parent
4d911c93ae
commit
818454311f
|
|
@ -12,6 +12,7 @@ import com.ruoyi.common.utils.ShiroUtils;
|
|||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.OrderList;
|
||||
import com.ruoyi.sip.domain.ProductInfo;
|
||||
import com.ruoyi.sip.domain.ProjectProductInfo;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.mapper.OrderInfoMapper;
|
||||
import com.ruoyi.sip.mapper.ProductInfoMapper;
|
||||
|
|
@ -225,16 +226,18 @@ public class DeliveryListServiceImpl implements IDeliveryListService {
|
|||
if (CollUtil.isEmpty(serviceInfoList) && ProductInfo.ProductTypeEnum.HARDWARE.getType().equals(deliveryInfoVo.getProductType())
|
||||
&& CollUtil.isNotEmpty(productInfos)) {
|
||||
// 判断是否硬件,如果是硬件取标准维保三年
|
||||
int extendedWarrantyYears = 0;
|
||||
for (ProductInfo productInfo : productInfos) {
|
||||
if (ProductInfo.ProductTypeEnum.SERVICE.getType().equals(productInfo.getType()) && ProductInfo.ProductTypeLevel2ServiceEnum.HARDWARE_QA.getType().equals(productInfo.getLevel2Type()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
extendedWarrantyYears += Integer.parseInt(productInfo.getValue());
|
||||
}
|
||||
if (ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType().equals(productInfo.getType()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
startTime = updateStartTimeAndAddList(deliveryInfoVo, productInfo, startTime, serviceInfoList);
|
||||
}
|
||||
}
|
||||
int extendedWarrantyYears = 0;
|
||||
// 将硬件延保时间累加到硬件标准维保时间上
|
||||
for (ProductInfo productInfo : productInfoList) {
|
||||
if (ProductInfo.ProductTypeEnum.SERVICE.getType().equals(productInfo.getType()) && ProductInfo.ProductTypeLevel2ServiceEnum.HARDWARE_QA.getType().equals(productInfo.getLevel2Type()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
extendedWarrantyYears += Integer.parseInt(productInfo.getValue());
|
||||
}
|
||||
}
|
||||
if (extendedWarrantyYears > 0 && CollUtil.isNotEmpty(serviceInfoList)) {
|
||||
DeliveryInfoVo.ServiceInfo serviceInfo = serviceInfoList.get(serviceInfoList.size() - 1);
|
||||
serviceInfo.setServiceEndTime(DateUtils.addYears(serviceInfo.getServiceEndTime(), extendedWarrantyYears));
|
||||
|
|
|
|||
|
|
@ -658,11 +658,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
if (CollUtil.isEmpty(serviceInfoList) && ProductInfo.ProductTypeEnum.HARDWARE.getType().equals(deliveryInfoVo.getProductType())
|
||||
&& CollUtil.isNotEmpty(productInfos)) {
|
||||
// 判断是否硬件,如果是硬件取标准维保三年
|
||||
int extendedWarrantyYears = 0;
|
||||
for (ProductInfo productInfo : productInfos) {
|
||||
if (ProductInfo.ProductTypeEnum.SERVICE.getType().equals(productInfo.getType()) && ProductInfo.ProductTypeLevel2ServiceEnum.HARDWARE_QA.getType().equals(productInfo.getLevel2Type()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
extendedWarrantyYears += Integer.parseInt(productInfo.getValue());
|
||||
}
|
||||
if (ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType().equals(productInfo.getType()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
ProjectProductInfo projectProductInfo = new ProjectProductInfo();
|
||||
projectProductInfo.setProductBomCode(productInfo.getProductCode());
|
||||
|
|
@ -673,6 +669,12 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
}
|
||||
}
|
||||
// 将硬件延保时间累加到硬件标准维保时间上
|
||||
int extendedWarrantyYears = 0;
|
||||
for (ProjectProductInfo productInfo : productInfoList) {
|
||||
if (ProductInfo.ProductTypeEnum.SERVICE.getType().equals(productInfo.getType()) && ProductInfo.ProductTypeLevel2ServiceEnum.HARDWARE_QA.getType().equals(productInfo.getLevel2Type()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
extendedWarrantyYears += Integer.parseInt(productInfo.getValue());
|
||||
}
|
||||
}
|
||||
if (extendedWarrantyYears > 0 && CollUtil.isNotEmpty(serviceInfoList)) {
|
||||
DeliveryInfoVo.ServiceInfo serviceInfo = serviceInfoList.get(serviceInfoList.size() - 1);
|
||||
serviceInfo.setServiceEndTime(DateUtils.addYears(serviceInfo.getServiceEndTime(), extendedWarrantyYears));
|
||||
|
|
|
|||
Loading…
Reference in New Issue