|
@@ -11,6 +11,7 @@ import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fs.api.param.OrderListParam;
|
|
|
import com.fs.api.vo.OrderListVO;
|
|
|
import com.fs.api.vo.ProductListVO;
|
|
@@ -68,6 +69,8 @@ import com.fs.hisapi.domain.ApiResponse;
|
|
|
import com.fs.hisapi.param.CreateOrderParam;
|
|
|
import com.fs.hisapi.param.RecipeDetailParam;
|
|
|
import com.fs.hisapi.service.HisApiService;
|
|
|
+import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
|
|
|
+import com.fs.hospital580.mapper.Hospital580PrescriptionScrmMapper;
|
|
|
import com.fs.huifuPay.domain.HuiFuRefundResult;
|
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
@@ -319,6 +322,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Autowired
|
|
|
private FsPackageOrderMapper fsPackageOrderMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Hospital580PrescriptionScrmMapper prescriptionScrmMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询订单
|
|
|
*
|
|
@@ -4192,6 +4198,34 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
return fsStoreOrderMapper.batchGetPrescriptionDrugCount(orderIds);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R orderPrescription(Long orderId, Long userId) {
|
|
|
+ FsStoreOrderPrescriptionVo orderPrescriptionVo = new FsStoreOrderPrescriptionVo();
|
|
|
+ orderPrescriptionVo.setStatus(0);//默认值
|
|
|
+ //获取订单信息
|
|
|
+ FsStoreOrderScrm orderScrm = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
|
+ if(orderScrm == null){
|
|
|
+ return R.error("获取失败,订单不存在!");
|
|
|
+ }else if(orderScrm.getIsPrescribe() == 0){
|
|
|
+ return R.error("获取失败,当前订单不属于处方药!");
|
|
|
+ }
|
|
|
+ //验证是否开方完成
|
|
|
+ if(orderScrm.getIsPrescribe() == 1 && orderScrm.getPrescribeId() == null){
|
|
|
+ //获取580开方信息
|
|
|
+ Hospital580PrescriptionScrmEntity prescription=prescriptionScrmMapper.selectOne(new LambdaQueryWrapper<Hospital580PrescriptionScrmEntity>()
|
|
|
+ .eq(Hospital580PrescriptionScrmEntity::getStoreOrderId,orderId)
|
|
|
+ .eq(Hospital580PrescriptionScrmEntity::getUserId,userId));
|
|
|
+ if(prescription != null){
|
|
|
+ orderPrescriptionVo.setStatus(1);
|
|
|
+ //获取链接
|
|
|
+ orderPrescriptionVo.setJumpLink(prescription.getJumpUrl());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ orderPrescriptionVo.setStatus(2);
|
|
|
+ }
|
|
|
+ return R.ok().put("data",orderPrescriptionVo);
|
|
|
+ }
|
|
|
+
|
|
|
private static final DateTimeFormatter CST_FORMATTER = DateTimeFormatter
|
|
|
.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US)
|
|
|
.withZone(ZoneId.of("Asia/Shanghai"));
|