|
@@ -21,8 +21,9 @@ import org.jeecg.modules.app.form.CreateOrderForm;
|
|
|
import org.jeecg.modules.app.form.InsureOrderInfoForm;
|
|
|
import org.jeecg.modules.app.form.UserPayForm;
|
|
|
import org.jeecg.modules.app.service.IOrderService;
|
|
|
+import org.jeecg.modules.app.vo.AppGameScheduleVO;
|
|
|
import org.jeecg.modules.app.vo.OrderVO;
|
|
|
-import org.jeecg.modules.app.vo.VerifyCourseInfoDTO;
|
|
|
+import org.jeecg.modules.app.vo.QueryOrderVerifyRecordsVO;
|
|
|
import org.jeecg.modules.system.app.entity.*;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.mapper.SysDepartMapper;
|
|
@@ -318,13 +319,18 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
for (String id : ids) {
|
|
|
FamilyMembers familyMembers = familyMembersMapper.selectById(id);
|
|
|
|
|
|
+ String date = DateUtil.format(priceRule.getDateOfSale(), "yyyy-MM-dd");
|
|
|
+ String time = DateUtil.format(priceRule.getEndTime(), "HH:mm:ss");
|
|
|
+ String expireTime = date + " " + time;
|
|
|
+
|
|
|
AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
|
|
|
appOrderProInfo
|
|
|
.setProductId(priceRule.getId())
|
|
|
.setProductName("学校场地预约")
|
|
|
.setType(CommonConstant.ORDER_PRO_INFO_TYPE_1)
|
|
|
- .setUseDateStr(DateUtil.format(priceRule.getDateOfSale(), "yyyy-MM-dd"))
|
|
|
+ .setUseDateStr(date)
|
|
|
.setFrameTimeStr(priceRule.getStartTime() + "-" + priceRule.getEndTime())
|
|
|
+ .setExpireTime(expireTime)
|
|
|
.setOriginalPrice(priceRule.getOriginalPrice())
|
|
|
.setPrice(priceRule.getSellingPrice())
|
|
|
.setOrderStatus(2)
|
|
@@ -352,9 +358,15 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
AppSitePlace appSitePlace = appSitePlaceMapper.selectById(priceRule.getSitePlaceId());
|
|
|
AppSite appSite = appSiteMapper.selectById(appSitePlace.getSiteId());
|
|
|
|
|
|
+ String date = DateUtil.format(priceRule.getDateOfSale(), "yyyy-MM-dd");
|
|
|
+ String startTime = DateUtil.format(priceRule.getStartTime(), "HH:mm:ss");
|
|
|
+ String endTime = DateUtil.format(priceRule.getEndTime(), "HH:mm:ss");
|
|
|
+ String expireTime = date + " " + endTime;
|
|
|
+
|
|
|
AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
|
|
|
appOrderProInfo.setProductId(id);
|
|
|
- appOrderProInfo.setProductName(priceRule.getDateOfSale() + " " + priceRule.getStartTime() + "-" + priceRule.getEndTime() + "|" + appSitePlace.getName());
|
|
|
+ appOrderProInfo.setProductName(date + " " + startTime + "-" + endTime + "|" + appSitePlace.getName());
|
|
|
+ appOrderProInfo.setExpireTime(expireTime);
|
|
|
appOrderProInfo.setAddress(appSite.getAddress());
|
|
|
appOrderProInfo.setType(CommonConstant.ORDER_PRO_INFO_TYPE_2);
|
|
|
appOrderProInfo.setOriginalPrice(priceRule.getOriginalPrice());
|
|
@@ -387,9 +399,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
//无固定场
|
|
|
if (createOrderForm.getOrderType() == 2) {
|
|
|
- AppSitePlace sitePlace = appSitePlaceMapper.selectById(createOrderForm.getProductIds());
|
|
|
- AppSitePriceRules priceRule = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
|
- .eq(AppSitePriceRules::getSitePlaceId,sitePlace.getId()).last("limit 1"));
|
|
|
+ AppSitePriceRules priceRule = appSitePriceRulesMapper.selectById(createOrderForm.getProductIds());
|
|
|
AppSitePlace appSitePlace = appSitePlaceMapper.selectById(priceRule.getSitePlaceId());
|
|
|
AppSite appSite = appSiteMapper.selectById(appSitePlace.getSiteId());
|
|
|
|
|
@@ -400,13 +410,19 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
for (int i = 1; i <= createOrderForm.getAmount(); i++) {
|
|
|
|
|
|
+ String date = DateUtil.format(priceRule.getDateOfSale(), "yyyy-MM-dd");
|
|
|
+ String startTime = DateUtil.format(priceRule.getStartTime(), "HH:mm:ss");
|
|
|
+ String endTime = DateUtil.format(priceRule.getEndTime(), "HH:mm:ss");
|
|
|
+ String expireTime = date + " " + endTime;
|
|
|
+
|
|
|
AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
|
|
|
appOrderProInfo.setProductId(createOrderForm.getProductIds());
|
|
|
appOrderProInfo.setProductName(appSitePlace.getName());
|
|
|
appOrderProInfo.setProductImage(appSitePlace.getCover());
|
|
|
appOrderProInfo.setAddress(appSite.getAddress());
|
|
|
appOrderProInfo.setType(CommonConstant.ORDER_PRO_INFO_TYPE_3);
|
|
|
- appOrderProInfo.setFrameTimeStr(appSite.getStartTime() + "-" + appSite.getEndTime());
|
|
|
+ appOrderProInfo.setFrameTimeStr(startTime + "-" + endTime);
|
|
|
+ appOrderProInfo.setExpireTime(expireTime);
|
|
|
appOrderProInfo.setOriginalPrice(priceRule.getOriginalPrice());
|
|
|
appOrderProInfo.setPrice(priceRule.getSellingPrice());
|
|
|
appOrderProInfo.setOrderStatus(0);
|
|
@@ -441,6 +457,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
//个人赛
|
|
|
AppGamePriceRules appGamePriceRules = appGamePriceRulesMapper.selectById(createOrderForm.getProductIds());
|
|
|
AppGame appGame = appGameMapper.selectById(appGamePriceRules.getGameId());
|
|
|
+ AppGameSchedule appGameSchedule = appGameScheduleMapper.selectOne(Wrappers.<AppGameSchedule>lambdaQuery().eq(AppGameSchedule::getGameId, appGame.getId()).last("limit 1"));
|
|
|
+
|
|
|
|
|
|
appOrder.setOrgCode(appGamePriceRules.getOrgCode());
|
|
|
appOrder.setTenantId(appGamePriceRules.getTenantId());
|
|
@@ -450,6 +468,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
for (int i = 1; i <= createOrderForm.getAmount(); i++) {
|
|
|
|
|
|
+
|
|
|
String familyUserId = createOrderForm.getFamilyIds().split(",")[i - 1];
|
|
|
FamilyMembers familyMembers = familyMembersMapper.selectById(familyUserId);
|
|
|
AppOrderProInfo appOrderProInfo = new AppOrderProInfo();
|
|
@@ -463,6 +482,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderProInfo.setType(CommonConstant.ORDER_PRO_INFO_TYPE_5);
|
|
|
}
|
|
|
appOrderProInfo.setFrameTimeStr(appGame.getStartTime() + "-" + appGame.getEndTime());
|
|
|
+ appOrderProInfo.setExpireTime(DateUtil.format(appGameSchedule.getEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
appOrderProInfo.setOriginalPrice(appGamePriceRules.getSellingPrice());
|
|
|
appOrderProInfo.setPrice(appGamePriceRules.getSellingPrice());
|
|
|
appOrderProInfo.setOrderStatus(0);
|
|
@@ -528,6 +548,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderProInfo.setAddress(appSite.getAddress());
|
|
|
appOrderProInfo.setType(CommonConstant.ORDER_PRO_INFO_TYPE_6);
|
|
|
appOrderProInfo.setFrameTimeStr(DateUtil.format(appCourse.getStartTime(), "yyyy-MM-dd") + "-" + DateUtil.format(appCourse.getEndTime(), "yyyy-MM-dd"));
|
|
|
+ appOrderProInfo.setExpireTime(DateUtil.format(appCourse.getEndTime(), "yyyy-MM-dd"));
|
|
|
appOrderProInfo.setOriginalPrice(appCourse.getOriginalPrice());
|
|
|
appOrderProInfo.setPrice(appCourse.getSellingPrice());
|
|
|
appOrderProInfo.setOrderStatus(0);
|
|
@@ -544,7 +565,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
AppCoursesVerificationRecord appCoursesVerificationRecord = new AppCoursesVerificationRecord();
|
|
|
appCoursesVerificationRecord.setCoursesId(appCourse.getId());
|
|
|
appCoursesVerificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
|
|
|
- appCoursesVerificationRecord.setCoursesName(appCourse.getName());
|
|
|
+ appCoursesVerificationRecord.setCoursesName(appCoursesPriceRules.getName());
|
|
|
appCoursesVerificationRecord.setCoursesStartTime(appCoursesPriceRules.getStartTime());
|
|
|
appCoursesVerificationRecord.setCoursesEndTime(appCoursesPriceRules.getEndTime());
|
|
|
appCoursesVerificationRecord.setUseUserId(familyUserId);
|
|
@@ -653,10 +674,15 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
.setOrderCode(appOrder.getOrderCode())
|
|
|
.setOrderProInfoId(appOrderProInfo.getId())
|
|
|
.setFamilyId(appOrderProInfo.getFamilyUserId())
|
|
|
+ .setFamilyUserName(appOrderProInfo.getUserName())
|
|
|
+ .setUserPhone(appOrderProInfo.getUserPhone())
|
|
|
.setUseAddress(StrUtil.isBlank(appOrderProInfo.getAddress()) ? null : appOrderProInfo.getAddress())
|
|
|
+ //过期时间
|
|
|
+ .setExpireTime(appOrderProInfo.getExpireTime())
|
|
|
//生成10位随机券号
|
|
|
.setTicketNo(appOrderProInfo.getTicketNo())
|
|
|
.setIsinStatus(CommonConstant.ISIN_STATUS_1);
|
|
|
+ appIsinMapper.insert(appIsin);
|
|
|
}
|
|
|
|
|
|
//保存保险
|
|
@@ -731,12 +757,111 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
//学校
|
|
|
if(appOrder.getType().equals(CommonConstant.ORDER_TYPE_0)){
|
|
|
-
|
|
|
+ if (appOrder.getOrderType() == 0) {
|
|
|
+ //商品信息
|
|
|
+ String productIds = appOrder.getProductIds();
|
|
|
+ AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(productIds);
|
|
|
+ AppSitePlace appSitePlace = appSitePlaceMapper.selectById(appSitePriceRules.getSitePlaceId());
|
|
|
+ //使用须知
|
|
|
+ if (ObjectUtils.isNotEmpty(appSitePlace.getReminder())) {
|
|
|
+ appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
|
+ }
|
|
|
+ //门店信息
|
|
|
+ AppSite site = appSiteMapper.selectById(appSitePlace.getSiteId());
|
|
|
+ appOrderInfoDTO.setSiteName(site.getName());
|
|
|
+ appOrderInfoDTO.setRunStatus(site.getRunStatus());
|
|
|
+ //预定信息
|
|
|
+ appOrderInfoDTO.setDateOfSale(appSitePriceRules.getDateOfSale());
|
|
|
+ appOrderInfoDTO.setStartTime(appSitePriceRules.getStartTime());
|
|
|
+ appOrderInfoDTO.setEndTime(appSitePriceRules.getEndTime());
|
|
|
+ StringBuilder userNames = new StringBuilder();
|
|
|
+ for (AppOrderProInfo appOrderProInfo : proInfoList) {
|
|
|
+ userNames.append(appOrderProInfo.getUserName()).append(" ");
|
|
|
+ }
|
|
|
+ appOrderInfoDTO.setUserNames(String.valueOf(userNames));
|
|
|
+ //地址信息
|
|
|
+ appOrderInfoDTO.setSchoolAddress(site.getAddress());
|
|
|
+ appOrderInfoDTO.setLatitude(site.getLatitude());
|
|
|
+ appOrderInfoDTO.setLongitude(site.getLongitude());
|
|
|
+ appOrderInfoDTO.setPhone(site.getPhone());
|
|
|
+ appOrderInfoDTO.setAddressSiteId(site.getId());
|
|
|
+ }
|
|
|
+ //包场
|
|
|
+ if (appOrder.getOrderType() == 1) {
|
|
|
+ //商品信息
|
|
|
+ String productIds = appOrder.getProductIds();
|
|
|
+ AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(productIds);
|
|
|
+ AppSitePlace appSitePlace = appSitePlaceMapper.selectById(appSitePriceRules.getSitePlaceId());
|
|
|
+ //使用须知
|
|
|
+ if (ObjectUtils.isNotEmpty(appSitePlace.getReminder())) {
|
|
|
+ appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
|
+ }
|
|
|
+ //场馆
|
|
|
+ AppSite site = appSiteMapper.selectById(appSitePlace.getSiteId());
|
|
|
+ appOrderInfoDTO.setSiteName(site.getName());
|
|
|
+ appOrderInfoDTO.setRunStatus(site.getRunStatus());
|
|
|
+ //退改规则、温馨提示
|
|
|
+ appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
|
+ appOrderInfoDTO.setAdvanceTime(appSitePlace.getAdvanceTime());
|
|
|
+
|
|
|
+ //地址信息
|
|
|
+ appOrderInfoDTO.setSchoolAddress(site.getAddress());
|
|
|
+ appOrderInfoDTO.setLatitude(site.getLatitude());
|
|
|
+ appOrderInfoDTO.setLongitude(site.getLongitude());
|
|
|
+ appOrderInfoDTO.setPhone(site.getPhone());
|
|
|
+ appOrderInfoDTO.setAddressSiteId(site.getId());
|
|
|
+ }
|
|
|
+ //无固定场
|
|
|
+ if (appOrder.getOrderType() == 2) {
|
|
|
+ //商品信息
|
|
|
+ String productIds = appOrder.getProductIds();
|
|
|
+ AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(productIds);
|
|
|
+ AppSitePlace appSitePlace = appSitePlaceMapper.selectById(appSitePriceRules.getSitePlaceId());
|
|
|
+ //使用须知
|
|
|
+ if (ObjectUtils.isNotEmpty(appSitePlace.getReminder())) {
|
|
|
+ appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
|
+ }
|
|
|
+ //门店信息
|
|
|
+ AppSite site = appSiteMapper.selectById(appSitePlace.getSiteId());
|
|
|
+ appOrderInfoDTO.setSiteName(site.getName());
|
|
|
+ appOrderInfoDTO.setRunStatus(site.getRunStatus());
|
|
|
+ //预定信息
|
|
|
+ appOrderInfoDTO.setStartTime(appSitePriceRules.getStartTime());
|
|
|
+ appOrderInfoDTO.setEndTime(appSitePriceRules.getEndTime());
|
|
|
+ appOrderInfoDTO.setRefundType(appSitePlace.getRefundType());
|
|
|
+ //地址信息
|
|
|
+ appOrderInfoDTO.setSchoolAddress(site.getAddress());
|
|
|
+ appOrderInfoDTO.setLatitude(site.getLatitude());
|
|
|
+ appOrderInfoDTO.setLongitude(site.getLongitude());
|
|
|
+ appOrderInfoDTO.setPhone(site.getPhone());
|
|
|
+ appOrderInfoDTO.setAddressSiteId(site.getId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //场地
|
|
|
+ //赛事
|
|
|
if(appOrder.getType().equals(CommonConstant.ORDER_TYPE_1)){
|
|
|
+ //商品信息
|
|
|
+ String productIds = appOrder.getProductIds();
|
|
|
+ AppGamePriceRules appGamePriceRules = appGamePriceRulesMapper.selectById(productIds);
|
|
|
+ AppGame appGame = appGameMapper.selectById(appGamePriceRules.getGameId());
|
|
|
|
|
|
+ //门店信息
|
|
|
+ AppSite site = appSiteMapper.selectById(appGame.getSiteId());
|
|
|
+ //退改规则、
|
|
|
+ appOrderInfoDTO.setReminder(appGame.getReminder());
|
|
|
+ //开始时间
|
|
|
+ appOrderInfoDTO.setStartTime(appGame.getStartTime());
|
|
|
+ //赛程安排
|
|
|
+ List<AppGameScheduleVO> appGameScheduleVOList = appGameScheduleMapper.getListVo(appGame.getId());
|
|
|
+ appOrderInfoDTO.setAppGameScheduleVOList(appGameScheduleVOList);
|
|
|
+ //赛程数
|
|
|
+ appOrderInfoDTO.setGameScheduleNum(appGameScheduleVOList.size());
|
|
|
+ //地址信息
|
|
|
+ appOrderInfoDTO.setSchoolAddress(site.getAddress());
|
|
|
+ appOrderInfoDTO.setLatitude(site.getLatitude());
|
|
|
+ appOrderInfoDTO.setLongitude(site.getLongitude());
|
|
|
+ appOrderInfoDTO.setPhone(site.getPhone());
|
|
|
+ appOrderInfoDTO.setAddressSiteId(site.getId());
|
|
|
}
|
|
|
|
|
|
//课程
|
|
@@ -766,9 +891,9 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<Integer, List<AppCoursesVerificationRecord>> queryOrderVerifyRecords(String orderId, String ticketNo) {
|
|
|
+ public List<QueryOrderVerifyRecordsVO> queryOrderVerifyRecords(String orderId, String ticketNo) {
|
|
|
|
|
|
- List<VerifyCourseInfoDTO> verifyCourseInfoDTOList = new ArrayList<>();
|
|
|
+ List<QueryOrderVerifyRecordsVO> list = new ArrayList<>();
|
|
|
|
|
|
AppOrderProInfo proInfo = appOrderProInfoMapper.selectOne(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getOrderId, orderId).eq(AppOrderProInfo::getTicketNo, ticketNo));
|
|
|
|
|
@@ -782,9 +907,22 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
Map<Integer, List<AppCoursesVerificationRecord>> map = verificationRecordList.stream().collect(Collectors.groupingBy(AppCoursesVerificationRecord::getCoursesType));
|
|
|
|
|
|
- return map;
|
|
|
- }
|
|
|
+ map.keySet().forEach(key -> {
|
|
|
+ QueryOrderVerifyRecordsVO queryOrderVerifyRecordsVO = new QueryOrderVerifyRecordsVO();
|
|
|
+ List<AppCoursesVerificationRecord> records = map.get(key);
|
|
|
+ queryOrderVerifyRecordsVO.setCoursesType(key);
|
|
|
+ queryOrderVerifyRecordsVO.setCoursesTotal(records.size());
|
|
|
+ long verifyNum = records.stream().filter(e -> e.getVerifyStatus() == 1).count();
|
|
|
+ queryOrderVerifyRecordsVO.setVerifyNum((int) verifyNum);
|
|
|
+ long unVerifyNum = records.stream().filter(e -> e.getVerifyStatus() == 0).count();
|
|
|
+ queryOrderVerifyRecordsVO.setUnVerifyNum((int) unVerifyNum);
|
|
|
+ queryOrderVerifyRecordsVO.setRecordList(map.get(key));
|
|
|
+
|
|
|
+ list.add(queryOrderVerifyRecordsVO);
|
|
|
+ });
|
|
|
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @return boolean
|