新增用户充值卡管理模块

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

@ -18,6 +18,7 @@ import java.util.Objects;
@RestController
@RequestMapping("/printer")
public class PrinterController extends BaseController {
@Autowired
private YiLianYunPrintService printerService;
@ -38,13 +39,14 @@ public class PrinterController extends BaseController {
if(Objects.isNull(printNum)){
throw new ServiceException("打印次数不能为空!");
}
if(printNum>2){
throw new ServiceException("打印次数不能超过2!");
}
// if(printNum>2){
// throw new ServiceException("打印次数不能超过2!");
// }
for (int i = 0; i < printNum; i++) {
printerService.imagePrint(imageUrl);
Thread.sleep(200);
}
return AjaxResult.success();
}
/**

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);
}

View File

@ -27,10 +27,11 @@
<result property="voiceManufacturerName" column="voice_manufacturer_name" />
<result property="replaceManufacturerName" column="replace_manufacturer_name" />
<result property="deviceId" column="device_id" />
<result property="status" column="status" />
</resultMap>
<sql id="selectDeviceReportInfoVo">
select id, imei, iccid, mcu_id, bsp_type, lte_type, mcu_type, mcu_fw, lte_fw, lcd_manufacturer, voice_manufacturer, fram_model, replace_manufacturer, test_record, batch_number, serial_number, qr_code, name, lcd_manufacturer_name, voice_manufacturer_name, replace_manufacturer_name, device_id from iot_device_report_info
select id, imei, iccid, mcu_id, bsp_type, lte_type, mcu_type, mcu_fw, lte_fw, lcd_manufacturer, voice_manufacturer, fram_model, replace_manufacturer, test_record, batch_number, serial_number, qr_code, name, lcd_manufacturer_name, voice_manufacturer_name, replace_manufacturer_name, device_id, status from iot_device_report_info
</sql>
<select id="selectDeviceReportInfoList" parameterType="DeviceReportInfo" resultMap="DeviceReportInfoResult">
@ -49,7 +50,7 @@
<if test="framModel != null and framModel != ''"> and fram_model = #{framModel}</if>
<if test="replaceManufacturer != null "> and replace_manufacturer = #{replaceManufacturer}</if>
<if test="testRecord != null and testRecord != ''"> and test_record = #{testRecord}</if>
<if test="batchNumber != null "> and batch_number = #{batchNumber}</if>
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
@ -57,6 +58,7 @@
<if test="voiceManufacturerName != null and voiceManufacturerName != ''"> and voice_manufacturer_name like concat('%', #{voiceManufacturerName}, '%')</if>
<if test="replaceManufacturerName != null and replaceManufacturerName != ''"> and replace_manufacturer_name like concat('%', #{replaceManufacturerName}, '%')</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
@ -89,6 +91,7 @@
<if test="voiceManufacturerName != null">voice_manufacturer_name,</if>
<if test="replaceManufacturerName != null">replace_manufacturer_name,</if>
<if test="deviceId != null">device_id,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="imei != null and imei != ''">#{imei},</if>
@ -112,6 +115,7 @@
<if test="voiceManufacturerName != null">#{voiceManufacturerName},</if>
<if test="replaceManufacturerName != null">#{replaceManufacturerName},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
@ -139,6 +143,7 @@
<if test="voiceManufacturerName != null">voice_manufacturer_name = #{voiceManufacturerName},</if>
<if test="replaceManufacturerName != null">replace_manufacturer_name = #{replaceManufacturerName},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.fastbee</groupId>
<artifactId>fastbee-service</artifactId>
<version>3.8.5</version>
</parent>
<artifactId>fastbee-rechargecard-service</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -0,0 +1,4 @@
package com.fastbee.rechargecard.domain;
public class test {
}

View File

@ -0,0 +1,4 @@
package com.fastbee.rechargecard.mapper;
public interface test {
}

View File

@ -0,0 +1,4 @@
package com.fastbee.rechargecard.service.impl;
public class testImpl {
}

View File

@ -0,0 +1,4 @@
package com.fastbee.rechargecard.service;
public interface test {
}

View File

@ -20,6 +20,7 @@
<module>fastbee-project-service</module>
<module>fastbee-ggroup-service</module>
<module>fastbee-device-service</module>
<module>fastbee-rechargecard-service</module>
</modules>