Browse Source

档案查询bug

jzh 1 year ago
parent
commit
4e022ad6bb

+ 12 - 8
zjugis-business/src/main/java/com/zjugis/business/flow/interview/event/InterviewEvent.java

@@ -55,6 +55,8 @@ public class InterviewEvent extends BaseController {
 
     @Autowired
     AdminUserApi adminUserApi;
+    @Resource
+    private StaffApi staffApi;
 
     /**
      * 设置流程描述
@@ -99,6 +101,9 @@ public class InterviewEvent extends BaseController {
                 entity.setFlowStatus(FLOW_FINISHED);
                 entity.setFlowFinishtime(LocalDateTime.now());
                 interviewService.update(entity);
+                //新建OA账号和档案的基本信息
+//                staffApi.insertStaff();
+
                 return ok("true");
             } else {
                 throw new BusinessException("执行事件出错,请联系管理员!");
@@ -188,7 +193,6 @@ public class InterviewEvent extends BaseController {
     }
 
 
-
     /**
      * 转到部门经理
      */
@@ -198,12 +202,12 @@ public class InterviewEvent extends BaseController {
             if (StringUtils.isNotBlank(flowInstanceId)) {
                 InterviewDO entity = interviewService.findByInstanceId(flowInstanceId);
                 List<Map<String, String>> userMaps = new ArrayList<>();
-                if(StringUtils.isNotBlank(entity.getDeptId())){
+                if (StringUtils.isNotBlank(entity.getDeptId())) {
                     CommonResult<DeptRespDTO> result = deptApi.getDept(entity.getDeptId());
                     DeptRespDTO dept = result.getCheckedData();
-                    if(dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())){
-                        HashMap<String,String> map = new HashMap<>();
-                        map.put("id",dept.getLeaderUserId());
+                    if (dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())) {
+                        HashMap<String, String> map = new HashMap<>();
+                        map.put("id", dept.getLeaderUserId());
                         userMaps.add(map);
                     }
                 }
@@ -212,7 +216,7 @@ public class InterviewEvent extends BaseController {
                 throw new BusinessException("找不到流程id");
             }
         } catch (Exception e) {
-            log.error(e.getMessage(),e);
+            log.error(e.getMessage(), e);
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
@@ -227,7 +231,7 @@ public class InterviewEvent extends BaseController {
             if (StringUtils.isNotBlank(flowInstanceId)) {
                 InterviewDO entity = interviewService.findByInstanceId(flowInstanceId);
                 List<Map<String, String>> userMaps = new ArrayList<>();
-                if(StringUtils.isNotBlank(entity.getDeptId())){
+                if (StringUtils.isNotBlank(entity.getDeptId())) {
                     DeptLeaderRespDTO deptLeaderRespDTO = deptLeaderApi.getDeptLeaderByDeptId(entity.getDeptId()).getCheckedData();
                     if (deptLeaderRespDTO != null && StringUtils.isNotBlank(deptLeaderRespDTO.getUserId())) {
                         HashMap<String, String> map = new HashMap<>();
@@ -240,7 +244,7 @@ public class InterviewEvent extends BaseController {
                 throw new BusinessException("找不到流程id");
             }
         } catch (Exception e) {
-            log.error(e.getMessage(),e);
+            log.error(e.getMessage(), e);
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }

+ 19 - 19
zjugis-business/src/main/java/com/zjugis/business/flow/staff/event/StaffEvent.java

@@ -115,28 +115,28 @@ public class StaffEvent extends BaseController {
                 entity.setFlowStatus(FLOW_FINISHED);
                 entity.setFlowFinishtime(LocalDateTime.now());
 
-                StaffRecordsDTO dto = StaffConvert.INSTANCE.convert(entity);
-                //数据归档  如果归档的时候包含括号就把括号和里面的内容去掉
-                if (dto.getNickname().contains("(")) {
-                    dto.setNickname(dto.getNickname().replaceAll("\\(.*?\\)", ""));
-                }
-
-                //亲属列表
-                List<StaffFamilyDetailDO> family = staffFamilyDetailDAO.selectList(new LambdaQueryWrapperX<StaffFamilyDetailDO>()
-                        .eq(StaffFamilyDetailDO::getStaffId, entity.getId()));
-                if (CollectionUtil.isNotEmpty(family)) {
-                    List<StaffFamilyDetailDTO> dtos = StaffConvert.INSTANCE.convertDetailList(family);
-                    dto.setFamilyList(dtos);
-                }
-                CommonResult<String> res = staffApi.insertStaff(dto);
-                if (res.isError()) {
-                    throw new BusinessException(res.getMsg());
-                }
-                entity.setUserId(res.getData());
+//                StaffRecordsDTO dto = StaffConvert.INSTANCE.convert(entity);
+//                //数据归档  如果归档的时候包含括号就把括号和里面的内容去掉
+//                if (dto.getNickname().contains("(")) {
+//                    dto.setNickname(dto.getNickname().replaceAll("\\(.*?\\)", ""));
+//                }
+//
+//                //亲属列表
+//                List<StaffFamilyDetailDO> family = staffFamilyDetailDAO.selectList(new LambdaQueryWrapperX<StaffFamilyDetailDO>()
+//                        .eq(StaffFamilyDetailDO::getStaffId, entity.getId()));
+//                if (CollectionUtil.isNotEmpty(family)) {
+//                    List<StaffFamilyDetailDTO> dtos = StaffConvert.INSTANCE.convertDetailList(family);
+//                    dto.setFamilyList(dtos);
+//                }
+//                CommonResult<String> res = staffApi.insertStaff(dto);
+//                if (res.isError()) {
+//                    throw new BusinessException(res.getMsg());
+//                }
+//                entity.setUserId(res.getData());
                 staffService.updateStaff(entity);
 
                 //归档后删除对应面试数据
-                interviewService.deleteByCardId(entity.getCardid());
+//                interviewService.deleteByCardId(entity.getCardid());
 
 
                 return ok("true");

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/api/staff/StaffApiImpl.java

@@ -30,7 +30,7 @@ public class StaffApiImpl implements StaffApi {
 
     @Override
     public CommonResult<String> insertStaff(StaffRecordsDTO dto) {
-        return success(recordsService.insertStaff(dto));
+        return success(/*recordsService.insertStaff(dto)*/);
     }
 
     @Override

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/staff/StaffRecordsController.java

@@ -72,7 +72,7 @@ public class StaffRecordsController {
      */
     @PostMapping("/insert")
     @Operation(summary = "档案新增")
-    public CommonResult<String> insertStaff(@Valid @RequestBody StaffRecordsDTO dto) {
+    public CommonResult<String> insertStaff(@Valid @RequestBody RecordsRespVO dto) {
         return success(recordsService.insertStaff(dto));
     }
 

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/dal/dataobject/staff/StaffFamilyDetailDO.java

@@ -21,7 +21,7 @@ public class StaffFamilyDetailDO {
     /**
      * 主表id
      */
-    private String staffId;
+    private String userId;
 
     /**
      * 姓名

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/staff/RecordsService.java

@@ -36,7 +36,7 @@ public interface RecordsService {
 
     String generateNum();
 
-    String insertStaff(StaffRecordsDTO vo);
+    String insertStaff(RecordsRespVO vo);
 
     List<StaffStateDTO> getResignStaffList();
 

+ 7 - 8
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/staff/RecordsServiceImpl.java

@@ -161,7 +161,7 @@ public class RecordsServiceImpl implements RecordsService {
         }
 
         //亲属查询
-        List<StaffFamilyDetailDO> family = familyDOMapper.selectList(new LambdaQueryWrapperX<StaffFamilyDetailDO>().eq(StaffFamilyDetailDO::getStaffId, staffRecordSDO.getId()));
+        List<StaffFamilyDetailDO> family = familyDOMapper.selectList(new LambdaQueryWrapperX<StaffFamilyDetailDO>().eq(StaffFamilyDetailDO::getUserId,userId));
         if (CollectionUtil.isNotEmpty(family)) {
             vo.setFamilyList(family);
         }
@@ -221,8 +221,7 @@ public class RecordsServiceImpl implements RecordsService {
 
 
         //更新员工家属列表
-        List<StaffFamilyDetailDO> detailDOS = vo.getFamilyList();
-        updateFamilyDetail(vo.getId(), detailDOS);
+        updateFamilyDetail(vo.getUserId(), vo.getFamilyList());
 
 
         //更新档案
@@ -302,7 +301,7 @@ public class RecordsServiceImpl implements RecordsService {
 
     @Override
     @Transactional
-    public String insertStaff(StaffRecordsDTO dto) {
+    public String insertStaff(RecordsRespVO dto) {
         StaffRecordSDO staffRecordSDO = RecordsConvert.INSTANCE.convertDetail(dto);
 
         //判断该员工档案是否已经存在 存在的话就直接改状态不存在就新增
@@ -338,21 +337,21 @@ public class RecordsServiceImpl implements RecordsService {
         }
 
         //亲属列表更新
-        updateFamilyDetail(staffRecordSDO.getId(), RecordsConvert.INSTANCE.convertDetailO1(dto.getFamilyList()));
+        updateFamilyDetail(staffRecordSDO.getId(), dto.getFamilyList());
 
         return user.getUserId();
     }
 
-    private void updateFamilyDetail(String id, List<StaffFamilyDetailDO> details) {
+    private void updateFamilyDetail(String userId, List<StaffFamilyDetailDO> details) {
         List<StaffFamilyDetailDO> detail = familyDOMapper.selectList(new LambdaQueryWrapperX<StaffFamilyDetailDO>()
-                .eq(StaffFamilyDetailDO::getStaffId, id));
+                .eq(StaffFamilyDetailDO::getUserId, userId));
         if (CollectionUtil.isNotEmpty(detail)) {
             Set<String> ids = convertSet(detail, StaffFamilyDetailDO::getId);
             familyDOMapper.deleteBatchIds(ids);
         }
 
         if (CollectionUtil.isNotEmpty(details)) {
-            details.forEach(v -> v.setStaffId(id));
+            details.forEach(v -> v.setUserId(userId));
             familyDOMapper.insertBatch(details);
         }
     }

+ 0 - 5
zjugis-module-adm/zjugis-module-adm-biz/src/main/resources/mapper/staff/SchoolDetailDOMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.zjugis.module.adm.dal.mysql.staff.SchoolDetailDOMapper">
-
-</mapper>