瀏覽代碼

人才后备库新增字段+实习生录用审批

jzh 11 月之前
父節點
當前提交
0965c1b9a8

+ 28 - 0
zjugis-business/src/main/java/com/zjugis/business/converter/intern/InternConvert.java

@@ -0,0 +1,28 @@
+package com.zjugis.business.converter.intern;
+
+import com.zjugis.business.flow.intern.controller.vo.InternVO;
+import com.zjugis.business.flow.intern.entity.InternDO;
+import com.zjugis.business.flow.interview.controller.vo.InterviewVO;
+import com.zjugis.business.flow.interview.entity.InterviewDO;
+import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.module.adm.api.staff.dto.StaffReportDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+/**
+ * @author jzh
+ * @since 2024/2/21 9:48
+ */
+@Mapper
+public interface InternConvert {
+
+    InternConvert INSTANCE = Mappers.getMapper(InternConvert.class);
+
+    InternDO convert(InternVO vo);
+
+    PageResult<InternVO> convertPage(PageResult<InternDO> page);
+
+    StaffReportDTO convert02(InternDO interviewDO);
+
+    InternVO convert01(InternDO entity);
+}

+ 116 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/controller/InternController.java

@@ -0,0 +1,116 @@
+package com.zjugis.business.flow.intern.controller;
+
+import com.zjugis.business.flow.intern.controller.dto.InternPageDTO;
+import com.zjugis.business.flow.intern.controller.vo.InternVO;
+import com.zjugis.business.flow.intern.service.InternService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.framework.workflow.model.BaseController;
+import com.zjugis.framework.workflow.workflow.WorkFlow;
+import com.zjugis.framework.workflow.workflow.WorkFlowMobile;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 工作流-实习生录用审批
+ *
+ * @author jzh
+ * @since 2024/2/21 9:31
+ */
+@Tag(name = "工作流程 - 实习生录用审批")
+@RestController
+@RequestMapping("/intern")
+@Validated
+public class InternController extends BaseController {
+
+    @Resource
+    private InternService internService;
+
+    /**
+     * 实习生录用审批表单生成
+     */
+    @WorkFlow(isReceiveMaterial = true, isReceiveOpinion = true)
+    @ResponseBody
+    @GetMapping("/index")
+    @Operation(summary = "实习生录用审批表单生成")
+    public String index(String activityTemplateId, String flowInstanceId, String userId) throws Exception {
+        Map<String, Object> map = internService.getFormParams(flowInstanceId);
+        return resultPage(map);
+    }
+
+
+    /**
+     * 实习生录用审批表单生成 钉钉端
+     */
+    @WorkFlowMobile(isReceiveMaterial = true, isReceiveOpinion = true)
+    @ResponseBody
+    @GetMapping("/mobileIndex")
+    @Operation(summary = "实习生录用审批表单生成")
+    public String mobileIndex(String activityTemplateId, String flowInstanceId, String userId) throws Exception {
+        Map<String, Object> map = internService.getFormParams(flowInstanceId);
+        return resultPage(map);
+    }
+
+    /**
+     * 实习生录用审批表单生成 vue
+     */
+    @GetMapping("/mobileAdd")
+    public CommonResult<InternVO> mobileAdd(String activityTemplateId, String flowInstanceId, String userId){
+        return CommonResult.success(internService.flowAdd(flowInstanceId, userId));
+    }
+
+
+    /**
+     * 实习生录用审批列表查询
+     */
+    @GetMapping("/page")
+    @Operation(summary = "实习生录用审批列表")
+    public CommonResult<PageResult<InternVO>> getPage(@Valid InternPageDTO dto) {
+        return CommonResult.success(internService.getPage(dto));
+    }
+
+
+
+
+    /**
+     * 创建实习生录用审批
+     */
+    @PostMapping("/create")
+    @Operation(summary = "创建实习生录用审批")
+    public String create(@Valid @RequestBody InternVO vo) {
+        return success(internService.create(vo));
+    }
+
+
+    /**
+     * 更新实习生录用审批
+     */
+    @PostMapping("/update")
+    @Operation(summary = "更新实习生录用审批")
+    public String update(@Valid @RequestBody InternVO vo) {
+        internService.update(vo);
+        return success(true);
+    }
+
+    /**
+     * 删除实习生录用审批
+     *
+     * @param id
+     * @return
+     */
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除实习生录用审批")
+    @Parameter(name = "id", description = "编号", required = true)
+    public String delete(@RequestParam("id") String id) {
+        internService.delete(id);
+        return success(true);
+    }
+
+}

+ 27 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/controller/dto/InternPageDTO.java

@@ -0,0 +1,27 @@
+package com.zjugis.business.flow.intern.controller.dto;
+
+import com.zjugis.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+/**
+ * @author jzh
+ * @since 2024/2/28 15:32
+ */
+@Data
+public class InternPageDTO extends PageParam {
+    @Schema(description = "员工姓名")
+    private String nickname;
+
+    @Schema(description = "部门ID")
+    private String deptId;
+
+    @Schema(description = "岗位")
+    private Integer ypgw;
+
+    @Schema(description = "等级初定")
+    private Integer djcd;
+
+    @Schema(description = "流程状态")
+    private Integer status;
+}

+ 274 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/controller/vo/InternPageVO.java

@@ -0,0 +1,274 @@
+package com.zjugis.business.flow.intern.controller.vo;
+
+import com.zjugis.framework.common.pojo.PageParam;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author jzh
+ * @since 2024/2/21 9:51
+ */
+@Data
+public class InternPageVO extends PageParam {
+    /**
+     * 主键ID
+     */
+    private String id;
+
+    /**
+     * 流程实例ID
+     */
+    private String instanceId;
+
+    /**
+     * 流程状态
+     */
+    private Integer flowStatus;
+
+    /**
+     * 流程完成时间
+     */
+    private LocalDateTime flowFinishtime;
+
+    /**
+     * 用户ID
+     */
+    private String userId;
+
+    /**
+     * 用户名
+     */
+    private String nickname;
+
+
+    /**
+     * 部门ID
+     */
+    private String deptId;
+
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+
+    /**
+     * 应聘岗位
+     */
+    private String ypgw;
+
+
+    /**
+     * 面试时间
+     */
+    private LocalDateTime mssj;
+
+    /**
+     * 仪容仪表分值
+     */
+    private Integer yrybf;
+
+    /**
+     * 仪容仪表评语
+     */
+    private String yrybp;
+
+    /**
+     * 说服力分值
+     */
+    private Integer sflf;
+
+    /**
+     * 说服力评语
+     */
+    private String sflp;
+
+    /**
+     * 商务礼仪分值
+     */
+    private Integer swlyf;
+
+    /**
+     * 商务礼仪评语
+     */
+    private String swlyp;
+
+    /**
+     * 抗压性分值
+     */
+    private Integer kyxf;
+
+    /**
+     * 抗压性评语
+     */
+    private String kyxp;
+
+    /**
+     * 沟通分值
+     */
+    private Integer gtf;
+
+    /**
+     * 沟通评语
+     */
+    private String gtp;
+
+    /**
+     * 出差分值
+     */
+    private Integer ccf;
+
+    /**
+     * 出差评语
+     */
+    private String ccp;
+
+    /**
+     * 态度分值
+     */
+    private Integer tdf;
+
+    /**
+     * 态度评语
+     */
+    private String tdp;
+
+    /**
+     * 学习力分值
+     */
+    private Integer xxlf;
+
+    /**
+     * 学习力评语
+     */
+    private String xxlp;
+
+    /**
+     * 证件交验情况
+     */
+    private String zjjy;
+
+    /**
+     * 初试意见
+     */
+    private String csyj;
+
+    /**
+     * 部门意见-结论
+     */
+    private String bmyjjl;
+
+    /**
+     * 部门意见-建议等级
+     */
+    private String bmyjjydj;
+
+    /**
+     * 部门意见-试用期工资
+     */
+    private BigDecimal bmyjsyxz;
+
+    /**
+     * 部门意见-转正工资
+     */
+    private BigDecimal bmyjzzxz;
+
+    /**
+     * 用工性质
+     */
+    private String ygxz;
+
+    /**
+     * 等级初定
+     */
+    private String djcd;
+
+    /**
+     * 试用期基本工资
+     */
+    private BigDecimal syjbyx;
+
+    /**
+     * 试用期基本绩效
+     */
+    private BigDecimal syjx;
+
+    /**
+     * 转正基本工资
+     */
+    private BigDecimal zzjbyx;
+
+    /**
+     * 转正基本绩效
+     */
+    private BigDecimal zzjx;
+
+    /**
+     * 拟定劳务期 (年)
+     */
+    private Integer lwq;
+
+    /**
+     * 试用期(月)
+     */
+    private Integer syq;
+
+    /**
+     * 分配岗位
+     */
+    private String fpgw;
+
+    /**
+     * 报到日期
+     */
+    private LocalDateTime bdrq;
+    /**
+     * 登录名称
+     */
+    private String loginName;
+    /**
+     * 身份证号
+     */
+    private String sfzh;
+    /**
+     * 性别
+     */
+    private Integer sex;
+    /**
+     * 手机号
+     */
+    private String mobile;
+    /**
+     * 业务技术
+     */
+    private String ywjs;
+
+    /**
+     * 项目能力
+     */
+    private String xmnl;
+
+    /**
+     * 沟通表达
+     */
+    private String gtbd;
+
+    /**
+     * 综合评价
+     */
+    private String zhpj;
+
+    /**
+     * 面试官id
+     */
+    private String msgid;
+
+    /**
+     * 面试官姓名
+     */
+    private String msgxm;
+
+}

+ 277 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/controller/vo/InternVO.java

@@ -0,0 +1,277 @@
+package com.zjugis.business.flow.intern.controller.vo;
+
+import com.zjugis.framework.common.validation.IdCard;
+import com.zjugis.framework.common.validation.Mobile;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author jzh
+ * @since 2024/2/21 9:51
+ */
+@Data
+public class InternVO {
+    /**
+     * 主键ID
+     */
+    private String id;
+
+    /**
+     * 流程实例ID
+     */
+    private String instanceId;
+
+    /**
+     * 流程状态
+     */
+    private Integer flowStatus;
+
+    /**
+     * 流程完成时间
+     */
+    private LocalDateTime flowFinishtime;
+
+    /**
+     * 用户ID
+     */
+    private String userId;
+
+    /**
+     * 用户名
+     */
+    private String nickname;
+
+
+    /**
+     * 部门ID
+     */
+    private String deptId;
+
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+
+    /**
+     * 应聘岗位
+     */
+    private String ypgw;
+
+
+    /**
+     * 面试时间
+     */
+    private LocalDateTime mssj;
+
+    /**
+     * 仪容仪表分值
+     */
+    private Integer yrybf;
+
+    /**
+     * 仪容仪表评语
+     */
+    private String yrybp;
+
+    /**
+     * 说服力分值
+     */
+    private Integer sflf;
+
+    /**
+     * 说服力评语
+     */
+    private String sflp;
+
+    /**
+     * 商务礼仪分值
+     */
+    private Integer swlyf;
+
+    /**
+     * 商务礼仪评语
+     */
+    private String swlyp;
+
+    /**
+     * 抗压性分值
+     */
+    private Integer kyxf;
+
+    /**
+     * 抗压性评语
+     */
+    private String kyxp;
+
+    /**
+     * 沟通分值
+     */
+    private Integer gtf;
+
+    /**
+     * 沟通评语
+     */
+    private String gtp;
+
+    /**
+     * 出差分值
+     */
+    private Integer ccf;
+
+    /**
+     * 出差评语
+     */
+    private String ccp;
+
+    /**
+     * 态度分值
+     */
+    private Integer tdf;
+
+    /**
+     * 态度评语
+     */
+    private String tdp;
+
+    /**
+     * 学习力分值
+     */
+    private Integer xxlf;
+
+    /**
+     * 学习力评语
+     */
+    private String xxlp;
+
+    /**
+     * 证件交验情况
+     */
+    private String zjjy;
+
+    /**
+     * 初试意见
+     */
+    private String csyj;
+
+    /**
+     * 部门意见-结论
+     */
+    private String bmyjjl;
+
+    /**
+     * 部门意见-建议等级
+     */
+    private String bmyjjydj;
+
+    /**
+     * 部门意见-试用期工资
+     */
+    private BigDecimal bmyjsyxz;
+
+    /**
+     * 部门意见-转正工资
+     */
+    private BigDecimal bmyjzzxz;
+
+    /**
+     * 用工性质
+     */
+    private String ygxz;
+
+    /**
+     * 等级初定
+     */
+    private String djcd;
+
+    /**
+     * 试用期基本工资
+     */
+    private BigDecimal syjbyx;
+
+    /**
+     * 试用期基本绩效
+     */
+    private BigDecimal syjx;
+
+    /**
+     * 转正基本工资
+     */
+    private BigDecimal zzjbyx;
+
+    /**
+     * 转正基本绩效
+     */
+    private BigDecimal zzjx;
+
+    /**
+     * 拟定劳务期 (年)
+     */
+    private Integer lwq;
+
+    /**
+     * 试用期(月)
+     */
+    private Integer syq;
+
+    /**
+     * 分配岗位
+     */
+    private String fpgw;
+    /**
+     * 报到日期
+     */
+    private LocalDateTime bdrq;
+
+    /**
+     * 登录名称
+     */
+    private String loginName;
+    /**
+     * 身份证号
+     */
+    @IdCard
+    private String sfzh;
+    /**
+     * 性别
+     */
+    private Integer sex;
+    /**
+     * 手机号
+     */
+    @Mobile
+    private String mobile;
+    /**
+     * 业务技术
+     */
+    private String ywjs;
+
+    /**
+     * 项目能力
+     */
+    private String xmnl;
+
+    /**
+     * 沟通表达
+     */
+    private String gtbd;
+
+    /**
+     * 综合评价
+     */
+    private String zhpj;
+
+    /**
+     * 面试官id
+     */
+    private String msgid;
+
+    /**
+     * 面试官姓名
+     */
+    private String msgxm;
+
+}

+ 31 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/dao/InternDAO.java

@@ -0,0 +1,31 @@
+package com.zjugis.business.flow.intern.dao;
+
+import com.zjugis.business.flow.intern.controller.dto.InternPageDTO;
+import com.zjugis.business.flow.intern.controller.vo.InternPageVO;
+import com.zjugis.business.flow.intern.entity.InternDO;
+import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.framework.mybatis.core.mapper.BaseMapperX;
+import com.zjugis.framework.mybatis.core.query.LambdaQueryWrapperX;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author jzh
+ * @since 2024/2/21 9:39
+ */
+@Mapper
+public interface InternDAO extends BaseMapperX<InternDO> {
+
+    default InternDO findByInstanceId(String flowInstanceId) {
+        return selectOne(new LambdaQueryWrapperX<InternDO>().eqIfPresent(InternDO::getInstanceId, flowInstanceId));
+    }
+
+    default PageResult<InternDO> getPage(InternPageDTO dto) {
+        return selectPage(dto, new LambdaQueryWrapperX<InternDO>()
+                .likeIfPresent(InternDO::getNickname, dto.getNickname())
+                .eqIfPresent(InternDO::getDeptId, dto.getDeptId())
+                .eqIfPresent(InternDO::getYpgw, dto.getYpgw())
+                .eq(InternDO::getFlowStatus, 90)
+                .orderByDesc(InternDO::getLatestModifyTime)
+        );
+    }
+}

+ 122 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/entity/InternDO.java

@@ -0,0 +1,122 @@
+package com.zjugis.business.flow.intern.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.zjugis.business.mybatis.entity.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+
+@Data
+@TableName(value = "WF_INTERN")
+public class InternDO extends BaseEntity {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    private String id;
+
+    /**
+     * 流程实例ID
+     */
+    private String instanceId;
+
+    /**
+     * 流程状态
+     */
+    private Integer flowStatus;
+
+    /**
+     * 流程完成时间
+     */
+    private LocalDateTime flowFinishtime;
+
+    /**
+     * 用户ID
+     */
+    private String userId;
+
+    /**
+     * 用户名
+     */
+    private String nickname;
+
+
+    /**
+     * 部门ID
+     */
+    private String deptId;
+
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+
+    /**
+     * 应聘岗位
+     */
+    private String ypgw;
+
+
+    /**
+     * 开始实习日期
+     */
+    private LocalDateTime ssxrq;
+
+    /**
+     * 结束实习日期
+     */
+    private LocalDateTime esxrq;
+
+    /**
+     * 实习期  月
+     */
+    private Integer sxq;
+
+    /**
+     * 申请录用日期
+     */
+    private LocalDateTime applyTime;
+
+    /**
+     * 实习期工作报告
+     */
+    private String report;
+
+    /**
+     * 部门经理录用意见 是否同意
+     */
+    private String bmjlly;
+
+    /**
+     * 综合管理部录用意见 是否同意
+     */
+    private String zhglly;
+
+    /**
+     * 试用期 录用薪资
+     */
+    private BigDecimal syxz;
+
+    /**
+     * 转正录用薪资
+     */
+    private BigDecimal zzxz;
+
+    /**
+     * 等级
+     */
+    private String nldj;
+
+    /**
+     * 实习期抵消试用期
+     */
+    private Integer dxsyq;
+
+
+}

+ 245 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/event/InternEvent.java

@@ -0,0 +1,245 @@
+package com.zjugis.business.flow.intern.event;
+
+import com.zjugis.business.flow.intern.entity.InternDO;
+import com.zjugis.business.flow.intern.service.InternService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
+import com.zjugis.framework.workflow.exception.BusinessException;
+import com.zjugis.framework.workflow.model.BaseController;
+import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.spring.resovler.ParamModel;
+import com.zjugis.module.adm.api.staff.StaffApi;
+import com.zjugis.module.system.api.dept.DeptApi;
+import com.zjugis.module.system.api.dept.DeptLeaderApi;
+import com.zjugis.module.system.api.dept.dto.DeptLeaderRespDTO;
+import com.zjugis.module.system.api.dept.dto.DeptRespDTO;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.*;
+
+import static com.zjugis.business.constants.FlowStatusConstants.*;
+
+/**
+ * 工作流-实习生录用审批归档
+ *
+ * @author jzh
+ * @since 2024/2/26 13:28
+ */
+@Slf4j
+@RestController
+@RequestMapping("/intern-event")
+public class InternEvent extends BaseController {
+
+    @Resource
+    private InternService internService;
+    @Autowired
+    WorkflowClient workflowClient;
+
+    @Autowired
+    DeptApi deptApi;
+    @Resource
+    private DeptLeaderApi deptLeaderApi;
+
+    @Autowired
+    AdminUserApi adminUserApi;
+    @Resource
+    private StaffApi staffApi;
+
+    /**
+     * 设置流程描述
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 活动实例
+     */
+    @PostMapping("/setFlowDesc")
+    public String setFlowDesc(@ParamModel Map flowInstance, @ParamModel Map activityInstance) {
+        try {
+            if (!Objects.isNull(activityInstance) && activityInstance.containsKey("flowInstanceId")) {
+                String flowInstanceId = activityInstance.get("flowInstanceId").toString();
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+                String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+                entity.setFlowStatus(FLOW_PROCESS);
+                internService.update(entity);
+                workflowClient.saveFlowDescribe(flowInstanceId, flowDesc);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 流程归档事件
+     *
+     * @param flowInstance                  流程实例
+     * @param triggerFinishActivityInstance 触发归档的结束活动实例
+     */
+    @Transactional
+    @PostMapping("/flowArchingEvent")
+    public String flowArchingEvent(@ParamModel Map flowInstance, @ParamModel Map triggerFinishActivityInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_FINISHED);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                entity.setReport("0");
+                internService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废事件
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 申请作废所在活动实例
+     * @param nullyApplyUserId 作废申请人ID
+     */
+    @PostMapping("/nullyEvent")
+    public String nullyEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_NULLY);
+                entity.setIsvalid(0);
+                internService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废恢复事件
+     *
+     * @param flowInstance      流程实例
+     * @param activityInstance  申请作废所在活动实例
+     * @param nullyApplyUserId  作废申请人ID
+     * @param nullyRecoverserId 作废恢复人ID
+     */
+    @PostMapping("/nullyRecoverEvent")
+    public String nullyRecoverEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyRecoverserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FLOW_PROCESS);
+                entity.setIsvalid(1);
+                internService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 彻底作废事件
+     *
+     * @param flowInstance        流程实例
+     * @param activityInstance    申请作废所在活动实例
+     * @param nullyApplyUserId    作废申请人ID
+     * @param nullyCompleteUserId 彻底作废人ID
+     */
+    @PostMapping("/nullyCompleteEvent")
+    public String nullyCompleteEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyCompleteUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                internService.delete(entity.getId());
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    /**
+     * 转到部门经理
+     */
+    @PostMapping("/to-dept-manager")
+    public String toDeptManager(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                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());
+                        userMaps.add(map);
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    /**
+     * 转到分管领导
+     */
+    @PostMapping("/to-dept-manager-leader")
+    public String toDeptManagerLeader(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                InternDO entity = internService.findByInstanceId(flowInstanceId);
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                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<>();
+                        map.put("id", deptLeaderRespDTO.getUserId());
+                        userMaps.add(map);
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+}

+ 49 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/service/InternService.java

@@ -0,0 +1,49 @@
+package com.zjugis.business.flow.intern.service;
+
+import com.zjugis.business.flow.intern.controller.dto.InternPageDTO;
+import com.zjugis.business.flow.intern.controller.vo.InternVO;
+import com.zjugis.business.flow.intern.entity.InternDO;
+import com.zjugis.framework.common.pojo.PageResult;
+
+import java.util.List;
+import java.util.Map;
+
+public interface InternService {
+
+    /**
+     * 创建入职流程
+     */
+    String create(InternVO vo);
+
+    /**
+     * 更新入职流程
+     */
+    void update(InternVO vo);
+
+    void update(InternDO internDO);
+
+
+    /**
+     * 删除入职流程
+     */
+    void delete(String id);
+
+    /**
+     * 通过流程实例ID查找记录
+     */
+    InternDO findByInstanceId(String flowInstanceId);
+
+    /**
+     * 获取表单参数
+     */
+    Map<String, Object> getFormParams(String flowInstanceId);
+
+    /**
+     * 列表查询
+     */
+    PageResult<InternVO> getPage(InternPageDTO dto);
+
+
+    InternVO flowAdd(String flowInstanceId, String userId);
+
+}

+ 205 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/intern/service/InternServiceImpl.java

@@ -0,0 +1,205 @@
+package com.zjugis.business.flow.intern.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson2.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.zjugis.business.constants.DictConstants;
+import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.converter.common.SelectConvert;
+import com.zjugis.business.converter.intern.InternConvert;
+import com.zjugis.business.converter.interview.InterviewConvert;
+import com.zjugis.business.flow.intern.controller.dto.InternPageDTO;
+import com.zjugis.business.flow.intern.controller.vo.InternVO;
+import com.zjugis.business.flow.intern.dao.InternDAO;
+import com.zjugis.business.flow.intern.entity.InternDO;
+import com.zjugis.business.flow.staff.controller.dto.StaffDictDTO;
+import com.zjugis.business.utils.IdCardUtil;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
+import com.zjugis.framework.mybatis.core.query.LambdaQueryWrapperX;
+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.StaffReportDTO;
+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;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.*;
+
+import static com.zjugis.business.enums.ErrorCodeConstants.INTERVIEW_NOT_EXISTS;
+import static com.zjugis.business.enums.ErrorCodeConstants.MOBILE_EXIST;
+import static com.zjugis.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * @author jzh
+ * @since 2024/2/21 9:34
+ */
+@Service
+public class InternServiceImpl implements InternService {
+
+
+    @Resource
+    private DictDataApi dictDataApi;
+    @Resource
+    private StaffApi staffApi;
+    @Resource
+    private WorkflowClient workflowClient;
+    @Resource
+    private AdminUserApi adminUserApi;
+    @Resource
+    private InternDAO internDAO;
+
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public String create(InternVO vo) {
+        InternDO interviewDO = InternConvert.INSTANCE.convert(vo);
+        internDAO.insert(interviewDO);
+        return interviewDO.getId();
+    }
+
+    @Override
+    public void update(InternVO vo) {
+        InternDO interviewDO = InternConvert.INSTANCE.convert(vo);
+        update(interviewDO);
+
+
+        //保存时生成流程描述
+        InternDO entity = internDAO.selectById(interviewDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
+    }
+
+
+    private void validMobile(String mobile) {
+        //校验手机号唯一
+        if (staffApi.validMobile(mobile).getCheckedData() > 0) {
+            throw exception(MOBILE_EXIST);
+        }
+    }
+
+    @Override
+    public void update(InternDO interviewDO) {
+        validateExists(interviewDO.getId());
+        internDAO.updateById(interviewDO);
+    }
+
+
+    private void validateExists(String id) {
+        if (internDAO.selectById(id) == null) {
+            throw exception(INTERVIEW_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public void delete(String id) {
+        validateExists(id);
+        internDAO.deleteById(id);
+    }
+
+    @Override
+    public InternDO findByInstanceId(String flowInstanceId) {
+        QueryWrapper<InternDO> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("INSTANCE_ID", flowInstanceId);
+        return internDAO.selectOne(queryWrapper);
+    }
+
+    @Override
+    public Map<String, Object> getFormParams(String flowInstanceId) {
+        CommonResult<IFlowInstance> flowResult = workflowClient.flowInstance(flowInstanceId);
+        if (flowResult.isSuccess()) {
+            InternDO entity = internDAO.findByInstanceId(flowInstanceId);
+            if (Objects.isNull(entity)) {
+                entity = new InternDO();
+                entity.setInstanceId(flowInstanceId);
+                entity.setCreateTime(LocalDateTime.now());
+                entity.setApplyTime(LocalDateTime.now());
+                entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
+                internDAO.insert(entity);
+            }
+            return createMap(entity);
+        }
+        return createModelMap();
+    }
+
+    @Override
+    public PageResult<InternVO> getPage(InternPageDTO dto) {
+        PageResult<InternDO> page = internDAO.getPage(dto);
+        return encapsulatePage(page);
+    }
+
+
+    @Override
+    public InternVO flowAdd(String flowInstanceId, String userId) {
+        InternVO res = new InternVO();
+        CommonResult<IFlowInstance> flowResult = workflowClient.flowInstance(flowInstanceId);
+        if (flowResult.isSuccess()) {
+            InternDO entity = internDAO.findByInstanceId(flowInstanceId);
+            if (Objects.isNull(entity)) {
+                entity = new InternDO();
+                entity.setInstanceId(flowInstanceId);
+                entity.setCreateTime(LocalDateTime.now());
+                entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
+                internDAO.insert(entity);
+            }
+            res = InternConvert.INSTANCE.convert01(entity);
+        }
+
+        return res;
+    }
+
+
+    private PageResult<InternVO> encapsulatePage(PageResult<InternDO> page) {
+        return InternConvert.INSTANCE.convertPage(page);
+    }
+
+
+    private Map<String, Object> createMap(InternDO entity) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("formEntity", entity);
+        //字典查询
+        List<String> types = getTypeList();
+        CommonResult<List<DictDataRespDTO>> res = dictDataApi.getDictDataListByTypes(types);
+        List<DictDataRespDTO> resData = res.getCheckedData();
+        Map<String, List<DictDataRespDTO>> map1 = new HashMap<>();
+        resData.forEach(v -> {
+            if (map1.get(v.getDictType()) != null) {
+                List<DictDataRespDTO> dtos = map1.get(v.getDictType());
+                dtos.add(v);
+                map1.put(v.getDictType(), dtos);
+            } else {
+                List<DictDataRespDTO> dtos = new ArrayList<>();
+                dtos.add(v);
+                map1.put(v.getDictType(), dtos);
+            }
+        });
+        map1.forEach((k, v) -> map.put(k, JSON.toJSONString(SelectConvert.INSTANCE.convertList(v))));
+        return map;
+    }
+
+    private List<String> getTypeList() {
+        List<String> res = new ArrayList<>();
+        res.add(DictConstants.ABILITY_LEVEL);
+        res.add(DictConstants.post_type);
+        res.add(DictConstants.point_standard);
+        res.add(DictConstants.sex_type);
+        return res;
+    }
+
+
+    private Map<String, Object> createModelMap() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("formEntity", new HashMap<>());
+        return map;
+    }
+}

+ 5 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/interview/controller/vo/InterviewVO.java

@@ -276,4 +276,9 @@ public class InterviewVO {
      */
     private String msgxm;
 
+    /**
+     * 报道邀请是否发送
+     */
+    private String report;
+
 }

+ 209 - 0
zjugis-business/src/main/resources/templates/Intern/index.ftl

@@ -0,0 +1,209 @@
+<@w.workFlow javascripts=['/Intern/js/index.js','/flow/js/formCommon.js', '/OwCommon/OwCommon.js','/timeSelector/TimeSelector.js','/js/moment.js']
+styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/TimeSelector.css' ]>
+
+    <div class="z-position form-boss ow-tabs" name="createReqVO">
+        <ul class="ow-tab-nav oa_tabBox">
+            <li z-tabindex="0" class="ow-tab-item on" data-name="jbxx">基本信息</li>
+            <#if WORKFLOW.OPINION! !="">
+                <li z-tabindex="4" class="ow-tab-item" data-name="yj">审批意见</li>
+            </#if>
+        </ul>
+
+        <div class="ow-tab-scroll z-tab-content">
+            <div class="ow-tab-content" name="jbxx" style="padding-bottom: 40px;">
+                <div class="z-form-row" style="display: none;">
+                    <input type="text" value="${formEntity.instanceId!}" name="createReqVO$instanceId">
+                    <input type="text" value="${formEntity.id!}" name="createReqVO$id">
+                </div>
+                <div class="form-title" style="margin-top: 0;">
+                    <div class="form-icon">
+                        <img src="/imgs/titleIcon.png" alt="">
+                        <span>基本信息</span>
+                    </div>
+                    <div class="form-btn">
+                    </div>
+                </div>
+                <div class="jbxx-box jbxx-box-flex">
+                    <table class="jbxx-table-info">
+
+                        <tr>
+
+                            <td class="th">
+                                <div class="form-label">姓名:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="z-comp-selecttree" 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>${formEntity.nickname!}</span><i></i>
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+
+
+                            <td class="th">
+                                <div class="form-label">部门:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="z-comp-input z-readonly" name="createReqVO$deptName">
+                                        <input type="text" value="${formEntity.deptName!}">
+                                    </div>
+                                    <input type="hidden" name="createReqVO$deptId" value="${formEntity.deptId!}">
+                                </div>
+                            </td>
+
+
+                        </tr>
+
+
+                        <tr>
+
+                            <td class="th">
+                                <div class="form-label ">岗位:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="form-item">
+                                        <div class="z-comp-select z-readonly" name="createReqVO$ypgw"
+                                             data='${post_type!}' value="${formEntity.ypgw!}">
+                                            <div class="z-inputselect-bar">
+                                                <span></span><i></i>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+
+
+                            <td class="th">
+                                <div class="form-label">实习期(月):</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="form-item">
+                                        <div class="z-comp-input" name="createReqVO$sxq">
+                                            <input type="number" value="${formEntity.sxq!}">
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+
+
+                        </tr>
+
+                        <tr>
+
+                            <td class="th">
+                                <div class="form-label">实习日期:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="z-comp-date" name="createReqVO$ssxrq">
+                                        <input type="text" value="${(formEntity.ssxrq?date)!}">
+                                    </div>
+                                </div>
+                            </td>
+
+                            <td class="th">
+                                <div class="form-label">正常转正时间:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="form-item">
+                                        <div class="z-comp-date" name="createReqVO$zzsj">
+                                            <input type="text" value="${(formEntity.zzsj?date)!}">
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+
+                        </tr>
+
+
+                        <tr>
+
+                            <td class="th">
+                                <div class="form-label">申请录用时间:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="form-item">
+                                        <div class="z-comp-date z-readonly" name="createReqVO$applyTime">
+                                            <input type="text" value="${(formEntity.applyTime?date)!}">
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+                        </tr>
+
+                    </table>
+                </div>
+
+
+
+                <div class="form-title" style="margin-top: 0;">
+                    <div class="form-icon">
+                        <img src="/imgs/titleIcon.png" alt="">
+                        <span>实习期工作报告</span>
+                    </div>
+                    <div class="form-btn">
+                    </div>
+                </div>
+                <div class="jbxx-box jbxx-box-flex">
+                    <table class="jbxx-table-info">
+                        <tr>
+                            <td class="th">
+                                <div class="form-label">工作总结:</div>
+                            </td>
+                            <td>
+                                <div class="form-group">
+                                    <div class="form-item">
+                                        <div class="z-comp-textarea" name="createReqVO$report">
+                                            <textarea>${formEntity.report!}</textarea>
+                                        </div>
+                                    </div>
+                                </div>
+                            </td>
+                        </tr>
+
+                    </table>
+                </div>
+
+            </div>
+
+            <#if WORKFLOW.OPINION! !="">
+                <div class="ow-tab-content" name="yj">
+                    <div class="form-title">
+                        <div class="form-icon">
+                            <img src="/imgs/titleIcon.png" alt="">
+                            <span>审批意见</span>
+                        </div>
+                        <div class="form-btn">
+                        </div>
+                    </div>
+                    <div class="qjsjxx-box">
+                        <div class="z-form-wrap" name="opinionsDiv">
+                            <div class="z-form-row"> ${WORKFLOW.OPINION!} </div>
+                        </div>
+                    </div>
+                </div>
+            </#if>
+        </div>
+    </div>
+
+    <script language="javascript">
+        ;
+        (function () {
+        })();
+    </script>
+    <style type="text/css">
+
+
+
+    </style>
+</@w.workFlow>

+ 116 - 0
zjugis-business/src/main/resources/templates/Intern/js/index.js

@@ -0,0 +1,116 @@
+(function () {
+    let list = []
+    let read = z.ui.comm.getUrlParam("read");
+
+    window.onload = function (ex) {
+
+        initStaff();//获取所有员工
+        getStaff();
+        bindEvents();
+    }
+
+
+    //注册业务保存事件
+    function bindEvents() {
+        z.workflow.saveBtn.addListener("onSaveClick", saveForm);
+    }
+
+
+    //新员工姓名查询
+    function initStaff() {
+        z.ui.ajax({
+            type: "get",
+            url: "/common/user-tree",
+            data: {},
+            success: function (res) {
+                if (res && res.length > 0) {
+                    selecttree("[name='nickname']", res, clickUser)
+                }
+            },
+            error: function () {
+            }
+        })
+    }
+
+
+    /*
+  * all 工作流js传递到业务的参数 success执行的方法
+  * istransfer 工作流js传递到业务的参数 是否转件
+  * */
+    function saveForm(all, istransfer) {
+        var postData = z.ui.form.getFormFields($("[name=createReqVO]"));
+        if (postData === false) {
+            all({success: false});
+            return;
+        }
+
+        //将string类型的时间转换成时间戳
+        for (let key of Object.keys(postData)) {
+            let mealName = postData[key];
+            mealName.rgssj = Date.parse(mealName.rgssj + "");
+            mealName.zzsj = Date.parse(mealName.zzsj + "");
+            mealName.txsj = Date.parse(mealName.txsj + "");
+            postData.createReqVO = mealName;
+        }
+
+        z.ui.ajax({
+            type: "post",
+            url: "/regular/update",
+            data: JSON.stringify(postData.createReqVO),
+            contentType: "application/json",
+            success: function (res) {
+                if (res && res.code === 200) {
+                    all({success: true});
+                } else {
+                    all({success: false});
+                    z.ui.alertWarning(res.msg);
+                }
+            },
+
+            error: function () {
+                all({success: false});
+            }
+        })
+    }
+
+
+    function clickUser(even, treeId, treeNode) {
+        $("[name='createReqVO$nickname']").val(treeNode.name);
+        $("[name='createReqVO$userId']").val(treeNode.id);
+        getStaff();
+    }
+
+
+    function getStaff() {
+        var userId = $("input[name='createReqVO$userId']").val();
+        if (userId) {
+            selectUser(userId, function (userData) {
+                var staff = userData.data;
+                // 在成功获取到用户数据后,将用户名赋值给 createReqVO$nickname
+
+                z.ui.input("[name='createReqVO$deptName']").setValue(staff.deptName); //部门
+                $("[name='createReqVO$deptId']").val(staff.deptId);//部门id
+                z.ui.select("[name='createReqVO$ypgw']").setValue(staff.postName); //岗位
+            });
+        }
+    }
+
+
+    function selectUser(userId, callback) {
+        $.ajax({
+            type: "GET",
+            url: "/staff/getStaff",
+            data: {userId: userId}, // 请求参数应该以对象形式传递
+            contentType: "application/json",
+            success: function (res) {
+                // 在这里处理成功获取到的数据,你可以根据需要调用回调函数
+                callback(res);
+            },
+            error: function () {
+
+            }
+        });
+    }
+
+}());
+