Merge branch 'master' of https://gitea.zianxin.com/zianxin-tec/biz-api-cloud
This commit is contained in:
commit
68d2394a7b
118 files changed
+3268
-269
No files matched your search
@@ -58,6 +58,59 @@ CREATE TABLE `third_door_log`
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='智能柜日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for third_pay_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `third_pay_log`;
|
||||
CREATE TABLE `third_pay_log`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`pay_source_type` varchar(32) NOT NULL COMMENT '支付发起方类型id',
|
||||
`biz_type` varchar(32) NOT NULL COMMENT '支付类型',
|
||||
`biz_id` varchar(2048) DEFAULT NULL COMMENT '支付类型id',
|
||||
`api_url` text DEFAULT NULL COMMENT 'api-url',
|
||||
`res` text DEFAULT NULL COMMENT 'res',
|
||||
`req` text DEFAULT NULL COMMENT 'req',
|
||||
`error` text DEFAULT NULL COMMENT '调用错误',
|
||||
`time_consuming` char(64) DEFAULT NULL COMMENT '耗时(毫秒)',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='第三方支付日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for third_key_manage
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `third_key_manage`;
|
||||
CREATE TABLE `third_key_manage`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`name` varchar(32) NOT NULL COMMENT '第三方名字',
|
||||
`biz_type` varchar(32) NOT NULL COMMENT '第三方类型id(常量)',
|
||||
`app_key` varchar(256) DEFAULT NULL COMMENT 'appKey',
|
||||
`app_secret` varchar(256) DEFAULT NULL COMMENT 'appSecret',
|
||||
`field_key` varchar(256) DEFAULT NULL COMMENT '字段加密key',
|
||||
`status` varchar(32) DEFAULT '1' COMMENT '状态',
|
||||
`remark` varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='第三方密钥管理';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for third_zy_id_dict
|
||||
|
||||
@@ -7,6 +7,7 @@ DROP TABLE IF EXISTS sys_user_transaction;
|
||||
CREATE TABLE `sys_user_transaction`
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
apply_user_id bigint NOT NULL COMMENT '申请用户id',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
biz_id bigint DEFAULT NULL COMMENT '业务id',
|
||||
biz_type varchar(32) NOT NULL COMMENT '业务类型',
|
||||
@@ -20,6 +21,7 @@ CREATE TABLE `sys_user_transaction`
|
||||
process_id varchar(256) DEFAULT NULL COMMENT '流程id',
|
||||
process_status varchar(10) DEFAULT NULL COMMENT '审核状体',
|
||||
process_time datetime DEFAULT NULL COMMENT '审核时间',
|
||||
remark varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
@@ -91,6 +93,29 @@ CREATE TABLE mch_manage
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='商户管理';
|
||||
CREATE INDEX idx_dept_id ON mch_manage (dept_id);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mch_catgory
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mch_catgory`;
|
||||
CREATE TABLE mch_catgory
|
||||
(
|
||||
id bigint NOT NULL COMMENT '主键',
|
||||
name varchar(64) NOT NULL COMMENT '分类名',
|
||||
biz_type varchar(64) NOT NULL COMMENT '分类名类型',
|
||||
sort int DEFAULT 0 COMMENT '排序',
|
||||
remark varchar(512) DEFAULT '' COMMENT '备注',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='商户分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mch_dpet_user
|
||||
-- ----------------------------
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
@Getter
|
||||
public enum HardOrderTypeEnum {
|
||||
BELOW("1", "线下购买"),
|
||||
RESERVE("2", "线上订餐"),
|
||||
RESERVE("2", "线上预定"),
|
||||
FOREIGN_TICKET("3", "外来人员"),
|
||||
STRIDE_DEPT("4", "跨单位"),
|
||||
ZY("5", "正元公务餐"),
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public enum HardPayTypeEnum {
|
||||
FACE("4", "人脸识别支付"),
|
||||
STRIDE_DEPT_QR_CODE("5", "跨单位二维码支付"),
|
||||
FOREIGN_TICKET_QR_CODE("6", "外来人员二维码支付"),
|
||||
RESERVE_QR_CODE("7", "线上订餐二维码支付"),
|
||||
RESERVE_QR_CODE("7", "线上二维码支付"),
|
||||
CASH("8", "现金支付"),
|
||||
HARD_DOOR_FREE_PAY("9", "智能柜免密支付"),
|
||||
;
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardAdBroadcastDto {
|
||||
|
||||
/**
|
||||
* 广播id
|
||||
*/
|
||||
private List<Long> ids;
|
||||
|
||||
/**
|
||||
* 广播次数
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
+5
@@ -13,4 +13,9 @@ public class HardSpuDto extends HardSpuEntity {
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
/**
|
||||
* 分类不能为空
|
||||
*/
|
||||
private Boolean spuCategoryIdIsNotNull = false;
|
||||
|
||||
}
|
||||
+8
@@ -155,12 +155,20 @@ public class HardSpuEntity extends Model<HardSpuEntity> {
|
||||
|
||||
/**
|
||||
* 旷世审核状态
|
||||
* 0:待审核
|
||||
* 1:审核中
|
||||
* 2:审核通过
|
||||
* 3:审核不通过
|
||||
*/
|
||||
@Schema(description = "旷世审核状态")
|
||||
private String ksStatus;
|
||||
|
||||
/**
|
||||
* 旷世审核状态标题
|
||||
* 0:待审核
|
||||
* 1:审核中
|
||||
* 2:审核通过
|
||||
* 3:审核不通过
|
||||
*/
|
||||
@Schema(description = "旷世审核状态标题")
|
||||
private String ksStatusTitle;
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.hard.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.KsSkuSubmitCallbackDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(contextId = "remoteHardSpuController", value = ServiceNameConstants.HARDWARE_SERVICE)
|
||||
public interface RemoteHardSpuController {
|
||||
|
||||
@NoToken
|
||||
@PostMapping("/sku-check-callback")
|
||||
R skuCheckCallback(@RequestBody KsSkuSubmitCallbackDto dto);
|
||||
|
||||
}
|
||||
+11
@@ -32,5 +32,16 @@ public class HardBroadcastVo extends HardBroadcastEntity implements BaseHardInte
|
||||
|
||||
private String userDeptName;
|
||||
|
||||
/**
|
||||
* 订单相关
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
private String productDesc;
|
||||
|
||||
private Integer payPrice;
|
||||
|
||||
private String hourType;
|
||||
|
||||
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardDoorService
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardOrderService
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardThirdSelfZyService
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardSpuController
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardThirdSelfZyService
|
||||
+25
@@ -5,9 +5,11 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardAdBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardBroadcastEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardBroadcastVo;
|
||||
@@ -22,6 +24,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -37,6 +40,28 @@ public class HardBroadcastController {
|
||||
|
||||
private final HardBroadcastService hardBroadcastService;
|
||||
|
||||
/* ************************************* start android start ************************************* */
|
||||
|
||||
@Operation(summary = "android查询今日的广播", description = "android查询今日的广播")
|
||||
@GetMapping("/ad/today")
|
||||
public R<Page<HardBroadcastVo>> androidToday(@ParameterObject Page page) {
|
||||
HardBroadcastDto dto = new HardBroadcastDto();
|
||||
DataScope dataScope = null;
|
||||
LocalDate today = LocalDate.now();
|
||||
dto.setIsDone(YesNoEnum.NO.getCode());
|
||||
dto.setCreateTimeList(new LocalDate[]{today, today.plusDays(1)});
|
||||
return R.ok(hardBroadcastService.scopePageJoin(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "android完成一轮广播", description = "android完成一轮广播")
|
||||
@PostMapping("/ad/broadcast")
|
||||
public R<Page<HardBroadcastVo>> androidDoneBroadcast(@RequestBody HardAdBroadcastDto dto) {
|
||||
hardBroadcastService.androidDoneBroadcast(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/* ************************************* start android start ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardBroadcast_view')")
|
||||
|
||||
+2
@@ -126,6 +126,8 @@ public class HardDoorFlowController {
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "检修开门", description = "检修开门")
|
||||
@PostMapping("/open-access")
|
||||
@Idempotent(expireTime = 5, info = "正在开门中,请勿重复操作")
|
||||
|
||||
+6
-6
@@ -149,10 +149,10 @@ public class HardOrderTotalController {
|
||||
}
|
||||
|
||||
@Operation(summary = "设备交易记录导出", description = "设备交易记录导出")
|
||||
@GetMapping("/export-sb")
|
||||
@PostMapping("/export-sb")
|
||||
@SysLog("设备交易记录导出")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardTotal_export_sb')")
|
||||
public void exportSb(HttpServletResponse response, HardOrderDto dto) throws IOException {
|
||||
public void exportSb(HttpServletResponse response, @RequestBody HardOrderDto dto) throws IOException {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
List<HardOrderSbVo> list = hardOrderTotalService.listSb(dto);
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream("file/设备交易金额汇总.xlsx")).build()) {
|
||||
@@ -223,10 +223,10 @@ public class HardOrderTotalController {
|
||||
|
||||
|
||||
@Operation(summary = "商户交易记录导出", description = "商户交易记录导出")
|
||||
@GetMapping("/export-cs")
|
||||
@PostMapping("/export-cs")
|
||||
@SysLog("商户交易记录导出")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardTotal_export_cs')")
|
||||
public void exportTk(HttpServletResponse response, HardOrderDto dto) throws IOException {
|
||||
public void exportTk(HttpServletResponse response, @RequestBody HardOrderDto dto) throws IOException {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = new ArrayList<>();
|
||||
@@ -308,10 +308,10 @@ public class HardOrderTotalController {
|
||||
}
|
||||
|
||||
@Operation(summary = "支付方式交易记录", description = "支付方式交易记录")
|
||||
@GetMapping("/export-payType")
|
||||
@PostMapping("/export-payType")
|
||||
@SysLog("支付方式交易记录")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardTotal_export_payType')")
|
||||
public void exportPayType(HttpServletResponse response, HardOrderDto dto) throws IOException {
|
||||
public void exportPayType(HttpServletResponse response, @RequestBody HardOrderDto dto) throws IOException {
|
||||
List<HardOrderPayTypeVo> list = hardOrderTotalService.listPayType(dto);
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream("file/支付方式交易汇总.xlsx")).build()) {
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
||||
|
||||
+21
-1
@@ -9,11 +9,13 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.hard.api.dto.spu.HardPutawayDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.spu.HardSpuDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.spu.HardSpuEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.spu.HardSpuJoinVo;
|
||||
import com.bsd.pjcloud.hard.service.HardSpuService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.KsSkuSubmitCallbackDto;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -42,6 +44,18 @@ public class HardSpuController {
|
||||
|
||||
private final HardSpuService hardSpuService;
|
||||
|
||||
/* ************************************* start callback start ************************************* */
|
||||
|
||||
@Inner
|
||||
@Operation(summary = "商品审核回调", description = "商品审核回调")
|
||||
@PostMapping("/sku-check-callback")
|
||||
public R skuCheckCallback(@RequestBody KsSkuSubmitCallbackDto dto) {
|
||||
hardSpuService.skuCheckCallback(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/* ************************************* end callback end ************************************* */
|
||||
|
||||
/* ************************************* start APP start ************************************* */
|
||||
|
||||
@Operation(summary = "app上架", description = "上架")
|
||||
@@ -88,6 +102,13 @@ public class HardSpuController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "更新旷世商品审核进度", description = "更新旷世商品审核进度")
|
||||
@GetMapping("/progress")
|
||||
public R progress(@RequestParam Long id) {
|
||||
hardSpuService.progress(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "根据设备id智能柜编号查询商品", description = "根据设备id智能柜编号查询商品")
|
||||
@GetMapping("/get-by-cabinet-no")
|
||||
public R<List<Map<Integer, List<HardSpuJoinVo>>>> getByCabinetNo(@RequestParam Long hardId, @RequestParam String cabinetNo) {
|
||||
@@ -108,7 +129,6 @@ public class HardSpuController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "下拉查询", description = "下拉查询")
|
||||
@GetMapping("/select")
|
||||
public R select(@ParameterObject Page page, @ParameterObject HardSpuDto dto) {
|
||||
|
||||
+7
-1
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardAdBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardBroadcastEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
@@ -21,5 +22,10 @@ public interface HardBroadcastService extends IService<HardBroadcastEntity> {
|
||||
/**
|
||||
* 完成硬件广播
|
||||
*/
|
||||
void doneBroadcast(HardOrderEntity orderdetail);
|
||||
void doneBroadcast(HardOrderEntity orderdetail, UserInfo userInfo);
|
||||
|
||||
/**
|
||||
* android完成一轮广播
|
||||
*/
|
||||
void androidDoneBroadcast(HardAdBroadcastDto dto);
|
||||
}
|
||||
+1
-1
@@ -73,7 +73,7 @@ public interface HardOrderService extends IService<HardOrderEntity> {
|
||||
/**
|
||||
* 核销二维码
|
||||
*/
|
||||
void cancelCode(HardOrderEntity order);
|
||||
void cancelCode(HardOrderEntity order, UserInfo userInfo);
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
|
||||
+12
@@ -10,6 +10,7 @@ import com.bsd.pjcloud.hard.api.entity.HardDoorFlowEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.spu.HardSpuEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.spu.HardSpuJoinVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.spu.HardSpuVo;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.KsSkuSubmitCallbackDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -36,6 +37,16 @@ public interface HardSpuService extends IService<HardSpuEntity> {
|
||||
*/
|
||||
Long edit(HardSpuEntity entity);
|
||||
|
||||
/**
|
||||
* 更新旷世商品审核进度
|
||||
*/
|
||||
void progress(Long id);
|
||||
|
||||
/**
|
||||
* 商品审核回调
|
||||
*/
|
||||
void skuCheckCallback(KsSkuSubmitCallbackDto dto);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@@ -75,4 +86,5 @@ public interface HardSpuService extends IService<HardSpuEntity> {
|
||||
* 扣减库存
|
||||
*/
|
||||
Boolean deductionSpuStock(HardDoorFlowEntity hardDoorFlow, List<DeductionSpuStockDto> list);
|
||||
|
||||
}
|
||||
+39
-4
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
@@ -15,6 +16,7 @@ import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardBroadcastEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardAdBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardBroadcastDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.manager.HardManagerDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardBroadcastEntity;
|
||||
@@ -133,6 +135,7 @@ public class HardBroadcastServiceImpl extends ServiceImpl<HardBroadcastMapper, H
|
||||
msg.setProductDesc(orderdetail.getProductDesc());
|
||||
msg.setPayPrice(orderdetail.getPayPrice());
|
||||
msg.setHourType(orderdetail.getHourType());
|
||||
msg.setIsDone(saveObj.getIsDone());
|
||||
remoteMqttEventService.sendTakeFoodBroadcast(msg);
|
||||
}
|
||||
|
||||
@@ -140,7 +143,7 @@ public class HardBroadcastServiceImpl extends ServiceImpl<HardBroadcastMapper, H
|
||||
* 完成硬件广播
|
||||
*/
|
||||
@Override
|
||||
public void doneBroadcast(HardOrderEntity orderdetail) {
|
||||
public void doneBroadcast(HardOrderEntity orderdetail, UserInfo userInfo) {
|
||||
if (ObjectUtil.isEmpty(orderdetail)) return;
|
||||
HardTypeEnum hardTypeEnum = HardTypeEnum.valueOfByType(orderdetail.getSysType());
|
||||
if (ObjectUtil.isEmpty(orderdetail)) {
|
||||
@@ -154,9 +157,7 @@ public class HardBroadcastServiceImpl extends ServiceImpl<HardBroadcastMapper, H
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.notEqual(hardOrderType, HardOrderTypeEnum.RESERVE)) return;
|
||||
HardBroadcastEntity broadcastDetail = baseMapper.selectOne(new LambdaQueryWrapper<HardBroadcastEntity>()
|
||||
.eq(HardBroadcastEntity::getBizId, orderdetail.getId())
|
||||
);
|
||||
HardBroadcastEntity broadcastDetail = baseMapper.selectOne(new LambdaQueryWrapper<HardBroadcastEntity>().eq(HardBroadcastEntity::getBizId, orderdetail.getId()));
|
||||
if (ObjectUtil.isEmpty(broadcastDetail)) {
|
||||
log.error("|{}|doneBroadcast发送mq消息失败,广播不存在|{}|", TAG, orderdetail.getId());
|
||||
return;
|
||||
@@ -168,6 +169,40 @@ public class HardBroadcastServiceImpl extends ServiceImpl<HardBroadcastMapper, H
|
||||
.isDoneTime(orderdetail.getCreateTime())
|
||||
.build();
|
||||
baseMapper.updateById(updateObj);
|
||||
// 发送mq
|
||||
String topic = broadcastDetail.getTopic().replaceAll("/#", "");
|
||||
HardTakeFoodBroadcastMsg msg = new HardTakeFoodBroadcastMsg();
|
||||
msg.setTopic(topic);
|
||||
msg.setAction(MqttActionEnum.TAKE_FOOD_BROADCAST);
|
||||
msg.setUserId(String.valueOf(userInfo.getSysUser().getUserId()));
|
||||
msg.setUsername(userInfo.getSysUser().getName());
|
||||
msg.setUserMobile(userInfo.getSysUser().getPhone());
|
||||
msg.setId(String.valueOf(broadcastDetail.getId()));
|
||||
msg.setTitle(broadcastDetail.getTitle());
|
||||
msg.setContent(broadcastDetail.getContent());
|
||||
msg.setBroadcastMaxCount(broadcastDetail.getBroadcastMaxCount());
|
||||
msg.setProductDesc(orderdetail.getProductDesc());
|
||||
msg.setPayPrice(orderdetail.getPayPrice());
|
||||
msg.setHourType(orderdetail.getHourType());
|
||||
msg.setIsDone(updateObj.getIsDone());
|
||||
remoteMqttEventService.sendTakeFoodBroadcast(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* android完成一轮广播
|
||||
*/
|
||||
@Override
|
||||
public void androidDoneBroadcast(HardAdBroadcastDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getIds())) return;
|
||||
if (ObjectUtil.isEmpty(dto.getCount())) dto.setCount(1);
|
||||
LambdaUpdateWrapper<HardBroadcastEntity> updateWrapper = new LambdaUpdateWrapper<HardBroadcastEntity>();
|
||||
if (ObjectUtil.equals(dto.getCount(), -1)) {
|
||||
updateWrapper.setSql(" broadcast_count = 0 ");
|
||||
} else {
|
||||
updateWrapper.setSql(" broadcast_count = broadcast_count + " + dto.getCount());
|
||||
}
|
||||
updateWrapper.in(HardBroadcastEntity::getId, dto.getIds());
|
||||
baseMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
private void disposeList(List<HardBroadcastVo> list, HardBroadcastDto dto) {
|
||||
|
||||
+10
-2
@@ -592,12 +592,15 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
// 查询订单
|
||||
HardOrderEntity order = baseMapper.selectById(dto.getOrderId());
|
||||
if (ObjectUtil.isEmpty(order)) throw new RuntimeException("订单不存在");
|
||||
// 查询用户
|
||||
UserInfo userInfo = userService.getByUserId(order.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) throw new RuntimeException("用户不存在");
|
||||
// 判断是否被核销过
|
||||
HardOrderTypeEnum orderType = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
boolean isCancel = validateCodeIsCancel(orderType, order.getId());
|
||||
if (isCancel) throw new RuntimeException("该二维码已被核销");
|
||||
// 核销二维码
|
||||
getSelf().cancelCode(order);
|
||||
getSelf().cancelCode(order, userInfo);
|
||||
HardOrderEntity updateObj = HardOrderEntity.builder().id(order.getId()).androidOrderCode(dto.getAndroidOrderCode()).hardId(dto.getHardwareId()).orderStatus(HardOrderStatusEnum.CANCEL.getType()).build();
|
||||
return baseMapper.updateById(updateObj) > 0;
|
||||
}
|
||||
@@ -605,7 +608,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
@Override
|
||||
// @GlobalTransactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelCode(HardOrderEntity order) {
|
||||
public void cancelCode(HardOrderEntity order, UserInfo userInfo) {
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
if (!ObjectUtil.isAllNotEmpty(orderTypeEnum)) return;
|
||||
Long id = order.getId();
|
||||
@@ -615,10 +618,15 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
}
|
||||
// 外来人员 | 跨单位 | 线上订餐
|
||||
case FOREIGN_TICKET, STRIDE_DEPT, RESERVE -> {
|
||||
// 核销二维码
|
||||
R<Boolean> result = remoteCodeUseService.cancelCode(id);
|
||||
if (ObjectUtil.isEmpty(result) || result.getCode() != 0 || !result.getData()) {
|
||||
throw new RuntimeException("核销二维码错误");
|
||||
}
|
||||
// 发送mq
|
||||
if (ObjectUtil.equals(orderTypeEnum, HardOrderTypeEnum.RESERVE)) {
|
||||
hardBroadcastService.doneBroadcast(order, userInfo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+172
-11
@@ -1,7 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.service.impl.spu;
|
||||
|
||||
import cn.hutool.Hutool;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -9,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.hard.api.constant.spu.HardKsCheckStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.spu.HardKsSkuTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.spu.DeductionSpuStockDto;
|
||||
@@ -27,9 +31,8 @@ import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.service.HardSpuJoinService;
|
||||
import com.bsd.pjcloud.hard.service.HardSpuService;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdKsService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.KsBarcodeLikeDto;
|
||||
import com.bsd.pjcloud.thirdparty.vo.ks.KsBarcodeLikeVo;
|
||||
import com.bsd.pjcloud.thirdparty.vo.ks.KsSpuVo;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.*;
|
||||
import com.bsd.pjcloud.thirdparty.vo.ks.*;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -38,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 硬件商品
|
||||
@@ -82,35 +86,109 @@ public class HardSpuServiceImpl extends ServiceImpl<HardSpuMapper, HardSpuEntity
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(HardSpuEntity entity) {
|
||||
// if (existName(entity)) {
|
||||
// throw new RuntimeException("商品名不能重复");
|
||||
// }
|
||||
String pic = entity.getPic();
|
||||
if (ObjectUtil.isEmpty(pic)) throw new RuntimeException("请上传图片");
|
||||
entity.setSkuType(HardKsSkuTypeEnum.SELF.getType());
|
||||
baseMapper.insert(entity);
|
||||
// 发起审核
|
||||
|
||||
if (ObjectUtil.equals(entity.getIsDefault(), YesNoEnum.NO.getCode())) {
|
||||
return entity.getId();
|
||||
}
|
||||
submitKsSpu(entity);
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long edit(HardSpuEntity entity) {
|
||||
// if (existName(entity)) {
|
||||
// throw new RuntimeException("商品名不能重复");
|
||||
// }
|
||||
HardSpuEntity spuDetail = baseMapper.selectById(entity.getId());
|
||||
if (ObjectUtil.isEmpty(spuDetail)) throw new RuntimeException("商品不存在");
|
||||
baseMapper.updateById(entity);
|
||||
// 修改sku审批
|
||||
if (ObjectUtil.equals(entity.getIsDefault(), YesNoEnum.NO.getCode())) {
|
||||
return entity.getId();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(entity.getKsSkuId())) {
|
||||
getSelf().submitKsSpu(spuDetail);
|
||||
} else {
|
||||
getSelf().editKsSpu(spuDetail);
|
||||
}
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新旷世商品审核进度
|
||||
*/
|
||||
@Override
|
||||
public void progress(Long id) {
|
||||
HardSpuEntity detail = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
throw new RuntimeException("商品不存在");
|
||||
}
|
||||
KsSkuResultDto dto = new KsSkuResultDto();
|
||||
dto.setKs_sku_id(detail.getKsSkuId());
|
||||
KsSkuResultVo vo = remoterThirdKsService.skuResult(dto).getData();
|
||||
if (ObjectUtil.isEmpty(vo) || !vo.isSuccess()) throw new RuntimeException(vo.getMessage());
|
||||
KsSkuResultVo.Result result = vo.getResult();
|
||||
String comments = "";
|
||||
if (ObjectUtil.isEmpty(vo.getComments())) {
|
||||
comments = vo.getComments();
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
HardSpuEntity update = new HardSpuEntity();
|
||||
update.setId(detail.getId());
|
||||
update.setKsStatus(result.getCode());
|
||||
update.setKsStatusTitle(result.getDesc());
|
||||
update.setKsComments(comments);
|
||||
baseMapper.updateById(update);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品审核回调
|
||||
*/
|
||||
@Override
|
||||
public void skuCheckCallback(KsSkuSubmitCallbackDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto) || ObjectUtil.isEmpty(dto.getKs_sku_id())) return;
|
||||
HardSpuEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<HardSpuEntity>().eq(HardSpuEntity::getKsSkuId, dto.getKs_sku_id()));
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
KsSkuSubmitCallbackDto.Result result = dto.getResult();
|
||||
String comments = "";
|
||||
if (ObjectUtil.isEmpty(dto.getComments())) {
|
||||
comments = dto.getComments();
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
HardSpuEntity update = new HardSpuEntity();
|
||||
update.setId(detail.getId());
|
||||
update.setKsStatus(result.getCode());
|
||||
update.setKsStatusTitle(result.getDesc());
|
||||
update.setKsComments(comments);
|
||||
baseMapper.updateById(update);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@Override
|
||||
public void delByIds(ArrayList<Long> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<HardSpuEntity> spuList = baseMapper.selectList(new LambdaQueryWrapper<HardSpuEntity>().in(HardSpuEntity::getId, list));
|
||||
for (HardSpuEntity v : spuList) {
|
||||
if (ObjectUtil.notEqual(v.getSkuType(), HardKsSkuTypeEnum.SELF.getType())) continue;
|
||||
if (ObjectUtil.isNotEmpty(v.getKsSkuId())) {
|
||||
KsSkuDeleteDto dto = new KsSkuDeleteDto();
|
||||
dto.setKs_sku_id(v.getKsSkuId());
|
||||
KsSkuDeleteVo data = remoterThirdKsService.skuDelete(dto).getData();
|
||||
if (ObjectUtil.isEmpty(data) || !data.isSuccess()) throw new RuntimeException(data.getMessage());
|
||||
}
|
||||
}
|
||||
baseMapper.deleteByIds(list);
|
||||
}
|
||||
|
||||
@@ -388,6 +466,76 @@ public class HardSpuServiceImpl extends ServiceImpl<HardSpuMapper, HardSpuEntity
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起旷世sku审核
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submitKsSpu(HardSpuEntity entity) {
|
||||
String pic = entity.getPic();
|
||||
pic = "https://nasa-voyager.oss-cn-beijing.aliyuncs.com/release/merchant_sku_img/watermark/202412021517-173bee3f2637499cb6b46e9b23d286c5.jpg";
|
||||
List<String> picList = Arrays.asList(pic.split(","));
|
||||
String imageBaseUrl = ParamResolver.getStr("IMAGE_BASE_URL");
|
||||
if (ObjectUtil.isEmpty(imageBaseUrl)) throw new RuntimeException("请配置图片基础路径");
|
||||
picList = picList.stream().map(v -> {
|
||||
boolean isUrl = isValidUrl(v);
|
||||
if (isUrl) return v;
|
||||
return String.format("%s%s", imageBaseUrl, v);
|
||||
}).toList();
|
||||
// 发起旷世审核
|
||||
KsSkuSubmitDto dto = new KsSkuSubmitDto();
|
||||
dto.setSku_id(String.valueOf(entity.getId()));
|
||||
dto.setSku_name(entity.getName());
|
||||
dto.setImg_urls(picList);
|
||||
Map<String, String> specs = new HashMap<>();
|
||||
specs.put("taste", entity.getSpecsTaste());
|
||||
specs.put("capacity", entity.getSpecsCapacity());
|
||||
specs.put("weight", entity.getSpecsWeight());
|
||||
dto.setSpecs(specs);
|
||||
KsSkuSubmitVo data = remoterThirdKsService.skuSubmit(dto).getData();
|
||||
if (ObjectUtil.isEmpty(data) || !data.isSuccess()) throw new RuntimeException(data.getMessage());
|
||||
HardSpuEntity update = new HardSpuEntity();
|
||||
update.setId(entity.getId());
|
||||
update.setKsSkuId(data.getKs_sku_id());
|
||||
update.setKsStatus("0");
|
||||
update.setKsStatusTitle("待审核");
|
||||
update.setKsComments("提交审核");
|
||||
baseMapper.updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改旷世sku审核
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void editKsSpu(HardSpuEntity entity) {
|
||||
String pic = entity.getPic();
|
||||
pic = "https://nasa-voyager.oss-cn-beijing.aliyuncs.com/release/merchant_sku_img/watermark/202412021517-173bee3f2637499cb6b46e9b23d286c5.jpg";
|
||||
List<String> picList = Arrays.asList(pic.split(","));
|
||||
String imageBaseUrl = ParamResolver.getStr("IMAGE_BASE_URL");
|
||||
if (ObjectUtil.isEmpty(imageBaseUrl)) throw new RuntimeException("请配置图片基础路径");
|
||||
picList = picList.stream().map(v -> {
|
||||
boolean isUrl = isValidUrl(v);
|
||||
if (isUrl) return v;
|
||||
return String.format("%s%s", imageBaseUrl, v);
|
||||
}).toList();
|
||||
// 修改旷世sku
|
||||
KsSkuEditDto updateObj = new KsSkuEditDto();
|
||||
updateObj.setSku_name(entity.getName());
|
||||
updateObj.setImg_urls(picList);
|
||||
Map<String, String> specs = new HashMap<>();
|
||||
specs.put("taste", entity.getSpecsTaste());
|
||||
specs.put("capacity", entity.getSpecsCapacity());
|
||||
specs.put("weight", entity.getSpecsWeight());
|
||||
updateObj.setSpecs(specs);
|
||||
KsSkuEditVo vo = remoterThirdKsService.skuEdit(updateObj, entity.getKsSkuId()).getData();
|
||||
if (ObjectUtil.isEmpty(vo) || !vo.isSuccess()) throw new RuntimeException(vo.getMessage());
|
||||
HardSpuEntity update = new HardSpuEntity();
|
||||
update.setId(entity.getId());
|
||||
update.setKsStatus("0");
|
||||
update.setKsStatusTitle("待审核");
|
||||
update.setKsComments("提交审核");
|
||||
baseMapper.updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品是否重复
|
||||
*/
|
||||
@@ -402,8 +550,21 @@ public class HardSpuServiceImpl extends ServiceImpl<HardSpuMapper, HardSpuEntity
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
public boolean isValidUrl(String url) {
|
||||
if (StrUtil.isBlank(url)) {
|
||||
return false;
|
||||
}
|
||||
String URL_REGEX = "^(https?|ftp)://[\\w.-]+(?:\\/[\\w.-]*)*";
|
||||
Pattern URL_PATTERN = Pattern.compile(URL_REGEX);
|
||||
return URL_PATTERN.matcher(url).matches();
|
||||
}
|
||||
|
||||
private void disposeList(List<HardSpuVo> list, HardSpuDto dto) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
}
|
||||
|
||||
private HardSpuServiceImpl getSelf() {
|
||||
return SpringUtil.getBean(getClass());
|
||||
}
|
||||
|
||||
}
|
||||
+7
-2
@@ -49,7 +49,7 @@
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.userId != null">
|
||||
and a.userId = #{dto.userId}
|
||||
and a.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.hardId != null">
|
||||
and a.hard_id = #{dto.hardId}
|
||||
@@ -76,10 +76,15 @@
|
||||
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.hard.api.vo.HardBroadcastVo">
|
||||
<include refid="selectA"/>
|
||||
1
|
||||
o.id as orderId,
|
||||
o.hour_type as hourType,
|
||||
o.product_desc as productDesc,
|
||||
o.pay_price as payPrice
|
||||
from hard_broadcast a
|
||||
left join hard_order o on o.id = a.biz_id
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -80,6 +80,12 @@
|
||||
<if test="dto.spuCategoryId != null ">
|
||||
and a.spu_category_id = #{dto.spuCategoryId}
|
||||
</if>
|
||||
<if test="dto.spuCategoryIdIsNotNull != null ">
|
||||
<if test="dto.spuCategoryIdIsNotNull == true ">
|
||||
and a.spu_category_id is not null
|
||||
and a.ks_status = 5
|
||||
</if>
|
||||
</if>
|
||||
<if test="dto.status != null and dto.status != '' ">
|
||||
and a.status = #{dto.status}
|
||||
</if>
|
||||
|
||||
+5
@@ -61,4 +61,9 @@ public class HardTakeFoodBroadcastMsg extends MqttHardBaseMsg {
|
||||
*/
|
||||
private String hourType;
|
||||
|
||||
/**
|
||||
* 是否完成
|
||||
*/
|
||||
private String isDone;
|
||||
|
||||
}
|
||||
+7
@@ -20,6 +20,13 @@ public interface RemoterThirdKsService {
|
||||
@PostMapping("/third-ks/sku-submit")
|
||||
R<KsSkuSubmitVo> skuSubmit(@RequestBody KsSkuSubmitDto dto);
|
||||
|
||||
/**
|
||||
* 常规SKU修改
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/third-ks/sku-edit")
|
||||
R<KsSkuEditVo> skuEdit(@RequestBody KsSkuEditDto dto, @RequestParam String ks_sku_id);
|
||||
|
||||
/**
|
||||
* 集合SKU提交审核(未公开)
|
||||
*/
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayApiBizTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方key类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdKeyTypeEnum {
|
||||
|
||||
LB("10", "宁波银行"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdKeyTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方统一支付api类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayApiBizTypeEnum {
|
||||
|
||||
PAY("10", "支付"),
|
||||
REFUND("20", "退款"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayApiBizTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方统一支付来源类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPaySoureBizTypeEnum {
|
||||
|
||||
LB("10", "宁波银行"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPaySoureBizTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 支付状态返回枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayVoStatusEnum {
|
||||
|
||||
SUCCESS(200, "成功"),
|
||||
SIGN_ERROR(400, "签名验证失败"),
|
||||
PARAMS_ERROR(500, "参数错误"),
|
||||
USER_EXIST(501, "用户不存在"),
|
||||
ORDER_EXIST(502, "订单不存在"),
|
||||
BALANCE_NOT_ENOUGH(505, "用户余额不足"),
|
||||
;
|
||||
|
||||
private final int type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayVoStatusEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+5
-7
@@ -2,14 +2,12 @@ package com.bsd.pjcloud.thirdparty.dto.ks;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class KsSkuEditDto {
|
||||
|
||||
/**
|
||||
* 该字段为超级收银员平台的sku_id,提交SKU审核后由系统返回,作为资源ID传递,是请求地址中的一部分,不需要提交到form表单
|
||||
*/
|
||||
private String ks_sku_id;
|
||||
|
||||
/**
|
||||
* 该字段为使用方系统sku_name,建议使用品牌名+商品名,如统一冰红茶
|
||||
*/
|
||||
@@ -23,7 +21,7 @@ public class KsSkuEditDto {
|
||||
/**
|
||||
* SKU图片仅在SKU因图片原因审核不通过的情况下支持修改,一旦SKU被审核通过,SKU图片将不再允许修改,如有相关需求,请重新申请SKU
|
||||
*/
|
||||
private String img_urls;
|
||||
private List<String> img_urls;
|
||||
|
||||
/**
|
||||
* 审核结果回调地址
|
||||
@@ -33,5 +31,5 @@ public class KsSkuEditDto {
|
||||
/**
|
||||
* 该字段为SKU所对应的规格,包含口味、容量、重量,taste表示口味,capacity表示容量,单位:ml,weight表示重量,单位:g
|
||||
*/
|
||||
private String specs;
|
||||
private Map<String, String> specs;
|
||||
}
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class KsSkuSubmitCallbackDto {
|
||||
* 2:审核通过
|
||||
* 3:审核不通过
|
||||
*/
|
||||
private Integer code;
|
||||
private String code;
|
||||
|
||||
private String desc;
|
||||
|
||||
|
||||
+5
-2
@@ -2,6 +2,9 @@ package com.bsd.pjcloud.thirdparty.dto.ks;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class KsSkuSubmitDto {
|
||||
/**
|
||||
@@ -22,7 +25,7 @@ public class KsSkuSubmitDto {
|
||||
/**
|
||||
* 该字段为SKU不同方位视图,所需拍摄的图片数量及角度请参考商品建模文档,参数具体值为图片资源地址,如资源为使用方所属,请确保外部可以访问,请注意图片尺寸及质量,综合质量不佳可能会导致审核不通过。图片尺寸不小于1920*1080,压缩质量不低于70%,长宽比介于16:9同1:1之间。
|
||||
*/
|
||||
private String img_urls;
|
||||
private List<String> img_urls;
|
||||
|
||||
/**
|
||||
* 审核结果回调地址
|
||||
@@ -32,6 +35,6 @@ public class KsSkuSubmitDto {
|
||||
/**
|
||||
* 该字段为SKU所对应的规格,包含口味、容量、重量,taste表示口味,capacity表示容量,单位:ml,weight表示重量,单位:g
|
||||
*/
|
||||
private String specs;
|
||||
private Map<String, String> specs;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.lb;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LbH5LoginDto {
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String phone;
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPaySoureBizTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 第三方唯一id
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 第三方统一支付类型
|
||||
*/
|
||||
private ThirdPaySoureBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 扣款金额(分)
|
||||
*/
|
||||
private Integer money;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayGetWalletInfoDto {
|
||||
|
||||
/**
|
||||
* sm4加密后的手机号
|
||||
*/
|
||||
private String signPhone;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class ThirdPayLogDto extends ThirdPayLogEntity {
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 第三方密钥管理
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-04-30 15:18:13
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_key_manage")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "第三方密钥管理")
|
||||
public class ThirdKeyManageEntity extends Model<ThirdKeyManageEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 第三方名字
|
||||
*/
|
||||
@Schema(description="第三方名字")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 第三方类型id(常量)
|
||||
*/
|
||||
@Schema(description="第三方类型id(常量)")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* appKey
|
||||
*/
|
||||
@Schema(description="appKey")
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* appSecret
|
||||
*/
|
||||
@Schema(description="appSecret")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 字段加密key
|
||||
*/
|
||||
@Schema(description="字段加密key")
|
||||
private String fieldKey;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description="状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除时间")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description="tenantId")
|
||||
private Long tenantId;
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity.api;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 第三方支付日志
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_pay_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "第三方支付日志")
|
||||
public class ThirdPayLogEntity extends Model<ThirdPayLogEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付发起方类型id
|
||||
*/
|
||||
@Schema(description="支付发起方类型id")
|
||||
private String paySourceType;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
@Schema(description="支付类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 支付类型id
|
||||
*/
|
||||
@Schema(description="支付类型id")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* api-url
|
||||
*/
|
||||
@Schema(description="api-url")
|
||||
private String apiUrl;
|
||||
|
||||
/**
|
||||
* res
|
||||
*/
|
||||
@Schema(description="res")
|
||||
private String res;
|
||||
|
||||
/**
|
||||
* req
|
||||
*/
|
||||
@Schema(description="req")
|
||||
private String req;
|
||||
|
||||
/**
|
||||
* 调用错误
|
||||
*/
|
||||
@Schema(description="调用错误")
|
||||
private String error;
|
||||
|
||||
/**
|
||||
* 耗时(毫秒)
|
||||
*/
|
||||
@Schema(description="耗时(毫秒)")
|
||||
private String timeConsuming;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除时间")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description="tenantId")
|
||||
private Long tenantId;
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.bsd.pjcloud.thirdparty.vo.ks;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KsSkuDeleteVo {
|
||||
public class KsSkuDeleteVo extends KsBaseInnerVo {
|
||||
|
||||
/**
|
||||
* 该sku_id为使用方sku_id
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.bsd.pjcloud.thirdparty.vo.ks;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KsSkuEditVo {
|
||||
public class KsSkuEditVo extends KsBaseInnerVo {
|
||||
|
||||
/**
|
||||
* 该sku_id为使用方sku_id
|
||||
|
||||
+9
-6
@@ -3,24 +3,27 @@ package com.bsd.pjcloud.thirdparty.vo.ks;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KsSkuResultVo {
|
||||
public class KsSkuResultVo extends KsBaseInnerVo {
|
||||
|
||||
/**
|
||||
* 该字段返回结果为字典值,不同code代表不同结果
|
||||
* <p>
|
||||
* 0:待审核
|
||||
* <p>
|
||||
* 1:审核中
|
||||
* <p>
|
||||
* 2:审核通过
|
||||
* <p>
|
||||
* 3:审核不通过
|
||||
*/
|
||||
private String result;
|
||||
private Result result;
|
||||
|
||||
/**
|
||||
* 审核不通过时该字段才有值
|
||||
*/
|
||||
private String comments;
|
||||
|
||||
@Data
|
||||
public static class Result {
|
||||
private String code;
|
||||
private String desc;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.lb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LbH5LoginVo {
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private String h5Url;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return code == 200;
|
||||
}
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayVoStatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayBaseVo<T> {
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
private T data;
|
||||
|
||||
public void set(ThirdPayVoStatusEnum type) {
|
||||
code = type.getType();
|
||||
message = type.getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayGetWalletInfoVo {
|
||||
|
||||
/**
|
||||
* sm4加密后的手机号
|
||||
*/
|
||||
private String signPhone;
|
||||
|
||||
/**
|
||||
* 用户真实姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户余额(分)
|
||||
*/
|
||||
private int balance;
|
||||
|
||||
|
||||
}
|
||||
pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/vo/pay/PayVo.java
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PayVo {
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
/**
|
||||
* 第三方唯一订单号
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 平台支付时间
|
||||
*/
|
||||
private LocalDateTime payTime;
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayWalletInfoVo {
|
||||
|
||||
/**
|
||||
* sm4加密后的手机号
|
||||
*/
|
||||
private String signPhone;
|
||||
|
||||
/**
|
||||
* 用户真实姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户余额(分)
|
||||
*/
|
||||
private Integer balance;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class RefundVo {
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
/**
|
||||
* 平台唯一退款单号
|
||||
*/
|
||||
private String platformRefundId;
|
||||
|
||||
/**
|
||||
* 第三方唯一订单号
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
}
|
||||
@@ -115,6 +115,12 @@
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.9.1</version>
|
||||
</dependency>
|
||||
<!-- 国密 -->
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15to18</artifactId>
|
||||
<version>1.66</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "lb")
|
||||
@Data
|
||||
public class LbConfig {
|
||||
|
||||
/**
|
||||
* 请求基础路径
|
||||
*/
|
||||
private String baseUrl;
|
||||
|
||||
private String appId;
|
||||
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 企业编号
|
||||
*/
|
||||
private String companyNumber;
|
||||
|
||||
/**
|
||||
* 国密sm4密钥
|
||||
*/
|
||||
private String sm4Key;
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdKeyManageService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 第三方密钥管理
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/third-key-manage")
|
||||
@Tag(description = "third-key-manage", name = "第三方密钥管理管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ThirdKeyManageController {
|
||||
|
||||
private final ThirdKeyManageService thirdKeyManageService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdKeyManage_view')")
|
||||
public R getThirdKeyManagePage(@ParameterObject Page page, @ParameterObject ThirdKeyManageEntity dto) {
|
||||
LambdaQueryWrapper<ThirdKeyManageEntity> wrapper = new LambdaQueryWrapper<ThirdKeyManageEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), ThirdKeyManageEntity::getName, dto.getName())
|
||||
.orderByDesc(ThirdKeyManageEntity::getCreateTime)
|
||||
.orderByDesc(ThirdKeyManageEntity::getId);
|
||||
return R.ok(thirdKeyManageService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdKeyManage_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(thirdKeyManageService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增第三方密钥管理", description = "新增第三方密钥管理")
|
||||
@SysLog("新增第三方密钥管理")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdKeyManage_add')")
|
||||
public R save(@RequestBody ThirdKeyManageEntity dto) {
|
||||
return R.ok(thirdKeyManageService.create(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改第三方密钥管理", description = "修改第三方密钥管理")
|
||||
@SysLog("修改第三方密钥管理")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdKeyManage_edit')")
|
||||
public R updateById(@RequestBody ThirdKeyManageEntity dto) {
|
||||
return R.ok(thirdKeyManageService.edit(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除第三方密钥管理", description = "通过id删除第三方密钥管理")
|
||||
@SysLog("通过id删除第三方密钥管理")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdKeyManage_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(thirdKeyManageService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -49,10 +49,10 @@ public class ThirdKsApiController {
|
||||
}
|
||||
|
||||
@Inner
|
||||
@Operation(summary = "SKU审核结果主动获取")
|
||||
@Operation(summary = "常规SKU修改")
|
||||
@PostMapping("/sku-edit")
|
||||
public R<KsSkuEditVo> skuEdit(@RequestBody KsSkuEditDto dto) {
|
||||
return R.ok(thirdKsApiService.skuEdit(dto));
|
||||
public R<KsSkuEditVo> skuEdit(@RequestBody KsSkuEditDto dto, @RequestParam String ks_sku_id) {
|
||||
return R.ok(thirdKsApiService.skuEdit(dto, ks_sku_id));
|
||||
}
|
||||
|
||||
@Inner
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller.lb;
|
||||
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.dto.lb.LbH5LoginDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdLbApiService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/third-lb")
|
||||
@Tag(description = "third-lb", name = "宁波银行对接")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ThirdLbApiController {
|
||||
|
||||
private final ThirdLbApiService thirdLbApiService;
|
||||
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "美好生活登录", description = "美好生活登录")
|
||||
@PostMapping("/h5-login")
|
||||
public R H5Login(@Valid @RequestBody LbH5LoginDto dto) {
|
||||
return R.ok(thirdLbApiService.h5Login(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller.pay;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayGetWalletInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayApiService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayLogService;
|
||||
import com.bsd.pjcloud.thirdparty.vo.pay.PayBaseVo;
|
||||
import com.bsd.pjcloud.thirdparty.vo.pay.PayWalletInfoVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 第三方支付日志
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/third-pay-api")
|
||||
@Tag(description = "third-pay-api", name = "地上方支付")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ThirdPayApiController {
|
||||
|
||||
private final ThirdPayApiService thirdPayApiService;
|
||||
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "通过手机号查询用户钱包信息", description = "通过手机号查询用户钱包信息")
|
||||
@PostMapping("/user-wallet")
|
||||
public PayBaseVo<PayWalletInfoVo> getWalletInfo(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
String body = httpEntity.getBody();
|
||||
return thirdPayApiService.getWalletInfo(body, headers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller.pay;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.ThirdPayLogDto;
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayLogService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 第三方支付日志
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/third-pay-log")
|
||||
@Tag(description = "third-pay-log", name = "第三方支付日志管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ThirdPayLogController {
|
||||
|
||||
private final ThirdPayLogService thirdPayLogService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_view')")
|
||||
public R getThirdPayLogPage(@ParameterObject Page page, @ParameterObject ThirdPayLogDto dto) {
|
||||
LambdaQueryWrapper<ThirdPayLogEntity> wrapper = new LambdaQueryWrapper<ThirdPayLogEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getPaySourceType()), ThirdPayLogEntity::getPaySourceType, dto.getPaySourceType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getBizType()), ThirdPayLogEntity::getBizType, dto.getBizType())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
ThirdPayLogEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(ThirdPayLogEntity::getCreateTime)
|
||||
.orderByDesc(ThirdPayLogEntity::getId);
|
||||
return R.ok(thirdPayLogService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(thirdPayLogService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增第三方支付日志", description = "新增第三方支付日志")
|
||||
@SysLog("新增第三方支付日志")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_add')")
|
||||
public R save(@RequestBody ThirdPayLogEntity thirdPayLog) {
|
||||
return R.ok(thirdPayLogService.save(thirdPayLog));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改第三方支付日志", description = "修改第三方支付日志")
|
||||
@SysLog("修改第三方支付日志")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_edit')")
|
||||
public R updateById(@RequestBody ThirdPayLogEntity thirdPayLog) {
|
||||
return R.ok(thirdPayLogService.updateById(thirdPayLog));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除第三方支付日志", description = "通过id删除第三方支付日志")
|
||||
@SysLog("通过id删除第三方支付日志")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(thirdPayLogService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('third_thirdPayLog_export')")
|
||||
public List<ThirdPayLogEntity> export(ThirdPayLogEntity thirdPayLog, Long[] ids) {
|
||||
return thirdPayLogService.list(Wrappers.lambdaQuery(thirdPayLog).in(ArrayUtil.isNotEmpty(ids), ThirdPayLogEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.thirdparty.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ThirdKeyManageMapper extends PjcloudBaseMapper<ThirdKeyManageEntity> {
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.thirdparty.mapper.pay;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ThirdPayLogMapper extends PjcloudBaseMapper<ThirdPayLogEntity> {
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.thirdparty.constant.ThirdKeyTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ThirdKeyManageService extends IService<ThirdKeyManageEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long create(ThirdKeyManageEntity dto);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Long edit(ThirdKeyManageEntity dto);
|
||||
|
||||
/**
|
||||
* 获取第三方key配置
|
||||
*/
|
||||
ThirdKeyManageEntity get(ThirdKeyTypeEnum type);
|
||||
|
||||
/**
|
||||
* 验签并且返回配置
|
||||
*/
|
||||
ThirdKeyManageEntity checkSignAndReturnConfig(String json, Map<String, String> headers);
|
||||
|
||||
}
|
||||
+2
-2
@@ -26,9 +26,9 @@ public interface ThirdKsApiService {
|
||||
KsSkuResultVo skuResult(KsSkuResultDto dto);
|
||||
|
||||
/**
|
||||
* SKU审核结果主动获取
|
||||
* 常规SKU修改
|
||||
*/
|
||||
KsSkuEditVo skuEdit(KsSkuEditDto dto);
|
||||
KsSkuEditVo skuEdit(KsSkuEditDto dto, String ks_sku_id);
|
||||
|
||||
/**
|
||||
* SKU删除
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.thirdparty.service;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.dto.lb.LbH5LoginDto;
|
||||
import com.bsd.pjcloud.thirdparty.vo.lb.LbH5LoginVo;
|
||||
|
||||
/**
|
||||
* @author liusiyang_dxm
|
||||
* @since 2025/4/29
|
||||
*/
|
||||
public interface ThirdLbApiService {
|
||||
|
||||
/**
|
||||
* 美好生活登录
|
||||
*/
|
||||
LbH5LoginVo h5Login(LbH5LoginDto dto);
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.thirdparty.service;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayGetWalletInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.RefundDto;
|
||||
import com.bsd.pjcloud.thirdparty.vo.pay.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ThirdPayApiService {
|
||||
|
||||
/**
|
||||
* 扣款
|
||||
*/
|
||||
PayVo pay(PayDto dto);
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
RefundVo refund(RefundDto dto);
|
||||
|
||||
/**
|
||||
* 根据加密的手机号查询用户钱包信息
|
||||
*/
|
||||
PayBaseVo<PayWalletInfoVo> getWalletInfo(String json, Map<String, String> headers);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.thirdparty.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
|
||||
public interface ThirdPayLogService extends IService<ThirdPayLogEntity> {
|
||||
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.thirdparty.constant.ThirdKeyTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity;
|
||||
import com.bsd.pjcloud.thirdparty.mapper.ThirdKeyManageMapper;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdKeyManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 第三方密钥管理
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ThirdKeyManageServiceImpl extends ServiceImpl<ThirdKeyManageMapper, ThirdKeyManageEntity> implements ThirdKeyManageService {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@Override
|
||||
public Long create(ThirdKeyManageEntity dto) {
|
||||
if (existBizType(dto)) throw new RuntimeException("第三方key类型不能重复");
|
||||
if (existName(dto)) throw new RuntimeException("第三方key名称不能重复");
|
||||
baseMapper.insert(dto);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@Override
|
||||
public Long edit(ThirdKeyManageEntity dto) {
|
||||
if (existBizType(dto)) throw new RuntimeException("第三方key类型不能重复");
|
||||
if (existName(dto)) throw new RuntimeException("第三方key名称不能重复");
|
||||
baseMapper.updateById(dto);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第三方key配置
|
||||
*/
|
||||
@Override
|
||||
public ThirdKeyManageEntity get(ThirdKeyTypeEnum type) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<ThirdKeyManageEntity>().eq(ThirdKeyManageEntity::getBizType, type.getType()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验签并且返回配置
|
||||
*/
|
||||
@Override
|
||||
public ThirdKeyManageEntity checkSignAndReturnConfig(String json, Map<String, String> headers) {
|
||||
Map<String, String> transitionHeader = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
transitionHeader.put(entry.getKey().toUpperCase(), entry.getValue());
|
||||
}
|
||||
// 验签
|
||||
String appKey = transitionHeader.get("APP-KEY");
|
||||
String bizType = transitionHeader.get("BIZ-TYPE");
|
||||
String timestamp = transitionHeader.get("TIMESTAMP");
|
||||
String sign = transitionHeader.get("SIGN");
|
||||
if (!ObjectUtil.isAllNotEmpty(appKey, bizType, timestamp, sign)) {
|
||||
return null;
|
||||
}
|
||||
// 判断bizType
|
||||
ThirdKeyTypeEnum keyType = ThirdKeyTypeEnum.valueOfByType(bizType);
|
||||
if (ObjectUtil.isEmpty(keyType)) {
|
||||
return null;
|
||||
}
|
||||
// 查询配置
|
||||
ThirdKeyManageEntity keyManage = get(keyType);
|
||||
if (ObjectUtil.isEmpty(keyManage)) {
|
||||
return null;
|
||||
}
|
||||
if (ObjectUtil.notEqual(appKey, keyManage.getAppKey())) {
|
||||
return null;
|
||||
}
|
||||
// 计算签名
|
||||
String signStr = String.format("%s%s%s%s%s", keyManage.getAppKey(), keyManage.getAppSecret(), keyManage.getBizType(), timestamp, json);
|
||||
String successSignMd5 = DigestUtils.md5Hex(signStr);
|
||||
if (ObjectUtil.notEqual(successSignMd5.toLowerCase(), sign.toLowerCase())) {
|
||||
return null;
|
||||
}
|
||||
return keyManage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方类型不能重复
|
||||
*/
|
||||
private boolean existBizType(ThirdKeyManageEntity dto) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<ThirdKeyManageEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getBizType()), ThirdKeyManageEntity::getBizType, dto.getBizType())
|
||||
.ne(ObjectUtil.isNotEmpty(dto.getId()), ThirdKeyManageEntity::getId, dto.getId())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
||||
return count >= 1;
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名字不能重复
|
||||
*/
|
||||
private boolean existName(ThirdKeyManageEntity dto) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<ThirdKeyManageEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getName()), ThirdKeyManageEntity::getName, dto.getName())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getBizType()), ThirdKeyManageEntity::getBizType, dto.getBizType())
|
||||
.ne(ObjectUtil.isNotEmpty(dto.getId()), ThirdKeyManageEntity::getId, dto.getId())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
||||
return count >= 1;
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
}
|
||||
+76
-12
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.hard.api.feign.RemoteHardDoorService;
|
||||
import com.bsd.pjcloud.hard.api.feign.RemoteHardSpuController;
|
||||
import com.bsd.pjcloud.thirdparty.config.KsDiscernConfig;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ks.*;
|
||||
import com.bsd.pjcloud.thirdparty.entity.door.ThirdDoorLogEntity;
|
||||
@@ -14,7 +15,6 @@ import com.bsd.pjcloud.thirdparty.utils.ks.tool.KsRetailSignUtils;
|
||||
import com.bsd.pjcloud.thirdparty.vo.ks.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.client.methods.HttpDelete;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -35,19 +35,37 @@ public class ThirdKsApiServiceImpl implements ThirdKsApiService {
|
||||
private final ThirdDoorLogService doorLogService;
|
||||
|
||||
private final RemoteHardDoorService remoteHardDoorService;
|
||||
private final RemoteHardSpuController remoteHardSpuController;
|
||||
|
||||
/**
|
||||
* 常规SKU提交审核
|
||||
*/
|
||||
@Override
|
||||
public KsSkuSubmitVo skuSubmit(KsSkuSubmitDto dto) {
|
||||
dto.setNotify_url(ksDiscernConfig.getCallbackBaseUrl() + ksDiscernConfig.getCallbackSkuUrl());
|
||||
long startTime = System.currentTimeMillis();
|
||||
KsBaseVo ksBaseVo = new KsBaseVo();
|
||||
KsApi.Api api = KsApi.SKU_SUBMIT.setBaseUrl(ksDiscernConfig.getBaseUrl()).setParams(BeanUtil.beanToMap(dto));
|
||||
KsApi.Api api = KsApi.SKU_SUBMIT.setBaseUrl(ksDiscernConfig.getBaseUrl())
|
||||
.setParams(BeanUtil.beanToMap(dto))
|
||||
.setAccessKey(ksDiscernConfig.getAccessKey())
|
||||
.setSecretKey(ksDiscernConfig.getSecretKey())
|
||||
.setHost(ksDiscernConfig.getHost());
|
||||
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
|
||||
logEntity.setReq(JSONUtil.toJsonStr(dto));
|
||||
try {
|
||||
|
||||
String body = JSONUtil.toJsonStr(dto);
|
||||
api.setBody(body);
|
||||
String res = api.getHttpRequest().execute().body();
|
||||
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
|
||||
logEntity.setRes(res);
|
||||
ksBaseVo = JSONUtil.toBean(res, KsBaseVo.class);
|
||||
if (!ksBaseVo.isSuccess()) {
|
||||
String errorLog = String.format("请求错误res|%s|url|%s|body|%s|", res, api, body);
|
||||
log.error(errorLog);
|
||||
KsSkuSubmitVo errorVo = new KsSkuSubmitVo();
|
||||
errorVo.setMessage(ksBaseVo.getMsg());
|
||||
return errorVo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||skuSubmit|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
@@ -89,11 +107,25 @@ public class ThirdKsApiServiceImpl implements ThirdKsApiService {
|
||||
public KsSkuResultVo skuResult(KsSkuResultDto dto) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
KsBaseVo ksBaseVo = new KsBaseVo();
|
||||
KsApi.Api api = KsApi.SKU_RESULT.setBaseUrl(ksDiscernConfig.getBaseUrl()).setParams(BeanUtil.beanToMap(dto));
|
||||
KsApi.Api api = KsApi.SKU_RESULT.setBaseUrl(ksDiscernConfig.getBaseUrl())
|
||||
.setpath(dto.getKs_sku_id())
|
||||
.setAccessKey(ksDiscernConfig.getAccessKey())
|
||||
.setSecretKey(ksDiscernConfig.getSecretKey())
|
||||
.setHost(ksDiscernConfig.getHost());
|
||||
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
|
||||
logEntity.setReq(JSONUtil.toJsonStr(dto));
|
||||
try {
|
||||
|
||||
String res = api.getHttpRequest().execute().body();
|
||||
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
|
||||
logEntity.setRes(res);
|
||||
ksBaseVo = JSONUtil.toBean(res, KsBaseVo.class);
|
||||
if (!ksBaseVo.isSuccess()) {
|
||||
String errorLog = String.format("请求错误res|%s|url|%s|", res, api);
|
||||
log.error(errorLog);
|
||||
KsSkuResultVo errorVo = new KsSkuResultVo();
|
||||
errorVo.setMessage(ksBaseVo.getMsg());
|
||||
return errorVo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||skuResult|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
@@ -106,17 +138,35 @@ public class ThirdKsApiServiceImpl implements ThirdKsApiService {
|
||||
}
|
||||
|
||||
/**
|
||||
* SKU审核结果主动获取
|
||||
* 常规SKU修改
|
||||
*/
|
||||
@Override
|
||||
public KsSkuEditVo skuEdit(KsSkuEditDto dto) {
|
||||
public KsSkuEditVo skuEdit(KsSkuEditDto dto, String ks_sku_id) {
|
||||
dto.setNotify_url(ksDiscernConfig.getCallbackBaseUrl() + ksDiscernConfig.getCallbackSkuUrl());
|
||||
String body = JSONUtil.toJsonStr(dto);
|
||||
long startTime = System.currentTimeMillis();
|
||||
KsBaseVo ksBaseVo = new KsBaseVo();
|
||||
KsApi.Api api = KsApi.SKU_EDIT.setBaseUrl(ksDiscernConfig.getBaseUrl()).setParams(BeanUtil.beanToMap(dto));
|
||||
KsApi.Api api = KsApi.SKU_EDIT.setBaseUrl(ksDiscernConfig.getBaseUrl())
|
||||
.setpath(ks_sku_id)
|
||||
.setBody(body)
|
||||
.setAccessKey(ksDiscernConfig.getAccessKey())
|
||||
.setSecretKey(ksDiscernConfig.getSecretKey())
|
||||
.setHost(ksDiscernConfig.getHost());
|
||||
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
|
||||
logEntity.setReq(JSONUtil.toJsonStr(dto));
|
||||
try {
|
||||
|
||||
api.setBody(body);
|
||||
String res = api.getHttpRequest().execute().body();
|
||||
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
|
||||
logEntity.setRes(res);
|
||||
ksBaseVo = JSONUtil.toBean(res, KsBaseVo.class);
|
||||
if (!ksBaseVo.isSuccess()) {
|
||||
String errorLog = String.format("请求错误res|%s|url|%s|", res, api);
|
||||
log.error(errorLog);
|
||||
KsSkuEditVo errorVo = new KsSkuEditVo();
|
||||
errorVo.setMessage(ksBaseVo.getMsg());
|
||||
return errorVo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||skuEdit|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
@@ -135,11 +185,25 @@ public class ThirdKsApiServiceImpl implements ThirdKsApiService {
|
||||
public KsSkuDeleteVo skuDelete(KsSkuDeleteDto dto) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
KsBaseVo ksBaseVo = new KsBaseVo();
|
||||
KsApi.Api api = KsApi.SKU_DELETE.setBaseUrl(ksDiscernConfig.getBaseUrl()).setParams(BeanUtil.beanToMap(dto));
|
||||
KsApi.Api api = KsApi.SKU_DELETE.setBaseUrl(ksDiscernConfig.getBaseUrl())
|
||||
.setpath(dto.getKs_sku_id())
|
||||
.setAccessKey(ksDiscernConfig.getAccessKey())
|
||||
.setSecretKey(ksDiscernConfig.getSecretKey())
|
||||
.setHost(ksDiscernConfig.getHost());
|
||||
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
|
||||
logEntity.setReq(JSONUtil.toJsonStr(dto));
|
||||
try {
|
||||
|
||||
String res = api.getHttpRequest().execute().body();
|
||||
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
|
||||
logEntity.setRes(res);
|
||||
ksBaseVo = JSONUtil.toBean(res, KsBaseVo.class);
|
||||
if (!ksBaseVo.isSuccess()) {
|
||||
String errorLog = String.format("请求错误res|%s|url|%s|", res, api);
|
||||
log.error(errorLog);
|
||||
KsSkuDeleteVo errorVo = new KsSkuDeleteVo();
|
||||
errorVo.setMessage(ksBaseVo.getMsg());
|
||||
return errorVo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||skuDelete|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
@@ -318,7 +382,7 @@ public class ThirdKsApiServiceImpl implements ThirdKsApiService {
|
||||
ThirdDoorLogEntity logEntity = api.getInitLogEntity();
|
||||
logEntity.setReq(json);
|
||||
try {
|
||||
|
||||
remoteHardSpuController.skuCheckCallback(dto);
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||callbackSKu|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.lb;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.thirdparty.config.LbConfig;
|
||||
import com.bsd.pjcloud.thirdparty.dto.lb.LbH5LoginDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdLbApiService;
|
||||
import com.bsd.pjcloud.thirdparty.utils.door.api.DoorApi;
|
||||
import com.bsd.pjcloud.thirdparty.utils.lb.api.LbApi;
|
||||
import com.bsd.pjcloud.thirdparty.utils.lb.tool.LbRetailSignUtils;
|
||||
import com.bsd.pjcloud.thirdparty.vo.lb.LbH5LoginVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ThirdLbApiServiceImpl implements ThirdLbApiService {
|
||||
|
||||
private static final String TAG = "宁波银行api";
|
||||
|
||||
private final LbConfig lbConfig;
|
||||
|
||||
@Override
|
||||
public LbH5LoginVo h5Login(LbH5LoginDto dto) {
|
||||
LbH5LoginVo ksBaseVo = new LbH5LoginVo();
|
||||
String phone = dto.getPhone();
|
||||
String signPhone = LbRetailSignUtils.sm4Encrypt(phone, lbConfig.getSm4Key());
|
||||
long timeMillis = System.currentTimeMillis() / 1000;
|
||||
String signature = apiCountersign(dto.getPhone(), timeMillis);
|
||||
Map<String, String> queryMap = new HashMap<>();
|
||||
// queryMap.put("companyNumber", lbConfig.getCompanyNumber());
|
||||
queryMap.put("appId", lbConfig.getAppId());
|
||||
queryMap.put("phone", signPhone);
|
||||
queryMap.put("timestamp", String.valueOf(timeMillis));
|
||||
queryMap.put("signature", signature);
|
||||
// 发送请求
|
||||
DoorApi.Api h5Login = LbApi.H5_LOGIN;
|
||||
try {
|
||||
String res = HttpRequest.post(lbConfig.getBaseUrl() + h5Login.getUrl()).contentType(h5Login.getContentType()).body(JSONUtil.toJsonStr(queryMap)).execute().body();
|
||||
if (ObjectUtil.isEmpty(res)) throw new RuntimeException("response响应为空");
|
||||
ksBaseVo = JSONUtil.toBean(res, LbH5LoginVo.class);
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||h5Login|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
}
|
||||
return ksBaseVo;
|
||||
}
|
||||
|
||||
|
||||
// 加签
|
||||
public String apiCountersign(String phone, Long timestamp) {
|
||||
// String str = "companyNumber=%s&appId=%s&phone=%s×tamp=%s&secret=%s";
|
||||
// str = String.format(str, lbConfig.getCompanyNumber(), lbConfig.getAppId(), phone, timestamp, lbConfig.getAppSecret());
|
||||
String str = "phone=%s&appKey=%s×tamp=%s&secret=%s";
|
||||
str = String.format(str, phone, lbConfig.getAppId(), timestamp, lbConfig.getAppSecret());
|
||||
// 使用 SHA-256 进行哈希计算,并返回十六进制字符串。
|
||||
String sha256 = DigestUtils.sha256Hex(str);
|
||||
return sha256;
|
||||
}
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayApiBizTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayVoStatusEnum;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayGetWalletInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.RefundDto;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity;
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdKeyManageService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayApiService;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayLogService;
|
||||
import com.bsd.pjcloud.thirdparty.utils.lb.tool.LbRetailSignUtils;
|
||||
import com.bsd.pjcloud.thirdparty.vo.pay.*;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 第三方支付
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ThirdPayApiServiceImpl implements ThirdPayApiService {
|
||||
|
||||
private final String TAG = "第三方支付";
|
||||
|
||||
private final ThirdKeyManageService keyManageService;
|
||||
private final ThirdPayLogService payLogService;
|
||||
|
||||
private final RemoteWalletService remoteWalletService;
|
||||
|
||||
/**
|
||||
* 扣款
|
||||
*/
|
||||
@Override
|
||||
public PayVo pay(PayDto dto) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
ThirdPayLogEntity logObj = ThirdPayLogEntity.builder().apiUrl("/pay").bizType(ThirdPayApiBizTypeEnum.PAY.getType()).req(JSONUtil.toJsonStr(dto)).build();
|
||||
PayVo vo = new PayVo();
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||pay|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
logObj.setError(error);
|
||||
} finally {
|
||||
logObj.setTimeConsuming(Long.toString(System.currentTimeMillis() - startTime));
|
||||
payLogService.save(logObj);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
@Override
|
||||
public RefundVo refund(RefundDto dto) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
ThirdPayLogEntity logObj = ThirdPayLogEntity.builder().apiUrl("/refund").bizType(ThirdPayApiBizTypeEnum.REFUND.getType()).req(JSONUtil.toJsonStr(dto)).build();
|
||||
RefundVo vo = new RefundVo();
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
String error = String.format("|%s||refund|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace()));
|
||||
log.error(error);
|
||||
logObj.setError(error);
|
||||
} finally {
|
||||
logObj.setTimeConsuming(Long.toString(System.currentTimeMillis() - startTime));
|
||||
payLogService.save(logObj);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据加密的手机号查询用户钱包信息
|
||||
*/
|
||||
@Override
|
||||
public PayBaseVo<PayWalletInfoVo> getWalletInfo(String json, Map<String, String> headers) {
|
||||
PayBaseVo baseVo = new PayBaseVo<PayWalletInfoVo>();
|
||||
ThirdKeyManageEntity keySetting = keyManageService.checkSignAndReturnConfig(json, headers);
|
||||
if (ObjectUtil.isEmpty(keySetting)) {
|
||||
baseVo.set(ThirdPayVoStatusEnum.SIGN_ERROR);
|
||||
return baseVo;
|
||||
}
|
||||
PayGetWalletInfoDto dto = JSONUtil.toBean(json, PayGetWalletInfoDto.class);
|
||||
if (ObjectUtil.isEmpty(dto)) {
|
||||
baseVo.set(ThirdPayVoStatusEnum.PARAMS_ERROR);
|
||||
return baseVo;
|
||||
}
|
||||
// 手机号解密
|
||||
String phone = LbRetailSignUtils.sm4Decrypt(dto.getSignPhone(), keySetting.getFieldKey());
|
||||
if (ObjectUtil.isEmpty(phone)) {
|
||||
baseVo.set(ThirdPayVoStatusEnum.PARAMS_ERROR);
|
||||
baseVo.setMessage("手机号解迷失败");
|
||||
return baseVo;
|
||||
}
|
||||
WalletManageVo userWallet = remoteWalletService.getWalletByUserPhone(phone, WalletTypeEnum.EAT).getData();
|
||||
if (ObjectUtil.isEmpty(userWallet)) {
|
||||
baseVo.set(ThirdPayVoStatusEnum.USER_EXIST);
|
||||
return baseVo;
|
||||
}
|
||||
PayGetWalletInfoVo result = new PayGetWalletInfoVo();
|
||||
result.setSignPhone(dto.getSignPhone());
|
||||
result.setBalance(userWallet.getBalance());
|
||||
result.setName(userWallet.getUsername());
|
||||
// 返回成功的参数
|
||||
baseVo.set(ThirdPayVoStatusEnum.SUCCESS);
|
||||
baseVo.setData(result);
|
||||
return baseVo;
|
||||
}
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.pay;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import com.bsd.pjcloud.thirdparty.mapper.pay.ThirdPayLogMapper;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPayLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 第三方支付日志
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ThirdPayLogServiceImpl extends ServiceImpl<ThirdPayLogMapper, ThirdPayLogEntity> implements ThirdPayLogService {
|
||||
|
||||
}
|
||||
+15
-9
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.thirdparty.utils.ks.api;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
@@ -35,13 +36,13 @@ public class KsApi {
|
||||
public static final KsApi.Api SKU_SUBMIT_COLLECTION = KsApi.Api.builder().url("/openapi/sc/v1/sku/collection").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpPost.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
// SKU审核结果主动获取
|
||||
public static final KsApi.Api SKU_RESULT = KsApi.Api.builder().url("/openapi/sc/v1/sku/%s").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpPost.METHOD_NAME).contentType("application/json").build();
|
||||
public static final KsApi.Api SKU_RESULT = KsApi.Api.builder().url("/openapi/sc/v1/sku/%s").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpGet.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
// SKU识别结果回调通知
|
||||
public static final KsApi.Api SKU_EDIT = KsApi.Api.builder().url("/callback").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpPatch.METHOD_NAME).contentType("application/json").build();
|
||||
// 常规SKU修改
|
||||
public static final KsApi.Api SKU_EDIT = KsApi.Api.builder().url("/openapi/sc/v1/sku/%s").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpPatch.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
// SKU审核结果回调通知
|
||||
public static final KsApi.Api SKU_SUBMIT_CALLBACK = KsApi.Api.builder().url("/openapi/sc/v1/sku/%s").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT_CALLBACK).method(HttpPatch.METHOD_NAME).contentType("application/json").build();
|
||||
public static final KsApi.Api SKU_SUBMIT_CALLBACK = KsApi.Api.builder().url("/callback").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT_CALLBACK).method(HttpPatch.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
// SKU删除
|
||||
public static final KsApi.Api SKU_DELETE = KsApi.Api.builder().url("/openapi/sc/v1/sku/%s").bizType(ThirdDoorKsApiTypeEnum.SKU_SUBMIT).method(HttpDelete.METHOD_NAME).contentType("application/json").build();
|
||||
@@ -75,6 +76,8 @@ public class KsApi {
|
||||
|
||||
private Map<String, Object> params = new TreeMap<>();
|
||||
|
||||
private List<Object> path;
|
||||
|
||||
private String body;
|
||||
|
||||
private String method;
|
||||
@@ -91,7 +94,6 @@ public class KsApi {
|
||||
|
||||
private String host = "";
|
||||
|
||||
|
||||
private String requestId;
|
||||
|
||||
public KsApi.Api setBaseUrl(String baseUrl) {
|
||||
@@ -119,14 +121,17 @@ public class KsApi {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Api setpath(Object... path) {
|
||||
this.url = String.format(this.url, path);
|
||||
this.path = ListUtil.of(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KsApi.Api setBody(String body) {
|
||||
this.body = body;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间戳
|
||||
*/
|
||||
public Long getXRequestDate() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
@@ -153,6 +158,7 @@ public class KsApi {
|
||||
// 计算签名
|
||||
Long currentTime = getXRequestDate();
|
||||
String queryString = getQueryString();
|
||||
if (ObjectUtil.isEmpty(queryString)) queryString = "";
|
||||
String auth = KsRetailSignUtils.getSignAuth(getHost(), getUrl(), contentType, getMethod(), currentTime, getAccessKey(), getSecretKey(), getBody(), queryString);
|
||||
String requestId = getXRequestDate() + RandomUtil.randomString(19);
|
||||
setRequestId(requestId);
|
||||
@@ -181,7 +187,7 @@ public class KsApi {
|
||||
} else if (ObjectUtil.equals(method, HttpPatch.METHOD_NAME)) {
|
||||
return HttpRequest.patch(fullPatch).header(getHeader()).body(getBody());
|
||||
} else if (ObjectUtil.equals(method, HttpDelete.METHOD_NAME)) {
|
||||
return HttpRequest.delete(fullPatch).header(getHeader()).body(getBody());
|
||||
return HttpRequest.delete(fullPatch).header(getHeader());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.bsd.pjcloud.thirdparty.utils.lb.api;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.door.ThirdDoorApiTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.utils.door.api.DoorApi;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
|
||||
|
||||
@UtilityClass
|
||||
public class LbApi {
|
||||
|
||||
// 美好生活登录(直连模式)
|
||||
public static final DoorApi.Api H5_LOGIN = DoorApi.Api.builder().url("/mall/xhr/authLogin/thirdApp").bizType(ThirdDoorApiTypeEnum.REGISTER).method(HttpPost.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
// 美好生活登录(分行中转模式)
|
||||
public static final DoorApi.Api H5_LOGIN_OPEN = DoorApi.Api.builder().url("/mall/xhr/authLogin/thirdAppOpen").bizType(ThirdDoorApiTypeEnum.REGISTER).method(HttpPost.METHOD_NAME).contentType("application/json").build();
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Api {
|
||||
private String url;
|
||||
|
||||
private String method;
|
||||
|
||||
private String contentType;
|
||||
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.bsd.pjcloud.thirdparty.utils.lb.tool;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Security;
|
||||
import java.util.Base64;
|
||||
|
||||
@Slf4j
|
||||
@UtilityClass
|
||||
public class LbRetailSignUtils {
|
||||
|
||||
static {
|
||||
// 添加安全提供者(SM2,SM3,SM4等加密算法,CBC、CFB等加密模式,PKCS7Padding等填充方式,不在Java标准库中,由BouncyCastleProvider实现)
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
}
|
||||
|
||||
public static String sm4Encrypt(String plainString, String key) {
|
||||
String cipherString = null;
|
||||
try {
|
||||
String algorithm = "SM4";
|
||||
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), algorithm);
|
||||
Cipher cipher = Cipher.getInstance(algorithm + "/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
|
||||
byte[] cipherBytes = cipher.doFinal(plainString.getBytes(StandardCharsets.UTF_8));
|
||||
cipherString = Base64.getEncoder().encodeToString(cipherBytes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return cipherString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* SM4,商业密码(Shang Mi4)是中华人民共和国政府采用的一种分组密码标准,由国家密码管理局于2012年3月21日发布,相关标准为“GM/T 0002-2012《SM4分组密码算法》”。
|
||||
*/
|
||||
public static String sm4Decrypt(String cipherString, String key) {
|
||||
String plainString = null;
|
||||
try {
|
||||
String algorithm = "SM4";
|
||||
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), algorithm);
|
||||
Cipher cipher = Cipher.getInstance(algorithm + "/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
|
||||
byte[] cipherBytes = cipher.doFinal(Base64.getDecoder().decode(cipherString));
|
||||
plainString = new String(cipherBytes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return plainString;
|
||||
}
|
||||
|
||||
}
|
||||
+30
-24
@@ -44,31 +44,31 @@ oauth2:
|
||||
# 正元智慧
|
||||
# https://gwyc.zj.gov.cn/API/%E7%9C%81%E5%B9%B3%E5%8F%B0API%E5%AF%B9%E6%8E%A5%E6%8E%A5%E5%8F%A3.html
|
||||
zy:
|
||||
# 测试1
|
||||
# base-url: http://60.191.37.212:18079
|
||||
# app-id: 689C8D6F5059A6F85B8BE45A49001ACB
|
||||
# app-secret: BD21DA0DEB8F0FC43246B0BD2FCAE6FF
|
||||
# 测试1
|
||||
# base-url: http://60.191.37.212:18079
|
||||
# app-id: 689C8D6F5059A6F85B8BE45A49001ACB
|
||||
# app-secret: BD21DA0DEB8F0FC43246B0BD2FCAE6FF
|
||||
|
||||
# 测试2
|
||||
# base-url: http://60.191.37.212:18079
|
||||
# app-id: FC455B0A788E334AC08FB3E1D8385C75
|
||||
# app-secret: E9131D0BCC9054808675DA1E2E199023
|
||||
# 测试2
|
||||
# base-url: http://60.191.37.212:18079
|
||||
# app-id: FC455B0A788E334AC08FB3E1D8385C75
|
||||
# app-secret: E9131D0BCC9054808675DA1E2E199023
|
||||
|
||||
# 正式
|
||||
# base-url: https://gwycport.zj.gov.cn
|
||||
# app-id: 0BBF0D9A7F1B4BD5280E59197E259AC6
|
||||
# app-secret: 434752786ACBB37214F6617CC37AD0E9
|
||||
# 正式
|
||||
# base-url: https://gwycport.zj.gov.cn
|
||||
# app-id: 0BBF0D9A7F1B4BD5280E59197E259AC6
|
||||
# app-secret: 434752786ACBB37214F6617CC37AD0E9
|
||||
|
||||
|
||||
# self-base-url: http://60.191.37.212:18079
|
||||
# self-app-id: xA5jF2vX4zO5mQ8tR9yE7rC7iI0fK0kI
|
||||
# self-app-secret: kE3hH5gF7zN0nH1yI5yX3vP0oP1hU0jE
|
||||
# 失效时间单位秒
|
||||
# self-expires-in: 7200
|
||||
# token key
|
||||
# self_token_key: zy_token
|
||||
# token
|
||||
# self_token_secret: eV3dT0oD7iX8rK4eC3jS6fU8cU5cS6mJ
|
||||
# self-base-url: http://60.191.37.212:18079
|
||||
# self-app-id: xA5jF2vX4zO5mQ8tR9yE7rC7iI0fK0kI
|
||||
# self-app-secret: kE3hH5gF7zN0nH1yI5yX3vP0oP1hU0jE
|
||||
# 失效时间单位秒
|
||||
# self-expires-in: 7200
|
||||
# token key
|
||||
# self_token_key: zy_token
|
||||
# token
|
||||
# self_token_secret: eV3dT0oD7iX8rK4eC3jS6fU8cU5cS6mJ
|
||||
|
||||
# 智能柜
|
||||
# door:
|
||||
@@ -88,7 +88,13 @@ zy:
|
||||
# callback-base-url: http://h1yzkslmyx.ny.takin.cc
|
||||
# callback-recognition-url: /third/third-ks/callback/recognition
|
||||
# callback-sku-url: /third/third-ks/callback/sku
|
||||
|
||||
lb:
|
||||
# base-url: https://elss-sit.nbcb.com.cn
|
||||
base-url: https://elss-sit.nbcb.com.cn/h5/thirdApp
|
||||
app-id: 7da62b1a9ade473c917f573c5748081e
|
||||
app-secret: 8ffl6b+OKTmdVAt9Qo+2F/HQQMdt/d8GFia0zUOt9l=
|
||||
company-number: 202504673472
|
||||
sm4-key: 567157e8aQs2tF5X
|
||||
|
||||
|
||||
sms:
|
||||
@@ -103,10 +109,10 @@ sms:
|
||||
templates:
|
||||
20657: # 验证码模板
|
||||
content: "您好,您的验证码是{code},有效时间{date}分钟,请勿转发!"
|
||||
params: ["code", "date"]
|
||||
params: [ "code", "date" ]
|
||||
20658:
|
||||
content: "您的访客预约申请已通过,请通过地址{url}查看详情!"
|
||||
params: ["url"]
|
||||
params: [ "url" ]
|
||||
settings:
|
||||
default-ext-code: "123"
|
||||
timeout-seconds: 300
|
||||
|
||||
Binary file not shown.
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.thirdparty.mapper.ThirdKeyManageMapper">
|
||||
|
||||
<resultMap id="thirdKeyManageMap" type="com.bsd.pjcloud.thirdparty.entity.ThirdKeyManageEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="appKey" column="app_key"/>
|
||||
<result property="appSecret" column="app_secret"/>
|
||||
<result property="fieldKey" column="field_key"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.thirdparty.mapper.pay.ThirdPayLogMapper">
|
||||
|
||||
<resultMap id="thirdPayLogMap" type="com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="paySourceType" column="pay_source_type"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="bizId" column="biz_id"/>
|
||||
<result property="apiUrl" column="api_url"/>
|
||||
<result property="res" column="res"/>
|
||||
<result property="req" column="req"/>
|
||||
<result property="error" column="error"/>
|
||||
<result property="timeConsuming" column="time_consuming"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.admin.api.constant;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 用户调岗类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum UserTransactionEnum {
|
||||
|
||||
LEAVE("10", "离职"),
|
||||
RETIRE("20", "退休"),
|
||||
INNER_TRANSFER("30", "调岗(内部)"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static UserTransactionEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+7
@@ -29,4 +29,11 @@ public class SysUserFaceDto extends SysUserFaceEntity implements BaseIsIncludeTr
|
||||
private Boolean isInclude;
|
||||
|
||||
private Boolean isFindCheckUser = false;
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String phone;
|
||||
}
|
||||
+90
-75
@@ -3,14 +3,17 @@ package com.bsd.pjcloud.admin.api.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 人员调动表
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sys_user_transaction")
|
||||
@@ -19,112 +22,124 @@ import java.time.LocalDateTime;
|
||||
public class SysUserTransactionEntity extends Model<SysUserTransactionEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description="用户id")
|
||||
/**
|
||||
* 申请部门用户id
|
||||
*/
|
||||
@Schema(description = "申请部门用户id")
|
||||
private Long applyUserId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@Schema(description="业务id")
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@Schema(description = "业务id")
|
||||
private Long bizId;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@Schema(description="业务类型")
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@Schema(description = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 源部门id
|
||||
*/
|
||||
@Schema(description="源部门id")
|
||||
/**
|
||||
* 源部门id
|
||||
*/
|
||||
@Schema(description = "源部门id")
|
||||
private Long sourceDeptId;
|
||||
|
||||
/**
|
||||
* 目标部门id
|
||||
*/
|
||||
@Schema(description="目标部门id")
|
||||
/**
|
||||
* 目标部门id
|
||||
*/
|
||||
@Schema(description = "目标部门id")
|
||||
private Long targetDeptId;
|
||||
|
||||
/**
|
||||
* 是否离职自动转账
|
||||
*/
|
||||
@Schema(description="是否离职自动转账")
|
||||
/**
|
||||
* 是否离职自动转账
|
||||
*/
|
||||
@Schema(description = "是否离职自动转账")
|
||||
private String isWalletTransaction;
|
||||
|
||||
/**
|
||||
* 离职自动转账时间
|
||||
*/
|
||||
@Schema(description="离职自动转账时间")
|
||||
/**
|
||||
* 离职自动转账时间
|
||||
*/
|
||||
@Schema(description = "离职自动转账时间")
|
||||
private LocalDateTime walletTransactionTime;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description="流程id")
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private String processId;
|
||||
|
||||
/**
|
||||
* 审核状体
|
||||
*/
|
||||
@Schema(description="审核状体")
|
||||
/**
|
||||
* 审核状体
|
||||
*/
|
||||
@Schema(description = "审核状体")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Schema(description="审核时间")
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Schema(description = "审核时间")
|
||||
private LocalDateTime processTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+7
@@ -54,6 +54,13 @@ public interface RemoteUserService {
|
||||
@GetMapping("/user/info/{username}")
|
||||
R<UserInfo> info(@PathVariable("username") String username);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/user/inner/phone")
|
||||
R<UserInfo> getInnerByPhone(@RequestParam String phone);
|
||||
|
||||
/**
|
||||
* 通过用户id查询用户、角色信息
|
||||
*/
|
||||
|
||||
+2
@@ -26,4 +26,6 @@ public class SysUserTransactionVo extends SysUserTransactionEntity implements Ba
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
private String applyUsername;
|
||||
|
||||
}
|
||||
+14
-3
@@ -121,6 +121,16 @@ public class SysUserController {
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户
|
||||
*/
|
||||
@GetMapping("/user/inner/phone")
|
||||
R<UserInfo> getInnerByPhone(@RequestParam String phone) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getPhone, phone));
|
||||
if (user == null) return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, phone));
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
@GetMapping("/get-by-user-id")
|
||||
public R getByUserId(@RequestParam Long userId) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUserId, userId));
|
||||
@@ -361,14 +371,15 @@ public class SysUserController {
|
||||
|
||||
/**
|
||||
* 根据部门id查询用户列表
|
||||
*
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
// @Inner
|
||||
@GetMapping("/getUserIdListByDeptId")
|
||||
public R<List<SimpleUserListVO>> getUserIdListByDeptId(@RequestParam("deptId")Long deptId,
|
||||
@RequestParam(value = "name",required = false) String name) {
|
||||
return R.ok(userService.listUserIdByDeptId(deptId,name));
|
||||
public R<List<SimpleUserListVO>> getUserIdListByDeptId(@RequestParam("deptId") Long deptId,
|
||||
@RequestParam(value = "name", required = false) String name) {
|
||||
return R.ok(userService.listUserIdByDeptId(deptId, name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-1
@@ -11,6 +11,7 @@ import com.bsd.pjcloud.admin.api.entity.SysUserFaceEntity;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserFaceVo;
|
||||
import com.bsd.pjcloud.admin.service.SysUserFaceService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
@@ -140,7 +141,9 @@ public class SysUserFaceController {
|
||||
@PostMapping("/page-check-join")
|
||||
public R<Page<SysUserFaceVo>> appPageCheckJoin(@ParameterObject Page page, @RequestBody SysUserFaceDto dto) {
|
||||
dto.setIsFindCheckUser(true);
|
||||
return R.ok(sysUserFaceService.pageJoin(page, dto));
|
||||
DataScope dataScope = new DataScope();
|
||||
dataScope.setScopeDeptName("userDeptId");
|
||||
return R.ok(sysUserFaceService.scopePageList(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
|
||||
+24
-5
@@ -11,6 +11,10 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.admin.service.SysUserTransactionService;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -36,6 +40,17 @@ public class SysUserTransactionController {
|
||||
|
||||
private final SysUserTransactionService sysUserTransactionService;
|
||||
|
||||
/* ************************************* start callback start ************************************* */
|
||||
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "申请调岗审批回调", description = "申请调岗审批回调")
|
||||
@PostMapping("/apply-callback")
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto, @RequestParam(required = false) Long tenantId) {
|
||||
sysUserTransactionService.applyCallback(dto, tenantId);
|
||||
}
|
||||
|
||||
/* ************************************* end callback end ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_view')")
|
||||
@@ -49,6 +64,7 @@ public class SysUserTransactionController {
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject SysUserTransactionDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
dataScope.setScopeDeptName("applyUserDeptId");
|
||||
return R.ok(sysUserTransactionService.scopePageJoin(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@@ -63,16 +79,18 @@ public class SysUserTransactionController {
|
||||
@SysLog("新增人员调动表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_add')")
|
||||
public R save(@RequestBody SysUserTransactionEntity sysUserTransaction) {
|
||||
return R.ok(sysUserTransactionService.save(sysUserTransaction));
|
||||
public R save(@RequestBody SysUserTransactionDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(sysUserTransactionService.create(dto, user));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改人员调动表", description = "修改人员调动表")
|
||||
@SysLog("修改人员调动表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_edit')")
|
||||
public R updateById(@RequestBody SysUserTransactionEntity sysUserTransaction) {
|
||||
return R.ok(sysUserTransactionService.updateById(sysUserTransaction));
|
||||
public R updateById(@RequestBody SysUserTransactionDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(sysUserTransactionService.edit(dto, user));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除人员调动表", description = "通过id删除人员调动表")
|
||||
@@ -80,7 +98,8 @@ public class SysUserTransactionController {
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysUserTransactionService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
sysUserTransactionService.delByIds(CollUtil.toList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
|
||||
+1
@@ -14,4 +14,5 @@ public interface SysUserTransactionMapper extends PjcloudBaseMapper<SysUserTrans
|
||||
|
||||
Page<SysUserTransactionVo> scopePageJoin(Page page, @Param("dto") SysUserTransactionDto dto, DataScope dataScope);
|
||||
|
||||
SysUserTransactionVo join(@Param("id") Long userTransactionId);
|
||||
}
|
||||
+28
@@ -3,11 +3,39 @@ package com.bsd.pjcloud.admin.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.admin.api.dto.SysUserTransactionDto;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserDTO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface SysUserTransactionService extends IService<SysUserTransactionEntity> {
|
||||
|
||||
Page<SysUserTransactionVo> scopePageJoin(Page page, SysUserTransactionDto dto, DataScope dataScope);
|
||||
|
||||
SysUserTransactionVo join(Long userTransactionId);
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
Long create(SysUserTransactionDto dto, PjcloudUser applyUser);
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
Long edit(SysUserTransactionDto dto, PjcloudUser applyUser);
|
||||
|
||||
/**
|
||||
* 删除人员调动
|
||||
*/
|
||||
void delByIds(ArrayList<Long> list);
|
||||
|
||||
/**
|
||||
* 回调
|
||||
*/
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId);
|
||||
}
|
||||
+3
@@ -191,6 +191,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
if (ObjectUtil.isEmpty(userRoles)) {
|
||||
return false;
|
||||
}
|
||||
// 如果是管理员,直接返回false
|
||||
boolean isAdmin = userRoles.stream().anyMatch(v -> ObjectUtil.equals(v.getRoleCode(), CommonRoleConstant.ROLE_ADMIN));
|
||||
if (isAdmin) return false;
|
||||
return userRoles.stream().anyMatch(v -> ObjectUtil.equals(v.getRoleCode(), CommonRoleConstant.DEPT_ADMIN));
|
||||
}
|
||||
|
||||
|
||||
+26
-1
@@ -147,7 +147,32 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
|
||||
@Override
|
||||
public Page<SysUserFaceVo> scopePageList(Page page, SysUserFaceDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageList(page, dto, DataScope.of());
|
||||
if (ObjectUtil.isNotEmpty(dto.getMerchantDeptIdOrGlobal())) {
|
||||
List<SysDept> deptList = sysDeptService.listDescendant(dto.getMerchantDeptIdOrGlobal());
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
List<Long> deptIds = deptList.stream().map(SysDept::getDeptId).toList();
|
||||
dto.setDeptIds(deptIds);
|
||||
}
|
||||
}
|
||||
Page<SysUserFaceVo> list = baseMapper.scopePageList(page, dto, dataScope);
|
||||
// 审批流程
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds = list.getRecords().stream().map(SysUserFaceVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list.getRecords(), v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
v.setIsCheckUser(true);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+17
-7
@@ -59,6 +59,7 @@ import com.bsd.pjcloud.common.core.util.MsgUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.excel.vo.ErrorMessage;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -86,6 +87,8 @@ import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -198,9 +201,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
if (isDeptAdmin) {
|
||||
getSelf().applyFlow(sysUser);
|
||||
} else {
|
||||
// 创建用户默认钱包
|
||||
remoteWalletService.createWallet(sysUser.getUserId());
|
||||
remoteWalletService.userChange(sysUser.getUserId(), Boolean.FALSE);
|
||||
// 创建用户默认钱包、保证线程header
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
RequestContextHolder.setRequestAttributes(requestAttributes);
|
||||
remoteWalletService.createWallet(sysUser.getUserId());
|
||||
remoteWalletService.userChange(sysUser.getUserId(), Boolean.FALSE);
|
||||
});
|
||||
}
|
||||
|
||||
return sysUser.getUserId();
|
||||
@@ -405,8 +412,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
|
||||
// 创建用户默认钱包
|
||||
remoteWalletService.createWallet(userDto.getUserId());
|
||||
remoteWalletService.userChange(userDto.getUserId(), Boolean.FALSE);
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
RequestContextHolder.setRequestAttributes(requestAttributes);
|
||||
remoteWalletService.createWallet(userDto.getUserId());
|
||||
remoteWalletService.userChange(userDto.getUserId(), Boolean.FALSE);
|
||||
});
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -915,11 +926,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<SimpleUserListVO> listUserIdByDeptId(Long deptId, String name) {
|
||||
List<SysUser> sysUsers = baseMapper.selectList(Wrappers.<SysUser>lambdaQuery()
|
||||
.eq(SysUser::getDeptId, deptId)
|
||||
.like(StrUtil.isNotBlank(name),SysUser::getName, name));
|
||||
.like(StrUtil.isNotBlank(name), SysUser::getName, name));
|
||||
return com.bsd.pjcloud.common.core.util.BeanUtils.toBean(sysUsers, SimpleUserListVO.class);
|
||||
}
|
||||
|
||||
|
||||
+190
@@ -1,16 +1,45 @@
|
||||
package com.bsd.pjcloud.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.constant.UserTransactionEnum;
|
||||
import com.bsd.pjcloud.admin.api.dto.SysUserTransactionDto;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserDTO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo;
|
||||
import com.bsd.pjcloud.admin.mapper.SysUserTransactionMapper;
|
||||
import com.bsd.pjcloud.admin.service.SysDeptService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserTransactionService;
|
||||
import com.bsd.pjcloud.admin.utils.flow.FlowUtil;
|
||||
import com.bsd.pjcloud.admin.utils.flow.dto.UserTransactionFlowDto;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowEngineService;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletThirdZyService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员调动表
|
||||
@@ -20,8 +49,169 @@ import org.springframework.stereotype.Service;
|
||||
@AllArgsConstructor
|
||||
public class SysUserTransactionServiceImpl extends ServiceImpl<SysUserTransactionMapper, SysUserTransactionEntity> implements SysUserTransactionService {
|
||||
|
||||
private static final String TAG = "员工申请调岗";
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
private final SysDeptService sysDeptService;
|
||||
|
||||
private final RemoteFlowEngineService remoteFlowEngineService;
|
||||
private final RemoteWalletThirdZyService remoteWalletThirdZyService;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@Override
|
||||
public Page<SysUserTransactionVo> scopePageJoin(Page page, SysUserTransactionDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageJoin(page, dto, dataScope);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserTransactionVo join(Long userTransactionId) {
|
||||
return baseMapper.join(userTransactionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(SysUserTransactionDto dto, PjcloudUser applyUser) {
|
||||
dto.setApplyUserId(applyUser.getId());
|
||||
if (ObjectUtil.notEqual(dto.getBizType(), UserTransactionEnum.INNER_TRANSFER.getType())) {
|
||||
dto.setIsWalletTransaction(YesNoEnum.YES.getCode());
|
||||
} else {
|
||||
dto.setIsWalletTransaction(YesNoEnum.NO.getCode());
|
||||
}
|
||||
// 查询调动用户
|
||||
SysUser userDetail = sysUserService.getById(dto.getUserId());
|
||||
// 如果是离职或者调岗(外地)自动移动到指定部门
|
||||
if (ObjectUtil.equals(dto.getBizType(), UserTransactionEnum.LEAVE.getType())) {
|
||||
Long deptId = null;
|
||||
try {
|
||||
String deptIdStr = ParamResolver.getStr("USER_TRANSACTION_LEAVE");
|
||||
deptId = Long.valueOf(deptIdStr);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("请配置离职部门参数");
|
||||
}
|
||||
if (ObjectUtil.equals(userDetail.getDeptId(), deptId)) {
|
||||
throw new RuntimeException("用户已在离职人员部门");
|
||||
}
|
||||
dto.setTargetDeptId(deptId);
|
||||
}
|
||||
if (ObjectUtil.equals(dto.getBizType(), UserTransactionEnum.RETIRE.getType())) {
|
||||
Long deptId = null;
|
||||
try {
|
||||
String deptIdStr = ParamResolver.getStr("USER_TRANSACTION_TRANSFER");
|
||||
deptId = Long.valueOf(deptIdStr);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("请配置调岗(外地)部门参数");
|
||||
}
|
||||
if (ObjectUtil.equals(userDetail.getDeptId(), deptId)) {
|
||||
throw new RuntimeException("用户已在退休人员部门");
|
||||
}
|
||||
dto.setTargetDeptId(deptId);
|
||||
}
|
||||
if (ObjectUtil.equals(dto.getBizType(), UserTransactionEnum.INNER_TRANSFER.getType())) {
|
||||
if (ObjectUtil.isEmpty(ObjectUtil.isEmpty(dto.getTargetDeptId()))) {
|
||||
throw new RuntimeException("请选择目标部门");
|
||||
}
|
||||
if (ObjectUtil.equals(userDetail.getDeptId(), dto.getTargetDeptId())) {
|
||||
throw new RuntimeException("调动用户源部门和目标部门不能一致");
|
||||
}
|
||||
}
|
||||
// 查询发起用户
|
||||
SysUser applySysUser = sysUserService.getById(applyUser.getId());
|
||||
SysDept applySysDept = sysDeptService.getById(applyUser.getDeptId());
|
||||
baseMapper.insert(dto);
|
||||
// 发起审批
|
||||
UserTransactionFlowDto flowDto = new UserTransactionFlowDto();
|
||||
flowDto.setApplyDeptName(applySysDept.getName());
|
||||
String processId = flowUtil.startFlow("USER_TRANSATION_APPLY", applySysUser, dto.getId(), flowDto);
|
||||
// 更新审批信息
|
||||
SysUserTransactionEntity updateObj = new SysUserTransactionEntity();
|
||||
updateObj.setId(dto.getId());
|
||||
updateObj.setProcessId(processId);
|
||||
updateObj.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
baseMapper.updateById(updateObj);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
@Override
|
||||
public Long edit(SysUserTransactionDto dto, PjcloudUser applyUser) {
|
||||
SysUserTransactionEntity updateObj = BeanUtil.toBean(dto, SysUserTransactionEntity.class);
|
||||
if (ObjectUtil.notEqual(TaskCheckStatusEnum.PADDING.getCode(), dto.getProcessStatus())) {
|
||||
throw new RuntimeException("审批中状态才可以修改");
|
||||
}
|
||||
baseMapper.updateById(updateObj);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员调动
|
||||
*/
|
||||
@Override
|
||||
public void delByIds(ArrayList<Long> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<SysUserTransactionEntity> userList = baseMapper.selectList(new LambdaQueryWrapper<SysUserTransactionEntity>()
|
||||
.in(SysUserTransactionEntity::getId, list)
|
||||
);
|
||||
for (SysUserTransactionEntity v : userList) {
|
||||
if (ObjectUtil.notEqual(TaskCheckStatusEnum.PADDING.getCode(), v.getProcessStatus())) {
|
||||
SysUserTransactionVo detail = join(v.getId());
|
||||
throw new RuntimeException("调动人<" + detail.getUsername() + ">手机号<" + detail.getUserMobile() + ">,审批中状态才可以修改");
|
||||
}
|
||||
}
|
||||
// 取消审批
|
||||
TaskParamDto dto = new TaskParamDto();
|
||||
dto.setProcessInstanceIdList(userList.stream().map(SysUserTransactionEntity::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList());
|
||||
remoteFlowEngineService.stopProcessInstance(dto).getData();
|
||||
baseMapper.deleteBatchIds(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 回调
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId) {
|
||||
if (!flowUtil.checkCallback(dto)) {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(tenantId) && ObjectUtil.notEqual(tenantId, 1L)) {
|
||||
TenantContextHolder.setTenantId(tenantId);
|
||||
}
|
||||
String processId = dto.getProcessInstanceId();
|
||||
SysUserTransactionEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<SysUserTransactionEntity>().eq(SysUserTransactionEntity::getProcessId, processId));
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return;
|
||||
}
|
||||
if (!ObjectUtil.equals(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
log.error("|{}|重复的回调,dto:|{}|", TAG, JSON.toJSONString(dto));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(SysUserTransactionEntity.builder().id(detail.getId()).processTime(LocalDateTime.now()).processStatus(processStatus).build());
|
||||
if (isConsent) {
|
||||
// 修改部门
|
||||
SysUser userUpdateObj = new SysUser();
|
||||
userUpdateObj.setUserId(detail.getUserId());
|
||||
userUpdateObj.setDeptId(detail.getTargetDeptId());
|
||||
sysUserService.updateById(userUpdateObj);
|
||||
// 通知正元
|
||||
if (ObjectUtil.equals(detail.getBizType(), UserTransactionEnum.INNER_TRANSFER.getType())) {
|
||||
// 通知正元
|
||||
remoteWalletThirdZyService.syncUserById(detail.getUserId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -58,12 +58,12 @@ public class FlowUtil {
|
||||
log.error("|{}|请配置跨单位审批流程ID;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("请配置跨单位审批流程ID");
|
||||
}
|
||||
R<ProcessVO> detail = flowApiFlowService.getDetail(defaultRole);
|
||||
R<Process> detail = flowApiFlowService.getProcessByBusinessKey(defaultRole);
|
||||
if (Optional.of(detail.getData()).map(Process::getId).isEmpty()) {
|
||||
log.error("|{}|未查询到该审批流程;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("未查询到该审批流程");
|
||||
}
|
||||
ProcessVO processVo = detail.getData();
|
||||
Process processVo = detail.getData();
|
||||
ProcessInstanceParamDto processDto = new ProcessInstanceParamDto();
|
||||
if (ObjectUtil.isNotEmpty(dto)) {
|
||||
if (ObjectUtil.isNotEmpty(user.getUserId())) {
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.admin.utils.flow.dto;
|
||||
|
||||
import com.bsd.pjcloud.flow.task.dto.base.FlowBaseDto;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserTransactionFlowDto extends FlowBaseDto {
|
||||
}
|
||||
@@ -15,13 +15,19 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectA">
|
||||
select a.user_id,
|
||||
select a.id,
|
||||
a.auto_code,
|
||||
a.user_id,
|
||||
a.process_id,
|
||||
a.process_status,
|
||||
a.face_img,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id,
|
||||
a.process_time,
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
@@ -29,7 +35,8 @@
|
||||
<if test="pa.userId != null">
|
||||
and a.user_id = #{pa.userId}
|
||||
</if>
|
||||
<if test="pa.userId != null">
|
||||
<if test="pa.processStatus != null">
|
||||
and a.process_status = #{pa.processStatus}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
@@ -37,12 +44,20 @@
|
||||
<include refid="selectA"/>
|
||||
u.name as username,
|
||||
u.avatar as userAvatar,
|
||||
u.phone as userMobile
|
||||
u.phone as userMobile,
|
||||
u.dept_id as userDeptId
|
||||
from sys_user_face a
|
||||
left join sys_user u on u.user_id = a.user_id
|
||||
left join sys_user u on u.user_id = a.user_id and u.del_flag = '0'
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
<if test="pa.username != null">
|
||||
and u.name LIKE CONCAT('%', #{pa.username}, '%')
|
||||
</if>
|
||||
<if test="pa.phone != null">
|
||||
and u.phone LIKE CONCAT('%', #{pa.phone}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc , a.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Long">
|
||||
|
||||
+17
-3
@@ -24,6 +24,7 @@
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.apply_user_id,
|
||||
a.user_id,
|
||||
a.biz_id,
|
||||
a.biz_type,
|
||||
@@ -79,19 +80,32 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<sql id="selectJoin">
|
||||
<include refid="selectA"/>
|
||||
soureD.name as sourceDeptName,
|
||||
targetD.name as targetDeptName,
|
||||
u.username as username,
|
||||
u.name as username,
|
||||
u.phone as userMobile,
|
||||
u.avatar as userAvatar
|
||||
u.avatar as userAvatar,
|
||||
applyU.name as applyUsername,
|
||||
applyU.dept_id as applyUserDeptId
|
||||
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
|
||||
left join sys_user applyU on applyU.user_id = a.apply_user_id
|
||||
</sql>
|
||||
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<include refid="selectJoin" />
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc,a.id desc
|
||||
</select>
|
||||
|
||||
<select id="join" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<include refid="selectJoin"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
+5
@@ -23,4 +23,9 @@ public class MchManageDto extends MchManageEntity {
|
||||
private String type;
|
||||
|
||||
private Boolean parentIsNull = true;
|
||||
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String catgoryName;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletTopupActionDto implements BaseIsIncludeTreeInterface {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 不活跃天数
|
||||
*/
|
||||
private Long unactiveMonthsNumber;
|
||||
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
private List<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 是否包含部门ids
|
||||
*/
|
||||
private Boolean isInclude;
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.mch;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商户分类
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("mch_catgory")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "商户分类")
|
||||
public class MchCatgoryEntity extends Model<MchCatgoryEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
@Schema(description="分类名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 分类名类型
|
||||
*/
|
||||
@Schema(description="分类名类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description="排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+7
-1
@@ -60,6 +60,12 @@ public class MchManageEntity extends Model<MchManageEntity> {
|
||||
@Schema(description = "店铺类型,逗号分隔")
|
||||
private String types;
|
||||
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
@Schema(description = "分类id")
|
||||
private Long catgoryId;
|
||||
|
||||
/**
|
||||
* 商户logo图片
|
||||
*/
|
||||
@@ -118,7 +124,7 @@ public class MchManageEntity extends Model<MchManageEntity> {
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
* 超市类型
|
||||
*/
|
||||
@Schema(description = "超市类型")
|
||||
private String supType;
|
||||
|
||||
+5
@@ -32,10 +32,15 @@ public interface RemoteWalletService {
|
||||
@GetMapping("/wallet-manage/get-wallet-by-id")
|
||||
R<WalletManageVo> getWalletById(@RequestParam Long walletId);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-manage/get-wallet-by-phone")
|
||||
R<WalletManageVo> getWalletByUserPhone(@RequestParam String phone, @RequestParam WalletTypeEnum walletTypeCode);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-manage/get-wallet-by-card-number")
|
||||
R<WalletManageEntity> getWalletByCardNumber(@RequestParam String cardNumber);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-manage/create-wallet")
|
||||
R<WalletManageEntity> createWallet(@RequestParam Long userId);
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(contextId = "remoteWalletThirdZyService", value = ServiceNameConstants.WALLET_SERVICE)
|
||||
public interface RemoteWalletThirdZyService {
|
||||
|
||||
@NoToken
|
||||
@PostMapping("/mch-third-zy/sync-user")
|
||||
R syncUserById(@RequestParam Long userId);
|
||||
|
||||
}
|
||||
+5
@@ -27,4 +27,9 @@ public class MchManageVo extends MchManageEntity implements BaseDeptInterface, B
|
||||
|
||||
private List<MchManageVo> children;
|
||||
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String catgoryName;
|
||||
|
||||
}
|
||||
+1
@@ -3,4 +3,5 @@ com.bsd.pjcloud.wallet.api.feign.RemoteCodeUseService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteWalletRechargeService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteMchService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteWalletSettingService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteWalletThirdZyService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteWalletTransactionService
|
||||
+24
-2
@@ -15,6 +15,7 @@ import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletTopupActionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletManageMapper;
|
||||
@@ -71,6 +72,7 @@ public class WalletManageController {
|
||||
return R.ok(wallet);
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/create-wallet")
|
||||
public R getWallet(@RequestParam Long userId) {
|
||||
walletManageService.createWallet(userId);
|
||||
@@ -87,12 +89,18 @@ public class WalletManageController {
|
||||
|
||||
@Inner
|
||||
@GetMapping("/get-wallet-by-id")
|
||||
public R getWalletById(@RequestParam Long walletId) {
|
||||
public R<WalletManageVo> getWalletById(@RequestParam Long walletId) {
|
||||
WalletManageVo wallet = walletManageMapper.join(walletId);
|
||||
if (ObjectUtil.isEmpty(wallet)) return R.failed("用户钱包不存在");
|
||||
return R.ok(wallet);
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/get-wallet-by-phone")
|
||||
public R<WalletManageVo> getWalletByUserPhone(@RequestParam String phone, @RequestParam WalletTypeEnum walletTypeCode) {
|
||||
return R.ok(walletManageService.getWalletByPhone(phone, walletTypeCode));
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/get-wallet-by-card-number")
|
||||
public R getWalletByCardNumber(@RequestParam String cardNumber) {
|
||||
@@ -195,11 +203,25 @@ public class WalletManageController {
|
||||
|
||||
@Operation(summary = "钱包记录分页", description = "钱包记录分页")
|
||||
@PostMapping("/page-join-qb")
|
||||
public R pageJoinQb(@ParameterObject Page page, @RequestBody WalletManageBalanceDto dto) {
|
||||
public R<Page<WalletManageVo>> pageJoinQb(@ParameterObject Page page, @RequestBody WalletManageBalanceDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletManageService.scopeQbPage(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "不活跃用户统计", description = "不活跃用户统计")
|
||||
@PostMapping("/page-join-active")
|
||||
public R<Page<WalletManageVo>> pageJoinActive(@ParameterObject Page page, @RequestBody WalletTopupActionDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletManageService.pageJoinActive(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "不活跃用户统计list", description = "不活跃用户统计list")
|
||||
@PostMapping("/list-list-active")
|
||||
public R<List<WalletManageVo>> listActive(@RequestBody WalletTopupActionDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletManageService.pageListActive(dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletManage_view')")
|
||||
|
||||
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user