fix(优惠券中心):携程全链路调试完成,调试对接逻辑优化,新增设备一键起飞的指令接口,二维码新增类型字段来区分二维码中航线的的用途等逻辑
This commit is contained in:
+1
@@ -913,6 +913,7 @@ public class OrderController {
|
||||
Tourism tourism = tourismMap.get(order.getTourismId());
|
||||
orderFileMap.put("addr", tourism != null ? tourism.getTourismAddress() : "");
|
||||
orderFileMap.put("orderNo", order.getOrderNo());
|
||||
orderFileMap.put("orderStatus", order.getOrderStatus());
|
||||
|
||||
// 从缓存获取文件列表
|
||||
List<OrderFile> allFiles = orderFilesMap.getOrDefault(order.getOrderNo(), new ArrayList<>());
|
||||
|
||||
+15
@@ -149,4 +149,19 @@ public class QrCodeController {
|
||||
map.put("waylineId",qrCode.getWaylineId());
|
||||
return map;
|
||||
}
|
||||
|
||||
@GetMapping("/device/{deviceId}")
|
||||
public Map<String,Object> getQrcodeByDeviceId(@PathVariable("deviceId") String deviceId, @RequestParam("qrcodeType") Integer qrcodeType){
|
||||
// 根据设备ID和二维码类型查询二维码信息
|
||||
QrCode qrCode = qrCodeService.getByDeviceIdAndType(deviceId, qrcodeType);
|
||||
Assert.notNull(qrCode,"二维码数据不能为空");
|
||||
|
||||
String waylineFilePath = fileCenterService.getFileViewUrl(qrCode.getWaylineId());
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("waylineFilePath",waylineFilePath);
|
||||
map.put("waylineId",qrCode.getWaylineId());
|
||||
map.put("codeId",qrCode.getCodeId());
|
||||
map.put("tourismId",qrCode.getTourismId());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,12 @@ public interface QrCodeMapper extends SuperMapper<QrCode> {
|
||||
// ID查询
|
||||
QrCode getByCodeId(@Param("codeId") String codeId);
|
||||
|
||||
/**
|
||||
* 根据设备ID和二维码类型查询二维码信息
|
||||
* @param deviceId 设备ID
|
||||
* @param qrcodeType 二维码类型
|
||||
* @return 二维码信息
|
||||
*/
|
||||
QrCode getByDeviceIdAndType(@Param("deviceId") String deviceId, @Param("qrcodeType") Integer qrcodeType);
|
||||
|
||||
}
|
||||
|
||||
@@ -105,4 +105,10 @@ public class QrCode extends SuperEntity {
|
||||
@Schema(description = "是否为测试二维码")
|
||||
private Integer isTest;
|
||||
|
||||
/**
|
||||
* 二维码类型(1:游客下单,2:定时巡查,3:其他)
|
||||
*/
|
||||
@Schema(description = "二维码类型(1:游客下单,2:定时巡查,3:其他)")
|
||||
private Integer qrcodeType;
|
||||
|
||||
}
|
||||
|
||||
@@ -34,5 +34,13 @@ public interface IQrCodeService extends ISuperService<QrCode> {
|
||||
* @return
|
||||
*/
|
||||
QrCode getByCodeId(String codeId);
|
||||
|
||||
/**
|
||||
* 根据设备ID和二维码类型查询二维码信息
|
||||
* @param deviceId 设备ID
|
||||
* @param qrcodeType 二维码类型
|
||||
* @return 二维码信息
|
||||
*/
|
||||
QrCode getByDeviceIdAndType(String deviceId, Integer qrcodeType);
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -51,6 +51,11 @@ public class QrCodeServiceImpl extends SuperServiceImpl<QrCodeMapper, QrCode> im
|
||||
return baseMapper.getByCodeId(codeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QrCode getByDeviceIdAndType(String deviceId, Integer qrcodeType) {
|
||||
return baseMapper.getByDeviceIdAndType(deviceId, qrcodeType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<if test="p.deviceSn != null and p.deviceSn != ''">
|
||||
AND q.device_sn = #{p.deviceSn}
|
||||
</if>
|
||||
<if test="p.qrcodeType != null">
|
||||
AND q.qrcode_type = #{p.qrcodeType}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY q.create_time DESC
|
||||
</select>
|
||||
@@ -44,4 +47,13 @@
|
||||
INSERT INTO qrcodes (code_id, tourism_id, device_sn)
|
||||
VALUES (#{codeId}, #{tourismId}, #{deviceSn})
|
||||
</insert>
|
||||
|
||||
<select id="getByDeviceIdAndType" resultMap="QrCodeResultMap">
|
||||
SELECT * FROM qrcodes
|
||||
WHERE device_sn = #{deviceId}
|
||||
AND qrcode_type = #{qrcodeType}
|
||||
AND is_del = 0
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user