Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
96bf268be9
24 files changed
+804
-6
No files matched your search
@@ -708,4 +708,53 @@ CREATE TABLE mch_pick_up_join
|
||||
mch_id bigint NOT NULL COMMENT '商户id',
|
||||
mch_pick_up_id bigint NOT NULL COMMENT '自提点id',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='商户自提点关联表';
|
||||
) ENGINE = InnoDB COMMENT ='商户自提点关联表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for integral_manage
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS integral_manage;
|
||||
CREATE TABLE integral_manage
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '创建者',
|
||||
|
||||
user_id bigint default NULL COMMENT '用户id',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
|
||||
integral_num int NOT NULL DEFAULT 0 COMMENT '积分总数',
|
||||
total_expense int NOT NULL DEFAULT 0 COMMENT '累计积分支出',
|
||||
total_recharge int NOT NULL DEFAULT 0 COMMENT '累计积分获得',
|
||||
integral_freeze int NOT NULL DEFAULT 0 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 COMMENT ='积分管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for integral_transaction
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS integral_transaction;
|
||||
CREATE TABLE integral_transaction
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '创建者',
|
||||
integral_id bigint NOT NULL COMMENT '积分总数',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
biz_type varchar(256) NOT NULL COMMENT '关联类型',
|
||||
biz_id varchar(64) NOT NULL COMMENT '关联业务编号',
|
||||
title varchar(128) NOT NULL COMMENT '流水标题',
|
||||
integral_num int NOT NULL COMMENT '流水积分',
|
||||
integral_balance int NOT 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 '修改人',
|
||||
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 COMMENT ='积分记录';
|
||||
+6
-1
@@ -9,6 +9,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
* 外卖状态 100(待接单(外卖))->110(配送中(外卖))-> 200(已核销(已完成))
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@@ -18,8 +19,12 @@ public enum HardOrderStatusEnum {
|
||||
PAY("5", "已经支付"),
|
||||
OFFLINE_PAY("6", "没有网络本地支付"),
|
||||
REFUND("10", "退款"),
|
||||
CANCEL("20", "已核销"),
|
||||
CANCEL("20", "已核销(已完成)"),
|
||||
UNFOLLOW("30", "已取消(智能柜)"),
|
||||
|
||||
TAKE_OUT_AWAIT("100", "待接单(外卖)"),
|
||||
TAKE_OUT_ING("110", "配送中(外卖)"),
|
||||
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public enum HardOrderTypeEnum {
|
||||
|
||||
public static HardOrderTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public static final List<HardOrderTypeEnum> refundList = List.of(BELOW, RESERVE, FOREIGN_TICKET, ZY, LB, FARMER, XFJ, TAKE_OUT);
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.remote;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardUpdateTakeOutStatusDto {
|
||||
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private HardUpdateTakeOutStatusDto.TakeOutStatus status;
|
||||
|
||||
public enum TakeOutStatus {
|
||||
// 配送中
|
||||
TAKE_OUT_ING,
|
||||
// 已完成
|
||||
DONE,
|
||||
// 退款
|
||||
REFUND,
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -5,6 +5,7 @@ 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.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateTakeOutStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -27,4 +28,8 @@ public interface RemoteHardOrderService {
|
||||
@NoToken
|
||||
@GetMapping("/hard-order/mch-count-by-id")
|
||||
R<Long> getMchCountById(@RequestParam Long id);
|
||||
|
||||
@NoToken
|
||||
@PostMapping("/hard-order/update-take-out-status")
|
||||
R<Boolean> updateTakeOutStatus(@RequestBody HardUpdateTakeOutStatusDto dto);
|
||||
}
|
||||
+10
-2
@@ -37,6 +37,7 @@ import com.bsd.pjcloud.hard.api.dto.order.act.HardCreateActOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateFarmerOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateTakeOutOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateTakeOutStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.excel.HardOrderExcelVo;
|
||||
@@ -92,7 +93,7 @@ public class HardOrderController {
|
||||
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
@Inner
|
||||
@Operation(summary = "app查询订单列表", description = "app查询订单列表")
|
||||
@Operation(summary = "查询订单列表", description = "查询订单列表")
|
||||
@GetMapping("/get-by-ids")
|
||||
public R<List<HardOrderEntity>> getByIds(@RequestParam List<Long> ids) {
|
||||
HardOrderDto dto = new HardOrderDto();
|
||||
@@ -101,7 +102,7 @@ public class HardOrderController {
|
||||
}
|
||||
|
||||
@Inner
|
||||
@Operation(summary = "app查询订单列表", description = "app查询订单列表")
|
||||
@Operation(summary = "查询订单", description = "查询订单")
|
||||
@GetMapping("/mch-count-by-id")
|
||||
public R<Long> getMchCountById(@RequestParam Long id) {
|
||||
LambdaQueryWrapper<HardOrderEntity> query = new LambdaQueryWrapper<HardOrderEntity>().eq(HardOrderEntity::getMerchantId, id);
|
||||
@@ -109,6 +110,13 @@ public class HardOrderController {
|
||||
if (ObjectUtil.isEmpty(count)) count = 0L;
|
||||
return R.ok(count);
|
||||
}
|
||||
|
||||
@Inner
|
||||
@Operation(summary = "更改外卖订单状态", description = "更改外卖订单状态")
|
||||
@PostMapping("/update-take-out-status")
|
||||
public R<Boolean> updateTakeOutStatus(@RequestBody HardUpdateTakeOutStatusDto dto) {
|
||||
return R.ok(hardwareOrderService.updateTakeOutStatus(dto));
|
||||
}
|
||||
/* ************************************* end 远程调用 ************************************* */
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
+6
@@ -18,6 +18,7 @@ import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.act.HardCreateActOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateFarmerOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateTakeOutStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.xfj.HardXfjFastCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
@@ -74,6 +75,11 @@ public interface HardOrderService extends IService<HardOrderEntity> {
|
||||
*/
|
||||
Long appCreateTakeOutOrder(HardAppCreateOrderDto createOrderDto);
|
||||
|
||||
/**
|
||||
* 更改外卖订单状态
|
||||
*/
|
||||
Boolean updateTakeOutStatus(HardUpdateTakeOutStatusDto dto);
|
||||
|
||||
/**
|
||||
* app创建线上超市预定订单
|
||||
*/
|
||||
|
||||
+43
-1
@@ -52,6 +52,7 @@ import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.act.HardCreateActOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateFarmerOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateTakeOutStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.xfj.HardXfjFastCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.spu.DeductionSpuStockDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.wechat.WechantReverseDto;
|
||||
@@ -643,7 +644,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
.userDeptId(userDetail.getSysUser().getDeptId())
|
||||
.parentCarId(dto.getCarParentId())
|
||||
.sysType(dto.getHardType().getType())
|
||||
.orderStatus(HardOrderStatusEnum.CREATE.getType())
|
||||
.orderStatus(HardOrderStatusEnum.TAKE_OUT_AWAIT.getType())
|
||||
.merchantId(parentCar.getMerchantId())
|
||||
.merchantType(hardManager.getTypes())
|
||||
.merchantDeptId(hardManager.getDeptId())
|
||||
@@ -705,6 +706,47 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
return orderObj.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改外卖订单状态
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateTakeOutStatus(HardUpdateTakeOutStatusDto dto) {
|
||||
// 查询订单
|
||||
HardOrderEntity order = baseMapper.selectById(dto.getOrderId());
|
||||
if (ObjectUtil.isEmpty(order)) {
|
||||
throw new RuntimeException("订单不存在");
|
||||
}
|
||||
// 是否为外卖订单
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
if (ObjectUtil.isEmpty(orderTypeEnum) || ObjectUtil.notEqual(orderTypeEnum, HardOrderTypeEnum.TAKE_OUT)) {
|
||||
throw new RuntimeException("订单类型错误");
|
||||
}
|
||||
HardOrderStatusEnum orderStatus = null;
|
||||
switch (dto.getStatus()) {
|
||||
case TAKE_OUT_ING:
|
||||
orderStatus = HardOrderStatusEnum.TAKE_OUT_ING;
|
||||
break;
|
||||
case DONE:
|
||||
orderStatus = HardOrderStatusEnum.CANCEL;
|
||||
break;
|
||||
case REFUND:
|
||||
orderStatus = HardOrderStatusEnum.REFUND;
|
||||
break;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(orderStatus)) {
|
||||
throw new RuntimeException("订单状态错误");
|
||||
}
|
||||
// 执行退款
|
||||
if (ObjectUtil.equals(orderStatus, HardOrderStatusEnum.REFUND)) {
|
||||
|
||||
}
|
||||
HardOrderEntity updateOrderObj = new HardOrderEntity();
|
||||
updateOrderObj.setId(order.getId());
|
||||
updateOrderObj.setOrderStatus(orderStatus.getType());
|
||||
baseMapper.updateById(updateOrderObj);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* app创建线上超市预定订单
|
||||
*/
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralManageDto extends IntegralManageEntity {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralTransactionDto extends IntegralTransactionEntity {
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.integral;
|
||||
|
||||
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("integral_manage")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户积分")
|
||||
public class IntegralManageEntity extends Model<IntegralManageEntity> {
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "创建者")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 积分总数
|
||||
*/
|
||||
@Schema(description = "积分总数")
|
||||
private Integer integralNum;
|
||||
|
||||
/**
|
||||
* 累计积分支出
|
||||
*/
|
||||
@Schema(description = "累计积分支出")
|
||||
private Integer totalExpense;
|
||||
|
||||
/**
|
||||
* 累计积分获得
|
||||
*/
|
||||
@Schema(description = "累计积分获得")
|
||||
private Integer totalRecharge;
|
||||
|
||||
/**
|
||||
* 冻结积分数
|
||||
*/
|
||||
@Schema(description = "冻结积分数")
|
||||
private Integer integralFreeze;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.integral;
|
||||
|
||||
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("integral_transaction")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "积分记录")
|
||||
public class IntegralTransactionEntity extends Model<IntegralTransactionEntity> {
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "创建者")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 积分总数
|
||||
*/
|
||||
@Schema(description = "积分总数")
|
||||
private Long integralId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 关联类型
|
||||
*/
|
||||
@Schema(description = "关联类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 关联业务编号
|
||||
*/
|
||||
@Schema(description = "关联业务编号")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 流水标题
|
||||
*/
|
||||
@Schema(description = "流水标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 流水积分
|
||||
*/
|
||||
@Schema(description = "流水积分")
|
||||
private Integer integralNum;
|
||||
|
||||
/**
|
||||
* 积分余额
|
||||
*/
|
||||
@Schema(description = "积分余额")
|
||||
private Integer integralBalance;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralManageVo extends IntegralManageEntity {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralTransactionVo extends IntegralTransactionEntity {
|
||||
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.bsd.pjcloud.wallet.controller.Integral;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
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.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
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("/integral-manage")
|
||||
@Tag(description = "integralManage", name = "用户积分管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class IntegralManageController {
|
||||
|
||||
private final IntegralManageService integralManageService;
|
||||
|
||||
/**
|
||||
* 查询分页页面
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_view')")
|
||||
public R<Page<IntegralManageVo>> getIntegralManagePage(@ParameterObject Page page, @ParameterObject IntegralManageDto dto) {
|
||||
return R.ok(integralManageService.scopePageList(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询用户积分
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(integralManageService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户积分
|
||||
*/
|
||||
@Operation(summary = "新增用户积分", description = "新增用户积分")
|
||||
@SysLog("新增用户积分")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_add')")
|
||||
public R save(@RequestBody IntegralManageEntity integralManage) {
|
||||
return R.ok(integralManageService.save(integralManage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户积分
|
||||
*/
|
||||
@Operation(summary = "修改用户积分", description = "修改用户积分")
|
||||
@SysLog("修改用户积分")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_edit')")
|
||||
public R updateById(@RequestBody IntegralManageEntity integralManage) {
|
||||
return R.ok(integralManageService.updateById(integralManage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除用户积分
|
||||
*/
|
||||
@Operation(summary = "通过id删除用户积分", description = "通过id删除用户积分")
|
||||
@SysLog("通过id删除用户积分")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(integralManageService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_export')")
|
||||
public List<IntegralManageEntity> export(IntegralManageEntity integralManage, Long[] ids) {
|
||||
return integralManageService.list(Wrappers.lambdaQuery(integralManage).in(ArrayUtil.isNotEmpty(ids), IntegralManageEntity::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.bsd.pjcloud.wallet.controller.Integral;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
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.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralTransactionService;
|
||||
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.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 积分记录
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/integralTransaction")
|
||||
@Tag(description = "integralTransaction", name = "积分记录管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class IntegralTransactionController {
|
||||
|
||||
private final IntegralTransactionService integralTransactionService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_view')")
|
||||
public R getIntegralTransactionPage(@ParameterObject Page page, @ParameterObject IntegralTransactionDto dto) {
|
||||
return R.ok(integralTransactionService.scopePageList(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询积分记录
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(integralTransactionService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增积分记录
|
||||
*/
|
||||
@Operation(summary = "新增积分记录", description = "新增积分记录")
|
||||
@SysLog("新增积分记录")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_add')")
|
||||
public R save(@RequestBody IntegralTransactionEntity integralTransaction) {
|
||||
return R.ok(integralTransactionService.save(integralTransaction));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分记录
|
||||
*/
|
||||
@Operation(summary = "修改积分记录", description = "修改积分记录")
|
||||
@SysLog("修改积分记录")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_edit')")
|
||||
public R updateById(@RequestBody IntegralTransactionEntity integralTransaction) {
|
||||
return R.ok(integralTransactionService.updateById(integralTransaction));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除积分记录
|
||||
*/
|
||||
@Operation(summary = "通过id删除积分记录", description = "通过id删除积分记录")
|
||||
@SysLog("通过id删除积分记录")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(integralTransactionService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_export')")
|
||||
public List<IntegralTransactionEntity> export(IntegralTransactionEntity integralTransaction, Long[] ids) {
|
||||
return integralTransactionService.list(Wrappers.lambdaQuery(integralTransaction).in(ArrayUtil.isNotEmpty(ids), IntegralTransactionEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface IntegralManageMapper extends PjcloudBaseMapper<IntegralManageEntity> {
|
||||
|
||||
Page<IntegralManageVo> scopePageList(Page page, @Param("dto") IntegralManageDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface IntegralTransactionMapper extends PjcloudBaseMapper<IntegralTransactionEntity> {
|
||||
|
||||
Page<IntegralTransactionVo> scopePageList(Page page, @Param("dto") IntegralTransactionDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
|
||||
public interface IntegralManageService extends IService<IntegralManageEntity> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
Page<IntegralManageVo> scopePageList(Page page, IntegralManageDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
|
||||
public interface IntegralTransactionService extends IService<IntegralTransactionEntity> {
|
||||
|
||||
Page<IntegralTransactionVo> scopePageList(Page page, IntegralTransactionDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.integral.IntegralManageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper, IntegralManageEntity> implements IntegralManageService {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public Page<IntegralManageVo> scopePageList(Page page, IntegralManageDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageList(page, dto, dataScope);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.integral.IntegralTransactionMapper;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralTransactionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 积分记录
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class IntegralTransactionServiceImpl extends ServiceImpl<IntegralTransactionMapper, IntegralTransactionEntity> implements IntegralTransactionService {
|
||||
|
||||
@Override
|
||||
public Page<IntegralTransactionVo> scopePageList(Page page, IntegralTransactionDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageList(page, dto, dataScope);
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?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.wallet.mapper.integral.IntegralManageMapper">
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.dept_id,
|
||||
a.integral_num,
|
||||
a.total_expense,
|
||||
a.total_recharge,
|
||||
a.integral_freeze,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.userId != null">
|
||||
and a.user_id = #{dto.userId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo">
|
||||
<include refid="selectA"/>
|
||||
from integral_manage a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?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.wallet.mapper.integral.IntegralTransactionMapper">
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.integral_id,
|
||||
a.dept_id,
|
||||
a.biz_type,
|
||||
a.biz_id,
|
||||
a.title,
|
||||
a.integral_num,
|
||||
a.integral_balance,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.integralId != null">
|
||||
and a.integral_id = #{dto.integralId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo">
|
||||
<include refid="selectA"/>
|
||||
from integral_transaction a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user