Преглед изворни кода

修复"药食同源"bug+修复答题领红包无关联记录的问题

cgp пре 1 дан
родитељ
комит
80aae0eb82

+ 3 - 3
fs-admin/src/main/java/com/fs/his/controller/FsPrescribeDataScrmController.java

@@ -108,10 +108,10 @@ public class FsPrescribeDataScrmController extends BaseController
         }else {
             vo.setNotRecommendUse(Boolean.FALSE);
         }
-        if (prescribe.getDoctorConfirm()==-3){
-            vo.setNotRecommendUse(Boolean.TRUE);
+        if (prescribe.getDoctorConfirm()==2){
+            vo.setFoodAsMedicine(Boolean.TRUE);
         }else {
-            vo.setNotRecommendUse(Boolean.FALSE);
+            vo.setFoodAsMedicine(Boolean.FALSE);
         }
         return AjaxResult.success(vo);
     }

+ 5 - 0
fs-company/src/main/java/com/fs/company/controller/his/FsPrescribeDataScrmController.java

@@ -99,6 +99,11 @@ public class FsPrescribeDataScrmController extends BaseController
         }else {
             vo.setNotRecommendUse(Boolean.FALSE);
         }
+        if (prescribe.getDoctorConfirm()==2){
+            vo.setFoodAsMedicine(Boolean.TRUE);
+        }else {
+            vo.setFoodAsMedicine(Boolean.FALSE);
+        }
         return AjaxResult.success(vo);
     }
 

+ 24 - 0
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -458,6 +458,30 @@ public class FsCompanyCustomerController extends BaseController {
         return toAjax( result);
     }
 
+    /**
+     * 修改商城处方表的制单状态
+     * */
+    @PostMapping("/updateScrmPrescriptionDocumentSuccess")
+    public AjaxResult updateScrmPrescriptionDocumentSuccess(@RequestBody FsCompanyCustomer fsCompanyCustomer){
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        Long companyUserId = loginUser.getUser().getUserId();
+        if (companyUserId == null){
+            throw new CustomException("登录信息已过期,请重新登录");
+        }
+        FsCompanyCustomer companyCustomer = fsCompanyCustomerService.selectFsCompanyCustomerById(fsCompanyCustomer.getId());
+        if (companyCustomer == null){
+            return AjaxResult.error("未找到客户信息");
+        }
+        //重置客户信息表的流程状态为"待完善"
+        companyCustomer.setProcessStatus(0);
+        fsCompanyCustomerService.updateFsCompanyCustomer(companyCustomer);
+        FsPrescribeDataScrm fsPrescribeDataScrm=new FsPrescribeDataScrm();
+        fsPrescribeDataScrm.setPrescribeId(companyCustomer.getPrescribeId());
+        fsPrescribeDataScrm.setIsDocument(1);//1-销售已制单
+        int result=prescribeDataScrmService.updateFsPrescribeDataScrm(fsPrescribeDataScrm);
+        return toAjax( result);
+    }
+
     /**
      * 生成客户信息表制单二维码
      * */

+ 5 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeDataScrmController.java

@@ -160,6 +160,11 @@ public class FsPrescribeDataScrmController extends BaseController
         }else {
             vo.setNotRecommendUse(Boolean.FALSE);
         }
+        if (prescribe.getDoctorConfirm()==2){
+            vo.setFoodAsMedicine(Boolean.TRUE);
+        }else {
+            vo.setFoodAsMedicine(Boolean.FALSE);
+        }
         return AjaxResult.success(vo);
     }
 

+ 3 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -107,7 +107,7 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
     private static final Integer NOT_RECOMMEND_USE = 8;
 
     /**
-     * 不适合用
+     * 药食同源
      * */
     private static final Integer FOOD_AS_MEDICINE = 9;
 
@@ -297,7 +297,8 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
             updateCustomerStatus(fsPrescribeDataScrm.getPrescribeId(), NOT_RECOMMEND_USE);
         }else if (addDoctorAdviceDTO.getFoodAsMedicine() != null && addDoctorAdviceDTO.getFoodAsMedicine()){
             // 处理"药食同源"处方
-            fsPrescribeDataScrm.setDoctorConfirm(2);//药食同源
+            fsPrescribeDataScrm.setDoctorConfirm(2);//医生确认 可药食同源
+            fsPrescribeDataScrm.setStatus(1);//已完成
             // 更新客户信息表状态为"药食同源"
             updateCustomerStatus(fsPrescribeDataScrm.getPrescribeId(), FOOD_AS_MEDICINE);
         }

+ 5 - 0
fs-service/src/main/java/com/fs/his/vo/PrescribeScrmDoctorAdviceVO.java

@@ -13,4 +13,9 @@ public class PrescribeScrmDoctorAdviceVO {
      * 不建议使用 选中为true否则为false
      * */
     private Boolean notRecommendUse;
+
+    /**
+     * 药食同源 选中为true否则为false
+     * */
+    private Boolean foodAsMedicine;
 }

+ 6 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -914,6 +914,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             if (param.getCompanyCustomerId() != null) {
                 //预付金
                 if (param.getPayType().equals("5")) {
+                    if (param.getPrepaidAmount() == null){
+                        return R.error("支付方式为定金时,预付金额不能为空");
+                    }
                     boolean b = param.getPrepaidAmount().compareTo(storeOrder.getTotalPrice()) >= 0;
                     if (b) {
                         return R.error("定金不能大于等于订单总价");
@@ -1677,7 +1680,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             if (prescribeDataScrm == null){
                 return R.error("处方信息为空,制单失败");
             }
-            if (prescribeDataScrm.getStatus()!=1||prescribeDataScrm.getDoctorConfirm()!=1){
+            if (prescribeDataScrm.getDoctorConfirm() != null && prescribeDataScrm.getDoctorConfirm() == 2) {
+                // 不做任何拦截
+            } else if (prescribeDataScrm.getStatus()!=1||prescribeDataScrm.getDoctorConfirm()!=1){
                 return R.error("关联处方还在开方中,请稍后刷新页面重试");
             }
             //创建订单后,重置客户信息表的流程状态为"待完善"

+ 7 - 3
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -1152,9 +1152,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectAnswerWatchLog" resultMap="FsCourseWatchLogResult">
         SELECT *
-            FROM fs_course_watch_log
-            WHERE  log_type = 2  AND user_id = #{userId}
-        order by log_id desc limit 1
+        FROM fs_course_watch_log
+        WHERE log_type = 2
+        AND user_id = #{userId}
+        AND create_time &gt;= CURDATE()
+        AND create_time &lt; CURDATE() + INTERVAL 1 DAY
+        ORDER BY log_id DESC
+        LIMIT 1
     </select>
 
     <select id="selectFsCourseWatchLogIdByVideoIdAndExternalIdAndQwUserId"