修复添加字典项报错
This commit is contained in:
@@ -73,7 +73,8 @@ public class DictDataController extends BaseController {
|
||||
return fail("字典数据标识已存在");
|
||||
}
|
||||
// 自动添加字典
|
||||
if (dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode,dictData.getDictCode())) == 0) {
|
||||
final int count = dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode, dictData.getDictCode()));
|
||||
if (dictData.getDictCode() != null && count == 0) {
|
||||
final Dict dict = new Dict();
|
||||
dict.setDictCode(dictData.getDictCode());
|
||||
dict.setDictName(dictData.getDictCode());
|
||||
|
||||
@@ -186,8 +186,6 @@ public class MainController extends BaseController {
|
||||
menu.setMenuType(0);
|
||||
list.add(menu);
|
||||
tenant.setMenu(list);
|
||||
// 服务器时间
|
||||
tenant.setDate(serverTime());
|
||||
// 授权信息
|
||||
HashMap<String, Object> 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<String, Object> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class VersionServiceImpl extends ServiceImpl<VersionMapper, Version> impl
|
||||
@Override
|
||||
public PageResult<Version> pageRel(VersionParam param) {
|
||||
PageParam<Version, VersionParam> page = new PageParam<>(param);
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<Version> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user