Browse Source

Merge branch 'feature/0425-bugfix' into master_saas

shangke 2 years ago
parent
commit
050d1f1b7c

+ 18 - 3
audio-analysis/src/main/java/com/yonge/netty/dto/HardLevelEnum.java

@@ -88,11 +88,25 @@ public enum HardLevelEnum implements BaseEnum<String, HardLevelEnum> {
 		return frequencyThreshold;
 	}
 
-	public int getTempoEffectiveRange(int denominator) {
+	public int getTempoEffectiveRange(int denominator, double duration) {
 		
 		int tempoEffectiveRange = 0;
 		
-		switch (denominator) {
+		if(duration >= 2666){
+			tempoEffectiveRange = tempoEffectiveRangeOf1;
+		}else if(duration >= 1333){
+			tempoEffectiveRange = tempoEffectiveRangeOf2;
+		}else if(duration >= 666){
+			tempoEffectiveRange = tempoEffectiveRangeOf4;
+		}else if(duration >= 333){
+			tempoEffectiveRange = tempoEffectiveRangeOf8;
+		}else if(duration >= 166){
+			tempoEffectiveRange = tempoEffectiveRangeOf16;
+		}else{
+			tempoEffectiveRange = tempoEffectiveRangeOf32;
+		}
+		
+		/*switch (denominator) {
 		case 1:
 			tempoEffectiveRange = tempoEffectiveRangeOf1;
 			break;
@@ -114,7 +128,7 @@ public enum HardLevelEnum implements BaseEnum<String, HardLevelEnum> {
 
 		default:
 			break;
-		}
+		}*/
 		return tempoEffectiveRange;
 	}
 
@@ -132,3 +146,4 @@ public enum HardLevelEnum implements BaseEnum<String, HardLevelEnum> {
 	}
 
 }
+

+ 33 - 12
audio-analysis/src/main/java/com/yonge/netty/dto/UserChannelContext.java

@@ -391,7 +391,7 @@ public class UserChannelContext {
 				//计算延迟偏移值
 				//playTime = musicXmlNote.getTimeStamp() + durationTime;
 				dynamicOffset = chunkAnalysis.getStartTime() - musicXmlNote.getTimeStamp();
-				if(100 * dynamicOffset / musicXmlNote.getDuration() > (100 - hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()))){
+				if(100 * dynamicOffset / musicXmlNote.getDuration() > (100 - hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()))){
 					dynamicOffset = 0;
 				}
 			}
@@ -532,7 +532,7 @@ public class UserChannelContext {
 
 	public void evaluateForNote(MusicXmlNote musicXmlNote, NoteAnalysis noteAnalysis) {
 		
-		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()) / 100;
+		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()) / 100;
 		
 		double endTime = musicXmlNote.getTimeStamp() + dynamicOffset + floatingRange;
 		double startTime = musicXmlNote.getTimeStamp() + dynamicOffset - floatingRange;
@@ -641,7 +641,7 @@ public class UserChannelContext {
 	
 	private int computeFrequency(MusicXmlNote musicXmlNote) {
 		
-		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()) / 100;
+		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()) / 100;
 		
 		double endTime = musicXmlNote.getTimeStamp() + dynamicOffset + floatingRange;
 		double startTime = musicXmlNote.getTimeStamp() + dynamicOffset - floatingRange;
@@ -691,7 +691,7 @@ public class UserChannelContext {
 	 */
 	private boolean computeTempoWithFrequency(MusicXmlNote musicXmlNote){
 		
-		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()) / 100;
+		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()) / 100;
 		
 		double endTime = musicXmlNote.getTimeStamp() + dynamicOffset + floatingRange;
 		double startTime = musicXmlNote.getTimeStamp() + dynamicOffset - floatingRange;
@@ -838,7 +838,7 @@ public class UserChannelContext {
 		
 		if (tempo) {
 			// 判断进入时间点
-			if(firstPeakIndex * 100 /chunkList.size() > hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator())){
+			if(firstPeakIndex * 100 /chunkList.size() > hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration())){
 				tempo = false;
 				LOGGER.debug("节奏错误原因:进入时间点太晚");
 			}else{
@@ -857,7 +857,7 @@ public class UserChannelContext {
 	
 	private boolean computeTempoWithAmplitude2(MusicXmlNote musicXmlNote) {
 
-		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()) / 100;
+		double floatingRange = musicXmlNote.getDuration() * hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()) / 100;
 		
 		double endTime = musicXmlNote.getTimeStamp() + dynamicOffset + floatingRange;
 		double startTime = musicXmlNote.getTimeStamp() + dynamicOffset - floatingRange;
@@ -872,7 +872,7 @@ public class UserChannelContext {
 		chunkAnalysisList = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getStartTime()) >= Double.doubleToLongBits(correctedStartTime) && Double.doubleToLongBits(t.getEndTime()) <= Double.doubleToLongBits(correctedEndTime)).collect(Collectors.toList());
 		
 		//根据完整度取部分有效信号
-		int elementSize = chunkAnalysisList.size() * (100 - hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator())) / 100;
+		int elementSize = chunkAnalysisList.size() * (100 - hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration())) / 100;
 		List<ChunkAnalysis> chunkList = chunkAnalysisList.subList(0, elementSize);
 		
 		if(chunkList == null || chunkList.size() == 0){
@@ -890,7 +890,7 @@ public class UserChannelContext {
 			return chunkList.stream().filter(t -> t.getAmplitude() > hardLevel.getAmplitudeThreshold()).count() <= 0;
 		}
 		
-		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) < Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).findFirst();
+		Optional<ChunkAnalysis> chunkAnalysisOptional = totalChunkAnalysisList.stream().filter(t -> Double.doubleToLongBits(t.getEndTime()) < Double.doubleToLongBits(firstChunkAnalysis.getStartTime())).reduce((first, second) -> second);
 
 		ChunkAnalysis lastChunkAnalysis = null;
 		if (chunkAnalysisOptional.isPresent()) {
@@ -908,11 +908,31 @@ public class UserChannelContext {
 		
 		// 检测是否有多个波峰
 		boolean tempo = false;
-		boolean isContinue = true;
+		boolean isContinue = false;
 		int firstPeakIndex = -1;
+		int firstPeakValue = 0;
 		int peakSize = 0;
-		
+
 		for (int i = 1; i < chunkAmplitudeList.size(); i++) {
+			if (chunkAmplitudeList.get(i - 1) + 3 >= chunkAmplitudeList.get(i)) {
+				isContinue = false;
+				continue;
+			}
+
+			if(isContinue == false && chunkAmplitudeList.get(i - 1) + 3 < chunkAmplitudeList.get(i)){
+				isContinue = true;
+				peakSize++;
+				
+				if(firstPeakIndex == -1){
+					firstPeakIndex = i;
+					firstPeakValue = chunkAmplitudeList.get(i);
+				}
+			}
+		}
+		
+		LOGGER.debug("PeakSize:" + peakSize + "  FirstPeakIndex:" + firstPeakIndex + " FirstPeakValue:" + firstPeakValue);
+		
+		/*for (int i = 1; i < chunkAmplitudeList.size(); i++) {
 			if (Math.abs(chunkAmplitudeList.get(i) - chunkAmplitudeList.get(i - 1)) < hardLevel.getAmplitudeThreshold()) {
 				continue;
 			}
@@ -932,7 +952,7 @@ public class UserChannelContext {
 					isContinue = false;
 				}
 			}
-		}
+		}*/
 		
 		if(peakSize == 0){
 			tempo = lastChunkAnalysis.isPeak();
@@ -945,7 +965,7 @@ public class UserChannelContext {
 		
 		if (tempo) {
 			// 判断进入时间点
-			if((firstPeakIndex - 1) * 100 /chunkAmplitudeList.size() > hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator()) * 2){
+			if((firstPeakIndex - 1) * 100 /chunkAmplitudeList.size() > hardLevel.getTempoEffectiveRange(musicXmlNote.getDenominator(), musicXmlNote.getDuration()) * 2){
 				LOGGER.debug("超过范围:{}", (firstPeakIndex - 1) * 100 /chunkAmplitudeList.size());
 				tempo = false;
 			}
@@ -1018,3 +1038,4 @@ public class UserChannelContext {
 	}
 	
 }
+

+ 2 - 2
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -154,9 +154,9 @@ public class NewsController extends BaseController {
         if (newsInfo.getType() == 6 || newsInfo.getType() == 4) {
             newsInfo.setTenantId(-1);
         }
-        if (newsInfo.getContent().length() > 7999) {
+        /*if (newsInfo.getContent().length() > 7999) {
             return failed("内容过长");
-        }
+        }*/
         return succeed(sysNewsInformationService.insert(newsInfo));
     }
 

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

@@ -2337,11 +2337,6 @@ public class ExportServiceImpl implements ExportService {
         //不承担课程的云教练收入
         Map<Integer, BigDecimal> personalCloudAmount = MapUtil.convertIntegerMap(cloudTeacherOrderDao.sumPersonalCloudAmount(month,firstDayOfMonth,lastDayOfMonth));
 
-//        List<Map<Integer, BigDecimal>> personIncomeMapList = cloudTeacherOrderDao.sumPersonIncome(params.get("month").toString());
-//        Map<Integer, BigDecimal> personIncomeMap = new HashMap<>();
-//        if(!CollectionUtils.isEmpty(personIncomeMapList)){
-//            personIncomeMap = MapUtil.convertIntegerMap(personIncomeMapList);
-//        }
         for (Integer organId : listMap.keySet()) {
             OperatingTotalIncomeDto incomeDto = new OperatingTotalIncomeDto();
             incomeDto.setOrganName(userOrganNameMap.get(organId));
@@ -2545,9 +2540,6 @@ public class ExportServiceImpl implements ExportService {
                 //维修费用
                 incomeDto.setMaintenanceCost(incomeDto.getMaintenanceCost()
                         .add(row.getRepairFee()));
-                //月保费用
-                incomeDto.setInstrumentInsuranceCost(incomeDto.getInstrumentInsuranceCost()
-                        .add(row.getMaintenanceFee()));
                 //其他服务收入
                 incomeDto.setOtherServiceIncome(incomeDto.getOtherServiceIncome()
                         .add(row.getLeaseFee())
@@ -2570,6 +2562,16 @@ public class ExportServiceImpl implements ExportService {
                     incomeDto.setGroupPurchaseTeachingAids(incomeDto.getGroupPurchaseTeachingAids()
                             .add(row.getTeachingFee()));
                 }
+                //区分零售月保
+                if(row.getGroupType() == GroupType.MAINTENANCE){
+                    //零售月保,计入其他
+                    incomeDto.setOtherIncome(incomeDto.getOtherIncome()
+                            .add(row.getMaintenanceFee()));
+                }else {
+                    //团购月保
+                    incomeDto.setInstrumentInsuranceCost(incomeDto.getInstrumentInsuranceCost()
+                            .add(row.getMaintenanceFee()));
+                }
 
                 //大件乐器
                 incomeDto.setLargeInstruments(incomeDto.getLargeInstruments()
@@ -2585,12 +2587,14 @@ public class ExportServiceImpl implements ExportService {
                     .add(incomeDto.getMaintenanceCost())
                     .add(incomeDto.getInstrumentInsuranceCost())
                     .add(incomeDto.getOtherServiceIncome())
+                    .add(incomeDto.getCloudCoachIncome())
             );
             incomeDto.setSalesIncome(incomeDto.getSalesIncome()
-                    .add(incomeDto.getCloudCoachIncome())
+                    .add(incomeDto.getSaleCloudCoachIncome())
                     .add(incomeDto.getGroupPurchaseInstruments())
                     .add(incomeDto.getGroupPurchaseTeachingAids())
                     .add(incomeDto.getLargeInstruments())
+                    .add(incomeDto.getOtherIncome())
             );
             incomeDtos.add(incomeDto);
         }

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

@@ -379,7 +379,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                     financialExpenditure.setOrganId(organization.getId());
                                                     financialExpenditure.setOrganName(organization.getName());
                                                 }
-                                            } else if (StringUtils.equals(name,"金额") || StringUtils.equals(name,"住宿费") || StringUtils.equals(name,"出差补助") || StringUtils.equals(name,"交通费")) {
+                                            } else if (StringUtils.contains(name,"金额") || StringUtils.equals(name,"住宿费") || StringUtils.equals(name,"出差补助") || StringUtils.equals(name,"交通费")) {
                                                 financialExpenditure.setAmount(financialExpenditure.getAmount().add(new BigDecimal(Double.parseDouble(o.toString()))));
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                                             } else if (StringUtils.equals(name,"情况说明") || StringUtils.equals(name,"事由")) {

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

@@ -404,7 +404,7 @@
 		from financial_expenditure fe
 				 left join organization o ON o.id_ = fe.organ_id_
 				 left join cooperation_organ co ON co.id_ = fe.cooperation_organ_id_
-		where fe.process_id_ IN (19,22,28,51) AND fe.del_flag_ = 0 AND DATE_FORMAT(fe.aproval_time_, '%Y-%m') = #{month}
+		where fe.process_id_ IN (19,22,28,51) AND fee_project_ NOT IN (1,2,13,14) AND fe.del_flag_ = 0 AND DATE_FORMAT(fe.aproval_time_, '%Y-%m') = #{month}
 		order by fe.id_ DESC
 	</select>
 	<select id="sumHumanCost" resultType="com.ym.mec.biz.dal.dto.HumanTypeDto">