|
|
@@ -1,6 +1,7 @@
|
|
|
package com.fs.app.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
@@ -15,6 +16,7 @@ import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.course.domain.FsUserCourseFavorite;
|
|
|
import com.fs.course.param.FsUserCourseFollowUParam;
|
|
|
+import com.fs.his.config.StoreConfig;
|
|
|
import com.fs.his.domain.*;
|
|
|
import com.fs.his.param.*;
|
|
|
import com.fs.his.service.*;
|
|
|
@@ -22,6 +24,7 @@ import com.fs.his.vo.FsDiseaseListUVO;
|
|
|
import com.fs.his.vo.FsDoctorListUVO;
|
|
|
import com.fs.his.vo.FsPackageDetailVO;
|
|
|
import com.fs.his.vo.FsPackageListUVO;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.jsonwebtoken.Claims;
|
|
|
@@ -40,6 +43,7 @@ import javax.imageio.ImageIO;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.net.URL;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -65,6 +69,11 @@ public class PackageController extends AppBaseController {
|
|
|
private ICompanyUserService companyUserService;
|
|
|
@Autowired
|
|
|
private ICompanyService companyService;
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService storeOrderService;
|
|
|
|
|
|
@ApiOperation("获取套餐分类")
|
|
|
@GetMapping("/getPackagCateList")
|
|
|
@@ -193,4 +202,28 @@ public class PackageController extends AppBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("校验是否可继续下单")
|
|
|
+ @GetMapping("/checkContinue/{packageId}")
|
|
|
+ public R checkContinue(@PathVariable("packageId") Long packageId){
|
|
|
+ String userId = getUserId();
|
|
|
+ String json = configService.selectConfigByKey("his.store");
|
|
|
+ StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
+ BigDecimal canPayPrice = config.getCanPayPrice();
|
|
|
+ BigDecimal yearPayPrice = config.getYearPayPrice();
|
|
|
+ if(canPayPrice==null||yearPayPrice==null){
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ String payPriceTip = config.getPayPriceTip();
|
|
|
+ //查询用户本年内支付处方订单+公私域套餐包总金额
|
|
|
+ FsPackage fsPackage = packageService.selectFsPackageByPackageId(packageId);
|
|
|
+ BigDecimal bigDecimal = storeOrderService.selectPayPriceByYear(userId);
|
|
|
+ if(bigDecimal==null){
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ if (bigDecimal.compareTo(yearPayPrice)>=0&&fsPackage.getTotalPrice().compareTo(canPayPrice)>=0){
|
|
|
+ return R.ok().put("tip",payPriceTip);
|
|
|
+ }
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
}
|