소스 검색

Merge branch 'saas' into master_saas

liujc 2 년 전
부모
커밋
abefe7ed26

+ 0 - 1
audio-analysis/src/main/java/com/yonge/netty/dto/UserChannelContext.java

@@ -1038,4 +1038,3 @@ public class UserChannelContext {
 	}
 	
 }
-

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

@@ -290,7 +290,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         feeProjectEnum = FeeProjectEnum.valueOfDesc(submitValue.toString());
                     }
                 }
-
+                Boolean continueFlag = false;
                 for (OaInputDto oaInputDto : oaInputDtos) {
                     String submitForm = oaInputDto.getModel();
                     Object submitValue = formData.get(submitForm);
@@ -315,8 +315,10 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                             String name = inputDto.getName();
                                             Object o = hashMap.get(inputDto.getModel());
                                             if (Objects.isNull(o) || StringUtils.isEmpty(o.toString())) {
+                                                continueFlag = false;
                                                 continue nullAmount;
                                             }
+                                            continueFlag = true;
                                             if (StringUtils.equals(name,"金额")) {
                                                 financialExpenditure.setCurrentAmount(new BigDecimal(Double.parseDouble(o.toString())));
                                             } else if (StringUtils.equals(name,"日期")) {
@@ -341,6 +343,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                             }
                         }
                     }else {
+                        if(continueFlag){
+                            continue;
+                        }
                         nullUser:
                         for (HashMap hashMap : hashMaps) {
                             FinancialExpenditure financialExpenditure = new FinancialExpenditure();
@@ -379,7 +384,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                     financialExpenditure.setOrganId(organization.getId());
                                                     financialExpenditure.setOrganName(organization.getName());
                                                 }
-                                            } else if (StringUtils.contains(name,"金额") || StringUtils.equals(name,"住宿费") || StringUtils.equals(name,"出差补助") || StringUtils.equals(name,"交通费")) {
+                                            } else if (StringUtils.equals(name,"学校")) {
+                                                financialExpenditure.setCooperationOrganId(Integer.parseInt(o.toString()));
+                                            } else if (StringUtils.contains(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/java/com/ym/mec/biz/service/impl/LessonExaminationServiceImpl.java

@@ -66,7 +66,7 @@ public class LessonExaminationServiceImpl extends ServiceImpl<LessonExaminationD
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void publish(LessonExaminationSaveDto param) {
-        log.info("publish param: ",param);
+        log.info("publish param: {}",param);
         if(CollectionUtils.isEmpty(param.getStudentLessonExaminationSaveDtos())){
             throw new BizException("请选择学员");
         }

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

@@ -477,6 +477,10 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			//布置课后评测
 			LessonExaminationSaveDto examinationSaveDto = teacherSignOutDto.getCourseHomeworkInfo().getLessonExaminationSaveDto();
 			if(Objects.nonNull(examinationSaveDto)){
+                examinationSaveDto.setTeacherId(teacherAttendance.getTeacherId());
+                examinationSaveDto.setClassGroupId(teacherAttendance.getClassGroupId());
+                examinationSaveDto.setCourseScheduleId(teacherAttendance.getCourseScheduleId());
+                examinationSaveDto.setMusicGroupId(teacherAttendance.getMusicGroupId());
 				lessonExaminationService.publish(examinationSaveDto);
 			}
 			return result;

+ 12 - 17
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -1650,38 +1650,34 @@
 	</select>
 
 	<select id="getOrganOtherAmountDataWithTimelyDetails" resultMap="IndexBaseMonthData">
-		SELECT
-		o.id_ organ_id_,o.name_ organ_name_,COALESCE(SUM(c.total_num_), 0) percent_
-		FROM organization o
+		SELECT o.id_ organ_id_,o.name_ organ_name_,SUM(c.total_num_) percent_ FROM organization o
 		LEFT JOIN (
-		SELECT organ_id_, type_, SUM(total_num_) total_num_
-		FROM (
-		SELECT spo.organ_id_, spo.type_, (COALESCE(spo.actual_amount_, 0) + COALESCE(spo.balance_payment_amount_, 0)) total_num_
+		SELECT spo.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,spo.type_
 		FROM student_payment_order spo
-		WHERE spo.status_ = 'SUCCESS' AND spo.tenant_id_ = #{tenantId}
-		AND spo.type_ NOT IN ('APPLY', 'ADD_STUDENT', 'RENEW', 'PRACTICE_GROUP_BUY', 'PRACTICE_GROUP_RENEW', 'SMALL_CLASS_TO_BUY', 'DEGREE')
+		WHERE spo.status_ = 'SUCCESS' AND spo.pay_time_ BETWEEN #{startDate} AND #{endDate} and spo.tenant_id_ = #{tenantId}
+		AND spo.type_ NOT IN ('APPLY','ADD_STUDENT','RENEW','PRACTICE_GROUP_BUY','PRACTICE_GROUP_RENEW','SMALL_CLASS_TO_BUY','DEGREE')
 		<if test="organIds!=null and organIds.size()>0">
 			AND spo.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 				#{organId}
 			</foreach>
 		</if>
-		AND spo.pay_time_ BETWEEN #{startDate} AND #{endDate}
+		GROUP BY spo.organ_id_,spo.type_
 		UNION ALL
-		SELECT spo.organ_id_, spo.type_, COALESCE(spod.price_, 0) total_num_
+		SELECT spo.organ_id_,SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_num_,spo.type_
 		FROM student_payment_order spo
 		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
-		WHERE spo.status_ = 'SUCCESS' AND spo.tenant_id_ = #{tenantId} AND spo.type_ = 'DEGREE' AND spod.type_ = 'DEGREE_REGISTRATION'
+		WHERE spo.status_ = 'SUCCESS' AND spo.pay_time_ BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'DEGREE' AND spod.type_ = 'DEGREE_REGISTRATION'
 		<if test="organIds!=null and organIds.size()>0">
 			AND spo.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 				#{organId}
 			</foreach>
 		</if>
-		AND spo.pay_time_ BETWEEN #{startDate} AND #{endDate}
-		) t
-		GROUP BY organ_id_, type_
-		) c ON o.id_ = c.organ_id_
+		GROUP BY spo.organ_id_,spo.type_
+		)c ON c.organ_id_ = o.id_
 		WHERE o.tenant_id_ = #{tenantId}
 		<if test="organIds!=null and organIds.size()>0">
 			AND o.id_ IN
@@ -1689,8 +1685,7 @@
 				#{organId}
 			</foreach>
 		</if>
-		GROUP BY o.id_,o.name_
-		ORDER BY percent_ DESC
+		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
 
 	<sql id="queryTeacherServeInfoCondition">

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

@@ -378,7 +378,7 @@
 			SUM(CASE WHEN hc.human_cost_type_ = 'STUDENT_MANAGEMENT_FEE_ADJUSTMENT' THEN hc.amount_ ELSE 0 END) AS studentManagementFeeAdjustment
 		FROM
 			organization o
-				left join financial_expenditure fe ON o.id_ = fe.organ_id_ AND fe.process_id_ = 28 AND DATE_FORMAT(fe.aproval_time_, '%Y-%m') = #{month} AND fe.del_flag_ = 0
+				left join financial_expenditure fe ON o.id_ = fe.organ_id_ AND fe.process_id_ = 28 AND effective_time_= #{month} AND fe.del_flag_ = 0
 				left join human_cost hc ON hc.organ_id_ = o.id_  AND hc.month_ = #{month}
 		WHERE
 			o.tenant_id_ = 1 AND o.del_flag_ = 0
@@ -388,7 +388,7 @@
 	<resultMap type="com.ym.mec.biz.dal.entity.FinancialExpenditure" id="FinancialExpenditure">
 		<result column="name_" property="organName"/>
 		<result column="batch_no_" property="batchNo"/>
-		<result column="cooperation_organ_name_" property="cooperationOrganName"/>
+		<result column="cooperationName" property="cooperationOrganName"/>
 		<result column="apply_user_" property="applyUser"/>
 		<result column="student_id_" property="studentId"/>
 		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -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 fee_project_ NOT IN (1,2,13,14) 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 fe.effective_time_ = #{month}
 		order by fe.id_ DESC
 	</select>
 	<select id="sumHumanCost" resultType="com.ym.mec.biz.dal.dto.HumanTypeDto">

+ 5 - 3
mec-gateway/mec-gateway-web/src/main/java/com/ym/mec/gateway/web/filter/AuthFilter.java

@@ -3,6 +3,8 @@ package com.ym.mec.gateway.web.filter;
 import javax.servlet.http.HttpServletRequest;
 
 import org.bouncycastle.util.IPAddress;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
 import com.netflix.zuul.ZuulFilter;
@@ -14,13 +16,13 @@ import java.net.UnknownHostException;
 
 @Component
 public class AuthFilter extends ZuulFilter {
+	private static final Logger logger = LoggerFactory.getLogger(AuthFilter.class);
 
 	@Override
 	public Object run() throws ZuulException {//过滤器核心业务方法
+
 		RequestContext requestContext = RequestContext.getCurrentContext();
-		HttpServletRequest request = requestContext.getRequest();
-		String remoteIp = getRealIp(request);
-		requestContext.getZuulRequestHeaders().put("HTTP_X_FORWARDED_FOR", remoteIp);
+		requestContext.getZuulRequestHeaders().put("HTTP_X_FORWARDED_FOR", getRealIp(requestContext.getRequest()));
 		return null;
 	}
 

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

@@ -24,6 +24,7 @@ import com.ym.mec.biz.dal.page.SysPaymentConfigQueryInfo;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.tenant.TenantContextHolder;
 
 @RequestMapping("paymentConfig")
 @Api(tags = "支付设置服务")
@@ -113,7 +114,7 @@ public class SysPaymentConfigController extends BaseController {
         if (sysUser == null || sysUser.getId() == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        return succeed(sysPaymentConfigService.getPaymentConfigs(payType, sysUser.getTenantId()));
+        return succeed(sysPaymentConfigService.getPaymentConfigs(payType, TenantContextHolder.getTenantId()));
     }