瀏覽代碼

支付map加上类型

周箭河 5 年之前
父節點
當前提交
e96d51d90f

+ 35 - 12
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultMusicGroupSalary.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -24,10 +25,18 @@ public class TeacherDefaultMusicGroupSalary {
 	/** 班级类型(参照 course_schedule表的type_字段) */
 	@ApiModelProperty(value = "课程类型",required = false)
 	private CourseScheduleType courseScheduleType;
-	
+
+
+	@ApiModelProperty(value = "结算方式",required = false)
+	private SalarySettlementTypeEnum settlementType;
+
+	/**  */
+	@ApiModelProperty(value = "最小课时长度",required = false)
+	private Integer durationMin;
+
 	/**  */
-	@ApiModelProperty(value = "专业技能",required = false)
-	private Integer subjectId;
+	@ApiModelProperty(value = "最大课时长度",required = false)
+	private Integer durationMax;
 	
 	/** 主教薪酬 */
 	@ApiModelProperty(value = "主教薪酬",required = false)
@@ -78,14 +87,6 @@ public class TeacherDefaultMusicGroupSalary {
 		this.courseScheduleType = courseScheduleType;
 	}
 
-	public void setSubjectId(Integer subjectId){
-		this.subjectId = subjectId;
-	}
-	
-	public Integer getSubjectId(){
-		return this.subjectId;
-	}
-
 	public BigDecimal getMainTeacherSalary() {
 		return mainTeacherSalary;
 	}
@@ -117,7 +118,29 @@ public class TeacherDefaultMusicGroupSalary {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+	public Integer getDurationMin() {
+		return durationMin;
+	}
+
+	public void setDurationMin(Integer durationMin) {
+		this.durationMin = durationMin;
+	}
+
+	public Integer getDurationMax() {
+		return durationMax;
+	}
+
+	public void setDurationMax(Integer durationMax) {
+		this.durationMax = durationMax;
+	}
+
+	public SalarySettlementTypeEnum getSettlementType() {
+		return settlementType;
+	}
+
+	public void setSettlementType(SalarySettlementTypeEnum settlementType) {
+		this.settlementType = settlementType;
+	}
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SalarySettlementTypeEnum.java

@@ -10,7 +10,8 @@ public enum SalarySettlementTypeEnum implements BaseEnum<Integer,SalarySettlemen
 
     TEACHER_DEFAULT(1,"老师默认课酬"),
     RATIO_DISCOUNT(2,"课程单价比例折扣"),
-    FIXED_SALARY(3,"固定课酬");
+    FIXED_SALARY(3,"固定课酬"),
+    GRADIENT_SALARY(4,"梯度课酬");
 
     private Integer code;
 

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

@@ -59,7 +59,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
 
     @Override
     public MusicGroupSubjectGoodsAndInfoDto getSubjectGoodsAndInfo(String musicGroupId, Integer subjectId) {
-        MusicGroup musicGroup = musicGroupService.get(musicGroupId.toString());
+        MusicGroup musicGroup = musicGroupService.get(musicGroupId);
 
         //课程形态
         Map<String, Object> courseForm = JSON.parseObject(musicGroup.getCourseForm(), Map.class);

+ 12 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Random;
 
 /**
  * 支付服务类
@@ -54,10 +55,10 @@ public class PayServiceImpl implements PayService {
             type = "UNIONPAY";
             payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
         }
-        unionPay.put("orderNo",orderNo);
-        unionPay.put("type",type);
-        unionPay.put("payMap",payMap);
-        return  unionPay;
+        unionPay.put("orderNo", orderNo);
+        unionPay.put("type", type);
+        unionPay.put("payMap", payMap);
+        return unionPay;
     }
 
     public Map<String, Object> query(String orderNo) throws Exception {
@@ -73,6 +74,13 @@ public class PayServiceImpl implements PayService {
         if (rem > 0 && rem <= 5) { //私人账户
             routingAccount = sysAccountService.getPerAccount(money);
         }
+
+        int i = new Random().nextInt(100);
+
+        //临时增加
+        if (i % 2 == 0) {
+            routingAccount = sysAccountService.getPerAccount(money);
+        }
         return routingAccount;
     }
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/SysAccountMapper.xml

@@ -109,6 +109,6 @@
   <select id="find"></select>
   <!-- 获取一个私户账户 -->
   <select id="getPerAccount" resultMap="SysAccount">
-    SELECT * FROM sys_account WHERE channel_type_ = 'YQPAY' AND channel_type_ = 'PER'
+    SELECT * FROM sys_account WHERE channel_ = 'YQPAY' AND channel_type_ = 'PER'
   </select>
 </mapper>

+ 14 - 6
mec-biz/src/main/resources/config/mybatis/TeacherDefaultMusicGroupSalaryMapper.xml

@@ -8,7 +8,9 @@
 		<result column="id_" property="id" />
 		<result column="user_id_" property="userId" />
 		<result column="course_schedule_type_" property="courseScheduleType" />
-		<result column="subject_id_" property="subjectId" />
+		<result column="settlement_type_" property="settlementType" />
+		<result column="duration_min_" property="durationMin" />
+		<result column="duration_max_" property="durationMax" />
 		<result column="main_teacher_salary_" property="mainTeacherSalary" />
 		<result column="assistant_teacher_salary_" property="assistantTeacherSalary" />
 		<result column="create_time_" property="createTime" />
@@ -33,8 +35,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO teacher_default_music_group_salary
-		(id_,user_id_,course_schedule_type_,subject_id_,main_teacher_salary_,assistant_teacher_salary_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{courseScheduleType},#{subjectId},#{mainTeacherSalary},#{assistantTeacherSalary},now(),now())
+		(id_,user_id_,course_schedule_type_,settlement_type_,duration_min_,duration_max_,main_teacher_salary_,assistant_teacher_salary_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{courseScheduleType},#{settlementType},#{durationMin},#{durationMax},#{mainTeacherSalary},#{assistantTeacherSalary},now(),now())
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -42,9 +44,6 @@
 		parameterType="com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary">
 		UPDATE teacher_default_music_group_salary
 		<set>
-			<if test="subjectId != null">
-				subject_id_ = #{subjectId},
-			</if>
 			<if test="userId != null">
 				user_id_ = #{userId},
 			</if>
@@ -54,6 +53,15 @@
 			<if test="courseScheduleType != null">
 				course_schedule_type_ = #{courseScheduleType},
 			</if>
+			<if test="settlementType != null">
+				settlement_type_ = #{settlementType},
+			</if>
+			<if test="duration_min_ != null">
+				duration_min_ = #{durationMin},
+			</if>
+			<if test="duration_max_ != null">
+				duration_max_ = #{durationMax},
+			</if>
 			<if test="mainTeacherSalary != null">
 				main_teacher_salary_ = #{mainTeacherSalary},
 			</if>

+ 5 - 5
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -282,11 +282,11 @@ public class MusicGroupController extends BaseController {
 //
 //        System.out.println(query);
 //
-//        IdWorker idWorker = new IdWorker(0, 0);
-//        String orderNo = "1017" + idWorker.nextId();
-//        BigDecimal amount = new BigDecimal("200");
-//        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
-       return succeed(sysUser);
+        IdWorker idWorker = new IdWorker(0, 0);
+        String orderNo = "1017" + idWorker.nextId();
+        BigDecimal amount = new BigDecimal("200");
+        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
+       return succeed(map);
     }
 
     @ApiOperation(value = "订单状态查询")