|
@@ -48,7 +48,6 @@ import org.jeecg.modules.system.entity.SysDepart;
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
import org.jeecg.modules.system.mapper.SysDepartMapper;
|
|
import org.jeecg.modules.system.mapper.SysDepartMapper;
|
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -129,14 +128,12 @@ public class OrderServiceImpl implements IOrderService {
|
|
private WechatPayV3Utils wechatPayV3Utils;
|
|
private WechatPayV3Utils wechatPayV3Utils;
|
|
@Resource
|
|
@Resource
|
|
private EvaluateMapper evaluateMapper;
|
|
private EvaluateMapper evaluateMapper;
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- IReceiptPaymentDetailsInfoService iReceiptPaymentDetailsInfoService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- SysDepartMapper sysDepartMapper;
|
|
|
|
- @Autowired
|
|
|
|
- SeparateAccountsMapper separateAccountsMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private IReceiptPaymentDetailsInfoService iReceiptPaymentDetailsInfoService;
|
|
|
|
+ @Resource
|
|
|
|
+ private SysDepartMapper sysDepartMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private SeparateAccountsMapper separateAccountsMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -630,7 +627,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
//订单总价(商品的售价总和)
|
|
//订单总价(商品的售价总和)
|
|
BigDecimal sumPrice = BigDecimal.ZERO;
|
|
BigDecimal sumPrice = BigDecimal.ZERO;
|
|
- ;
|
|
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
AppSitePriceRules priceRule = appSitePriceRulesMapper.selectById(list.get(i).split("\\|")[0]);
|
|
AppSitePriceRules priceRule = appSitePriceRulesMapper.selectById(list.get(i).split("\\|")[0]);
|
|
@@ -901,12 +897,15 @@ public class OrderServiceImpl implements IOrderService {
|
|
List<AppOrderProInfo> infos = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery()
|
|
List<AppOrderProInfo> infos = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery()
|
|
.eq(AppOrderProInfo::getProductId, appCourse.getId())
|
|
.eq(AppOrderProInfo::getProductId, appCourse.getId())
|
|
.eq(AppOrderProInfo::getFamilyUserId, familyUserId));
|
|
.eq(AppOrderProInfo::getFamilyUserId, familyUserId));
|
|
- List<AppOrderProInfo> infoList = infos.stream().filter(info -> Objects.equals(info.getOrFreePro(), CommonConstant.STATUS_0_INT)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<AppOrderProInfo> infoList = infos.stream().filter(info -> Objects.equals(info.getOrFreePro()
|
|
|
|
+ , CommonConstant.STATUS_0_INT) && !Objects.equals(info.getOrderStatus(), CommonConstant.ORDER_PRO_INFO_TYPE_4)).collect(Collectors.toList());
|
|
if (ObjectUtil.isNotEmpty(infoList)) {
|
|
if (ObjectUtil.isNotEmpty(infoList)) {
|
|
throw new JeecgBootException("当前课程已下过单,请勿重复下单");
|
|
throw new JeecgBootException("当前课程已下过单,请勿重复下单");
|
|
}
|
|
}
|
|
if (Objects.equals(createOrderForm.getOrFreeOrder(), CommonConstant.STATUS_1_INT)) {
|
|
if (Objects.equals(createOrderForm.getOrFreeOrder(), CommonConstant.STATUS_1_INT)) {
|
|
- List<AppOrderProInfo> freeProList = infos.stream().filter(info -> Objects.equals(info.getOrFreePro(), CommonConstant.STATUS_0_INT)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<AppOrderProInfo> freeProList = infos.stream()
|
|
|
|
+ .filter(info -> Objects.equals(info.getOrFreePro(), CommonConstant.STATUS_0_INT) && !Objects.equals(info.getOrderStatus(), CommonConstant.ORDER_PRO_INFO_TYPE_4))
|
|
|
|
+ .collect(Collectors.toList());
|
|
if (ObjectUtil.isNotEmpty(freeProList)) {
|
|
if (ObjectUtil.isNotEmpty(freeProList)) {
|
|
throw new JeecgBootException("当前试听课课程已下过单,请勿重复下单");
|
|
throw new JeecgBootException("当前试听课课程已下过单,请勿重复下单");
|
|
}
|
|
}
|
|
@@ -931,7 +930,29 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
//创建核销记录
|
|
//创建核销记录
|
|
if (CollUtil.isNotEmpty(priceRulesList)) {
|
|
if (CollUtil.isNotEmpty(priceRulesList)) {
|
|
- for (AppCoursesPriceRules appCoursesPriceRules : priceRulesList) {
|
|
|
|
|
|
+
|
|
|
|
+ if (Objects.equals(appOrder.getOrderOrFree(), CommonConstant.STATUS_0_INT)) {
|
|
|
|
+ for (AppCoursesPriceRules appCoursesPriceRules : priceRulesList) {
|
|
|
|
+ AppCoursesVerificationRecord appCoursesVerificationRecord = new AppCoursesVerificationRecord();
|
|
|
|
+ appCoursesVerificationRecord.setCoursesId(appCourse.getId());
|
|
|
|
+ appCoursesVerificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
|
|
|
|
+ appCoursesVerificationRecord.setCoursesName(appCoursesPriceRules.getName());
|
|
|
|
+ appCoursesVerificationRecord.setCoursesStartTime(appCoursesPriceRules.getStartTime());
|
|
|
|
+ appCoursesVerificationRecord.setCoursesEndTime(appCoursesPriceRules.getEndTime());
|
|
|
|
+ appCoursesVerificationRecord.setUseUserId(familyUserId);
|
|
|
|
+ appCoursesVerificationRecord.setUseUserName(familyMembers.getFullName());
|
|
|
|
+ appCoursesVerificationRecord.setUseUserPhone(familyMembers.getPhone());
|
|
|
|
+ appCoursesVerificationRecord.setUseUserImage(familyMembers.getRealNameImg());
|
|
|
|
+ appCoursesVerificationRecord.setUseUserName(familyMembers.getFullName());
|
|
|
|
+ appCoursesVerificationRecord.setVerifyStatus(0);
|
|
|
|
+ appCoursesVerificationRecord.setOrPostpone(0);
|
|
|
|
+ appCoursesVerificationRecord.setCoursesType(appCoursesPriceRules.getCoursesType());
|
|
|
|
+ appCoursesVerificationRecordList.add(appCoursesVerificationRecord);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (Objects.equals(appOrder.getOrderOrFree(), CommonConstant.STATUS_1_INT)) {
|
|
|
|
+ priceRulesList.sort(Comparator.comparing(AppCoursesPriceRules::getSort));
|
|
|
|
+ AppCoursesPriceRules appCoursesPriceRules = priceRulesList.get(0);
|
|
AppCoursesVerificationRecord appCoursesVerificationRecord = new AppCoursesVerificationRecord();
|
|
AppCoursesVerificationRecord appCoursesVerificationRecord = new AppCoursesVerificationRecord();
|
|
appCoursesVerificationRecord.setCoursesId(appCourse.getId());
|
|
appCoursesVerificationRecord.setCoursesId(appCourse.getId());
|
|
appCoursesVerificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
|
|
appCoursesVerificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
|
|
@@ -993,7 +1014,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//构建保单内容
|
|
//构建保单内容
|
|
InsureOrderInfoForm insureOrderInfoForm = createOrderForm.getInsureOrderInfoForm();
|
|
InsureOrderInfoForm insureOrderInfoForm = createOrderForm.getInsureOrderInfoForm();
|
|
if (ObjectUtils.isNotEmpty(insureOrderInfoForm)) {
|
|
if (ObjectUtils.isNotEmpty(insureOrderInfoForm)) {
|
|
@@ -1094,6 +1114,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!Objects.equals(appOrderProInfo.getType(), CommonConstant.ORDER_PRO_INFO_TYPE_6)) {
|
|
if (!Objects.equals(appOrderProInfo.getType(), CommonConstant.ORDER_PRO_INFO_TYPE_6)) {
|
|
|
|
+ AppSite appSite = appSiteMapper.selectById(appCoursesMapper.selectById(appOrderProInfo.getProductId()).getAddressSiteId());
|
|
//订单券号记录
|
|
//订单券号记录
|
|
AppIsin appIsin = new AppIsin();
|
|
AppIsin appIsin = new AppIsin();
|
|
appIsin
|
|
appIsin
|
|
@@ -1104,7 +1125,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
.setFamilyId(appOrderProInfo.getFamilyUserId())
|
|
.setFamilyId(appOrderProInfo.getFamilyUserId())
|
|
.setFamilyUserName(appOrderProInfo.getUserName())
|
|
.setFamilyUserName(appOrderProInfo.getUserName())
|
|
.setUserPhone(appOrderProInfo.getUserPhone())
|
|
.setUserPhone(appOrderProInfo.getUserPhone())
|
|
- .setUseAddress(StrUtil.isBlank(appOrderProInfo.getAddress()) ? null : appOrderProInfo.getAddress())
|
|
|
|
|
|
+ .setUseAddress(appSite.getName())
|
|
//过期时间
|
|
//过期时间
|
|
.setExpireTime(appOrderProInfo.getExpireTime())
|
|
.setExpireTime(appOrderProInfo.getExpireTime())
|
|
//生成10位随机券号
|
|
//生成10位随机券号
|