Quellcode durchsuchen

feat(app):
1.商家端相关接口

wzq vor 2 Tagen
Ursprung
Commit
c06c34fb2d
24 geänderte Dateien mit 399 neuen und 41 gelöschten Zeilen
  1. 15 0
      national-motion-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
  2. 56 4
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java
  3. 26 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/form/ClassPostponeForm.java
  4. 2 2
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/form/CreateOrderForm.java
  5. 4 2
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java
  6. 27 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/AppOrderProInfoVerifyVO.java
  7. 25 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/FamilyUserVO.java
  8. 39 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/ScanCodeQueryOrderVO.java
  9. 7 7
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppSitePlaceController.java
  10. 4 4
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppTeachingTimeController.java
  11. 6 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCoursesPriceRules.java
  12. 3 3
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppIsin.java
  13. 3 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrder.java
  14. 1 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrderProInfo.java
  15. 2 6
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppTeachingTimeMapper.java
  16. 3 5
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppTeachingTimeMapper.xml
  17. 6 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppCoureseService.java
  18. 7 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppOrderService.java
  19. 1 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppSitePlaceService.java
  20. 1 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppTeachingTimeService.java
  21. 63 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java
  22. 94 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppOrderServiceImpl.java
  23. 2 2
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppSitePlaceServiceImpl.java
  24. 2 2
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppTeachingTimeServiceImpl.java

+ 15 - 0
national-motion-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java

@@ -656,4 +656,19 @@ public interface CommonConstant {
     Integer ORDER_PRO_INFO_TYPE_6 = 6;
     Integer ORDER_PRO_INFO_TYPE_7 = 7;
 
+
+    /**
+     *  券状态 0-待使用 1-已使用 2-已失效
+     */
+    Integer ISIN_STATUS_0 = 0;
+    Integer ISIN_STATUS_1 = 1;
+    Integer ISIN_STATUS_2 = 2;
+
+    /**
+     * 子订单状态(0-待使用 1-已使用 2-已取消)
+     */
+    Integer ORDER_STATUS_0 = 0;
+    Integer ORDER_STATUS_1 = 1;
+    Integer ORDER_STATUS_2 = 2;
+
 }

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

@@ -12,14 +12,15 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.app.form.ClassPostponeForm;
 import org.jeecg.modules.app.form.CourseQueryUsersForm;
+import org.jeecg.modules.app.vo.FamilyUserVO;
+import org.jeecg.modules.app.vo.ScanCodeQueryOrderVO;
 import org.jeecg.modules.app.vo.VerifyCourseInfoVO;
 import org.jeecg.modules.system.app.entity.AppCourses;
+import org.jeecg.modules.system.app.entity.AppCoursesPriceRules;
 import org.jeecg.modules.system.app.entity.AppCoursesVerificationRecord;
 import org.jeecg.modules.system.app.entity.FamilyMembers;
 import org.jeecg.modules.system.app.form.CoursesVerificationRecordForm;
-import org.jeecg.modules.system.app.service.IAppCoureseService;
-import org.jeecg.modules.system.app.service.IAppCoursesVerificationRecordService;
-import org.jeecg.modules.system.app.service.IFamilyMembersService;
+import org.jeecg.modules.system.app.service.*;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -31,8 +32,12 @@ import java.util.List;
 @RequestMapping("/app/course")
 public class CommercialController {
 
+    private final IAppOrderService appOrderService;
+
     private final IAppCoureseService appCoureseService;
 
+    private final IAppCoursesPriceRulesService appCoursesPriceRulesService;
+
     private final IAppCoursesVerificationRecordService appCoursesVerificationRecordService;
 
     private final IFamilyMembersService familyMembersService;
@@ -124,10 +129,57 @@ public class CommercialController {
         return Result.OK(appCoureseService.temporaryCourse(coursePriceRulesId, userId));
     }
 
+    /**
+     * 课时延期学生列表
+     *
+     * @param coursePriceRulesId
+     * @return
+     */
+    @Operation(summary = "课时延期学生列表")
+    @GetMapping("/getClassPostponeUsers")
+    public Result<List<FamilyUserVO>> getClassPostponeUsers(@Schema(description = "课时ID") @RequestParam(name = "coursePriceRulesId") String coursePriceRulesId) {
+        return Result.OK(appCoureseService.getClassPostponeUsers(coursePriceRulesId));
+    }
+
+    /**
+     * 课时延期(创建补课课时)
+     *
+     * @param form
+     * @return
+     */
     @Operation(summary = "课时延期(创建补课课时)")
     @PostMapping("/classPostpone")
     public Result<Boolean> classPostpone(@RequestBody ClassPostponeForm form) {
+        return Result.OK(appCoureseService.classPostpone(form));
+    }
+
+    /**
+     * 扫码核销查询订单详情
+     *
+     * @param orderId
+     * @return
+     */
+    @Operation(summary = "扫码核销查询订单详情")
+    @GetMapping("/scanCodeQueryOrder")
+    public Result<ScanCodeQueryOrderVO> scanCodeQueryOrder(@Schema(description = "课时ID") @RequestParam(name = "orderId") String orderId) {
+        return Result.OK(appOrderService.scanCodeQueryOrder(orderId));
+    }
+
+    /**
+     * 扫码核销(查询订单详情)
+     *
+     * @param orderProInfoIds
+     * @return
+     */
+    @Operation(summary = "扫码核销确认")
+    @GetMapping("/scanCodeVerification")
+    public Result<Boolean> scanCodeVerification(@RequestBody List<String> orderProInfoIds) {
+        return Result.OK(appOrderService.scanCodeVerification(orderProInfoIds));
+    }
 
-        return Result.OK();
+    @Operation(summary = "查询补课课表")
+    @GetMapping("/queryMakeUpClassTable")
+    public Result<List<AppCoursesPriceRules>> queryMakeUpClassTable() {
+        return Result.OK(appCoursesPriceRulesService.list(Wrappers.<AppCoursesPriceRules>lambdaQuery().eq(AppCoursesPriceRules::getCoursesType,1)));
     }
 }

+ 26 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/form/ClassPostponeForm.java

@@ -1,11 +1,16 @@
 package org.jeecg.modules.app.form;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.modules.app.vo.FamilyUserVO;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
 
 @Data
 @Accessors(chain = true)
@@ -14,5 +19,26 @@ import java.io.Serializable;
 public class ClassPostponeForm implements Serializable {
     private static final long serialVersionUID = 1L;
 
+    @Schema(description = "订单ID")
+    private String orderId;
 
+    @Schema(description = "所选课时ID")
+    private String coursePriceRulesId;
+
+    //补课课时
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "开始时间")
+    private Date startTime;
+
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "结束时间")
+    private Date endTime;
+
+    @Schema(description = "用户列表")
+    private List<FamilyUserVO> familyUserVOList;
+
+    @Schema(description = "延课原因")
+    private String postponeReason;
 }

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/form/CreateOrderForm.java

@@ -22,8 +22,8 @@ public class CreateOrderForm implements Serializable {
     @NotNull(message = "订单类型不能为空")
     public Integer type;
 
-    @Schema(description = "场地类型;0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛")
-    //场地类型;0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛
+    @Schema(description = "订单子类型;0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛")
+    //订单子类型;0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛
     public Integer orderType;
 
     //商品IDs

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

@@ -19,7 +19,6 @@ import org.jeecg.modules.app.form.CreateOrderForm;
 import org.jeecg.modules.app.form.InsureOrderInfoForm;
 import org.jeecg.modules.app.form.UserPayForm;
 import org.jeecg.modules.app.service.IOrderService;
-import org.jeecg.modules.app.vo.CoursesPriceRulesVO;
 import org.jeecg.modules.app.vo.OrderVO;
 import org.jeecg.modules.app.vo.VerifyCourseInfoDTO;
 import org.jeecg.modules.system.app.entity.*;
@@ -269,6 +268,7 @@ public class OrderServiceImpl implements IOrderService {
         //创建订单
         AppOrder appOrder = new AppOrder();
         appOrder
+                .setOrderType(createOrderForm.getOrderType())
                 .setOrderCode(orderCode)
                 .setUserId(user.getId())
                 .setUserPhone(user.getPhone())
@@ -294,6 +294,7 @@ public class OrderServiceImpl implements IOrderService {
                     AppSitePlace appSitePlace = appSitePlaceMapper.selectById(priceRule.getSitePlaceId());
                     AppSite appSite = appSiteMapper.selectById(appSitePlace.getSiteId());
                     appOrder
+
                             .setPayType(3)
                             .setOrderStatus(2)
                             .setOrgCode(appSite.getOrgCode())
@@ -397,6 +398,7 @@ public class OrderServiceImpl implements IOrderService {
                         AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
                         appOrderProInfo.setProductId(createOrderForm.getProductIds());
                         appOrderProInfo.setProductName(appSitePlace.getName());
+                        appOrderProInfo.setProductImage(appSitePlace.getCover());
                         appOrderProInfo.setAddress(appSite.getAddress());
                         appOrderProInfo.setType(CommonConstant.ORDER_PRO_INFO_TYPE_3);
                         appOrderProInfo.setFrameTimeStr(appSite.getStartTime() + "-" + appSite.getEndTime());
@@ -645,7 +647,7 @@ public class OrderServiceImpl implements IOrderService {
                     .setUseAddress(StrUtil.isBlank(appOrderProInfo.getAddress()) ? null : appOrderProInfo.getAddress())
                     //生成10位随机券号
                     .setIsinCode(appOrderProInfo.getTicketNo())
-                    .setIsinStatus(CommonConstant.STATUS_0_INT);
+                    .setIsinStatus(CommonConstant.ISIN_STATUS_1);
         }
 
         //保存保险

+ 27 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/AppOrderProInfoVerifyVO.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.app.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.modules.system.app.entity.AppOrderProInfo;
+
+import java.io.Serializable;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description = "扫码验课商品信息响应对象")
+public class AppOrderProInfoVerifyVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "券ID")
+    private String isinId;
+
+    @Schema(description = "券状态 1、待使用 2、已使用 3、已失效")
+    private Integer isinStatus;
+
+    @Schema(description = "子订单商品")
+    private AppOrderProInfo appOrderProInfo;
+}

+ 25 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/FamilyUserVO.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.app.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description = "课时用户信息响应对象")
+public class FamilyUserVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "用户ID")
+    private String familyUserId;
+
+    @Schema(description = "用户名称")
+    private String familyUserName;
+
+    @Schema(description = "用户人脸图片")
+    private String familyUserImage;
+}

+ 39 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/vo/ScanCodeQueryOrderVO.java

@@ -0,0 +1,39 @@
+package org.jeecg.modules.app.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description = "课时用户信息响应对象")
+public class ScanCodeQueryOrderVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "场馆")
+    private String siteName;
+
+    @Schema(description = "商品名称")
+    private String productName;
+
+    @Schema(description = "商品价格")
+    private BigDecimal price;
+
+    @Schema(description = "比赛类型 0-个人 1-团队")
+    private Integer gameType;
+
+    @Schema(description = "商品数量")
+    private Integer amount;
+
+    @Schema(description = "商品图片")
+    private String productImage;
+
+    @Schema(description = "子订单信息")
+    private List<AppOrderProInfoVerifyVO> appOrderProInfoVerifyVOS;
+}

+ 7 - 7
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppSitePlaceController.java

@@ -157,16 +157,16 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
     }
 
     /**
-     * 根据部门ID查询site列表
+     * 根据orgCode查询site列表
      *
-     * @param deptId
+     * @param orgCode
      * @return
      */
-    @AutoLog(value = "根据部门ID查询商户信息列表")
-    @Operation(summary = "根据部门ID查询site列表")
-    @GetMapping(value = "/queryByDeptId/{deptId}")
-    public Result<List<AppSite>> queryByDeptId(@PathVariable(name = "deptId") String deptId) {
-        List<AppSite> appSites = appSitePlaceService.queryByDeptId(deptId);
+    @AutoLog(value = "根据orgCode查询商户信息列表")
+    @Operation(summary = "根据orgCode查询site列表")
+    @GetMapping(value = "/queryByOrgCode/{orgCode}")
+    public Result<List<AppSite>> queryByOrgCode(@PathVariable(name = "orgCode") String orgCode) {
+        List<AppSite> appSites = appSitePlaceService.queryByOrgCode(orgCode);
         return Result.OK(appSites);
     }
 

+ 4 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppTeachingTimeController.java

@@ -167,14 +167,14 @@ public class AppTeachingTimeController extends JeecgController<AppTeachingTime,
 	 /**
 	  * 通过tenantId查询
 	  *
-	  * @param tenantId
+	  * @param orgCode
 	  * @return
 	  */
 	 //@AutoLog(value = "教学/非教学维护表-通过id查询")
 	 @Operation(summary="教学/非教学维护表-通过tenantId查询当前月与下月-教学/非教学")
-	 @GetMapping(value = "/queryByTenantId")
-	 public Result<List<AppTeachingTimeDTO>> queryByTenantId(@RequestParam(name="tenantId",required=true) String tenantId) {
-		 return Result.OK(appTeachingTimeService.queryListByTenantId(tenantId));
+	 @GetMapping(value = "/queryByOrgCode")
+	 public Result<List<AppTeachingTimeDTO>> queryByOrgCode(@RequestParam(name = "orgCode", required = true) String orgCode) {
+		 return Result.OK(appTeachingTimeService.queryListByOrgCode(orgCode));
 	 }
 
 }

+ 6 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCoursesPriceRules.java

@@ -69,6 +69,12 @@ public class AppCoursesPriceRules implements Serializable {
     @Excel(name = "课程类型(0-正常 1-补课)", width = 20)
     @Schema(description = "课程类型(0-正常 1-补课)")
     private Integer coursesType;
+    /**
+     * 课时状态
+     */
+    @Excel(name = "课时状态(0-正常 1-延期)", width = 20)
+    @Schema(description = "课时状态(0-正常 1-延期)")
+    private Integer classStatus;
 	/**乐观锁*/
 	@Excel(name = "乐观锁", width = 15)
     @Schema(description = "乐观锁")

+ 3 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppIsin.java

@@ -57,9 +57,9 @@ public class AppIsin implements Serializable {
 	@Excel(name = "券码号", width = 15)
     @Schema(description = "券码号")
     private String isinCode;
-	/**券状态 1、待使用 2、已使用 3、已失效*/
-	@Excel(name = "券状态 1、待使用 2、已使用 3、已失效", width = 15)
-    @Schema(description = "券状态 1、待使用 2、已使用 3、已失效")
+	/**券状态  0-待使用 1-已使用 2-已失效*/
+	@Excel(name = "券状态  0-待使用 1-已使用 2-已失效", width = 15)
+    @Schema(description = "券状态  0-待使用 1-已使用 2-已失效")
     private Integer isinStatus;
     @Excel(name = "核验人ID", width = 15)
     @Schema(description = "核验人ID")

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

@@ -42,6 +42,9 @@ public class AppOrder implements Serializable {
     @Excel(name = "订单类型", width = 15)
     @Schema(description = "订单类型 0场地/1赛事/2课程")
     private Integer type;
+    @Excel(name = "订单子类型", width = 15)
+    @Schema(description = "订单子类型 0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程")
+    private Integer orderType;
     /**部门id*/
     @Excel(name = "部门编码", width = 15)
     @Schema(description = "部门编码")

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppOrderProInfo.java

@@ -70,7 +70,7 @@ public class AppOrderProInfo  implements Serializable {
     private BigDecimal originalPrice;
     @Schema(description = "实际价格/元")
     private BigDecimal price;
-    @Schema(description = "订单状态")
+    @Schema(description = "订单状态 0-待使用 1-已使用 2-已取消")
     private Integer orderStatus;
     @Schema(description = "售后状态")
     private Integer afterSaleStatus;

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

@@ -2,12 +2,8 @@ package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.system.app.dto.AppTeachingTimeDTO;
-import org.jeecg.modules.system.app.entity.AppTeachingTime;
-
-import java.util.List;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.app.vo.OrderVO;
+import org.jeecg.modules.system.app.dto.AppTeachingTimeDTO;
 import org.jeecg.modules.system.app.entity.AppTeachingTime;
 
 import java.util.List;
@@ -28,7 +24,7 @@ public interface AppTeachingTimeMapper extends BaseMapper<AppTeachingTime> {
      **/
     List<OrderVO.PreviewOrderPlaceSchoolTime> previewOrderPlaceSchoolTime(String orgCode);
 
-    List<AppTeachingTimeDTO> queryListByTenantId(@Param("tenantId") String tenantId);
+    List<AppTeachingTimeDTO> queryListByOrgCode(@Param("orgCode") String orgCode);
 
     int insertList(@Param("list") List<AppTeachingTime> list);
 }

+ 3 - 5
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppTeachingTimeMapper.xml

@@ -23,7 +23,7 @@
 	    AND CURDATE() + INTERVAL 6 DAY
 	    AND a.org_code = #{orgCode};
     </select>
-    <select id="queryListByTenantId" resultType="org.jeecg.modules.system.app.dto.AppTeachingTimeDTO">
+    <select id="queryListByOrgCode" resultType="org.jeecg.modules.system.app.dto.AppTeachingTimeDTO">
         SELECT
             t1.id,
             t1.`day`,
@@ -31,8 +31,7 @@
             t1.org_code
         FROM
             `nm_teaching_time` t1
-        WHERE
-            t1.tenant_id = #{tenantId}
+        WHERE t1.org_code = #{orgCode}
         AND t1.`status` = 0
         AND MONTH(t1.`day`) = MONTH(CURRENT_DATE)
         UNION
@@ -43,8 +42,7 @@
             t2.org_code
         FROM
             `nm_teaching_time` t2
-        WHERE
-            t2.tenant_id = #{tenantId}
+        WHERE t2.org_code = #{orgCode}
         AND t2.`status` = 0
         AND MONTH(t2.`day`) = MONTH(DATE_ADD(CURRENT_DATE, INTERVAL 1 MONTH))
     </select>

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

@@ -2,6 +2,8 @@ package org.jeecg.modules.system.app.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.app.form.ClassPostponeForm;
+import org.jeecg.modules.app.vo.FamilyUserVO;
 import org.jeecg.modules.app.vo.VerifyCourseInfoVO;
 import org.jeecg.modules.system.app.dto.AppCoursesDTO;
 import org.jeecg.modules.system.app.dto.AppCoursesInfoPageDTO;
@@ -50,4 +52,8 @@ public interface IAppCoureseService extends IService<AppCourses> {
     VerifyCourseInfoVO getCourseInfo(String courseId);
 
     Boolean temporaryCourse(String coursePriceRulesId, String userId);
+
+    List<FamilyUserVO> getClassPostponeUsers(String coursePriceRulesId);
+
+    Boolean classPostpone(ClassPostponeForm form);
 }

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

@@ -2,12 +2,15 @@ package org.jeecg.modules.system.app.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.app.vo.ScanCodeQueryOrderVO;
 import org.jeecg.modules.system.app.dto.AppOrderDTO;
 import org.jeecg.modules.system.app.entity.AppOrder;
 import org.jeecg.modules.system.app.form.AppOrderPageForm;
 import org.jeecg.modules.system.app.vo.AppOrderInfoVO;
 import org.jeecg.modules.system.app.vo.OrderPageVO;
 
+import java.util.List;
+
 /**
  * @Description: 订单表
  * @Author: jeecg-boot
@@ -46,4 +49,8 @@ public interface IAppOrderService extends IService<AppOrder> {
     Page<OrderPageVO> queryPage(AppOrderPageForm appOrderPageForm);
 
     AppOrderInfoVO queryInfoById(String orderId);
+
+    ScanCodeQueryOrderVO scanCodeQueryOrder(String orderId);
+
+    Boolean scanCodeVerification(List<String> orderProInfoIds);
 }

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

@@ -117,5 +117,5 @@ public interface IAppSitePlaceService extends IService<AppSitePlace> {
 
     AppSitePlaceParkDTO queryPack(String siteId);
 
-    List<AppSite> queryByDeptId(String deptId);
+    List<AppSite> queryByOrgCode(String orgCode);
 }

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

@@ -15,5 +15,5 @@ import java.util.List;
 public interface IAppTeachingTimeService extends IService<AppTeachingTime> {
 
 
-    List<AppTeachingTimeDTO> queryListByTenantId(String tenantId);
+    List<AppTeachingTimeDTO> queryListByOrgCode(String orgCode);
 }

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

@@ -10,7 +10,9 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.app.form.ClassPostponeForm;
 import org.jeecg.modules.app.vo.CoursesPriceRulesVO;
+import org.jeecg.modules.app.vo.FamilyUserVO;
 import org.jeecg.modules.app.vo.VerifyCourseInfoDTO;
 import org.jeecg.modules.app.vo.VerifyCourseInfoVO;
 import org.jeecg.modules.system.app.dto.*;
@@ -47,13 +49,15 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
     private AppCoursesVerificationRecordMapper appCoursesVerificationRecordMapper;
     @Resource
     private FamilyMembersMapper familyMembersMapper;
+    @Resource
+    private AppOrderMapper appOrderMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean saveWitchPriceRules(AppCoursesDTO appCoursesDTO) {
         AppCoursesCuDTO coursesCuDTO = appCoursesDTO.getCourses();
         if (null == coursesCuDTO.getCategoryId()) throw new JeecgBootException("请选择课程类别");
-        AppSite site = siteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getTenantId, coursesCuDTO.getSiteId()));
+        AppSite site = siteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, coursesCuDTO.getOrgCode()));
         AppCourses appCourses = new AppCourses();
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         BeanUtils.copyProperties(coursesCuDTO, appCourses);
@@ -357,6 +361,64 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
         return Boolean.TRUE;
     }
 
+    @Override
+    public List<FamilyUserVO> getClassPostponeUsers(String coursePriceRulesId) {
+
+        List<AppCoursesVerificationRecord> verificationRecordList = appCoursesVerificationRecordMapper.selectList(Wrappers.<AppCoursesVerificationRecord>lambdaQuery().eq(AppCoursesVerificationRecord::getCoursesId, coursePriceRulesId));
+
+        return verificationRecordList.stream().map(e -> {
+            FamilyUserVO familyUserVO = new FamilyUserVO();
+            familyUserVO.setFamilyUserId(e.getUseUserId()).setFamilyUserName(e.getCoursesName()).setFamilyUserImage(e.getUseUserImage());
+            return familyUserVO;
+        }).collect(Collectors.toList());
+    }
+
+    @Override
+    public Boolean classPostpone(ClassPostponeForm form) {
+
+        AppOrder appOrder = appOrderMapper.selectById(form.getOrderId());
+        //原课时
+        AppCoursesPriceRules appCoursesPriceRules = priceRulesMapper.selectById(form.getCoursePriceRulesId());
+        //设置为延期状态
+        appCoursesPriceRules.setClassStatus(CommonConstant.STATUS_1_INT);
+        List<AppCoursesVerificationRecord> verificationRecordList = appCoursesVerificationRecordMapper.selectList(Wrappers.<AppCoursesVerificationRecord>lambdaQuery().eq(AppCoursesVerificationRecord::getCoursesPriceRuleId, form.getCoursePriceRulesId()));
+        //所有记录修改为延期
+        for (AppCoursesVerificationRecord appCoursesVerificationRecord : verificationRecordList) {
+            appCoursesVerificationRecord
+                    .setOrPostpone(CommonConstant.STATUS_1_INT)
+                    .setPostponeReason(form.getPostponeReason());
+            appCoursesVerificationRecordMapper.updateById(appCoursesVerificationRecord);
+        }
+        //补课新课时
+        AppCoursesPriceRules priceRules = new AppCoursesPriceRules();
+        priceRules.setOrgCode(appCoursesPriceRules.getOrgCode());
+        priceRules.setTenantId(appCoursesPriceRules.getTenantId());
+        priceRules.setCoursesId(appCoursesPriceRules.getCoursesId());
+        priceRules.setName("(补课)" + appCoursesPriceRules.getName());
+        priceRules.setStartTime(form.getStartTime());
+        priceRules.setEndTime(form.getEndTime());
+        priceRules.setCoursesType(CommonConstant.STATUS_1_INT);
+        priceRulesMapper.insert(priceRules);
+
+        for (FamilyUserVO familyUserVO : form.getFamilyUserVOList()) {
+            AppCoursesVerificationRecord verificationRecord = new AppCoursesVerificationRecord();
+            verificationRecord.setOrderId(appOrder.getId());
+            verificationRecord.setOrderCode(appOrder.getOrderCode());
+            verificationRecord.setCoursesId(appOrder.getProductIds());
+            verificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
+            verificationRecord.setCoursesName(appCoursesPriceRules.getName());
+            verificationRecord.setCoursesStartTime(form.getStartTime());
+            verificationRecord.setCoursesEndTime(form.getEndTime());
+            verificationRecord.setUseUserId(familyUserVO.getFamilyUserId());
+            verificationRecord.setUseUserName(familyUserVO.getFamilyUserName());
+            verificationRecord.setUseUserImage(familyUserVO.getFamilyUserImage());
+            verificationRecord.setVerifyStatus(CommonConstant.STATUS_1_INT);
+            verificationRecord.setCoursesType(CommonConstant.STATUS_1_INT);
+            appCoursesVerificationRecordMapper.insert(verificationRecord);
+        }
+        return Boolean.TRUE;
+    }
+
     /**
      * 校验权限
      *

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

@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.app.vo.AppOrderProInfoVerifyVO;
+import org.jeecg.modules.app.vo.ScanCodeQueryOrderVO;
 import org.jeecg.modules.system.app.dto.AppOrderDTO;
 import org.jeecg.modules.system.app.dto.IsinUserInfoDTO;
 import org.jeecg.modules.system.app.dto.VerificationRecordDTO;
@@ -55,6 +58,23 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
     @Resource
     private AppCoursesVerificationRecordMapper appCoursesVerificationRecordMapper;
 
+    @Resource
+    private AppSitePriceRulesMapper appSitePriceRulesMapper;
+
+    @Resource
+    private AppSitePlaceMapper appSitePlaceMapper;
+
+    @Resource
+    private AppGameMapper appGameMapper;
+
+    @Resource
+    private AppGamePriceRulesMapper appGamePriceRulesMapper;
+
+    @Resource
+    private AppCoursesMapper appCoursesMapper;
+    @Resource
+    private AppCoursesPriceRulesMapper appCoursesPriceRulesMapper;
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -176,4 +196,78 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
         }
         return appOrderInfoVO;
     }
+
+    @Override
+    public ScanCodeQueryOrderVO scanCodeQueryOrder(String orderId) {
+
+        AppOrder appOrder = appOrderMapper.selectById(orderId);
+        AppSite site = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, appOrder.getOrgCode()));
+
+
+        ScanCodeQueryOrderVO scanCodeQueryOrderVO = new ScanCodeQueryOrderVO();
+        scanCodeQueryOrderVO.setSiteName(site.getName());
+        scanCodeQueryOrderVO.setAmount(appOrder.getAmount());
+
+
+        List<AppOrderProInfoVerifyVO> orderProInfoVOList = new ArrayList<>();
+        List<AppOrderProInfo> proInfoList = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getOrderId, orderId));
+
+        for (AppOrderProInfo appOrderProInfo : proInfoList) {
+
+            AppIsin appIsin = appIsinMapper.selectOne(Wrappers.<AppIsin>lambdaQuery().eq(AppIsin::getOrderProInfoId, appOrderProInfo.getId()));
+
+            AppOrderProInfoVerifyVO appOrderProInfoVerifyVO = new AppOrderProInfoVerifyVO();
+            appOrderProInfoVerifyVO.setIsinId(appIsin.getId());
+            appOrderProInfoVerifyVO.setIsinStatus(appIsin.getIsinStatus());
+            appOrderProInfoVerifyVO.setAppOrderProInfo(appOrderProInfo);
+
+            orderProInfoVOList.add(appOrderProInfoVerifyVO);
+        }
+        scanCodeQueryOrderVO.setAppOrderProInfoVerifyVOS(orderProInfoVOList);
+
+        //0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程    学校及包场即为商品不用查
+        if (appOrder.getOrderType() == 2) {
+            String productIds = appOrder.getProductIds();
+            AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(productIds);
+            AppSitePlace appSitePlace = appSitePlaceMapper.selectById(appSitePriceRules.getSitePlaceId());
+            scanCodeQueryOrderVO.setProductName(appSitePlace.getName());
+            scanCodeQueryOrderVO.setProductImage(appSitePlace.getCover());
+            scanCodeQueryOrderVO.setPrice(appSitePriceRules.getSellingPrice());
+        }
+        if (appOrder.getOrderType() == 3 || appOrder.getOrderType() == 4) {
+            AppGamePriceRules appGamePriceRules = appGamePriceRulesMapper.selectById(appOrder.getProductIds());
+            AppGame appGame = appGameMapper.selectById(appGamePriceRules.getGameId());
+
+            scanCodeQueryOrderVO.setProductName(appGame.getName());
+            scanCodeQueryOrderVO.setProductImage(appGame.getCover());
+            scanCodeQueryOrderVO.setGameType(appGamePriceRules.getType());
+            scanCodeQueryOrderVO.setPrice(appGamePriceRules.getSellingPrice());
+        }
+        if (appOrder.getOrderType() == 5) {
+            AppCourses appCourses = appCoursesMapper.selectById(appOrder.getProductIds());
+            scanCodeQueryOrderVO.setProductName(appCourses.getName());
+            scanCodeQueryOrderVO.setProductImage(appCourses.getCover());
+            scanCodeQueryOrderVO.setPrice(appCourses.getSellingPrice());
+        }
+
+        return scanCodeQueryOrderVO;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean scanCodeVerification(List<String> isinIds) {
+
+        for (String isinId : isinIds) {
+            //查询对应券号
+            AppIsin appIsin = appIsinMapper.selectById(isinId);
+            appIsin.setIsinStatus(CommonConstant.ISIN_STATUS_2);
+            appIsinMapper.updateById(appIsin);
+            //修改订单状态
+            String orderProInfoId = appIsin.getOrderProInfoId();
+            AppOrderProInfo appOrderProInfo = appOrderProInfoMapper.selectById(orderProInfoId);
+            appOrderProInfo.setOrderStatus(CommonConstant.ORDER_STATUS_1);
+            appOrderProInfoMapper.updateById(appOrderProInfo);
+        }
+        return Boolean.TRUE;
+    }
 }

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

@@ -919,8 +919,8 @@ public class AppSitePlaceServiceImpl extends ServiceImpl<AppSitePlaceMapper, App
     }
 
     @Override
-    public List<AppSite> queryByDeptId(String deptId) {
-        return appSiteMapper.selectList(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getTenantId, deptId));
+    public List<AppSite> queryByOrgCode(String orgCode) {
+        return appSiteMapper.selectList(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, orgCode));
     }
 
     /**

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

@@ -20,9 +20,9 @@ import java.util.List;
 public class AppTeachingTimeServiceImpl extends ServiceImpl<AppTeachingTimeMapper, AppTeachingTime> implements IAppTeachingTimeService {
 
     @Override
-    public List<AppTeachingTimeDTO> queryListByTenantId(String tenantId) {
+    public List<AppTeachingTimeDTO> queryListByOrgCode(String orgCode) {
 
-        List<AppTeachingTimeDTO> dtoList = baseMapper.queryListByTenantId(tenantId);
+        List<AppTeachingTimeDTO> dtoList = baseMapper.queryListByOrgCode(orgCode);
         if (ObjectUtils.isNotEmpty(dtoList)) {
             return dtoList;
         }