diff --git a/pom.xml b/pom.xml index 7209437..2f0b1dd 100644 --- a/pom.xml +++ b/pom.xml @@ -294,7 +294,12 @@ jaxb-runtime 2.3.3 - + + + com.alipay.sdk + alipay-easysdk + 2.2.3 + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/MusicRecommendController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/MusicRecommendController.java index 0bdbd9c..4e564d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/MusicRecommendController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/MusicRecommendController.java @@ -91,7 +91,7 @@ public class MusicRecommendController extends BaseController @PreAuthorize("@ss.hasPermi('system:recommend:remove')") @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(musicRecommendService.deleteMusicRecommendByIds(ids)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/OrderInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/OrderInfoController.java new file mode 100644 index 0000000..861a3de --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/back/OrderInfoController.java @@ -0,0 +1,98 @@ +package com.ruoyi.web.controller.back; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.OrderInfo; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.IOrderInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 【请填写功能名称】Controller + * + * @author ruoyi + * @date 2025-08-03 + */ +@RestController +@RequestMapping("/back/info") +public class OrderInfoController extends BaseController +{ + @Autowired + private IOrderInfoService orderInfoService; + + /** + * 查询【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:list')") + @GetMapping("/list") + public TableDataInfo list(OrderInfo orderInfo) + { + startPage(); + List list = orderInfoService.selectOrderInfoList(orderInfo); + return getDataTable(list); + } + + /** + * 导出【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:export')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, OrderInfo orderInfo) + { + List list = orderInfoService.selectOrderInfoList(orderInfo); + ExcelUtil util = new ExcelUtil(OrderInfo.class); + util.exportExcel(response, list, "【请填写功能名称】数据"); + } + + /** + * 获取【请填写功能名称】详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(orderInfoService.selectOrderInfoById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:info:add')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody OrderInfo orderInfo) + { + return toAjax(orderInfoService.insertOrderInfo(orderInfo)); + } + + /** + * 修改【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:info:edit')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody OrderInfo orderInfo) + { + return toAjax(orderInfoService.updateOrderInfo(orderInfo)); + } + + /** + * 删除【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:info:remove')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(orderInfoService.deleteOrderInfoByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientOrderInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientOrderInfoController.java new file mode 100644 index 0000000..030b7d8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/client/ClientOrderInfoController.java @@ -0,0 +1,34 @@ +package com.ruoyi.web.controller.client; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.entity.OrderInfo; +import com.ruoyi.system.service.IOrderInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 【请填写功能名称】Controller + * + * @author ruoyi + * @date 2025-08-03 + */ +@RestController +@RequestMapping("/client/order") +public class ClientOrderInfoController extends BaseController +{ + @Autowired + private IOrderInfoService orderInfoService; + + // 创建订单 + @PostMapping("/create") + public void crateOrder(@RequestBody OrderInfo orderInfo){ + + orderInfoService.createOrder(orderInfo); + + } + + +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 7f6178c..02ae3e5 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -16,7 +16,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8081 + port: 8080 servlet: # 应用的访问路径 context-path: / diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index c2644fa..408dbe9 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -185,7 +185,11 @@ org.glassfish.jaxb jaxb-runtime - + + + com.alipay.sdk + alipay-easysdk + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/AliPayConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/AliPayConfig.java new file mode 100644 index 0000000..641bd8d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/AliPayConfig.java @@ -0,0 +1,62 @@ +package com.ruoyi.common.config; + +import com.alipay.easysdk.factory.Factory; +import com.alipay.easysdk.kernel.Config; +import lombok.Getter; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +/** + * 描述: + * + * @author menxipeng by 2023/12/15 + */ +@Getter +@Component +public class AliPayConfig { + + @Value("${alipay.gateway}") + private String aliPayGateway; + @Value("${alipay.appid}") + private String aliPayAppid; + @Value("${alipay.privateKey}") + private String aliPayPrivateKey; + @Value("${alipay.publicKey}") + private String aliPayPublicKey; + @Value("${alipay.merchantCertPath}") + private String merchantCertPath; + @Value("${alipay.alipayCertPath}") + private String alipayCertPath; + @Value("${alipay.alipayRootCertPath}") + private String alipayRootCertPath; + @Value("${alipay.notifyUrl}") + private String aliPayNotifyUrl; + @Value("${alipay.authUrl}") + private String aliPayAuthUrl; + @Value("${alipay.timeout}") + private Integer aliTimeOut; + + + @Bean + public void init() { + Config config = new Config(); + config.protocol = "https"; + config.gatewayHost = "openapi.alipay.com"; + config.signType = "RSA2"; + + config.appId = aliPayAppid; + // 为避免私钥随源码泄露,推荐从文件中读取私钥字符串而不是写入源码中 + config.merchantPrivateKey = aliPayPrivateKey; + //注:证书文件路径支持设置为文件系统中的路径或CLASS_PATH中的路径,优先从文件系统中加载,加载失败后会继续尝试从CLASS_PATH中加载 + config.merchantCertPath = merchantCertPath; + config.alipayCertPath = alipayCertPath; + config.alipayRootCertPath = alipayRootCertPath; + //注:如果采用非证书模式,则无需赋值上面的三个证书路径,改为赋值如下的支付宝公钥字符串即可 + //可设置异步通知接收服务地址(可选) + config.notifyUrl = aliPayNotifyUrl; + + Factory.setOptions(config); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/PayStatusCode.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/PayStatusCode.java new file mode 100644 index 0000000..809e18c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/PayStatusCode.java @@ -0,0 +1,56 @@ +//package com.ruoyi.common.config; +// +//import com.lvcai.lvcaibiwebstarter.constant +// .IStatusCode; +//import com.lvcai.lvcaibiwebstarter.enums.GenericStatusCode; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.Setter; +// +///** +// * 描述: +// * +// * @author menxipeng by 2023/12/15 +// */ +// +//@AllArgsConstructor +//public enum PayStatusCode { +// +// /** +// * 稍后再试 +// */ +// TRY_AGAIN_LATER(902, "稍后再试"), +// +// /** +// * 支付方式错误 +// */ +// PAY_TYPE_ERROR(990, "支付方式错误"), +// +// PAY_ERROR(991, "支付失败"), +// /** +// * 支付宝预创建订单失败 +// */ +// ALI_PRE_CREATE_FAIL(992, "支付宝预创建订单失败"), +// +// // 重复上传 +// REPEAT_UPLOAD(993, "重复上传"), +// ; +// +// public int codeValue; +// public String msg; +// +// @Override +// public int getCodeSegment() { +// return 15; +// } +// +// @Override +// public int getCodeValue() { +// return this.codeValue; +// } +// +// @Override +// public String getMsg() { +// return this.msg; +// } +//} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/OrderInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/OrderInfo.java new file mode 100644 index 0000000..c525a94 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/OrderInfo.java @@ -0,0 +1,331 @@ +package com.ruoyi.common.core.domain.entity; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 【请填写功能名称】对象 order_info + * + * @author ruoyi + * @date 2025-08-03 + */ +public class OrderInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private String id; + + /** 订单号 */ + @Excel(name = "订单号") + private Long orderId; + + /** 订单名称 */ + @Excel(name = "订单名称") + private String orderName; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + /** 金额 分 */ + @Excel(name = "金额 分") + private Long amount; + + /** 支付方式 aliPay / wechatPay / applePay */ + @Excel(name = "支付方式 aliPay / wechatPay / applePay ") + private String payType; + + /** 交易时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "交易时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date payTime; + + /** 支付状态 1 创建订单 2 待出货 3 已完成 */ + @Excel(name = "支付状态 1 创建订单 2 待出货 3 已完成") + private Long payStatus; + + /** 开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 截止时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "截止时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 1删除 */ + @Excel(name = "1删除") + private Long idDel; + + /** 回调时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "回调时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date callTime; + + /** 套餐类型 1 包月 3 包季度 6 半年 12 一年 */ + @Excel(name = "套餐类型 1 包月 3 包季度 6 半年 12 一年") + private String packageType; + + /** 回调内容 */ + @Excel(name = "回调内容") + private String callbackContent; + + /** 第三方支付交易号 */ + @Excel(name = "第三方支付交易号") + private String tradeNo; + + /** 已退款金额(单位:分) */ + @Excel(name = "已退款金额(单位:分)") + private Long refundAmount; + + /** 退款时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date refundTime; + + /** 下单用户ip */ + @Excel(name = "下单用户ip") + private String clientIp; + + /** 设备类型 */ + @Excel(name = "设备类型") + private String deviceType; + + /** 乐观锁版本号 */ + @Excel(name = "乐观锁版本号") + private Long version; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + + public void setOrderId(Long orderId) + { + this.orderId = orderId; + } + + public Long getOrderId() + { + return orderId; + } + + public void setOrderName(String orderName) + { + this.orderName = orderName; + } + + public String getOrderName() + { + return orderName; + } + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + public void setAmount(Long amount) + { + this.amount = amount; + } + + public Long getAmount() + { + return amount; + } + + public void setPayType(String payType) + { + this.payType = payType; + } + + public String getPayType() + { + return payType; + } + + public void setPayTime(Date payTime) + { + this.payTime = payTime; + } + + public Date getPayTime() + { + return payTime; + } + + public void setPayStatus(Long payStatus) + { + this.payStatus = payStatus; + } + + public Long getPayStatus() + { + return payStatus; + } + + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + + public void setIdDel(Long idDel) + { + this.idDel = idDel; + } + + public Long getIdDel() + { + return idDel; + } + + public void setCallTime(Date callTime) + { + this.callTime = callTime; + } + + public Date getCallTime() + { + return callTime; + } + + public void setPackageType(String packageType) + { + this.packageType = packageType; + } + + public String getPackageType() + { + return packageType; + } + + public void setCallbackContent(String callbackContent) + { + this.callbackContent = callbackContent; + } + + public String getCallbackContent() + { + return callbackContent; + } + + public void setTradeNo(String tradeNo) + { + this.tradeNo = tradeNo; + } + + public String getTradeNo() + { + return tradeNo; + } + + public void setRefundAmount(Long refundAmount) + { + this.refundAmount = refundAmount; + } + + public Long getRefundAmount() + { + return refundAmount; + } + + public void setRefundTime(Date refundTime) + { + this.refundTime = refundTime; + } + + public Date getRefundTime() + { + return refundTime; + } + + public void setClientIp(String clientIp) + { + this.clientIp = clientIp; + } + + public String getClientIp() + { + return clientIp; + } + + public void setDeviceType(String deviceType) + { + this.deviceType = deviceType; + } + + public String getDeviceType() + { + return deviceType; + } + + public void setVersion(Long version) + { + this.version = version; + } + + public Long getVersion() + { + return version; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("orderId", getOrderId()) + .append("orderName", getOrderName()) + .append("userId", getUserId()) + .append("amount", getAmount()) + .append("payType", getPayType()) + .append("payTime", getPayTime()) + .append("payStatus", getPayStatus()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("createTime", getCreateTime()) + .append("idDel", getIdDel()) + .append("updateTime", getUpdateTime()) + .append("callTime", getCallTime()) + .append("packageType", getPackageType()) + .append("callbackContent", getCallbackContent()) + .append("tradeNo", getTradeNo()) + .append("refundAmount", getRefundAmount()) + .append("refundTime", getRefundTime()) + .append("clientIp", getClientIp()) + .append("deviceType", getDeviceType()) + .append("version", getVersion()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/PayStatusEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/PayStatusEnum.java new file mode 100644 index 0000000..6035206 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/PayStatusEnum.java @@ -0,0 +1,24 @@ +package com.ruoyi.common.core.domain.entity; + + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public enum PayStatusEnum { + + // `pay_status` int DEFAULT NULL COMMENT '支付状态 1 待支付 2 待出货 3 待退款 4 已退款 5 已完成', + CREATE(1, "待支付"), + PENDING(2,"待出货"), + WAIT_REFUND(3,"待退款"), + REFUND(4,"已退款"), + COMPLETE(5,"已完成") + ; + + public long status; + public String desc; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java index 78d45e3..ba52839 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CategoryInfoMapper.java @@ -68,4 +68,6 @@ public interface CategoryInfoMapper int deleteCategoryInfoBycategoryId(String categoryId); + + int deleteCategoryInfoBycategoryIds(String[] ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MusicRecommendMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MusicRecommendMapper.java index 0bdab72..d0ebcbe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MusicRecommendMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/MusicRecommendMapper.java @@ -58,5 +58,5 @@ public interface MusicRecommendMapper * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteMusicRecommendByIds(String[] ids); + public int deleteMusicRecommendByIds(Long[] ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderInfoMapper.java new file mode 100644 index 0000000..db974a8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderInfoMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.common.core.domain.entity.OrderInfo; + +import java.util.List; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author ruoyi + * @date 2025-08-03 + */ +public interface OrderInfoMapper +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public OrderInfo selectOrderInfoById(String id); + + /** + * 查询【请填写功能名称】列表 + * + * @param orderInfo 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectOrderInfoList(OrderInfo orderInfo); + + /** + * 新增【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + public int insertOrderInfo(OrderInfo orderInfo); + + /** + * 修改【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + public int updateOrderInfo(OrderInfo orderInfo); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteOrderInfoById(String id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteOrderInfoByIds(String[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IMusicRecommendService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IMusicRecommendService.java index 5f627df..5b6d5d3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IMusicRecommendService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IMusicRecommendService.java @@ -50,7 +50,7 @@ public interface IMusicRecommendService * @param ids 需要删除的【请填写功能名称】主键集合 * @return 结果 */ - public int deleteMusicRecommendByIds(String[] ids); + public int deleteMusicRecommendByIds(Long[] ids); /** * 删除【请填写功能名称】信息 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderInfoService.java new file mode 100644 index 0000000..06845de --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderInfoService.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.OrderInfo; + +import java.util.List; + +/** + * 【请填写功能名称】Service接口 + * + * @author ruoyi + * @date 2025-08-03 + */ +public interface IOrderInfoService +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public OrderInfo selectOrderInfoById(String id); + + /** + * 查询【请填写功能名称】列表 + * + * @param orderInfo 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectOrderInfoList(OrderInfo orderInfo); + + /** + * 新增【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + public int insertOrderInfo(OrderInfo orderInfo); + + /** + * 修改【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + public int updateOrderInfo(OrderInfo orderInfo); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键集合 + * @return 结果 + */ + public int deleteOrderInfoByIds(String[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteOrderInfoById(String id); + + AjaxResult createOrder(OrderInfo orderInfo); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java index 280021e..6a1bfc9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CategoryInfoServiceImpl.java @@ -23,6 +23,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService @Autowired private CategoryInfoMapper categoryInfoMapper; + /** * 查询【请填写功能名称】 * @@ -83,6 +84,7 @@ public class CategoryInfoServiceImpl implements ICategoryInfoService @Override public int deleteCategoryInfoByIds(String[] ids) { + categoryInfoMapper.deleteCategoryInfoBycategoryIds(ids); return categoryInfoMapper.deleteCategoryInfoByIds(ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicRecommendServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicRecommendServiceImpl.java index b62ca8e..12617e4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicRecommendServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MusicRecommendServiceImpl.java @@ -20,6 +20,7 @@ public class MusicRecommendServiceImpl implements IMusicRecommendService @Autowired private MusicRecommendMapper musicRecommendMapper; + /** * 查询【请填写功能名称】 * @@ -75,8 +76,9 @@ public class MusicRecommendServiceImpl implements IMusicRecommendService * @return 结果 */ @Override - public int deleteMusicRecommendByIds(String[] ids) + public int deleteMusicRecommendByIds(Long[] ids) { + // 删除关联数据 return musicRecommendMapper.deleteMusicRecommendByIds(ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderInfoServiceImpl.java new file mode 100644 index 0000000..2cdafc4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderInfoServiceImpl.java @@ -0,0 +1,111 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.OrderInfo; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.mapper.OrderInfoMapper; +import com.ruoyi.system.service.IOrderInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author ruoyi + * @date 2025-08-03 + */ +@Service +public class OrderInfoServiceImpl implements IOrderInfoService +{ + @Autowired + private OrderInfoMapper orderInfoMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + @Override + public OrderInfo selectOrderInfoById(String id) + { + return orderInfoMapper.selectOrderInfoById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param orderInfo 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectOrderInfoList(OrderInfo orderInfo) + { + return orderInfoMapper.selectOrderInfoList(orderInfo); + } + + /** + * 新增【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertOrderInfo(OrderInfo orderInfo) + { + orderInfo.setCreateTime(DateUtils.getNowDate()); + return orderInfoMapper.insertOrderInfo(orderInfo); + } + + /** + * 修改【请填写功能名称】 + * + * @param orderInfo 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateOrderInfo(OrderInfo orderInfo) + { + orderInfo.setUpdateTime(DateUtils.getNowDate()); + return orderInfoMapper.updateOrderInfo(orderInfo); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteOrderInfoByIds(String[] ids) + { + return orderInfoMapper.deleteOrderInfoByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteOrderInfoById(String id) + { + return orderInfoMapper.deleteOrderInfoById(id); + } + + @Override + public AjaxResult createOrder(OrderInfo orderInfo) { + LoginUser userInfo = SecurityUtils.getLoginUser(); + + if (userInfo != null){ + //orderInfo.setPayStatus(); + } + + return null; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecommendInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecommendInfoServiceImpl.java index 245026e..5ce6b41 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecommendInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecommendInfoServiceImpl.java @@ -93,6 +93,7 @@ public class RecommendInfoServiceImpl implements IRecommendInfoService @Override public int deleteRecommendInfoByIds(Long[] ids) { + musicRecommendMapper.deleteMusicRecommendByIds(ids); return recommendInfoMapper.deleteRecommendInfoByIds(ids); } diff --git a/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml index 06b4714..3eb1cce 100644 --- a/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/CategoryInfoMapper.xml @@ -102,4 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" DELETE FROM music_category where category_id =#{categoryId} + + + delete from music_category where category_id in + + #{id} + + diff --git a/ruoyi-system/src/main/resources/mapper/system/OrderInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/OrderInfoMapper.xml new file mode 100644 index 0000000..f33f3c0 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/OrderInfoMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, order_id, order_name, user_id, amount, pay_type, pay_time, pay_status, start_time, end_time, create_time, id_del, update_time, call_time, package_type, callback_content, trade_no, refund_amount, refund_time, client_ip, device_type, version from order_info + + + + + + + + insert into order_info + + order_id, + order_name, + user_id, + amount, + pay_type, + pay_time, + pay_status, + start_time, + end_time, + create_time, + id_del, + update_time, + call_time, + package_type, + callback_content, + trade_no, + refund_amount, + refund_time, + client_ip, + device_type, + version, + + + #{orderId}, + #{orderName}, + #{userId}, + #{amount}, + #{payType}, + #{payTime}, + #{payStatus}, + #{startTime}, + #{endTime}, + #{createTime}, + #{idDel}, + #{updateTime}, + #{callTime}, + #{packageType}, + #{callbackContent}, + #{tradeNo}, + #{refundAmount}, + #{refundTime}, + #{clientIp}, + #{deviceType}, + #{version}, + + + + + update order_info + + order_id = #{orderId}, + order_name = #{orderName}, + user_id = #{userId}, + amount = #{amount}, + pay_type = #{payType}, + pay_time = #{payTime}, + pay_status = #{payStatus}, + start_time = #{startTime}, + end_time = #{endTime}, + create_time = #{createTime}, + id_del = #{idDel}, + update_time = #{updateTime}, + call_time = #{callTime}, + package_type = #{packageType}, + callback_content = #{callbackContent}, + trade_no = #{tradeNo}, + refund_amount = #{refundAmount}, + refund_time = #{refundTime}, + client_ip = #{clientIp}, + device_type = #{deviceType}, + version = #{version}, + + where id = #{id} + + + + delete from order_info where id = #{id} + + + + delete from order_info where id in + + #{id} + + + \ No newline at end of file