瀏覽代碼

fix(app):
1、bug修复
2、删除拉卡拉相关资源

wzq 4 周之前
父節點
當前提交
eb66f87c0d

+ 2 - 35
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -770,39 +770,6 @@ public class OrderServiceImpl implements IOrderService {
                 List<AppCoursesPriceRules> priceRulesList = appCoursesPriceRulesMapper.selectList(Wrappers.<AppCoursesPriceRules>lambdaQuery().eq(AppCoursesPriceRules::getCoursesId, appCourse.getId()));
                 AppSite appSite = appSiteMapper.selectById(appCourse.getAddressSiteId());
 
-                String productId = createOrderForm.getProductIds();
-
-                productKey = "ORDER_TYPE_5_PRODUCT_" + productId; // ORDER_TYPE_1_PRODUCT_N001
-                stockKey = "ORDER_TYPE_5_PRODUCT_STOCK_" + productId; // ORDER_TYPE_1_PRODUCT_STOCK_N001
-
-                // 查询库存
-                Integer stock = (Integer) redisTemplate.opsForValue().get(stockKey);
-                // 缓存没有商品库存,查询数据库
-                if (stock == null) {
-                    AppSitePriceRules product = appSitePriceRulesMapper.selectById(productId);
-                    if (Objects.isNull(product)) {
-                        throw new JeecgBootException("订单提交失败,商品已下架");
-                    }
-                    redisTemplate.opsForValue().set(productKey, JSON.toJSONString(product));
-                    // 数据库的库存信息要根据实际业务来获取,如果商品有规格信息,库存应该根据规格来获取
-                    stock = product.getTicketNum();
-                    redisTemplate.opsForValue().set(stockKey, stock);
-                }
-
-                // 检查库存是否足够
-                if (stock < count) {
-                    throw new JeecgBootException("订单提交失败,库存不足");
-                }
-
-                // 更新数据库中的库存数据
-                int row = appSitePriceRulesMapper.update(null, Wrappers.<AppSitePriceRules>lambdaUpdate()
-                        .eq(AppSitePriceRules::getId, productId)
-                        .set(AppSitePriceRules::getTicketNum, stock - count));
-                if (row > 0) {
-                    // 更新Redis中缓存的商品库存数据
-                    redisTemplate.opsForValue().decrement(stockKey, count);
-                }
-
                 appOrder.setType(CommonConstant.ORDER_TYPE_2);
                 appOrder.setOrgCode(appCourse.getOrgCode());
                 appOrder.setTenantId(appCourse.getTenantId());
@@ -1040,7 +1007,7 @@ public class OrderServiceImpl implements IOrderService {
         params.put("attach", appOrder.getOrderCode()); //附加数据 选填
         // 在查询API和支付通知中原样返回 可作为自定义参数使用
         params.put("notify_url", WechatUrlConstants.PAY_V3_NOTIFY); //支付结果异步通知接口
-
+        params.put("trade_type", WechatConstants.WECHAT_MP_TRADE_TYPE);//JSAPI
         //分账必传参数
         JSONObject settleInfo = new JSONObject();
         settleInfo.put("profit_sharing", Boolean.TRUE);
@@ -1060,7 +1027,7 @@ public class OrderServiceImpl implements IOrderService {
         params.put("payer", payer);
 
         //拉起支付-返回JSAPI参数
-//        Map<String, String> result = weChatPayService.wechatPay(params);
+        Map<String, String> result = weChatPayService.wechatPay(params);
 //        payForm.setParams(result);
 
         //发布任务到redission延迟队列

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/quartz/job/OrTeachingJobService.java

@@ -106,12 +106,14 @@ public class OrTeachingJobService {
                         data.forEach(item -> {
                             String startTime = item.getStartTime();
                             String endTime = item.getEndTime();
+                            Integer ticketNum = Integer.valueOf(item.getTicketNum());
                             AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
                             appSitePriceRules
                                     .setOrgCode(site.getOrgCode())
                                     .setTenantId(site.getTenantId())
                                     .setSitePlaceId(appSitePlace.getId())
                                     .setType(0)
+                                    .setTicketNum(ticketNum)
                                     .setDateOfSale(localDate)
                                     .setStartTime(DateUtils.str2Date(startTime, new SimpleDateFormat("HH:mm")))
                                     .setEndTime(DateUtils.str2Date(endTime, new SimpleDateFormat("HH:mm")))
@@ -131,12 +133,14 @@ public class OrTeachingJobService {
                         data.forEach(item -> {
                             String startTime = item.getStartTime();
                             String endTime = item.getEndTime();
+                            Integer ticketNum = Integer.valueOf(item.getTicketNum());
                             AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
                             appSitePriceRules
                                     .setOrgCode(site.getOrgCode())
                                     .setTenantId(site.getTenantId())
                                     .setSitePlaceId(appSitePlace.getId())
                                     .setType(0)
+                                    .setTicketNum(ticketNum)
                                     .setDateOfSale(localDate)
                                     .setStartTime(DateUtils.str2Date(startTime, new SimpleDateFormat("HH:mm")))
                                     .setEndTime(DateUtils.str2Date(endTime, new SimpleDateFormat("HH:mm")))

+ 2 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCourses.java

@@ -1,9 +1,6 @@
 package org.jeecg.modules.system.app.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -145,6 +142,7 @@ public class AppCourses implements Serializable {
     /**乐观锁*/
     @Excel(name = "乐观锁", width = 15)
     @Schema(description = "乐观锁")
+    @Version
     private java.lang.Integer revision;
     /**创建人;创建人*/
     @Schema(description = "创建人;创建人")

+ 2 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrder.java

@@ -1,9 +1,6 @@
 package org.jeecg.modules.system.app.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -139,6 +136,7 @@ public class AppOrder implements Serializable {
 	/**乐观锁*/
 	@Excel(name = "乐观锁", width = 15)
     @Schema(description = "乐观锁")
+    @Version
     private Integer revision;
 	/**创建人;创建人*/
     @Schema(description = "创建人;创建人")

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppCoursesMapper.xml

@@ -171,7 +171,7 @@
             c.cover,
             c.start_time,
             c.end_time,
-            s.address,
+            s.name AS address,
             c.original_price,
             c.selling_price,
             c.racking_status,
@@ -181,7 +181,7 @@
         FROM
             `nm_courses` c
             left JOIN nm_site s ON c.address_site_id = s.id
-        WHERE 1=1 and c.del_flag = '0'
+        WHERE 1=1 and c.del_flag = 0
         <if test="dto.orgCode != null and dto.orgCode != ''">
             AND c.org_code LIKE CONCAT(#{ dto.orgCode },'%')
         </if>

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

@@ -315,6 +315,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
 
                                 String startTime = item.getStartTime();
                                 String endTime = item.getEndTime();
+                                Integer ticketNum = Integer.valueOf(item.getTicketNum());
 
                                 AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
                                 appSitePriceRules
@@ -322,6 +323,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
                                         .setTenantId(site.getTenantId())
                                         .setSitePlaceId(appSitePlace.getId())
                                         .setType(0)
+                                        .setTicketNum(ticketNum)
                                         .setDateOfSale(localDate)
                                         .setStartTime(DateUtils.str2Date(startTime, new SimpleDateFormat("HH:mm")))
                                         .setEndTime(DateUtils.str2Date(endTime, new SimpleDateFormat("HH:mm")))
@@ -343,6 +345,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
 
                                 String startTime = item.getStartTime();
                                 String endTime = item.getEndTime();
+                                Integer ticketNum = Integer.valueOf(item.getTicketNum());
 
                                 AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
                                 appSitePriceRules
@@ -350,6 +353,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
                                         .setTenantId(site.getTenantId())
                                         .setSitePlaceId(appSitePlace.getId())
                                         .setType(0)
+                                        .setTicketNum(ticketNum)
                                         .setDateOfSale(localDate)
                                         .setStartTime(DateUtils.str2Date(startTime, new SimpleDateFormat("HH:mm")))
                                         .setEndTime(DateUtils.str2Date(endTime, new SimpleDateFormat("HH:mm")))