Browse Source

Merge remote-tracking branch 'origin/saas' into saas

yanite 3 năm trước cách đây
mục cha
commit
fd1cae05a9
20 tập tin đã thay đổi với 240 bổ sung81 xóa
  1. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  2. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java
  3. 67 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDetailDto.java
  4. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java
  5. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  6. 1 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherQueryInfo.java
  7. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  8. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  9. 51 26
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  10. 14 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  11. 1 1
      mec-biz/src/main/resources/config/mybatis/CooperationOrganLinkmanMapper.xml
  12. 6 3
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml
  13. 28 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  14. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectPlanMapper.xml
  15. 1 1
      mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml
  16. 4 3
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml
  17. 1 1
      mec-biz/src/main/resources/config/mybatis/TeacherDefaultPracticeGroupSalaryMapper.xml
  18. 6 5
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  19. 10 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java
  20. 12 18
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import java.util.Set;
 
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 
 import org.apache.ibatis.annotations.Param;
@@ -274,4 +275,8 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @return
 	 */
 	List<MusicGroupPaymentCalenderDetail> queryNoPaymentCanPushByCalenderId(@Param("calenderId") Long calenderId, @Param("studentIds") String studentIds);
+
+	int countDetailPage(Map<String, Object> params);
+
+	List<MusicGroupPaymentCalenderDetailDto> queryDetailPage(Map<String, Object> params);
 }

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

@@ -9,6 +9,7 @@ import java.util.Date;
 import java.util.List;
 
 public class MusicGroupPaymentBaseCalender {
+	private Long calenderId;
 
 	@ApiModelProperty(value = "乐团编号", required = true)
 	private String musicGroupId;
@@ -50,6 +51,14 @@ public class MusicGroupPaymentBaseCalender {
 	@ApiModelProperty(value = "进行中加学员拓展信息", required = false)
 	private CalenderAddStudent calenderAddStudent;
 
+	public Long getCalenderId() {
+		return calenderId;
+	}
+
+	public void setCalenderId(Long calenderId) {
+		this.calenderId = calenderId;
+	}
+
 	public CalenderAddStudent getCalenderAddStudent() {
 		return calenderAddStudent;
 	}

+ 67 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDetailDto.java

@@ -0,0 +1,67 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import java.math.BigDecimal;
+
+public class MusicGroupPaymentCalenderDetailDto extends MusicGroupPaymentCalenderDetail {
+    //辅件
+    private BigDecimal accessoriesAmount = BigDecimal.ZERO;
+    //会员金额
+    private BigDecimal cloudAmount = BigDecimal.ZERO;
+    //乐器
+    private BigDecimal musicalAmount = BigDecimal.ZERO;
+    //乐保
+    private BigDecimal maintenanceAmount = BigDecimal.ZERO;
+    //活动
+    private BigDecimal activityAmount = BigDecimal.ZERO;
+    //课程
+    private BigDecimal courseAmount = BigDecimal.ZERO;
+
+    public BigDecimal getCourseAmount() {
+        return courseAmount;
+    }
+
+    public void setCourseAmount(BigDecimal courseAmount) {
+        this.courseAmount = courseAmount;
+    }
+
+    public BigDecimal getAccessoriesAmount() {
+        return accessoriesAmount;
+    }
+
+    public void setAccessoriesAmount(BigDecimal accessoriesAmount) {
+        this.accessoriesAmount = accessoriesAmount;
+    }
+
+    public BigDecimal getCloudAmount() {
+        return cloudAmount;
+    }
+
+    public void setCloudAmount(BigDecimal cloudAmount) {
+        this.cloudAmount = cloudAmount;
+    }
+
+    public BigDecimal getMusicalAmount() {
+        return musicalAmount;
+    }
+
+    public void setMusicalAmount(BigDecimal musicalAmount) {
+        this.musicalAmount = musicalAmount;
+    }
+
+    public BigDecimal getMaintenanceAmount() {
+        return maintenanceAmount;
+    }
+
+    public void setMaintenanceAmount(BigDecimal maintenanceAmount) {
+        this.maintenanceAmount = maintenanceAmount;
+    }
+
+    public BigDecimal getActivityAmount() {
+        return activityAmount;
+    }
+
+    public void setActivityAmount(BigDecimal activityAmount) {
+        this.activityAmount = activityAmount;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java

@@ -42,6 +42,8 @@ public class SysMusicScore {
 
 	/** 带节拍器原音MP3 */
 	private String metronomeUrl;
+	
+	private String midiUrl;
 
 	private String accompanimentUrl;
 
@@ -298,6 +300,14 @@ public class SysMusicScore {
 		return this.createTime;
 	}
 
+	public String getMidiUrl() {
+		return midiUrl;
+	}
+
+	public void setMidiUrl(String midiUrl) {
+		this.midiUrl = midiUrl;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -16,6 +16,7 @@ public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum>
     MIX("MIX", "合奏课"),
     HIGH("HIGH", "小班课"),
     VIP("VIP", "vip课"),
+    PRACTICE("PRACTICE", "网管课"),
     DEMO("DEMO", "试听课"),
     COMPREHENSIVE("COMPREHENSIVE", "综合课"),
     ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"),

+ 1 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherQueryInfo.java

@@ -1,9 +1,8 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.List;
+import com.ym.mec.common.page.QueryInfo;
 
 public class TeacherQueryInfo extends QueryInfo {
 
@@ -22,9 +21,6 @@ public class TeacherQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "账号状态")
     private String lockFlag;
 
-    @ApiModelProperty(value = "1内2外")
-    private Integer tenantId;
-    
     @ApiModelProperty(value = "是否支持额外陪练课授课")
     private Boolean isSupportExtraPracticeLesson;
 
@@ -39,14 +35,6 @@ public class TeacherQueryInfo extends QueryInfo {
         this.isSettlementSalary = isSettlementSalary;
     }
 
-    public Integer getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(Integer tenantId) {
-        this.tenantId = tenantId;
-    }
-
     public Integer getSubjectId() {
         return subjectId;
     }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -7,6 +7,7 @@ import java.util.Set;
 
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
@@ -110,4 +111,6 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
      * @return
      */
     void pushWaitRenewMessage(Long calenderId, String studentIds);
+
+    PageInfo<MusicGroupPaymentCalenderDetailDto> queryDetailPage(MusicCalenderDetailQueryInfo queryInfo);
 }

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

@@ -183,4 +183,13 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	List<MusicGroupPaymentCalender> findByBatchNo(String batchNo);
 
 	PageInfo<MusicGroupPaymentCalenderResultDto> queryCalenderPage(MusicGroupPaymentCalenderQueryInfo queryInfo);
+
+	/**
+	* @description: 新版修改缴费项目,先删除原有的缴费项目,再重新生成
+	 * @param musicGroupPaymentBaseCalender
+	* @return java.lang.String
+	* @author zx
+	* @date 2021/12/27 20:43
+	*/
+    String merge1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender);
 }

+ 51 - 26
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -19,46 +19,26 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
 import com.ym.mec.biz.event.source.GroupEventSource;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
-import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -96,7 +76,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	@Autowired
 	private GroupEventSource groupEventSource;
 	@Autowired
-	private StudentService studentService;
+	private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
 	@Autowired
 	private CloudTeacherOrderDao cloudTeacherOrderDao;
 	@Autowired
@@ -691,4 +671,49 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
 				null, 0, memo, null, musicGroup.getName());
 	}
+
+    @Override
+    public PageInfo<MusicGroupPaymentCalenderDetailDto> queryDetailPage(MusicCalenderDetailQueryInfo queryInfo) {
+		PageInfo<MusicGroupPaymentCalenderDetailDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<MusicGroupPaymentCalenderDetailDto> dataList = null;
+		int count = musicGroupPaymentCalenderDetailDao.countDetailPage(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = musicGroupPaymentCalenderDetailDao.queryDetailPage(params);
+			List<Long> orderIds = dataList.stream().map(e -> e.getPaymentOrderId()).collect(Collectors.toList());
+			List<StudentPaymentOrderDetail> orderDetail = studentPaymentOrderDetailDao.getOrderDetailByOrderId(orderIds);
+			Map<Long, List<StudentPaymentOrderDetail>> orderDetailMap = orderDetail.stream().collect(Collectors.groupingBy(StudentPaymentOrderDetail::getPaymentOrderId));
+			for (MusicGroupPaymentCalenderDetailDto row : dataList) {
+				List<StudentPaymentOrderDetail> orderDetailList = orderDetailMap.get(row.getPaymentOrderId());
+				if(orderDetailList != null && orderDetailList.size() > 0){
+					BigDecimal totalAmount = orderDetailList.stream().map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					//辅件
+					BigDecimal accessoriesAmount = orderDetailList.stream().filter(e -> e.getType() == OrderDetailTypeEnum.ACCESSORIES).map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					row.setAccessoriesAmount(accessoriesAmount);
+					//会员金额
+					BigDecimal cloudAmount = orderDetailList.stream().filter(e -> e.getType() == OrderDetailTypeEnum.CLOUD_TEACHER || e.getType() == OrderDetailTypeEnum.CLOUD_TEACHER_PLUS).map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					row.setCloudAmount(cloudAmount);
+					//乐器
+					BigDecimal musicalAmount = orderDetailList.stream().filter(e -> e.getType() == OrderDetailTypeEnum.MUSICAL).map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					row.setMusicalAmount(musicalAmount);
+					//乐保
+					BigDecimal maintenanceAmount = orderDetailList.stream().filter(e -> e.getType() == OrderDetailTypeEnum.MAINTENANCE).map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					row.setMaintenanceAmount(maintenanceAmount);
+					//活动
+					BigDecimal activityAmount = orderDetailList.stream().filter(e -> e.getType() == OrderDetailTypeEnum.PRACTICE || e.getType() == OrderDetailTypeEnum.VIP).map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+					totalAmount = totalAmount.subtract(accessoriesAmount).subtract(cloudAmount).subtract(musicalAmount).subtract(maintenanceAmount).subtract(activityAmount);
+					row.setCourseAmount(totalAmount);
+				}
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+    }
 }

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

@@ -401,6 +401,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroupPaymentCalender.setCreateTime(date);
 			musicGroupPaymentCalender.setUpdateTime(date);
 			musicGroupPaymentCalender.setStatus(status);
+			musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
 
 			//缴费截止日期默认三天后
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
@@ -608,6 +609,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setCurrentTotalAmount(currentTotalAmount);
 		musicGroupPaymentCalender.setOriginalTotalAmount(originalTotalAmount);
 		musicGroupPaymentCalender.setStatus(status);
+		musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
 
 		if (musicGroupPaymentCalender.getStatus() != AUDITING) {
 			if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
@@ -1648,7 +1650,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = musicGroupPaymentCalenderDao.queryCalenderPage(params);
-			List<Integer> organIdList = dataList.stream().map(e -> e.getOrganId()).collect(Collectors.toList());
+			Set<Integer> organIdList = dataList.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
 			Map<Integer, String> organNameMap = getMap("organization", "id_", "name_", organIdList, Integer.class, String.class);
 			List<Integer> operatorIds = dataList.stream().map(e -> e.getOperator()).collect(Collectors.toList());
 			operatorIds.removeAll(Collections.singleton(null));
@@ -1665,7 +1667,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		return pageInfo;
 	}
 
-	@Override
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public String merge1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
+		del(musicGroupPaymentBaseCalender.getCalenderId());
+		return create1(musicGroupPaymentBaseCalender);
+    }
+
+    @Override
 	@Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
 	public boolean autoUpdateMusicGroupPaymentCalenderStatus() {
 		Date date = new Date();
@@ -1741,11 +1750,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//缴费项目中没有学生即可删除缴费项目
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryByCalenderId(id, null);
 		if (musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0) {
-			throw new BizException("缴费项目中已存在学员,不能删除");
+			throw new BizException("操作失败:缴费项目中已存在学员");
 		}
 		MusicGroupStudentClassAdjust byBatchNo = musicGroupStudentClassAdjustDao.findByBatchNo(calender.getBatchNo());
 		if(byBatchNo != null){
-			throw new BizException("删除失败,班级调整的缴费项目不允许删除");
+			throw new BizException("操作失败:班级调整的缴费项目不支持");
 		}
 
 		if (calender.getPaymentType() == PaymentType.MUSIC_APPLY) {
@@ -1753,7 +1762,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			List<StudentPaymentOrder> studentPaymentOrderList = studentPaymentOrderDao.queryByDealStatus(calender.getMusicGroupId(), OrderTypeEnum.APPLY,
 					DealStatusEnum.ING);
 			if (studentPaymentOrderList != null && studentPaymentOrderList.size() > 0) {
-				throw new BizException("存在缴费中的学生,不能删除");
+				throw new BizException("操作失败:存在缴费中的学生");
 			}
 		}
 		

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

@@ -41,7 +41,7 @@
 		(id_,cooperation_organ_id_,linkman_,mobile_no_,job_,create_time_,tenant_id_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
-		(#{item.id},#{item.cooperationOrganId},#{item.linkman},#{item.mobileNo},#{item.job},#{item.createTime},#{itemm.tenantId})
+		(#{item.id},#{item.cooperationOrganId},#{item.linkman},#{item.mobileNo},#{item.job},#{item.createTime},#{item.tenantId})
 		</foreach>
 	</insert>
 

+ 6 - 3
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml

@@ -87,10 +87,13 @@
 
   <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
           parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
-    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,original_amount_, create_time_, update_time_, tenant_id_)    values
+    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,
+    original_amount_, create_time_, update_time_, tenant_id_)
+    VALUE
     <foreach collection="calenderActivityList" item="entity" separator=",">
-#{entity.activityId}, #{entity.calenderId}, #{entity.optionalFlag}, #{entity.actualAmount},
-      #{entity.originalAmount}, NOW(), NOW(),#{entity.tenantId})    </foreach>
+      (#{entity.activityId}, #{entity.calenderId}, #{entity.optionalFlag}, #{entity.actualAmount},
+      #{entity.originalAmount}, NOW(), NOW(),#{entity.tenantId})
+    </foreach>
   </insert>
   <delete id="delByCalenderId">
     DELETE FROM music_group_payment_calender_activity WHERE calender_id_ = #{calenderId}

+ 28 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -3,8 +3,7 @@
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao">
 
-	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail"
-		id="MusicGroupPaymentCalenderDetail">
+	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail" id="MusicGroupPaymentCalenderDetail">
 		<result column="id_" property="id" />
         <result column="tenant_id_" property="tenantId"/>
 		<result column="music_group_payment_calender_id_" property="musicGroupPaymentCalenderId" />
@@ -232,7 +231,7 @@
 	</select>
 	<sql id="queryPageSql">
 		<where>
-			mgpc.music_group_id_ = sr.music_group_id_ and mgpcd.tenant_id_ = #{tenantId}
+			mgpc.music_group_id_ = sr.music_group_id_ AND mgpcd.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
 			</if>
@@ -542,8 +541,33 @@
 		WHERE (mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1) AND mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) != 0
 		AND mgpcd.music_group_payment_calender_id_ = #{calenderId} AND FIND_IN_SET(mgpcd.user_id_,#{studentIds})
 	</select>
+	<select id="countDetailPage" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT mgpcd.id_) FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
+		LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
+		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+		<include refid="queryPageSql"/>
+	</select>
+
+	<resultMap id="MusicGroupPaymentCalenderDetailDto" type="com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto" extends="MusicGroupPaymentCalenderDetail">
+	</resultMap>
+	<select id="queryDetailPage" resultMap="MusicGroupPaymentCalenderDetailDto">
+		SELECT mgpcd.user_id_,su.username_,st.name_ subject_names_,sr.music_group_status_,su.phone_,
+		CASE WHEN mgpcd.start_payment_date_ IS NULL THEN mgpc.start_payment_date_ ELSE mgpcd.start_payment_date_ END start_payment_date_mgpc_,
+		CASE WHEN mgpcd.deadline_payment_date_ IS NULL THEN mgpc.deadline_payment_date_ ELSE mgpcd.deadline_payment_date_ END deadline_payment_date_mgpc_,
+		CASE WHEN mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1 THEN 1 ELSE 0 END open_,mgpc.payment_type_,mgpcd.payment_order_id_,mgpcd.payment_status_,mgpcd.pay_time_
+		FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
+		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
+		LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+		<include refid="queryPageSql"/>
+		ORDER BY mgpc.update_time_ DESC
+		<include refid="global.limit" />
+	</select>
 
-    <update id="updateNoPaymentAndZeroPaymentStatus">
+	<update id="updateNoPaymentAndZeroPaymentStatus">
 		UPDATE music_group_payment_calender_detail mgpcd
 		SET mgpcd.payment_status_ = 'PAID_COMPLETED',mgpcd.actual_amount_ = 0,mgpcd.update_time_ = NOW()
 		WHERE mgpcd.music_group_payment_calender_id_ = #{calenderId} AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) = 0

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

@@ -50,7 +50,7 @@
         VALUES
         <foreach collection="subjectPlans" item="item" separator=",">
             (#{musicGroupId},#{item.subjectId},#{item.expectedStudentNum},#{item.fee},#{item.kitGroupPurchaseType},
-            #{item.depositFee},now(),now(),#{tenantId})
+            #{item.depositFee},now(),now(),#{item.tenantId})
         </foreach>
     </insert>
 

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

@@ -102,7 +102,7 @@
         <include refid="global.limit"/>
     </select>
     <sql id="queryPageSql">
-    	s.tenant_id_ = #{tenantId}
+    	and s.tenant_id_ = #{tenantId}
         <if test="cooperationOrganId != null">
             AND s.cooperation_organ_id_ = #{cooperationOrganId}
         </if>

+ 4 - 3
mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml

@@ -17,6 +17,7 @@
 		<result column="speed_" property="speed" />
 		<result column="url_" property="url" />
 		<result column="metronome_url_" property="metronomeUrl" />
+		<result column="midi_url_" property="midiUrl" />
 		<result column="accompaniment_url_" property="accompanimentUrl" />
 		<result column="accompaniment_metronome_url_" property="accompanimentMetronomeUrl" />
 		<result column="create_user_id_" property="createUserId" />
@@ -46,10 +47,10 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScore" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_music_score (music_score_categories_id_,name_,type_,speed_,url_,metronome_url_,create_user_id_,order_,
+		INSERT INTO sys_music_score (music_score_categories_id_,name_,type_,speed_,url_,metronome_url_,midi_url_,create_user_id_,order_,
 		                             update_time_,create_time_,client_type_,rank_ids_,render_from_,enable_evaluation_,show_flag_)
 		VALUES(#{musicScoreCategoriesId},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		       #{speed},#{url},#{metronomeUrl},#{createUserId},#{order},NOW(),NOW(),#{clientType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		       #{speed},#{url},#{metronomeUrl},#{midiUrl},#{createUserId},#{order},NOW(),NOW(),#{clientType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		       #{rankIds},#{renderFrom},#{enableEvaluation},#{showFlag})
 	</insert>
 
@@ -81,7 +82,7 @@
 		<if test="createUserId != null">
 			create_user_id_ = #{createUserId},
 		</if>
-			metronome_url_ = #{metronomeUrl},
+			metronome_url_ = #{metronomeUrl},midi_url_ = #{midiUrl},
 			url_ = #{url},
 		<if test="subjectIds != null and subjectIds != ''">
 			subject_ids_ = #{subjectIds},

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

@@ -41,7 +41,7 @@
     	INSERT INTO teacher_default_practice_group_salary
 		(id_,user_id_,minutes_,main_teacher_salary_,assistant_teacher_salary_,create_time_,update_time_,tenant_id_)
 		<foreach collection="list" item="item" separator=",">
-			VALUES(#{item.id},#{item.userId},#{item.minutes},#{item.mainTeacherSalary},#{item.assistantTeacherSalary},now(),now(),#{tenantId})
+			VALUES(#{item.id},#{item.userId},#{item.minutes},#{item.mainTeacherSalary},#{item.assistantTeacherSalary},now(),now(),#{item.tenantId})
 		</foreach>
     </insert>
 

+ 6 - 5
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -684,13 +684,14 @@ public class ExportController extends BaseController {
     public void exportMusicGroupPaymentCalenderDetail(HttpServletResponse response, MusicCalenderDetailQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        List<MusicGroupPaymentCalenderDetail> rows = musicGroupPaymentCalenderDetailService.queryPage(queryInfo).getRows();
+        List<MusicGroupPaymentCalenderDetailDto> rows = musicGroupPaymentCalenderDetailService.queryDetailPage(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名", "学员声部", "学员状态", "手机号", "预计缴费金额",
-                    "缴费开始日期", "缴费截止日期", "是否开启缴费", "缴费状态", "支付时间"}, new String[]{
-                    "userId", "sysUser.username", "studentRegistration.subjectName", "studentRegistration.musicGroupStatus.msg", "sysUser.phone", "expectAmount",
-                    "startPaymentDateMgpc", "deadlinePaymentDateMgpc", "openFlag.msg", "paymentStatus.desc", "payTime"}, rows);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名", "学员声部", "学员状态", "手机号",
+                    "缴费开始日期", "缴费截止日期", "是否开启缴费", "缴费状态", "支付时间","会员金额", "乐器金额", "课程金额", "辅件金额", "乐保金额", "活动金额"}, new String[]{
+                    "userId", "sysUser.username", "studentRegistration.subjectName", "studentRegistration.musicGroupStatus.msg", "sysUser.phone",
+                    "startPaymentDateMgpc", "deadlinePaymentDateMgpc", "openFlag.msg", "paymentStatus.desc", "payTime",
+                    "cloudAmount", "musicalAmount", "courseAmount", "accessoriesAmount", "maintenanceAmount", "activityAmount"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();

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

@@ -78,6 +78,16 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         return succeed(map);
     }
 
+    @ApiOperation(value = "修改乐团缴费日历")
+    @PostMapping(value = "/updateCalender", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/updateCalender')")
+    public Object updateCalender(@RequestBody MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
+    	String batchNo = musicGroupPaymentCalenderService.merge1(musicGroupPaymentBaseCalender);
+        ModelMap map = new ModelMap(1);
+        map.put("musicGroupPaymentCalenderBatchNo", batchNo);
+        return succeed(map);
+    }
+
     @ApiOperation(value = "待审核的缴费项目撤回")
     @PostMapping(value = "/revoke")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/revoke')")

+ 12 - 18
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -1,22 +1,5 @@
 package com.ym.mec.web.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-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.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
@@ -30,6 +13,17 @@ import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
 
 @RequestMapping("musicGroupPaymentCalenderDetail")
 @Api(tags = "乐团缴费明细")
@@ -49,7 +43,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/queryPage')")
     public Object queryPage(MusicCalenderDetailQueryInfo queryInfo) {
-        return succeed(musicGroupPaymentCalenderDetailService.queryPage(queryInfo));
+        return succeed(musicGroupPaymentCalenderDetailService.queryDetailPage(queryInfo));
     }
 
     @ApiOperation(value = "修改学员预计缴费金额")