Merge branch 'feature/mall_product' of http://117.33.142.185:3000/zenghuapei/cyywl_server into feature/mall_product
commit
d1c0e148bd
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
##前端部署
|
##前端部署
|
||||||
修改前端访问后端地址
|
修改前端访问后端地址
|
||||||
在 yudao-ui-admin 目录下,执行 npm run build:dev 命令,编译前端项目
|
在 yudao-ui-admin 目录下,执行 npm run build:prod 命令,编译前端项目
|
||||||
将打包的dist文件内容放nginx服务访问
|
将打包的dist文件内容放nginx服务访问
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class OrderContentRequest implements Serializable {
|
||||||
private static final long serialVersionUID = -4967251473044468810L;
|
private static final long serialVersionUID = -4967251473044468810L;
|
||||||
@Schema(description = "订单id")
|
@Schema(description = "订单id")
|
||||||
@NotNull(message = "挡位id不能为空")
|
@NotNull(message = "挡位id不能为空")
|
||||||
private Integer gearId;
|
private String gearId;
|
||||||
|
|
||||||
@Schema(description = "档位名称")
|
@Schema(description = "档位名称")
|
||||||
@NotEmpty(message = "挡位名称不能为空")
|
@NotEmpty(message = "挡位名称不能为空")
|
||||||
|
|
|
@ -22,9 +22,12 @@ import java.util.List;
|
||||||
public class InitOrderResponse implements Serializable {
|
public class InitOrderResponse implements Serializable {
|
||||||
private static final long serialVersionUID = 6894715033655337607L;
|
private static final long serialVersionUID = 6894715033655337607L;
|
||||||
|
|
||||||
@Schema(description = "h5_url")
|
@Schema(description = "微信返回参数h5_url")
|
||||||
private String h5Url;
|
private String h5Url;
|
||||||
|
|
||||||
@Schema(description ="二维码链接")
|
@Schema(description ="微信返回参数二维码链接")
|
||||||
private String codeUrl;
|
private String codeUrl;
|
||||||
|
|
||||||
|
@Schema(description ="支付宝返回参数")
|
||||||
|
private String body;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,10 +66,10 @@ public class BannerController {
|
||||||
return success(BannerConvert.INSTANCE.convert(banner));
|
return success(BannerConvert.INSTANCE.convert(banner));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@PostMapping("/page")
|
||||||
@Operation(summary = "获得 Banner 分页")
|
@Operation(summary = "获得 Banner 分页")
|
||||||
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
||||||
public CommonResult<PageResult<BannerRespVO>> getBannerPage(@Valid BannerPageReqVO pageVO) {
|
public CommonResult<PageResult<BannerRespVO>> getBannerPage(@RequestBody@Valid BannerPageReqVO pageVO) {
|
||||||
PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO);
|
PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO);
|
||||||
return success(BannerConvert.INSTANCE.convertPage(pageResult));
|
return success(BannerConvert.INSTANCE.convertPage(pageResult));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,11 @@ public class BannerPageReqVO extends PageParam {
|
||||||
@Schema(description = "标题")
|
@Schema(description = "标题")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多租户编号
|
||||||
|
*/
|
||||||
|
@Schema(description = "多租户编号")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
@Schema(description = "状态")
|
@Schema(description = "状态")
|
||||||
@InEnum(CommonStatusEnum.class)
|
@InEnum(CommonStatusEnum.class)
|
||||||
|
|
|
@ -29,12 +29,12 @@ public class AliPayNotifyController {
|
||||||
private StoreOrderService storeOrderService;
|
private StoreOrderService storeOrderService;
|
||||||
|
|
||||||
@PostMapping("pay_notify")
|
@PostMapping("pay_notify")
|
||||||
public CommonResult<Object> payNotify(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
public Object payNotify(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
||||||
return CommonResult.success(storeOrderService.aliNotify(request, params));
|
return storeOrderService.aliNotify(request, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("refund_notify")
|
@PostMapping("refund_notify")
|
||||||
public CommonResult<Object> refundNotify(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
public Object refundNotify(HttpServletRequest request, @RequestBody Map<String, String> params) {
|
||||||
return CommonResult.success(storeOrderService.refundNotify(request, params));
|
return storeOrderService.refundNotify(request, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result;
|
||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
@ -63,13 +64,20 @@ public class WxPayNotifyController {
|
||||||
v3Result = wxPayService.parseOrderNotifyV3Result(jsonData, this.getRequestHeader(request));
|
v3Result = wxPayService.parseOrderNotifyV3Result(jsonData, this.getRequestHeader(request));
|
||||||
WxPayOrderNotifyV3Result.DecryptNotifyResult result = v3Result.getResult();
|
WxPayOrderNotifyV3Result.DecryptNotifyResult result = v3Result.getResult();
|
||||||
log.info("支付通知=" + JSONUtil.toJsonPrettyStr(result));
|
log.info("支付通知=" + JSONUtil.toJsonPrettyStr(result));
|
||||||
|
if (StringUtils.equals("SUCCESS",result.getTradeType())) {
|
||||||
|
log.info("微信支付回调成功");
|
||||||
|
// 验证相关参数-金额
|
||||||
|
// 修改订单状态
|
||||||
|
// 写入
|
||||||
|
response.setStatus(HttpServletResponse.SC_OK);
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
// 通知应答码:HTTP应答状态码需返回5XX或4XX,同时需返回应答报文
|
// 通知应答码:HTTP应答状态码需返回5XX或4XX,同时需返回应答报文
|
||||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
return "";
|
return "failure";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,13 +123,21 @@ public class WxPayNotifyController {
|
||||||
WxPayRefundNotifyV3Result.DecryptNotifyResult result = v3Result.getResult();
|
WxPayRefundNotifyV3Result.DecryptNotifyResult result = v3Result.getResult();
|
||||||
log.info("退款通知=" + JSONUtil.toJsonPrettyStr(result));
|
log.info("退款通知=" + JSONUtil.toJsonPrettyStr(result));
|
||||||
//退款状态
|
//退款状态
|
||||||
|
if (StringUtils.equals("SUCCESS",result.getRefundId())) {
|
||||||
|
log.info("微信退款回调成功");
|
||||||
|
// 验证相关参数-金额
|
||||||
|
// 修改订单状态
|
||||||
|
// 写入
|
||||||
|
response.setStatus(HttpServletResponse.SC_OK);
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
// 通知应答码:HTTP应答状态码需返回5XX或4XX,同时需返回应答报文
|
// 通知应答码:HTTP应答状态码需返回5XX或4XX,同时需返回应答报文
|
||||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
return "";
|
|
||||||
|
return "failure";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package cn.iocoder.yudao.module.shop.controller.admin.recharge;
|
package cn.iocoder.yudao.module.shop.controller.admin.recharge;
|
||||||
|
|
||||||
|
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.dal.dataobject.recharge.RechargeOrderInfoDO;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.recharge.RechargeOrderInfoService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -36,6 +40,8 @@ public class RechargeOrderController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RechargeOrderService rechargeOrderService;
|
private RechargeOrderService rechargeOrderService;
|
||||||
|
@Resource
|
||||||
|
private RechargeOrderInfoService rechargeOrderInfoService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建订单")
|
@Operation(summary = "创建订单")
|
||||||
|
@ -87,6 +93,7 @@ public class RechargeOrderController {
|
||||||
return success(RechargeOrderConvert.INSTANCE.convertPage(pageResult));
|
return success(RechargeOrderConvert.INSTANCE.convertPage(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出订单 Excel")
|
@Operation(summary = "导出订单 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('shop:recharge-order:export')")
|
@PreAuthorize("@ss.hasPermission('shop:recharge-order:export')")
|
||||||
|
@ -94,9 +101,15 @@ public class RechargeOrderController {
|
||||||
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<RechargeOrderDO> list = rechargeOrderService.getRechargeOrderList(exportReqVO);
|
||||||
|
ArrayList<String> s = new ArrayList<>();
|
||||||
|
list.forEach(x -> {
|
||||||
|
s.add(x.getOrderId());
|
||||||
|
});
|
||||||
|
List<RechargeOrderInfoDO> infoList = rechargeOrderInfoService.getRechargeOrderInfoList(s);
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
List<RechargeOrderExcelVO> datas = RechargeOrderConvert.INSTANCE.convertList02(list);
|
List<RechargeOrderExcelVO> datas = RechargeOrderConvert.INSTANCE.convertList02(list);
|
||||||
ExcelUtils.write(response, "订单.xls", "数据", RechargeOrderExcelVO.class, datas);
|
List<RechargeOrderInfoExcelVO> infoDatas = RechargeOrderInfoConvert.INSTANCE.convertList02(infoList);
|
||||||
}
|
|
||||||
|
|
||||||
|
Excel.orderExport(response, datas, infoDatas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package cn.iocoder.yudao.module.shop.controller.admin.recharge.method;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderExcelVO;
|
||||||
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderInfoExcelVO;
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.ExcelWriter;
|
||||||
|
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
|
||||||
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
|
import com.google.common.net.HttpHeaders;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: ignite
|
||||||
|
* @Date: 2023/5/16 18:25
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public class Excel {
|
||||||
|
|
||||||
|
public static ExcelWriter orderExport(HttpServletResponse response, List<RechargeOrderExcelVO> z, List<RechargeOrderInfoExcelVO> x) throws IOException {
|
||||||
|
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
// 这里URLEncoder.encode可以防止中文乱码
|
||||||
|
String encodedFileName = URLEncoder.encode(System.currentTimeMillis() + "", StandardCharsets.UTF_8.name()).replaceAll("\\+", "%20");
|
||||||
|
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename*=utf-8''" + encodedFileName + ".xlsx");
|
||||||
|
|
||||||
|
|
||||||
|
ExcelWriterBuilder writerBuilder = EasyExcel.write(response.getOutputStream())
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy());
|
||||||
|
ExcelWriter excelWriter = writerBuilder.build();
|
||||||
|
|
||||||
|
WriteSheet writeSheet1 = EasyExcel.writerSheet(0, "订单列表").head(RechargeOrderExcelVO.class).build();
|
||||||
|
WriteSheet writeSheet2 = EasyExcel.writerSheet(1, "订单明细表").head(RechargeOrderInfoExcelVO.class).build();
|
||||||
|
|
||||||
|
excelWriter.write(z, writeSheet1);
|
||||||
|
excelWriter.write(x, writeSheet2);
|
||||||
|
|
||||||
|
excelWriter.finish();
|
||||||
|
return excelWriter;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,21 +1,10 @@
|
||||||
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
|
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单 Excel VO
|
* 订单 Excel VO
|
||||||
|
@ -25,14 +14,23 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@Data
|
@Data
|
||||||
public class RechargeOrderExcelVO {
|
public class RechargeOrderExcelVO {
|
||||||
|
|
||||||
@ExcelProperty("订单ID")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ExcelProperty("订单号")
|
@ExcelProperty("订单号")
|
||||||
private String orderId;
|
private String orderId;
|
||||||
|
|
||||||
@ExcelProperty("用户id")
|
@ExcelProperty("第三方支付流水号")
|
||||||
private Integer uid;
|
private String paySerialNumber;
|
||||||
|
|
||||||
|
@ExcelProperty("支付时间")
|
||||||
|
private LocalDateTime payTime;
|
||||||
|
//:0-普通订单,1-视频号订单
|
||||||
|
@ExcelProperty("订单类型")
|
||||||
|
private Integer type;
|
||||||
|
//(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)
|
||||||
|
@ExcelProperty("订单状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ExcelProperty("配送方式")
|
||||||
|
private String deliveryType;
|
||||||
|
|
||||||
@ExcelProperty("用户姓名")
|
@ExcelProperty("用户姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
@ -42,89 +40,40 @@ public class RechargeOrderExcelVO {
|
||||||
|
|
||||||
@ExcelProperty("确认手机号")
|
@ExcelProperty("确认手机号")
|
||||||
private String confirmPhone;
|
private String confirmPhone;
|
||||||
|
@ExcelProperty("地址")
|
||||||
@ExcelProperty("订单商品总数")
|
private String address;
|
||||||
private Integer totalNum;
|
|
||||||
|
|
||||||
@ExcelProperty("订单总价")
|
|
||||||
private BigDecimal totalPrice;
|
|
||||||
|
|
||||||
@ExcelProperty("实际支付金额")
|
|
||||||
private BigDecimal payPrice;
|
|
||||||
|
|
||||||
@ExcelProperty("支付状态")
|
|
||||||
private Byte paid;
|
|
||||||
|
|
||||||
@ExcelProperty("支付截止时间")
|
|
||||||
private LocalDateTime payTime;
|
|
||||||
|
|
||||||
@ExcelProperty("支付截止时间")
|
|
||||||
private LocalDateTime payEndTime;
|
|
||||||
|
|
||||||
@ExcelProperty("支付方式")
|
|
||||||
private String payType;
|
|
||||||
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@ExcelProperty("订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)")
|
|
||||||
private Boolean status;
|
|
||||||
|
|
||||||
@ExcelProperty("0 未退款 1 申请中 2 已退款 3 退款中")
|
|
||||||
private Byte refundStatus;
|
|
||||||
|
|
||||||
@ExcelProperty("退款图片")
|
|
||||||
private String refundReasonWapImg;
|
|
||||||
|
|
||||||
@ExcelProperty("退款用户说明")
|
|
||||||
private String refundReasonWapExplain;
|
|
||||||
|
|
||||||
@ExcelProperty("前台退款原因")
|
|
||||||
private String refundReasonWap;
|
|
||||||
|
|
||||||
@ExcelProperty("不退款的理由")
|
|
||||||
private String refundReason;
|
|
||||||
|
|
||||||
@ExcelProperty("退款时间")
|
|
||||||
private LocalDateTime refundReasonTime;
|
|
||||||
|
|
||||||
@ExcelProperty("退款金额")
|
|
||||||
private BigDecimal refundPrice;
|
|
||||||
|
|
||||||
@ExcelProperty("备注")
|
@ExcelProperty("备注")
|
||||||
private String mark;
|
private String mark;
|
||||||
|
|
||||||
@ExcelProperty("管理员备注")
|
@ExcelProperty("取货地址")
|
||||||
|
private String pickUpAddr;
|
||||||
|
|
||||||
|
@ExcelProperty("自提地址")
|
||||||
|
private String SelfPickupAddr;
|
||||||
|
|
||||||
|
@ExcelProperty("支付方式")
|
||||||
|
private String payType;
|
||||||
|
|
||||||
|
@ExcelProperty("订单备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@ExcelProperty("成本价")
|
@ExcelProperty("产品合计金额")
|
||||||
private BigDecimal cost;
|
|
||||||
|
|
||||||
@ExcelProperty("支付渠道(0微信公众号1微信小程序2余额)")
|
|
||||||
private Byte isChannel;
|
|
||||||
|
|
||||||
@ExcelProperty("消息提醒")
|
|
||||||
private Byte isRemind;
|
|
||||||
|
|
||||||
@ExcelProperty("后台是否删除")
|
|
||||||
private Boolean isSystemDel;
|
|
||||||
|
|
||||||
@ExcelProperty("订单类型:0-普通订单,1-视频号订单")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@ExcelProperty("商品总价")
|
|
||||||
private BigDecimal proTotalPrice;
|
private BigDecimal proTotalPrice;
|
||||||
|
|
||||||
@ExcelProperty("改价前支付金额")
|
@ExcelProperty("运费")
|
||||||
private BigDecimal beforePayPrice;
|
private BigDecimal shipPrice;
|
||||||
|
|
||||||
@ExcelProperty("是否改价,0-否,1-是")
|
@ExcelProperty("会员账号")
|
||||||
private Boolean isAlterPrice;
|
private String vipAccount;
|
||||||
|
|
||||||
@ExcelProperty("商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
|
@ExcelProperty("会员姓名")
|
||||||
private String outTradeNo;
|
private String vipName;
|
||||||
|
|
||||||
@ExcelProperty("第三方支付流水号")
|
@ExcelProperty("推广员")
|
||||||
private String paySerialNumber;
|
private String promoter;
|
||||||
|
|
||||||
|
@ExcelProperty("组织名称")
|
||||||
|
private Integer depName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,30 +18,59 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@Data
|
@Data
|
||||||
public class RechargeOrderInfoExcelVO {
|
public class RechargeOrderInfoExcelVO {
|
||||||
|
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ExcelProperty("充值订单id")
|
|
||||||
private Integer rechargeOrderId;
|
|
||||||
|
|
||||||
@ExcelProperty("充值档位")
|
|
||||||
private Integer rechargeGearId;
|
|
||||||
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@ExcelProperty("订单号")
|
@ExcelProperty("订单号")
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
@ExcelProperty("商品名称")
|
@ExcelProperty("商户名称")
|
||||||
|
private String shopName;
|
||||||
|
|
||||||
|
@ExcelProperty("产品名称")
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
@ExcelProperty("商品价格")
|
@ExcelProperty("购物选项")
|
||||||
|
private String shopOption;
|
||||||
|
|
||||||
|
@ExcelProperty("产品分类")
|
||||||
|
private String productCategory;
|
||||||
|
|
||||||
|
@ExcelProperty("产品价格")
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
@ExcelProperty("购买数量")
|
@ExcelProperty("产品数量")
|
||||||
private Integer payNum;
|
private Integer payNum;
|
||||||
|
|
||||||
|
@ExcelProperty("合计金额")
|
||||||
|
private BigDecimal proTotalPrice;
|
||||||
|
|
||||||
|
@ExcelProperty("支付金额")
|
||||||
|
private BigDecimal payPrice;
|
||||||
|
|
||||||
|
@ExcelProperty("售后状态")
|
||||||
|
private String afterStatus;
|
||||||
|
|
||||||
|
@ExcelProperty("退款金额")
|
||||||
|
private BigDecimal refundPrice;
|
||||||
|
|
||||||
|
@ExcelProperty("会员账号")
|
||||||
|
private String vipAccount;
|
||||||
|
|
||||||
|
@ExcelProperty("会员姓名")
|
||||||
|
private String vipName;
|
||||||
|
//(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)
|
||||||
|
@ExcelProperty("订单状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ExcelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ExcelProperty("订单备注")
|
||||||
|
private String mark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ExcelProperty("赠送积分")
|
@ExcelProperty("赠送积分")
|
||||||
private Integer giveIntegral;
|
private Integer giveIntegral;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
package cn.iocoder.yudao.module.shop.controller.app.member;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
|
||||||
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
|
||||||
|
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert;
|
||||||
|
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert;
|
||||||
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO;
|
||||||
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.recharge.RechargeGearService;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.recharge.RechargeOrderService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title:MemberController
|
||||||
|
* @Description: 会员相关信息
|
||||||
|
* @author: tangqian
|
||||||
|
* @date: 2023/5/17 10:13
|
||||||
|
* @version: V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/order/member")
|
||||||
|
@Tag(name = "用户 APP - 会员相关信息")
|
||||||
|
public class MemberController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RechargeGearService rechargeGearService;
|
||||||
|
@Autowired
|
||||||
|
private RechargeOrderService rechargeOrderService;
|
||||||
|
|
||||||
|
// 会员档次信息列表
|
||||||
|
@Operation(summary = "会员档次信息")
|
||||||
|
@RequestMapping(value = "/memberGradeInfo", method = RequestMethod.GET)
|
||||||
|
public CommonResult<List<RechargeGearRespVO>> memberGradeInfo() {
|
||||||
|
List<RechargeGearDO> gradeInfo = rechargeGearService.getGradeInfo();
|
||||||
|
return CommonResult.success(RechargeGearConvert.INSTANCE.convertList(gradeInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 充值列表记录
|
||||||
|
@Operation(summary = "获取当前登录账号的充值记录")
|
||||||
|
@RequestMapping(value = "/memberOrderInfo", method = RequestMethod.GET)
|
||||||
|
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfo() {
|
||||||
|
List<RechargeOrderDO> orderDOS = rechargeOrderService.memberOrderInfo();
|
||||||
|
return CommonResult.success(RechargeOrderConvert.INSTANCE.convertList(orderDOS));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -165,4 +165,8 @@ public class RechargeOrderDO extends BaseDO {
|
||||||
*/
|
*/
|
||||||
private String paySerialNumber;
|
private String paySerialNumber;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
private String updater;
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,4 +70,9 @@ public class RechargeOrderInfoDO extends BaseDO {
|
||||||
*/
|
*/
|
||||||
private Integer productType;
|
private Integer productType;
|
||||||
|
|
||||||
|
private String creator;
|
||||||
|
private String updater;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,4 +49,9 @@ public interface RechargeOrderInfoMapper extends BaseMapperX<RechargeOrderInfoDO
|
||||||
.orderByDesc(RechargeOrderInfoDO::getId));
|
.orderByDesc(RechargeOrderInfoDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<RechargeOrderInfoDO> selectList(List<String> s) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<RechargeOrderInfoDO>().in(RechargeOrderInfoDO::getOrderNo, s));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
|
import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
import cn.iocoder.yudao.framework.pay.config.WxPayOneAutoConfiguration;
|
|
||||||
import cn.iocoder.yudao.framework.pay.properties.AliPayProperties;
|
import cn.iocoder.yudao.framework.pay.properties.AliPayProperties;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
@ -52,6 +51,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -80,6 +80,7 @@ import java.util.stream.Collectors;
|
||||||
* | Author: CRMEB Team <admin@crmeb.com>
|
* | Author: CRMEB Team <admin@crmeb.com>
|
||||||
* +----------------------------------------------------------------------
|
* +----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOrder> implements StoreOrderService {
|
public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOrder> implements StoreOrderService {
|
||||||
|
|
||||||
|
@ -1150,14 +1151,25 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verifyResult) {
|
if (verifyResult) {
|
||||||
|
log.info("支付宝支付回调成功");
|
||||||
String orderId = params.get("out_trade_no");
|
String orderId = params.get("out_trade_no");
|
||||||
RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getOrderId, orderId));
|
String amount = params.get("refund_amount");
|
||||||
|
String total_amount = params.get("total_amount");
|
||||||
|
log.info("orderId:{}",orderId);
|
||||||
|
log.info("amount:{}",amount);
|
||||||
|
log.info("amount:{}",total_amount);
|
||||||
// 处理相关逻辑
|
// 处理相关逻辑
|
||||||
|
// 验证相关参数-金额
|
||||||
|
// 修改订单状态
|
||||||
|
// 写入
|
||||||
|
RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getOrderId, orderId));
|
||||||
|
orderDO.setPaid((byte) 1);
|
||||||
|
rechargeOrderMapper.updateById(orderDO);
|
||||||
|
return "success";
|
||||||
|
} else {
|
||||||
|
return "failure";
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1170,31 +1182,36 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object refundNotify(HttpServletRequest request, Map<String, String> params1) {
|
public Object refundNotify(HttpServletRequest request, Map<String, String> params) {
|
||||||
// 解析支付宝回调参数
|
String tradeNo = params.get("trade_no"); // 支付宝交易号
|
||||||
Map<String, String> params = new HashMap<>();
|
String outTradeNo = params.get("out_trade_no"); // 商户订单号
|
||||||
Map<String, String[]> requestParams = request.getParameterMap();
|
String refundAmount = params.get("refund_amount"); // 退款金额
|
||||||
for (Map.Entry<String, String[]> entry : requestParams.entrySet()) {
|
String tradeStatus = params.get("trade_status");
|
||||||
String name = entry.getKey();
|
log.info("tradeStatus:{}",tradeStatus);
|
||||||
String[] values = entry.getValue();
|
log.info("tradeNo:{}",tradeNo);
|
||||||
StringBuilder sb = new StringBuilder();
|
log.info("outTradeNo:{}",outTradeNo);
|
||||||
for (String value : values) {
|
log.info("refundAmount:{}",refundAmount);
|
||||||
sb.append(value);
|
// 2. 验证回调签名
|
||||||
}
|
Map<String, String> paramMap = new HashMap<>(params);
|
||||||
params.put(name, sb.toString());
|
paramMap.remove("sign_type"); // 移除sign_type参数
|
||||||
}
|
|
||||||
// 验证签名
|
// 验证签名
|
||||||
boolean isSignatureValid = false;
|
boolean isSignatureValid = false;
|
||||||
try {
|
try {
|
||||||
isSignatureValid = AlipaySignature.rsaCheckV1(params, aliPayProperties.getAlipayPublicKey(), "UTF-8", "RSA2");
|
isSignatureValid = AlipaySignature.rsaCheckV1(paramMap, aliPayProperties.getAlipayPublicKey(), "UTF-8", "RSA2");
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
log.info("支付宝退款回调验证结果{}",isSignatureValid);
|
||||||
if (isSignatureValid) {
|
if (isSignatureValid) {
|
||||||
// 验证通过,处理退款结果
|
log.info("支付宝退款回调成功");
|
||||||
String tradeStatus = params.get("trade_status");
|
// 验证通过
|
||||||
|
// 处理相关逻辑
|
||||||
|
// 验证相关参数-金额
|
||||||
|
// 修改订单状态
|
||||||
|
// 写入
|
||||||
if ("TRADE_SUCCESS".equals(tradeStatus)) {
|
if ("TRADE_SUCCESS".equals(tradeStatus)) {
|
||||||
// 退款成功逻辑
|
// 退款成功逻辑
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 退款失败逻辑
|
// 退款失败逻辑
|
||||||
}
|
}
|
||||||
|
@ -1229,12 +1246,12 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
orderInfos.forEach(info -> {
|
orderInfos.forEach(info -> {
|
||||||
RechargeOrderInfoDO infoDO = new RechargeOrderInfoDO();
|
RechargeOrderInfoDO infoDO = new RechargeOrderInfoDO();
|
||||||
infoDO.setRechargeOrderId(orderDO.getId());
|
infoDO.setRechargeOrderId(orderDO.getId());
|
||||||
infoDO.setGiveIntegral(info.getGearId());
|
|
||||||
infoDO.setOrderNo(code);
|
infoDO.setOrderNo(code);
|
||||||
infoDO.setProductName(info.getName());
|
infoDO.setProductName(info.getName());
|
||||||
infoDO.setPrice(new BigDecimal(info.getGearAmount()));
|
infoDO.setPrice(new BigDecimal(info.getGearAmount()));
|
||||||
infoDO.setPayNum(1);
|
infoDO.setPayNum(1);
|
||||||
infoDO.setGiveIntegral(info.getGearAmount());
|
infoDO.setGiveIntegral(info.getGearAmount());
|
||||||
|
infoDO.setVipPrice(new BigDecimal(info.getGearAmount()));
|
||||||
infoDOS.add(infoDO);
|
infoDOS.add(infoDO);
|
||||||
});
|
});
|
||||||
rechargeOrderInfoMapper.insertBatch(infoDOS);
|
rechargeOrderInfoMapper.insertBatch(infoDOS);
|
||||||
|
|
|
@ -67,4 +67,5 @@ public interface RechargeGearService {
|
||||||
*/
|
*/
|
||||||
List<RechargeGearDO> getRechargeGearList(RechargeGearExportReqVO exportReqVO);
|
List<RechargeGearDO> getRechargeGearList(RechargeGearExportReqVO exportReqVO);
|
||||||
|
|
||||||
|
List<RechargeGearDO> getGradeInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.shop.service.recharge;
|
package cn.iocoder.yudao.module.shop.service.recharge;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -79,4 +80,10 @@ public class RechargeGearServiceImpl implements RechargeGearService {
|
||||||
return rechargeGearMapper.selectList(exportReqVO);
|
return rechargeGearMapper.selectList(exportReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RechargeGearDO> getGradeInfo() {
|
||||||
|
return rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
|
||||||
|
.eq(RechargeGearDO::getDeleted, 0));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,4 +67,6 @@ public interface RechargeOrderInfoService {
|
||||||
*/
|
*/
|
||||||
List<RechargeOrderInfoDO> getRechargeOrderInfoList(RechargeOrderInfoExportReqVO exportReqVO);
|
List<RechargeOrderInfoDO> getRechargeOrderInfoList(RechargeOrderInfoExportReqVO exportReqVO);
|
||||||
|
|
||||||
|
List<RechargeOrderInfoDO> getRechargeOrderInfoList(List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.shop.service.recharge;
|
package cn.iocoder.yudao.module.shop.service.recharge;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -79,4 +80,9 @@ public class RechargeOrderInfoServiceImpl implements RechargeOrderInfoService {
|
||||||
return rechargeOrderInfoMapper.selectList(exportReqVO);
|
return rechargeOrderInfoMapper.selectList(exportReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RechargeOrderInfoDO> getRechargeOrderInfoList(List<String> s) {
|
||||||
|
return rechargeOrderInfoMapper.selectList(s);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,4 +67,6 @@ public interface RechargeOrderService {
|
||||||
*/
|
*/
|
||||||
List<RechargeOrderDO> getRechargeOrderList(RechargeOrderExportReqVO exportReqVO);
|
List<RechargeOrderDO> getRechargeOrderList(RechargeOrderExportReqVO exportReqVO);
|
||||||
|
|
||||||
|
List<RechargeOrderDO> memberOrderInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package cn.iocoder.yudao.module.shop.service.recharge;
|
package cn.iocoder.yudao.module.shop.service.recharge;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -79,4 +84,11 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
return rechargeOrderMapper.selectList(exportReqVO);
|
return rechargeOrderMapper.selectList(exportReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RechargeOrderDO> memberOrderInfo() {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Assert.notNull(loginUser, "登录失效,请重新登录!");
|
||||||
|
return rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUid,loginUser.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class AliPayStrategy implements IPayStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest, String openId) {
|
public InitOrderResponse pay(RechargeOrderDO orderDO, HttpServletRequest servletRequest, String openId) {
|
||||||
|
InitOrderResponse orderResponse = new InitOrderResponse();
|
||||||
AlipayClient alipayClient = aliPayConfig.alipayClient();
|
AlipayClient alipayClient = aliPayConfig.alipayClient();
|
||||||
Assert.notNull(alipayClient, "获取支付宝支付配置失败!");
|
Assert.notNull(alipayClient, "获取支付宝支付配置失败!");
|
||||||
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
|
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
|
||||||
|
@ -56,13 +57,11 @@ public class AliPayStrategy implements IPayStrategy {
|
||||||
AlipayTradeWapPayResponse response = null;
|
AlipayTradeWapPayResponse response = null;
|
||||||
try {
|
try {
|
||||||
response = alipayClient.pageExecute(request);
|
response = alipayClient.pageExecute(request);
|
||||||
|
orderResponse.setBody(response.getBody());
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (response.isSuccess()) {
|
return orderResponse;
|
||||||
return new InitOrderResponse();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.controller.admin.promoter;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.v3.oas.annotations.Parameters;
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -87,8 +88,8 @@ public class PromoterController {
|
||||||
@Operation(summary = "获得推广员分页")
|
@Operation(summary = "获得推广员分页")
|
||||||
@PreAuthorize("@ss.hasPermission('member:promoter:query')")
|
@PreAuthorize("@ss.hasPermission('member:promoter:query')")
|
||||||
public CommonResult<PageResult<PromoterRespVO>> getPromoterPage(@Valid PromoterPageReqVO pageVO) {
|
public CommonResult<PageResult<PromoterRespVO>> getPromoterPage(@Valid PromoterPageReqVO pageVO) {
|
||||||
PageResult<PromoterDO> pageResult = promoterService.getPromoterPage(pageVO);
|
PageResult<PromoterRespVO> pageResult = promoterService.getPromoterPage(pageVO);
|
||||||
return success(PromoterConvert.INSTANCE.convertPage(pageResult));
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class PromoterBaseVO {
|
||||||
@Schema(description = "推广员名称", required = true, example = "5841")
|
@Schema(description = "推广员名称", required = true, example = "5841")
|
||||||
@NotEmpty(message = "推广员名称不能为空")
|
@NotEmpty(message = "推广员名称不能为空")
|
||||||
@Size(max = 10,message = "推广员名称最长不能超过{max}")
|
@Size(max = 10,message = "推广员名称最长不能超过{max}")
|
||||||
private String nickName;
|
private String nickname;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "推广员手机号", example = "15601691300")
|
@Schema(description = "推广员手机号", example = "15601691300")
|
||||||
|
|
|
@ -11,5 +11,8 @@ public class PromoterRespVO extends PromoterBaseVO {
|
||||||
|
|
||||||
@Schema(description = "编号", required = true, example = "3051")
|
@Schema(description = "编号", required = true, example = "3051")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@Schema(description = "组织名称", required = true, example = "18443")
|
||||||
|
private String orgName;
|
||||||
|
@Schema(description = "组织名称", required = true, example = "18443")
|
||||||
|
private String userId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
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.user.dto.AdminUserQueryDTO;
|
import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.AdminUserInfoRespVO;
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.AdminUserInfoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUpdateStatusReqVO;
|
||||||
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
|
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
|
||||||
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.service.user.MemberUserService;
|
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||||
|
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
@ -58,7 +60,13 @@ public class AdminUserController {
|
||||||
String avatar = userService.updateUserAvatar(getLoginUserId(), file.getInputStream());
|
String avatar = userService.updateUserAvatar(getLoginUserId(), file.getInputStream());
|
||||||
return success(avatar);
|
return success(avatar);
|
||||||
}
|
}
|
||||||
|
@PutMapping("/update-status")
|
||||||
|
@Operation(summary = "修改用户状态")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||||
|
public CommonResult<Boolean> updateUserStatus(@Valid @RequestBody MemberUpdateStatusReqVO reqVO) {
|
||||||
|
userService.updateUserStatus(reqVO.getId(), reqVO.getStatus());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得基本信息")
|
@Operation(summary = "获得基本信息")
|
||||||
@PreAuthorize("@ss.hasPermission('member:user:query')")
|
@PreAuthorize("@ss.hasPermission('member:user:query')")
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package cn.iocoder.yudao.module.member.controller.admin.user.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 用户更新状态 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MemberUpdateStatusReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "用户编号", required = true, example = "1024")
|
||||||
|
@NotNull(message = "角色编号不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1")
|
||||||
|
@NotNull(message = "状态不能为空")
|
||||||
|
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
|
@ -6,8 +6,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.*;
|
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推广员 Mapper
|
* 推广员 Mapper
|
||||||
|
@ -23,7 +25,7 @@ public interface PromoterMapper extends BaseMapperX<PromoterDO> {
|
||||||
.eqIfPresent(PromoterDO::getUserId, reqVO.getUserId())
|
.eqIfPresent(PromoterDO::getUserId, reqVO.getUserId())
|
||||||
.orderByDesc(PromoterDO::getId));
|
.orderByDesc(PromoterDO::getId));
|
||||||
}
|
}
|
||||||
|
IPage<PromoterRespVO> findListPage(IPage<PromoterRespVO> page, @Param("data") PromoterPageReqVO data);
|
||||||
default List<PromoterDO> selectList(PromoterExportReqVO reqVO) {
|
default List<PromoterDO> selectList(PromoterExportReqVO reqVO) {
|
||||||
return selectList(new LambdaQueryWrapperX<PromoterDO>()
|
return selectList(new LambdaQueryWrapperX<PromoterDO>()
|
||||||
.eqIfPresent(PromoterDO::getOrgId, reqVO.getOrgId())
|
.eqIfPresent(PromoterDO::getOrgId, reqVO.getOrgId())
|
||||||
|
|
|
@ -5,6 +5,7 @@ import javax.validation.*;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.*;
|
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.*;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推广员 Service 接口
|
* 推广员 Service 接口
|
||||||
|
@ -57,7 +58,7 @@ public interface PromoterService {
|
||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 推广员分页
|
* @return 推广员分页
|
||||||
*/
|
*/
|
||||||
PageResult<PromoterDO> getPromoterPage(PromoterPageReqVO pageReqVO);
|
PageResult<PromoterRespVO> getPromoterPage(PromoterPageReqVO pageReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得推广员列表, 用于 Excel 导出
|
* 获得推广员列表, 用于 Excel 导出
|
||||||
|
|
|
@ -9,6 +9,9 @@ import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -58,11 +61,11 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
if(memberUserDO==null){
|
if(memberUserDO==null){
|
||||||
//创建用户
|
//创建用户
|
||||||
memberUserDO = new MemberUserDO();
|
memberUserDO = new MemberUserDO();
|
||||||
memberUserDO.setNickname(createReqVO.getNickName());
|
memberUserDO.setNickname(createReqVO.getNickname());
|
||||||
memberUserDO.setMobile(createReqVO.getMobile());
|
memberUserDO.setMobile(createReqVO.getMobile());
|
||||||
memberUserDO.setStatus(createReqVO.getStatus());
|
memberUserDO.setStatus(createReqVO.getStatus());
|
||||||
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length()-6));
|
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length()-6));
|
||||||
memberUserService.createUserIfAbsent(createReqVO.getMobile(),createReqVO.getNickName(),getClientIP());
|
memberUserService.createUserIfAbsent(createReqVO.getMobile(),createReqVO.getNickname(),getClientIP());
|
||||||
}
|
}
|
||||||
// 插入
|
// 插入
|
||||||
PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO);
|
PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO);
|
||||||
|
@ -111,8 +114,10 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<PromoterDO> getPromoterPage(PromoterPageReqVO pageReqVO) {
|
public PageResult<PromoterRespVO> getPromoterPage(PromoterPageReqVO pageReqVO) {
|
||||||
return promoterMapper.selectPage(pageReqVO);
|
Page<PromoterRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
|
promoterMapper.findListPage(page,pageReqVO);
|
||||||
|
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -82,6 +82,8 @@ public interface MemberUserService {
|
||||||
*/
|
*/
|
||||||
String updateUserAvatar(Long userId, InputStream inputStream) throws Exception;
|
String updateUserAvatar(Long userId, InputStream inputStream) throws Exception;
|
||||||
|
|
||||||
|
void updateUserStatus(Long id, Integer status) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改手机
|
* 修改手机
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
|
|
|
@ -123,7 +123,16 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||||
memberUserMapper.updateById(MemberUserDO.builder().id(userId).avatar(avatar).build());
|
memberUserMapper.updateById(MemberUserDO.builder().id(userId).avatar(avatar).build());
|
||||||
return avatar;
|
return avatar;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void updateUserStatus(Long id, Integer status) {
|
||||||
|
// 校验用户存在
|
||||||
|
this.checkUserExists(id);
|
||||||
|
// 更新状态
|
||||||
|
MemberUserDO updateObj = new MemberUserDO();
|
||||||
|
updateObj.setId(id);
|
||||||
|
updateObj.setStatus(status);
|
||||||
|
memberUserMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateUserMobile(Long userId, AppUserUpdateMobileReqVO reqVO) {
|
public void updateUserMobile(Long userId, AppUserUpdateMobileReqVO reqVO) {
|
||||||
|
|
|
@ -9,4 +9,10 @@
|
||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<select id="findListPage" resultType="cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO">
|
||||||
|
select a.id,a.user_id,a.org_id,b.nickname,b.status,b.mobile,c.parent_organization_name as 'orgName' from member_promoter a
|
||||||
|
left join member_user b on a.user_id = b.id
|
||||||
|
left join system_dept c on c.id=a.org_id
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -165,4 +165,6 @@ public interface ErrorCodeConstants {
|
||||||
// ========== 站内信发送 1002028000 ==========
|
// ========== 站内信发送 1002028000 ==========
|
||||||
ErrorCode NOTIFY_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失");
|
ErrorCode NOTIFY_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,5 +102,14 @@ public class TenantBaseVO {
|
||||||
@Length( max =200, message = "logo长度为 {max}位")
|
@Length( max =200, message = "logo长度为 {max}位")
|
||||||
private String logo;
|
private String logo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品提成
|
||||||
|
*/
|
||||||
|
private Integer goodsCommission;
|
||||||
|
/**
|
||||||
|
* 会员充值提成
|
||||||
|
*/
|
||||||
|
private Integer memberCommission;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,12 +21,12 @@ public class TenantCommissionUpdateReqVO {
|
||||||
* 商品提成
|
* 商品提成
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "商品提成不能为空")
|
@NotNull(message = "商品提成不能为空")
|
||||||
@Size(min = 0,max = 100,message ="商品提成{min}{max}之间" )
|
// @Size(min = 0,max = 100,message ="商品提成{min}{max}之间" )
|
||||||
private Integer goodsCommission;
|
private Integer goodsCommission;
|
||||||
/**
|
/**
|
||||||
* 会员充值提成
|
* 会员充值提成
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "会员充值提成不能为空")
|
@NotNull(message = "会员充值提成不能为空")
|
||||||
@Size(min = 0,max = 100,message ="会员充值提成{min}{max}之间" )
|
// @Size(min = 0,max = 100,message ="会员充值提成{min}{max}之间" )
|
||||||
private Integer memberCommission;
|
private Integer memberCommission;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
package cn.iocoder.yudao.module.system.controller.app.tenant;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
|
||||||
|
import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 租户")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/tenant")
|
||||||
|
public class AppTenantController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TenantService tenantService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得租户")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:tenant:query')")
|
||||||
|
public CommonResult<TenantRespVO> getTenant(@RequestParam("id") Long id) {
|
||||||
|
TenantDO tenant = tenantService.getTenant(id);
|
||||||
|
return success(TenantConvert.INSTANCE.convert(tenant));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package cn.iocoder.yudao.module.system.controller.app.tenant.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantBaseVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 租户 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class TenantRespVO extends TenantBaseVO {
|
||||||
|
|
||||||
|
@Schema(description = "租户编号", required = true, example = "1024")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "租户名", required = true, example = "芋道")
|
||||||
|
@NotNull(message = "租户名不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
|
@ -97,10 +97,10 @@ public class SmsCodeServiceImpl implements SmsCodeService {
|
||||||
throw exception(SMS_CODE_NOT_FOUND);
|
throw exception(SMS_CODE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
// 超过时间
|
// 超过时间
|
||||||
if (LocalDateTimeUtil.between(lastSmsCode.getCreateTime(), LocalDateTime.now()).toMillis()
|
// if (LocalDateTimeUtil.between(lastSmsCode.getCreateTime(), LocalDateTime.now()).toMillis()
|
||||||
>= smsCodeProperties.getExpireTimes().toMillis()) { // 验证码已过期
|
// >= smsCodeProperties.getExpireTimes().toMillis()) { // 验证码已过期
|
||||||
throw exception(SMS_CODE_EXPIRED);
|
// throw exception(SMS_CODE_EXPIRED);
|
||||||
}
|
// }
|
||||||
// 判断验证码是否已被使用
|
// 判断验证码是否已被使用
|
||||||
if (Boolean.TRUE.equals(lastSmsCode.getUsed())) {
|
if (Boolean.TRUE.equals(lastSmsCode.getUsed())) {
|
||||||
throw exception(SMS_CODE_USED);
|
throw exception(SMS_CODE_USED);
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class TenantServiceImpl implements TenantService {
|
||||||
// 校验租户名称是否重复
|
// 校验租户名称是否重复
|
||||||
validTenantNameDuplicate(updateReqVO.getName(), updateReqVO.getId());
|
validTenantNameDuplicate(updateReqVO.getName(), updateReqVO.getId());
|
||||||
// 校验套餐被禁用
|
// 校验套餐被禁用
|
||||||
TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId());
|
TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(tenant.getPackageId());
|
||||||
|
|
||||||
// 更新租户
|
// 更新租户
|
||||||
TenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO);
|
TenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO);
|
||||||
|
|
|
@ -22,4 +22,4 @@ VUE_APP_CAPTCHA_ENABLE = true
|
||||||
VUE_APP_DOC_ENABLE = false
|
VUE_APP_DOC_ENABLE = false
|
||||||
|
|
||||||
# 百度统计
|
# 百度统计
|
||||||
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
VUE_APP_BAIDU_CODE =
|
||||||
|
|
|
@ -52,3 +52,15 @@ export function exportUserExcel(query) {
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 用户状态修改
|
||||||
|
export function changeUserStatus(id, status) {
|
||||||
|
const data = {
|
||||||
|
id,
|
||||||
|
status
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/member/user/update-status',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -35,14 +35,22 @@
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column label="组织id" align="center" prop="orgId" />
|
<el-table-column label="推广员名称" align="center" prop="nickname" />
|
||||||
<el-table-column label="会员id" align="center" prop="userId" />
|
<el-table-column label="手机号" align="center" prop="mobile" />
|
||||||
|
<el-table-column label="所属组织" align="center" prop="orgName" />
|
||||||
|
<el-table-column label="启用状态" align="center" prop="status" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['member:promoter:update']">修改</el-button>
|
v-hasPermi="['member:promoter:update']">修改</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['member:promoter:delete']">删除</el-button>
|
v-hasPermi="['member:promoter:delete']">修改密码</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleStatusChange(scope.row)"
|
||||||
|
v-hasPermi="['member:promoter:delete']">禁用</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -90,9 +98,19 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createPromoter, updatePromoter, deletePromoter, getPromoter, getPromoterPage, importTemplate,exportPromoterExcel } from "@/api/member/promoter";
|
import { createPromoter, updatePromoter, deletePromoter, getPromoter, getPromoterPage, importTemplate,exportPromoterExcel } from "@/api/member/promoter";
|
||||||
|
import {
|
||||||
|
changeUserStatus
|
||||||
|
} from "@/api/member/user";
|
||||||
import {getBaseHeader} from "@/utils/request";
|
import {getBaseHeader} from "@/utils/request";
|
||||||
|
import {CommonStatusEnum} from "@/utils/constants";
|
||||||
|
import {DICT_TYPE} from "@/utils/dict";
|
||||||
export default {
|
export default {
|
||||||
name: "Promoter",
|
name: "Promoter",
|
||||||
|
computed: {
|
||||||
|
DICT_TYPE() {
|
||||||
|
return DICT_TYPE
|
||||||
|
}
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -229,6 +247,18 @@ export default {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
|
// 用户状态修改
|
||||||
|
handleStatusChange(row) {
|
||||||
|
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "禁用";
|
||||||
|
this.$modal.confirm('您确认要"' + text + '""' + row.nickname + '"推广员吗?').then(function() {
|
||||||
|
return changeUserStatus(row.user_id, row.status);
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess(text + "成功");
|
||||||
|
}).catch(function() {
|
||||||
|
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
||||||
|
: CommonStatusEnum.ENABLE;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
|
|
|
@ -108,9 +108,9 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="归属部门" prop="deptId">
|
<el-form-item label="归属组织" prop="deptId">
|
||||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :clearable="false"
|
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :clearable="false"
|
||||||
placeholder="请选择归属部门" :normalizer="normalizer"/>
|
placeholder="请选择归属组织" :normalizer="normalizer"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
Loading…
Reference in New Issue