ct 5 дней назад
Родитель
Сommit
62c171b253

+ 1 - 6
fs-doctor-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

@@ -2,11 +2,8 @@ package com.fs.app.controller;
 
 import com.fs.common.core.domain.R;
 import com.fs.his.domain.FsUserInformationCollection;
-import com.fs.his.dto.FsUserInformationCollectionDTO;
-import com.fs.his.param.CollectionInfoConfirmParam;
 import com.fs.his.param.UserInformationDoctorType2Param;
 import com.fs.his.service.IFsUserInformationCollectionService;
-import com.fs.his.vo.FsInquiryOrderListPDVO;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,10 +18,8 @@ public class FsUserInformationCollectionController extends  AppBaseController {
     private IFsUserInformationCollectionService fsUserInformationCollectionService;
     @GetMapping("/getUserInformation")
     public R getUserInformation(@RequestParam("id") Long id) {
-        FsUserInformationCollectionDTO fsUserInformationCollection = fsUserInformationCollectionService.selectFsUserInformationCollectionDTOById(id);
 
-
-        return R.ok().put("data", fsUserInformationCollection);
+        return R.ok().put("data", fsUserInformationCollectionService.selectFsUserInformationCollectionVoById(id));
     }
     //医生确认
     @PostMapping("/doctorConfirm")

+ 4 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/df/DfClient.java

@@ -85,6 +85,10 @@ public class DfClient {
 
 	public String execute(RequestUrlEnum request, Map<String, Object> params,Long dfAccountId) throws IOException {
 		FsDfAccount dfAccount = fsDfAccountMapper.selectFsDfAccountById(dfAccountId);
+		if (dfAccount == null){
+			log.error("未查询到代服账户,传参:请求={},参数-{},代服id-{}",JSON.toJSONString(request),JSON.toJSONString(params),dfAccountId);
+			return null;
+		}
 		String appkey = dfAccount.getDfAppKey();
 		String appsecret = dfAccount.getDfAppsecret();
 		String timestamp = String.valueOf(System.currentTimeMillis());

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

@@ -112,4 +112,6 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     FsUserInformationCollectionDTO selectFsUserInformationCollectionDTOById(Long id);
 
     int updatePackageOrderCode(FsUserInformationCollection fsUserInformationCollection);
+
+    FsUserInformationCollectionAndPatientVO selectFsUserInformationCollectionVoById(Long id);
 }

+ 20 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -60,6 +60,7 @@ import com.fs.huifuPay.sdk.opps.core.utils.HuiFuUtils;
 import com.fs.huifuPay.service.HuiFuService;
 import com.fs.im.dto.*;
 import com.fs.im.service.IImService;
+import com.fs.im.service.OpenIMService;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwExternalContactMapper;
@@ -293,6 +294,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
     @Autowired
     private com.fs.gtPush.service.uniPush2Service uniPush2Service;
 
+    @Autowired
+    private FsUserInformationCollectionMapper fsUserInformationCollectionMapper;
+    @Autowired
+    private OpenIMService openIMService;
+
     //ERP 类型到服务的映射
     private Map<Integer, IErpOrderService> erpServiceMap;
 
@@ -1036,6 +1042,20 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         }
 
         if (fsStoreOrderMapper.insertFsStoreOrder(order) > 0) {
+            try {
+                //信息采集 发送药师im
+                FsUserInformationCollection fsUserInformationCollectionParam = new FsUserInformationCollection();
+                fsUserInformationCollectionParam.setPackageOrderId(packageOrder.getOrderId());
+                fsUserInformationCollectionParam.setPackageOrderCode(packageOrder.getOrderSn());
+                List<FsUserInformationCollection> fsUserInformationCollections = fsUserInformationCollectionMapper.selectFsUserInformationCollectionList(fsUserInformationCollectionParam);
+                if (!fsUserInformationCollections.isEmpty()) {
+                    for (FsUserInformationCollection collection : fsUserInformationCollections) {
+                        openIMService.sendUserInformation(collection.getUserId(),collection.getDoctorType2Id(),collection.getId());
+                    }
+                }
+            } catch (Exception e) {
+                log.error("信息采集 通知药师发送失败:{}",e.getMessage());
+            }
             if (packageOrder.getCycle() >= followRate) {
                 FsFollow fsFollow = new FsFollow();
                 fsFollow.setTempId(FollowTempId + 0L);

+ 36 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -25,6 +25,7 @@ import com.fs.core.utils.OrderCodeUtils;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.*;
 import com.fs.his.dto.FsUserInformationCollectionDTO;
+import com.fs.his.enums.FsPackageOrderStatusEnum;
 import com.fs.his.enums.FsStoreOrderStatusEnum;
 import com.fs.his.mapper.*;
 import com.fs.his.param.*;
@@ -59,6 +60,7 @@ import com.google.gson.Gson;
 import me.chanjar.weixin.common.error.WxErrorException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -131,6 +133,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
 
     @Autowired
     private FsPackageOrderMapper packageOrderMapper;
+    @Autowired
+    private FsPatientMapper fsPatientMapper;
 
     @Autowired
     private FsPrescribeMapper fsPrescribeMapper;
@@ -971,6 +975,38 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         return fsUserInformationCollectionMapper.updateFsUserInformationCollection(fsUserInformationCollection);
     }
 
+    @Override
+    public FsUserInformationCollectionAndPatientVO selectFsUserInformationCollectionVoById(Long id) {
+        FsUserInformationCollection info = baseMapper.selectFsUserInformationCollectionById(id);
+        FsUserInformationCollectionAndPatientVO vo = new FsUserInformationCollectionAndPatientVO();
+        BeanUtils.copyProperties(info, vo);
+        Long patientId = info.getPatientId();
+        if(patientId != null){
+            FsPatient fsPatient = fsPatientMapper.selectFsPatientByPatientId(patientId);
+            if (fsPatient != null){
+
+                vo.setPatientInfo(fsPatient);
+                //查询是否支付
+                Integer isPay = 0;
+                Long packageOrderId = info.getPackageOrderId();
+                if (packageOrderId != null){
+                    FsPackageOrder order = packageOrderMapper.selectFsPackageOrderByOrderId(packageOrderId);
+                    if (order != null && order.getStatus() > 1){
+                        isPay = 1;
+                        vo.setStoreOrderId(order.getStoreOrderId());
+                        Integer status = order.getStatus();
+                        vo.setOrderStatus(FsPackageOrderStatusEnum.toType(status).getDesc()); //订单状态
+                        vo.setPackageJson(order.getPackageJson());
+                    }
+                }
+                vo.setIsPay(isPay);
+            }
+        }
+        CompanyUser companyUser = companyUserMapper.selectCompanyUserById(info.getCompanyUserId());
+        info.setCompanyId(companyUser.getCompanyId());
+        return vo;
+    }
+
     private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
         target.addAll(source);
         return target.stream()

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

@@ -15,6 +15,8 @@ public class FsUserInformationCollectionAndPatientVO extends FsUserInformationCo
     private FsPatient patientInfo; //病人信息
     private Integer isPay;
     private Long storeOrderId;
+    private String orderStatus;
+    private String packageJson;
 
 
 }

+ 1 - 1
fs-service/src/main/resources/mapper/his/FsUserInformationCollectionMapper.xml

@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="maps.doctorType2Confirm != null"> and fui.doctor_type2_confirm = #{maps.doctorType2Confirm}</if>
                 <if test="maps.packageOrderCode != null  and maps.packageOrderCode != ''"> and fui.package_order_code = #{maps.packageOrderCode}</if>
             </where>
-
+        order by id desc
     </select>
     <select id="selectFsUserInformationCollectionByDoctorType1"
             resultType="com.fs.his.domain.FsUserInformationCollection">

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

@@ -37,10 +37,7 @@ import com.fs.fastgptApi.vo.AudioVO;
 import com.fs.his.domain.FsPatient;
 import com.fs.his.domain.FsUserInformationCollection;
 import com.fs.his.param.*;
-import com.fs.his.service.IFsPatientService;
-import com.fs.his.service.IFsPrescribeService;
-import com.fs.his.service.IFsQuestionAndAnswerService;
-import com.fs.his.service.IFsUserInformationCollectionService;
+import com.fs.his.service.*;
 import com.fs.his.vo.*;
 import com.fs.sop.domain.QwSopTempVoice;
 import com.fs.sop.service.IQwSopTempVoiceService;
@@ -98,8 +95,6 @@ public class CompanyUserController extends  AppBaseController {
     private IFsUserInformationCollectionService fsUserInformationCollectionService;
     @Autowired
     private IFsQuestionAndAnswerService fsQuestionAndAnswerService;
-    @Autowired
-    private IFsPatientService fsPatientService;
 
     public static final String SOP_TEMP_VOICE_KEY = "sop:tempVoice";
     @PostMapping("/login")
@@ -430,18 +425,7 @@ public class CompanyUserController extends  AppBaseController {
     @GetMapping(value = "/informationCollection/{id}")
     public R getInformationCollectionInfo(@PathVariable("id") Long id)
     {
-        FsUserInformationCollection info = fsUserInformationCollectionService.selectFsUserInformationCollectionById(id);
-        Long patientId = info.getPatientId();
-        if(patientId != null){
-            FsPatient fsPatient = fsPatientService.selectFsPatientByPatientId(patientId);
-            if (fsPatient != null){
-                FsUserInformationCollectionAndPatientVO vo = new FsUserInformationCollectionAndPatientVO();
-                BeanUtils.copyProperties(info, vo);
-                vo.setPatientInfo(fsPatient);
-                return R.ok().put("data", vo);
-            }
-        }
-        return R.ok().put("data",info);
+        return R.ok().put("data", fsUserInformationCollectionService.selectFsUserInformationCollectionVoById(id));
     }
 
     /**

+ 5 - 38
fs-user-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

@@ -35,12 +35,6 @@ public class FsUserInformationCollectionController extends AppBaseController
 {
     @Autowired
     private IFsUserInformationCollectionService fsUserInformationCollectionService;
-    @Autowired
-    private IFsPatientService fsPatientService;
-    @Autowired
-    private ICompanyUserService companyUserService;
-    @Autowired
-    private IFsPackageOrderService fsPackageOrderService;
 
 
     /**
@@ -51,44 +45,17 @@ public class FsUserInformationCollectionController extends AppBaseController
     public R getInfo(@PathVariable("id") Long id)
     {
 
-        FsUserInformationCollection info = fsUserInformationCollectionService.selectFsUserInformationCollectionById(id);
-
-        if (info == null){
+        FsUserInformationCollectionAndPatientVO vo = fsUserInformationCollectionService.selectFsUserInformationCollectionVoById(id);
+        if (vo == null){
             return R.error("未查询到信息!");
         }
         String userId = getUserId();
-        if (info.getUserId() != Long.parseLong(userId)){
+        if (vo.getUserId() != Long.parseLong(userId)){
             return R.error("未查询您的采集信息!");
         }
-        if (info.getDoctorConfirm() == 0){
-            info.setPackageId(null);
-        }
-        CompanyUser companyUser = companyUserService.selectCompanyUserById(info.getCompanyUserId());
-        info.setCompanyId(companyUser.getCompanyId());
-        Long patientId = info.getPatientId();
-
-        FsUserInformationCollectionAndPatientVO vo = new FsUserInformationCollectionAndPatientVO();
-        BeanUtils.copyProperties(info, vo);
-
-        if(patientId != null){
-            FsPatient fsPatient = fsPatientService.selectFsPatientByPatientId(patientId);
-            if (fsPatient != null){
-
-                vo.setPatientInfo(fsPatient);
-                //查询是否支付
-                Integer isPay = 0;
-                Long packageOrderId = info.getPackageOrderId();
-                if (packageOrderId != null){
-                    FsPackageOrder order = fsPackageOrderService.selectFsPackageOrderByOrderId(packageOrderId);
-                    if (order != null && order.getStatus() > 1){
-                        isPay = 1;
-                        vo.setStoreOrderId(order.getStoreOrderId());
-                    }
-                }
-                vo.setIsPay(isPay);
-            }
+        if (vo.getDoctorConfirm() == 0){
+            vo.setPackageId(null);
         }
-
         return R.ok().put("data", vo);
     }