فهرست منبع

refactor(app): 优化课程和订单相关功能

- 在 AppCoureseServiceImpl 中添加原始价格设置逻辑
- 在 AppOrderMapper.xml 中添加订单类型过滤条件
- 在 AppOrderServiceImpl 中更新订单总价获取逻辑
- 在 CommercialController 中增加课程 ID 参数以过滤家庭成员列表
- 移除未使用的支付回调相关类和接口
wzq 2 هفته پیش
والد
کامیت
61211dd405

+ 11 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java

@@ -20,6 +20,7 @@ import org.jeecg.modules.app.vo.*;
 import org.jeecg.modules.redission.RedissonDelayQueue;
 import org.jeecg.modules.system.app.entity.AppCoursesPriceRules;
 import org.jeecg.modules.system.app.entity.AppCoursesVerificationRecord;
+import org.jeecg.modules.system.app.entity.AppOrderProInfo;
 import org.jeecg.modules.system.app.entity.FamilyMembers;
 import org.jeecg.modules.system.app.form.VerifyForm;
 import org.jeecg.modules.system.app.service.*;
@@ -41,6 +42,8 @@ public class CommercialController {
 
     private final IAppOrderService appOrderService;
 
+    private final IAppOrderProInfoService appOrderProInfoService;
+
     private final IAppCoureseService appCoureseService;
 
     private final IAppCoursesPriceRulesService appCoursesPriceRulesService;
@@ -131,9 +134,15 @@ public class CommercialController {
      */
     @Operation(summary = "根据姓名查询用户 ")
     @GetMapping("/getFamilyMembersByName")
-    public Result<List<FamilyMembers>> getFamilyMembersByName(@Schema(description = "页数") @RequestParam(name = "name") String name) {
+    public Result<List<FamilyMembers>> getFamilyMembersByName(@RequestParam(name = "courseId") String courseId,@RequestParam(name = "name") String name) {
+        List<AppOrderProInfo> orderProInfoList = appOrderProInfoService.list(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getProductId, courseId));
+        List<String> familUserIds = orderProInfoList.stream().map(AppOrderProInfo::getFamilyUserId).distinct().collect(Collectors.toList());
         List<FamilyMembers> list = familyMembersService.list(Wrappers.<FamilyMembers>lambdaQuery().like(FamilyMembers::getFullName, name));
-        return Result.OK(list);
+        // 去除list中存在于familUserIds的元素
+        List<FamilyMembers> differenceList = list.stream()
+                .filter(e -> !familUserIds.contains(e.getId()))
+                .collect(Collectors.toList());
+        return Result.OK(differenceList);
     }
 
     /**

+ 0 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IOrderService.java

@@ -8,8 +8,6 @@ import org.jeecg.modules.app.form.UserPayForm;
 import org.jeecg.modules.app.vo.OrderVO;
 import org.jeecg.modules.app.vo.PageOrdersVO;
 import org.jeecg.modules.app.vo.QueryOrderVerifyRecordsVO;
-import org.jeecg.modules.pay.vo.NotifyRequest;
-import org.jeecg.modules.pay.vo.NotifyResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
@@ -88,8 +86,6 @@ public interface IOrderService {
 
     List<QueryOrderVerifyRecordsVO> queryOrderVerifyRecords(String orderId, String ticketNo);
 
-    NotifyResponse orderNotify(NotifyRequest notifyRequestForm);
-
     String orderQuery(String orderCode) throws IOException;
 
     String cancelOrder(String orderId);

+ 0 - 68
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/pay/vo/NotifyRequest.java

@@ -1,68 +0,0 @@
-package org.jeecg.modules.pay.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 回调函数
- * </p>
- *
- * @author HY
- * @date 2024-08-18 19:52
- */
-@Data
-@Accessors(chain = true)
-@Schema(description = "支付回调接收对象")
-public class NotifyRequest implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    //	商户号
-    public String merchant_no;
-    //商户交易流水号
-    public String out_trade_no;
-    //	拉卡拉交易流水号
-    public String trade_no;
-    //拉卡拉对账单流水号
-    public String log_no;
-    //账户端交易订单号
-    public String acc_trade_no;
-    //钱包类型
-    public String account_type;
-    //结算商户号
-    public String settle_merchant_no;
-    //结算终端号
-    public String settle_term_no;
-    //交易状态
-    public String trade_status;
-    //	订单金额
-    public String total_amount;
-    //付款人实付金额
-    public String payer_amount;
-    //账户端结算金额
-    public String acc_settle_amount;
-    //商户侧优惠金额(账户端)
-    public String acc_mdiscount_amount;
-    //账户端优惠金额
-    public String acc_discount_amount;
-    //账户端其它优惠金额
-    public String acc_other_discount_amount;
-    //交易完成时间
-    public String trade_time;
-    //用户标识1
-    public String user_id1;
-    //用户标识2
-    public String user_id2;
-    //活动 ID
-    public String acc_activity_id;
-    //付款银行
-    public String bank_type;
-    //银行卡类型
-    public String card_type;
-    //	备注
-    public String remark;
-}

+ 0 - 24
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/pay/vo/NotifyResponse.java

@@ -1,24 +0,0 @@
-package org.jeecg.modules.pay.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-@Data
-@Accessors(chain = true)
-@Schema(description = "支付回调响应对象")
-public class NotifyResponse implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * {
-     *     "code": "SUCCESS",
-     *     "message": "执行成功"
-     * }
-     */
-    private String code;
-
-    private String message;
-}

+ 1 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppOrderMapper.xml

@@ -95,6 +95,7 @@
           AND b.date_of_sale = #{date}
           AND b.start_time = #{startTime}
           AND b.end_time = #{endTime}
+          AND opi.type <![CDATA[!=]]> 6
           AND b.del_flag = 0;
     </select>
     <select id="pageOrders" resultType="org.jeecg.modules.app.vo.PageOrdersVO">

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java

@@ -86,6 +86,9 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             appCourses.setTenantId(site.getTenantId());
             appCourses.setSiteId(site.getId());
         }
+        if (ObjUtil.isNotEmpty(appCourses.getOriginalPrice())){
+            appCourses.setOriginalPrice(appCourses.getSellingPrice());
+        }
         if (appCoursesDTO.getCourses().getSellingPrice() == null ||
                 appCoursesDTO.getCourses().getSellingPrice().compareTo(BigDecimal.ZERO) == 0) {
             appCourses.setPriceType(1);

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppOrderServiceImpl.java

@@ -171,7 +171,7 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
         appOrderInfoVO.setNikeName(sysUser.getUsername());
         appOrderInfoVO.setPhoneNumber(sysUser.getPhone());
         //费用信息
-        appOrderInfoVO.setTotalPrice(appOrder.getOriginalPrice());
+        appOrderInfoVO.setTotalPrice(appOrder.getPrice());
         appOrderInfoVO.setPrice(appOrder.getPrice());
         //使用记录
         List<AppIsinVO> appIsinVOList = new ArrayList<>();