修复添加字典项报错
This commit is contained in:
@@ -73,7 +73,8 @@ public class DictDataController extends BaseController {
|
|||||||
return fail("字典数据标识已存在");
|
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();
|
final Dict dict = new Dict();
|
||||||
dict.setDictCode(dictData.getDictCode());
|
dict.setDictCode(dictData.getDictCode());
|
||||||
dict.setDictName(dictData.getDictCode());
|
dict.setDictName(dictData.getDictCode());
|
||||||
|
|||||||
@@ -186,8 +186,6 @@ public class MainController extends BaseController {
|
|||||||
menu.setMenuType(0);
|
menu.setMenuType(0);
|
||||||
list.add(menu);
|
list.add(menu);
|
||||||
tenant.setMenu(list);
|
tenant.setMenu(list);
|
||||||
// 服务器时间
|
|
||||||
tenant.setDate(serverTime());
|
|
||||||
// 授权信息
|
// 授权信息
|
||||||
HashMap<String, Object> config = new HashMap<>();
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
config.put("LICENSE_CODE", "dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW==");
|
config.put("LICENSE_CODE", "dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW==");
|
||||||
@@ -982,7 +980,7 @@ public class MainController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("获取服务器时间")
|
@ApiOperation("获取服务器时间")
|
||||||
@GetMapping("/serverTime")
|
@GetMapping("/serverTime")
|
||||||
public ApiResult<?> serverTime(){
|
public ApiResult<?> serverTime(String deliveryTime){
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
// 今天日期
|
// 今天日期
|
||||||
DateTime date = DateUtil.date();
|
DateTime date = DateUtil.date();
|
||||||
@@ -990,17 +988,32 @@ public class MainController extends BaseController {
|
|||||||
// 明天日期
|
// 明天日期
|
||||||
final DateTime dateTime = DateUtil.tomorrow();
|
final DateTime dateTime = DateUtil.tomorrow();
|
||||||
String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
|
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();
|
final DateTime nextWeek = DateUtil.nextWeek();
|
||||||
|
|
||||||
map.put("now",DateUtil.now());
|
map.put("now",DateUtil.now());
|
||||||
map.put("today",today);
|
map.put("today",today);
|
||||||
map.put("tomorrow",tomorrow);
|
map.put("tomorrow",tomorrow);
|
||||||
|
map.put("afterDay",afterDay);
|
||||||
map.put("week",week);
|
map.put("week",week);
|
||||||
map.put("minDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, -7 ));
|
map.put("minDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, -7 ));
|
||||||
map.put("maxDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, 7 ));
|
map.put("maxDate",DateUtil.offset(date, DateField.DAY_OF_WEEK, 7 ));
|
||||||
map.put("nextWeek",nextWeek);
|
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);
|
return success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class VersionServiceImpl extends ServiceImpl<VersionMapper, Version> impl
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<Version> pageRel(VersionParam param) {
|
public PageResult<Version> pageRel(VersionParam param) {
|
||||||
PageParam<Version, VersionParam> page = new PageParam<>(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);
|
List<Version> list = baseMapper.selectPageRel(page, param);
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,3 +23,6 @@ config:
|
|||||||
# 开发环境接口
|
# 开发环境接口
|
||||||
server-url: http://127.0.0.1:9090/api
|
server-url: http://127.0.0.1:9090/api
|
||||||
upload-path: /Users/gxwebsoft/Documents/uploads
|
upload-path: /Users/gxwebsoft/Documents/uploads
|
||||||
|
|
||||||
|
#swagger:
|
||||||
|
#host: https://server.gxwebsoft.com/swagger-ui/index.html
|
||||||
|
|||||||
Reference in New Issue
Block a user