| src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/system/controller/ConfigController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/webapp/static/js/config/config.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/webapp/views/config/config.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -400,6 +401,17 @@ //检测浅库位状态 public synchronized boolean checkShallowLocStatus(String locNo, Integer taskNo) { String checkDeepLocOutTaskBlockReport = "Y"; Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); if (systemConfigMapObj != null) { HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; checkDeepLocOutTaskBlockReport = systemConfigMap.get("checkDeepLocOutTaskBlockReport"); } if (!checkDeepLocOutTaskBlockReport.equals("Y")) { return true; } Object lock = redisUtil.get(RedisKeyType.CHECK_SHALLOW_LOC_STATUS_LIMIT.key + taskNo); if (lock != null) { return false; src/main/java/com/zy/system/controller/ConfigController.java
@@ -13,6 +13,8 @@ import com.zy.common.entity.Parameter; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; import com.zy.common.utils.RedisUtil; import com.zy.core.enums.RedisKeyType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +25,20 @@ @Autowired private ConfigService configService; @Autowired private RedisUtil redisUtil; @RequestMapping(value = "/config/refreshCache") @ManagerAuth public R refreshCache(){ HashMap<String, String> systemConfigMap = new HashMap<>(); List<Config> configList = configService.selectList(new EntityWrapper<>()); for (Config config : configList) { systemConfigMap.put(config.getCode(), config.getValue()); } redisUtil.set(RedisKeyType.SYSTEM_CONFIG_MAP.key, systemConfigMap); return R.ok(); } @RequestMapping(value = "/config/{id}/auth") @ManagerAuth src/main/webapp/static/js/config/config.js
@@ -130,6 +130,24 @@ }); } break; case 'refreshCache': layer.confirm('确定刷新Redis缓存吗', function(){ $.ajax({ url: baseUrl+"/config/refreshCache", headers: {'token': localStorage.getItem('token')}, method: 'POST', success: function (res) { if (res.code === 200){ layer.msg('刷新成功'); } else if (res.code === 403){ top.location.href = baseUrl+"/"; } else { layer.msg(res.msg) } } }) }); break; case 'exportData': layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ var titles=[]; src/main/webapp/views/config/config.html
@@ -34,6 +34,7 @@ <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> <button class="layui-btn layui-btn-warm layui-btn-sm" id="btn-refresh-cache" lay-event="refreshCache">刷新缓存</button> </div> </script>