Bläddra i källkod

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

zouxuan 5 år sedan
förälder
incheckning
d2dc077c49

+ 50 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupPayInfoDto.java

@@ -0,0 +1,50 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/11/29
+ */
+public class VipGroupPayInfoDto {
+
+    private Integer vipGroupId;
+
+    private String viipGroupName;
+
+    private BigDecimal price;
+
+    private BigDecimal balance;
+
+    public Integer getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Integer vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
+    public String getViipGroupName() {
+        return viipGroupName;
+    }
+
+    public void setViipGroupName(String viipGroupName) {
+        this.viipGroupName = viipGroupName;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public BigDecimal getBalance() {
+        return balance;
+    }
+
+    public void setBalance(BigDecimal balance) {
+        this.balance = balance;
+    }
+}

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java

@@ -50,9 +50,11 @@ public interface DemoGroupService extends BaseService<Long, DemoGroup> {
     PageInfo findTeacherDemoGroups(TeacherManageDemoGroupQueryInfo queryInfo);
     PageInfo findTeacherDemoGroups(TeacherManageDemoGroupQueryInfo queryInfo);
 
 
     /**
     /**
-     * @Author: Joburgess
-     * @Date: 2019/9/27
-     *
+     * @describe
+     * @author Joburgess
+     * @date 2019/11/29
+     * @param teacherID: 教师编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.EducationDemoGroupListDto>
      */
      */
     List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherID);
     List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherID);
 
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -310,4 +310,14 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
 	 * 更新vipgroup至完成状态
 	 * 更新vipgroup至完成状态
 	 */
 	 */
 	void updateVipGroupStatusToFinished();
 	void updateVipGroupStatusToFinished();
+
+	/**
+	 * @describe 获取vip课购买信息
+	 * @author Joburgess
+	 * @date 2019/11/29
+	 * @param vipGroupId: vip课编号
+	 * @param userId: 用户编号
+	 * @return void
+	 */
+    VipGroupPayInfoDto getVipGroupPayInfo(Integer vipGroupId,Integer userId);
 }
 }

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -389,8 +389,10 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			}
 			}
 			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 		} else {
 		} else {
-			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
-					: musicGroupStudentFee.getCourseFee().doubleValue());
+			params.put(
+					"courseFee",
+					(musicGroupStudentFee.getTemporaryCourseFee() != null && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0) ? musicGroupStudentFee
+							.getTemporaryCourseFee().doubleValue() : musicGroupStudentFee.getCourseFee().doubleValue());
 		}
 		}
 
 
 		// 收费形式
 		// 收费形式

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -195,7 +195,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             sysUser.setUserType(SysUserType.STUDENT);
             sysUser.setUserType(SysUserType.STUDENT);
             sysUser.setGender(studentRegistration.getGender());
             sysUser.setGender(studentRegistration.getGender());
             if(studentRegistration.getOrganId() != null){
             if(studentRegistration.getOrganId() != null){
-                sysUser.setOrganId(studentRegistration.getOrganId().toString());
+                sysUser.setOrganId(studentRegistration.getOrganId());
             }
             }
             sysUser.setRealName(studentRegistration.getParentsName());
             sysUser.setRealName(studentRegistration.getParentsName());
             sysUser.setUsername(studentRegistration.getName());
             sysUser.setUsername(studentRegistration.getName());
@@ -518,7 +518,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 }
                 }
                 musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
                 musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
                         userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
                         userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
-                        DateUtil.getFirstDayOfMonth(calendar.getTime()), null));
+                        DateUtil.getFirstDayOfMonth(calendar.getTime()), studentAddDto.getTemporaryCourseFee()));
                 //生成订单
                 //生成订单
                 StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
                 StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
                 studentPaymentOrder.setUserId(userId);
                 studentPaymentOrder.setUserId(userId);

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1657,4 +1657,25 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	public void updateVipGroupStatusToFinished() {
 	public void updateVipGroupStatusToFinished() {
 		
 		
 	}
 	}
+
+	@Override
+	public VipGroupPayInfoDto getVipGroupPayInfo(Integer vipGroupId, Integer userId) {
+		if(Objects.isNull(vipGroupId)){
+			throw new BizException("请指定需要购买的小课");
+		}
+		VipGroup vipGroup=vipGroupDao.get(vipGroupId.longValue());
+		if(Objects.isNull(vipGroup)){
+			throw new BizException("未找到此课程");
+		}
+		VipGroupPayInfoDto vipGroupPayInfo=new VipGroupPayInfoDto();
+		vipGroupPayInfo.setVipGroupId(vipGroup.getId().intValue());
+		vipGroupPayInfo.setViipGroupName(vipGroup.getName());
+		vipGroupPayInfo.setPrice(vipGroup.getTotalPrice());
+		SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
+		if(Objects.isNull(sysUserCashAccount)){
+			throw new BizException("当前用户没有现金账户");
+		}
+		vipGroupPayInfo.setBalance(sysUserCashAccount.getBalance());
+		return  vipGroupPayInfo;
+	}
 }
 }

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -58,7 +58,7 @@ public class MusicGroupRegisterController extends BaseController {
         }else{
         }else{
             studentRegistration.setPaymentStatus(PaymentStatusEnum.NO);
             studentRegistration.setPaymentStatus(PaymentStatusEnum.NO);
         }
         }
-        studentRegistration.setOrganId(musicGroup.getOrganId());
+        studentRegistration.setOrganId(musicGroup.getOrganId().toString());
         return succeed(studentRegistrationService.addStudent(studentRegistration));
         return succeed(studentRegistrationService.addStudent(studentRegistration));
     }
     }
 
 

+ 10 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -88,4 +88,14 @@ public class StudentVipGroupController extends BaseController {
 		return succeed();
 		return succeed();
 	}
 	}
 
 
+    @ApiOperation(value = "获取vip购买信息")
+    @PostMapping("/getVipGroupPayInfo")
+	public Object getVipGroupPayInfo(Integer vipGroupId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (null == sysUser) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return succeed(vipGroupService.getVipGroupPayInfo(vipGroupId,sysUser.getId()));
+    }
+
 }
 }

+ 7 - 5
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -1,25 +1,27 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.biz.dal.dto.StudentAddDto;
-import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 
 
 import java.util.Date;
 import java.util.Date;
-import java.util.Set;
 
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+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.ym.mec.biz.dal.dto.StudentAddDto;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 
 
 @RequestMapping("studentRegistration")
 @RequestMapping("studentRegistration")
 @Api(tags = "学生报名信息服务")
 @Api(tags = "学生报名信息服务")