Procházet zdrojové kódy

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into zx_saas_6-12

zouxuan před 2 roky
rodič
revize
e87188d33f

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

@@ -313,6 +313,9 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
         }
         studentAttendanceDao.addStudentAttendances(studentAttendances);
         List<StudentAttendance> allStudentAttendances = studentAttendanceDao.findByCourseId(studentAttendanceInfo.getCourseScheduleId());
+        if(!CollectionUtils.isEmpty(allStudentAttendances)){
+            allStudentAttendances = allStudentAttendances.stream().filter(e->e.getStatus() != null).collect(Collectors.toList());
+        }
         Map<StudentAttendanceStatusEnum, List<StudentAttendance>> studentAttendanceGroupByStatus = allStudentAttendances.stream().collect(Collectors.groupingBy(StudentAttendance::getStatus));
         Integer studentNum = studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.NORMAL) == null ? 0 : studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.NORMAL).size();
         Integer leaveStudentNum = studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.LEAVE) == null ? 0 : studentAttendanceGroupByStatus.get(StudentAttendanceStatusEnum.LEAVE).size();

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

@@ -769,7 +769,7 @@
         FROM student_payment_order spo
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
         LEFT JOIN sporadic_charge_info sci on spo.music_group_id_ = sci.id_
-        where DATE_FORMAT(spo.pay_time_,'%Y-%m') = #{month} AND spo.order_no_ NOT IN (select distinct order_no_ from sell_order where DATE_FORMAT(delivery_time_,'%Y-%m') = #{month})
+        where DATE_FORMAT(spo.pay_time_,'%Y-%m') = #{month} AND spo.order_no_ NOT IN (select distinct order_no_ from sell_order where DATE_FORMAT(sell_time_,'%Y-%m') = #{month})
         AND spo.tenant_id_ = 1 AND spo.status_ = 'SUCCESS'
     </select>
     <select id="ExportQueryPage2" resultMap="orderAndDetail" parameterType="map">

+ 2 - 2
mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java

@@ -146,13 +146,13 @@ public class BaseController {
 
     public String dingTalkRobotsSecurityParam() throws Exception{
         Long timestamp = System.currentTimeMillis();
-        String secret = "SEC5e3b73acccb12fc2a2a7d36d416c1967c66adb99a75dce24ecc324b50e528a29";
+        String secret = "SEC405b2e5f38aaae6472b242ee53607fb4a6549cf05a72bdf6482ec3799d5576ec";
         String stringToSign = timestamp + "\n" + secret;
         Mac mac = Mac.getInstance("HmacSHA256");
         mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"));
         byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8"));
         String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8");
-        StringBuffer sb = new StringBuffer("https://api.dingtalk.com/robot/send?access_token=22d7b3b54ea7f1633c640dfdf17083d0731c3757719a84bd333740a8b18eb035&timestamp=");
+        StringBuffer sb = new StringBuffer("https://oapi.dingtalk.com/robot/send?access_token=ffa98e1f0f5f4cff586a228699281a7955e305fd6f55145af8e8da5ea794d033&timestamp=");
         sb.append(timestamp).append("&sign=").append(sign);
         return sb.toString();
     }

+ 64 - 24
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/BaseServiceImpl.java

@@ -25,6 +25,7 @@ import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.util.*;
 
 /**
@@ -131,15 +132,19 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 		}
 		StringBuffer sql=new StringBuffer();
 		Map<Y,Z> result=new HashMap();
+		SqlSession sqlSession = null;
+		Connection connection = null;
+		PreparedStatement ps = null;
+		ResultSet resultSet = null;
 		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
+			sqlSession = sqlSessionFactory.openSession();
+			connection = sqlSession.getConnection();
 			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(StringUtils.join(ids, ",")).append(")");
 			if(tenantId != null){
 				sql.append(" AND tenant_id_ = ").append(tenantId);
 			}
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
 			while (resultSet.next()){
 				Y key;
 				Z value;
@@ -159,17 +164,26 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 				}
 				result.put(key, value);
 			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
 			if(resultSet!=null){
-				resultSet.close();
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(ps!=null){
-				ps.close();
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(sqlSession!=null){
 				sqlSession.close();
 			}
-		} catch (Exception e) {
-			e.printStackTrace();
 		}
 
 		return result;
@@ -182,12 +196,16 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 		}
 		StringBuffer sql=new StringBuffer();
 		Map<Y,Z> result=new HashMap();
+		SqlSession sqlSession = null;
+		Connection connection = null;
+		PreparedStatement ps = null;
+		ResultSet resultSet = null;
 		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
+			sqlSession = sqlSessionFactory.openSession();
+			connection = sqlSession.getConnection();
 			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE ").append(columnKey).append(" IN (").append(ids).append(")");
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
 			while (resultSet.next()){
 				Y key;
 				Z value;
@@ -207,17 +225,26 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 				}
 				result.put(key, value);
 			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
 			if(resultSet!=null){
-				resultSet.close();
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(ps!=null){
-				ps.close();
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(sqlSession!=null){
 				sqlSession.close();
 			}
-		} catch (Exception e) {
-			e.printStackTrace();
 		}
 
 		return result;
@@ -228,9 +255,13 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 	public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue,Boolean hasDelFlag,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
 		StringBuffer sql=new StringBuffer();
 		Map<Y,Z> result=new HashMap();
+		SqlSession sqlSession = null;
+		Connection connection = null;
+		PreparedStatement ps = null;
+		ResultSet resultSet = null;
 		try {
-			SqlSession sqlSession = sqlSessionFactory.openSession();
-			Connection connection = sqlSession.getConnection();
+			sqlSession = sqlSessionFactory.openSession();
+			connection = sqlSession.getConnection();
 			sql.append("SELECT ").append(columnKey).append(",").append(columnValue).append(" FROM ").append(tableName).append(" WHERE 1 = 1");
 			if(hasDelFlag){
 				sql.append(" AND del_flag_ = 0");
@@ -238,8 +269,8 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 			if(tenantId != null){
 				sql.append(" AND tenant_id_ = ").append(tenantId);
 			}
-			PreparedStatement ps = connection.prepareStatement(sql.toString());
-			ResultSet resultSet = ps.executeQuery();
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
 			while (resultSet.next()){
 				Y key;
 				Z value;
@@ -259,17 +290,26 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 				}
 				result.put(key, value);
 			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
 			if(resultSet!=null){
-				resultSet.close();
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(ps!=null){
-				ps.close();
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
 			}
 			if(sqlSession!=null){
 				sqlSession.close();
 			}
-		} catch (Exception e) {
-			e.printStackTrace();
 		}
 
 		return result;