|
@@ -2,6 +2,7 @@ package org.jeecg.modules.system.app.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -26,6 +27,8 @@ import org.jeecg.modules.system.app.dto.*;
|
|
|
import org.jeecg.modules.system.app.entity.*;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.app.service.IAppCoureseService;
|
|
|
+import org.jeecg.modules.system.entity.SysDepart;
|
|
|
+import org.jeecg.modules.system.mapper.SysDepartMapper;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -67,18 +70,28 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
|
|
|
private FamilyMembersMapper familyMembersMapper;
|
|
|
@Resource
|
|
|
private AppOrderMapper appOrderMapper;
|
|
|
-
|
|
|
@Autowired
|
|
|
WxNotificationService wxNotificationService;
|
|
|
@Resource
|
|
|
private AppCoursesMapper appCoursesMapper;
|
|
|
@Resource
|
|
|
private AppDeviceMapper appDeviceMapper;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private SysDepartMapper sysDepartMapper;
|
|
|
+ @Resource
|
|
|
+ private SeparateAccountsMapper separateAccountsMapper;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean saveWitchPriceRules(AppCoursesDTO appCoursesDTO) {
|
|
|
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ SysDepart depart = sysDepartMapper.selectOne(Wrappers.lambdaQuery(SysDepart.class).eq(SysDepart::getOrgCode, loginUser.getOrgCode()).last("limit 1"));
|
|
|
+ if (depart.getSystemType() != 0) {
|
|
|
+ SeparateAccounts separateAccounts = separateAccountsMapper.selectOne(Wrappers.lambdaQuery(SeparateAccounts.class).eq(SeparateAccounts::getDeptId, depart.getId()));
|
|
|
+ if (ObjectUtil.isEmpty(separateAccounts)) {
|
|
|
+ throw new JeecgBootException("商户分账比例信息未配置!");
|
|
|
+ }
|
|
|
+ }
|
|
|
AppCoursesCuDTO coursesCuDTO = appCoursesDTO.getCourses();
|
|
|
if (null == coursesCuDTO.getCategoryId()) throw new JeecgBootException("请选择课程类别");
|
|
|
AppSite site = siteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, coursesCuDTO.getOrgCode()));
|