浏览代码

Merge remote-tracking branch 'origin/master'

周箭河 4 年之前
父节点
当前提交
3fd9ac5717

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentGoodsSell.java

@@ -41,10 +41,10 @@ public class StudentGoodsSell {
 	private Date updateTime;
 
 	@ApiModelProperty(value = "是否使用余额",required = true)
-	private Boolean isUseBalancePayment = false;
+	private boolean isUseBalancePayment = false;
 
 	@ApiModelProperty(value = "是否重复支付",required = true)
-	private Boolean isRepeatPay;
+	private boolean isRepeatPay;
 
 	@ApiModelProperty(value = "商品列表",required = true)
 	private List<GoodsSellDto> goodsSellDtos;
@@ -114,11 +114,11 @@ public class StudentGoodsSell {
 		isRepeatPay = repeatPay;
 	}
 
-	public Boolean getIsUseBalancePayment() {
+	public boolean getIsUseBalancePayment() {
 		return isUseBalancePayment;
 	}
 
-	public void setIsUseBalancePayment(Boolean useBalancePayment) {
+	public void setIsUseBalancePayment(boolean useBalancePayment) {
 		isUseBalancePayment = useBalancePayment;
 	}
 

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -540,7 +540,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
             }
         }
-
         studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
 
         return studentPaymentOrder;

+ 15 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -106,6 +106,20 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     @Override
     @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
     public Map addGoodsSellOrder(StudentGoodsSell studentGoodsSell) throws Exception {
+        //关闭老订单
+        if(StringUtils.isNotEmpty(studentGoodsSell.getOrderNo())){
+            StudentPaymentOrder orderByOrderNo = studentPaymentOrderService.findOrderByOrderNo(studentGoodsSell.getOrderNo());
+            if(orderByOrderNo.getBalancePaymentAmount() != null){
+                studentGoodsSell.setIsUseBalancePayment(true);
+            }else {
+                studentGoodsSell.setIsUseBalancePayment(false);
+            }
+            orderByOrderNo.setStatus(DealStatusEnum.CLOSE);
+            studentPaymentOrderService.update(orderByOrderNo);
+            if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+                sysUserCashAccountService.updateBalance(orderByOrderNo.getUserId(), orderByOrderNo.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
+            }
+        }
         Integer studentId = studentGoodsSell.getUserId();
         List<GoodsSellDto> goodsSellDtos = studentGoodsSell.getGoodsSellDtos();
         if(goodsSellDtos == null || goodsSellDtos.size() == 0){
@@ -143,11 +157,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         studentGoodsSell.setOrganId(student.getOrganId());
         studentGoodsSell.setTotalAmount(amount);
         studentGoodsSell.setGoodsJson(JSONObject.toJSONString(goodsSellDtos));
-        if(studentGoodsSell.getId() == null){
-            studentGoodsSellDao.insert(studentGoodsSell);
-        }else {
-            studentGoodsSellDao.update(studentGoodsSell);
-        }
+        studentGoodsSellDao.insert(studentGoodsSell);
 
         if (studentGoodsSell.getType() == 1) {
             Map<String, Object> repairInfoMap = new HashMap<>();

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -307,13 +307,14 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
 			teacherAttendance.setSignOutTime(date);
 			if(DateUtil.minutesBetween(classEndDateTime,date) > 0){
+				List<CourseSchedule> courseSchedules = new ArrayList<>();
+				CourseSchedule cs = courseSchedule;
 				String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
 				if(StringUtils.isEmpty(continueCourseTime)){
 					continueCourseTime = "5";
 				}
-				List<CourseSchedule> courseSchedules = new ArrayList<>();
-				CourseSchedule cs = courseSchedule;
 				while (true){
+					//签到为空那么看下一条数据,
 					//获取当前课程的所有连堂课列表
 					String courseClassDate = DateUtil.format(cs.getClassDate(), DateUtil.DEFAULT_PATTERN);
 					String courseEndDateTime = DateUtil.format(cs.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);

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

@@ -35,8 +35,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentGoodsSell" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO student_goods_sell (id_,user_id_,teacher_id_,goods_json_,total_amount_,market_amount_,create_time_,update_time_,order_no_,organ_id_,author_user_)
-		VALUES(#{id},#{userId},#{teacherId},#{goodsJson},#{totalAmount},#{marketAmount},NOW(),NOW(),#{orderNo},#{organId},#{authorUser})
+		INSERT INTO student_goods_sell (user_id_,teacher_id_,goods_json_,total_amount_,market_amount_,create_time_,update_time_,order_no_,organ_id_,author_user_)
+		VALUES(#{userId},#{teacherId},#{goodsJson},#{totalAmount},#{marketAmount},NOW(),NOW(),#{orderNo},#{organId},#{authorUser})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->

+ 29 - 0
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -277,6 +277,35 @@ public class RoomServiceImpl implements RoomService {
         log.info("signInSuccess: roomId={}, userId={}", roomId, userId);
         Integer userIdInt = Integer.parseInt(userId);
         Long courseId = Long.parseLong(roomId.substring(1));
+        CourseSchedule schedule = courseScheduleDao.get(courseId);
+        Date date = new Date();
+        String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
+        String endClassTime = DateUtil.format(schedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+        Date classEndDateTime = DateUtil.stringToDate(classDate + " " + endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+        //如果当前时间大于课程结束时间,并查看是否是连堂课,将签到记录落到对应的考勤上
+        if(date.after(classEndDateTime)){
+            //获取下一节连堂课
+            CourseSchedule cs = schedule;
+            String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
+            if(StringUtils.isEmpty(continueCourseTime)){
+                continueCourseTime = "5";
+            }
+            while (true){
+                //获取当前课程的所有连堂课列表
+                String courseClassDate = DateUtil.format(cs.getClassDate(), DateUtil.DEFAULT_PATTERN);
+                String courseEndDateTime = DateUtil.format(cs.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                Date stringToDate = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+                cs = courseScheduleDao.queryContinueCourse(cs,continueCourseTime,courseClassDate + " " + courseEndDateTime);
+                if(cs != null){
+                    if(stringToDate.after(date)){
+                        courseId = cs.getId();
+                        break;
+                    }
+                }else {
+                    break;
+                }
+            }
+        }
         RoleEnum roleEnum = RoleEnum.getEnumByValue(roomMember.getRole());
         if(roleEnum == RoleTeacher){
             teacherAttendanceService.addTeacherAttendanceRecord(courseId.intValue(),userIdInt, SignStatusEnum.SIGN_IN,true);

+ 0 - 3
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -259,9 +259,7 @@ public class MusicGroupController extends BaseController {
         if (studentRegistration == null) {
             return failed("报名信息有误,请核查");
         }
-
         Integer userId = studentRegistration.getUserId();
-
         StudentPaymentOrder ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.SUCCESS);
         StudentPaymentOrder waitPay = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
         if (ApplyOrder != null && waitPay == null) {
@@ -271,7 +269,6 @@ public class MusicGroupController extends BaseController {
         if(payMap.containsKey("tradeState")){
             return failed(HttpStatus.CREATED, "恭喜您,报名成功!");
         }
-
         return succeed(payMap);
     }