Преглед изворни кода

Merge branch 'Joburgess' of http://git.dayaedu.com/yonge/mec into Joburgess

zouxuan пре 4 година
родитељ
комит
3b181c6db0

+ 44 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SellOrder.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.SellTypeEnum;
+import com.ym.mec.biz.dal.enums.StockType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
@@ -135,6 +137,24 @@ public class SellOrder {
     private String merNo;
 
     /**
+     * 批次号
+     */
+    @ApiModelProperty(value="批次号")
+    private String batchNo;
+
+    /**
+    * 库存类型
+    */
+    @ApiModelProperty(value="库存类型")
+    private StockType stockType;
+
+    /**
+     * 账户类型
+     */
+    @ApiModelProperty(value = "账户类型")
+    private AccountType accountType;
+
+    /**
     * 交易时间
     */
     @ApiModelProperty(value="交易时间")
@@ -367,4 +387,28 @@ public class SellOrder {
     public void setEduTeacher(String eduTeacher) {
         this.eduTeacher = eduTeacher;
     }
+
+    public StockType getStockType() {
+        return stockType;
+    }
+
+    public void setStockType(StockType stockType) {
+        this.stockType = stockType;
+    }
+
+    public AccountType getAccountType() {
+        return accountType;
+    }
+
+    public void setAccountType(AccountType accountType) {
+        this.accountType = accountType;
+    }
+
+    public String getBatchNo() {
+        return batchNo;
+    }
+
+    public void setBatchNo(String batchNo) {
+        this.batchNo = batchNo;
+    }
 }

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysPaymentConfig.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import io.swagger.annotations.ApiModelProperty;
 import java.util.Date;
@@ -51,8 +52,8 @@ public class SysPaymentConfig {
     /**
      * 账户类型
      */
-    @ApiModelProperty(value = "账户类型(0-内部、1-外部)")
-    private Integer accountType;
+    @ApiModelProperty(value = "账户类型")
+    private AccountType accountType;
 
 
     /**
@@ -239,11 +240,11 @@ public class SysPaymentConfig {
         this.routeScale = routeScale;
     }
 
-    public Integer getAccountType() {
+    public AccountType getAccountType() {
         return accountType;
     }
 
-    public void setAccountType(Integer accountType) {
+    public void setAccountType(AccountType accountType) {
         this.accountType = accountType;
     }
 }

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/AccountType.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+
+public enum AccountType implements BaseEnum<Integer, AccountType> {
+    INTERNAL(0, "内部"),
+    EXTERNAL(1, "外部");
+
+    private Integer code;
+    private String msg;
+
+    AccountType(Integer code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    @Override
+    public Integer getCode() {
+        return null;
+    }
+}

+ 8 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1937,14 +1937,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                     salary = baseSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
 
-                    for (CourseScheduleTeacherSalary teacherSalary : allTeacherSalarys) {
-                        if (teacherSalary.getUserId().equals(classGroupTeacherMapper.getUserId())
-                                && teacherSalary.getTeacherRole().equals(classGroupTeacherMapper.getTeacherRole())) {
-                            int duration = DateUtil.minutesBetween(teacherSalary.getCourseSchedule().getStartClassTime(), teacherSalary.getCourseSchedule().getEndClassTime());
-                            salary = teacherSalary.getExpectSalary().divide(new BigDecimal(duration), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(classCourseDuration)).setScale(2, BigDecimal.ROUND_HALF_UP);
-                            break;
-                        }
-                    }
+//                    for (CourseScheduleTeacherSalary teacherSalary : allTeacherSalarys) {
+//                        if (teacherSalary.getUserId().equals(classGroupTeacherMapper.getUserId())
+//                                && teacherSalary.getTeacherRole().equals(classGroupTeacherMapper.getTeacherRole())) {
+//                            int duration = DateUtil.minutesBetween(teacherSalary.getCourseSchedule().getStartClassTime(), teacherSalary.getCourseSchedule().getEndClassTime());
+//                            salary = teacherSalary.getExpectSalary().divide(new BigDecimal(duration), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(classCourseDuration)).setScale(2, BigDecimal.ROUND_HALF_UP);
+//                            break;
+//                        }
+//                    }
 
                     //课堂课课酬
                     if (classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.CLASSROOM)) {

+ 18 - 13
mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml

@@ -56,15 +56,11 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into sell_order (edu_teacher_id_,organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_,
-        expect_amount_,
-        actual_amount_,
-        balance_amount_, type_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_, user_id_, payment_channel_,
-        mer_no_, sell_time_, create_ime_, update_time_)
+        expect_amount_,actual_amount_,balance_amount_, type_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_, user_id_, payment_channel_,
+        mer_no_,batch_no_,stock_type_,account_type_, sell_time_, create_ime_, update_time_)
         values (#{eduTeacherId},#{organId}, #{cooperationOrganId}, #{transNo}, #{orderNo},#{orderId}, #{expectAmount},
-        #{actualAmount},
-        #{balanceAmount}, #{type}, #{goodsId}, #{goodsName}, #{sellCost}, #{sellCost2}, #{num}, #{userId},
-        #{paymentChannel},
-        #{merNo}, #{sellTime}, #{createIme}, #{updateTime})
+        #{actualAmount}, #{balanceAmount}, #{type}, #{goodsId}, #{goodsName}, #{sellCost}, #{sellCost2}, #{num}, #{userId},
+        #{paymentChannel}, #{merNo},#{batchNo},#{stockType},#{accountType}, #{sellTime}, #{createIme}, #{updateTime})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.SellOrder">
         <!--@mbg.generated-->
@@ -98,7 +94,7 @@
                 balance_amount_ = #{balanceAmount},
             </if>
             <if test="type != null">
-                type_ = #{type},
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="goodsId != null">
                 goods_id_ = #{goodsId},
@@ -124,6 +120,15 @@
             <if test="merNo != null">
                 mer_no_ = #{merNo},
             </if>
+            <if test="batchNo != null">
+                batch_no_ = #{batchNo},
+            </if>
+            <if test="stockType != null">
+                stock_type_ = #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="accountType != null">
+                account_type_ = #{accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
             <if test="sellTime != null">
                 sell_time_ = #{sellTime},
             </if>
@@ -139,15 +144,15 @@
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         insert into sell_order (organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_, expect_amount_,
-        actual_amount_,
-        balance_amount_, type_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_, user_id_, payment_channel_,
-        mer_no_, sell_time_,edu_teacher_id_, create_ime_, update_time_)
+        actual_amount_,balance_amount_, type_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_, user_id_, payment_channel_,
+        mer_no_,batch_no_,stock_type_,account_type_, sell_time_,edu_teacher_id_, create_ime_, update_time_)
         VALUE
         <foreach collection="sellOrders" separator="," item="sellOrder">
             (#{sellOrder.organId},#{sellOrder.cooperationOrganId},#{sellOrder.transNo},#{sellOrder.orderId},#{sellOrder.orderNo},
             #{sellOrder.expectAmount},#{sellOrder.actualAmount},#{sellOrder.balanceAmount},#{sellOrder.type},#{sellOrder.goodsId},
             #{sellOrder.goodsName},#{sellOrder.sellCost},#{sellOrder.sellCost2},#{sellOrder.num},#{sellOrder.userId},
-            #{sellOrder.paymentChannel},#{sellOrder.merNo},#{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW())
+            #{sellOrder.paymentChannel},#{sellOrder.merNo},#{sellOrder.batchNo},#{sellOrder.stockType},#{sellOrder.accountType},
+            #{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW())
         </foreach>
     </insert>
 

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

@@ -75,7 +75,7 @@
                 #{organId},
             </if>
             <if test="accountType != null">
-                #{accountType},
+                #{accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="payType != null">
                 #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -108,7 +108,7 @@
                 organ_id_ = #{organId},
             </if>
             <if test="accountType != null">
-                account_type_ = #{accountType},
+                account_type_ = #{accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="payType != null">
                 pay_type_ = #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},