|
@@ -1,8 +1,12 @@
|
|
|
package com.jeeplus.human.enrollment.enrollmentRegistration.controller;
|
|
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.common.utils.ResponseUtil;
|
|
|
+import com.jeeplus.flowable.feign.IFlowableApi;
|
|
|
import com.jeeplus.human.depart.handover.domain.Handover;
|
|
|
import com.jeeplus.human.depart.handover.service.HandoverService;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.domain.*;
|
|
@@ -11,10 +15,13 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.utils.HunamFreemarker
|
|
|
import com.jeeplus.human.practice.register.domain.Registration;
|
|
|
import com.jeeplus.logging.annotation.ApiLog;
|
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
+import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import freemarker.template.Configuration;
|
|
|
import freemarker.template.Template;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.models.auth.In;
|
|
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
|
|
import org.apache.pdfbox.pdmodel.PDPage;
|
|
|
import org.apache.pdfbox.pdmodel.PDPageContentStream;
|
|
@@ -47,6 +54,7 @@ import java.nio.file.Paths;
|
|
|
import java.nio.file.StandardCopyOption;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author 王强
|
|
@@ -201,13 +209,27 @@ public class EnrollmentRegistrationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 保存个人信息完善登记信息
|
|
|
+ * @param registration
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiLog(value = "保存个人信息完善登记信息", type = LogTypeEnum.SAVE)
|
|
|
+ @PostMapping("save2")
|
|
|
+ public ResponseEntity save2(@Valid @RequestBody EnrollmentRegistration registration) throws Exception {
|
|
|
+ EnrollmentRegistration s = service.saveRegistration2(registration);
|
|
|
+ return ResponseUtil.newInstance().add("businessTable", "human_resources_enrollment_registration")
|
|
|
+ .add("businessId", s.getId())
|
|
|
+ .ok ("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 保存入职人员登记信息
|
|
|
* @param registration
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog(value = "修改入职人员登记信息", type = LogTypeEnum.SAVE)
|
|
|
@PostMapping("updateInfo")
|
|
|
- public ResponseEntity updateInfo(@Valid @RequestBody Registration registration) throws Exception {
|
|
|
+ public ResponseEntity updateInfo(@Valid @RequestBody EnrollmentRegistration registration) throws Exception {
|
|
|
service.updateRegistration(registration);
|
|
|
return ResponseUtil.newInstance().ok("操作成功");
|
|
|
}
|
|
@@ -267,6 +289,100 @@ public class EnrollmentRegistrationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 根据人员id查询是否有对应信息
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "根据人员id查询是否有对应信息")
|
|
|
+ @GetMapping("/findByUserId")
|
|
|
+ public Integer findByUserId(@RequestParam String userId) throws Exception{
|
|
|
+
|
|
|
+ /*List<UserDTO> allUserInfos = SpringUtil.getBean(IUserApi.class).getAllUserInfos();
|
|
|
+ List<String> allUserIdInSuccess = service.getAllUserIdInSuccess();
|
|
|
+ // 使用流操作过滤掉 allUserIdInSuccess 中存在的用户数据
|
|
|
+ List<UserDTO> filteredUsers = allUserInfos.stream()
|
|
|
+ .filter(user -> !allUserIdInSuccess.contains(user.getId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (int i=0;i<filteredUsers.size();i++){
|
|
|
+ //发起完善个人信息流程
|
|
|
+ Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("完善个人信息");
|
|
|
+ String procDefId = map.get("id")+"";
|
|
|
+
|
|
|
+ EnrollmentRegistration report = new EnrollmentRegistration();
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ report.setId(id);
|
|
|
+ report.setCreateById("1");
|
|
|
+ report.setCreateTime(new Date());
|
|
|
+ report.setUpdateById("1");
|
|
|
+ report.setType("2");
|
|
|
+ report.setUserId(filteredUsers.get(i).getId());
|
|
|
+ report.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ report.setProcessDefinitionId(procDefId);
|
|
|
+
|
|
|
+ String value = JSON.toJSONString(report);
|
|
|
+ //先保存数据
|
|
|
+ service.insertIntoEnrollmentRegistrationInfo(value);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String ,Map<String,String >> allMap = new HashMap<>();
|
|
|
+
|
|
|
+ String procDefKey = map.get("key")+"";
|
|
|
+ String businessTable = "human_resources_enrollment_registration";
|
|
|
+
|
|
|
+ String businessId = id;
|
|
|
+ String title = "管理员发起了- [" + filteredUsers.get(i).getName() + "完善个人信息]";
|
|
|
+
|
|
|
+ String assignee = filteredUsers.get(i).getId();
|
|
|
+ String recordType = "";
|
|
|
+
|
|
|
+ Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
|
|
|
+ allMap.put("完善个人信息",newMap);
|
|
|
+ SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
|
|
|
+ }*/
|
|
|
+
|
|
|
+ return service.findByUserId(userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String,String> pingMap(String procDefId,String procDefKey,String businessTable,
|
|
|
+ String businessId,String title,String assignee,String recordType){
|
|
|
+ Map<String,String> map = new HashMap();
|
|
|
+ map.put("procDefId", procDefId);
|
|
|
+ map.put("procDefKey", procDefKey);
|
|
|
+ map.put("businessTable", businessTable);
|
|
|
+ map.put("businessId", businessId);
|
|
|
+ map.put("title", title);
|
|
|
+ map.put("assignee", assignee);
|
|
|
+ map.put("recordType", recordType);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 定时任务发起 个人信息完善所用
|
|
|
+ * @param value
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "保存信息")
|
|
|
+ @GetMapping("/insertIntoEnrollmentRegistrationInfo")
|
|
|
+ public void insertIntoEnrollmentRegistrationInfo(String value) throws Exception{
|
|
|
+
|
|
|
+ service.insertIntoEnrollmentRegistrationInfo(value);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有的入职登记表中的有效数据的id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "获取所有的入职登记表中的有效数据的id")
|
|
|
+ @GetMapping("/getAllUserIdInSuccess")
|
|
|
+ public List<String> getAllUserIdInSuccess() throws Exception{
|
|
|
+ return service.getAllUserIdInSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 根据人员登记id查询社保信息
|
|
|
* @param id
|
|
|
* @return
|