Prechádzať zdrojové kódy

入职办理 已离职员工重新办理

jzh 1 rok pred
rodič
commit
4ad2db4694

+ 9 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/staff/controller/StaffController.java

@@ -8,6 +8,7 @@ import com.zjugis.framework.common.pojo.PageResult;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.workflow.WorkFlow;
 import com.zjugis.module.adm.api.staff.dto.StaffDeptPostDTO;
+import com.zjugis.module.adm.api.staff.dto.StaffRecordsDTO;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -100,9 +101,16 @@ public class StaffController extends BaseController {
     }
 
     @GetMapping("/getStaff")
-    @Operation(summary = "根据用户id获取职工详情")
+    @Operation(summary = "根据用户id获取职工简略信息")
     public CommonResult<StaffDeptPostDTO> getStaff(@RequestParam("userId") String userId) {
         return CommonResult.success(staffService.getStaff(userId));
     }
 
+
+    @GetMapping("/getStaffDetail")
+    @Operation(summary = "根据用户id获取职工详情")
+    public CommonResult<StaffRecordsDTO> getStaffDetail(@RequestParam("userId") String userId) {
+        return CommonResult.success(staffService.getStaffResignDetail(userId));
+    }
+
 }

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/staff/service/StaffService.java

@@ -7,6 +7,7 @@ import com.zjugis.business.flow.staff.entity.StaffDO;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.common.pojo.PageResult;
 import com.zjugis.module.adm.api.staff.dto.StaffDeptPostDTO;
+import com.zjugis.module.adm.api.staff.dto.StaffRecordsDTO;
 
 import java.util.Map;
 
@@ -50,4 +51,6 @@ public interface StaffService {
     String generateNum();
 
     StaffDeptPostDTO getStaff(String userId);
+
+    StaffRecordsDTO getStaffResignDetail(String userId);
 }

+ 6 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/staff/service/impl/StaffServiceImpl.java

@@ -19,6 +19,7 @@ import com.zjugis.framework.workflow.model.IFlowInstance;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
 import com.zjugis.module.adm.api.staff.StaffApi;
 import com.zjugis.module.adm.api.staff.dto.StaffDeptPostDTO;
+import com.zjugis.module.adm.api.staff.dto.StaffRecordsDTO;
 import com.zjugis.module.adm.api.staff.dto.StaffStateDTO;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.dict.dto.DictDataRespDTO;
@@ -139,6 +140,11 @@ public class StaffServiceImpl implements StaffService {
         return dto;
     }
 
+    @Override
+    public StaffRecordsDTO getStaffResignDetail(String userId) {
+        return staffApi.getStaffResign(userId).getCheckedData();
+    }
+
     private PageResult<StaffVO> encapsulatePage(PageResult<StaffDO> page) {
         return StaffConvert.INSTANCE.convertList(page);
     }

+ 72 - 6
zjugis-business/src/main/resources/templates/Staff/js/index.js

@@ -31,6 +31,8 @@
     }
 
 
+
+
     function initUser() {
         z.ui.ajax({
             type: "get",
@@ -109,18 +111,82 @@
      * 离职员工回归
      */
     function backPerson() {
-        debugger
+
         z.ui.inputsearch("[name='createReqVO$nickname']").bindEvents({
             onAfterSelect: function (value, data) {
-                console.log(value)
-                console.log(data)
+                var userId = null;
+                // 遍历 data 列表
+                $.each(data, function (index, item) {
+                    if (item.text === value) {
+                        userId = item.userId;
+                        return false; // 结束循环
+                    }
+                });
+
+                //根据用户id 获取用户的详情 并赋值到前端
+                selectStaffResign(userId, function (staff) {
+
+                    z.ui.input("[name='createReqVO$userId']").setValue(staff.userId);
+                    z.ui.input("[name='createReqVO$cardid']").setValue(staff.cardid);
+                    z.ui.input("[name='createReqVO$mobilePhone']").setValue(staff.mobilePhone);
+                    z.ui.select("[name='createReqVO$sex']").setValue(staff.sex + "");
+                    z.ui.select("[name='createReqVO$nation']").setValue(staff.nation + "");
+                    z.ui.laydate("[name='createReqVO$birthday']").setValue(moment(staff.birthday).format('YYYY-MM-DD'));
+                    z.ui.select("[name='createReqVO$hyzk']").setValue(staff.hyzk + "");
+                    z.ui.select("[name='createReqVO$hkxz']").setValue(staff.hkxz + "");
+                    z.ui.select("[name='createReqVO$zzmm']").setValue(staff.zzmm + "");
+                    z.ui.input("[name='createReqVO$hkszd']").setValue(staff.hkszd);
+                    z.ui.input("[name='createReqVO$xjzdz']").setValue(staff.xjzdz);
+                    z.ui.select("[name='createReqVO$drzw']").setValue(staff.drzw + "");
+                    z.ui.select("[name='createReqVO$state']").setValue(staff.state + "");
+                    z.ui.select("[name='createReqVO$sfytd']").setValue(staff.sfytd + "");
+                    z.ui.laydate("[name='createReqVO$cjgzsj']").setValue(moment(staff.cjgzsj).format('YYYY-MM-DD'));
+                    z.ui.laydate("[name='createReqVO$htqdsj']").setValue(moment(staff.htqdsj).format('YYYY-MM-DD'));
+                    z.ui.laydate("[name='createReqVO$htdqs']").setValue(moment(staff.htdqs).format('YYYY-MM-DD'));
+                    z.ui.laydate("[name='createReqVO$rgssj']").setValue(moment(staff.rgssj).format('YYYY-MM-DD'));
+                    z.ui.input("[name='createReqVO$cssl']").setValue(staff.cssl);
+                    z.ui.input("[name='createReqVO$nj']").setValue(staff.nj);
+                    z.ui.input("[name='createReqVO$khyh']").setValue(staff.khyh);
+                    z.ui.input("[name='createReqVO$yhzh']").setValue(staff.yhzh);
+                    z.ui.input("[name='createReqVO$byxx']").setValue(staff.byxx);
+                    z.ui.laydate("[name='createReqVO$bysj']").setValue(moment(staff.bysj).format('YYYY-MM-DD'));
+                    z.ui.input("[name='createReqVO$major']").setValue(staff.major);
+                    z.ui.select("[name='createReqVO$zgxl']").setValue(staff.zgxl + "");
+                    z.ui.input("[name='createReqVO$jjlxrxm']").setValue(staff.jjlxrxm);
+                    z.ui.input("[name='createReqVO$jjlxrhm']").setValue(staff.jjlxrhm);
+                    z.ui.select("[name='createReqVO$jjlxrgx']").setValue(staff.jjlxrgx + "");
+
+                    z.ui.selecttree("[name='qdgs']").setValue(staff.qdgsid)
+                    z.ui.input("[name='createReqVO$qdgsid']").setValue(staff.qdgsid);
+                    z.ui.input("[name='createReqVO$qdgs']").setValue(staff.qdgs);
+
+                    z.ui.selecttree("[name='deptName']").setValue(staff.deptId)
+                    z.ui.input("[name='createReqVO$deptName']").setValue(staff.deptName);
+                    z.ui.input("[name='createReqVO$deptId']").setValue(staff.deptId);
+
+                    z.ui.selecttree("[name='zdr']").setValue(staff.zdr)
+                    z.ui.input("[name='createReqVO$zdr']").setValue(staff.zdr);
+                    z.ui.input("[name='createReqVO$zdrmc']").setValue(staff.zdrmc);
+                });
             }
         });
     }
 
-    function clickResign(even, treeId, treeNode) {
-        $("[name='createReqVO$nickname']").val(treeNode.name);
-        $("[name='createReqVO$userId']").val(treeNode.id);
+
+    function selectStaffResign(userId, callback) {
+        $.ajax({
+            type: "GET",
+            url: "/staff/getStaffDetail",
+            data: {userId: userId}, // 请求参数应该以对象形式传递
+            contentType: "application/json",
+            success: function (res) {
+                // 在这里处理成功获取到的数据,你可以根据需要调用回调函数
+                callback(res.data);
+            },
+            error: function () {
+
+            }
+        });
     }
 
     //部门

+ 5 - 0
zjugis-module-adm/zjugis-module-adm-api/src/main/java/com/zjugis/module/adm/api/staff/StaffApi.java

@@ -46,4 +46,9 @@ public interface StaffApi {
     @GetMapping(PREFIX + "/getResignStaffList")
     @Operation(description = "获取离职员工列表")
     CommonResult<List<StaffStateDTO>> getResignStaffList();
+
+
+    @GetMapping(PREFIX + "/getStaffResign")
+    @Operation(description = "获取用户档案信息")
+    CommonResult<StaffRecordsDTO> getStaffResign(@RequestParam("userId") String userId);
 }

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

@@ -67,4 +67,9 @@ public class StaffApiImpl implements StaffApi {
     public CommonResult<List<StaffStateDTO>> getResignStaffList() {
         return success(recordsService.getResignStaffList());
     }
+
+    @Override
+    public CommonResult<StaffRecordsDTO> getStaffResign(String userId) {
+        return success(RecordsConvert.INSTANCE.convertDetailResign(recordsService.getRecordDetail(userId)));
+    }
 }

+ 2 - 0
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/convert/staff/RecordsConvert.java

@@ -30,6 +30,8 @@ public interface RecordsConvert {
 
     StaffRecordSDO convertDetail(StaffRecordsDTO recordsBaseVO);
 
+
+    StaffRecordsDTO convertDetailResign(RecordsRespVO vo);
     RecordsRespVO convertDetailToVO(StaffRecordsDTO dto);
 
     StaffDeptPostDTO convertDeptPost(RecordsBaseVO recordsBaseVO);