|
@@ -10,7 +10,9 @@ import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
|
+import org.jeecg.modules.app.form.ClassPostponeForm;
|
|
|
import org.jeecg.modules.app.vo.CoursesPriceRulesVO;
|
|
import org.jeecg.modules.app.vo.CoursesPriceRulesVO;
|
|
|
|
|
+import org.jeecg.modules.app.vo.FamilyUserVO;
|
|
|
import org.jeecg.modules.app.vo.VerifyCourseInfoDTO;
|
|
import org.jeecg.modules.app.vo.VerifyCourseInfoDTO;
|
|
|
import org.jeecg.modules.app.vo.VerifyCourseInfoVO;
|
|
import org.jeecg.modules.app.vo.VerifyCourseInfoVO;
|
|
|
import org.jeecg.modules.system.app.dto.*;
|
|
import org.jeecg.modules.system.app.dto.*;
|
|
@@ -47,13 +49,15 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
|
|
|
private AppCoursesVerificationRecordMapper appCoursesVerificationRecordMapper;
|
|
private AppCoursesVerificationRecordMapper appCoursesVerificationRecordMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
private FamilyMembersMapper familyMembersMapper;
|
|
private FamilyMembersMapper familyMembersMapper;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private AppOrderMapper appOrderMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean saveWitchPriceRules(AppCoursesDTO appCoursesDTO) {
|
|
public Boolean saveWitchPriceRules(AppCoursesDTO appCoursesDTO) {
|
|
|
AppCoursesCuDTO coursesCuDTO = appCoursesDTO.getCourses();
|
|
AppCoursesCuDTO coursesCuDTO = appCoursesDTO.getCourses();
|
|
|
if (null == coursesCuDTO.getCategoryId()) throw new JeecgBootException("请选择课程类别");
|
|
if (null == coursesCuDTO.getCategoryId()) throw new JeecgBootException("请选择课程类别");
|
|
|
- AppSite site = siteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getTenantId, coursesCuDTO.getSiteId()));
|
|
|
|
|
|
|
+ AppSite site = siteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, coursesCuDTO.getOrgCode()));
|
|
|
AppCourses appCourses = new AppCourses();
|
|
AppCourses appCourses = new AppCourses();
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
BeanUtils.copyProperties(coursesCuDTO, appCourses);
|
|
BeanUtils.copyProperties(coursesCuDTO, appCourses);
|
|
@@ -357,6 +361,64 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
|
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<FamilyUserVO> getClassPostponeUsers(String coursePriceRulesId) {
|
|
|
|
|
+
|
|
|
|
|
+ List<AppCoursesVerificationRecord> verificationRecordList = appCoursesVerificationRecordMapper.selectList(Wrappers.<AppCoursesVerificationRecord>lambdaQuery().eq(AppCoursesVerificationRecord::getCoursesId, coursePriceRulesId));
|
|
|
|
|
+
|
|
|
|
|
+ return verificationRecordList.stream().map(e -> {
|
|
|
|
|
+ FamilyUserVO familyUserVO = new FamilyUserVO();
|
|
|
|
|
+ familyUserVO.setFamilyUserId(e.getUseUserId()).setFamilyUserName(e.getCoursesName()).setFamilyUserImage(e.getUseUserImage());
|
|
|
|
|
+ return familyUserVO;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean classPostpone(ClassPostponeForm form) {
|
|
|
|
|
+
|
|
|
|
|
+ AppOrder appOrder = appOrderMapper.selectById(form.getOrderId());
|
|
|
|
|
+ //原课时
|
|
|
|
|
+ AppCoursesPriceRules appCoursesPriceRules = priceRulesMapper.selectById(form.getCoursePriceRulesId());
|
|
|
|
|
+ //设置为延期状态
|
|
|
|
|
+ appCoursesPriceRules.setClassStatus(CommonConstant.STATUS_1_INT);
|
|
|
|
|
+ List<AppCoursesVerificationRecord> verificationRecordList = appCoursesVerificationRecordMapper.selectList(Wrappers.<AppCoursesVerificationRecord>lambdaQuery().eq(AppCoursesVerificationRecord::getCoursesPriceRuleId, form.getCoursePriceRulesId()));
|
|
|
|
|
+ //所有记录修改为延期
|
|
|
|
|
+ for (AppCoursesVerificationRecord appCoursesVerificationRecord : verificationRecordList) {
|
|
|
|
|
+ appCoursesVerificationRecord
|
|
|
|
|
+ .setOrPostpone(CommonConstant.STATUS_1_INT)
|
|
|
|
|
+ .setPostponeReason(form.getPostponeReason());
|
|
|
|
|
+ appCoursesVerificationRecordMapper.updateById(appCoursesVerificationRecord);
|
|
|
|
|
+ }
|
|
|
|
|
+ //补课新课时
|
|
|
|
|
+ AppCoursesPriceRules priceRules = new AppCoursesPriceRules();
|
|
|
|
|
+ priceRules.setOrgCode(appCoursesPriceRules.getOrgCode());
|
|
|
|
|
+ priceRules.setTenantId(appCoursesPriceRules.getTenantId());
|
|
|
|
|
+ priceRules.setCoursesId(appCoursesPriceRules.getCoursesId());
|
|
|
|
|
+ priceRules.setName("(补课)" + appCoursesPriceRules.getName());
|
|
|
|
|
+ priceRules.setStartTime(form.getStartTime());
|
|
|
|
|
+ priceRules.setEndTime(form.getEndTime());
|
|
|
|
|
+ priceRules.setCoursesType(CommonConstant.STATUS_1_INT);
|
|
|
|
|
+ priceRulesMapper.insert(priceRules);
|
|
|
|
|
+
|
|
|
|
|
+ for (FamilyUserVO familyUserVO : form.getFamilyUserVOList()) {
|
|
|
|
|
+ AppCoursesVerificationRecord verificationRecord = new AppCoursesVerificationRecord();
|
|
|
|
|
+ verificationRecord.setOrderId(appOrder.getId());
|
|
|
|
|
+ verificationRecord.setOrderCode(appOrder.getOrderCode());
|
|
|
|
|
+ verificationRecord.setCoursesId(appOrder.getProductIds());
|
|
|
|
|
+ verificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
|
|
|
|
|
+ verificationRecord.setCoursesName(appCoursesPriceRules.getName());
|
|
|
|
|
+ verificationRecord.setCoursesStartTime(form.getStartTime());
|
|
|
|
|
+ verificationRecord.setCoursesEndTime(form.getEndTime());
|
|
|
|
|
+ verificationRecord.setUseUserId(familyUserVO.getFamilyUserId());
|
|
|
|
|
+ verificationRecord.setUseUserName(familyUserVO.getFamilyUserName());
|
|
|
|
|
+ verificationRecord.setUseUserImage(familyUserVO.getFamilyUserImage());
|
|
|
|
|
+ verificationRecord.setVerifyStatus(CommonConstant.STATUS_1_INT);
|
|
|
|
|
+ verificationRecord.setCoursesType(CommonConstant.STATUS_1_INT);
|
|
|
|
|
+ appCoursesVerificationRecordMapper.insert(verificationRecord);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Boolean.TRUE;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 校验权限
|
|
* 校验权限
|
|
|
*
|
|
*
|