Merge branch 'develop' into feature/ticket-add-solution

This commit is contained in:
曹鹏飞 2025-03-24 17:34:51 +08:00
commit 436f39ac0a
3 changed files with 17 additions and 13 deletions

View File

@ -23,6 +23,7 @@ public class CmrDeviceResultVO {
//客户
private String Account;
private Integer CfsStatus__c;
private String Id;
}

View File

@ -122,26 +122,24 @@ public class AdminDeviceService {
if (CollUtil.isEmpty(crmDeviceList)) {
return;
}
Set<String> crmDeviceNos = crmDeviceList.stream().map(u -> u.getMachine_Number__c()).collect(Collectors.toSet());
Set<String> crmDeviceIds = crmDeviceList.stream().map(CmrDeviceResultVO::getId).collect(Collectors.toSet());
List<Device> deviceList = deviceService.lambdaQuery().in(Device::getDeviceNo, crmDeviceNos).list();
Map<String, Device> deviceMap = deviceList.stream().collect(Collectors.toMap(Device::getDeviceNo, device -> device));
List<Device> deviceList = deviceService.lambdaQuery().eq(Device::getSourceFrom, DeviceSourceFromEnum.FROM_CRM.getSourceKey()).in(Device::getSourceId, crmDeviceIds).list();
Map<String, Device> deviceMap = deviceList.stream().collect(Collectors.toMap(Device::getSourceId, device -> device));
crmDeviceList.forEach(u -> {
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
Device ent = deviceMap.get(u.getMachine_Number__c());
Device ent = deviceMap.get(u.getId());
if (Objects.nonNull(ent)) {
ent = deviceMap.get(u.getMachine_Number__c());
ent.setUpdateBy("crm");
ent.setUpdateTime(LocalDateTime.now());
} else {
ent = new Device();
ent.setUpdateBy("crm");
ent.setUpdateTime(LocalDateTime.now());
ent.setSourceId(u.getId());
ent.setCreateBy("crm");
ent.setCreateTime(LocalDateTime.now());
}
ent.setDeviceState(u.getCfsStatus__c());
ent.setDeviceNo(u.getMachine_Number__c());
ent.setDeviceType(u.getAssetProductLine3__c());
ent.setDeviceTypeSub(u.getAssetProductLine4__c());
@ -154,7 +152,6 @@ public class AdminDeviceService {
ent.setSourceFrom(DeviceSourceFromEnum.FROM_CRM.getSourceKey());
ent.setCustomerId(0);
ent.setDeviceState(0);
result.add(ent);
}
});

View File

@ -2,13 +2,14 @@ package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* <p>
* 设备
@ -117,6 +118,11 @@ public class Device implements Serializable {
*/
private Integer sourceFrom;
/**
* 数据来源id
*/
private String sourceId;
/**
* 创建人
*/