فهرست منبع

店铺提示优化

yjwang 1 هفته پیش
والد
کامیت
6f97ba3cd6

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java

@@ -473,4 +473,10 @@ public class FsStoreScrm extends BaseEntity {
     private String settlementAgreementFileName;
     private String qualityAssuranceAgreementFileName;
     private String otherSpecialQualificationFileName;
+
+    /**
+     * 到期天数
+     * **/
+    @TableField(exist = false)
+    private Integer remainDays;
 }

+ 3 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -325,6 +325,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         if(fsStore.getIsAudit() != null && fsStore.getIsAudit() == 1){
             updateStore.setQualificationUpdateTime(LocalDate.now());
         }
+        updateStore.setStatus(1);
         fsStoreMapper.updateFsStore(updateStore);
         //更新日志
         storeAuditLogUtil.addAudit(fsStore.getStoreId(), fsStore.getReason(), fsStore.getAttachImage());
@@ -479,12 +480,9 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
 
     @Override
     public R qualificationReminder(Long storeId) {
-        boolean check = false;
         FsStoreScrm storeScrm = fsStoreMapper.qualificationReminder(storeId);
         if (storeScrm != null) {
-            check = true;
-
-            if(storeScrm.getStatus().equals(1)){
+            if(storeScrm.getStatus().equals(1) && storeScrm.getRemainDays() < 0){
                 //更新店铺状态
                 FsStoreScrm fsStoreScrm =new FsStoreScrm();
                 fsStoreScrm.setStoreId(storeId);
@@ -492,7 +490,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
                 fsStoreMapper.updateFsStore(fsStoreScrm);
             }
         }
-        return R.ok().put("check",check);
+        return R.ok().put("data",storeScrm);
     }
 
     /**

+ 5 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -946,13 +946,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="qualificationReminder" resultType="com.fs.hisStore.domain.FsStoreScrm">
         SELECT
         store_id,
-        status
+        status,
+        TIMESTAMPDIFF(DAY, CURDATE(), DATE_ADD(qualification_update_time, INTERVAL 6 MONTH)) AS remain_days
         FROM
         fs_store_scrm
         WHERE
         store_id = #{storeId}
-        AND is_audit IN (- 1, 1 )
-        AND qualification_update_time &lt;= DATE_SUB(CURDATE() , INTERVAL 6 MONTH )
+        AND is_audit IN (-1, 1)
+        AND qualification_update_time IS NOT NULL
+        AND DATE_ADD(qualification_update_time, INTERVAL 6 MONTH) &lt;= DATE_ADD(CURDATE(), INTERVAL 30 DAY)
     </select>
 
     <select id="getStoreInfo" resultType="com.fs.hisStore.dto.FsStoreProductScrmInfoDTO">

+ 1 - 1
fs-service/src/main/resources/mapper/hospital580/Hospital580PrescriptionScrmMapper.xml

@@ -60,7 +60,7 @@
             fs_store_hospital580_prescription_scrm ps
                 LEFT JOIN fs_store_order_scrm sos ON ps.store_order_id = sos.id
         WHERE
-            TIMESTAMPDIFF(MINUTE, ps.create_time, NOW()) >= 4320
+            TIMESTAMPDIFF(HOUR, ps.create_time, NOW()) >= 72
           AND sos.`status` = 0
     </select>