代码提交
This commit is contained in:
parent
1fc659e214
commit
d64b672217
|
|
@ -59,7 +59,7 @@ public class ArchivedSettingController extends BaseController {
|
||||||
@RequiresPermissions("archived:setting:edit")
|
@RequiresPermissions("archived:setting:edit")
|
||||||
public AjaxResult updateArchivedSetting(@RequestBody List<ArchivedSettingDto> dto) {
|
public AjaxResult updateArchivedSetting(@RequestBody List<ArchivedSettingDto> dto) {
|
||||||
try {
|
try {
|
||||||
return AjaxResult.success(service.updateArchivedSetting(dto));
|
return service.updateArchivedSetting(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
return AjaxResult.error("请求出错了");
|
return AjaxResult.error("请求出错了");
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,5 @@ public interface ArchivedSettingService {
|
||||||
|
|
||||||
AjaxResult addArchivedSetting(ArchivedSettingDto dto);
|
AjaxResult addArchivedSetting(ArchivedSettingDto dto);
|
||||||
|
|
||||||
Integer updateArchivedSetting(List<ArchivedSettingDto> dto);
|
AjaxResult updateArchivedSetting(List<ArchivedSettingDto> dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class ArchivedSettingServiceImpl implements ArchivedSettingService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateArchivedSetting(List<ArchivedSettingDto> dtos) {
|
public AjaxResult updateArchivedSetting(List<ArchivedSettingDto> dtos) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (ArchivedSettingDto dto : dtos) {
|
for (ArchivedSettingDto dto : dtos) {
|
||||||
String cronStr = CronExpressionGenerator.generateCron(dto.getArchivedType(), dto.getCycle(), dto.getTime(), dto.getWeekOfDay(), dto.getMonthDay());
|
String cronStr = CronExpressionGenerator.generateCron(dto.getArchivedType(), dto.getCycle(), dto.getTime(), dto.getWeekOfDay(), dto.getMonthDay());
|
||||||
|
|
@ -53,7 +53,11 @@ public class ArchivedSettingServiceImpl implements ArchivedSettingService {
|
||||||
num += i;
|
num += i;
|
||||||
archivedSettingMapper.updatecronExpression(dto);
|
archivedSettingMapper.updatecronExpression(dto);
|
||||||
}
|
}
|
||||||
return num;
|
if (num > 0) {
|
||||||
|
return AjaxResult.success("修改成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("修改失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue