Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/ScrmStores' into ScrmStores

吴树波 2 dní pred
rodič
commit
e2cb9fed06

+ 1 - 1
README.md

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

+ 26 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -1,6 +1,7 @@
 package com.fs.app.controller;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fs.app.annotation.Login;
 import com.fs.app.config.ImageStorageConfig;
@@ -11,6 +12,7 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsUserCoursePeriod;
 import com.fs.course.dto.BatchSendCourseDTO;
 import com.fs.course.dto.BatchUrgeCourseDTO;
@@ -31,6 +33,7 @@ import com.fs.im.service.IFsImMsgSendDetailService;
 import com.fs.im.service.IFsImMsgSendLogService;
 import com.fs.im.service.OpenIMService;
 import com.fs.im.vo.FsImMsgSendLogVO;
+import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -77,6 +80,11 @@ public class FsUserCourseVideoController extends AppBaseController {
     @Autowired
     private IFsImMsgSendLogService imMsgSendLogService;
 
+    @Autowired
+    private ISysConfigService configService;
+
+    private final String FANG_HUA_APP_ID = "wx503cf8ab31f83dd4";
+
     @Login
     @GetMapping("/pageList")
     @ApiOperation("课程分页列表")
@@ -348,4 +356,22 @@ public class FsUserCourseVideoController extends AppBaseController {
         return imMsgSendLogService.deleteFsImMsgSendLogAndDetail(logId);
     }
 
+    @ApiOperation("获取登录小程id值")
+    @GetMapping("/getLoginMiniAppId/{appId}")
+    public ResponseResult getLoginMiniAppId(@PathVariable String appId){
+        String json = configService.selectConfigByKey("course.config");
+        if(null == json || com.hc.openapi.tool.util.StringUtils.isBlank(json)){
+            ResponseResult.fail(500,"请先配置课程系统参数");
+        }
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        //判断配置的appid是否为芳华惠选appid 如果配置了直接返回芳华惠选的appid
+        if(null != config && StringUtils.isNotBlank(config.getLoginMiniAppId())){
+            String loginMiniAppId = config.getLoginMiniAppId();
+            if(FANG_HUA_APP_ID.equals(loginMiniAppId)){
+                return ResponseResult.ok(FANG_HUA_APP_ID);
+            }
+        }
+        return ResponseResult.ok(appId);
+    }
+
 }

+ 2 - 2
fs-company/src/main/resources/application.yml

@@ -4,11 +4,11 @@ server:
 spring:
   profiles:
 #    active: druid-fcky-test
-    active: druid-jnmy-test
+#    active: druid-jnmy-test
 #    active: druid-jzzx-test
 #    active: druid-hdt
 #    active: druid-sxjz
 #    active: druid-yzt
 #    active: druid-myhk
 #    active: druid-sft
-#    active: dev-yjb
+    active: dev-yjb

+ 5 - 0
fs-service/src/main/java/com/fs/course/config/CourseConfig.java

@@ -85,6 +85,11 @@ public class CourseConfig implements Serializable {
      */
     private Boolean isOpenIM;
 
+    /**
+     * 用于配置登录的小程序id
+     */
+    private String loginMiniAppId;
+
 
     @Data
     public static class DisabledTimeVo{

+ 6 - 0
fs-service/src/main/java/com/fs/his/vo/FsArticleListVO.java

@@ -56,4 +56,10 @@ public class FsArticleListVO {
     /** 更新时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
+
+
+    /**
+     * 是否审核(-1驳回、0待审核,1审核中、2已审核)
+     * **/
+    private Integer auditStatus;
 }

+ 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}