Ver Fonte

修复药品上下架问题,展示不合理情况。

Guos há 3 dias atrás
pai
commit
eefa69c4d4

+ 1 - 1
README.md

@@ -1,7 +1,7 @@
 # his_java
 
 #### 介绍
-问诊平台
+医建宝分支
 
 #### 软件模块说明
 

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -203,6 +203,15 @@ public interface FsStoreProductScrmMapper
         "on FIND_IN_SET(p.product_id, uc.product_ids) " +
         "</if> " +
         "where 1=1 " +
+        //审核通过的才会展示到列表,防止主要商品列表中展示未审核商品
+        "<if test='maps.isAudit == null'>"+
+            "<if test='maps.isShow == 1'>" +
+                "and p.is_audit =  1"+
+            "</if>" +
+            "<if test='maps.isShow == 0'>" +
+                "and p.is_audit !=  1"+
+            "</if>" +
+        "</if>" +
         // 评论内容条件
         "<if test='maps.commentContent != null and maps.commentContent.trim() != \"\"'> " +
         "and fsosc.content like CONCAT('%', #{maps.commentContent}, '%') " +

+ 7 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -502,7 +502,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     }
                 }
             }
-    }
+        }
 
         if("纯正堂".equals(cloudHostProper.getCompanyName())){
             product.setIsAudit("1");
@@ -556,6 +556,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             }
         }
         else{
+            //新添加的商品默认都应该不是上架状态,流程都是需要先审核。即使你新增时候选择了上架状态,也应该是上架并待审核才对。
+            product.setIsShow(0);
             fsStoreProductMapper.insertFsStoreProduct(product);
         }
         storeAuditLogUtil.addOperLog(product.getProductId());
@@ -1277,6 +1279,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     @Transactional
     public void batchAudit(ProductAuditDTO auditDTO) {
+        //如果审核通过就是上架,如果审核不通过就是处于下架状态,为了清晰这里可以添加枚举(0未审核1审核通过2审核退回),
+        // 正常情况是退回后可以申请重新上架的如果不通过2,那么show就变回0(直接在sql中去做的),按照原有逻辑去做
         fsStoreProductMapper.batchAudit(auditDTO);
         storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
     }
@@ -1426,7 +1430,9 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         copyProductInfo.setProductId(null);
         copyProductInfo.setCreateTime(new Date());
         copyProductInfo.setUpdateTime(new Date());
+        //复制过来的商品应该是0审核,未上架的状态
         copyProductInfo.setIsAudit("0");
+        copyProductInfo.setIsShow(0);
 
         //插入复制商品
         if(fsStoreProductMapper.insertFsStoreProduct(copyProductInfo) < 1){

+ 1 - 1
fs-service/src/main/java/com/fs/statis/dto/ProductAuditDTO.java

@@ -16,7 +16,7 @@ public class ProductAuditDTO implements Serializable {
      */
     private List<Long> productIds;
     /**
-     * 审核状态
+     * 审核状态(0未审核1审核通过2审核退回),
      * */
     private Integer isAudit;
     /**

+ 11 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -517,7 +517,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <update id="batchAudit" parameterType="com.fs.statis.dto.ProductAuditDTO">
         UPDATE fs_store_product_scrm
-        SET is_audit = #{isAudit}
+        <set>
+            is_audit = #{isAudit},
+            <choose>
+                <when test="isAudit == 1">
+                    is_show = 1
+                </when>
+                <otherwise>
+                    is_show = 0
+                </otherwise>
+            </choose>
+        </set>
         WHERE product_id IN
         <foreach item="productId" collection="productIds" open="(" separator="," close=")">
             #{productId}