Bladeren bron

用户信息采集

15376779826 1 week geleden
bovenliggende
commit
85b868bef7

+ 8 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/InquiryOrderController.java

@@ -186,6 +186,14 @@ public class InquiryOrderController extends  AppBaseController {
         return inquiryOrderService.receiveOrder(param);
     }
 
+    @Login
+    @ApiOperation("接用户信息采集订单")
+    @PostMapping("/receiveInformationOrder")
+    public R receiveInformationOrder(@Validated @RequestBody FsInquiryOrderReceiveParam param, HttpServletRequest request) throws JsonProcessingException {
+        param.setDoctorId(Long.parseLong(getDoctorId()));
+        return inquiryOrderService.receiveOrder(param);
+    }
+
     @Login
     @ApiOperation("拒单")
     @PostMapping("/refuseOrder")

+ 38 - 1
fs-doctor-app/src/main/java/com/fs/app/controller/PrescribeController.java

@@ -41,6 +41,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 
 @Slf4j
@@ -374,7 +376,42 @@ public class PrescribeController extends  AppBaseController {
         //OpenImResponseDTO openImResponseDTO = openIMService.sendCourse(Long.parseLong(map.get("userId")), Long.parseLong(map.get("sendId")), "/pages/courseAnswer/index?link=1932017457275338752", "《五仙传医2.0》","https://cos.his.cdwjyyh.com/fs/20241108/a8ed49ae9a264c7483cec5bdcbcf6060.png");
         log.info("请求地址{}",IMConfig.URL);
 //        log.info("前缀{}",IMConfig.PREFIX);
-        //OpenImResponseDTO openImResponseDTO = openIMService.sendUtil("D" +map.get("sendId"), "U"+map.get("userId").toString(), 110, map.get("payloadDAata").toString(), "", map.get("title").toString(), "", "3135749",ex);
+        OpenImResponseDTO openImResponseDTO = openIMService.sendUserInformation(4050279479l,10086l,1l);
         return R.ok().put("data",null);
     }
+
+    @GetMapping("/getUserInformation")
+    public R getUserInformation(@RequestParam("id") Long id) {
+        Map<String, Object> data = new HashMap<String, Object>() {{
+            put("id", 1);
+            put("questionId", 1);
+            put("userId", 4050279479L);
+            put("jsonInfo", Stream.generate(() -> Collections.singletonMap("flag", false))
+                    .limit(6)
+                    .collect(Collectors.toList()));
+            put("userConfirm", 0);
+            put("doctorConfirm", 0);
+            put("createTime", "2025-11-21 18:27:10");
+            put("updateTime", null);
+            put("doctorId", 318);
+            put("companyUserId", 1);
+            put("packageId", 1);
+            put("payType", null);
+            put("amount", null);
+            put("userAdvice", null);
+            put("doctorAdvice", null);
+            put("isPackage", 1);
+            put("userConfirm2", 0);
+            put("packageOrderCode", null);
+            put("status", 1);
+            put("doctorConfirmTime", null);
+            put("sex", null);
+            put("userName", null);
+            put("userPhoneFour", null);
+            put("allergy", null);
+            put("remark", null);
+        }};
+
+        return R.ok().put("data", data);
+    }
 }

+ 10 - 0
fs-service/src/main/java/com/fs/his/domain/FsInquiryOrder.java

@@ -144,6 +144,16 @@ public class FsInquiryOrder extends BaseEntity
     private Integer source;//订单来源
 
     private Long triageUserId;
+    //是否信息采集生成的问诊订单1是0否
+    private Integer isUserInformation;
+
+    public Integer getIsUserInformation() {
+        return isUserInformation;
+    }
+
+    public void setIsUserInformation(Integer isUserInformation) {
+        this.isUserInformation = isUserInformation;
+    }
 
     public Long getTriageUserId() {
         return triageUserId;

+ 3 - 1
fs-service/src/main/java/com/fs/his/dto/PayloadDTO.java

@@ -1,5 +1,6 @@
 package com.fs.his.dto;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,6 +13,7 @@ public class PayloadDTO implements Serializable {
     private String description;
 
     @Data
+    @JsonInclude(JsonInclude.Include.NON_NULL)
     public static class Extension implements Serializable{
         private String title;
         private String patientName;
@@ -33,7 +35,7 @@ public class PayloadDTO implements Serializable {
         private Long companyId;
         private Long companyUserId;
         private Long doctorId;
-
+        private Long userInformationId;
     }
 
 }

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

@@ -1083,6 +1083,15 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
 
         return R.ok("抢单成功");
     }
+    //金牛发送用户信息采集数据
+    public void sendUserInformation(Long userId,Long doctorId){
+        //先查询当前用户待发送给当前医生的数据
+        //todo 待发送给当前医生的数据
+        //发送数据
+        openIMService.sendUserInformation(userId,doctorId,0l);
+
+    }
+
 
     @Override
     @Transactional
@@ -1125,6 +1134,10 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
 
             }
         }
+        //是用户信息采集的订单发送用户信息给医生
+        if (order.getIsUserInformation()==1){
+            sendUserInformation(order.getUserId(),order.getDoctorId());
+        }
         MsgDTO msgDTO=new MsgDTO();
         MsgCustomDTO customDTO=new MsgCustomDTO();
         customDTO.setType("startInquiry");

+ 2 - 0
fs-service/src/main/java/com/fs/im/dto/OpenImMsgDTO.java

@@ -1,5 +1,6 @@
 package com.fs.im.dto;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fs.his.dto.PayloadDTO;
 import lombok.Data;
 
@@ -23,6 +24,7 @@ public class OpenImMsgDTO {
 
 
     @Data
+    @JsonInclude(JsonInclude.Include.NON_NULL)
     public static class Content {
         private String content;
         private String data;

+ 3 - 0
fs-service/src/main/java/com/fs/im/service/OpenIMService.java

@@ -84,4 +84,7 @@ public interface OpenIMService {
 
     OpenImResponseDTO sendInquiryUtil(String sendID, String recvID, Integer contentType, String payloadData,String inquiryName,String type,Long companyId,Long companyUserId,String doctorId);
 
+
+    OpenImResponseDTO sendUserInformation(Long userId,Long doctorId,Long userInformationId);
+
 }

+ 37 - 0
fs-service/src/main/java/com/fs/im/service/impl/OpenIMServiceImpl.java

@@ -1575,4 +1575,41 @@ public class OpenIMServiceImpl implements OpenIMService {
             return null;
         }
     }
+
+    //发送用户信息采集数据
+    @Override
+    public OpenImResponseDTO sendUserInformation(Long userId,Long doctorId,Long userInformationId) {
+        try {
+            accountCheck("U"+userId,"1");
+        OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
+        ObjectMapper objectMapper = new ObjectMapper();
+        openImMsgDTO.setSendID("U"+userId);
+        openImMsgDTO.setRecvID("D"+doctorId);
+        //110为im的自定义消息类型
+        openImMsgDTO.setContentType(110);
+        openImMsgDTO.setSenderPlatformID(5);
+        openImMsgDTO.setSessionType(1);
+        OpenImMsgDTO.Content content = new OpenImMsgDTO.Content();
+        //content.setContent(ext);
+        PayloadDTO payload = new PayloadDTO();
+        payload.setDescription("userInformation");
+        payload.setData("userInformation");
+        PayloadDTO.Extension extension = new PayloadDTO.Extension();
+
+        extension.setDoctorId(doctorId);
+        extension.setUserInformationId(userInformationId);
+        payload.setExtension(extension);
+        OpenImMsgDTO.ImData imData = new OpenImMsgDTO.ImData();
+
+        imData.setPayload(payload);
+
+        String imJson = objectMapper.writeValueAsString(imData);
+        content.setData(imJson);
+        openImMsgDTO.setContent(content);
+        return openIMSendMsg(openImMsgDTO);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
 }

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

@@ -45,10 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="doctorRemark"    column="doctor_remark"    />
         <result property="source"    column="source"    />
         <result property="triageUserId"    column="triage_user_id"    />
+        <result property="isUserInformation"    column="is_user_information"    />
     </resultMap>
 
     <sql id="selectFsInquiryOrderVo">
-        select order_id,doctor_remark,source,triage_user_id, user_coupon_id,dept_id,company_deduct_money,company_id,company_user_id,company_user_remark,is_send_sms,package_order_id,discount_money, order_sn, title, imgs, user_id, patient_id, order_type, money, pay_money, pay_type, is_pay, doctor_id, create_time, pay_time, status, start_time, finish_time, remark, is_ping, department_id, inquiry_type, inquiry_sub_type, patient_json, is_receive, trade_no, is_audit, audit_user_id, audit_time from fs_inquiry_order
+        select order_id,doctor_remark,is_user_information,source,triage_user_id, user_coupon_id,dept_id,company_deduct_money,company_id,company_user_id,company_user_remark,is_send_sms,package_order_id,discount_money, order_sn, title, imgs, user_id, patient_id, order_type, money, pay_money, pay_type, is_pay, doctor_id, create_time, pay_time, status, start_time, finish_time, remark, is_ping, department_id, inquiry_type, inquiry_sub_type, patient_json, is_receive, trade_no, is_audit, audit_user_id, audit_time from fs_inquiry_order
     </sql>
 
     <select id="selectFsInquiryOrderList" parameterType="FsInquiryOrder" resultMap="FsInquiryOrderResult">
@@ -80,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditUserId != null "> and audit_user_id = #{auditUserId}</if>
             <if test="auditTime != null "> and audit_time = #{auditTime}</if>
             <if test="isSendSms != null "> and is_send_sms = #{isSendSms}</if>
+            <if test="isUserInformation != null "> and is_user_information = #{isUserInformation}</if>
         </where>
     </select>
 
@@ -130,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorRemark != null">doctor_remark,</if>
             <if test="source != null">source,</if>
             <if test="triageUserId != null">triage_user_id,</if>
+            <if test="isUserInformation != null">is_user_information,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderSn != null">#{orderSn},</if>
@@ -171,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorRemark != null">#{doctorRemark},</if>
             <if test="source != null">#{source},</if>
             <if test="triageUserId != null">#{triageUserId},</if>
+            <if test="isUserInformation != null">#{isUserInformation},</if>
          </trim>
     </insert>
 
@@ -216,6 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorRemark != null">doctor_remark = #{doctorRemark},</if>
             <if test="source != null">source = #{source},</if>
             <if test="triageUserId != null">triage_user_id = #{triageUserId},</if>
+            <if test="isUserInformation != null">is_user_information = #{isUserInformation},</if>
         </trim>
         where order_id = #{orderId}
     </update>