Bläddra i källkod

问诊功能修改

15376779826 4 veckor sedan
förälder
incheckning
cbd1517820

+ 10 - 10
fs-service/src/main/java/com/fs/core/utils/OrderCodeUtils.java

@@ -44,16 +44,16 @@ public class OrderCodeUtils {
 
     }
     public static String getOrderSn(){
-        String url= FSConfig.getCommonApi()+ "/app/common/genOrderCode";
-//        String url= "42.194.245.189:8010/app/common/genOrderCode";
-        String json = HttpRequest.get(url)
-                .execute().body();
-        OrderCodeVO vo= JSONUtil.toBean(json, OrderCodeVO.class);
-        if(vo.getCode()==200){
-            return vo.getOrderCode();
-        }
-        else return null;
-
+//        String url= FSConfig.getCommonApi()+ "/app/common/genOrderCode";
+////        String url= "42.194.245.189:8010/app/common/genOrderCode";
+//        String json = HttpRequest.get(url)
+//                .execute().body();
+//        OrderCodeVO vo= JSONUtil.toBean(json, OrderCodeVO.class);
+//        if(vo.getCode()==200){
+//            return vo.getOrderCode();
+//        }
+//        else return null;
+        return genOrderSn();
     }
 
     public static String getH5RedPacketOrderSn(){

+ 18 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPrescribeMapper.java

@@ -2,6 +2,7 @@ package com.fs.his.mapper;
 
 import java.util.List;
 import com.fs.his.domain.FsPrescribe;
+import com.fs.his.param.FsPrescribeListDCompanyParam;
 import com.fs.his.param.FsPrescribeListDParam;
 import com.fs.his.param.FsPrescribeListUParam;
 import com.fs.his.param.FsPrescribeParam;
@@ -134,6 +135,23 @@ public interface FsPrescribeMapper
             "</script>"})
     List<FsPrescribeListUVO> selectFsPrescribeListUVO(@Param("maps")FsPrescribeListUParam param);
 
+    @Select({"<script> " +
+            "select p.*  from fs_prescribe p " +
+            "where 1=1  " +
+            "<if test = 'maps.status != null    '> " +
+            "and p.status = #{maps.status} " +
+            "</if>" +
+            "<if test = ' maps.patientName!=null and maps.patientName != \"\"  '> " +
+            "and p.patient_name like concat('%', #{maps.patientName}, '%') " +
+            "</if>" +
+            "<if test = ' maps.prescribeType!=null and maps.prescribeType != \"\"  '> " +
+            "and p.prescribe_type = #{maps.prescribeType} " +
+            "</if>" +
+            " order by p.create_time desc "+
+            "</script>"})
+    List<FsPrescribeListDVO> selectFsPrescribeListUVOByCompanyUser(@Param("maps") FsPrescribeListDCompanyParam param);
+
+
 
     @Select("select so.*,ffff.doctor_name prescribeDoctorName, us.nick_name ,dc.doctor_name,dp.doctor_name doctor_drug_name,fso.order_code,fso.`status` order_status,fse.store_name FROM fs_prescribe so  LEFT JOIN fs_user us ON us.user_id=so.user_id LEFT JOIN fs_doctor dc ON dc.doctor_id = so.doctor_id LEFT JOIN fs_doctor dp ON dp.doctor_id =so.drug_doctor_id LEFT JOIN fs_store_order fso ON fso.order_id = so.store_order_id LEFT JOIN fs_store fse ON fse.store_id = so.store_id  LEFT JOIN fs_doctor ffff ON ffff.doctor_id=so.prescribe_doctor_id  where so.prescribe_id=#{prescribeId}")
     FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);

+ 27 - 0
fs-service/src/main/java/com/fs/his/param/FsPrescribeListDCompanyParam.java

@@ -0,0 +1,27 @@
+package com.fs.his.param;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class FsPrescribeListDCompanyParam  extends BaseParam implements Serializable {
+
+    Long doctorId;
+    Long doctorDrugId;
+    Integer status;//1待审核 2历史订单
+    Integer type;//1医生 2药师
+    String patientName;
+    String prescribeCode;
+    Integer prescribeType;
+    Long companyUserId;
+
+    /** 开始时间 */
+    @JsonIgnore
+    private String beginTime;
+    /** 结束时间 */
+    @JsonIgnore
+    private String endTime;
+
+
+}

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/FsPrescribeListDParam.java

@@ -17,6 +17,7 @@ public class FsPrescribeListDParam extends BaseParam implements Serializable {
     String patientName;
     String prescribeCode;
     Integer prescribeType;
+    Long companyUserId;
 
     /** 开始时间 */
     @JsonIgnore

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/FsPrescribeListUParam.java

@@ -8,4 +8,5 @@ import java.io.Serializable;
 public class FsPrescribeListUParam extends BaseParam implements Serializable {
     Long userId;
     Integer status;
+    String patientName;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsPrescribeService.java

@@ -104,4 +104,6 @@ public interface IFsPrescribeService
     List<Long> selectFsPrescribeByPrescribeIdByOrderType();
 
     void PrescribeStoreImg(Long id);
+
+    List<FsPrescribeListDVO> selectFsPrescribeListDVOByCompanyUser(FsPrescribeListDCompanyParam param);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsInquiryOrderServiceImpl.java

@@ -657,6 +657,9 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
                     }
                 }
             }
+            if(param.getDoctorId()!=null){
+                order.setDoctorId(param.getDoctorId());
+            }
             List<FsPriceDTO> price = configDTO.getPrices().stream().filter(x -> x.getType().equals(param.getOrderType())).collect(Collectors.toList());
             if(price!=null&&price.size()==1){
                 order.setMoney(price.get(0).getPrice());
@@ -815,6 +818,10 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
             fsInquiryOrderMapper.updateFsInquiryOrder(map);
             // 木易华康特殊处理(支付成功医生自动接单)
             if (CloudHostUtils.hasCloudHostName("木易华康")&&order.getDoctorId()!=null) {
+                Integer orderCount=fsInquiryOrderMapper.checkAcceptOrder(order.getDoctorId(),order.getUserId());
+                if(orderCount>0){
+                    return R.error("此医生正在为您服务,不能下单");
+                }
                 FsInquiryOrderReceiveParam fsInquiryOrderReceiveParam = new FsInquiryOrderReceiveParam();
                 fsInquiryOrderReceiveParam.setOrderId(order.getOrderId());
                 fsInquiryOrderReceiveParam.setDoctorId(order.getDoctorId());

+ 14 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeServiceImpl.java

@@ -952,4 +952,18 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
             pen.drawString(value,x,y);
         }
     }
+
+    @Override
+    public List<FsPrescribeListDVO> selectFsPrescribeListDVOByCompanyUser(FsPrescribeListDCompanyParam param) {
+        List<FsPrescribeListDVO> list=fsPrescribeMapper.selectFsPrescribeListUVOByCompanyUser(param);
+        for(FsPrescribeListDVO vo:list){
+            FsPrescribeDrug map=new FsPrescribeDrug();
+            map.setPrescribeId(vo.getPrescribeId());
+            vo.setDrugs(fsPrescribeDrugMapper.selectFsPrescribeDrugList(map));
+        }
+        return list;
+
+
+    }
+
 }

+ 0 - 6
fs-service/src/main/resources/application-common.yml

@@ -138,9 +138,3 @@ image:
   storage:
     local-path: C:\logoFile\logo.jpg
     server-path: C:\logoFile\logo.jpg
-
-openIM:
-  secret: openIM123
-  userID: imAdmin
-  url: https://web.im.fbylive.com/api
-  prefix:

+ 2 - 2
fs-service/src/main/resources/application-druid-myhk-test.yml

@@ -153,10 +153,10 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
-    url: https://web.im.fbylive.com/api
+    url: https://im.muyi88.com/api
 #是否使用新im
 im:
-    type: NONE
+    type: OPENIM
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: true
 

+ 2 - 2
fs-service/src/main/resources/application-druid-myhk.yml

@@ -153,10 +153,10 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
-    url: https://web.im.fbylive.com/api
+    url: https://im.muyi88.com/api
 #是否使用新im
 im:
-    type: NONE
+    type: OPENIM
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: true
 

+ 23 - 2
fs-user-app/src/main/java/com/fs/app/controller/CompanyUserController.java

@@ -11,6 +11,7 @@ import com.fs.app.param.FsBindCompanyUserParam;
 import com.fs.common.annotation.Log;
 import com.fs.common.config.FSConfig;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.exception.CustomException;
@@ -27,10 +28,15 @@ import com.fs.company.service.ICompanyUserCardService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.company.service.ICompanyUserUserService;
 import com.fs.fastgptApi.util.AudioUtils;
-import com.fs.his.param.FsCouponReceiveParam;
-import com.fs.his.param.FsHealthTongueUParam;
+import com.fs.his.param.*;
+import com.fs.his.service.IFsPrescribeService;
+import com.fs.his.vo.FsPrescribeListDVO;
+import com.fs.his.vo.FsPrescribeListUVO;
+import com.fs.his.vo.FsPrescribeListVO;
 import com.fs.system.oss.CloudStorageService;
 import com.fs.system.oss.OSSFactory;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.io.FileUtils;
@@ -65,6 +71,8 @@ public class CompanyUserController extends  AppBaseController {
     private CompanyUserMapper companyUserMapper;
     @Autowired
     private ICompanyUserUserService companyUserUserService;
+    @Autowired
+    private IFsPrescribeService fsPrescribeService;
     @PostMapping("/login")
     public R Login(@RequestBody CompanyUserLoginParam param, HttpServletRequest request){
         try {
@@ -195,4 +203,17 @@ public class CompanyUserController extends  AppBaseController {
         return R.ok().put("data",WxaCode);
     }
 
+    @Login
+    @GetMapping("/getPrescribeList")
+    public R getPrescribeList(FsPrescribeListDCompanyParam param)
+    {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setCompanyUserId(getCompanyUserId());
+        param.setStatus(1);
+        List<FsPrescribeListDVO> list=fsPrescribeService.selectFsPrescribeListDVOByCompanyUser(param);
+        PageInfo<FsPrescribeListDVO> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo);
+    }
+
+
 }

+ 5 - 4
fs-user-app/src/main/java/com/fs/app/controller/PrescribeController.java

@@ -61,12 +61,13 @@ public class PrescribeController extends  AppBaseController {
 
     @Login
     @GetMapping("/getPrescribeById")
-    public R getPrescribeById(@RequestParam("prescribeId")Long prescribeId)
+    public R getPrescribeById(@RequestParam("prescribeId")Long prescribeId,
+    @RequestParam(value = "isCompanyUser", required = false, defaultValue = "0") Integer isCompanyUser)
     {
         FsPrescribe prescribe=prescribeService.selectFsPrescribeByPrescribeId(prescribeId);
-//        if(!prescribe.getUserId().equals(Long.parseLong(getUserId()))){
-//            return R.error("非法操作");
-//        }
+        if(prescribe!=null&&!prescribe.getUserId().equals(Long.parseLong(getUserId()))&&isCompanyUser == 0){
+            return R.error("非本人处方单");
+        }
 
         if(prescribe!=null&& StringUtils.isNotEmpty(prescribe.getPatientTel())){
             prescribe.setPatientTel(ParseUtils.parsePhone(prescribe.getPatientTel()));