微信支付

pull/2/head
perry 2023-05-19 17:49:39 +08:00
parent 59841c23b4
commit 04e0f33ad3
33 changed files with 309 additions and 48 deletions

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.shop.controller.admin.recharge; package cn.iocoder.yudao.module.shop.controller.admin.recharge;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.method.Excel; import cn.iocoder.yudao.module.shop.controller.admin.recharge.method.Excel;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderInfoConvert; import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderInfoConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
@ -46,7 +48,7 @@ public class RechargeOrderController {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建订单") @Operation(summary = "创建订单")
@PreAuthorize("@ss.hasPermission('shop:recharge-order:create')") @PreAuthorize("@ss.hasPermission('shop:recharge-order:create')")
public CommonResult<Integer> createRechargeOrder(@Valid @RequestBody RechargeOrderCreateReqVO createReqVO) { public CommonResult<Long> createRechargeOrder(@Valid @RequestBody RechargeOrderCreateReqVO createReqVO) {
return success(rechargeOrderService.createRechargeOrder(createReqVO)); return success(rechargeOrderService.createRechargeOrder(createReqVO));
} }
@ -88,7 +90,9 @@ public class RechargeOrderController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得订单分页") @Operation(summary = "获得订单分页")
@PreAuthorize("@ss.hasPermission('shop:recharge-order:query')") @PreAuthorize("@ss.hasPermission('shop:recharge-order:query')")
@TenantIgnore
public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) { public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) {
pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO); PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO);
return success(pageResult); return success(pageResult);
} }
@ -98,18 +102,17 @@ public class RechargeOrderController {
@Operation(summary = "导出订单 Excel") @Operation(summary = "导出订单 Excel")
@PreAuthorize("@ss.hasPermission('shop:recharge-order:export')") @PreAuthorize("@ss.hasPermission('shop:recharge-order:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
@TenantIgnore
public void exportRechargeOrderExcel(@Valid RechargeOrderExportReqVO exportReqVO, public void exportRechargeOrderExcel(@Valid RechargeOrderExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
List<RechargeOrderDO> list = rechargeOrderService.getRechargeOrderList(exportReqVO); List<RechargeOrderExcelVO> list = rechargeOrderService.findListExcel(exportReqVO);
ArrayList<String> s = new ArrayList<>(); ArrayList<Long> s = new ArrayList<>();
list.forEach(x -> { list.forEach(x -> {
s.add(x.getOrderId()); s.add(x.getId());
}); });
List<RechargeOrderInfoDO> infoList = rechargeOrderInfoService.getRechargeOrderInfoList(s); List<RechargeOrderInfoExcelVO> infoList = rechargeOrderInfoService.getRechargeOrderInfoListExcel(s);
// 导出 Excel // 导出 Excel
List<RechargeOrderExcelVO> datas = RechargeOrderConvert.INSTANCE.convertList02(list);
List<RechargeOrderInfoExcelVO> infoDatas = RechargeOrderInfoConvert.INSTANCE.convertList02(infoList);
Excel.orderExport(response, datas, infoDatas); Excel.orderExport(response, list, infoList);
} }
} }

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -24,6 +26,13 @@ public class RechargeGearBaseVO {
@Schema(description = "档位显示金额", required = true) @Schema(description = "档位显示金额", required = true)
@NotNull(message = "档位显示金额不能为空") @NotNull(message = "档位显示金额不能为空")
private Integer gearAmount; private BigDecimal gearAmount;
/**
*
*/
@Schema(description = "返费金额", required = true)
@NotNull(message = "返费金额不能为空")
private BigDecimal refundAmount;
} }

View File

@ -14,36 +14,43 @@ import java.time.LocalDateTime;
@Data @Data
public class RechargeOrderExcelVO { public class RechargeOrderExcelVO {
@ExcelProperty("订单号")
@ExcelProperty("订单id")
private Long id;
@ExcelProperty("订单编号")
private String orderId; private String orderId;
@ExcelProperty("第三方支付流水号") @ExcelProperty("交易流水号")
private String paySerialNumber; private String paySerialNumber;
@ExcelProperty("商户名称")
private String tenantName;
@ExcelProperty("支付时间") @ExcelProperty("订单支付时间")
private LocalDateTime payTime; private LocalDateTime payTime;
//:0-普通订单1-视频号订单
@ExcelProperty("交易完成时间")
private LocalDateTime payCompleteTime;
@ExcelProperty("订单类型") @ExcelProperty("订单类型")
private Integer type; private String type="普通订单";
//0待发货1待收货2已收货待评价3已完成
@ExcelProperty("订单状态") @ExcelProperty("订单状态")
private String status; private String status="已经完成";
@ExcelProperty("配送方式") @ExcelProperty("配送方式")
private String deliveryType; private String deliveryType="快递(系统快递)(系统快递)";
@ExcelProperty("用户姓名") @ExcelProperty("姓名")
private String realName; private String realName;
@ExcelProperty("用户电话") @ExcelProperty("充值号码")
private String userPhone; private String userPhone;
@ExcelProperty("确认手机号") @ExcelProperty("确认")
private String confirmPhone; private String confirmPhone;
@ExcelProperty("地址") @ExcelProperty("地址")
private String address; private String address;
@ExcelProperty("备注") @ExcelProperty("给卖家留言")
private String mark; private String mark;
@ExcelProperty("取货地址") @ExcelProperty("取货地址")
@ -59,7 +66,7 @@ public class RechargeOrderExcelVO {
private String remark; private String remark;
@ExcelProperty("产品合计金额") @ExcelProperty("产品合计金额")
private BigDecimal proTotalPrice; private BigDecimal totalPrice;
@ExcelProperty("运费") @ExcelProperty("运费")
private BigDecimal shipPrice; private BigDecimal shipPrice;
@ -74,6 +81,6 @@ public class RechargeOrderExcelVO {
private String promoter; private String promoter;
@ExcelProperty("组织名称") @ExcelProperty("组织名称")
private Integer depName; private String depName;
} }

View File

@ -18,12 +18,19 @@ public class RechargeOrderExportReqVO {
@Schema(description = "订单号", example = "3697") @Schema(description = "订单号", example = "3697")
private String orderId; private String orderId;
@Schema(description = "租户id")
private Long tenantId;
@Schema(description = "用户id", example = "28969") @Schema(description = "用户id", example = "28969")
private Integer uid; private Integer uid;
@Schema(description = "用户姓名", example = "张三") @Schema(description = "用户姓名", example = "张三")
private String realName; private String realName;
@Schema(description = "推广员名称", example = "张三")
private String nickname;
@Schema(description = "用户电话") @Schema(description = "用户电话")
private String userPhone; private String userPhone;

View File

@ -18,7 +18,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
@Data @Data
public class RechargeOrderInfoExcelVO { public class RechargeOrderInfoExcelVO {
@ExcelProperty("订单号") @ExcelProperty("订单号")
private String orderNo; private String orderNo;
@ExcelProperty("商户名称") @ExcelProperty("商户名称")
@ -31,18 +31,19 @@ public class RechargeOrderInfoExcelVO {
private String shopOption; private String shopOption;
@ExcelProperty("产品分类") @ExcelProperty("产品分类")
private String productCategory; private String productCategory="话费";
@ExcelProperty("产品") @ExcelProperty("产品价")
private BigDecimal price; private BigDecimal price;
@ExcelProperty("产品数量") @ExcelProperty("产品数量")
private Integer payNum; private Integer payNum=1;
@ExcelProperty("配送价格/运费")
private BigDecimal freight=new BigDecimal(0);
@ExcelProperty("合计金额") @ExcelProperty("合计金额")
private BigDecimal proTotalPrice; private BigDecimal proTotalPrice;
@ExcelProperty("付金额") @ExcelProperty("付金额")
private BigDecimal payPrice; private BigDecimal payPrice;
@ExcelProperty("售后状态") @ExcelProperty("售后状态")

View File

@ -20,6 +20,9 @@ public class RechargeOrderPageReqVO extends PageParam {
@Schema(description = "订单号", example = "3697") @Schema(description = "订单号", example = "3697")
private String orderId; private String orderId;
@Schema(description = "租户id")
private Long tenantId;
@Schema(description = "用户id", example = "28969") @Schema(description = "用户id", example = "28969")
private Integer uid; private Integer uid;

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.shop.controller.app.banner;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.shop.controller.admin.banner.vo.BannerPageReqVO;
import cn.iocoder.yudao.module.shop.controller.admin.banner.vo.BannerRespVO;
import cn.iocoder.yudao.module.shop.convert.banner.BannerConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.banner.BannerDO;
import cn.iocoder.yudao.module.shop.service.banner.BannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "用户APP - 商户Banner 管理")
@RestController
@RequestMapping("/market/banner")
@Validated
public class AppBannerController {
@Resource
private BannerService bannerService;
@PostMapping("/list")
@Operation(summary = "获得 Banner 列表")
public CommonResult<PageResult<BannerRespVO>> getBannerList(@RequestBody@Valid BannerPageReqVO pageVO) {
pageVO.setTenantId(TenantContextHolder.getTenantId());
pageVO.setPageSize(5);
PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO);
return success(BannerConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.shop.dal.dataobject.recharge; package cn.iocoder.yudao.module.shop.dal.dataobject.recharge;
import lombok.*; import lombok.*;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -38,6 +40,12 @@ public class RechargeGearDO extends BaseDO {
/** /**
* *
*/ */
private Integer gearAmount; private BigDecimal gearAmount;
/**
*
*/
private BigDecimal refundAmount;
} }

View File

@ -36,7 +36,7 @@ public class RechargeOrderDO extends TenantBaseDO {
* ID * ID
*/ */
@TableId(type=IdType.ASSIGN_ID) @TableId(type=IdType.ASSIGN_ID)
private Integer id; private Long id;
/** /**
* *
*/ */

View File

@ -33,7 +33,7 @@ public class RechargeOrderInfoDO extends TenantBaseDO {
/** /**
* id * id
*/ */
private Integer rechargeOrderId; private Long rechargeOrderId;
/** /**
* *
*/ */

View File

@ -26,7 +26,7 @@ public class RefundFeeRecordDO extends BaseDO {
/** /**
* *
*/ */
@TableId @TableId(type = IdType.ASSIGN_ID)
private Long id; private Long id;
/** /**
* id * id

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -54,4 +55,7 @@ public interface RechargeOrderInfoMapper extends BaseMapperX<RechargeOrderInfoDO
} }
List<RechargeOrderInfoExcelVO> getRechargeOrderInfoListExcel(@Param("ids") List<Long> ids);
} }

View File

@ -57,6 +57,9 @@ public interface RechargeOrderMapper extends BaseMapperX<RechargeOrderDO> {
.orderByDesc(RechargeOrderDO::getId)); .orderByDesc(RechargeOrderDO::getId));
} }
IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data); IPage<RechargeOrderRespVO> findListPage(IPage<RechargeOrderRespVO> page, @Param("data") RechargeOrderPageReqVO data);
List<RechargeOrderExcelVO> findListExcel(@Param("data") RechargeOrderExportReqVO data);
default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) { default List<RechargeOrderDO> selectList(RechargeOrderExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<RechargeOrderDO>() return selectList(new LambdaQueryWrapperX<RechargeOrderDO>()
.eqIfPresent(RechargeOrderDO::getOrderId, reqVO.getOrderId()) .eqIfPresent(RechargeOrderDO::getOrderId, reqVO.getOrderId())

View File

@ -67,6 +67,6 @@ public interface RechargeOrderInfoService {
*/ */
List<RechargeOrderInfoDO> getRechargeOrderInfoList(RechargeOrderInfoExportReqVO exportReqVO); List<RechargeOrderInfoDO> getRechargeOrderInfoList(RechargeOrderInfoExportReqVO exportReqVO);
List<RechargeOrderInfoDO> getRechargeOrderInfoList(List<String> ids); List<RechargeOrderInfoExcelVO> getRechargeOrderInfoListExcel(List<Long> ids);
} }

View File

@ -81,8 +81,8 @@ public class RechargeOrderInfoServiceImpl implements RechargeOrderInfoService {
} }
@Override @Override
public List<RechargeOrderInfoDO> getRechargeOrderInfoList(List<String> s) { public List<RechargeOrderInfoExcelVO> getRechargeOrderInfoListExcel(List<Long> s) {
return rechargeOrderInfoMapper.selectList(s); return rechargeOrderInfoMapper.getRechargeOrderInfoListExcel(s);
} }
} }

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse; import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
import org.apache.ibatis.annotations.Param;
/** /**
* Service * Service
@ -20,7 +21,7 @@ public interface RechargeOrderService {
* @param createReqVO * @param createReqVO
* @return * @return
*/ */
Integer createRechargeOrder(@Valid RechargeOrderCreateReqVO createReqVO); Long createRechargeOrder(@Valid RechargeOrderCreateReqVO createReqVO);
/** /**
* *
@ -68,6 +69,8 @@ public interface RechargeOrderService {
*/ */
List<RechargeOrderDO> getRechargeOrderList(RechargeOrderExportReqVO exportReqVO); List<RechargeOrderDO> getRechargeOrderList(RechargeOrderExportReqVO exportReqVO);
List<RechargeOrderExcelVO> findListExcel(RechargeOrderExportReqVO data);
List<RechargeOrderRespVO> memberOrderInfo(); List<RechargeOrderRespVO> memberOrderInfo();
MemberHeadResponse memberHeadInfo(); MemberHeadResponse memberHeadInfo();

View File

@ -45,7 +45,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
private RechargeOrderInfoMapper infoMapper; private RechargeOrderInfoMapper infoMapper;
@Override @Override
public Integer createRechargeOrder(RechargeOrderCreateReqVO createReqVO) { public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
// 插入 // 插入
RechargeOrderDO rechargeOrder = RechargeOrderConvert.INSTANCE.convert(createReqVO); RechargeOrderDO rechargeOrder = RechargeOrderConvert.INSTANCE.convert(createReqVO);
rechargeOrderMapper.insert(rechargeOrder); rechargeOrderMapper.insert(rechargeOrder);
@ -98,6 +98,11 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
return rechargeOrderMapper.selectList(exportReqVO); return rechargeOrderMapper.selectList(exportReqVO);
} }
@Override
public List<RechargeOrderExcelVO> findListExcel(RechargeOrderExportReqVO data) {
return rechargeOrderMapper.findListExcel(data);
}
@Override @Override
public List<RechargeOrderRespVO> memberOrderInfo() { public List<RechargeOrderRespVO> memberOrderInfo() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();

View File

@ -9,4 +9,33 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
<select id="getRechargeOrderInfoListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderInfoExcelVO">
select
a.order_id as 'orderNo',
e.name as tenantName,
f.product_name as 'productName',
f.price,
f.price as proTotalPrice,
f.price as payPrice,
a.refund_status as afterStatus,
f.price as refundPrice,
a.uid as 'vipAccount',
a.real_name as vipName
from cy_recharge_order_info f
left join cy_recharge_order a on a.id = f.recharge_order_id
left join member_user b on a.promoter_id = b.id
left join system_dept d on d.id = a.dept_id
left join system_tenant e on a.promoter_id = b.id
<where>
<if test="ids!=null and ids.size>0">
f.recharge_order_id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -22,6 +22,8 @@
a.user_phone, a.user_phone,
a.confirm_phone, a.confirm_phone,
a.pay_type, a.pay_type,
a.total_price,
a.pay_price,
a.paid, a.paid,
d.parent_organization_name d.parent_organization_name
from cy_recharge_order a from cy_recharge_order a
@ -33,11 +35,14 @@
<if test="data.orderId !=null and data.orderId!=''"> <if test="data.orderId !=null and data.orderId!=''">
and a.order_id like CONCAT('%',#{data.orderId},'%') and a.order_id like CONCAT('%',#{data.orderId},'%')
</if> </if>
<if test="data.payserialNumber !=null and data.payserialNumber!=''"> <if test="data.tenantId !=null and data.tenantId!=1">
and a.pay_serial_number like CONCAT('%',#{data.payserialNumber},'%') and a.tenant_id =#{data.tenantId}
</if>
<if test="data.paySerialNumber !=null and data.paySerialNumber!=''">
and a.pay_serial_number like CONCAT('%',#{data.paySerialNumber},'%')
</if> </if>
<if test="data.nickname !=null and data.nickname!=''"> <if test="data.nickname !=null and data.nickname!=''">
and a.nickname like CONCAT('%',#{data.nickname},'%') and b.nickname like CONCAT('%',#{data.nickname},'%')
</if> </if>
<if test="data.realName !=null and data.realName!=''"> <if test="data.realName !=null and data.realName!=''">
and a.real_name like CONCAT('%',#{data.realName},'%') and a.real_name like CONCAT('%',#{data.realName},'%')
@ -53,4 +58,82 @@
</if> </if>
</where> </where>
</select> </select>
<select id="findListPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
select
a.order_id,
a.pay_serial_number,
a.out_trade_no,
a.pay_time,
b.nickname,
a.real_name,
a.uid,
a.user_phone,
a.confirm_phone,
a.pay_type,
a.total_price,
a.pay_price,
a.paid,
d.parent_organization_name
from cy_recharge_order a
left join member_user b on a.promoter_id = b.id
left join member_promoter c on a.promoter_id=c.user_id
left join system_dept d on d.id = c.dept_id
<include refid="baseWhere">
</include>
</select>
<select id="findListExcel" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO">
select
a.id,
a.order_id,
a.pay_serial_number,
e.name as tenantName,
a.pay_time,
a.pay_time as payCompleteTime,
a.real_name,
a.user_phone,
a.confirm_phone,
a.pay_type,
a.total_price,
a.pay_price,
a.uid,
a.real_name as vipName,
a.out_trade_no,
b.nickname as promoter,
d.parent_organization_name as 'depName'
from cy_recharge_order a
left join member_user b on a.promoter_id = b.id
left join system_dept d on d.id = a.dept_id
left join system_tenant e on a.promoter_id = b.id
<include refid="baseWhere">
</include>
</select>
<sql id="baseWhere">
<where>
and a.paid=1
<if test="data.orderId !=null and data.orderId!=''">
and a.order_id like CONCAT('%',#{data.orderId},'%')
</if>
<if test="data.tenantId !=null and data.tenantId!=1">
and a.tenant_id =#{data.tenantId}
</if>
<if test="data.paySerialNumber !=null and data.paySerialNumber!=''">
and a.pay_serial_number like CONCAT('%',#{data.paySerialNumber},'%')
</if>
<if test="data.nickname !=null and data.nickname!=''">
and b.nickname like CONCAT('%',#{data.nickname},'%')
</if>
<if test="data.realName !=null and data.realName!=''">
and a.real_name like CONCAT('%',#{data.realName},'%')
</if>
<if test="data.userPhone !=null and data.userPhone!=''">
and a.user_phone like CONCAT('%',#{data.userPhone},'%')
</if>
<if test="data.payTime !=null ">
and a.pay_time &gt;=#{data.payTime[0]}
</if>
<if test="data.payTime !=null ">
and a.pay_time &lt;=#{data.payTime[1]}
</if>
</where>
</sql>
</mapper> </mapper>

View File

@ -108,6 +108,7 @@ public class MemberUserApiImpl implements MemberUserApi {
} }
@Override @Override
@TenantIgnore
public PromoterDTO getPromoterDOByUserId(Long userId) { public PromoterDTO getPromoterDOByUserId(Long userId) {
PromoterDTO promoterDTO = new PromoterDTO(); PromoterDTO promoterDTO = new PromoterDTO();
PromoterDO promoterDO = promoterService.getPromoterDOByUserId(userId); PromoterDO promoterDO = promoterService.getPromoterDOByUserId(userId);

View File

@ -13,6 +13,9 @@ public class PromoterRespVO extends PromoterBaseVO {
private Long id; private Long id;
@Schema(description = "组织名称", required = true, example = "18443") @Schema(description = "组织名称", required = true, example = "18443")
private String orgName; private String orgName;
@Schema(description = "组织名称", required = true, example = "18443") @Schema(description = "用户id", required = true, example = "18443")
private String userId; private String userId;
@Schema(description = "组织简称", required = true, example = "18443")
private String deptName;
} }

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoReqVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
@ -76,6 +77,9 @@ public class AppUserController {
AppUserInfoRespVO appUserInfoRespVO = UserConvert.INSTANCE.convert(user); AppUserInfoRespVO appUserInfoRespVO = UserConvert.INSTANCE.convert(user);
if(promoterService.checkIsPromoterByUserId(getLoginUserId())){ if(promoterService.checkIsPromoterByUserId(getLoginUserId())){
appUserInfoRespVO.setUserType(UserTypeEnum.PROMOTER); appUserInfoRespVO.setUserType(UserTypeEnum.PROMOTER);
PromoterRespVO promoterRespVO = promoterService.getPromoterInfo(getLoginUserId());
appUserInfoRespVO.setDeptName(promoterRespVO.getDeptName());
appUserInfoRespVO.setParentDeptName(promoterRespVO.getOrgName());
}else{ }else{
appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER); appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER);
} }

View File

@ -12,6 +12,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class AppUserInfoRespVO { public class AppUserInfoRespVO {
@Schema(description = "用户id", required = true, example = "芋艿")
private Long userId;
@Schema(description = "用户昵称", required = true, example = "芋艿") @Schema(description = "用户昵称", required = true, example = "芋艿")
private String nickname; private String nickname;
@ -23,4 +25,10 @@ public class AppUserInfoRespVO {
@Schema(description = "用户类型", required = true, example = "15601691300") @Schema(description = "用户类型", required = true, example = "15601691300")
private UserTypeEnum userType; private UserTypeEnum userType;
@Schema(description = "组织", required = true, example = "15601691300")
private String deptName;
@Schema(description = "组织全称", required = true, example = "15601691300")
private String parentDeptName;
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.dal.dataobject.user;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
@ -29,7 +30,7 @@ public class MemberUserDO extends TenantBaseDO {
/** /**
* ID * ID
*/ */
@TableId @TableId(type = IdType.ASSIGN_ID)
private Long id; private Long id;
/** /**
* *

View File

@ -25,6 +25,9 @@ public interface PromoterMapper extends BaseMapperX<PromoterDO> {
.orderByDesc(PromoterDO::getId)); .orderByDesc(PromoterDO::getId));
} }
IPage<PromoterRespVO> findListPage(IPage<PromoterRespVO> page, @Param("data") PromoterPageReqVO data); IPage<PromoterRespVO> findListPage(IPage<PromoterRespVO> page, @Param("data") PromoterPageReqVO data);
PromoterRespVO getPromoterInfo(@Param("userId") Long userId);
default List<PromoterDO> selectList(PromoterExportReqVO reqVO) { default List<PromoterDO> selectList(PromoterExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PromoterDO>() return selectList(new LambdaQueryWrapperX<PromoterDO>()
.eqIfPresent(PromoterDO::getDeptId, reqVO.getDeptId()) .eqIfPresent(PromoterDO::getDeptId, reqVO.getDeptId())

View File

@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.member.controller.app.auth.vo.*;
import cn.iocoder.yudao.module.member.convert.auth.AuthConvert; import cn.iocoder.yudao.module.member.convert.auth.AuthConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
import cn.iocoder.yudao.module.member.service.promoter.PromoterService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService; import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.system.api.logger.LoginLogApi; import cn.iocoder.yudao.module.system.api.logger.LoginLogApi;
import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO;
@ -39,6 +40,7 @@ import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
/** /**
@ -69,6 +71,9 @@ public class MemberAuthServiceImpl implements MemberAuthService {
@Resource @Resource
private MemberUserMapper userMapper; private MemberUserMapper userMapper;
@Resource
private PromoterService promoterService;
@Override @Override
public AppAuthLoginRespVO login(AppAuthLoginReqVO reqVO) { public AppAuthLoginRespVO login(AppAuthLoginReqVO reqVO) {
// 使用手机 + 密码,进行登录。 // 使用手机 + 密码,进行登录。

View File

@ -77,6 +77,8 @@ public interface PromoterService {
*/ */
List<PromoterDO> getPromoterList(PromoterExportReqVO exportReqVO); List<PromoterDO> getPromoterList(PromoterExportReqVO exportReqVO);
PromoterRespVO getPromoterInfo(Long userId);
/** /**
* 广 * 广
* *
@ -85,6 +87,5 @@ public interface PromoterService {
* @return * @return
*/ */
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport); PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
PromoterDO getPromoterDOByUserId(Long userId); PromoterDO getPromoterDOByUserId(Long userId);
} }

View File

@ -161,6 +161,11 @@ public class PromoterServiceImpl implements PromoterService {
return promoterMapper.selectList(exportReqVO); return promoterMapper.selectList(exportReqVO);
} }
@Override
public PromoterRespVO getPromoterInfo(Long userId) {
return promoterMapper.getPromoterInfo(userId);
}
/** /**
* 广 * 广
* *

View File

@ -29,4 +29,14 @@
</where> </where>
</select> </select>
<select id="getPromoterInfo" resultType="cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO">
select a.id,a.user_id,a.dept_id,b.nickname,b.status,b.mobile,c.parent_organization_name as 'orgName',c.name as 'deptName' from member_promoter a
left join member_user b on a.user_id = b.id
left join system_dept c on c.id=a.dept_id
<where>
a.user_id=#{userId}
</where>
</select>
</mapper> </mapper>

View File

@ -115,6 +115,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import me.chanjar.weixin.mp.api.WxMpService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -36,6 +37,7 @@ public class TenantController {
@Resource @Resource
private TenantService tenantService; private TenantService tenantService;
@GetMapping("/get-id-by-name") @GetMapping("/get-id-by-name")
@PermitAll @PermitAll
@Operation(summary = "使用租户名,获得租户编号", description = "登录界面,根据用户的租户名,获得租户编号") @Operation(summary = "使用租户名,获得租户编号", description = "登录界面,根据用户的租户名,获得租户编号")
@ -108,6 +110,4 @@ public class TenantController {
List<TenantExcelVO> datas = TenantConvert.INSTANCE.convertList02(list); List<TenantExcelVO> datas = TenantConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "租户.xls", "数据", TenantExcelVO.class, datas); ExcelUtils.write(response, "租户.xls", "数据", TenantExcelVO.class, datas);
} }
} }

View File

@ -31,6 +31,8 @@
<el-table-column label="档位名称" align="center" prop="name" /> <el-table-column label="档位名称" align="center" prop="name" />
<el-table-column label="档位备注" align="center" prop="gearRemarks" /> <el-table-column label="档位备注" align="center" prop="gearRemarks" />
<el-table-column label="档位显示金额" align="center" prop="gearAmount" /> <el-table-column label="档位显示金额" align="center" prop="gearAmount" />
<el-table-column label="返费金额" align="center" prop="refundAmount" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
@ -58,6 +60,9 @@
<el-form-item label="显示金额" prop="gearAmount"> <el-form-item label="显示金额" prop="gearAmount">
<el-input v-model="form.gearAmount" placeholder="请输入显示金额" /> <el-input v-model="form.gearAmount" placeholder="请输入显示金额" />
</el-form-item> </el-form-item>
<el-form-item label="返费金额" prop="refundAmount">
<el-input v-model="form.refundAmount" placeholder="请输入返费金额" />
</el-form-item>
<el-form-item label="备注" prop="gearRemarks"> <el-form-item label="备注" prop="gearRemarks">
<el-input v-model="form.gearRemarks" placeholder="请输入备注" /> <el-input v-model="form.gearRemarks" placeholder="请输入备注" />
</el-form-item> </el-form-item>
@ -107,6 +112,7 @@ export default {
name: [{ required: true, message: "档位名称不能为空", trigger: "blur" }], name: [{ required: true, message: "档位名称不能为空", trigger: "blur" }],
gearRemarks: [{ required: true, message: "档位备注不能为空", trigger: "blur" }], gearRemarks: [{ required: true, message: "档位备注不能为空", trigger: "blur" }],
gearAmount: [{ required: true, message: "档位显示金额不能为空", trigger: "blur" }], gearAmount: [{ required: true, message: "档位显示金额不能为空", trigger: "blur" }],
refundAmount: [{ required: true, message: "档位显示金额不能为空", trigger: "blur" }],
} }
}; };
}, },

View File

@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="订单编号" prop="orderId"> <el-form-item label="订单编号" prop="orderId">
<el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
@ -45,7 +45,11 @@
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="订单编号" align="center" prop="orderId" /> <el-table-column label="订单编号" align="center" prop="orderId" />
<el-table-column label="交易流水号" align="center" prop="paySerialNumber" /> <el-table-column label="交易流水号" align="center" prop="paySerialNumber" />
<el-table-column label="订单支付时间" align="center" prop="payTime" width="180"/> <el-table-column label="订单支付时间" align="center" prop="payTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="推广员" align="center" prop="parentOrganizationName" > <el-table-column label="推广员" align="center" prop="parentOrganizationName" >
<template v-slot="scope"> <template v-slot="scope">
<span>{{ scope.row.parentOrganizationName }}-{{ scope.row.nickname }}</span> <span>{{ scope.row.parentOrganizationName }}-{{ scope.row.nickname }}</span>