周箭河 5 роки тому
батько
коміт
11f09c0100

+ 29 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DegreeRegistration.java

@@ -51,6 +51,12 @@ public class DegreeRegistration {
     private String subject;
 
     /**
+     * 考试级别
+     */
+    @ApiModelProperty(value = "考试级别",required = true)
+    private String level;
+
+    /**
      * 乐理级别
      */
     @ApiModelProperty(value = "乐理级别",required = true)
@@ -63,7 +69,7 @@ public class DegreeRegistration {
     private String mobile;
 
     /**
-     * 收费标准
+     * 考级费用
      */
     @ApiModelProperty(value = "收费标准",required = false)
     private BigDecimal money;
@@ -75,6 +81,12 @@ public class DegreeRegistration {
     private String memo;
 
     /**
+     * 乐理费用
+     */
+    @ApiModelProperty(value = "乐理费用",required = true)
+    private BigDecimal theoryMoney;
+
+    /**
      * 报名时间
      */
     private Date createTime;
@@ -222,4 +234,20 @@ public class DegreeRegistration {
     public void setIsRepay(Boolean repay) {
         isRepay = repay;
     }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+
+    public BigDecimal getTheoryMoney() {
+        return theoryMoney;
+    }
+
+    public void setTheoryMoney(BigDecimal theoryMoney) {
+        this.theoryMoney = theoryMoney;
+    }
 }

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

@@ -56,9 +56,24 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         //获取收费项价格
         SporadicChargeInfo chargeInfo = sporadicChargeInfoDao.get(degreeRegistration.getSporadicId());
         if (chargeInfo == null) {
-            throw new BizException("支付项不存在");
+            throw new BizException("你选的考试级别不存在");
         }
+        degreeRegistration.setLevel(chargeInfo.getTitle());
+        BigDecimal theoryMoney = BigDecimal.ZERO;
+        if(degreeRegistration.getTheoryLevel().equals("一级")){
+            theoryMoney = new BigDecimal(200);
+        }else if(degreeRegistration.getTheoryLevel().equals("二级")){
+            theoryMoney = new BigDecimal(240);
+        }else if(degreeRegistration.getTheoryLevel().equals("三级")){
+            theoryMoney = new BigDecimal(280);
+        }else if(degreeRegistration.getTheoryLevel().equals("四级")){
+            theoryMoney = new BigDecimal(320);
+        }else if(degreeRegistration.getTheoryLevel().equals("免考")){
 
+        }else {
+            throw new BizException("您选择的乐理级别不存在,请核对");
+        }
+        degreeRegistration.setTheoryMoney(theoryMoney);
         DegreeRegistration degree = degreeRegistrationDao.findByMobileAndSporadicId(degreeRegistration.getMobile(), degreeRegistration.getSporadicId());
         if (degree == null) {
             degreeRegistration.setMoney(chargeInfo.getAmount());
@@ -76,7 +91,10 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         }
         degreeRegistrationDao.getLock(degreeRegistration.getId());
 
+
+
         BigDecimal amount = chargeInfo.getAmount();
+        amount = amount.add(theoryMoney);
 
         OrderTypeEnum type = OrderTypeEnum.SPORADIC;
 
@@ -94,6 +112,9 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         studentPaymentOrder.setMusicGroupId(degreeRegistration.getSporadicId().toString());
         studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
         studentPaymentOrder.setRoutingOrganId(chargeInfo.getOrganId());
+        if(theoryMoney.compareTo(BigDecimal.ZERO) >0){
+            studentPaymentOrder.setMemo("乐理"+degreeRegistration.getTheoryLevel()+",费用:"+theoryMoney);
+        }
         studentPaymentOrderService.insert(studentPaymentOrder);
         studentPaymentOrder.setVersion(0);
 

+ 10 - 2
mec-biz/src/main/resources/config/mybatis/DegreeRegistrationMapper.xml

@@ -12,7 +12,9 @@
     <result column="city_" jdbcType="VARCHAR" property="city" />
     <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="mobile_" jdbcType="VARCHAR" property="mobile" />
     <result column="money_" jdbcType="DECIMAL" property="money" />
     <result column="memo_" jdbcType="VARCHAR" property="memo" />
@@ -50,12 +52,12 @@
     <!--@mbg.generated-->
     insert into degree_registration (sporadic_id_, name_, gender_, 
       idcard_, city_, school_, 
-      subject_, theory_level_, mobile_, 
+      subject_,level_, theory_level_,theory_money_, mobile_,
       money_, memo_, create_time_, 
       update_time_, status_)
     values (#{sporadicId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, 
       #{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR}, 
-      #{subject,jdbcType=VARCHAR}, #{theoryLevel,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, 
+      #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR}, #{theoryLevel,jdbcType=VARCHAR},#{theoryMoney,jdbcType=DECIMAL}, #{mobile,jdbcType=VARCHAR},
       #{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, #{createTime},
       #{updateTime}, #{status,jdbcType=TINYINT})
   </insert>
@@ -84,9 +86,15 @@
       <if test="subject != null">
         subject_ = #{subject,jdbcType=VARCHAR},
       </if>
+      <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="mobile != null">
         mobile_ = #{mobile,jdbcType=VARCHAR},
       </if>