瀏覽代碼

Merge branch 'zx_saas_goodsCopy' of http://git.dayaedu.com/yonge/mec into test

zouxuan 1 年之前
父節點
當前提交
8fd77217ab

+ 2 - 2
mec-application/src/main/java/com/ym/mec/student/controller/LessonCoursewareController.java

@@ -64,8 +64,8 @@ public class LessonCoursewareController extends BaseController {
 
 	@ApiOperation(value = "获取课程详情")
 	@GetMapping("/getLessonCourseDetail/{id}")
-	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") String id){
-		return succeed(coursewareFeignService.lessonCoursewareDetailDetail(Long.parseLong(id)).feignData());
+	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
+		return succeed(lessonCoursewareService.getLessonCourseDetail(id));
 	}
 
 	@ApiOperation(value = "获取课件关联的声部列表")

+ 2 - 2
mec-application/src/main/java/com/ym/mec/teacher/controller/LessonCoursewareController.java

@@ -64,8 +64,8 @@ public class LessonCoursewareController extends BaseController {
 
 	@ApiOperation(value = "获取课程详情")
 	@GetMapping("/getLessonCourseDetail/{id}")
-	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") String id){
-		return succeed(coursewareFeignService.lessonCoursewareDetailDetail(Long.parseLong(id)).feignData());
+	public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
+		return succeed(lessonCoursewareService.getLessonCourseDetail(id));
 	}
 
 	@ApiOperation(value = "获取课件关联的声部列表")

+ 8 - 0
mec-application/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.service.GoodsCategoryService;
 import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -166,4 +167,11 @@ public class GoodsController extends BaseController {
     public Object queryGoodsBrandList() {
         return succeed(goodsService.queryGoodsBrandList());
     }
+
+    @ApiOperation(value = "复制商品")
+    @PostMapping("/copyGoods")
+    public HttpResponseResult<Object> copyGoods(Integer goodsId){
+        goodsService.copyGoods(goodsId);
+        return succeed();
+    }
 }

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

@@ -55,16 +55,6 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      */
     MusicGroupPaymentCalender getForLock(@Param("id") Long id);
 
-    /**
-     * 根据指定乐团的缴费日期查询交集
-     *
-     * @param musicGroupId        乐团编号
-     * @param startPaymentDate    开始缴费日期
-     * @param deadlinePaymentDate 截止缴费日期
-     * @return
-     */
-    int queryIntersectionByPaymentDate(@Param("musicGroupId") String musicGroupId, @Param("startPaymentDate") Date startPaymentDate,
-                                       @Param("deadlinePaymentDate") Date deadlinePaymentDate, @Param("calenderId") Long calenderId);
 
     /**
      * 乐团最后一次交费信息
@@ -74,8 +64,6 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      */
     MusicGroupPaymentCalender getLastStartOne(@Param("musicGroupId") String musicGroupId);
 
-    int queryIntersectionByDate(@Param("musicGroupId") String musicGroupId, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
     /**
      * @param configValue:
      * @return void

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -165,4 +165,6 @@ public interface GoodsService extends BaseService<Integer, Goods> {
     List<ProductCategoryDto> queryGoodsCategoryList();
 
     Map<String,String> getBrandMap();
+
+    void copyGoods(Integer goodsId);
 }

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
 import com.ym.mec.biz.dal.mapper.LessonCoursewareMapper;
 import com.ym.mec.biz.dal.entity.LessonCourseware;
 import com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper;
@@ -18,5 +19,7 @@ public interface LessonCoursewareService extends IService<LessonCourseware> {
 
     //获取课件适用范围
     LessonCoursewareWrapper.UpdateRangeDetail getRangeType(Integer lessonCoursewareId);
+
+    CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id);
 }
 

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

@@ -35,6 +35,7 @@ import com.ym.mec.util.excel.POIUtil;
 import com.ym.mec.util.ini.IniFileUtil;
 import com.ym.mec.util.upload.UploadUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.PictureData;
@@ -47,7 +48,6 @@ import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -1512,4 +1512,38 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
         }
         return new HashMap<>();
     }
+
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public void copyGoods(Integer goodsId) {
+		List<GoodsSub> goodsSubs = goodsSubService.lambdaQuery().eq(GoodsSub::getGoodsId, goodsId).list();
+		Goods goods = goodsDao.get(goodsId);
+		if (goods == null) {
+			throw new BizException("商品不存在");
+		}
+		Date now = new Date();
+		if(goods.getName().contains("-副本")){
+			//截取副本后的数字
+			String copyNum = goods.getName().substring(goods.getName().lastIndexOf("-副本") + 3);
+			if(NumberUtils.isNumber(copyNum)){
+				goods.setName(goods.getName().replace("-副本"+copyNum,"")+"-副本"+(Integer.parseInt(copyNum)+1));
+			}else{
+				goods.setName(goods.getName()+"-副本1");
+			}
+		}else {
+			goods.setName(goods.getName()+"-副本1");
+		}
+		goods.setId(null);
+		goods.setStatus(YesOrNoEnum.NO);
+		goods.setCreateTime(now);
+		goods.setUpdateTime(now);
+		goodsDao.insert(goods);
+		if(CollectionUtils.isNotEmpty(goodsSubs)){
+			List<GoodsSub> newGoodsSubs = goodsSubs.stream().peek(goodsSub -> {
+				goodsSub.setId(null);
+				goodsSub.setGoodsId(goods.getId());
+            }).collect(Collectors.toList());
+			goodsSubService.saveBatch(newGoodsSubs);
+		}
+	}
 }

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/LessonCoursewareServiceImpl.java

@@ -3,7 +3,9 @@ package com.ym.mec.biz.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
+import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsMaterialRefWrapper;
 import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
@@ -14,6 +16,7 @@ import com.ym.mec.biz.dal.mapper.LessonCoursewareMapper;
 import com.ym.mec.biz.dal.wrapper.LessonCoursewareWrapper;
 import com.ym.mec.biz.service.LessonCoursewareService;
 import com.ym.mec.biz.service.LessonCoursewareUserMapperService;
+import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.collection.MapUtil;
@@ -48,6 +51,8 @@ public class LessonCoursewareServiceImpl extends ServiceImpl<LessonCoursewareMap
     private SubjectDao subjectDao;
     @Resource
     private TeacherDao teacherDao;
+    @Resource
+    private SysMusicScoreService sysMusicScoreService;
 
     @Override
     public IPage<LessonCoursewareWrapper.LessonCoursewareDto> selectPage(IPage<LessonCoursewareWrapper.LessonCoursewareDto> page, LessonCoursewareWrapper.LessonCoursewareQuery query) {
@@ -183,5 +188,40 @@ public class LessonCoursewareServiceImpl extends ServiceImpl<LessonCoursewareMap
         return detail;
     }
 
+    @Override
+    public CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail getLessonCourseDetail(Long id) {
+        CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail detail = coursewareFeignService.lessonCoursewareDetailDetail(id).feignData();
+        if (detail == null) {
+            return null;
+        }
+        List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> knowledgePointList = detail.getKnowledgePointList();
+        if(CollectionUtils.isNotEmpty(knowledgePointList)){
+            //获取知识点下的素材列表、下面关联的资源列表,如果applicationIdList是空的,那么把他剔除掉
+            for (CbsLessonCoursewareDetailWrapper.KnowledgePointSmall knowledgePointSmall : knowledgePointList) {
+                List<CbsLessonCoursewareDetailWrapper.KnowledgePointSmall> knowledgePointSmalls = knowledgePointSmall.getChildren();
+                if (CollectionUtils.isNotEmpty(knowledgePointSmalls)){
+                    for (CbsLessonCoursewareDetailWrapper.KnowledgePointSmall pointSmall : knowledgePointSmalls) {
+                        List<CbsLessonCoursewareDetailWrapper.MaterialSmall> materialList = pointSmall.getMaterialList();
+                        if(CollectionUtils.isNotEmpty(materialList)){
+                            for (CbsLessonCoursewareDetailWrapper.MaterialSmall materialSmall : materialList) {
+                                List<CbsMaterialRefWrapper.AddMaterialRef> materialRefs = materialSmall.getMaterialRefs();
+                                if (CollectionUtils.isNotEmpty(materialRefs)){
+                                    for (CbsMaterialRefWrapper.AddMaterialRef materialRef : materialRefs) {
+                                        materialRef.setResourceId(null);
+                                        CbsMaterialRefWrapper.RelateMaterialInfo relateMaterialInfo = materialRef.getRelateMaterialInfo();
+                                        if(relateMaterialInfo != null && StringUtils.equals(relateMaterialInfo.getType(),"SONG")
+                                                && CollectionUtils.isNotEmpty(relateMaterialInfo.getApplicationIdList())){
+                                            materialRef.setResourceId(relateMaterialInfo.getId());
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return detail;
+    }
 }
 

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

@@ -111,7 +111,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
                 push.put(userId, userId + "");
             }
             MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-            String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+            String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL_MDAYA);
             String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId=" + calender.getId() + "&id=" + calender.getMusicGroupId();
             // 发送续费通知
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
@@ -423,7 +423,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
         //未缴费
         Map<Integer, String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calenderId, studentIdList));
         MusicGroup musicGroup = musicGroupDao.get(paymentCalender.getMusicGroupId());
-        String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+        String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL_MDAYA);
         String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId=" + calenderId + "&id=" + musicGroup.getId();
         Map<Integer, String> push = new HashMap<>();
         for (Integer userId : studentIdList) {

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

@@ -33,6 +33,7 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.mall.MallFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -192,7 +193,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
         PaymentCalenderStatusEnum status = musicGroupPaymentCalenderDto.getStatus();
 
-        Date date = new Date();
         String batchNo = idGeneratorService.generatorId() + "";
 
         MusicGroupPaymentDateRange musicGroupPaymentDateRange = musicGroupPaymentDateRangeList.get(0);
@@ -211,14 +211,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentDateRange.getStartPaymentDate());
         musicGroupPaymentCalender.setStudentIds(musicGroupPaymentCalenderDto.getStudentIds());
         musicGroupPaymentCalender.setOperator(sysUser.getId());
-        musicGroupPaymentCalender.setCreateTime(date);
-        musicGroupPaymentCalender.setUpdateTime(date);
         musicGroupPaymentCalender.setStatus(status);
         musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
         if (musicGroupPaymentCalender.getStatus() != AUDITING) {
+            Date date = new Date();
+            Date day = DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN);
             if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-            } else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+            } else if (day.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
             } else {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
@@ -763,9 +763,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         musicGroupPaymentCalender.setStatus(status);
         musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
         if (musicGroupPaymentCalender.getStatus() != AUDITING) {
+            Date day = DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN);
             if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-            } else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+            } else if (day.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
             } else {
                 musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
@@ -1028,6 +1029,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
             
             for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
                 //如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
+                Date day = DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN);
                 if (musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
                     if (musicGroupPaymentCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) > 0) {
                         musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
@@ -1036,7 +1038,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                     }
                 } else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
                     musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-                } else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+                } else if (day.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
                     musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
                 } else {
                     musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
@@ -1409,7 +1411,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
             studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentStudentIds(calenderId);
         }
         if (studentIds.size() > 0) {
-            String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+            String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL_MDAYA);
             StringBuffer memo = new StringBuffer("4?").append(baseUrl).append("/#/musicGroupRenew?calenderId=").append(calenderId).append("&id=").append(musicGroup.getId());
             Map<Integer, String> push = new HashMap<>(studentIds.size());
             studentIds.forEach(e -> push.put(e, e.toString()));
@@ -1593,8 +1595,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(null, statusList, PayUserType.STUDENT.getCode());
 
         List<MusicGroupPaymentCalender> updateMusicGroupPaymentCalenderList = new ArrayList<MusicGroupPaymentCalender>();
+        Date day = DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN);
         for (MusicGroupPaymentCalender mgpc : musicGroupPaymentCalenderList) {
-            if (mgpc.getDeadlinePaymentDate() != null && date.after(mgpc.getDeadlinePaymentDate()) && mgpc.getStatus() == PaymentCalenderStatusEnum.OPEN) {
+            if (mgpc.getDeadlinePaymentDate() != null && day.after(mgpc.getDeadlinePaymentDate()) && mgpc.getStatus() == PaymentCalenderStatusEnum.OPEN) {
                 // “进行中”更新至“已结束”
                 mgpc.setUpdateTime(date);
                 mgpc.setStatus(PaymentCalenderStatusEnum.OVER);

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

@@ -447,12 +447,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
 				insertMusicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 			}
-			if (insertMusicGroupPaymentCalenderDetailList.size() > 0) {
+			if (CollectionUtils.isNotEmpty(insertMusicGroupPaymentCalenderDetailList)) {
 				musicGroupPaymentCalenderDetailDao.batchInsert(insertMusicGroupPaymentCalenderDetailList);
                 //创建学生课排课分钟数
                 Map<Integer, Long> userCalenderDetailMap = new HashMap<>(insertMusicGroupPaymentCalenderDetailList.size());
-                insertMusicGroupPaymentCalenderDetailList.stream().forEach(e -> userCalenderDetailMap.put(e.getUserId(), e.getId()));
-                Set<Integer> userIdList = studentBasicList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+                insertMusicGroupPaymentCalenderDetailList.forEach(e -> userCalenderDetailMap.put(e.getUserId(), e.getId()));
+                Set<Integer> userIdList = studentBasicList.stream().map(StudentImportDto::getUserId).collect(Collectors.toSet());
                 musicGroupPaymentStudentCourseDetailService.batchInsert(userIdList,musicGroupPaymentCalender,userCalenderDetailMap);
 			}
 		}
@@ -1814,7 +1814,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0){
             	throw new BizException("没有审核中的缴费项目");
             }
-
+			Date day = DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN);
             musicGroupPaymentCalenderList.forEach(t -> {
                 if (t.getPayUserType() == SCHOOL) {
                     if (t.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) > 0) {
@@ -1824,7 +1824,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     }
                 } else if (date.after(t.getStartPaymentDate())) {
                     t.setStatus(PaymentCalenderStatusEnum.OPEN);
-                } else if (date.after(t.getDeadlinePaymentDate())) {
+                } else if (day.after(t.getDeadlinePaymentDate())) {
                     t.setStatus(PaymentCalenderStatusEnum.OVER);
                 } else {
                     t.setStatus(PaymentCalenderStatusEnum.NO);

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.beust.jcommander.internal.Lists;
 import com.dayaedu.cbs.common.enums.EClientType;
@@ -14,6 +15,7 @@ import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendClientWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.musicInstrument.CbsMusicalInstrumentWrapper;
+import com.google.common.collect.Maps;
 import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
 import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
@@ -34,6 +36,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;

+ 2 - 19
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -64,14 +64,14 @@
             keyColumn="id_" keyProperty="id">
         INSERT INTO music_group_payment_calender
         (name_,music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
-        actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,
+        actual_num_,memo_,is_give_music_network_,payment_valid_start_date_,payment_valid_end_date_,
         payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,
          attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_
          ,original_member_payment_amount_,current_total_amount_,original_total_amount_,tenant_id_,organ_id_,
          cloud_teacher_payment_flag_,payment_item_show_state_,is_show_sale_price_,calender_fee_type_,calender_fee_json_,contract_url_)
         VALUES(#{name},#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
+        #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds},
                #{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount},
@@ -372,27 +372,10 @@
     <select id="getForLock" resultMap="MusicGroupPaymentCalender">
         SELECT * FROM music_group_payment_calender WHERE id_ = #{id} FOR UPDATE
     </select>
-	
-    <select id="queryIntersectionByPaymentDate" resultType="int" parameterType="map">
-        SELECT count(*) FROM music_group_payment_calender mgpc
-        WHERE music_group_id_ = #{musicGroupId} 
-        and (start_payment_date_ between #{startPaymentDate} and #{deadlinePaymentDate}
-        or deadline_payment_date_ between #{startPaymentDate} and #{deadlinePaymentDate})
-        <if test="calenderId != null">
-            AND mgpc.id_ != #{calenderId}
-        </if>
-    </select>
     
     <select id="getLastStartOne" resultMap="MusicGroupPaymentCalender">
         SELECT * FROM music_group_payment_calender WHERE music_group_id_ = #{musicGroupId} ORDER BY start_payment_date_ DESC LIMIT 1
     </select>
-    <select id="queryIntersectionByDate" resultType="java.lang.Integer">
-        SELECT COUNT(DISTINCT mgpcd.id_) FROM music_group_payment_calender mgpc
-        LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-        WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpcd.payment_status_ != 'PAID_COMPLETED'
-        AND (DATE_FORMAT(mgpcd.start_payment_date_,'%Y-%m-%d') between #{startTime} AND #{endTime}
-        OR DATE_FORMAT(mgpcd.deadline_payment_date_,'%Y-%m-%d') between #{startTime} AND #{endTime})
-    </select>
     <select id="queryCalenderByDay" resultType="java.util.Map">
         SELECT mgpcd.music_group_payment_calender_id_ 'key',COUNT(mgpcd.payment_status_) 'value'
         FROM music_group_payment_calender_detail mgpcd

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

@@ -643,7 +643,7 @@
         MAX(cs.class_date_) class_date_,MAX(cs.start_class_time_) start_class_time_,MAX(cs.end_class_time_) end_class_time_,
         MAX(su1.real_name_) educational_teacher_name_,MAX(mg.educational_teacher_id_) educational_teacher_id_,MAX(cs.group_type_) group_type_,
         MAX(cs.actual_teacher_id_) actual_teacher_id_,MAX(su3.real_name_) actual_teacher_name_,
-        CASE WHEN MAX(sa.id_) IS NULL THEN 'TRUANT' ELSE MAX(sa.status_) END attendance_status_
+        IFNULL(MAX(sa.status_),'TRUANT') attendance_status_
         FROM course_schedule_student_payment cssp
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
         LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND sa.user_id_ = cssp.user_id_

+ 1 - 1
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -41,7 +41,7 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
     @Override
     public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
-//        syncSaveLog(request, handler);
+        syncSaveLog(request, handler);
     }
 
     public void syncSaveLog(HttpServletRequest request, Object handler) {