|
|
@@ -1027,6 +1027,7 @@ public class SupermeController extends BaseController {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
+ @OperationLog(value = "读取假日信息列表")
|
|
|
@GetMapping(value = "/holidayList")
|
|
|
public String holidayList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
ModelMap modelMap) throws Exception {
|
|
|
@@ -1043,6 +1044,7 @@ public class SupermeController extends BaseController {
|
|
|
* @param modelMap
|
|
|
* @return
|
|
|
*/
|
|
|
+ @OperationLog(value = "新增假日信息")
|
|
|
@GetMapping(value = "/holiday/add")
|
|
|
public String addHolidayPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,ModelMap modelMap) {
|
|
|
return BASE_SUPER_PATH + "holiday/holiday_add";
|
|
|
@@ -1054,6 +1056,7 @@ public class SupermeController extends BaseController {
|
|
|
* @param modelMap
|
|
|
* @return
|
|
|
*/
|
|
|
+ @OperationLog(value = "编辑假日信息")
|
|
|
@GetMapping(value = "/holiday/edit/{id}")
|
|
|
public String editHolidayPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
@PathVariable("id") Integer id,ModelMap modelMap) {
|
|
|
@@ -1083,9 +1086,10 @@ public class SupermeController extends BaseController {
|
|
|
return ResponseMessage.success("删除成功!");
|
|
|
}
|
|
|
|
|
|
+ @OperationLog(value = "导入假日信息")
|
|
|
@PostMapping(value = "/holiday/import")
|
|
|
public ResponseEntity<String> importHoliday(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws IOException {
|
|
|
-
|
|
|
+ String retInfo = "";
|
|
|
if (file.isEmpty()) {
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("文件不能为空");
|
|
|
}
|
|
|
@@ -1094,21 +1098,83 @@ public class SupermeController extends BaseController {
|
|
|
try {
|
|
|
//调用util方法拿到解析的数据集合
|
|
|
readExcel = new ReadExcelUtil().readExcel(file);
|
|
|
-
|
|
|
// 进一步解析
|
|
|
-
|
|
|
- String retInfo = HolidayExcelParser.parse(readExcel);
|
|
|
-
|
|
|
- //int a = 0;
|
|
|
+ retInfo = HolidayExcelParser.parse(readExcel);
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
+
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
+ return ResponseEntity.status(HttpStatus.OK).body(retInfo);
|
|
|
|
|
|
- return ResponseEntity.status(HttpStatus.OK).body("OK");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @OperationLog(value = "假日信息保存")
|
|
|
+ @PostMapping(value = "/holiday/save")
|
|
|
+ public ResponseMessage saveHoliday(@RequestParam(value = "id", defaultValue = "-1") int id,
|
|
|
+ @RequestParam(value = "configName", defaultValue = "") String configName,
|
|
|
+ @RequestParam(value = "configKey", defaultValue = "") String configKey,
|
|
|
+ @RequestParam(value = "configValue", defaultValue = "") String configValue) throws Exception {
|
|
|
+
|
|
|
+ if(IsTooFrequently()) {
|
|
|
+ return ResponseMessage.success("操作过于频繁,请稍后再试!");
|
|
|
+ }
|
|
|
+
|
|
|
+ SysConfig ent2Save;
|
|
|
+ if (-1 < id)
|
|
|
+ {
|
|
|
+ ent2Save = sysConfigService.findById(id);
|
|
|
+ }else{
|
|
|
+ ent2Save = new SysConfig();
|
|
|
+ }
|
|
|
+
|
|
|
+ ent2Save.setConfigName(configName);
|
|
|
+ ent2Save.setConfigKey(configKey);
|
|
|
+ ent2Save.setConfigValue(configValue.replace(""","\""));
|
|
|
+ ent2Save.setDel_flag(false);
|
|
|
+
|
|
|
+
|
|
|
+ if (-1 < id)
|
|
|
+ {
|
|
|
+ sysConfigService.update(ent2Save);
|
|
|
+ }else{
|
|
|
+ sysConfigService.save(ent2Save);
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResponseMessage.success("保存成功!");
|
|
|
|
|
|
}
|
|
|
|
|
|
+ ///super/isExistHoliday
|
|
|
+ /**
|
|
|
+ * 同一年份假日信息是否存在
|
|
|
+ *
|
|
|
+ * @param configKey
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @OperationLog(value = "同一年份假日信息是否存在")
|
|
|
+ @ResponseBody
|
|
|
+ @GetMapping(value = "/isExistHoliday")
|
|
|
+ public Boolean isExistHoliday(String id, String configKey) throws Exception {
|
|
|
+ boolean flag = true;
|
|
|
+ log.debug("检验同一年份假日信息是否存在参数! id= {}, configKey= {}", id, configKey);
|
|
|
+ SysConfig entExist = sysConfigService.getByKey(configKey);
|
|
|
+
|
|
|
+ if (null != entExist) {
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ flag = false;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (entExist.getId() != (Integer.parseInt(id))) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ log.info("检验假日信息年份是否存在结果! flag = {}", flag);
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
}
|
|
|
+
|