浏览代码

Merge remote-tracking branch 'origin/master'

周箭河 4 年之前
父节点
当前提交
8b915ed612

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java

@@ -51,5 +51,5 @@ public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Inte
 	 * @param calenderId:
 	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
 	 */
-	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Integer calenderId);
+	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -192,7 +192,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @date 2020/11/2
      * @time 17:46
      */
-    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Integer calenderId);
+    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Long calenderId);
 
     /**
      * 获取乐团的报名缴费日历

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -167,7 +167,7 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
      * @param musicGroupId:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
-	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Integer calenderId, @Param("musicGroupId") String musicGroupId);
+	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Long calenderId, @Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 统计实际收款金额
@@ -175,4 +175,16 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @return
 	 */
 	BigDecimal sumActualAmount(@Param("id") Long id);
+
+	/**
+	 * @describe 获取学员缴费日历详情
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/11/3
+	 * @time 14:47
+	 * @param calenderId:
+	 * @param userId:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail
+	 */
+	MusicGroupPaymentCalenderDetail findByCalenderIdAndUserId(@Param("calenderId") Long calenderId, @Param("userId") Integer userId);
 }

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

@@ -93,7 +93,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param calenderId:
 	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
 	 */
-	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Integer calenderId);
+	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId);
 
 	/**
 	 * @describe 审核通过

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

@@ -406,7 +406,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
-	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Integer calenderId) {
+	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId) {
 		MusicGroupPaymentCalenderAuditDetailDto calenderAuditDetailDto = new MusicGroupPaymentCalenderAuditDetailDto();
 		MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(calenderId);
 		if(auditDto.getOrganId() != null){

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

@@ -1047,6 +1047,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setMemo(memo);
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT_FAILED);
         musicGroupDao.update(musicGroup);
+        //修改缴费项目状态
+        List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+        if(musicGroupPaymentCalenders != null && musicGroupPaymentCalenders.size() > 0){
+            musicGroupPaymentCalenders.forEach(e->{
+                e.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT);
+            });
+            musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
+        }
     }
 
     @Override

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -360,4 +360,7 @@
 		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
 		WHERE mgpcd.music_group_payment_calender_id_ = #{id}
 	</select>
+	<select id="findByCalenderIdAndUserId" resultMap="MusicGroupPaymentCalenderDetail">
+		SELECT * FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{calenderId} AND user_id_ = #{userId} LIMIT 1
+	</select>
 </mapper>

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

@@ -178,7 +178,7 @@ public class MusicGroupController extends BaseController {
 
     @ApiOperation(value = "查询续费信息")
     @GetMapping("/queryRenewInfo")
-    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
     public HttpResponseResult queryRenewInfo(String musicGroupId) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         Integer userId = sysUser.getId();

+ 87 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java

@@ -0,0 +1,87 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.RegisterPayDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
+
+@RequestMapping("musicGroupPaymentCalender")
+@Api(tags = "乐团缴费项目服务")
+@RestController
+public class MusicGroupPaymentCalenderController extends BaseController {
+
+    @Resource
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+
+
+    @ApiOperation(value = "查询学员缴费详情")
+    @GetMapping("/getCalenderInfo")
+    @ApiImplicitParams({@ApiImplicitParam(name = "calenderId", value = "缴费项目编号", required = true, dataType = "Long")})
+    public HttpResponseResult getCalenderInfo(Long calenderId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = sysUser.getId();
+        MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderId);
+        if (calender == null) {
+            return failed("缴费项目不存在");
+        }
+        String musicGroupId = calender.getMusicGroupId();
+        MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.findByCalenderIdAndUserId(calenderId, userId);
+        if (calenderDetail == null) {
+            throw new BizException("缴费项不存在该学员,请联系教务老师");
+        }
+        if(calenderDetail.getPaymentStatus() == PaymentStatus.PAID_COMPLETED){
+            throw new BizException("当前缴费项已缴费");
+        }else if(calenderDetail.getPaymentStatus() == PaymentStatus.PROCESSING){
+            throw new BizException("当前缴费项存在待处理的订单,请稍候尝试");
+        }
+        if(calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
+            StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId,musicGroupId);
+            if (studentRegistration == null) {
+                return failed("乐团报名信息找不到");
+            }
+            List<MusicGroupPaymentCalenderCourseSettings> calenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
+            ModelMap model = new ModelMap();
+            model.put("musicGroup",musicGroupDao.get(musicGroupId));
+            model.put("amount", calenderDetail.getExpectAmount());
+            model.put("calenderCourseSettings", calenderCourseSettings);
+            model.put("balance",studentRegistration.getBalance());
+            return succeed(model);
+        }else if(calender.getStatus() == PaymentCalenderStatusEnum.OVER){
+            throw new BizException("当前缴费项时间已截止,如有问题请联系指导老师");
+        }else {
+            throw new BizException("当前缴费项未开始,如有问题请联系指导老师");
+        }
+    }
+}

+ 1 - 9
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -80,14 +80,6 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "开启缴费的推送(暂时不用,没写完)")
-    @GetMapping("/paymentPush")
-    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/paymentPush')")
-    public Object paymentPush(Long id,String userIds) {
-        musicGroupPaymentCalenderService.paymentPush(id,userIds);
-        return succeed();
-    }
-
     @ApiOperation(value = "乐团缴费日历审核列表")
     @GetMapping("/auditList")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditList')")
@@ -115,7 +107,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @ApiOperation(value = "乐团缴费日历审核列表详情")
     @GetMapping("/auditListDetail")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditListDetail')")
-    public Object auditListDetail(Integer calenderId) {
+    public Object auditListDetail(Long calenderId) {
         return succeed(musicGroupPaymentCalenderService.auditListDetail(calenderId));
     }