diff --git a/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java b/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java index 5037ed6..1248754 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/DictDataController.java @@ -73,7 +73,8 @@ public class DictDataController extends BaseController { return fail("字典数据标识已存在"); } // 自动添加字典 - if (dictService.count(new LambdaQueryWrapper().eq(Dict::getDictCode,dictData.getDictCode())) == 0) { + final int count = dictService.count(new LambdaQueryWrapper().eq(Dict::getDictCode, dictData.getDictCode())); + if (dictData.getDictCode() != null && count == 0) { final Dict dict = new Dict(); dict.setDictCode(dictData.getDictCode()); dict.setDictName(dictData.getDictCode()); diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java index 615e1d4..2bd360e 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java @@ -186,8 +186,6 @@ public class MainController extends BaseController { menu.setMenuType(0); list.add(menu); tenant.setMenu(list); - // 服务器时间 - tenant.setDate(serverTime()); // 授权信息 HashMap config = new HashMap<>(); config.put("LICENSE_CODE", "dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW=="); @@ -982,7 +980,7 @@ public class MainController extends BaseController { */ @ApiOperation("获取服务器时间") @GetMapping("/serverTime") - public ApiResult serverTime(){ + public ApiResult serverTime(String deliveryTime){ HashMap map = new HashMap<>(); // 今天日期 DateTime date = DateUtil.date(); @@ -990,17 +988,32 @@ public class MainController extends BaseController { // 明天日期 final DateTime dateTime = DateUtil.tomorrow(); String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd"); + // 后天日期 + final DateTime dateTime2 = DateUtil.offsetDay(date, 2); + final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd"); // 今天星期几 - final int week = DateUtil.thisDayOfWeek();; + final int week = DateUtil.thisDayOfWeek(); final DateTime nextWeek = DateUtil.nextWeek(); map.put("now",DateUtil.now()); map.put("today",today); map.put("tomorrow",tomorrow); + map.put("afterDay",afterDay); map.put("week",week); map.put("minDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, -7 )); map.put("maxDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, 7 )); map.put("nextWeek",nextWeek); + if(deliveryTime != null){ + DateTime parse = DateUtil.parse(deliveryTime); + // 前一天 + DateTime previous = DateUtil.offsetDay(parse, -1); + // 后一天 + DateTime nextDay = DateUtil.offsetDay(parse, 1); + map.put("previous",DateUtil.format(previous,"yyyy-MM-dd")); + map.put("previousWeek",DateUtil.dayOfWeek(previous)-1); + map.put("nextDay",DateUtil.format(nextDay,"yyyy-MM-dd")); + map.put("week",DateUtil.dayOfWeek(nextDay)-1); + } return success(map); } diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java index d9b9873..70b147e 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/VersionServiceImpl.java @@ -23,7 +23,7 @@ public class VersionServiceImpl extends ServiceImpl impl @Override public PageResult pageRel(VersionParam param) { PageParam page = new PageParam<>(param); - //page.setDefaultOrder("create_time desc"); + page.setDefaultOrder("create_time desc"); List list = baseMapper.selectPageRel(page, param); return new PageResult<>(list, page.getTotal()); } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 9c20e5a..fbf8382 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -23,3 +23,6 @@ config: # 开发环境接口 server-url: http://127.0.0.1:9090/api upload-path: /Users/gxwebsoft/Documents/uploads + +#swagger: +#host: https://server.gxwebsoft.com/swagger-ui/index.html