|
|
@@ -25,14 +25,10 @@ import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
|
import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
|
import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
|
-import com.zhongzheng.modules.course.domain.Course;
|
|
|
-import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
-import com.zhongzheng.modules.course.domain.CourseMenu;
|
|
|
+import com.zhongzheng.modules.course.domain.*;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
|
+import com.zhongzheng.modules.course.service.*;
|
|
|
import com.zhongzheng.modules.course.vo.CourseLiveVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeTwoAddBo;
|
|
|
@@ -73,6 +69,7 @@ import com.zhongzheng.modules.order.mapper.OrderGoodsMapper;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderInputService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
+import com.zhongzheng.modules.order.vo.MailOrderVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
|
|
|
@@ -80,6 +77,7 @@ import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
|
|
|
import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
+import com.zhongzheng.modules.tencentcloud.service.IFaceOcrService;
|
|
|
import com.zhongzheng.modules.top.goods.bo.TopOldOrderGoodsQuery;
|
|
|
import com.zhongzheng.modules.top.goods.vo.TopOldOrderGoodsListVo;
|
|
|
import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
|
|
|
@@ -197,6 +195,15 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
@Autowired
|
|
|
private ISysTenantService iSysTenantService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseEducationTypeService iCourseEducationTypeService;
|
|
|
+ @Autowired
|
|
|
+ private ICourseProjectTypeService iCourseProjectTypeService;
|
|
|
+ @Autowired
|
|
|
+ private ICourseBusinessService iCourseBusinessService;
|
|
|
+ @Autowired
|
|
|
+ private IMajorService iMajorService;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -889,6 +896,60 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
return BeanUtil.toBean(goods,GoodsVo.class);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<MailOrderVo> getMailList(MailOrderBo bo) {
|
|
|
+ List<MailOrderVo> mailOrderVos = baseMapper.getMailList(bo);
|
|
|
+ if (CollectionUtils.isEmpty(mailOrderVos)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ mailOrderVos.forEach(item -> {
|
|
|
+ List<OrderGoods> list = list(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn, item.getOrderSn()));
|
|
|
+ if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ Map<Long, List<OrderGoods>> map = list.stream().collect(Collectors.groupingBy(OrderGoods::getGoodsId));
|
|
|
+ Integer mailNum = 0;
|
|
|
+ List<String> mailTail = new ArrayList<>();
|
|
|
+ for (Long goodsId : map.keySet()) {
|
|
|
+ Goods goods = iGoodsService.getById(goodsId);
|
|
|
+ if (ObjectUtils.isNull(goods.getMailSign()) || goods.getMailSign() != 1){
|
|
|
+ //非寄件商品
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int size = map.get(goodsId).size();
|
|
|
+ mailNum += size;
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService.getById(goods.getEducationTypeId());
|
|
|
+ CourseProjectType projectType = iCourseProjectTypeService.getById(goods.getProjectId());
|
|
|
+ CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
|
|
|
+ String format = String.format("%s/%s%s", educationType.getEducationName(), business.getBusinessName(), projectType.getProjectName());
|
|
|
+ if (ObjectUtils.isNotNull(goods.getMajorId())){
|
|
|
+ Major major = iMajorService.getById(goods.getMajorId());
|
|
|
+ format = format +"/"+ major.getCategoryName();
|
|
|
+ }
|
|
|
+ format = format + String.format("%s套教材",size);
|
|
|
+ mailTail.add(format);
|
|
|
+ }
|
|
|
+ item.setMailDetail(mailTail);
|
|
|
+ item.setMailNum(mailNum);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return mailOrderVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean mailOrderHandle(MailOrderHandleBo bo) {
|
|
|
+ List<Order> list = iOrderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderSn, bo.getOrderSnList()));
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
+ throw new CustomException("订单信息错误");
|
|
|
+ }
|
|
|
+ list.forEach(item -> {
|
|
|
+ if (ObjectUtils.isNotNull(bo.getMailStatus())){
|
|
|
+ item.setMailStatus(bo.getMailStatus());
|
|
|
+ }else if (ObjectUtils.isNotNull(bo.getMailRemark())){
|
|
|
+ item.setMailRemark(bo.getMailRemark());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return iOrderService.updateBatchById(list);
|
|
|
+ }
|
|
|
+
|
|
|
private boolean checkUnique(Long GoodsId,Long UserId) {
|
|
|
ShoppingCart info = iShoppingCartService.getOne(new LambdaQueryWrapper<ShoppingCart>()
|
|
|
.eq(ShoppingCart::getUserId,UserId).eq(ShoppingCart::getGoodsId,GoodsId).last("limit 1"));
|