新增用户充值卡管理模块
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user