|
@@ -1,78 +1,92 @@
|
|
|
-package org.fouram.controller;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.fouram.core.base.controller.BaseController;
|
|
|
-import org.fouram.core.util.AppUtil;
|
|
|
-import org.fouram.dto.input.UploadHrEmpUserDTO;
|
|
|
-import org.fouram.entity.SapUser;
|
|
|
-import org.fouram.enums.UploadHrEmpUserEnum;
|
|
|
-import org.fouram.service.SapUserService;
|
|
|
-import org.fouram.service.SyncUploadService;
|
|
|
-import org.fouram.service.TestService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-
|
|
|
-@Controller
|
|
|
-@RequestMapping(value = "/test")
|
|
|
-public class TestController extends BaseController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private TestService testService;
|
|
|
- @Autowired
|
|
|
- private SapUserService sapUserService;
|
|
|
- @Autowired
|
|
|
- private SyncUploadService syncUploadService;
|
|
|
-
|
|
|
- /**
|
|
|
- * http://localhost:8080/sapcms/test/saveTestAnon
|
|
|
- *
|
|
|
- * @return
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- @PostMapping(value = "/saveTestAnon", produces = "application/json;charset=utf-8")
|
|
|
- @ResponseBody
|
|
|
- public Object saveTestAnon() throws Exception {
|
|
|
- testService.saveTest();
|
|
|
- return AppUtil.success();
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping(value = "/syncUploadAnon", produces = "application/json;charset=utf-8")
|
|
|
- @ResponseBody
|
|
|
- public Object syncUploadAnon() throws Exception {
|
|
|
- syncUploadService.sync();
|
|
|
- return AppUtil.success();
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping(value = "/uploadDevHrEmpUserInfoAnon", produces = "application/json;charset=utf-8")
|
|
|
- @ResponseBody
|
|
|
- public Object uploadDevHrEmpUserInfoAnon(UploadHrEmpUserDTO dto) throws Exception {
|
|
|
- List<SapUser> users = sapUserService.selectLeaveAndEntryList(dto.getDate());
|
|
|
- for (SapUser user : users) {
|
|
|
- if (StringUtils.isNotBlank(user.getEndDate())) {
|
|
|
- sapUserService.uploadDevHrEmpUserInfo(user, UploadHrEmpUserEnum.LEAVE.getCode());
|
|
|
- } else {
|
|
|
- sapUserService.uploadDevHrEmpUserInfo(user, UploadHrEmpUserEnum.ENTRY.getCode());
|
|
|
- }
|
|
|
- }
|
|
|
- return AppUtil.success();
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping(value = "/uploadMasHrEmpUserInfoAnon", produces = "application/json;charset=utf-8")
|
|
|
- @ResponseBody
|
|
|
- public Object uploadMasHrEmpUserInfoAnon(UploadHrEmpUserDTO dto) throws Exception {
|
|
|
- List<SapUser> users = sapUserService.selectLeaveAndEntryList(dto.getDate());
|
|
|
- for (SapUser user : users) {
|
|
|
- if (StringUtils.isNotBlank(user.getEndDate())) {
|
|
|
- sapUserService.uploadMasHrEmpUserInfo(user, UploadHrEmpUserEnum.LEAVE.getCode());
|
|
|
- } else {
|
|
|
- sapUserService.uploadMasHrEmpUserInfo(user, UploadHrEmpUserEnum.ENTRY.getCode());
|
|
|
- }
|
|
|
- }
|
|
|
- return AppUtil.success();
|
|
|
- }
|
|
|
+package org.fouram.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.fouram.core.base.controller.BaseController;
|
|
|
+import org.fouram.core.util.AppUtil;
|
|
|
+import org.fouram.dto.input.UploadHrEmpUserDTO;
|
|
|
+import org.fouram.entity.SapUser;
|
|
|
+import org.fouram.enums.UploadHrEmpUserEnum;
|
|
|
+import org.fouram.service.SapUserService;
|
|
|
+import org.fouram.service.SyncUploadService;
|
|
|
+import org.fouram.service.TestService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+
|
|
|
+@Controller
|
|
|
+@RequestMapping(value = "/test")
|
|
|
+public class TestController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TestService testService;
|
|
|
+ @Autowired
|
|
|
+ private SapUserService sapUserService;
|
|
|
+ @Autowired
|
|
|
+ private SyncUploadService syncUploadService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * http://localhost:8080/sapcms/test/saveTestAnon
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/saveTestAnon", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object saveTestAnon() throws Exception {
|
|
|
+ testService.saveTest();
|
|
|
+ return AppUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/syncUploadAnon", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object syncUploadAnon() throws Exception {
|
|
|
+ syncUploadService.sync();
|
|
|
+ return AppUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/uploadDevHrEmpUserInfoAnon", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object uploadDevHrEmpUserInfoAnon(UploadHrEmpUserDTO dto) throws Exception {
|
|
|
+ List<SapUser> users = sapUserService.selectLeaveAndEntryList(dto.getDate());
|
|
|
+ for (SapUser user : users) {
|
|
|
+ if (StringUtils.isNotBlank(user.getEndDate())) {
|
|
|
+ sapUserService.uploadDevHrEmpUserInfo(user, UploadHrEmpUserEnum.LEAVE.getCode());
|
|
|
+ } else {
|
|
|
+ sapUserService.uploadDevHrEmpUserInfo(user, UploadHrEmpUserEnum.ENTRY.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AppUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/uploadMasHrEmpUserInfoAnon", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object uploadMasHrEmpUserInfoAnon(UploadHrEmpUserDTO dto) throws Exception {
|
|
|
+ List<SapUser> users = sapUserService.selectLeaveAndEntryList(dto.getDate());
|
|
|
+ for (SapUser user : users) {
|
|
|
+ if (StringUtils.isNotBlank(user.getEndDate())) {
|
|
|
+ sapUserService.uploadMasHrEmpUserInfo(user, UploadHrEmpUserEnum.LEAVE.getCode());
|
|
|
+ } else {
|
|
|
+ sapUserService.uploadMasHrEmpUserInfo(user, UploadHrEmpUserEnum.ENTRY.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AppUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/uploadDevEmpUserDetailInfoAnon", produces = "application/json;charset=utf-8")
|
|
|
+ @ResponseBody
|
|
|
+ public Object uploadDevEmpUserDetailInfoAnon(UploadHrEmpUserDTO dto) throws Exception {
|
|
|
+ List<SapUser> users = sapUserService.selectLeaveAndEntryList(dto.getDate());
|
|
|
+ for (SapUser user : users) {
|
|
|
+ if (StringUtils.isNotBlank(user.getEndDate())) {
|
|
|
+ sapUserService.uploadDevEmpUserDetailInfo(user, UploadHrEmpUserEnum.LEAVE.getCode());
|
|
|
+ } else {
|
|
|
+ sapUserService.uploadDevEmpUserDetailInfo(user, UploadHrEmpUserEnum.ENTRY.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AppUtil.success();
|
|
|
+ }
|
|
|
}
|