Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e39f3f5f9 | |||
| 99a873993d | |||
| 8d0d503700 |
@@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.peanut.common.utils.DateUtils;
|
import com.peanut.common.utils.*;
|
||||||
import com.peanut.common.utils.PageUtils;
|
|
||||||
import com.peanut.common.utils.R;
|
|
||||||
import com.peanut.common.utils.ShiroUtils;
|
|
||||||
import com.peanut.config.Constants;
|
import com.peanut.config.Constants;
|
||||||
import com.peanut.config.DelayQueueConfig;
|
import com.peanut.config.DelayQueueConfig;
|
||||||
import com.peanut.modules.book.service.*;
|
import com.peanut.modules.book.service.*;
|
||||||
@@ -41,6 +38,7 @@ import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
|
|||||||
import com.peanut.modules.pay.weChatPay.service.WxpayService;
|
import com.peanut.modules.pay.weChatPay.service.WxpayService;
|
||||||
import com.peanut.modules.sys.entity.SysConfigEntity;
|
import com.peanut.modules.sys.entity.SysConfigEntity;
|
||||||
import com.peanut.modules.sys.service.SysConfigService;
|
import com.peanut.modules.sys.service.SysConfigService;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.http.HttpException;
|
import org.apache.http.HttpException;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
@@ -152,7 +150,9 @@ public class BuyOrderController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(path = "/orderList", method = RequestMethod.POST)
|
@RequestMapping(path = "/orderList", method = RequestMethod.POST)
|
||||||
public R orderList(@RequestBody BuyOrderListRequestVo requestVo) {
|
public R orderList(@RequestBody BuyOrderListRequestVo requestVo) {
|
||||||
Page<BuyOrder> buyOrderPage = buyOrderService.orderList(requestVo);
|
HttpServletRequest request = HttpContextUtil.getHttpServletRequest();
|
||||||
|
Boolean isHT = request.getHeader("appType")==null?true:false;
|
||||||
|
Page<BuyOrder> buyOrderPage = buyOrderService.orderList(requestVo, isHT);
|
||||||
return R.ok().put("result", buyOrderPage);
|
return R.ok().put("result", buyOrderPage);
|
||||||
}
|
}
|
||||||
//导出名医精彩订单
|
//导出名医精彩订单
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public interface BuyOrderService extends IService<BuyOrder> {
|
|||||||
*/
|
*/
|
||||||
R delivery(String expressCompanyCode, List<Integer> buyOrderDetailId);
|
R delivery(String expressCompanyCode, List<Integer> buyOrderDetailId);
|
||||||
|
|
||||||
|
Page<BuyOrder> orderList(BuyOrderListRequestVo requestVo, Boolean isHT);
|
||||||
|
|
||||||
Page<BuyOrder> getUserOrderList(UserOrderDto userOrderDto);
|
Page<BuyOrder> getUserOrderList(UserOrderDto userOrderDto);
|
||||||
|
|
||||||
List<BuyOrder> getUserOrderStatusNum(Integer userId);
|
List<BuyOrder> getUserOrderStatusNum(Integer userId);
|
||||||
|
|||||||
@@ -383,6 +383,15 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<BuyOrder> orderList(BuyOrderListRequestVo requestVo) {
|
public Page<BuyOrder> orderList(BuyOrderListRequestVo requestVo) {
|
||||||
|
Page<BuyOrder> buyOrderPage = this.getOrderList(requestVo,null);
|
||||||
|
return buyOrderPage;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Page<BuyOrder> orderList(BuyOrderListRequestVo requestVo, Boolean isHT) {
|
||||||
|
Page<BuyOrder> buyOrderPage = this.getOrderList(requestVo,isHT);
|
||||||
|
return buyOrderPage;
|
||||||
|
}
|
||||||
|
public Page<BuyOrder> getOrderList(BuyOrderListRequestVo requestVo,Boolean isHT){
|
||||||
MPJLambdaWrapper<BuyOrder> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<BuyOrder> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(BuyOrder.class);
|
wrapper.selectAll(BuyOrder.class);
|
||||||
wrapper.leftJoin(MyUserEntity.class, MyUserEntity::getId,BuyOrder::getUserId);
|
wrapper.leftJoin(MyUserEntity.class, MyUserEntity::getId,BuyOrder::getUserId);
|
||||||
@@ -443,6 +452,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
if(paymentDateTime > timestamp-7*24*60*60*1000){
|
if(paymentDateTime > timestamp-7*24*60*60*1000){
|
||||||
refundableStatus = true;
|
refundableStatus = true;
|
||||||
}
|
}
|
||||||
|
refundableStatus = isHT?true:refundableStatus;
|
||||||
b.setVipBuyConfigEntity(vipBuyConfigService.getById(b.getVipBuyConfigId()));
|
b.setVipBuyConfigEntity(vipBuyConfigService.getById(b.getVipBuyConfigId()));
|
||||||
}
|
}
|
||||||
//添加商品信息
|
//添加商品信息
|
||||||
@@ -460,9 +470,9 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
b1.setProduct(byId);
|
b1.setProduct(byId);
|
||||||
b1.setExpressOrder(expressOrderDao.selectById(b1.getExpressOrderId()));
|
b1.setExpressOrder(expressOrderDao.selectById(b1.getExpressOrderId()));
|
||||||
boolean refundableStatusProduct = false;
|
boolean refundableStatusProduct = false;
|
||||||
if(b1.getProduct()!=null && b1.getProduct().getGoodsType().equals("05") && (paymentDateTime > timestamp-7*24*60*60*1000)){
|
if(b1.getProduct()!=null && b1.getProduct().getGoodsType().equals("05") && (paymentDateTime > timestamp-7*24*60*60*1000 || isHT)){
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
}else if(b1.getProduct()!=null && !b1.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals("1")){
|
}else if(b1.getProduct()!=null && !b1.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals("1") && b1.getExpressOrderId()==0){
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
}
|
}
|
||||||
refundableStatusArr[i] = refundableStatusProduct;
|
refundableStatusArr[i] = refundableStatusProduct;
|
||||||
@@ -571,7 +581,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
boolean refundableStatusProduct = false;
|
boolean refundableStatusProduct = false;
|
||||||
if (bb.getProduct()!=null && bb.getProduct().getGoodsType().equals("05") && paymentDateTime > timestamp - 7 * 24 * 60 * 60 * 1000) {
|
if (bb.getProduct()!=null && bb.getProduct().getGoodsType().equals("05") && paymentDateTime > timestamp - 7 * 24 * 60 * 60 * 1000) {
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
} else if (bb.getProduct()!=null && !bb.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals(Constants.ORDER_STATUS_TO_BE_SHIPPED)){
|
} else if (bb.getProduct()!=null && !bb.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals(Constants.ORDER_STATUS_TO_BE_SHIPPED) && bb.getExpressOrderId()==0){
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
}
|
}
|
||||||
refundableStatusArr[i] = refundableStatusProduct;
|
refundableStatusArr[i] = refundableStatusProduct;
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ public class UserVipController {
|
|||||||
String timeId = IdWorker.getTimeId().substring(0, 32);
|
String timeId = IdWorker.getTimeId().substring(0, 32);
|
||||||
buyOrder.setOrderSn(timeId);
|
buyOrder.setOrderSn(timeId);
|
||||||
buyOrder.setUserId(uid);
|
buyOrder.setUserId(uid);
|
||||||
|
buyOrder.setPaymentDate(new Date());
|
||||||
buyOrderService.save(buyOrder);
|
buyOrderService.save(buyOrder);
|
||||||
BigDecimal totalPrice = buyOrder.getRealMoney();
|
BigDecimal totalPrice = buyOrder.getRealMoney();
|
||||||
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.CourseMedicine;
|
||||||
|
|
||||||
|
public interface CourseMedicineService extends IService<CourseMedicine> {
|
||||||
|
}
|
||||||
@@ -125,7 +125,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
boolean refundableStatusProduct = false;
|
boolean refundableStatusProduct = false;
|
||||||
if(bb.getProduct()!=null && bb.getProduct().getGoodsType().equals("05") && (paymentDateTime > timestamp-7*24*60*60*1000)){
|
if(bb.getProduct()!=null && bb.getProduct().getGoodsType().equals("05") && (paymentDateTime > timestamp-7*24*60*60*1000)){
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
}else if(bb.getProduct()!=null && !bb.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals("1")){
|
}else if(bb.getProduct()!=null && !bb.getProduct().getGoodsType().equals("05") && b.getOrderStatus().equals("1") && bb.getExpressOrderId()==0){
|
||||||
refundableStatusProduct = true;
|
refundableStatusProduct = true;
|
||||||
}
|
}
|
||||||
refundableStatusArr[i] = refundableStatusProduct;
|
refundableStatusArr[i] = refundableStatusProduct;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.peanut.modules.common.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.common.dao.CourseMedicineDao;
|
||||||
|
import com.peanut.modules.common.dao.CourseToMedicineDao;
|
||||||
|
import com.peanut.modules.common.entity.CourseMedicine;
|
||||||
|
import com.peanut.modules.common.entity.CourseToMedicine;
|
||||||
|
import com.peanut.modules.common.service.CourseMedicineService;
|
||||||
|
import com.peanut.modules.common.service.CourseToMedicineService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("commonCourseMedicineService")
|
||||||
|
public class CourseMedicineServiceImpl extends ServiceImpl<CourseMedicineDao, CourseMedicine> implements CourseMedicineService {
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.peanut.modules.sociology.service.impl;
|
package com.peanut.modules.sociology.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
@@ -10,9 +11,12 @@ import com.peanut.common.utils.ShiroUtils;
|
|||||||
import com.peanut.modules.book.service.ShopProductService;
|
import com.peanut.modules.book.service.ShopProductService;
|
||||||
import com.peanut.modules.common.dao.*;
|
import com.peanut.modules.common.dao.*;
|
||||||
import com.peanut.modules.common.entity.*;
|
import com.peanut.modules.common.entity.*;
|
||||||
|
import com.peanut.modules.common.service.CourseMedicineService;
|
||||||
|
import com.peanut.modules.common.service.CourseToMedicineService;
|
||||||
import com.peanut.modules.common.service.MyUserService;
|
import com.peanut.modules.common.service.MyUserService;
|
||||||
import com.peanut.modules.common.service.UserVipService;
|
import com.peanut.modules.common.service.UserVipService;
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
|
import com.peanut.modules.master.service.CourseMedicalService;
|
||||||
import com.peanut.modules.sociology.service.CourseService;
|
import com.peanut.modules.sociology.service.CourseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -52,6 +56,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
private UserVipDao userVipDao;
|
private UserVipDao userVipDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCourseBuyLogDao userCourseBuyLogDao;
|
private UserCourseBuyLogDao userCourseBuyLogDao;
|
||||||
|
@Autowired
|
||||||
|
private CourseToMedicineService courseToMedicineService;
|
||||||
|
@Autowired
|
||||||
|
private CourseMedicineService courseMedicineService;
|
||||||
|
|
||||||
|
|
||||||
//根据标签获取课程列表
|
//根据标签获取课程列表
|
||||||
@@ -117,7 +125,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), CourseEntity.class, wrapper);
|
||||||
return courseEntityPage;
|
return courseEntityPage;
|
||||||
}
|
}
|
||||||
|
public CourseMedicine getCourseMedicinePid(int medicineId){
|
||||||
|
CourseMedicine courseMedicine = courseMedicineService.getById(medicineId);
|
||||||
|
if(courseMedicine.getPid()==0){
|
||||||
|
return courseMedicine;
|
||||||
|
}else{
|
||||||
|
return getCourseMedicinePid(courseMedicine.getPid());
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getCourseDetail(Integer id) {
|
public Map<String, Object> getCourseDetail(Integer id) {
|
||||||
Map<String, Object> flag = new HashMap<>();
|
Map<String, Object> flag = new HashMap<>();
|
||||||
@@ -163,6 +178,26 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QueryWrapper<CourseToMedicine> courseToMedicineWrapper = new QueryWrapper<CourseToMedicine>();
|
||||||
|
courseToMedicineWrapper.eq("course_id",course.getId());
|
||||||
|
List<CourseToMedicine> courseToMedicineList = courseToMedicineService.list(courseToMedicineWrapper);
|
||||||
|
String content = course.getContent();
|
||||||
|
List<Integer> medicinePids = new ArrayList<>();
|
||||||
|
for (CourseToMedicine courseToMedicine:courseToMedicineList){
|
||||||
|
CourseMedicine courseMedicine = getCourseMedicinePid(courseToMedicine.getMedicalId());
|
||||||
|
if(medicinePids.contains(courseMedicine.getId())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(courseMedicine!=null && courseMedicine.getId()==1){
|
||||||
|
content = content+"<img src=\"https://ehh-public-01.oss-cn-beijing.aliyuncs.com/image/zhong-yi-xue-ke-cheng-biao.jpg\"/>";
|
||||||
|
}else if(courseMedicine!=null && courseMedicine.getId()==74){
|
||||||
|
content = content+"<img src=\"https://ehh-public-01.oss-cn-beijing.aliyuncs.com/image/hui-tong-ke-cheng-biao.jpg\"/>";
|
||||||
|
}
|
||||||
|
if(courseMedicine!=null){
|
||||||
|
medicinePids.add(courseMedicine.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
course.setContent(content);
|
||||||
flag.put("course",course);
|
flag.put("course",course);
|
||||||
//课程关联商品
|
//课程关联商品
|
||||||
if (StringUtils.isNotEmpty(course.getRelationProductIds())){
|
if (StringUtils.isNotEmpty(course.getRelationProductIds())){
|
||||||
|
|||||||
Reference in New Issue
Block a user