zouxuan 2 년 전
부모
커밋
ad9f493bd5

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

@@ -301,7 +301,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         continue;
                         continue;
                     }
                     }
                     List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
                     List<HashMap> hashMaps = JSONObject.parseArray(formData.get(submitForm).toString(), HashMap.class);
+                    Boolean continueFlag = false;
                     if(StringUtils.equals("分摊明细",oaInputDto.getName())){
                     if(StringUtils.equals("分摊明细",oaInputDto.getName())){
+                        continueFlag = true;
                         //处理房租的分摊明细
                         //处理房租的分摊明细
                         nullAmount:
                         nullAmount:
                         for (HashMap hashMap : hashMaps) {
                         for (HashMap hashMap : hashMaps) {
@@ -341,6 +343,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                             }
                             }
                         }
                         }
                     }else {
                     }else {
+                        if(continueFlag){
+                            continue;
+                        }
                         nullUser:
                         nullUser:
                         for (HashMap hashMap : hashMaps) {
                         for (HashMap hashMap : hashMaps) {
                             FinancialExpenditure financialExpenditure = new FinancialExpenditure();
                             FinancialExpenditure financialExpenditure = new FinancialExpenditure();
@@ -379,6 +384,8 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                                                     financialExpenditure.setOrganId(organization.getId());
                                                     financialExpenditure.setOrganId(organization.getId());
                                                     financialExpenditure.setOrganName(organization.getName());
                                                     financialExpenditure.setOrganName(organization.getName());
                                                 }
                                                 }
+                                            } else if (StringUtils.equals(name,"学校")) {
+                                                financialExpenditure.setCooperationOrganId(Integer.parseInt(o.toString()));
                                             } else if (StringUtils.contains(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.setAmount(financialExpenditure.getAmount().add(new BigDecimal(Double.parseDouble(o.toString()))));
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());
                                                 financialExpenditure.setCurrentAmount(financialExpenditure.getAmount());

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

@@ -1650,38 +1650,34 @@
 	</select>
 	</select>
 
 
 	<select id="getOrganOtherAmountDataWithTimelyDetails" resultMap="IndexBaseMonthData">
 	<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 (
 		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
 		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">
 		<if test="organIds!=null and organIds.size()>0">
 			AND spo.organ_id_ IN
 			AND spo.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 				#{organId}
 				#{organId}
 			</foreach>
 			</foreach>
 		</if>
 		</if>
-		AND spo.pay_time_ BETWEEN #{startDate} AND #{endDate}
+		GROUP BY spo.organ_id_,spo.type_
 		UNION ALL
 		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
 		FROM student_payment_order spo
 		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
 		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">
 		<if test="organIds!=null and organIds.size()>0">
 			AND spo.organ_id_ IN
 			AND spo.organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 				#{organId}
 				#{organId}
 			</foreach>
 			</foreach>
 		</if>
 		</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}
 		WHERE o.tenant_id_ = #{tenantId}
 		<if test="organIds!=null and organIds.size()>0">
 		<if test="organIds!=null and organIds.size()>0">
 			AND o.id_ IN
 			AND o.id_ IN
@@ -1689,8 +1685,7 @@
 				#{organId}
 				#{organId}
 			</foreach>
 			</foreach>
 		</if>
 		</if>
-		GROUP BY o.id_,o.name_
-		ORDER BY percent_ DESC
+		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
 	</select>
 
 
 	<sql id="queryTeacherServeInfoCondition">
 	<sql id="queryTeacherServeInfoCondition">

+ 1 - 0
mec-gateway/mec-gateway-web/src/main/java/com/ym/mec/gateway/web/filter/AuthFilter.java

@@ -20,6 +20,7 @@ public class AuthFilter extends ZuulFilter {
 		RequestContext requestContext = RequestContext.getCurrentContext();
 		RequestContext requestContext = RequestContext.getCurrentContext();
 		HttpServletRequest request = requestContext.getRequest();
 		HttpServletRequest request = requestContext.getRequest();
 		String remoteIp = getRealIp(request);
 		String remoteIp = getRealIp(request);
+		System.out.println("remoteIp:-------------" + remoteIp);
 		requestContext.getZuulRequestHeaders().put("HTTP_X_FORWARDED_FOR", remoteIp);
 		requestContext.getZuulRequestHeaders().put("HTTP_X_FORWARDED_FOR", remoteIp);
 		return null;
 		return null;
 	}
 	}