新增用户充值卡管理模块

This commit is contained in:
mi9688
2024-12-17 11:20:36 +08:00
parent 04dd90b3ef
commit b600d08344
10 changed files with 62 additions and 8 deletions

View File

@ -132,4 +132,8 @@ public class DeviceReportInfo extends BaseEntity
@ApiModelProperty("对应设备id")
private Long deviceId;
/** 状态:0未审核1已审核2已打印 */
@Excel(name = "状态:0未审核1已审核2已打印")
@ApiModelProperty("状态:0未审核1已审核2已打印")
private Integer status;
}

View File

@ -59,14 +59,20 @@ public class DeviceReportInfoServiceImpl implements IDeviceReportInfoService
@Override
public int insertDeviceReportInfo(DeviceReportInfo deviceReportInfo)
{
//查重
//设备编码查重
List<DeviceReportInfo> list = new LambdaQueryChainWrapper<>(deviceReportInfoMapper)
.select(DeviceReportInfo::getSerialNumber)
.select(DeviceReportInfo::getSerialNumber,DeviceReportInfo::getImei)
.eq(DeviceReportInfo::getSerialNumber, deviceReportInfo.getSerialNumber())
.or()
.eq(DeviceReportInfo::getImei, deviceReportInfo.getImei())
.list();
System.err.println("查重:"+list);
if (!list.isEmpty()) {
throw new ServiceException("设备编号重复!");
if (list.get(0).getImei().equals(deviceReportInfo.getImei())) {
throw new ServiceException("IMEI号重复!");
} else if (list.get(0).getSerialNumber().equals(deviceReportInfo.getSerialNumber())) {
throw new ServiceException("设备编号重复!");
}
}
return deviceReportInfoMapper.insertDeviceReportInfo(deviceReportInfo);
}