Browse Source

调岗bug修改+转正

jzh 1 year ago
parent
commit
c1ebcba828

+ 19 - 7
zjugis-business/src/main/java/com/zjugis/business/flow/regular/service/impl/RegularServiceImpl.java

@@ -1,6 +1,9 @@
 package com.zjugis.business.flow.regular.service.impl;
 package com.zjugis.business.flow.regular.service.impl;
 
 
+import com.alibaba.fastjson2.JSON;
+import com.zjugis.business.constants.DictConstants;
 import com.zjugis.business.constants.FlowStatusConstants;
 import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.converter.common.SelectConvert;
 import com.zjugis.business.converter.regular.RegularConvert;
 import com.zjugis.business.converter.regular.RegularConvert;
 import com.zjugis.business.flow.regular.controller.vo.RegularPageReqVO;
 import com.zjugis.business.flow.regular.controller.vo.RegularPageReqVO;
 import com.zjugis.business.flow.regular.controller.vo.RegularPageVO;
 import com.zjugis.business.flow.regular.controller.vo.RegularPageVO;
@@ -12,6 +15,9 @@ import com.zjugis.framework.common.pojo.PageResult;
 import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
 import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
 import com.zjugis.framework.workflow.model.IFlowInstance;
 import com.zjugis.framework.workflow.model.IFlowInstance;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.utils.Select;
+import com.zjugis.module.adm.api.staff.StaffApi;
+import com.zjugis.module.adm.api.staff.dto.StaffDeptPostDTO;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.user.AdminUserApi;
 import com.zjugis.module.system.api.user.AdminUserApi;
 import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
 import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
@@ -20,6 +26,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Objects;
 
 
@@ -39,6 +46,8 @@ public class RegularServiceImpl implements RegularService {
     @Resource
     @Resource
     private AdminUserApi adminUserApi;
     private AdminUserApi adminUserApi;
     @Resource
     @Resource
+    private StaffApi staffApi;
+    @Resource
     private RegularDAO regularDAO;
     private RegularDAO regularDAO;
 
 
 
 
@@ -54,11 +63,14 @@ public class RegularServiceImpl implements RegularService {
                 entity.setUserId(userId);
                 entity.setUserId(userId);
                 entity.setCreateTime(LocalDateTime.now());
                 entity.setCreateTime(LocalDateTime.now());
                 entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
                 entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
-                CommonResult<AdminUserRespDTO> result = adminUserApi.getUser(userId);
+                CommonResult<StaffDeptPostDTO> result = staffApi.getUser(userId);
+                StaffDeptPostDTO dto = result.getCheckedData();
                 if (result.isSuccess()) {
                 if (result.isSuccess()) {
-                    entity.setNickname(result.getData().getNickname());
-                    entity.setDeptId(result.getData().getDeptId());
-                    entity.setDeptName(result.getData().getDeptName());
+                    entity.setNickname(dto.getNickname());
+                    entity.setDeptId(dto.getDeptId());
+                    entity.setDeptName(dto.getDeptName());
+                    entity.setRgssj(dto.getRgssj());
+                    entity.setDrzw(dto.getPostName());
                 }
                 }
                 regularDAO.insert(entity);
                 regularDAO.insert(entity);
             }
             }
@@ -113,9 +125,9 @@ public class RegularServiceImpl implements RegularService {
     private Map<String, Object> createMap(String flowInstanceId, RegularDO entity, String userId) {
     private Map<String, Object> createMap(String flowInstanceId, RegularDO entity, String userId) {
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         map.put("formEntity", entity);
         map.put("formEntity", entity);
-        /*//查字典
-        List<Select> typeList = SelectConvert.INSTANCE.convertList(dictDataApi.getDictDataList(DictConstants.RECRUIT_DEMAND_TYPE).getCheckedData());
-        map.put("recruitType", JSON.toJSONString(typeList));*/
+        //查字典
+        List<Select> typeList = SelectConvert.INSTANCE.convertList(dictDataApi.getDictDataList(DictConstants.post_type).getCheckedData());
+        map.put("post_type", JSON.toJSONString(typeList));
         return map;
         return map;
     }
     }
 
 

+ 5 - 2
zjugis-business/src/main/resources/templates/JobTransfer/js/index.js

@@ -50,13 +50,16 @@
             data: JSON.stringify(postData.createReqVO),
             data: JSON.stringify(postData.createReqVO),
             contentType: "application/json",
             contentType: "application/json",
             success: function (res) {
             success: function (res) {
-                if (res && !(res.code === 0)) {
+                if (res && res.code === 200) {
+                    all({success: true});
+                } else {
+                    all({success: false});
                     z.ui.alertWarning(res.msg);
                     z.ui.alertWarning(res.msg);
-
                 }
                 }
             },
             },
 
 
             error: function () {
             error: function () {
+                all({success: false});
             }
             }
         })
         })
     }
     }

+ 8 - 8
zjugis-business/src/main/resources/templates/RegularStaff/index.ftl

@@ -23,24 +23,25 @@ styles=[ '/flow/css/formCommon.css' ]>
                     </td>
                     </td>
                     <td>
                     <td>
                         <div class="form-group">
                         <div class="form-group">
-                            <div class="form-item">
-                                <div class="z-comp-input" name="createReqVO$nickname">
-                                    <label>
-                                        <input type="text" value="${formEntity.nickname!}">
-                                    </label>
+                            <div class="z-comp-selectsearch" name="nickname">
+                                <input type="hidden" name="createReqVO$nickname" value="${formEntity.nickname!}">
+                                <input type="hidden" name="createReqVO$userId" value="${formEntity.userId!}">
+                                <div class="z-inputselect-bar">
+                                    <span> </span><i></i>
                                 </div>
                                 </div>
                             </div>
                             </div>
                         </div>
                         </div>
                     </td>
                     </td>
 
 
+
                     <td class="th">
                     <td class="th">
                         <div class="form-label ">岗位:</div>
                         <div class="form-label ">岗位:</div>
                     </td>
                     </td>
                     <td>
                     <td>
                         <div class="form-group">
                         <div class="form-group">
                             <div class="form-item">
                             <div class="form-item">
-                                <div class="z-comp-select z-readonly" name="createReqVO$post"
-                                     data='${post_type!}' value="${formEntity.post!}">
+                                <div class="z-comp-select z-readonly" name="createReqVO$drzw"
+                                     data='${post_type!}' value="${formEntity.drzw!}">
                                     <div class="z-inputselect-bar">
                                     <div class="z-inputselect-bar">
                                         <span></span><i></i>
                                         <span></span><i></i>
                                     </div>
                                     </div>
@@ -154,7 +155,6 @@ styles=[ '/flow/css/formCommon.css' ]>
                 <tr>
                 <tr>
 
 
 
 
-
                     <td class="th">
                     <td class="th">
                         <div class="form-label">指导人所属部门:</div>
                         <div class="form-label">指导人所属部门:</div>
                     </td>
                     </td>

+ 26 - 14
zjugis-business/src/main/resources/templates/RegularStaff/js/index.js

@@ -1,6 +1,14 @@
 (function () {
 (function () {
     window.onload = function (ex) {
     window.onload = function (ex) {
-        initDept();//所有部门列表查询
+
+        z.ui.selectsearch("[name=selectsearch]").bindEvents({
+            onAfterSelect: function (value, data) {
+                console.log(data)
+                console.log(value)
+            }
+        });
+
+        initStaff();//获取所有员工
         bindEvents();
         bindEvents();
     }
     }
 
 
@@ -11,17 +19,15 @@
     }
     }
 
 
 
 
-    /**
-     * 部门列表查询
-     */
-    function initDept() {
+    //新员工姓名查询
+    function initStaff() {
         z.ui.ajax({
         z.ui.ajax({
             type: "get",
             type: "get",
-            url: "/common/dept-tree",
-            data: {},
+            url: "/staff/page",
+            data: {"state": 1, "status": 90},
             success: function (res) {
             success: function (res) {
                 if (res && res.length > 0) {
                 if (res && res.length > 0) {
-                    selecttree("[name='deptTransferName']", res, clickDeptTransferName)
+
                 }
                 }
             },
             },
             error: function () {
             error: function () {
@@ -50,22 +56,28 @@
             data: JSON.stringify(postData.createReqVO),
             data: JSON.stringify(postData.createReqVO),
             contentType: "application/json",
             contentType: "application/json",
             success: function (res) {
             success: function (res) {
-                if (res && !(res.code === 0)) {
+                if (res && res.code === 200) {
+                    all({success: true});
+                } else {
+                    all({success: false});
                     z.ui.alertWarning(res.msg);
                     z.ui.alertWarning(res.msg);
-
                 }
                 }
             },
             },
 
 
             error: function () {
             error: function () {
+                all({success: false});
             }
             }
         })
         })
     }
     }
 
 
+    function clickUser(even, treeId, treeNode) {
+        $("[name='createReqVO$nickname']").val(treeNode.name);
+        $("[name='createReqVO$userId']").val(treeNode.id);
+    }
 
 
-    //调任部门
-    function clickDeptTransferName(even, treeId, treeNode) {
-        $("[name='createReqVO$deptTransferName']").val(treeNode.name);
-        $("[name='createReqVO$deptId']").val(treeNode.id);
+    function clickZDR(even, treeId, treeNode) {
+        $("[name='createReqVO$zdrmc']").val(treeNode.name);
+        $("[name='createReqVO$zdr']").val(treeNode.id);
     }
     }
 
 
 }());
 }());

+ 5 - 2
zjugis-business/src/main/resources/templates/Staff/js/index.js

@@ -54,13 +54,16 @@
             data: JSON.stringify(postData.createReqVO),
             data: JSON.stringify(postData.createReqVO),
             contentType: "application/json",
             contentType: "application/json",
             success: function (res) {
             success: function (res) {
-                if (res && !(res.code === 0)) {
+                if (res && res.code === 200) {
+                    all({success: true});
+                } else {
+                    all({success: false});
                     z.ui.alertWarning(res.msg);
                     z.ui.alertWarning(res.msg);
-
                 }
                 }
             },
             },
 
 
             error: function () {
             error: function () {
+                all({success: false});
             }
             }
         })
         })
     }
     }

+ 3 - 0
zjugis-module-adm/zjugis-module-adm-api/src/main/java/com/zjugis/module/adm/api/staff/dto/StaffDeptPostDTO.java

@@ -2,6 +2,8 @@ package com.zjugis.module.adm.api.staff.dto;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
+import java.time.LocalDateTime;
+
 /**
 /**
  * @author jzh
  * @author jzh
  * @since 2024/3/5 9:35
  * @since 2024/3/5 9:35
@@ -13,4 +15,5 @@ public class StaffDeptPostDTO {
     private String userId;
     private String userId;
     private String postName;
     private String postName;
     private String nickname;
     private String nickname;
+    private LocalDateTime rgssj;
 }
 }

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

@@ -100,7 +100,7 @@ public class RecordsServiceImpl implements RecordsService {
 
 
     @Override
     @Override
     public RecordsRespVO getRecordDetail(String userId) {
     public RecordsRespVO getRecordDetail(String userId) {
-        //计算年假  这里计算根据入职时间到现在的年份
+        //计算司领  这里计算根据入职时间到现在的年份
         StaffRecordSDO staffRecordSDO = recordsMapper.selectOne(new LambdaQueryWrapperX<StaffRecordSDO>().eq(StaffRecordSDO::getUserId, userId));
         StaffRecordSDO staffRecordSDO = recordsMapper.selectOne(new LambdaQueryWrapperX<StaffRecordSDO>().eq(StaffRecordSDO::getUserId, userId));
         if (staffRecordSDO == null) {
         if (staffRecordSDO == null) {
             throw exception(STAFF_NOT_EXISTS);
             throw exception(STAFF_NOT_EXISTS);