소스 검색

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 년 전
부모
커밋
822a3fc378

+ 1 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java

@@ -145,6 +145,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 	}
 	}
 
 
 	@Override
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public SysUserInfo initUser(String phone, String clientId) {
 	public SysUserInfo initUser(String phone, String clientId) {
 		if(autoRegister){
 		if(autoRegister){
 			Date date = new Date();
 			Date date = new Date();

+ 2 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1196,15 +1196,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public ClassGroup classGroupUpdate(ClassGroup4MixDto classGroup4MixDto) throws Exception {
     public ClassGroup classGroupUpdate(ClassGroup4MixDto classGroup4MixDto) throws Exception {
         Date date = new Date();
         Date date = new Date();
-        String musicGroupId = classGroup4MixDto.getMusicGroupId();
-        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-        if (musicGroup == null) {
-            throw new Exception("乐团不存在");
-        }
         ClassGroup classGroup = classGroupDao.get(classGroup4MixDto.getClassGroupId());
         ClassGroup classGroup = classGroupDao.get(classGroup4MixDto.getClassGroupId());
         if (classGroup == null) {
         if (classGroup == null) {
             throw new Exception("班级不存在");
             throw new Exception("班级不存在");
         }
         }
+        MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+
         Integer schoolId = musicGroup.getSchoolId();
         Integer schoolId = musicGroup.getSchoolId();
 
 
         List<Subject> subjectList = subjectService.findBySubjectByIdList(classGroup.getSubjectIdList());
         List<Subject> subjectList = subjectService.findBySubjectByIdList(classGroup.getSubjectIdList());

+ 24 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -333,18 +333,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         		// 更新订单信息
         		// 更新订单信息
         		studentPaymentOrder.setBalancePaymentAmount(amount);
         		studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setUpdateTime(date);
                 studentPaymentOrder.setUpdateTime(date);
-                studentPaymentOrderService.update(studentPaymentOrder);
-                studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
-
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
 
 
-                Map<String,String> notifyMap=new HashMap<>();
-                notifyMap.put("tradeState", "1");
-                notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
-                notifyMap.put("channelType", channelType);
-                notifyMap.put("orderNo", "");
-                studentPaymentOrderService.updateOrder(notifyMap);
-                return notifyMap;
         	}else{
         	}else{
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
@@ -356,6 +346,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	}
         	}
         }
         }
 
 
+        studentPaymentOrderService.update(studentPaymentOrder);
+        if(amount.compareTo(BigDecimal.ZERO)==0) {
+            Map<String, String> notifyMap = new HashMap<>();
+            notifyMap.put("tradeState", "1");
+            notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
+            notifyMap.put("channelType", channelType);
+            notifyMap.put("orderNo", "");
+            studentPaymentOrderService.updateOrder(notifyMap);
+            return notifyMap;
+        }
+
+        studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
 
 
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         Map payMap = payService.getPayMap(
         Map payMap = payService.getPayMap(
@@ -370,7 +372,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
         studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrderService.update(studentPaymentOrder);
-        
 		return payMap;
 		return payMap;
 	}
 	}
 
 
@@ -477,17 +478,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         		// 更新订单信息
         		// 更新订单信息
         		studentPaymentOrder.setBalancePaymentAmount(amount);
         		studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setUpdateTime(date);
                 studentPaymentOrder.setUpdateTime(date);
-                studentPaymentOrderService.update(studentPaymentOrder);
-                
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
-
-                Map<String,String> notifyMap=new HashMap<>();
-                notifyMap.put("tradeState", "1");
-                notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
-                notifyMap.put("channelType", channelType);
-                notifyMap.put("orderNo", "");
-                studentPaymentOrderService.updateOrder(notifyMap);
-                return notifyMap;
         	}else{
         	}else{
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
@@ -499,6 +490,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	}
         	}
         }
         }
 
 
+        studentPaymentOrderService.update(studentPaymentOrder);
+        if(amount.compareTo(BigDecimal.ZERO)==0) {
+            Map<String, String> notifyMap = new HashMap<>();
+            notifyMap.put("tradeState", "1");
+            notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
+            notifyMap.put("channelType", channelType);
+            notifyMap.put("orderNo", "");
+            studentPaymentOrderService.updateOrder(notifyMap);
+            return notifyMap;
+        }
+        studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
+
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         Map payMap = payService.getPayMap(
         Map payMap = payService.getPayMap(
                 amount,
                 amount,

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

@@ -1225,7 +1225,8 @@
             cs.schoole_id_
             cs.schoole_id_
         FROM
         FROM
             course_schedule cs
             course_schedule cs
-            WHERE (cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},'%Y%m%d') AND DATE_FORMAT(#{endTime},'%Y%m%d'))
+        WHERE (cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},'%Y%m%d') AND DATE_FORMAT(#{endTime},'%Y%m%d'))
+            AND cs.del_flag_!=1 AND cg.del_flag_!=1
     </select>
     </select>
     
     
     <select id="queryStudentCoursesTimesOfTomorrow" resultMap="Mapper">
     <select id="queryStudentCoursesTimesOfTomorrow" resultMap="Mapper">