|
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
+import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.modules.app.vo.AppOrderProInfoVerifyVO;
|
|
|
+import org.jeecg.modules.app.vo.ScanCodeQueryOrderVO;
|
|
|
import org.jeecg.modules.system.app.dto.AppOrderDTO;
|
|
|
import org.jeecg.modules.system.app.dto.IsinUserInfoDTO;
|
|
|
import org.jeecg.modules.system.app.dto.VerificationRecordDTO;
|
|
@@ -55,6 +58,23 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
|
|
|
@Resource
|
|
|
private AppCoursesVerificationRecordMapper appCoursesVerificationRecordMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private AppSitePriceRulesMapper appSitePriceRulesMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private AppSitePlaceMapper appSitePlaceMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private AppGameMapper appGameMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private AppGamePriceRulesMapper appGamePriceRulesMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private AppCoursesMapper appCoursesMapper;
|
|
|
+ @Resource
|
|
|
+ private AppCoursesPriceRulesMapper appCoursesPriceRulesMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -176,4 +196,78 @@ public class AppOrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> i
|
|
|
}
|
|
|
return appOrderInfoVO;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ScanCodeQueryOrderVO scanCodeQueryOrder(String orderId) {
|
|
|
+
|
|
|
+ AppOrder appOrder = appOrderMapper.selectById(orderId);
|
|
|
+ AppSite site = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, appOrder.getOrgCode()));
|
|
|
+
|
|
|
+
|
|
|
+ ScanCodeQueryOrderVO scanCodeQueryOrderVO = new ScanCodeQueryOrderVO();
|
|
|
+ scanCodeQueryOrderVO.setSiteName(site.getName());
|
|
|
+ scanCodeQueryOrderVO.setAmount(appOrder.getAmount());
|
|
|
+
|
|
|
+
|
|
|
+ List<AppOrderProInfoVerifyVO> orderProInfoVOList = new ArrayList<>();
|
|
|
+ List<AppOrderProInfo> proInfoList = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getOrderId, orderId));
|
|
|
+
|
|
|
+ for (AppOrderProInfo appOrderProInfo : proInfoList) {
|
|
|
+
|
|
|
+ AppIsin appIsin = appIsinMapper.selectOne(Wrappers.<AppIsin>lambdaQuery().eq(AppIsin::getOrderProInfoId, appOrderProInfo.getId()));
|
|
|
+
|
|
|
+ AppOrderProInfoVerifyVO appOrderProInfoVerifyVO = new AppOrderProInfoVerifyVO();
|
|
|
+ appOrderProInfoVerifyVO.setIsinId(appIsin.getId());
|
|
|
+ appOrderProInfoVerifyVO.setIsinStatus(appIsin.getIsinStatus());
|
|
|
+ appOrderProInfoVerifyVO.setAppOrderProInfo(appOrderProInfo);
|
|
|
+
|
|
|
+ orderProInfoVOList.add(appOrderProInfoVerifyVO);
|
|
|
+ }
|
|
|
+ scanCodeQueryOrderVO.setAppOrderProInfoVerifyVOS(orderProInfoVOList);
|
|
|
+
|
|
|
+ //0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程 学校及包场即为商品不用查
|
|
|
+ if (appOrder.getOrderType() == 2) {
|
|
|
+ String productIds = appOrder.getProductIds();
|
|
|
+ AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectById(productIds);
|
|
|
+ AppSitePlace appSitePlace = appSitePlaceMapper.selectById(appSitePriceRules.getSitePlaceId());
|
|
|
+ scanCodeQueryOrderVO.setProductName(appSitePlace.getName());
|
|
|
+ scanCodeQueryOrderVO.setProductImage(appSitePlace.getCover());
|
|
|
+ scanCodeQueryOrderVO.setPrice(appSitePriceRules.getSellingPrice());
|
|
|
+ }
|
|
|
+ if (appOrder.getOrderType() == 3 || appOrder.getOrderType() == 4) {
|
|
|
+ AppGamePriceRules appGamePriceRules = appGamePriceRulesMapper.selectById(appOrder.getProductIds());
|
|
|
+ AppGame appGame = appGameMapper.selectById(appGamePriceRules.getGameId());
|
|
|
+
|
|
|
+ scanCodeQueryOrderVO.setProductName(appGame.getName());
|
|
|
+ scanCodeQueryOrderVO.setProductImage(appGame.getCover());
|
|
|
+ scanCodeQueryOrderVO.setGameType(appGamePriceRules.getType());
|
|
|
+ scanCodeQueryOrderVO.setPrice(appGamePriceRules.getSellingPrice());
|
|
|
+ }
|
|
|
+ if (appOrder.getOrderType() == 5) {
|
|
|
+ AppCourses appCourses = appCoursesMapper.selectById(appOrder.getProductIds());
|
|
|
+ scanCodeQueryOrderVO.setProductName(appCourses.getName());
|
|
|
+ scanCodeQueryOrderVO.setProductImage(appCourses.getCover());
|
|
|
+ scanCodeQueryOrderVO.setPrice(appCourses.getSellingPrice());
|
|
|
+ }
|
|
|
+
|
|
|
+ return scanCodeQueryOrderVO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean scanCodeVerification(List<String> isinIds) {
|
|
|
+
|
|
|
+ for (String isinId : isinIds) {
|
|
|
+ //查询对应券号
|
|
|
+ AppIsin appIsin = appIsinMapper.selectById(isinId);
|
|
|
+ appIsin.setIsinStatus(CommonConstant.ISIN_STATUS_2);
|
|
|
+ appIsinMapper.updateById(appIsin);
|
|
|
+ //修改订单状态
|
|
|
+ String orderProInfoId = appIsin.getOrderProInfoId();
|
|
|
+ AppOrderProInfo appOrderProInfo = appOrderProInfoMapper.selectById(orderProInfoId);
|
|
|
+ appOrderProInfo.setOrderStatus(CommonConstant.ORDER_STATUS_1);
|
|
|
+ appOrderProInfoMapper.updateById(appOrderProInfo);
|
|
|
+ }
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
}
|