|
@@ -3,6 +3,7 @@ package com.persagy.calendar.controller;
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -38,6 +39,9 @@ import io.swagger.annotations.ApiOperation;
|
|
|
@RequestMapping(value = "/v2.0/calendarLabel", method = RequestMethod.POST)
|
|
|
public class WorkCalendarLabelController {
|
|
|
|
|
|
+ @Value("${integrated.calendar.group-code:BR}")
|
|
|
+ private String defaultGroupCode;
|
|
|
+
|
|
|
@Autowired
|
|
|
private WorkCalendarLabelHandler workCalendarLabelHandler;
|
|
|
|
|
@@ -47,6 +51,9 @@ public class WorkCalendarLabelController {
|
|
|
@ApiOperation(value = "列表查询")
|
|
|
@RequestMapping(value = "queryCalendarLabelList")
|
|
|
public ResponseResult queryCalendarLabelList(@RequestBody @Validated WorkCalendarLabelQueryVO queryVO) {
|
|
|
+ if (StringUtil.isBlank(queryVO.getGroupCode())) {
|
|
|
+ queryVO.setGroupCode(defaultGroupCode);
|
|
|
+ }
|
|
|
List<WorkCalendarLabel> dateList = this.workCalendarLabelHandler.queryCalendarLabelList(queryVO);
|
|
|
if (CollectionUtil.isEmpty(dateList)) {
|
|
|
return ResponseUtil.successResult(Lists.newArrayList(), 0L);
|
|
@@ -63,6 +70,10 @@ public class WorkCalendarLabelController {
|
|
|
@ApiOperation(value = "查询标签的有效期")
|
|
|
@RequestMapping(value = "queryCalendarLabelValid")
|
|
|
public ResponseResult queryCalendarLabelValid(@RequestBody @Validated WorkCalendarLabelQueryVO queryVO) {
|
|
|
+ if (StringUtil.isBlank(queryVO.getGroupCode())) {
|
|
|
+ queryVO.setGroupCode(defaultGroupCode);
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtil.isBlank(queryVO.getDictType())) {
|
|
|
return ResponseUtil.errorResult(ResponseCode.A0400.getCode(), "标签类型,不可为空");
|
|
|
}
|
|
@@ -81,6 +92,10 @@ public class WorkCalendarLabelController {
|
|
|
@ApiOperation(value = "创建或更新日期标签属性")
|
|
|
@RequestMapping(value = "updateLabelInfo")
|
|
|
public ResponseResult updateLabelInfo(@RequestBody @Validated WorkCalendarLabelUpdateVO updateVO) {
|
|
|
+ if (StringUtil.isBlank(updateVO.getGroupCode())) {
|
|
|
+ updateVO.setGroupCode(defaultGroupCode);
|
|
|
+ }
|
|
|
+
|
|
|
ResponseResult validity = WorkCalendarLabelHandler.checkDataValidity(updateVO);
|
|
|
if (validity != null) {
|
|
|
return validity;
|
|
@@ -97,6 +112,10 @@ public class WorkCalendarLabelController {
|
|
|
@ApiOperation(value = "更新日期标签属性集")
|
|
|
@RequestMapping(value = "updateCalendarDateAttribute")
|
|
|
public ResponseResult updateCalendarDateAttribute(@RequestBody @Validated WorkLabelBatchUpdateVO updateVO) {
|
|
|
+ if (StringUtil.isBlank(updateVO.getGroupCode())) {
|
|
|
+ updateVO.setGroupCode(defaultGroupCode);
|
|
|
+ }
|
|
|
+
|
|
|
List<WorkCalendarLabelUpdateVO> labels = updateVO.getLabels();
|
|
|
List<WorkCalendarMoreDateCreateVO> times = updateVO.getTimes();
|
|
|
if (CollectionUtil.isNotEmpty(labels) || CollectionUtil.isNotEmpty(times)) {
|