Browse Source

Merge branch 'feature/0529-live' of http://git.dayaedu.com/yonge/mec into feature/0529-live

liujc 2 years ago
parent
commit
48bac90228

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

@@ -17,7 +17,6 @@ import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.dal.school.dto.ClassesForDayDto;
 import com.ym.mec.biz.dal.school.dto.CourseStudentDto;
 import com.ym.mec.biz.dal.vo.CourseScheduleWrapper;
-import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.dal.vo.ImLiveRoomVideoVo;
 import com.ym.mec.biz.dal.wrapper.DailySummaryOfClassesForTheCurrentSemesterWrapper;
 import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
@@ -197,8 +196,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Autowired
 	private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
 
-    @Autowired
-    private ImLiveRoomVideoService imLiveRoomVideoService;
 
     @Autowired
     private ImLiveRoomVideoDao imLiveRoomVideoDao;
@@ -411,7 +408,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Transactional(rollbackFor = Exception.class)
     public void batchDeleteMusicGroupCourseWithStudent(String musicGroupId, Integer userId, GroupType groupType) {
         if (StringUtils.isBlank(musicGroupId)) {
-            throw new BizException("请指定乐团");
+            throw new BizException("请指定课程组");
         }
         List<CourseSchedule> musicGroupCourseSchedules = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, groupType.getCode(), CourseStatusEnum.NOT_START.getCode(), userId);
         if (!CollectionUtils.isEmpty(musicGroupCourseSchedules)) {
@@ -419,6 +416,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     .map(courseSchedule -> courseSchedule.getId())
                     .collect(Collectors.toList());
             courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudent(courseScheduleIds, userId);
+			studentAttendanceDao.deleteByCourseAndUser(courseScheduleIds,userId);
         }
     }
 
@@ -3927,7 +3925,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
         CourseAttendanceDetailHeadInfoDto courseAttendanceDetailHeadInfoDto = courseScheduleDao.findByCourse(courseScheduleId);
         courseAttendanceDetailHeadInfoDto.setLatestAttendanceTime(studentAttendanceDao.findLatestAttendanceDate(courseScheduleId));
-        courseAttendanceDetailHeadInfoDto.setStudentNum(studentAttendanceDao.getStudentNumByStatus(courseScheduleId, StudentAttendanceStatusEnum.NORMAL));
         courseAttendanceDetailHeadInfoDto.setLeaveStudentNum(studentAttendanceDao.getStudentNumByStatus(courseScheduleId, StudentAttendanceStatusEnum.LEAVE));
         courseAttendanceDetailHeadInfoDto.setTruantStudentNum(studentAttendanceDao.getStudentNumByStatus(courseScheduleId, StudentAttendanceStatusEnum.TRUANT));
         courseAttendanceDetailHeadInfoDto.setLateStudentNum(studentAttendanceDao.getStudentNumByStatus(courseScheduleId, StudentAttendanceStatusEnum.LATE));
@@ -5913,19 +5910,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         List<CourseScheduleDto> teacherCourseFormat = getTeacherCourseFormat(queryInfo.getTeacherId(), new Date(),
                 queryInfo.getTenantId(), new Date(), courseScheduleDtos, courseIds, courseIds);
 
-        // 直播房间id集合
-//        List<String> roomIdList = teacherCourseFormat.stream().map(CourseScheduleDto::getLiveRoomId).collect(Collectors.toList());
-//
-//        // 查询直播间视频数
-//        Map<String, Integer> uidCountMap = imLiveRoomVideoService.queryRoomUidCountMap(roomIdList);
-//        for (CourseScheduleDto record : teacherCourseFormat) {
-//            Integer count = uidCountMap.get(record.getLiveRoomId());
-//            if (count == null) {
-//                record.setVideoNum(0);
-//            }
-//            record.setVideoNum(count);
-//        }
-
         return page.setRecords(teacherCourseFormat);
     }
 

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

@@ -1790,8 +1790,8 @@ public class ExportServiceImpl implements ExportService {
             List<JSONObject> orderItemList = JSONObject.parseArray(JSONObject.parseObject(goodsJson).getString("orderItemList"), JSONObject.class);
             productIdList.addAll(orderItemList.stream().map(e -> e.get("productId").toString()).collect(Collectors.toSet()));
         }
-        List<String> categoryNames = sellOrderDao.getMallProductCategory("mall_pro");
-        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mall_pro"));
+        List<String> categoryNames = sellOrderDao.getMallProductCategory("mec_mall");
+        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mec_mall"));
         for (StudentPaymentOrderMallExportDto row : studentPaymentOrderExportDtos) {
             if (row.getActualAmount() == null) {
                 row.setActualAmount(BigDecimal.ZERO);
@@ -2622,8 +2622,8 @@ public class ExportServiceImpl implements ExportService {
             List<JSONObject> orderItemList = JSONObject.parseArray(JSONObject.parseObject(goodsJson).getString("orderItemList"), JSONObject.class);
             productIdList.addAll(orderItemList.stream().map(e -> e.get("productId").toString()).collect(Collectors.toSet()));
         }
-        List<String> categoryNames = sellOrderDao.getMallProductCategory("mall_pro");
-        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mall_pro"));
+        List<String> categoryNames = sellOrderDao.getMallProductCategory("mec_mall");
+        Map<Long,String> productCategoryMap = MapUtil.convertMybatisMap(sellOrderDao.getMallProductMap(productIdList,"mec_mall"));
         for (StudentPaymentOrderMallExportDto basicOrder : studentPaymentOrderExportDtos) {
             basicOrder.getUser().setUsername(studentNameMap.get(basicOrder.getUserId()));
             basicOrder.setUserOrganName(userOrganNameMap.get(basicOrder.getOrganId()));

+ 19 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -264,7 +264,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                 List<FinancialExpenditure> financialExpenditureList = new ArrayList<>();
                 Integer organId = null;
                 String note = "";
-                ExpenditureTypeEnum expenditureTypeEnum = ExpenditureTypeEnum.REFUND;
                 FeeProjectEnum feeProjectEnum = FeeProjectEnum.REFUND;
                 BigDecimal totalAmount = BigDecimal.ZERO;
 
@@ -283,9 +282,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                     if (oaInputDto.getName().contains("金额")) {
                         totalAmount = new BigDecimal(submitValue.toString());
                     }
-                    if (StringUtils.equals("支出类型", oaInputDto.getName())) {
-                        expenditureTypeEnum = ExpenditureTypeEnum.valueOfDesc(submitValue.toString());
-                    }
                     if (StringUtils.equals("费用类别", oaInputDto.getName()) || StringUtils.equals("费用类型", oaInputDto.getName())) {
                         feeProjectEnum = FeeProjectEnum.valueOfDesc(submitValue.toString());
                     }
@@ -328,7 +324,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                     }
                                 }
                                 financialExpenditure.setFeeProject(feeProjectEnum);
-                                financialExpenditure.setType(expenditureTypeEnum);
+                                financialExpenditure.setType(getExpenditureType(feeProjectEnum));
                                 financialExpenditure.setAprovalTime(endTime);
                                 financialExpenditure.setPaymentTime(endTime);
                                 financialExpenditure.setAmount(totalAmount);
@@ -356,7 +352,6 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                             financialExpenditure.setApplyUserId(pWorkOrderInfo.getCreator());
                             financialExpenditure.setProcessId(pWorkOrderInfo.getProcess());
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
-                            financialExpenditure.setType(expenditureTypeEnum);
                             List<OaColumnDto> columns = oaInputDto.getColumns();
                             if (columns != null && columns.size() > 0) {
                                 for (OaColumnDto column : columns) {
@@ -391,14 +386,13 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                                             } else if (StringUtils.equals(name,"情况说明") || StringUtils.equals(name,"事由")) {
                                                 financialExpenditure.setCause(o.toString());
-                                            } else if (StringUtils.equals(name,"支出类型")) {
-                                                financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
-                                            } else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
+                                            }else if (StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")) {
                                                 FeeProjectEnum projectEnum = FeeProjectEnum.valueOfDesc(o.toString());
                                                 if(projectEnum == null){
                                                     projectEnum = feeProjectEnum;
                                                 }
                                                 financialExpenditure.setFeeProject(projectEnum);
+                                                financialExpenditure.setType(getExpenditureType(projectEnum));
                                             }else if (StringUtils.equals(name,"日期") || StringUtils.equals(name,"费用发生日期")) {
                                                 financialExpenditure.setPaymentTime(DateUtil.stringToDate(o.toString(),DateUtil.DEFAULT_PATTERN));
                                             } else if (StringUtils.equals(name,"费用分摊月份")) {
@@ -483,11 +477,10 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         for (FinancialExpenditure financialExpenditure : financialExpenditures) {
                             financialExpenditure.setAprovalTime(endTime);
                             financialExpenditure.setPaymentTime(endTime);
-                            financialExpenditure.setType(expenditureTypeEnum);
                             financialExpenditure.setEffectiveTime(DateUtil.format(endTime,DateUtil.ISO_YEAR_MONTH_FORMAT));
                             financialExpenditure.setApplyUser(realName);
-                            financialExpenditure.setType(ExpenditureTypeEnum.REFUND);
                             financialExpenditure.setFeeProject(FeeProjectEnum.REFUND);
+                            financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                             financialExpenditure.setBatchNo(pWorkOrderInfo.getId().toString());
                             financialExpenditure.setFinancialProcessNo(pWorkOrderInfo.getId().toString());
                         }
@@ -525,10 +518,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                     }else if(StringUtils.equals(name,"情况说明")){
                         financialExpenditure.setCause(o.toString());
-                    }else if(StringUtils.equals(name,"支出类型")){
-                        financialExpenditure.setType(ExpenditureTypeEnum.valueOfDesc(o.toString()));
                     }else if(StringUtils.equals(name,"费用类型") || StringUtils.equals(name,"费用类别")){
                         financialExpenditure.setFeeProject(FeeProjectEnum.valueOfDesc(o.toString()));
+                        financialExpenditure.setType(getExpenditureType(financialExpenditure.getFeeProject()));
                     }
                 }
                 financialExpenditureDao.insert(financialExpenditure);
@@ -536,6 +528,19 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
     }
 
+    public static ExpenditureTypeEnum getExpenditureType(FeeProjectEnum feeProjectEnum) {
+        switch (feeProjectEnum) {
+            case REFUND:
+                return ExpenditureTypeEnum.REFUND;
+            case HOUSE:
+            case OFFICE:
+            case MAINS_PROPERTY:
+                return ExpenditureTypeEnum.FIXED;
+            default:
+                return ExpenditureTypeEnum.VARIABLE;
+        }
+    }
+
     @Override
     public void checkCourseReturnFee(Map<String,String> paramMap) {
         String tplInfoId = paramMap.get("tplInfoId");
@@ -721,4 +726,5 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
         }
         return financialExpenditureList;
     }
+
 }

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

@@ -3035,17 +3035,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if (classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
             throw new BizException("当前学生已经是退学状态");
         }
-        /*BigDecimal amount = returnFeeDto.getAmount();
-        if (!classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
-            if (Objects.isNull(amount)) {
-                throw new BizException("请确定退费金额");
-            }
-            Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
-            BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
-            if (amount.compareTo(suplusCourseFee) > 0) {
-                throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
-            }
-        }*/
         GroupType groupType = GroupType.VIP;
         if("LIVE".equals(vipGroup.getGroupType())){
             groupType = GroupType.LIVE;

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

@@ -673,16 +673,16 @@
         </foreach>
     </select>
     <select id="getMallProductMap" resultType="java.util.Map">
-        select pp.id 'key',ppc.name 'value' from mall_pro.pms_product_category ppc
-        left join mall_pro.pms_product_category ppcc ON ppcc.parent_id = ppc.id
-        left join mall_pro.pms_product pp ON pp.product_category_id = ppcc.id
+        select pp.id 'key',ppc.name 'value' from mec_mall.pms_product_category ppc
+        left join mec_mall.pms_product_category ppcc ON ppcc.parent_id = ppc.id
+        left join mec_mall.pms_product pp ON pp.product_category_id = ppcc.id
         where pp.id IN
         <foreach collection="productIdList" item="id" open="(" close=")" separator=",">
             #{id}
         </foreach>
     </select>
     <select id="getMallProductCategory" resultType="java.lang.String">
-        select name from mall_pro.pms_product_category where parent_id = 0
+        select name from mec_mall.pms_product_category where parent_id = 0
     </select>
 
 </mapper>

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

@@ -1233,9 +1233,9 @@
     <select id="queryVipQuitOrder" resultType="com.ym.mec.biz.dal.entity.StudentPaymentOrder">
         SELECT spo.* FROM student_payment_order spo
         left join class_group_student_mapper cgsm ON spo.class_group_id_ = cgsm.class_group_id_ and spo.music_group_id_ = cgsm.music_group_id_
-        WHERE music_group_id_ = #{vipGroupId} AND cgsm.status_ != 'QUIT'
-        AND type_ IN ('LIVE_GROUP_BUY','SMALL_CLASS_TO_BUY')
-        AND status_ = 'SUCCESS'  AND spo.class_group_id_ = cgsm.class_group_id_ and spo.music_group_id_ = cgsm.music_group_id_
+        WHERE cgsm.music_group_id_ = #{vipGroupId} AND cgsm.status_ != 'QUIT'
+        AND spo.type_ IN ('LIVE_GROUP_BUY','SMALL_CLASS_TO_BUY')
+        AND spo.status_ = 'SUCCESS'  AND spo.class_group_id_ = cgsm.class_group_id_ and spo.music_group_id_ = cgsm.music_group_id_
     </select>
 
 

+ 6 - 6
mec-student/src/main/java/com/ym/mec/student/controller/WechatController.java

@@ -43,11 +43,11 @@ public class WechatController extends BaseController {
 
 	@ApiOperation("获取签名")
 	@GetMapping(value = "/getSignature")
-	public Object getSignature(String url,String platForm) throws Exception {
-		if(StringUtils.isEmpty(platForm)){
-			platForm = "gym";
+	public Object getSignature(String url,String platform) throws Exception {
+		if(StringUtils.isEmpty(platform)){
+			platform = "gym";
 		}
-		Map<String, String> appIdMap = appidMap.get(platForm);
+		Map<String, String> appIdMap = appidMap.get(platform);
 
 		url = URLDecoder.decode(url);
 		String appId = appIdMap.get("appId");
@@ -83,8 +83,8 @@ public class WechatController extends BaseController {
 		map.put("appId", "wx80f175c0eb6836e9");
 		map.put("secret", "a9d779747dba9f4e82f19882debe3e93");
 		Map<String,String> map1 = new HashMap<>();
-		map.put("appId", "wx751141096e75a4ee");
-		map.put("secret", "e882d76c95d1613607a85338b1bed3ff");
+		map1.put("appId", "wx751141096e75a4ee");
+		map1.put("secret", "e882d76c95d1613607a85338b1bed3ff");
 		resultMap.put("gym",map);
 		resultMap.put("daya",map1);
 		return resultMap;

+ 1 - 1
pom.xml

@@ -183,7 +183,7 @@
 			<dependency>
 				<groupId>com.alibaba</groupId>
 				<artifactId>druid-spring-boot-starter</artifactId>
-				<version>1.1.24</version>
+				<version>1.1.10</version>
 			</dependency>
 
 			<dependency>