diff --git a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceController.java b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceController.java index 2b09018f..a66b4539 100644 --- a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceController.java +++ b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/controller/DeviceController.java @@ -390,8 +390,8 @@ public class DeviceController extends ControllerBase { } if (StrUtil.isNotBlank(dto.getShipmentDate())) { try { - LocalDate date = LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setShipmentDate(DateTimeUtil.asSystemDate(date)); + LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); + device.setShipmentDate(dto.getShipmentDate()); } catch (DateTimeParseException e) { sb.append("发货日期无效;"); } @@ -399,7 +399,7 @@ public class DeviceController extends ControllerBase { if (StrUtil.isNotBlank(dto.getStartWarrantyDate())) { try { LocalDate date = LocalDate.parse(dto.getStartWarrantyDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setStartWarrantyDate(DateTimeUtil.asSystemDate(date)); + device.setStartWarrantyDate(dto.getStartWarrantyDate()); if (StrUtil.isBlank(dto.getWarrantyMonth())) { sb.append("质保期不能为空;"); } else { @@ -487,8 +487,8 @@ public class DeviceController extends ControllerBase { dto.setAgentName(d.getAgentName()); dto.setAreaName(d.getAreaName()); dto.setAddress(d.getAddress()); - dto.setShipmentDate(DateTimeUtil.format(d.getShipmentDate(), "yyyy-MM-dd")); - dto.setStartWarrantyDate(DateTimeUtil.format(d.getStartWarrantyDate(), "yyyy-MM-dd")); + dto.setShipmentDate(d.getShipmentDate()); + dto.setStartWarrantyDate(d.getStartWarrantyDate()); if (Objects.nonNull(d.getWarrantyMonth())) { dto.setWarrantyMonth(String.valueOf(d.getWarrantyMonth())); } @@ -620,8 +620,8 @@ public class DeviceController extends ControllerBase { } if (StrUtil.isNotBlank(dto.getShipmentDate())) { try { - LocalDate date = LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setShipmentDate(DateTimeUtil.asSystemDate(date)); + LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); + device.setShipmentDate(dto.getShipmentDate()); } catch (DateTimeParseException e) { sb.append("发货日期无效;"); } @@ -631,7 +631,7 @@ public class DeviceController extends ControllerBase { if (StrUtil.isNotBlank(dto.getStartWarrantyDate())) { try { LocalDate date = LocalDate.parse(dto.getStartWarrantyDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setStartWarrantyDate(DateTimeUtil.asSystemDate(date)); + device.setStartWarrantyDate(dto.getStartWarrantyDate()); if (StrUtil.isBlank(dto.getWarrantyMonth())) { sb.append("质保期不能为空;"); } else { diff --git a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/pojo/vo/CmrDeviceResultVO.java b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/pojo/vo/CmrDeviceResultVO.java index 17a5f39c..dcfc7600 100644 --- a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/pojo/vo/CmrDeviceResultVO.java +++ b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/pojo/vo/CmrDeviceResultVO.java @@ -1,8 +1,10 @@ package com.nflg.mobilebroken.admin.pojo.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.time.LocalDate; +import java.time.OffsetDateTime; /** * CRM-设备信息 @@ -37,12 +39,14 @@ public class CmrDeviceResultVO { /** * 发货日期 */ - private LocalDate LastCarDevliverDate__c; + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") + private OffsetDateTime LastCarDevliverDate__c; /** * 质保开始日期 */ - private LocalDate WarrantyStartDate__c; + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") + private OffsetDateTime WarrantyStartDate__c; /** * 质保期(月) diff --git a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/service/AdminDeviceService.java b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/service/AdminDeviceService.java index 35b5a521..a063769f 100644 --- a/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/service/AdminDeviceService.java +++ b/nflg-mobilebroken-admin/src/main/java/com/nflg/mobilebroken/admin/service/AdminDeviceService.java @@ -14,11 +14,14 @@ import com.nflg.mobilebroken.admin.pojo.vo.DeviceExcelVO; import com.nflg.mobilebroken.common.constant.Constant; import com.nflg.mobilebroken.common.constant.STATE; import com.nflg.mobilebroken.common.util.AdminUserUtil; +import com.nflg.mobilebroken.common.util.DateTimeUtil; import com.nflg.mobilebroken.common.util.VUtils; import com.nflg.mobilebroken.repository.entity.Device; +import com.nflg.mobilebroken.repository.entity.DictionaryItem; import com.nflg.mobilebroken.repository.entity.GongfuDevice; import com.nflg.mobilebroken.repository.entity.TBaseCustomer; import com.nflg.mobilebroken.repository.service.IDeviceService; +import com.nflg.mobilebroken.repository.service.IDictionaryItemService; import com.nflg.mobilebroken.repository.service.IGongfuDeviceService; import com.nflg.mobilebroken.repository.service.ITBaseCustomerService; import lombok.extern.slf4j.Slf4j; @@ -27,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -52,6 +56,9 @@ public class AdminDeviceService { @Resource private ITBaseCustomerService customerService; + @Resource + IDictionaryItemService dictionaryItemService; + @Transactional(rollbackFor = Exception.class) public void add(DeviceDTO deviceDTO) { Device device = Convert.convert(Device.class, deviceDTO); @@ -142,6 +149,7 @@ public class AdminDeviceService { List agents = customerService.lambdaQuery().select(TBaseCustomer::getAgencyCompanyCode, TBaseCustomer::getAgencyCompanyName).list(); Set deviceNos = new HashSet<>(); + List warrantyStates = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DEVICE_WARRANTY_STATE); crmDeviceList.forEach(u -> { if (StrUtil.isBlank(u.getProductLine__c()) || StrUtil.isBlank(u.getAssetProductLine3__c()) || StrUtil.isBlank(u.getAssetProductLine4__c())) { log.info("跳过没有产品线或设备类型的设备"); @@ -187,9 +195,30 @@ public class AdminDeviceService { } ent.setSourceFrom(DeviceSourceFromEnum.FROM_CRM.getSourceKey()); ent.setProductLine(u.getProductLine__c()); - ent.setShipmentDate(u.getLastCarDevliverDate__c()); - ent.setStartWarrantyDate(u.getWarrantyStartDate__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(); + if (now.isBefore(warrantyStartDate)){ + ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "NotStarted")).findFirst().get().getId()); + }else if (now.isAfter(warrantyStartDate.plusMonths(ent.getWarrantyMonth()))){ + ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "OutsideWarranty")).findFirst().get().getId()); + }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() .filter(agent -> agent.getAgencyCompanyCode().equals(u.getAgent__r().getId())) diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/util/DateTimeUtil.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/util/DateTimeUtil.java index 8fddfd05..63321d7b 100644 --- a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/util/DateTimeUtil.java +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/util/DateTimeUtil.java @@ -2,10 +2,7 @@ package com.nflg.mobilebroken.common.util; import cn.hutool.core.date.DatePattern; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZoneOffset; +import java.time.*; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.Objects; @@ -53,6 +50,14 @@ public class DateTimeUtil { .toLocalDateTime(); } + public static LocalDateTime asSystemDateTime(OffsetDateTime datetime) { + if (Objects.isNull(datetime)) { + return null; + } + return datetime.atZoneSameInstant(ZoneId.systemDefault()) + .toLocalDateTime(); + } + public static LocalDate parse(String dateStr) { return LocalDate.parse(dateStr, DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)); } diff --git a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/controller/DeviceController.java b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/controller/DeviceController.java index e0dacec9..cc004252 100644 --- a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/controller/DeviceController.java +++ b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/controller/DeviceController.java @@ -393,8 +393,8 @@ public class DeviceController extends ControllerBase { } if (StrUtil.isNotBlank(dto.getShipmentDate())) { try { - LocalDate date = LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setShipmentDate(DateTimeUtil.asSystemDate(date)); + LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); + device.setShipmentDate(dto.getShipmentDate()); } catch (DateTimeParseException e) { sb.append("发货日期无效;"); } @@ -402,7 +402,7 @@ public class DeviceController extends ControllerBase { if (StrUtil.isNotBlank(dto.getStartWarrantyDate())) { try { LocalDate date = LocalDate.parse(dto.getStartWarrantyDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setStartWarrantyDate(DateTimeUtil.asSystemDate(date)); + device.setStartWarrantyDate(dto.getStartWarrantyDate()); if (StrUtil.isBlank(dto.getWarrantyMonth())) { sb.append("质保期不能为空;"); } else { @@ -506,8 +506,8 @@ public class DeviceController extends ControllerBase { dto.setCustomerName(d.getCustomerName()); dto.setAgentName(d.getAgentName()); dto.setAreaName(d.getAreaName()); - dto.setShipmentDate(DateTimeUtil.format(d.getShipmentDate(), "yyyy-MM-dd")); - dto.setStartWarrantyDate(DateTimeUtil.format(d.getStartWarrantyDate(), "yyyy-MM-dd")); + dto.setShipmentDate(d.getShipmentDate()); + dto.setStartWarrantyDate(d.getStartWarrantyDate()); if (Objects.nonNull(d.getWarrantyMonth())) { dto.setWarrantyMonth(String.valueOf(d.getWarrantyMonth())); } @@ -648,8 +648,8 @@ public class DeviceController extends ControllerBase { } if (StrUtil.isNotBlank(dto.getShipmentDate())) { try { - LocalDate date = LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setShipmentDate(DateTimeUtil.asSystemDate(date)); + LocalDate.parse(dto.getShipmentDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); + device.setShipmentDate(dto.getShipmentDate()); } catch (DateTimeParseException e) { sb.append("发货日期无效;"); } @@ -659,7 +659,7 @@ public class DeviceController extends ControllerBase { if (StrUtil.isNotBlank(dto.getStartWarrantyDate())) { try { LocalDate date = LocalDate.parse(dto.getStartWarrantyDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); - device.setStartWarrantyDate(DateTimeUtil.asSystemDate(date)); + device.setStartWarrantyDate(dto.getStartWarrantyDate()); if (StrUtil.isBlank(dto.getWarrantyMonth())) { sb.append("质保期不能为空;"); } else { diff --git a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/pojo/vo/CmrDeviceResultVO.java b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/pojo/vo/CmrDeviceResultVO.java index a31aad82..b868fa58 100644 --- a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/pojo/vo/CmrDeviceResultVO.java +++ b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/pojo/vo/CmrDeviceResultVO.java @@ -1,8 +1,10 @@ package com.nflg.mobilebroken.gongfu.pojo.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.time.LocalDate; +import java.time.OffsetDateTime; /** * CRM-设备信息 @@ -37,12 +39,14 @@ public class CmrDeviceResultVO { /** * 发货日期 */ - private LocalDate LastCarDevliverDate__c; + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") + private OffsetDateTime LastCarDevliverDate__c; /** * 质保开始日期 */ - private LocalDate WarrantyStartDate__c; + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") + private OffsetDateTime WarrantyStartDate__c; /** * 质保期(月) diff --git a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/AdminDeviceService.java b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/AdminDeviceService.java index f627b5e8..42a4a70d 100644 --- a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/AdminDeviceService.java +++ b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/AdminDeviceService.java @@ -7,16 +7,21 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.google.common.collect.ImmutableList; import com.nflg.mobilebroken.common.constant.Constant; +import com.nflg.mobilebroken.common.constant.STATE; import com.nflg.mobilebroken.common.util.AdminUserUtil; +import com.nflg.mobilebroken.common.util.DateTimeUtil; +import com.nflg.mobilebroken.common.util.VUtils; import com.nflg.mobilebroken.gongfu.constant.Constant1; import com.nflg.mobilebroken.gongfu.constant.DeviceSourceFromEnum; import com.nflg.mobilebroken.gongfu.pojo.dto.DeviceDTO; import com.nflg.mobilebroken.gongfu.pojo.dto.SyncFromCrmDTO; import com.nflg.mobilebroken.gongfu.pojo.vo.CmrDeviceResultVO; import com.nflg.mobilebroken.repository.entity.Device; +import com.nflg.mobilebroken.repository.entity.DictionaryItem; import com.nflg.mobilebroken.repository.entity.GongfuDevice; import com.nflg.mobilebroken.repository.entity.TBaseCustomer; import com.nflg.mobilebroken.repository.service.IDeviceService; +import com.nflg.mobilebroken.repository.service.IDictionaryItemService; import com.nflg.mobilebroken.repository.service.IGongfuDeviceService; import com.nflg.mobilebroken.repository.service.ITBaseCustomerService; import lombok.extern.slf4j.Slf4j; @@ -25,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -50,6 +56,9 @@ public class AdminDeviceService { @Resource private ITBaseCustomerService customerService; + @Resource + IDictionaryItemService dictionaryItemService; + @Transactional(rollbackFor = Exception.class) public void add(DeviceDTO deviceDTO) { GongfuDevice device = Convert.convert(GongfuDevice.class, deviceDTO); @@ -148,6 +157,7 @@ public class AdminDeviceService { List agents = customerService.lambdaQuery().select(TBaseCustomer::getAgencyCompanyCode, TBaseCustomer::getAgencyCompanyName).list(); Set deviceNos = new HashSet<>(); + List warrantyStates = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DEVICE_WARRANTY_STATE); crmDeviceList.forEach(u -> { if (StrUtil.isBlank(u.getProductLine__c()) || StrUtil.isBlank(u.getAssetProductLine3__c()) || StrUtil.isBlank(u.getAssetProductLine4__c())) { log.info("跳过没有产品线或设备类型的设备"); @@ -156,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)) { @@ -194,9 +205,31 @@ public class AdminDeviceService { ent.setSourceFrom(DeviceSourceFromEnum.FROM_CRM.getSourceKey()); ent.setProductLine(u.getProductLine__c()); Constant1.PRODUCT_LINE.add(u.getProductLine__c()); - ent.setShipmentDate(u.getLastCarDevliverDate__c()); - ent.setStartWarrantyDate(u.getWarrantyStartDate__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(); + if (now.isBefore(warrantyStartDate)){ + ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "NotStarted")).findFirst().get().getId()); + }else if (now.isAfter(warrantyStartDate.plusMonths(ent.getWarrantyMonth()))){ + ent.setWarrantyState(warrantyStates.stream().filter(s -> StrUtil.equals(s.getCode(), "OutsideWarranty")).findFirst().get().getId()); + }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())) { TBaseCustomer customer = agents.stream() .filter(agent -> agent.getAgencyCompanyCode().equals(u.getAgent__r().getId())) diff --git a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/CrmService.java b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/CrmService.java index ee7534e2..7d6d3fd1 100644 --- a/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/CrmService.java +++ b/nflg-mobilebroken-gongfu/src/main/java/com/nflg/mobilebroken/gongfu/service/CrmService.java @@ -124,11 +124,14 @@ public class CrmService { HttpUtils httpUtils = new HttpUtils(); // reBody.put("CrLsDate", startDate); String token = StrUtil.join(" ", "Bearer", getToken()); - String orderResult = httpUtils.doPost(getDeviceUrl, JSONUtil.toJsonStr(dateParam), token); + String data = JSONUtil.toJsonStr(dateParam); + log.debug("请求地址:" + getDeviceUrl); + log.debug("请求参数:" + data); + String orderResult = httpUtils.doPost(getDeviceUrl, data, token); + log.debug("响应数据:" + orderResult); JSONObject jsonObject = JSONUtil.parseObj(orderResult); String code = jsonObject.getStr("code"); if (Objects.equals(code, "0")) { - log.debug("响应数据:" + orderResult); String dataResult = jsonObject.getStr("jsonData"); return JSONUtil.toList(dataResult, CmrDeviceResultVO.class); } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/Device.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/Device.java index 271fc42c..761594e8 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/Device.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/Device.java @@ -1,13 +1,14 @@ 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; import lombok.experimental.Accessors; import java.io.Serializable; -import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -91,17 +92,20 @@ public class Device implements Serializable { /** * 发货日期 */ - private LocalDate shipmentDate; + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String shipmentDate; /** * 质保状态-来自字典 */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) private Long warrantyState; /** * 开始质保日期 */ - private LocalDate startWarrantyDate; + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String startWarrantyDate; /** * 质保期(月) @@ -156,5 +160,6 @@ public class Device implements Serializable { /** * 设备地址 */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) private String address; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/GongfuDevice.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/GongfuDevice.java index 0466c3ba..beed5351 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/GongfuDevice.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/GongfuDevice.java @@ -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,17 +90,20 @@ public class GongfuDevice implements Serializable { /** * 发货日期 */ - private LocalDate shipmentDate; + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String shipmentDate; /** * 质保状态-来自字典 */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) private Long warrantyState; /** * 开始质保日期 */ - private LocalDate startWarrantyDate; + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String startWarrantyDate; /** * 质保期(月) @@ -157,5 +158,6 @@ public class GongfuDevice implements Serializable { /** * 设备地址 */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) private String address; }