Kaynağa Gözat

1.修改创建疗法制单参数 2.获取问答查询

wjj 3 hafta önce
ebeveyn
işleme
1f3cf4c6c9

+ 7 - 0
fs-service/src/main/java/com/fs/his/domain/FsPrescribe.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import com.vdurmont.emoji.EmojiParser;
+import lombok.Data;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -16,6 +17,7 @@ import java.util.Date;
  * @author fs
  * @date 2023-06-13
  */
+@Data
 public class FsPrescribe extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -168,6 +170,11 @@ public class FsPrescribe extends BaseEntity
 
     public Integer source;
 
+    /**
+     * 医生是否确认 0未确认 1已确认 -1其他系统
+     */
+    private Integer doctorConfirm;
+
 
     public String getPrescribeImgStoreUrl() {
         return prescribeImgStoreUrl;

+ 13 - 0
fs-service/src/main/java/com/fs/his/param/CreatePackageOrderParam.java

@@ -0,0 +1,13 @@
+package com.fs.his.param;
+
+import com.fs.his.domain.FsPatient;
+import lombok.Data;
+
+//疗法制单
+@Data
+public class CreatePackageOrderParam {
+    private String token;
+    private FsPatient patient;
+    private Long packageId;
+    private String jsonInfo;
+}

+ 2 - 1
fs-service/src/main/java/com/fs/his/service/IFsPackageOrderService.java

@@ -7,6 +7,7 @@ import com.fs.common.core.domain.R;
 import com.fs.company.domain.CompanyUser;
 import com.fs.his.domain.FsPackage;
 import com.fs.his.domain.FsPackageOrder;
+import com.fs.his.domain.FsPatient;
 import com.fs.his.domain.FsStorePayment;
 import com.fs.his.dto.PackageOrderDTO;
 import com.fs.his.param.*;
@@ -129,7 +130,7 @@ public interface IFsPackageOrderService
     /**
      * 套餐包制单
      */
-    R createPackageOrder(CompanyUser companyUser,Long packageId);
+    R createPackageOrder(CompanyUser companyUser, Long packageId, FsPatient patient,String json);
 
     /**
      * 更新套餐订单金额

+ 6 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java

@@ -1751,7 +1751,7 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
     }
 
     @Override
-    public R createPackageOrder(CompanyUser companyUser, Long packageId) {
+    public R createPackageOrder(CompanyUser companyUser, Long packageId,FsPatient patient,String json) {
         FsPackage fsPackage=fsPackageMapper.selectFsPackageByPackageId(packageId);
         if(fsPackage==null){
             return R.error("套餐不存在");
@@ -1763,6 +1763,8 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
         String uuid = IdUtil.randomUUID();
         redisCache.setCacheObject("createPackageOrderKey:" + uuid, companyUser.getCompanyId() + "-" + companyUser.getUserId(), 24, TimeUnit.HOURS);
         redisCache.setCacheObject("package:" + uuid, fsPackage, 24, TimeUnit.HOURS);
+        redisCache.setCacheObject("json:" + uuid, json, 24, TimeUnit.HOURS);
+        redisCache.setCacheObject("patient:" + uuid, patient, 24, TimeUnit.HOURS);
         BigDecimal price = fsPackage.getTotalPrice();
         if (price == null){
             price = BigDecimal.ZERO;
@@ -1810,11 +1812,13 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
             throw new CustomException("套餐包订单已过期", 501);
         }
         FsPackage fsPackage = redisCache.getCacheObject("package:" + createPackageOrderKey);
+        String json = redisCache.getCacheObject("json:" + createPackageOrderKey);
+        FsPatient fsPatient = redisCache.getCacheObject("patient:" + createPackageOrderKey);
         BigDecimal money = redisCache.getCacheObject("createPackageOrderMoney:" + createPackageOrderKey);
         Integer payType = redisCache.getCacheObject("createPackageOrderPayType:" + createPackageOrderKey);
         if (payType != null && payType == 2) {
             money = redisCache.getCacheObject("createPackageOrderAmount:" + createPackageOrderKey);
         }
-        return R.ok().put("package", fsPackage).put("money", money).put("payType", payType);
+        return R.ok().put("package", fsPackage).put("money", money).put("payType", payType).put("jsonInfo",json).put("fsPatient",fsPatient);
     }
 }

+ 4 - 3
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1630,9 +1630,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 Long doctorID = iFsDoctorService.selectFsDoctorDoctorByPackage();
                 packageOrder.setDoctorId(doctorID);
             }
-            if (packageSubType == 3 ) {
-                inquiryOrderService.createOrderByPackageOrderStatus4(packageOrder);
-            }
+//            if (packageSubType == 3 ) {
+//                inquiryOrderService.createOrderByPackageOrderStatus4(packageOrder);
+//            }
             prescribeId = fsPrescribeService.insertFsPrescribeByPackageOrder(packageOrder);
             order.setPrescribeId(prescribeId);
         }
@@ -1831,6 +1831,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 FsPrescribe fsPrescribe = new FsPrescribe();
                 fsPrescribe.setPrescribeId(prescribeId);
                 fsPrescribe.setStoreOrderId(order.getOrderId());
+                fsPrescribe.setDoctorConfirm(0);
                 fsPrescribeService.updateFsPrescribe(fsPrescribe);
             }
 

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

@@ -48,10 +48,11 @@
         <result property="icdCode"    column="icd_code"    />
         <result property="source"    column="source"    />
         <result property="prescribeImgStoreUrl"    column="prescribe_img_store_url"    />
+        <result property="doctorConfirm"    column="doctor_confirm"    />
     </resultMap>
 
     <sql id="selectFsPrescribeVo">
-        select prescribe_id,prescribe_code_url,prescribe_img_store_url,source,cycle,icd_code,prescribe_type,recipe_type,patient_birthday,drug_doctor_sign_url,prescribe_doctor_id,doctor_sign_url,prescribe_doctor_sign_url, inquiry_order_id, store_order_id, user_id, patient_id, prescribe_code, patient_descs, now_illness, history_illness, patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, is_lactation, patient_tel, patient_gender, record_pic, prescribe_img_url, audit_reason, diagnose, doctor_id,drug_doctor_id, create_time, status, audit_time,remark,usage_json,store_id from fs_prescribe
+        select prescribe_id,prescribe_code_url,prescribe_img_store_url,source,cycle,icd_code,prescribe_type,recipe_type,patient_birthday,drug_doctor_sign_url,prescribe_doctor_id,doctor_sign_url,prescribe_doctor_sign_url, inquiry_order_id, store_order_id, user_id, patient_id, prescribe_code, patient_descs, now_illness, history_illness, patient_age, patient_name, weight, is_history_allergic, history_allergic, liver_unusual, renal_unusual, is_lactation, patient_tel, patient_gender, record_pic, prescribe_img_url, audit_reason, diagnose, doctor_id,drug_doctor_id, create_time, status, audit_time,remark,usage_json,store_id,doctor_confirm from fs_prescribe
     </sql>
 
     <select id="selectFsPrescribeList" parameterType="FsPrescribe" resultMap="FsPrescribeResult">
@@ -83,6 +84,7 @@
             <if test="doctorId != null  and doctorId != ''"> and doctor_id = #{doctorId}</if>
             <if test="status != null "> and status = #{status}</if>
             <if test="auditTime != null "> and audit_time = #{auditTime}</if>
+            <if test="doctorConfirm != null "> and doctor_confirm = #{doctorConfirm}</if>
         </where>
         order by prescribe_id desc
     </select>
@@ -137,6 +139,7 @@
             <if test="icdCode != null">icd_code,</if>
             <if test="source != null">source,</if>
             <if test="prescribeImgStoreUrl != null">prescribe_img_store_url,</if>
+            <if test="doctorConfirm != null">doctor_confirm,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="prescribeType != null">#{prescribeType},</if>
@@ -181,6 +184,7 @@
             <if test="icdCode != null">#{icdCode},</if>
             <if test="source != null">#{source},</if>
             <if test="prescribeImgStoreUrl != null">#{prescribeImgStoreUrl},</if>
+            <if test="doctorConfirm != null">#{doctorConfirm},</if>
         </trim>
     </insert>
 
@@ -229,6 +233,7 @@
             <if test="icdCode != null">icd_code = #{icdCode},</if>
             <if test="source != null">source = #{source},</if>
             <if test="prescribeImgStoreUrl != null">prescribe_img_store_url = #{prescribeImgStoreUrl},</if>
+            <if test="doctorConfirm != null">doctor_confirm = #{doctorConfirm},</if>
         </trim>
         where prescribe_id = #{prescribeId}
     </update>

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

@@ -242,11 +242,10 @@ public class PackageOrderController extends  AppBaseController {
 
     @Login
     @ApiOperation("套餐包分享制单")
-    @GetMapping("/createPackageOrder")
-    public R createSalesOrder(@RequestParam("token")String token,
-                              @RequestParam("packageId")Long packageId,
+    @PostMapping("/createPackageOrder")
+    public R createPackageOrder(@RequestBody CreatePackageOrderParam param,
                               HttpServletRequest request){
-        Long userId=redisCache.getCacheObject("company-user-token:"+token);
+        Long userId=redisCache.getCacheObject("company-user-token:"+param.getToken());
         if(userId==null){
             return R.error(403,"用户失效");
         }
@@ -257,7 +256,7 @@ public class PackageOrderController extends  AppBaseController {
         if(!companyUser.getStatus().equals("0")){
             return R.error("用户已禁用");
         }
-        return packageOrderService.createPackageOrder(companyUser,packageId);
+        return packageOrderService.createPackageOrder(companyUser,param.getPackageId(),param.getPatient(),param.getJsonInfo());
     }
 
     @ApiOperation("改价")

+ 30 - 0
fs-user-app/src/main/java/com/fs/app/controller/QuestionAndAnswerController.java

@@ -0,0 +1,30 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.his.service.IFsQuestionAndAnswerService;
+import com.fs.his.vo.FsQuestionAndAnswerVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api("问答")
+@RestController
+@RequestMapping(value="/app/answer")
+public class QuestionAndAnswerController {
+
+    @Autowired
+    private IFsQuestionAndAnswerService questionAndAnswerService;
+
+    @Login
+    @ApiOperation("问答信息")
+    @GetMapping("/getInfo")
+    public R getInfo(@RequestParam("questionId") Long questionId) {
+        FsQuestionAndAnswerVO vo = questionAndAnswerService.selectFsQuestionAndAnswerById(questionId);
+        return R.ok().put("data", vo);
+    }
+}