This commit is contained in:
dzc committed 2025-04-21 16:48:33 +08:00
1 parent 014c9ceb07
commit 7a463016ec
6 files changed
+95 -9

No files matched your search

@@ -85,25 +85,28 @@ public class ThirdDoorApiController {
@Inner(value = false)
@Operation(summary = "门锁开关通知回调")
@PostMapping("/callback/open")
public void callbackOpen(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
public R callbackOpen(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
String body = httpEntity.getBody();
thirdDoorApiService.callbackOpen(body, headers);
return R.ok();
}
@Inner(value = false)
@Operation(summary = "视频地址通知回调")
@PostMapping("/callback/video")
public void callbackVideo(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
public R callbackVideo(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
String body = httpEntity.getBody();
thirdDoorApiService.callbackVideo(body, headers);
return R.ok();
}
@Inner(value = false)
@Operation(summary = "设备状态通知回调")
@PostMapping("/callback/status")
public void callbackStatus(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
public R callbackStatus(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
String body = httpEntity.getBody();
thirdDoorApiService.callbackStatus(body, headers);
return R.ok();
}
@@ -105,17 +105,19 @@ public class ThirdKsApiController {
@Inner(value = false)
@Operation(summary = "sku审核回调")
@PostMapping("/callback/sku")
public void callbackSKu(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
public R callbackSKu(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
String body = httpEntity.getBody();
thirdKsApiService.callbackSKu(body, headers);
return R.ok();
}
@Inner(value = false)
@Operation(summary = "识别回调")
@PostMapping("/callback/recognition")
public void callbackRecognition(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
public R callbackRecognition(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
String body = httpEntity.getBody();
thirdKsApiService.callbackRecognition(body, headers);
return R.ok();
}
/* ************************************* end 回调 end ************************************* */
@@ -213,10 +213,10 @@ public class ThirdDoorApiServiceImpl implements ThirdDoorApiService {
DoorBaseVo doorBaseVo = new DoorBaseVo();
DoorApi.Api api = DoorApi.OPEN.setBaseUrl(doorConfig.getBaseUrl());
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
logEntity.setReq(JSONUtil.toJsonStr(dto));
try {
dto.setLockNotifyUrl(doorConfig.getCallbackBaseUrl() + doorConfig.getCallbackLockUrl());
dto.setVideoNotifyUrl(doorConfig.getCallbackBaseUrl() + doorConfig.getCallbackVideoUrl());
logEntity.setReq(JSONUtil.toJsonStr(dto));
String body = JSONUtil.toJsonStr(dto);
String res = api.getHttpRequest().header(apiCountersign(body)).body(body).execute().body();
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
@@ -3,6 +3,15 @@ package com.bsd.pjcloud.admin.api.dto;
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class SysUserTransactionDto extends SysUserTransactionEntity {
private LocalDateTime[] createTimeList;
private LocalDateTime[] walletTransactionTimeList;
private LocalDateTime[] processTimeList;
}
@@ -1,10 +1,11 @@
package com.bsd.pjcloud.admin.api.vo;
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
import lombok.Data;
@Data
public class SysUserTransactionVo extends SysUserTransactionEntity {
public class SysUserTransactionVo extends SysUserTransactionEntity implements BaseUserInterface {
/**
* 源部门名称
@@ -16,4 +17,13 @@ public class SysUserTransactionVo extends SysUserTransactionEntity {
*/
private String targetDeptName;
/**
* 用户相关
*/
private String username;
private String userMobile;
private String userAvatar;
}
@@ -23,13 +23,75 @@
</resultMap>
<sql id="selectA">
select a.id,
a.user_id,
a.biz_id,
a.biz_type,
a.source_dept_id,
a.target_dept_id,
a.is_wallet_transaction,
a.wallet_transaction_time,
a.process_id,
a.process_status,
a.process_time,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.tenant_id,
</sql>
<sql id="whereA">
a.del_flag = '0'
<if test="dto.userId != null">
AND a.user_id = #{dto.userId}
</if>
<if test="dto.bizId != null">
AND a.biz_id = #{dto.bizId}
</if>
<if test="dto.bizId != null">
AND a.biz_id = #{dto.bizId}
</if>
<if test="dto.bizType != null">
AND a.biz_type = #{dto.bizType}
</if>
<if test="dto.sourceDeptId != null">
AND a.source_dept_id = #{dto.sourceDeptId}
</if>
<if test="dto.targetDeptId != null">
AND a.target_dept_id = #{dto.targetDeptId}
</if>
<if test="dto.isWalletTransaction != null">
AND a.is_wallet_transaction = #{dto.isWalletTransaction}
</if>
<if test="dto.processStatus != null">
AND a.process_status = #{dto.processStatus}
</if>
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
and a.create_time between #{dto.createTimeList[0]} and #{dto.createTimeList[1]}
</if>
<if test="dto.walletTransactionTimeList != null and dto.walletTransactionTimeList.length == 2">
and a.wallet_transaction_time between #{dto.walletTransactionTimeList[0]} and #{dto.walletTransactionTimeList[1]}
</if>
<if test="dto.processTimeList != null and dto.processTimeList.length == 2">
and a.create_time between #{dto.processTimeList[0]} and #{dto.processTimeList[1]}
</if>
</sql>
<select id="scopePageJoin" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
<include refid="selectA"/>
soureD.name as sourceDeptName,
targetD.name as targetDeptName,
u.username as username,
u.phone as userMobile,
u.avatar as userAvatar
from sys_user_transaction a
left join sys_dept soureD on soureD.dept_id = a.source_dept_id
left join sys_dept targetD on targetD.dept_id = a.target_dept_id
left join sys_user u on u.user_id = a.user_id
<where>
<include refid="whereA"/>
</where>
</select>
</mapper>