Browse Source

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

 Conflicts:
	mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/BaseServiceImpl.java
zouxuan 2 năm trước cách đây
mục cha
commit
95b1b1c8ea

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CouponDetailTypeEnum.java

@@ -95,6 +95,17 @@ public enum CouponDetailTypeEnum implements BaseEnum<String, CouponDetailTypeEnu
             case "CLOUD_TEACHER":
             case "CLOUD_TEACHER_PLUS":
                 return MEMBER.getCode();
+            case "MIX":
+            case "SINGLE":
+            case "TRAINING_MIX":
+            case "TRAINING_SINGLE":
+            case "HIGH":
+            case "COMPREHENSIVE":
+            case "ENLIGHTENMENT":
+            case "CLASSROOM":
+            case "HIGH_ONLINE":
+            case "MUSIC_NETWORK":
+                return MUSIC.getCode();
             default:
                 return null;
         }

+ 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();
     }

+ 177 - 197
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/BaseServiceImpl.java

@@ -125,212 +125,192 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
     }
 
 
-    @Override
-    public <K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
-        if(CollectionUtils.isEmpty(ids)){
-            return Collections.emptyMap();
-        }
-        StringBuffer sql=new StringBuffer();
-        Map<Y,Z> result=new HashMap();
-        SqlSession sqlSession = null;
-        Connection connection = null;
-        PreparedStatement ps = null;
-        try {
-            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);
-            }
-            ps = connection.prepareStatement(sql.toString());
-            ResultSet resultSet = ps.executeQuery();
-            while (resultSet.next()){
-                Y key;
-                Z value;
-                if(keyType.isAssignableFrom(BigDecimal.class)){
-                    key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-                }else if(keyType.isAssignableFrom(String.class)){
-                    key = (Y) resultSet.getString(1);
-                }else{
-                    key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-                }
-                if(valueType.isAssignableFrom(BigDecimal.class)){
-                    value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-                }else if(valueType.isAssignableFrom(String.class)){
-                    value = (Z) resultSet.getString(2);
-                }else{
-                    value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-                }
-                result.put(key, value);
-            }
-            if(resultSet!=null){
-                resultSet.close();
-            }
-            if(ps!=null){
-                ps.close();
-            }
-            if(sqlSession!=null){
-                sqlSession.close();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            if(ps!=null){
-                try {
-                    ps.close();
-                } catch (SQLException e) {
-                }
-            }
-            if(sqlSession!=null){
-                sqlSession.close();
-            }
-            if(connection!=null){
-                try {
-                    connection.close();
-                } catch (SQLException e) {
-                }
-            }
-        }
+	@Override
+	public <K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids,Integer tenantId, Class<Y> keyType, Class<Z> valueType){
+		if(CollectionUtils.isEmpty(ids)){
+			return Collections.emptyMap();
+		}
+		StringBuffer sql=new StringBuffer();
+		Map<Y,Z> result=new HashMap();
+		SqlSession sqlSession = null;
+		Connection connection = null;
+		PreparedStatement ps = null;
+		ResultSet resultSet = null;
+		try {
+			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);
+			}
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
+			while (resultSet.next()){
+				Y key;
+				Z value;
+				if(keyType.isAssignableFrom(BigDecimal.class)){
+					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+				}else if(keyType.isAssignableFrom(String.class)){
+					key = (Y) resultSet.getString(1);
+				}else{
+					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+				}
+				if(valueType.isAssignableFrom(BigDecimal.class)){
+					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+				}else if(valueType.isAssignableFrom(String.class)){
+					value = (Z) resultSet.getString(2);
+				}else{
+					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+				}
+				result.put(key, value);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			if(resultSet!=null){
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(ps!=null){
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(sqlSession!=null){
+				sqlSession.close();
+			}
+		}
 
             return result;
         }
 
-        @Override
-        public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, String ids, Class<Y> keyType, Class<Z> valueType){
-            if(StringUtils.isEmpty(ids)){
-                return Collections.emptyMap();
-            }
-            StringBuffer sql=new StringBuffer();
-            Map<Y,Z> result=new HashMap();
-
-            SqlSession sqlSession = null;
-            Connection connection = null;
-            PreparedStatement ps = null;
-            try {
-                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(")");
-                ps = connection.prepareStatement(sql.toString());
-                ResultSet resultSet = ps.executeQuery();
-                while (resultSet.next()){
-                    Y key;
-                    Z value;
-                    if(keyType.isAssignableFrom(BigDecimal.class)){
-                        key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-                    }else if(keyType.isAssignableFrom(String.class)){
-                        key = (Y) resultSet.getString(1);
-                    }else{
-                        key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-                    }
-                    if(valueType.isAssignableFrom(BigDecimal.class)){
-                        value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-                    }else if(valueType.isAssignableFrom(String.class)){
-                        value = (Z) resultSet.getString(2);
-                    }else{
-                        value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-                    }
-                    result.put(key, value);
-                }
-                if(resultSet!=null){
-                    resultSet.close();
-                }
-                if(ps!=null){
-                    ps.close();
-                }
-                if(sqlSession!=null){
-                    sqlSession.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }finally {
-                if(ps!=null){
-                    try {
-                        ps.close();
-                    } catch (SQLException e) {
-                    }
-                }
-                if(sqlSession!=null){
-                    sqlSession.close();
-                }
-                if(connection!=null){
-                    try {
-                        connection.close();
-                    } catch (SQLException e) {
-                    }
-                }
-            }
+	@Override
+	public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, String ids, Class<Y> keyType, Class<Z> valueType){
+		if(StringUtils.isEmpty(ids)){
+			return Collections.emptyMap();
+		}
+		StringBuffer sql=new StringBuffer();
+		Map<Y,Z> result=new HashMap();
+		SqlSession sqlSession = null;
+		Connection connection = null;
+		PreparedStatement ps = null;
+		ResultSet resultSet = null;
+		try {
+			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(")");
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
+			while (resultSet.next()){
+				Y key;
+				Z value;
+				if(keyType.isAssignableFrom(BigDecimal.class)){
+					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+				}else if(keyType.isAssignableFrom(String.class)){
+					key = (Y) resultSet.getString(1);
+				}else{
+					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+				}
+				if(valueType.isAssignableFrom(BigDecimal.class)){
+					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+				}else if(valueType.isAssignableFrom(String.class)){
+					value = (Z) resultSet.getString(2);
+				}else{
+					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+				}
+				result.put(key, value);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			if(resultSet!=null){
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(ps!=null){
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(sqlSession!=null){
+				sqlSession.close();
+			}
+		}
 
             return result;
         }
 
 
-        @Override
-        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;
-            try {
-                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");
-                }
-                if(tenantId != null){
-                    sql.append(" AND tenant_id_ = ").append(tenantId);
-                }
-                ps = connection.prepareStatement(sql.toString());
-                ResultSet resultSet = ps.executeQuery();
-                while (resultSet.next()){
-                    Y key;
-                    Z value;
-                    if(keyType.isAssignableFrom(BigDecimal.class)){
-                        key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
-                    }else if(keyType.isAssignableFrom(String.class)){
-                        key = (Y) resultSet.getString(1);
-                    }else{
-                        key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
-                    }
-                    if(valueType.isAssignableFrom(BigDecimal.class)){
-                        value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
-                    }else if(valueType.isAssignableFrom(String.class)){
-                        value = (Z) resultSet.getString(2);
-                    }else{
-                        value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
-                    }
-                    result.put(key, value);
-                }
-                if(resultSet!=null){
-                    resultSet.close();
-                }
-                if(ps!=null){
-                    ps.close();
-                }
-                if(sqlSession!=null){
-                    sqlSession.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }finally {
-                if(ps!=null){
-                    try {
-                        ps.close();
-                    } catch (SQLException e) {
-                    }
-                }
-                if(sqlSession!=null){
-                    sqlSession.close();
-                }
-                if(connection!=null){
-                    try {
-                        connection.close();
-                    } catch (SQLException e) {
-                    }
-                }
-            }
+	@Override
+	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 = 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");
+			}
+			if(tenantId != null){
+				sql.append(" AND tenant_id_ = ").append(tenantId);
+			}
+			ps = connection.prepareStatement(sql.toString());
+			resultSet = ps.executeQuery();
+			while (resultSet.next()){
+				Y key;
+				Z value;
+				if(keyType.isAssignableFrom(BigDecimal.class)){
+					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(1));
+				}else if(keyType.isAssignableFrom(String.class)){
+					key = (Y) resultSet.getString(1);
+				}else{
+					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(1));
+				}
+				if(valueType.isAssignableFrom(BigDecimal.class)){
+					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(resultSet.getString(2));
+				}else if(valueType.isAssignableFrom(String.class)){
+					value = (Z) resultSet.getString(2);
+				}else{
+					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null,resultSet.getString(2));
+				}
+				result.put(key, value);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			if(resultSet!=null){
+				try {
+					resultSet.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(ps!=null){
+				try {
+					ps.close();
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}
+			}
+			if(sqlSession!=null){
+				sqlSession.close();
+			}
+		}
 
             return result;
         }