|
@@ -1,53 +1,30 @@
|
|
|
package com.fs.app.controller.store;
|
|
package com.fs.app.controller.store;
|
|
|
|
|
|
|
|
-import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
|
|
-import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
|
|
-import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
-import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.fs.app.annotation.Login;
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.app.controller.AppBaseController;
|
|
import com.fs.app.controller.AppBaseController;
|
|
|
-import com.fs.common.config.FSSysConfig;
|
|
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.*;
|
|
import com.fs.common.utils.*;
|
|
|
-import com.fs.common.utils.ip.IpUtils;
|
|
|
|
|
-import com.fs.core.config.WxMaConfiguration;
|
|
|
|
|
import com.fs.erp.service.IErpOrderService;
|
|
import com.fs.erp.service.IErpOrderService;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
import com.fs.his.config.FsSysConfig;
|
|
|
import com.fs.his.dto.ExpressInfoDTO;
|
|
import com.fs.his.dto.ExpressInfoDTO;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
-import com.fs.hisStore.config.FsErpConfig;
|
|
|
|
|
import com.fs.hisStore.domain.*;
|
|
import com.fs.hisStore.domain.*;
|
|
|
import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
|
|
import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
|
|
|
import com.fs.hisStore.enums.OrderInfoEnum;
|
|
import com.fs.hisStore.enums.OrderInfoEnum;
|
|
|
-import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
|
|
|
import com.fs.hisStore.param.*;
|
|
import com.fs.hisStore.param.*;
|
|
|
import com.fs.hisStore.service.*;
|
|
import com.fs.hisStore.service.*;
|
|
|
import com.fs.hisStore.vo.FsMyStoreOrderListQueryVO;
|
|
import com.fs.hisStore.vo.FsMyStoreOrderListQueryVO;
|
|
|
import com.fs.hisStore.vo.FsStoreOrderItemVO;
|
|
import com.fs.hisStore.vo.FsStoreOrderItemVO;
|
|
|
-import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
|
|
-import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
|
|
-import com.fs.huifuPay.service.HuiFuService;
|
|
|
|
|
-import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
|
|
|
-import com.fs.pay.service.IPayService;
|
|
|
|
|
import com.fs.store.config.StoreConfig;
|
|
import com.fs.store.config.StoreConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
-import com.fs.wx.miniapp.config.WxMaProperties;
|
|
|
|
|
-import com.fs.ybPay.domain.OrderResult;
|
|
|
|
|
-import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
|
|
|
|
-import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
|
|
|
|
-import com.github.binarywang.wxpay.config.WxPayConfig;
|
|
|
|
|
-import com.github.binarywang.wxpay.exception.WxPayException;
|
|
|
|
|
-import com.github.binarywang.wxpay.service.WxPayService;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
|
|
import org.redisson.api.RLock;
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -122,6 +99,10 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsExpressScrmService expressService;
|
|
private IFsExpressScrmService expressService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsStoreProductScrmService storeProductService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Login
|
|
@Login
|
|
|
@ApiOperation("获取我的订单列表")
|
|
@ApiOperation("获取我的订单列表")
|
|
@@ -591,4 +572,46 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Login
|
|
|
|
|
+ @ApiOperation("校验是否可继续下单")
|
|
|
|
|
+ @PostMapping("/checkContinue")
|
|
|
|
|
+ public R checkContinue(@RequestBody FsStoreOrderCheckContinueParam param){
|
|
|
|
|
+ String userId = getUserId();
|
|
|
|
|
+ String json = configService.selectConfigByKey("his.store");
|
|
|
|
|
+ com.fs.his.config.StoreConfig config = JSONUtil.toBean(json, com.fs.his.config.StoreConfig.class);
|
|
|
|
|
+ BigDecimal canPayPrice = config.getCanPayPrice();
|
|
|
|
|
+ BigDecimal yearPayPrice = config.getYearPayPrice();
|
|
|
|
|
+ if(canPayPrice==null||yearPayPrice==null){
|
|
|
|
|
+ return R.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+ String payPriceTip = config.getPayPriceTip();
|
|
|
|
|
+ BigDecimal totalMoney = BigDecimal.ZERO;
|
|
|
|
|
+ //查询用户本年内支付处方订单+公私域套餐包总金额 (类型 1:商品 2:套餐)
|
|
|
|
|
+ if (param.getType() == 1){
|
|
|
|
|
+ List<FsStoreOrderCheckContinueParam.ProductInfo> productInfos = param.getProductInfo();
|
|
|
|
|
+ if(productInfos==null|| productInfos.isEmpty()){
|
|
|
|
|
+ return R.error("缺少必要参数");
|
|
|
|
|
+ }
|
|
|
|
|
+ totalMoney = storeProductService.selectFsStoreProductTotalMoneyByIds(productInfos);
|
|
|
|
|
+ }else if (param.getType() == 2){
|
|
|
|
|
+ Long packageId = param.getPackageId();
|
|
|
|
|
+ if(packageId==null){
|
|
|
|
|
+ return R.error("缺少必要参数");
|
|
|
|
|
+ }
|
|
|
|
|
+ FsStoreProductPackageScrm packageScrm = productPackageService.selectFsStoreProductPackageById(packageId);
|
|
|
|
|
+ totalMoney = packageScrm.getPayMoney();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return R.error("类型不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ BigDecimal bigDecimal = orderService.selectPayPriceByYear(userId);
|
|
|
|
|
+ if(bigDecimal==null || totalMoney == null){
|
|
|
|
|
+ return R.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (bigDecimal.compareTo(yearPayPrice)>=0&&totalMoney.compareTo(canPayPrice)>=0){
|
|
|
|
|
+ return R.ok().put("tip",payPriceTip);
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|