zouxuan 3 years ago
parent
commit
024cecf99a

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderActivityDao.java

@@ -0,0 +1,7 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
+
+public interface MusicGroupPaymentCalenderActivityDao extends BaseMapper<MusicGroupPaymentCalenderActivity> {
+}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderMemberDto.java

@@ -20,7 +20,7 @@ public class CalenderMemberDto {
     @ApiModelProperty(value = "会员等级编号", required = false)
     private Integer memberRankSettingId = 1;
 
-    @ApiModelProperty(value = "是否选", required = false)
+    @ApiModelProperty(value = "是否选", required = false)
     private Boolean optionalFlag = false;
 
     public PeriodEnum getPeriodEnum() {

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -43,9 +44,20 @@ public class MusicGroupPaymentBaseCalender {
 	@ApiModelProperty(value = "乐保信息", required = false)
 	private MusicRepairDto musicRepair;
 
+	@ApiModelProperty(value = "乐团活动相关信息(vip、网管课)", required = false)
+	private List<MusicGroupPaymentCalenderActivity> calenderActivityList;
+
 	@ApiModelProperty(value = "乐团课程信息", required = false)
 	private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList;
 
+	public List<MusicGroupPaymentCalenderActivity> getCalenderActivityList() {
+		return calenderActivityList;
+	}
+
+	public void setCalenderActivityList(List<MusicGroupPaymentCalenderActivity> calenderActivityList) {
+		this.calenderActivityList = calenderActivityList;
+	}
+
 	public MusicRepairDto getMusicRepair() {
 		return musicRepair;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicRepairDto.java

@@ -12,6 +12,17 @@ public class MusicRepairDto {
     @ApiModelProperty(value = "团购价", required = false)
     private BigDecimal actualAmount;
 
+    @ApiModelProperty(value = "是否必选", required = false)
+    private Boolean optionalFlag = false;
+
+    public Boolean getOptionalFlag() {
+        return optionalFlag;
+    }
+
+    public void setOptionalFlag(Boolean optionalFlag) {
+        this.optionalFlag = optionalFlag;
+    }
+
     public BigDecimal getNum() {
         return num;
     }

+ 41 - 203
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderActivity.java

@@ -1,87 +1,35 @@
 package com.ym.mec.biz.dal.entity;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 对应数据库表(music_group_payment_calender_activity):
  */
 public class MusicGroupPaymentCalenderActivity{
 
-	/**  */
 	private Integer id;
 
-	/**  */
+	@ApiModelProperty(value = "活动编号", required = true)
 	private Integer activityId;
-	
-	/**  */
-	private Integer userId;
 
-	/**  */
-	private Integer teacherId;
-	
-	/** vip课排课标记0没有排课资格1未排课2已排课 */
-	private Integer vipFlag = 0;
-	
-	/**  */
-	private Integer giveVipFlag = 0;
-	
-	/**  */
-	private Integer practiceFlag = 0;
-	
-	/**  */
-	private Integer givePracticeFlag = 0;
+	@ApiModelProperty(value = "缴费项目编号", required = false)
+	private Integer calenderId;
 
-	/**  */
-	private Integer memberFlag = 0;
+	@ApiModelProperty(value = "现价", required = true)
+	private BigDecimal actualPrice;
 
-	/**  */
-	private Integer giveMemberFlag = 0;
+	@ApiModelProperty(value = "原价", required = true)
+	private BigDecimal originalPrice;
 
-	private Long paymentOrderId;
+	@ApiModelProperty(value = "是否必选", required = true)
+	private Boolean optionalFlag = false;
 
-	private Long vipGroupId;
+	private Date createTime;
 
-	private Long giveVipGroupId;
-
-	private Long memberOrderId;
-
-	private Long giveMemberOrderId;
-
-	private Long practiceGroupId;
-
-	private Long givePracticeGroupId;
-
-	private Boolean returnFee = false;
-
-	private BigDecimal actualPrice = BigDecimal.ZERO;
-
-	private String addMemo;
-
-	private String cutMemo;
-	
-	/**  */
-	private java.util.Date createTime;
-	
-	/**  */
-	private java.util.Date updateTime;
-
-	public String getAddMemo() {
-		return addMemo;
-	}
-
-	public void setAddMemo(String addMemo) {
-		this.addMemo = addMemo;
-	}
-
-	public String getCutMemo() {
-		return cutMemo;
-	}
-
-	public void setCutMemo(String cutMemo) {
-		this.cutMemo = cutMemo;
-	}
+	private Date updateTime;
 
 	public BigDecimal getActualPrice() {
 		return actualPrice;
@@ -91,169 +39,59 @@ public class MusicGroupPaymentCalenderActivity{
 		this.actualPrice = actualPrice;
 	}
 
-	public Integer getTeacherId() {
-		return teacherId;
+	public BigDecimal getOriginalPrice() {
+		return originalPrice;
 	}
 
-	public void setTeacherId(Integer teacherId) {
-		this.teacherId = teacherId;
+	public void setOriginalPrice(BigDecimal originalPrice) {
+		this.originalPrice = originalPrice;
 	}
 
-	public Long getMemberOrderId() {
-		return memberOrderId;
+	public Date getCreateTime() {
+		return createTime;
 	}
 
-	public void setMemberOrderId(Long memberOrderId) {
-		this.memberOrderId = memberOrderId;
-	}
-
-	public Long getGiveMemberOrderId() {
-		return giveMemberOrderId;
-	}
-
-	public void setGiveMemberOrderId(Long giveMemberOrderId) {
-		this.giveMemberOrderId = giveMemberOrderId;
-	}
-
-	public Integer getMemberFlag() {
-		return memberFlag;
-	}
-
-	public void setMemberFlag(Integer memberFlag) {
-		this.memberFlag = memberFlag;
-	}
-
-	public Integer getGiveMemberFlag() {
-		return giveMemberFlag;
-	}
-
-	public void setGiveMemberFlag(Integer giveMemberFlag) {
-		this.giveMemberFlag = giveMemberFlag;
-	}
-
-	public Boolean getReturnFee() {
-		return returnFee;
-	}
-
-	public void setReturnFee(Boolean returnFee) {
-		this.returnFee = returnFee;
-	}
-
-	public Long getVipGroupId() {
-		return vipGroupId;
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
 	}
 
-	public void setVipGroupId(Long vipGroupId) {
-		this.vipGroupId = vipGroupId;
+	public Date getUpdateTime() {
+		return updateTime;
 	}
 
-	public Long getGiveVipGroupId() {
-		return giveVipGroupId;
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
 	}
 
-	public void setGiveVipGroupId(Long giveVipGroupId) {
-		this.giveVipGroupId = giveVipGroupId;
+	public Integer getId() {
+		return id;
 	}
 
-	public Long getPracticeGroupId() {
-		return practiceGroupId;
+	public void setId(Integer id) {
+		this.id = id;
 	}
 
-	public void setPracticeGroupId(Long practiceGroupId) {
-		this.practiceGroupId = practiceGroupId;
+	public Integer getActivityId() {
+		return activityId;
 	}
 
-	public Long getGivePracticeGroupId() {
-		return givePracticeGroupId;
+	public void setActivityId(Integer activityId) {
+		this.activityId = activityId;
 	}
 
-	public void setGivePracticeGroupId(Long givePracticeGroupId) {
-		this.givePracticeGroupId = givePracticeGroupId;
+	public Integer getCalenderId() {
+		return calenderId;
 	}
 
-	public Long getPaymentOrderId() {
-		return paymentOrderId;
+	public void setCalenderId(Integer calenderId) {
+		this.calenderId = calenderId;
 	}
 
-	public void setPaymentOrderId(Long paymentOrderId) {
-		this.paymentOrderId = paymentOrderId;
+	public Boolean getOptionalFlag() {
+		return optionalFlag;
 	}
 
-	public void setId(Integer id){
-		this.id = id;
-	}
-	
-	public Integer getId(){
-		return this.id;
-	}
-			
-	public void setActivityId(Integer activityId){
-		this.activityId = activityId;
-	}
-	
-	public Integer getActivityId(){
-		return this.activityId;
-	}
-			
-	public void setUserId(Integer userId){
-		this.userId = userId;
-	}
-	
-	public Integer getUserId(){
-		return this.userId;
-	}
-			
-	public void setVipFlag(Integer vipFlag){
-		this.vipFlag = vipFlag;
+	public void setOptionalFlag(Boolean optionalFlag) {
+		this.optionalFlag = optionalFlag;
 	}
-	
-	public Integer getVipFlag(){
-		return this.vipFlag;
-	}
-			
-	public void setGiveVipFlag(Integer giveVipFlag){
-		this.giveVipFlag = giveVipFlag;
-	}
-	
-	public Integer getGiveVipFlag(){
-		return this.giveVipFlag;
-	}
-			
-	public void setPracticeFlag(Integer practiceFlag){
-		this.practiceFlag = practiceFlag;
-	}
-	
-	public Integer getPracticeFlag(){
-		return this.practiceFlag;
-	}
-			
-	public void setGivePracticeFlag(Integer givePracticeFlag){
-		this.givePracticeFlag = givePracticeFlag;
-	}
-	
-	public Integer getGivePracticeFlag(){
-		return this.givePracticeFlag;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
 }

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

@@ -9,8 +9,8 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum DeductReasonEnum implements BaseEnum<String,DeductReasonEnum> {
     SIGN_IN_TIME_ERR("SIGN_IN_TIME_ERR", "签到时间异常", ""),
     SIGN_OUT_TIME_ERR("SIGN_OUT_TIME_ERR", "签退时间异常", ""),
-    GPS_ERR_IN("GPS_ERR", "位置异常", ""),
-    GPS_ERR_OUT("GPS_ERR", "位置异常", ""),
+    GPS_ERR_IN("GPS_ERR", "签到位置异常", ""),
+    GPS_ERR_OUT("GPS_ERR", "签退位置异常", ""),
     NOT_SETTLEMENT("NOT_SETTLEMENT", "不结算课酬", "特殊老师不结算课酬"),
     TRAIL("TRAIL", "试用期扣减", "试用期老师课酬按系统配置的折扣计算"),
 

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderActivityService.java

@@ -0,0 +1,4 @@
+package com.ym.mec.biz.service;
+
+public interface MusicGroupPaymentCalenderActivityService {
+}

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

@@ -1678,7 +1678,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         //扣除费用
         BigDecimal deductCost = BigDecimal.ZERO;
         //获取签到状态
-        TeachModeEnum teachMode = courseScheduleTeacherSalary.getCourseSchedule().getTeachMode();
+        TeachModeEnum teachMode = courseSchedule.getTeachMode();
         TeacherAttendance teacherAttendance = null;
         if(teacherAttendances != null && teacherAttendances.size() > 0){
             teacherAttendance = teacherAttendances.get(0);

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderActivityServiceImpl.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
+
+import java.math.BigDecimal;
+
+public class MusicGroupPaymentCalenderActivityServiceImpl implements MusicGroupPaymentCalenderActivityService, MusicGroupPaymentCalenderBaseService {
+    @Override
+    public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
+
+    }
+
+    @Override
+    public MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        return null;
+    }
+
+    @Override
+    public BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        return null;
+    }
+}

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

@@ -50,6 +50,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.springframework.util.Assert;
 
 import javax.annotation.Resource;
 
@@ -534,7 +535,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
-
+		if(musicGroupPaymentBaseCalender == null){
+			throw new BizException("参数校验异常");
+		}
+		if(musicGroupPaymentBaseCalender.getCalenderActivityList() == null
+				&& musicGroupPaymentBaseCalender.getCalenderMember() == null
+				&& musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList() == null
+				&& musicGroupPaymentBaseCalender.getMusicRepair() == null){
+			throw new BizException("请选择一个缴费项目");
+		}
 		String musicGroupId = musicGroupPaymentBaseCalender.getMusicGroupId();
 
 		PaymentType paymentType = musicGroupPaymentBaseCalender.getPaymentType();
@@ -601,22 +610,19 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setStatus(status);
 
 		BigDecimal totalPaymentAmount = BigDecimal.ZERO;
+		totalPaymentAmount.add(memberCalenderService.getActualAmount(musicGroupPaymentBaseCalender));
+		totalPaymentAmount.add(((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).getActualAmount(musicGroupPaymentBaseCalender));
+		totalPaymentAmount.add(musicRepairService.getActualAmount(musicGroupPaymentBaseCalender));
+		musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
+
 		CalenderMemberDto calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
 		if(calenderMember != null){
 			//设置会员缴费金额、级别以及有效期
-			totalPaymentAmount.add(calenderMember.getActualAmount());
 			musicGroupPaymentCalender.setMemberPaymentAmount(calenderMember.getActualAmount());
 			musicGroupPaymentCalender.setMemberRankSettingId(calenderMember.getMemberRankSettingId());
 			musicGroupPaymentCalender.setMemberValidDate(calenderMember.getMemberNum());
 			musicGroupPaymentCalender.setMemberPeriod(calenderMember.getPeriodEnum());
 		}
-		//课程费用列表
-		List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
-				.getMusicGroupPaymentCalenderCourseSettingsList();
-		if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-			totalPaymentAmount.add(currentMusicGroupPaymentCalenderCourseSettings.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add));
-		}
-		musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
 
 //		BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
 //		if(musicGroupPaymentCalenderCourseSettingsList != null){
@@ -663,6 +669,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setBatchNo(batchNo);
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
+		//课程费用列表
+		List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
+				.getMusicGroupPaymentCalenderCourseSettingsList();
 		if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
 			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
 					.getMusicGroupOrganizationCourseSettingId());

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

@@ -816,7 +816,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				}
 				//如果课程时间在两天前
 				int i = DateUtil.daysBetween(classDate, DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN));
-				if (i > --day) {
+				if (i > day) {
 					throw new BizException("超出可申述时间");
 				}
 			}

+ 15 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml

@@ -0,0 +1,15 @@
+<?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.MusicGroupPaymentCalenderActivityDao">
+  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
+    <id column="id_" jdbcType="BIGINT" property="id" />
+    <result column="activity_id_" jdbcType="INTEGER" property="activityId" />
+    <result column="calender_id_" jdbcType="INTEGER" property="calenderId" />
+    <result column="optional_flag_" jdbcType="TINYINT" property="optionalFlag" />
+    <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id_, activity_id_, calender_id_, optional_flag_, create_time_, update_time_
+  </sql>
+</mapper>

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

@@ -63,7 +63,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/add')")
     public Object add(@RequestBody MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
     	String batchNo = musicGroupPaymentCalenderService.create1(musicGroupPaymentBaseCalender);
-        ModelMap map = new ModelMap();
+        ModelMap map = new ModelMap(1);
         map.put("musicGroupPaymentCalenderBatchNo", batchNo);
         return succeed(map);
     }