Compare commits
No commits in common. "6ff6b0c64f5a5e606899969e5a40c64fc97a6960" and "d8c99e3cf9a0f068c951827114351ffb722d9546" have entirely different histories.
6ff6b0c64f
...
d8c99e3cf9
|
|
@ -22,7 +22,6 @@ import com.nflg.mobilebroken.common.constant.STATE;
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.IdPostRequest;
|
import com.nflg.mobilebroken.common.pojo.request.IdPostRequest;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentRecordVO;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceQRCodeVO;
|
import com.nflg.mobilebroken.common.pojo.vo.DeviceQRCodeVO;
|
||||||
import com.nflg.mobilebroken.common.util.*;
|
import com.nflg.mobilebroken.common.util.*;
|
||||||
import com.nflg.mobilebroken.repository.entity.*;
|
import com.nflg.mobilebroken.repository.entity.*;
|
||||||
|
|
@ -380,8 +379,6 @@ public class DeviceController extends ControllerBase {
|
||||||
} else {
|
} else {
|
||||||
device.setAgentName(customer.getAgencyCompanyName());
|
device.setAgentName(customer.getAgencyCompanyName());
|
||||||
device.setAgentCode(customer.getAgencyCompanyCode());
|
device.setAgentCode(customer.getAgencyCompanyCode());
|
||||||
device.setServiceAgentCode(customer.getAgencyCompanyCode());
|
|
||||||
device.setServiceAgentName(customer.getAgencyCompanyName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(dto.getAreaName())) {
|
if (StrUtil.isNotBlank(dto.getAreaName())) {
|
||||||
|
|
@ -806,35 +803,4 @@ public class DeviceController extends ControllerBase {
|
||||||
);
|
);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取服务代理商公司变更记录
|
|
||||||
*/
|
|
||||||
@GetMapping("getServiceAgentChangeRecord")
|
|
||||||
public ApiResult<List<DeviceAgentRecordVO>> getServiceAgentChangeRecord(@RequestParam Integer deviceId) {
|
|
||||||
Device device = deviceService.getById(deviceId);
|
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(device)).throwMessage("设备不存在");
|
|
||||||
List<DeviceAgentRecord> list = deviceAgentRecordService.lambdaQuery()
|
|
||||||
.eq(DeviceAgentRecord::getDeviceId, deviceId)
|
|
||||||
.orderByAsc(DeviceAgentRecord::getId)
|
|
||||||
.list();
|
|
||||||
String oldAgentCode = device.getAgentCode();
|
|
||||||
String oldAgentName = device.getAgentName();
|
|
||||||
List<DeviceAgentRecordVO> vos = new ArrayList<>();
|
|
||||||
for (DeviceAgentRecord r : list) {
|
|
||||||
DeviceAgentRecordVO vo = new DeviceAgentRecordVO()
|
|
||||||
.setId(r.getId())
|
|
||||||
.setOldAgentCode(oldAgentCode)
|
|
||||||
.setOldAgentName(oldAgentName)
|
|
||||||
.setNewAgentCode(r.getAgentCode())
|
|
||||||
.setNewAgentName(r.getAgentName())
|
|
||||||
.setCreateBy(r.getCreateBy())
|
|
||||||
.setCreateTime(r.getCreateTime());
|
|
||||||
oldAgentCode = r.getAgentCode();
|
|
||||||
oldAgentName = r.getAgentName();
|
|
||||||
vos.add(vo);
|
|
||||||
}
|
|
||||||
vos.sort(Comparator.comparingLong(DeviceAgentRecordVO::getId).reversed());
|
|
||||||
return ApiResult.success(vos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,6 @@ public class AdminDeviceService {
|
||||||
device.setProductLine(Constant.MOBILE_BROKEN);
|
device.setProductLine(Constant.MOBILE_BROKEN);
|
||||||
// device.setUpdateBy(AdminUserUtil.getUserName());
|
// device.setUpdateBy(AdminUserUtil.getUserName());
|
||||||
// device.setUpdateTime(LocalDateTime.now());
|
// device.setUpdateTime(LocalDateTime.now());
|
||||||
device.setServiceAgentCode(device.getAgentCode());
|
|
||||||
device.setServiceAgentName(device.getAgentName());
|
|
||||||
deviceService.save(device);
|
deviceService.save(device);
|
||||||
//将设备类型放入-设备类型表维护客户质量管理人
|
//将设备类型放入-设备类型表维护客户质量管理人
|
||||||
|
|
||||||
|
|
@ -160,8 +158,8 @@ public class AdminDeviceService {
|
||||||
} else if (StrUtil.isBlank(u.getProductLine5__c())) {
|
} else if (StrUtil.isBlank(u.getProductLine5__c())) {
|
||||||
log.error("设备机型为空,{}", JSONUtil.toJsonStr(u));
|
log.error("设备机型为空,{}", JSONUtil.toJsonStr(u));
|
||||||
} else {
|
} else {
|
||||||
Device ent = deviceMap.get(u.getId());
|
|
||||||
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
|
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
|
||||||
|
Device ent = deviceMap.get(u.getId());
|
||||||
if (Objects.nonNull(ent)) {
|
if (Objects.nonNull(ent)) {
|
||||||
ent.setUpdateBy("crm");
|
ent.setUpdateBy("crm");
|
||||||
ent.setUpdateTime(LocalDateTime.now());
|
ent.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
@ -238,16 +236,9 @@ public class AdminDeviceService {
|
||||||
}
|
}
|
||||||
ent.setAgentCode(customer.getAgencyCompanyCode());
|
ent.setAgentCode(customer.getAgencyCompanyCode());
|
||||||
ent.setAgentName(customer.getAgencyCompanyName());
|
ent.setAgentName(customer.getAgencyCompanyName());
|
||||||
if (Objects.isNull(ent.getId())) {
|
|
||||||
ent.setServiceAgentCode(ent.getAgentCode());
|
|
||||||
ent.setServiceAgentName(ent.getAgentName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ent.setAddress(u.getSpecificAddress__c());
|
ent.setAddress(u.getSpecificAddress__c());
|
||||||
result.add(ent);
|
result.add(ent);
|
||||||
}else if (Objects.nonNull(ent)){
|
|
||||||
ent.setDataValidState(false);
|
|
||||||
result.add(ent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
package com.nflg.mobilebroken.common.pojo.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class DeviceAgentRecordVO {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变更前公司编码
|
|
||||||
*/
|
|
||||||
private String oldAgentCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变更前公司名称
|
|
||||||
*/
|
|
||||||
private String oldAgentName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变更后公司编码
|
|
||||||
*/
|
|
||||||
private String newAgentCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变更后公司名称
|
|
||||||
*/
|
|
||||||
private String newAgentName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
}
|
|
||||||
|
|
@ -12,7 +12,6 @@ import com.nflg.mobilebroken.common.constant.STATE;
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.IdPostRequest;
|
import com.nflg.mobilebroken.common.pojo.request.IdPostRequest;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentRecordVO;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceQRCodeVO;
|
import com.nflg.mobilebroken.common.pojo.vo.DeviceQRCodeVO;
|
||||||
import com.nflg.mobilebroken.common.util.*;
|
import com.nflg.mobilebroken.common.util.*;
|
||||||
import com.nflg.mobilebroken.gongfu.annotation.ApiMark;
|
import com.nflg.mobilebroken.gongfu.annotation.ApiMark;
|
||||||
|
|
@ -383,8 +382,6 @@ public class DeviceController extends ControllerBase {
|
||||||
} else {
|
} else {
|
||||||
device.setAgentName(customer.getAgencyCompanyName());
|
device.setAgentName(customer.getAgencyCompanyName());
|
||||||
device.setAgentCode(customer.getAgencyCompanyCode());
|
device.setAgentCode(customer.getAgencyCompanyCode());
|
||||||
device.setServiceAgentCode(customer.getAgencyCompanyCode());
|
|
||||||
device.setServiceAgentName(customer.getAgencyCompanyName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(dto.getAreaName())) {
|
if (StrUtil.isNotBlank(dto.getAreaName())) {
|
||||||
|
|
@ -825,10 +822,6 @@ public class DeviceController extends ControllerBase {
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("changeServiceAgentCode")
|
@PostMapping("changeServiceAgentCode")
|
||||||
public ApiResult<Void> changeServiceAgentCode(@RequestBody ChangeServiceAgentCodeQuery query) {
|
public ApiResult<Void> changeServiceAgentCode(@RequestBody ChangeServiceAgentCodeQuery query) {
|
||||||
GongfuDevice device=deviceService.getById(query.getDeviceId());
|
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(device)).throwMessage("设备不存在");
|
|
||||||
VUtils.trueThrowBusinessError(StrUtil.equals(device.getServiceAgentCode(), query.getServiceAgentCode()))
|
|
||||||
.throwMessage("代理商未修改");
|
|
||||||
TBaseCustomer customer = customerService.lambdaQuery()
|
TBaseCustomer customer = customerService.lambdaQuery()
|
||||||
.eq(TBaseCustomer::getDelIs, 0)
|
.eq(TBaseCustomer::getDelIs, 0)
|
||||||
.eq(TBaseCustomer::getEnableState, 1)
|
.eq(TBaseCustomer::getEnableState, 1)
|
||||||
|
|
@ -850,35 +843,4 @@ public class DeviceController extends ControllerBase {
|
||||||
);
|
);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取服务代理商公司变更记录
|
|
||||||
*/
|
|
||||||
@GetMapping("getServiceAgentChangeRecord")
|
|
||||||
public ApiResult<List<DeviceAgentRecordVO>> getServiceAgentChangeRecord(@RequestParam Long deviceId) {
|
|
||||||
GongfuDevice device = deviceService.getById(deviceId);
|
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(device)).throwMessage("设备不存在");
|
|
||||||
List<GongfuDeviceAgentRecord> list = gongfuDeviceAgentRecordService.lambdaQuery()
|
|
||||||
.eq(GongfuDeviceAgentRecord::getDeviceId, deviceId)
|
|
||||||
.orderByAsc(GongfuDeviceAgentRecord::getId)
|
|
||||||
.list();
|
|
||||||
String oldAgentCode = device.getAgentCode();
|
|
||||||
String oldAgentName = device.getAgentName();
|
|
||||||
List<DeviceAgentRecordVO> vos = new ArrayList<>();
|
|
||||||
for (GongfuDeviceAgentRecord r : list) {
|
|
||||||
DeviceAgentRecordVO vo = new DeviceAgentRecordVO()
|
|
||||||
.setId(r.getId())
|
|
||||||
.setOldAgentCode(oldAgentCode)
|
|
||||||
.setOldAgentName(oldAgentName)
|
|
||||||
.setNewAgentCode(r.getAgentCode())
|
|
||||||
.setNewAgentName(r.getAgentName())
|
|
||||||
.setCreateBy(r.getCreateBy())
|
|
||||||
.setCreateTime(r.getCreateTime());
|
|
||||||
oldAgentCode = r.getAgentCode();
|
|
||||||
oldAgentName = r.getAgentName();
|
|
||||||
vos.add(vo);
|
|
||||||
}
|
|
||||||
vos.sort(Comparator.comparingLong(DeviceAgentRecordVO::getId).reversed());
|
|
||||||
return ApiResult.success(vos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,16 +60,6 @@ public class DeviceDetailResultVO {
|
||||||
*/
|
*/
|
||||||
private String agentName;
|
private String agentName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务代理商编码
|
|
||||||
*/
|
|
||||||
private String serviceAgentCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务代理商名称
|
|
||||||
*/
|
|
||||||
private String serviceAgentName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区域编码
|
* 区域编码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,6 @@ public class AdminDeviceService {
|
||||||
device.setCreateTime(LocalDateTime.now());
|
device.setCreateTime(LocalDateTime.now());
|
||||||
// device.setUpdateBy(AdminUserUtil.getUserName());
|
// device.setUpdateBy(AdminUserUtil.getUserName());
|
||||||
// device.setUpdateTime(LocalDateTime.now());
|
// device.setUpdateTime(LocalDateTime.now());
|
||||||
device.setServiceAgentCode(device.getAgentCode());
|
|
||||||
device.setServiceAgentName(device.getAgentName());
|
|
||||||
deviceService.save(device);
|
deviceService.save(device);
|
||||||
//将设备类型放入-设备类型表维护客户质量管理人
|
//将设备类型放入-设备类型表维护客户质量管理人
|
||||||
Map<String, Set<String>> dataTypes = new HashMap<>();
|
Map<String, Set<String>> dataTypes = new HashMap<>();
|
||||||
|
|
@ -169,8 +167,8 @@ public class AdminDeviceService {
|
||||||
log.error("设备机型为空,{}", JSONUtil.toJsonStr(u));
|
log.error("设备机型为空,{}", JSONUtil.toJsonStr(u));
|
||||||
} else {
|
} else {
|
||||||
log.debug("处理设备:"+u.getMachine_Number__c());
|
log.debug("处理设备:"+u.getMachine_Number__c());
|
||||||
GongfuDevice ent = deviceMap.get(u.getId());
|
|
||||||
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
|
if (StrUtil.isNotBlank(u.getMachine_Number__c())) {
|
||||||
|
GongfuDevice ent = deviceMap.get(u.getId());
|
||||||
if (Objects.nonNull(ent)) {
|
if (Objects.nonNull(ent)) {
|
||||||
ent.setUpdateBy("crm");
|
ent.setUpdateBy("crm");
|
||||||
ent.setUpdateTime(LocalDateTime.now());
|
ent.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
@ -249,17 +247,10 @@ public class AdminDeviceService {
|
||||||
}
|
}
|
||||||
ent.setAgentCode(customer.getAgencyCompanyCode());
|
ent.setAgentCode(customer.getAgencyCompanyCode());
|
||||||
ent.setAgentName(customer.getAgencyCompanyName());
|
ent.setAgentName(customer.getAgencyCompanyName());
|
||||||
if (Objects.isNull(ent.getId())) {
|
|
||||||
ent.setServiceAgentCode(ent.getAgentCode());
|
|
||||||
ent.setServiceAgentName(ent.getAgentName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ent.setAddress(u.getSpecificAddress__c());
|
ent.setAddress(u.getSpecificAddress__c());
|
||||||
ent.setDataValidState(true);
|
ent.setDataValidState(true);
|
||||||
result.add(ent);
|
result.add(ent);
|
||||||
}else if (Objects.nonNull(ent)){
|
|
||||||
ent.setDataValidState(false);
|
|
||||||
result.add(ent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue