设备的发货日期和开始质保日期类型由LocalDate改为String

This commit is contained in:
曹鹏飞 2026-01-28 17:12:14 +08:00
parent 1edb6ce1c5
commit f02e04016d
4 changed files with 28 additions and 3 deletions

View File

@ -197,9 +197,14 @@ public class AdminDeviceService {
ent.setProductLine(u.getProductLine__c());
if (Objects.nonNull(u.getLastCarDevliverDate__c())) {
ent.setShipmentDate(DateTimeUtil.asSystemDateTime(u.getLastCarDevliverDate__c()).format(DateTimeFormatter.ISO_LOCAL_DATE));
} else {
ent.setShipmentDate(null);
}
ent.setWarrantyMonth(u.getWarrantyPeriod1__c());
if (Objects.nonNull(u.getWarrantyStartDate__c())) {
if (Objects.isNull(ent.getWarrantyMonth())){
ent.setWarrantyMonth(0);
}
LocalDateTime warrantyStartDate=DateTimeUtil.asSystemDateTime(u.getWarrantyStartDate__c());
ent.setStartWarrantyDate(warrantyStartDate.format(DateTimeFormatter.ISO_LOCAL_DATE));
LocalDateTime now=LocalDateTime.now();
@ -210,6 +215,9 @@ public class AdminDeviceService {
}else {
ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "WithinWarranty")).findFirst().get().getId());
}
}else {
ent.setStartWarrantyDate(null);
ent.setWarrantyState(null);
}
if (Objects.nonNull(u.getAgent__r())) {
TBaseCustomer customer = agents.stream()

View File

@ -166,6 +166,7 @@ public class AdminDeviceService {
} else if (StrUtil.isBlank(u.getProductLine5__c())) {
log.error("设备机型为空,{}", JSONUtil.toJsonStr(u));
} else {
log.debug("处理设备:"+u.getMachine_Number__c());
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
GongfuDevice ent = deviceMap.get(u.getId());
if (Objects.nonNull(ent)) {
@ -206,9 +207,14 @@ public class AdminDeviceService {
Constant1.PRODUCT_LINE.add(u.getProductLine__c());
if (Objects.nonNull(u.getLastCarDevliverDate__c())) {
ent.setShipmentDate(DateTimeUtil.asSystemDateTime(u.getLastCarDevliverDate__c()).format(DateTimeFormatter.ISO_LOCAL_DATE));
} else {
ent.setShipmentDate(null);
}
ent.setWarrantyMonth(u.getWarrantyPeriod1__c());
if (Objects.nonNull(u.getWarrantyStartDate__c())) {
if (Objects.isNull(ent.getWarrantyMonth())){
ent.setWarrantyMonth(0);
}
LocalDateTime warrantyStartDate=DateTimeUtil.asSystemDateTime(u.getWarrantyStartDate__c());
ent.setStartWarrantyDate(warrantyStartDate.format(DateTimeFormatter.ISO_LOCAL_DATE));
LocalDateTime now=LocalDateTime.now();
@ -219,6 +225,9 @@ public class AdminDeviceService {
}else {
ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "WithinWarranty")).findFirst().get().getId());
}
} else {
ent.setStartWarrantyDate(null);
ent.setWarrantyState(null);
}
// VUtils.trueThrow(true).throwMessage(STATE.SystemErr,"测试");
if (Objects.nonNull(u.getAgent__r())) {

View File

@ -1,6 +1,8 @@
package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
@ -91,16 +93,19 @@ public class Device implements Serializable {
/**
* 发货日期
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String shipmentDate;
/**
* 质保状态-来自字典
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Integer warrantyState;
/**
* 开始质保日期
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String startWarrantyDate;
/**
@ -156,5 +161,6 @@ public class Device implements Serializable {
/**
* 设备地址
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String address;
}

View File

@ -1,8 +1,6 @@
package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@ -92,16 +90,19 @@ public class GongfuDevice implements Serializable {
/**
* 发货日期
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String shipmentDate;
/**
* 质保状态-来自字典
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Integer warrantyState;
/**
* 开始质保日期
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String startWarrantyDate;
/**
@ -157,5 +158,6 @@ public class GongfuDevice implements Serializable {
/**
* 设备地址
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String address;
}