Explorar o código

店铺商品查询展示,处理首页异常问题

yjwang hai 13 horas
pai
achega
1754460081

+ 0 - 3
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java

@@ -263,9 +263,6 @@ public class FsStoreOrderScrmController extends BaseController {
         List<FsStoreOrderExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
         //对手机号脱敏
         if (list != null) {
-            //获取当前账号角色权限
-            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-
             for (FsStoreOrderExportVO vo : list) {
                 if (vo.getPhone() != null) {
                     vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));

+ 7 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java

@@ -301,4 +301,11 @@ public interface IFsStoreOrderScrmService
      * @return Integer
      * **/
     Map<Long, Long> batchGetPrescriptionDrugCount(List<Long> orderIds);
+
+    /**
+     * 获取订单开方信息
+     * @param orderId 订单ID
+     * @return R
+     * **/
+    R orderPrescription(Long orderId,Long userId);
 }

+ 34 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -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"));

+ 21 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderPrescriptionVo.java

@@ -0,0 +1,21 @@
+package com.fs.hisStore.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 订单开方信息状态实体类
+ * **/
+@Data
+public class FsStoreOrderPrescriptionVo implements Serializable {
+    /**
+     * 状态 0未开放,跳转填写信息界面。 1开方中,跳转医生开方界面 2开方完成,跳转到支付
+     * **/
+    private Integer status;
+
+    /**
+     * 跳转链接
+     * **/
+    private String jumpLink;
+}

+ 5 - 3
fs-service/src/main/java/com/fs/system/service/impl/SysDeptServiceImpl.java

@@ -53,9 +53,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
     @DataScope(deptAlias = "d")
     public List<SysDept> selectDeptList(SysDept dept) {
         List<SysDept> list = deptMapper.selectDeptList(dept);
-        List<SysDeptConfig> configList = sysDeptConfigMapper.selectList(new QueryWrapper<SysDeptConfig>().in("dept_id", PubFun.listToNewList(list, SysDept::getDeptId)));
-        Map<Long, SysDeptConfig> deptConfig = PubFun.listToMapByGroupObject(configList, SysDeptConfig::getDeptId);
-        list.stream().filter(e -> deptConfig.containsKey(e.getDeptId())).forEach(e -> e.setDeptConfig(deptConfig.get(e.getDeptId())));
+        if(!list.isEmpty()){
+            List<SysDeptConfig> configList = sysDeptConfigMapper.selectList(new QueryWrapper<SysDeptConfig>().in("dept_id", PubFun.listToNewList(list, SysDept::getDeptId)));
+            Map<Long, SysDeptConfig> deptConfig = PubFun.listToMapByGroupObject(configList, SysDeptConfig::getDeptId);
+            list.stream().filter(e -> deptConfig.containsKey(e.getDeptId())).forEach(e -> e.setDeptConfig(deptConfig.get(e.getDeptId())));
+        }
         return list;
     }
 

+ 13 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -1486,4 +1486,17 @@ public class StoreOrderScrmController extends AppBaseController {
 //        }
         return null;
     }
+
+    /**
+     * 获取订单开方信息
+     * @param orderId 订单ID
+     * @return R
+     * **/
+    @GetMapping("/orderPrescription/{orderId}")
+    public R orderPrescription(@PathVariable("orderId") Long orderId){
+        if(orderId == null){
+            return R.error("操作失败,订单关键信息不能为空!");
+        }
+        return orderService.orderPrescription(orderId,Long.parseLong(getUserId()));
+    }
 }