Forráskód Böngészése

知识库状态修改为待发布已发布

jingyuanchao 2 éve
szülő
commit
e0c91568e0

+ 4 - 2
project_data/sql/0.0.3/soc/soc.sql

@@ -616,5 +616,7 @@ VALUES (01717079254782545922, '外包评价', 01720259442805620738, 2, 'wbpj', '
 -- 天气接口配置
 delete from sys_config where config_key='WEATHER_URL';
 INSERT INTO sys_config (config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES (191, '天气接口', 'WEATHER_URL', 'https://ali-weather.showapi.com', 'Y', NULL, now(), NULL, now(), NULL);
-
-
+-- 知识库状态修改
+DELETE FROM sys_dict_data WHERE dict_type = 'materials_status' and dict_value=2;
+UPDATE sys_dict_data t SET t.dict_label = '已发布' WHERE dict_type = 'materials_status' and dict_value=1;
+UPDATE sys_dict_data t SET t.dict_label = '待发布' WHERE dict_type = 'materials_status' and dict_value=0;

+ 1 - 7
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/SysLearningMaterialsServiceImpl.java

@@ -298,13 +298,7 @@ public class SysLearningMaterialsServiceImpl extends ServiceImpl<SysLearningMate
     public int editOpen(Long id, Integer isOpen) {
         SysLearningMaterials sysLearningMaterials = sysLearningMaterialsMapper.selectById(id);
         if (sysLearningMaterials != null) {
-            if (isOpen == 1) {
-                //发布:使用中
-                sysLearningMaterials.setIsOpen(isOpen);
-            } else if (isOpen == 0) {
-                //取消发布:停用
-                sysLearningMaterials.setIsOpen(2);
-            }
+            sysLearningMaterials.setIsOpen(isOpen);
             sysLearningMaterials.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
             sysLearningMaterials.setUpdateTime(DateUtils.getNowDate());
             return sysLearningMaterialsMapper.updateById(sysLearningMaterials);