瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
542b89cc2d

+ 0 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentVipGroupPaymentDao.java

@@ -1,9 +0,0 @@
-package com.ym.mec.biz.dal.dao;
-
-import com.ym.mec.biz.dal.entity.StudentVipGroupPayment;
-import com.ym.mec.common.dal.BaseDAO;
-
-public interface StudentVipGroupPaymentDao extends BaseDAO<Long, StudentVipGroupPayment> {
-
-	
-}

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/StudentVipGroupPaymentService.java

@@ -1,8 +0,0 @@
-package com.ym.mec.biz.service;
-
-import com.ym.mec.biz.dal.entity.StudentVipGroupPayment;
-import com.ym.mec.common.service.BaseService;
-
-public interface StudentVipGroupPaymentService extends BaseService<Long, StudentVipGroupPayment> {
-
-}

+ 0 - 23
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentVipGroupPaymentServiceImpl.java

@@ -1,23 +0,0 @@
-package com.ym.mec.biz.service.impl;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.ym.mec.biz.dal.dao.StudentVipGroupPaymentDao;
-import com.ym.mec.biz.dal.entity.StudentVipGroupPayment;
-import com.ym.mec.biz.service.StudentVipGroupPaymentService;
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-
-@Service
-public class StudentVipGroupPaymentServiceImpl extends BaseServiceImpl<Long, StudentVipGroupPayment>  implements StudentVipGroupPaymentService {
-	
-	@Autowired
-	private StudentVipGroupPaymentDao studentVipGroupPaymentDao;
-
-	@Override
-	public BaseDAO<Long, StudentVipGroupPayment> getDAO() {
-		return studentVipGroupPaymentDao;
-	}
-	
-}

+ 9 - 17
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java

@@ -1,22 +1,5 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Random;
-import java.util.Set;
-
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.SysMessageDao;
@@ -35,6 +18,15 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.string.MessageFormatter;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.Map.Entry;
 
 @Service
 public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> implements SysMessageService {

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

@@ -59,8 +59,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
-    private StudentVipGroupPaymentDao studentVipGroupPaymentDao;
-    @Autowired
 	private StudentApplyRefundsDao studentApplyRefundsDao;
 	@Autowired
 	private SysUserCashAccountService sysUserCashAccountService;
@@ -828,12 +826,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
 		studentPaymentOrderDao.insert(studentPaymentOrder);
 
-		StudentVipGroupPayment studentVipGroupPayment=new StudentVipGroupPayment();
-		studentVipGroupPayment.setUserId(user.getId());
-		studentVipGroupPayment.setVipGroupId(vipGroup.getId());
-		studentVipGroupPayment.setClassGroupId(vipGroupClassGroupMapper.getClassGroupId());
-		studentVipGroupPayment.setStudentPaymentOrderId(studentPaymentOrder.getId());
-		studentVipGroupPaymentDao.insert(studentVipGroupPayment);
+//		StudentVipGroupPayment studentVipGroupPayment=new StudentVipGroupPayment();
+//		studentVipGroupPayment.setUserId(user.getId());
+//		studentVipGroupPayment.setVipGroupId(vipGroup.getId());
+//		studentVipGroupPayment.setClassGroupId(vipGroupClassGroupMapper.getClassGroupId());
+//		studentVipGroupPayment.setStudentPaymentOrderId(studentPaymentOrder.getId());
+//		studentVipGroupPaymentDao.insert(studentVipGroupPayment);
 		return payMap;
 
 	}

+ 6 - 7
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -188,14 +188,13 @@
     </select>
     <select id="findByStudentVipGroup" resultMap="StudentPaymentOrder">
         SELECT
-        spo.*
+          spo.*
         FROM
-        student_vip_group_payment svgp
-        LEFT JOIN student_payment_order spo ON svgp.student_payment_order_id_=spo.id_
-        WHERE svgp.user_id_=#{userId}
-        AND svgp.vip_group_id_=#{vipGroupId}
-        AND spo.status_=#{status}
-        and spo.type_ = 'SMALL_CLASS_TO_BUY'
+          student_payment_order spo
+        WHERE spo.user_id_=#{userId}
+            AND spo.music_group_id_=#{vipGroupId}
+            AND spo.status_=#{status}
+            and spo.type_ = 'SMALL_CLASS_TO_BUY'
     </select>
     <!-- 查询报名订单 -->
     <select id="findMusicGroupApplyOrderByStatus" resultMap="StudentPaymentOrder">

+ 0 - 76
mec-biz/src/main/resources/config/mybatis/StudentVipGroupPaymentMapper.xml

@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<!--
-这个文件是自动生成的。
-不要修改此文件。所有改动将在下次重新自动生成时丢失。
--->
-<mapper namespace="com.ym.mec.biz.dal.dao.StudentVipGroupPaymentDao">
-	
-	<resultMap type="com.ym.mec.biz.dal.entity.StudentVipGroupPayment" id="StudentVipGroupPayment">
-		<result column="id_" property="id" />
-		<result column="user_id_" property="userId" />
-		<result column="vip_group_id_" property="vipGroupId" />
-		<result column="class_group_id_" property="classGroupId" />
-		<result column="create_time_" property="createTime" />
-		<result column="student_payment_order_id_" property="studentPaymentOrderId" />
-	</resultMap>
-	
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="StudentVipGroupPayment" >
-		SELECT * FROM student_vip_group_payment WHERE id_ = #{id} 
-	</select>
-	
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="StudentVipGroupPayment">
-		SELECT * FROM student_vip_group_payment ORDER BY id_
-	</select>
-	
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentVipGroupPayment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO student_vip_group_payment (id_,user_id_,vip_group_id_,class_group_id_,create_time_,student_payment_order_id_) VALUES(#{id},#{userId},#{vipGroupId},#{classGroupId},now(),#{studentPaymentOrderId})
-	</insert>
-	
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentVipGroupPayment">
-		UPDATE student_vip_group_payment <set>
-<if test="userId != null">
-user_id_ = #{userId},
-</if>
-<if test="vipGroupId != null">
-vip_group_id_ = #{vipGroupId},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="classGroupId != null">
-class_group_id_ = #{classGroupId},
-</if>
-<if test="studentPaymentOrderId != null">
-student_payment_order_id_ = #{studentPaymentOrderId},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-</set> WHERE id_ = #{id} 
-	</update>
-	
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
-		DELETE FROM student_vip_group_payment WHERE id_ = #{id} 
-	</delete>
-	
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="StudentVipGroupPayment" parameterType="map">
-		SELECT * FROM student_vip_group_payment ORDER BY id_ <include refid="global.limit"/>
-	</select>
-	
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_vip_group_payment
-	</select>
-</mapper>

+ 34 - 5
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -28,6 +29,8 @@ import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
@@ -35,6 +38,7 @@ import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentApplyRefundsService;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 
@@ -59,6 +63,9 @@ public class VipGroupManageController extends BaseController {
     @Autowired
     private StudentApplyRefundsService studentApplyRefundsService;
     
+    @Autowired
+    private StudentPaymentOrderService studentPaymentOrderService;
+    
     @ApiOperation(value = "vip课申请")
     @PostMapping("/vipGroupApply")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/vipGroupApply')")
@@ -130,11 +137,33 @@ public class VipGroupManageController extends BaseController {
     @GetMapping("/queryApplyRefundDetail")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/queryApplyRefundDetail')")
 	public Object queryApplyRefundDetail(Long id) {
-    	StudentApplyRefunds studentApplyRefunds = studentApplyRefundsService.get(id);
-    	if(studentApplyRefunds == null){
-    		return failed("");
-    	}
-		return succeed();
+		StudentApplyRefunds studentApplyRefunds = studentApplyRefundsService.get(id);
+		if (studentApplyRefunds == null) {
+			return failed("参数输入有误");
+		}
+
+		Long orderId = studentApplyRefunds.getOrigPaymentOrderId();
+
+		StudentPaymentOrder paymentOrder = studentPaymentOrderService.get(orderId);
+		if (paymentOrder == null) {
+			return failed("支付订单信息找不到");
+		}
+		String vipGroupId = paymentOrder.getMusicGroupId();
+		VipGroup vipGroup = vipGroupService.get(Long.parseLong(vipGroupId));
+		if (vipGroup == null) {
+			return failed("vip课信息找不到");
+		}
+
+		SysUser student = sysUserFeignService.queryUserById(studentApplyRefunds.getUserId());
+
+		SysUser teacher = sysUserFeignService.queryUserById(vipGroup.getUserId());
+
+		ModelMap model = new ModelMap();
+		model.put("student", student.getUsername());
+		model.put("teacher", teacher.getUsername());
+		model.put("className", vipGroup.getName());
+
+		return succeed(model);
 	}
 
     @ApiOperation(value = "获取VIP课教学记录")