Bladeren bron

2022考级报名活动
1、只是单纯的考级报名,不需要购买课程
2、合并乐器和乐理考级,分开展示

zouxuan 3 jaren geleden
bovenliggende
commit
6f01551cc9

+ 17 - 21
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DegreeRegistration.java

@@ -43,7 +43,8 @@ public class DegreeRegistration extends BaseEntity {
      */
     @ApiModelProperty(value = "性别",required = true)
     private String gender;
-    
+
+    @ApiModelProperty(value = "证件类型",required = true)
 	private String certificateType;
 
     /**
@@ -82,11 +83,14 @@ public class DegreeRegistration extends BaseEntity {
     @ApiModelProperty(value = "考试类型",required = true)
     private Integer degreeType;
 
+    @ApiModelProperty(value = "1乐器考级、2乐理考级",required = true)
+    private Integer type;
+
     /**
      * 乐理级别
      */
-    @ApiModelProperty(value = "乐理级别",required = true)
-    private String theoryLevel;
+//    @ApiModelProperty(value = "乐理级别",required = true)
+//    private String theoryLevel;
 
 
     /**
@@ -116,8 +120,8 @@ public class DegreeRegistration extends BaseEntity {
     /**
      * 乐理费用
      */
-    @ApiModelProperty(value = "乐理费用",required = true)
-    private BigDecimal theoryMoney;
+//    @ApiModelProperty(value = "乐理费用",required = true)
+//    private BigDecimal theoryMoney;
 
     /**
      * 报名时间
@@ -150,6 +154,14 @@ public class DegreeRegistration extends BaseEntity {
 
     private String activityTag;
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public Integer getDegreeType() {
         return degreeType;
     }
@@ -246,14 +258,6 @@ public class DegreeRegistration extends BaseEntity {
         this.subject = subject;
     }
 
-    public String getTheoryLevel() {
-        return theoryLevel;
-    }
-
-    public void setTheoryLevel(String theoryLevel) {
-        this.theoryLevel = theoryLevel;
-    }
-
     public String getMobile() {
         return mobile;
     }
@@ -318,14 +322,6 @@ public class DegreeRegistration extends BaseEntity {
         this.level = level;
     }
 
-    public BigDecimal getTheoryMoney() {
-        return theoryMoney;
-    }
-
-    public void setTheoryMoney(BigDecimal theoryMoney) {
-        this.theoryMoney = theoryMoney;
-    }
-
     public String getTheoryCert() {
         return theoryCert;
     }

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java

@@ -657,12 +657,12 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             params.put("offset", pageInfo.getOffset());
             dataList = degreeRegistrationDao.queryPage(params);
             DegreeRegistration degree = degreeRegistrationDao.getTotalAmount(params);
-            BigDecimal subjectLevelAmount = degree.getMoney() == null ? BigDecimal.ZERO : degree.getMoney();
-            BigDecimal theoryLevelAmount = degree.getTheoryMoney() == null ? BigDecimal.ZERO : degree.getTheoryMoney();
-            BigDecimal totalAmount = subjectLevelAmount.add(theoryLevelAmount);
+            BigDecimal totalAmount = degree.getMoney() == null ? BigDecimal.ZERO : degree.getMoney();
+//            BigDecimal theoryLevelAmount = degree.getTheoryMoney() == null ? BigDecimal.ZERO : degree.getTheoryMoney();
+//            BigDecimal totalAmount = subjectLevelAmount.add(theoryLevelAmount);
             pageInfo.setApplyNum(degreeRegistrationDao.countApplyNum(params));
-            pageInfo.setSubjectLevelAmount(subjectLevelAmount);
-            pageInfo.setTheoryLevelAmount(theoryLevelAmount);
+//            pageInfo.setSubjectLevelAmount(subjectLevelAmount);
+//            pageInfo.setTheoryLevelAmount(theoryLevelAmount);
             pageInfo.setTotalAmount(totalAmount);
         }
         pageInfo.setRows(dataList);

+ 8 - 25
mec-biz/src/main/resources/config/mybatis/DegreeRegistrationMapper.xml

@@ -17,8 +17,6 @@
         <result column="school_" jdbcType="VARCHAR" property="school"/>
         <result column="subject_" jdbcType="VARCHAR" property="subject"/>
         <result column="level_" jdbcType="VARCHAR" property="level"/>
-        <result column="theory_level_" jdbcType="VARCHAR" property="theoryLevel"/>
-        <result column="theory_money_" jdbcType="DECIMAL" property="theoryMoney"/>
         <result column="theory_cert_" jdbcType="VARCHAR" property="theoryCert"/>
         <result column="mobile_" jdbcType="VARCHAR" property="mobile"/>
         <result column="money_" jdbcType="DECIMAL" property="money"/>
@@ -30,6 +28,7 @@
         <result column="degree_type_" property="degreeType"/>
         <result column="certificate_type_" property="certificateType"/>
 		<result column="tenant_id_" property="tenantId" />
+		<result column="type_" property="type" />
     </resultMap>
 
     <select id="get" parameterType="java.lang.Integer" resultMap="DegreeRegistration">
@@ -118,7 +117,7 @@
     </select>
 
     <select id="getTotalAmount" parameterType="map" resultMap="DegreeRegistration">
-        SELECT SUM(case when status_ = 2 then money_ else 0 end) money_ ,SUM(case when status_ = 2 then theory_money_ else 0 end) theory_money_ FROM degree_registration
+        SELECT SUM(case when status_ = 2 then money_ else 0 end) money_ FROM degree_registration
         <include refid="queryPageSql"/>
     </select>
 
@@ -138,15 +137,14 @@
         <!--@mbg.generated-->
         insert into degree_registration (user_id_,sporadic_id_,organ_id_,order_no_, name_, gender_,
         idcard_, city_, school_,
-        subject_,level_, theory_level_,theory_money_, theory_cert_,mobile_,
+        subject_,level_, theory_cert_,mobile_,
         money_, memo_, create_time_,
-        update_time_, status_, activity_tag_,degree_type_,certificate_type_,tenant_id_)
+        update_time_, status_, activity_tag_,degree_type_,certificate_type_,tenant_id_,type_)
         values (#{userId},#{sporadicId,jdbcType=INTEGER},#{organId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
         #{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
         #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR},
-        #{theoryLevel,jdbcType=VARCHAR},#{theoryMoney,jdbcType=DECIMAL},
         #{theoryCert,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR},
-        #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT}, #{activityTag}, #{degreeType},#{certificateType},#{tenantId})
+        #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT}, #{activityTag}, #{degreeType},#{certificateType},#{tenantId},#{type})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
         <!--@mbg.generated-->
@@ -191,13 +189,7 @@
             <if test="level != null">
                 level_ = #{level,jdbcType=VARCHAR},
             </if>
-            <if test="theoryLevel != null">
-                theory_level_ = #{theoryLevel,jdbcType=VARCHAR},
-            </if>
-            <if test="theoryLevel != null">
-                theory_money_ = #{theoryMoney,jdbcType=DECIMAL},
-            </if>
-            <if test="theoryLevel != null">
+            <if test="theoryCert != null and theoryCert != ''">
                 theory_cert_ = #{theoryCert,jdbcType=VARCHAR},
             </if>
             <if test="mobile != null">
@@ -269,13 +261,7 @@
                 <if test="degree.level != null">
                     level_ = #{degree.level,jdbcType=VARCHAR},
                 </if>
-                <if test="degree.theoryLevel != null">
-                    theory_level_ = #{degree.theoryLevel,jdbcType=VARCHAR},
-                </if>
-                <if test="degree.theoryLevel != null">
-                    theory_money_ = #{degree.theoryMoney,jdbcType=DECIMAL},
-                </if>
-                <if test="degree.theoryLevel != null">
+                <if test="degree.theoryCert != null and degree.theoryCert != ''">
                     theory_cert_ = #{degree.theoryCert,jdbcType=VARCHAR},
                 </if>
                 <if test="degree.mobile != null">
@@ -331,9 +317,6 @@
             <if test="degree.sporadicId!=null">
                 AND sporadic_id_ = #{degree.sporadicId}
             </if>
-            <if test="degree.theoryLevel!=null">
-                AND theory_level_ = #{degree.theoryLevel}
-            </if>
             <if test="degree.degreeType != null">
                 AND degree_type_ = #{degree.degreeType}
             </if>
@@ -345,7 +328,7 @@
         where
             user_id_ = #{userId}
             AND activity_tag_=#{activityTag}
-            AND (sporadic_id_ IS NOT NULL OR theory_level_ IS NOT NULL)
+            AND sporadic_id_ IS NOT NULL
             <if test="degreeType != null">
                 AND degree_type_ = #{degreeType}
             </if>

+ 41 - 64
mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java

@@ -1,55 +1,37 @@
 package com.ym.mec.student.controller;
 
 
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysTenantConfigService;
-import com.ym.mec.biz.service.impl.SysConfigServiceImpl;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpStatus;
-import org.springframework.transaction.annotation.Isolation;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-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;
-
-import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
 import com.ym.mec.biz.dal.dao.OrganizationDao;
 import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.DegreeRegistrationActivityDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.DegreeRegistration;
 import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
 import com.ym.mec.biz.service.DegreeRegistrationService;
 import com.ym.mec.biz.service.SporadicChargeInfoService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysTenantConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.idcard.IdcardValidator;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
 
 @RequestMapping("degree")
 @Api(tags = "考级报名服务")
@@ -75,9 +57,6 @@ public class DegreeController extends BaseController {
     private StudentDao studentDao;
     
     @Autowired
-    private SysConfigDao sysConfigDao;
-
-    @Autowired
     private SysTenantConfigService sysTenantConfigService;
 
     @Autowired
@@ -86,9 +65,6 @@ public class DegreeController extends BaseController {
 	@Value("${message.debugMode: false}")
 	private boolean debugMode;
 
-    @Autowired
-    private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
-
     @ApiOperation(value = "考级报名支付")
     @PostMapping("/pay")
     public HttpResponseResult pay(@RequestBody DegreeRegistrationActivityDto degreeRegistration) throws Exception {
@@ -162,6 +138,7 @@ public class DegreeController extends BaseController {
         studentDao.getLocked(degreeRegistration.getUserId());
         List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(),
                 DegreeRegistrationService.ACTIVITY_TAG,degreeRegistration.getDegreeType(),degreeRegistration.getSporadicId());
+
         long levelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
         long theoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
 
@@ -222,32 +199,32 @@ public class DegreeController extends BaseController {
 //        result.put("levelApplied", levelNum>0?1:0);
 //        result.put("theoryLevelApplied", theoryLevelNum>0?1:0);
 
-        List<StudentPaymentOrderDetail> historyOrderDetails = studentPaymentOrderDetailDao.getWithUserAndOrderType(user.getId(), OrderTypeEnum.DEGREE_REGISTRATION);
-        int historyVipNum = 0, historyPracticeNum = 0, historyHighNum = 0;
-        for (StudentPaymentOrderDetail historyOrderDetail : historyOrderDetails) {
-            if(StringUtils.isBlank(historyOrderDetail.getGoodsIdList())){
-                continue;
-            }
-            Map<String, Integer> courseNumMap = JSON.parseObject(historyOrderDetail.getGoodsIdList(), Map.class);
-            for (Map.Entry<String, Integer> stringIntegerEntry : courseNumMap.entrySet()) {
-                switch (stringIntegerEntry.getKey()){
-                    case "VIP":
-                        historyVipNum = historyVipNum + stringIntegerEntry.getValue();
-                        break;
-                    case "PRACTICE":
-                        historyPracticeNum = historyPracticeNum + stringIntegerEntry.getValue();
-                        break;
-                    case "HIGH":
-                        historyHighNum = historyHighNum + stringIntegerEntry.getValue();
-                        break;
-                }
-            }
-        }
-        Map<String, Integer> historyCourseInfo = new HashMap<>();
-        historyCourseInfo.put(CourseSchedule.CourseScheduleType.VIP.getCode(), historyVipNum);
-        historyCourseInfo.put(CourseSchedule.CourseScheduleType.PRACTICE.getCode(), historyPracticeNum);
-        historyCourseInfo.put(CourseSchedule.CourseScheduleType.HIGH.getCode(), historyHighNum);
-        result.put("historyCourseInfo", historyCourseInfo);
+//        List<StudentPaymentOrderDetail> historyOrderDetails = studentPaymentOrderDetailDao.getWithUserAndOrderType(user.getId(), OrderTypeEnum.DEGREE_REGISTRATION);
+//        int historyVipNum = 0, historyPracticeNum = 0, historyHighNum = 0;
+//        for (StudentPaymentOrderDetail historyOrderDetail : historyOrderDetails) {
+//            if(StringUtils.isBlank(historyOrderDetail.getGoodsIdList())){
+//                continue;
+//            }
+//            Map<String, Integer> courseNumMap = JSON.parseObject(historyOrderDetail.getGoodsIdList(), Map.class);
+//            for (Map.Entry<String, Integer> stringIntegerEntry : courseNumMap.entrySet()) {
+//                switch (stringIntegerEntry.getKey()){
+//                    case "VIP":
+//                        historyVipNum = historyVipNum + stringIntegerEntry.getValue();
+//                        break;
+//                    case "PRACTICE":
+//                        historyPracticeNum = historyPracticeNum + stringIntegerEntry.getValue();
+//                        break;
+//                    case "HIGH":
+//                        historyHighNum = historyHighNum + stringIntegerEntry.getValue();
+//                        break;
+//                }
+//            }
+//        }
+//        Map<String, Integer> historyCourseInfo = new HashMap<>();
+//        historyCourseInfo.put(CourseSchedule.CourseScheduleType.VIP.getCode(), historyVipNum);
+//        historyCourseInfo.put(CourseSchedule.CourseScheduleType.PRACTICE.getCode(), historyPracticeNum);
+//        historyCourseInfo.put(CourseSchedule.CourseScheduleType.HIGH.getCode(), historyHighNum);
+//        result.put("historyCourseInfo", historyCourseInfo);
 
         return succeed(result);
     }

+ 0 - 5
mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java

@@ -1,8 +1,6 @@
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.page.DegreeQueryInfo;
 import com.ym.mec.biz.service.DegreeRegistrationService;
 import com.ym.mec.biz.service.OrganizationService;
@@ -25,9 +23,6 @@ public class DegreeController extends BaseController { ;
     private DegreeRegistrationService degreeRegistrationService;
     @Autowired
     private OrganizationService organizationService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
 
     @ApiOperation(value = "查询收费列表")
     @GetMapping("/queryPage")

+ 2 - 2
mec-web/src/main/resources/exportColumnMapper.ini

@@ -163,8 +163,8 @@ headColumns = ["分部", "上课日期", "课程编号", "课程班名称", "老
 fieldColumns = ["organName", "classDateStr", "id", "courseName", "teacherName", "teachingMaterial",  "pronunciationStr", "tempoStr", "musicTheoryStr", "song", "memo", "createTimeStr", "assignHomeworkStr",  "handHomeworkStr", "eduTeacherName", "courseReview"]
 
 [考级报名导出]
-headColumns = ["姓名", "性别", "身份证号", "城市", "学校", "报考乐器", "报考级别", "乐理级别", "乐理级别证书", "家长联系电话", "考级费用", "乐理费用", "备注", "缴费状态", "订单编号", "商户订单号", "报名时间"]
-fieldColumns = ["name", "gender == 1?'男':'女'", "idcard", "city", "school", "subject", "level", "theoryLevel",  "theoryCert", "mobile", "money", "theoryMoney", "memo", "status == 2?'已缴费':'未缴费'", "orderNo", "transNo", "createTime"]
+headColumns = ["姓名", "性别", "身份证号", "城市", "学校", "报考乐器", "报考级别","乐理级别证书", "家长联系电话", "考级费用","备注", "缴费状态", "订单编号", "商户订单号", "报名时间"]
+fieldColumns = ["name", "gender == 1?'男':'女'", "idcard", "city", "school", "subject", "level", "theoryCert", "mobile", "money","memo", "status == 2?'已缴费':'未缴费'", "orderNo", "transNo", "createTime"]
 
 [合作单位导出]
 headColumns = ["分部", "单位编号", "单位名称", "是否启用","乐团主管","状态栏"]