Commit e730e663 authored by 赵啸非's avatar 赵啸非

添加离职管理

parent ee7a6e70
...@@ -6,4 +6,48 @@ ALTER TABLE mortals_xhx_user ADD COLUMN `openId` varchar(64) COMMENT '微 ...@@ -6,4 +6,48 @@ ALTER TABLE mortals_xhx_user ADD COLUMN `openId` varchar(64) COMMENT '微
ALTER TABLE mortals_xhx_user ADD COLUMN `serviceAprParams` varchar(1024) default '' COMMENT '事件服务接口请求参数'; ALTER TABLE mortals_xhx_user ADD COLUMN `serviceAprParams` varchar(1024) default '' COMMENT '事件服务接口请求参数';
ALTER TABLE mortals_xhx_user ADD COLUMN `customerId` bigint(20) COMMENT '客户ID'; ALTER TABLE mortals_xhx_user ADD COLUMN `customerId` bigint(20) COMMENT '客户ID';
ALTER TABLE mortals_xhx_user ADD COLUMN `shareCode` varchar(64) COMMENT '员工分享码'; ALTER TABLE mortals_xhx_user ADD COLUMN `shareCode` varchar(64) COMMENT '员工分享码';
\ No newline at end of file
-- ----------------------------
-- 员工离职信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_staff_leave`;
CREATE TABLE mortals_xhx_staff_leave(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(64) COMMENT '员工姓名',
`photoPath` varchar(255) COMMENT '照片',
`email` varchar(128) COMMENT '邮件地址',
`phoneNumber` varchar(128) COMMENT '联系电话',
`companyIds` varchar(128) COMMENT '所属公司',
`companyName` varchar(128) COMMENT '所属公司名称',
`positionName` varchar(128) COMMENT '职位名称',
`staffStatus` tinyint(2) DEFAULT '3' COMMENT '员工状态(1.正式,2.试用,3.离职)',
`leaveDate` datetime COMMENT '离职时间',
`remark` varchar(255) COMMENT '备注',
`sumViews` int(4) DEFAULT '0' COMMENT '累计查看次数',
`viewsByDay` int(4) DEFAULT '0' COMMENT '当日查看次数',
`sendBusinessCardTimes` int(4) DEFAULT '0' COMMENT '发送名片次数',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
,KEY `name` (`name`) USING BTREE
,KEY `companyIds` (`companyIds`) USING BTREE
,KEY `staffStatus` (`staffStatus`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='员工离职信息';
-- ----------------------------
-- 员工离职信息菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '员工离职信息', '/staff/leave/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 员工离职信息资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '员工离职信息-菜单管理-查看', '/staff/leave/list,/staff/leave/view,/staff/leave/info,/staff/leave/export,/staff/leave/exportExcel,/staff/leave/downloadTemplate,/staff/leave/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '员工离职信息-菜单管理-维护', '/staff/leave/add,/staff/leave/edit,/staff/leave/delete,/staff/leave/logicDelete,/staff/leave/save,/staff/leave/importData', 3, 0, NULL, NULL, NULL, 0);
...@@ -52,6 +52,7 @@ const router = new Router({ ...@@ -52,6 +52,7 @@ const router = new Router({
...restBuilder('feedback', 'feedback'),//反馈信息 ...restBuilder('feedback', 'feedback'),//反馈信息
...restBuilder('staff', 'staff'),//员工基本信息 ...restBuilder('staff', 'staff'),//员工基本信息
...restBuilder('leave', 'leave'),//员工离职信息
...restBuilder('bussinesscard', 'bussinesscard'),//名片基本信息 ...restBuilder('bussinesscard', 'bussinesscard'),//名片基本信息
...restBuilder('staff/record', 'staff/record'),//客户访问记录信息 ...restBuilder('staff/record', 'staff/record'),//客户访问记录信息
...restBuilder('news/category', 'news/category'),//新闻频道分类 ...restBuilder('news/category', 'news/category'),//新闻频道分类
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="员工姓名" prop="name" v-model="form.name" placeholder="请输入员工姓名"/>
<Field label="照片"><imageUpload v-model="form.photoPath" prePath="/file/preview"/></Field>
<Field label="邮件地址" prop="email" v-model="form.email" placeholder="请输入邮件地址"/>
<Field label="联系电话" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/>
<Field label="所属公司" prop="companyIds" v-model="form.companyIds" type="select" :enumData="dict.companyIds" placeholder="请选择所属公司"/>
<Field label="所属公司名称" prop="companyName" v-model="form.companyName" placeholder="请输入所属公司名称"/>
<Field label="职位名称" prop="positionName" v-model="form.positionName" placeholder="请输入职位名称"/>
<Field label="员工状态" prop="staffStatus" v-model="form.staffStatus" type="select" :enumData="dict.staffStatus" placeholder="请选择员工状态"/>
<Field label="离职时间" prop="leaveDate" v-model="form.leaveDate" type="date" />
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="累计查看次数" prop="sumViews" v-model="form.sumViews" placeholder="请输入累计查看次数"/>
<Field label="发送名片次数" prop="sendBusinessCardTimes" v-model="form.sendBusinessCardTimes" placeholder="请输入发送名片次数"/>
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "StaffLeaveDetail",
mixins: [form],
components: {
},
created() {
this.changePath("staff/leave")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工离职信息",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
"staffStatus",
],
toDate:[
"leaveDate",
],
// 表单校验
rules: {
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="staff/leave/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改员工离职信息";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "staff/leave/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增员工离职信息";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="staff/leave/view";
this.getData();
this.pageInfo.type="view"
this.title = "员工离职信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
name : "",
photoPath : "",
email : "",
phoneNumber : "",
companyIds : "",
companyName : "",
positionName : "",
staffStatus : 3,
leaveDate : null,
remark : "",
sumViews : 0,
viewsByDay : 0,
sendBusinessCardTimes : 0,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "StaffLeaveList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
{
name: "name",
type: "text",
label: "员工姓名",
fuzzy: true
},
{
name: "companyIds",
type: "select",
label: "所属公司",
fuzzy: true
}
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "员工姓名", prop: "name"},
{label: "照片", prop: "photoPath"},
{label: "邮件地址", prop: "email"},
{label: "联系电话", prop: "phoneNumber"},
{label: "所属公司", prop: "companyIds"},
{label: "职位名称", prop: "positionName"},
{label: "离职时间", prop: "leaveDate", formatter: this.formatterDate},
{label: "操作用户", prop: "createUserId", formatter: this.formatter},
]
}
};
}
};
</script>
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="员工姓名" label-class-name="labelClass" content-class-name="contentClass">
{{form.name}}
</el-descriptions-item>
<el-descriptions-item label="照片" label-class-name="labelClass" content-class-name="contentClass">
<imageUpload v-model="form.photoPath" prePath="/file/preview"/>
</el-descriptions-item>
<el-descriptions-item label="邮件地址" label-class-name="labelClass" content-class-name="contentClass">
{{form.email}}
</el-descriptions-item>
<el-descriptions-item label="联系电话" label-class-name="labelClass" content-class-name="contentClass">
{{form.phoneNumber}}
</el-descriptions-item>
<el-descriptions-item label="所属公司" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("companyIds", form.companyIds) }}
</el-descriptions-item>
<el-descriptions-item label="所属公司名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.companyName}}
</el-descriptions-item>
<el-descriptions-item label="职位名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.positionName}}
</el-descriptions-item>
<el-descriptions-item label="员工状态" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("staffStatus", form.staffStatus) }}
</el-descriptions-item>
<el-descriptions-item label="离职时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.leaveDate)}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="累计查看次数" label-class-name="labelClass" content-class-name="contentClass">
{{form.sumViews}}
</el-descriptions-item>
<el-descriptions-item label="发送名片次数" label-class-name="labelClass" content-class-name="contentClass">
{{form.sendBusinessCardTimes}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import ImageUpload from '@/components/ImageUpload';
export default {
mixins: [view],
components: {
ImageUpload,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
"staffStatus",
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
package com.mortals.xhx.module.staff.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import java.util.List;
/**
* 员工离职信息Dao
* 员工离职信息 DAO接口
*
* @author zxfei
* @date 2023-10-18
*/
public interface StaffLeaveDao extends ICRUDDao<StaffLeaveEntity,Long>{
}
package com.mortals.xhx.module.staff.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.staff.dao.StaffLeaveDao;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 员工离职信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-10-18
*/
@Repository("staffLeaveDao")
public class StaffLeaveDaoImpl extends BaseCRUDDaoMybatis<StaffLeaveEntity,Long> implements StaffLeaveDao {
}
package com.mortals.xhx.module.staff.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.staff.model.vo.StaffLeaveVo;
import lombok.Data;
/**
* 员工离职信息实体对象
*
* @author zxfei
* @date 2023-10-18
*/
@Data
public class StaffLeaveEntity extends StaffLeaveVo {
private static final long serialVersionUID = 1L;
/**
* 员工姓名
*/
private String name;
/**
* 照片
*/
private String photoPath;
/**
* 邮件地址
*/
private String email;
/**
* 联系电话
*/
private String phoneNumber;
/**
* 所属公司
*/
private String companyIds;
/**
* 所属公司名称
*/
private String companyName;
/**
* 职位名称
*/
private String positionName;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private Integer staffStatus;
/**
* 离职时间
*/
private Date leaveDate;
/**
* 备注
*/
private String remark;
/**
* 累计查看次数
*/
private Integer sumViews;
/**
* 当日查看次数
*/
private Integer viewsByDay;
/**
* 发送名片次数
*/
private Integer sendBusinessCardTimes;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof StaffLeaveEntity) {
StaffLeaveEntity tmp = (StaffLeaveEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.name = "";
this.photoPath = "";
this.email = "";
this.phoneNumber = "";
this.companyIds = "";
this.companyName = "";
this.positionName = "";
this.staffStatus = 3;
this.leaveDate = new Date();
this.remark = "";
this.sumViews = 0;
this.viewsByDay = 0;
this.sendBusinessCardTimes = 0;
}
}
\ No newline at end of file
package com.mortals.xhx.module.staff.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 员工离职信息视图对象
*
* @author zxfei
* @date 2023-10-18
*/
@Data
public class StaffLeaveVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.dao.StaffLeaveDao;
/**
* StaffLeaveService
*
* 员工离职信息 service接口
*
* @author zxfei
* @date 2023-10-18
*/
public interface StaffLeaveService extends ICRUDService<StaffLeaveEntity,Long>{
StaffLeaveDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service; package com.mortals.xhx.module.staff.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
...@@ -14,4 +16,8 @@ import com.mortals.xhx.module.staff.dao.StaffDao; ...@@ -14,4 +16,8 @@ import com.mortals.xhx.module.staff.dao.StaffDao;
public interface StaffService extends ICRUDCacheService<StaffEntity,Long> { public interface StaffService extends ICRUDCacheService<StaffEntity,Long> {
StaffDao getDao(); StaffDao getDao();
Rest<Void> leave(StaffEntity staffEntity, Context context);
} }
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.staff.dao.StaffLeaveDao;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.service.StaffLeaveService;
import lombok.extern.slf4j.Slf4j;
/**
* StaffLeaveService
* 员工离职信息 service实现
*
* @author zxfei
* @date 2023-10-18
*/
@Service("staffLeaveService")
@Slf4j
public class StaffLeaveServiceImpl extends AbstractCRUDServiceImpl<StaffLeaveDao, StaffLeaveEntity, Long> implements StaffLeaveService {
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl; package com.mortals.xhx.module.staff.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.StaffStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.model.StaffLeaveQuery;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffLeaveService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -8,15 +18,43 @@ import com.mortals.xhx.module.staff.dao.StaffDao; ...@@ -8,15 +18,43 @@ import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
/** /**
* StaffService * StaffService
* 员工基本信息 service实现 * 员工基本信息 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-09-18 * @date 2023-09-18
*/ */
@Service("staffService") @Service("staffService")
@Slf4j @Slf4j
public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, StaffEntity, Long> implements StaffService { public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, StaffEntity, Long> implements StaffService {
@Autowired
private StaffLeaveService staffLeaveService;
@Override
public Rest<Void> leave(StaffEntity staffEntity, Context context) {
//离职
StaffEntity condition = new StaffEntity();
condition.setId(staffEntity.getId());
condition.setStaffStatus(StaffStatusEnum.离职.getValue());
condition.setUpdateTime(new Date());
condition.setUpdateUserId(this.getContextUserId(context));
this.update(condition, context);
StaffEntity staffCache = this.getCache(staffEntity.getId().toString());
StaffLeaveEntity staffLeaveEntity = staffLeaveService.selectOne(new StaffLeaveQuery().name(staffCache.getName()).phoneNumber(staffCache.getPhoneNumber()));
if (ObjectUtils.isEmpty(staffLeaveEntity)) {
StaffLeaveEntity staffLeave = new StaffLeaveEntity();
staffLeave.initAttrValue();
BeanUtils.copyProperties(staffCache, staffLeave, BeanUtil.getNullPropertyNames(staffCache));
staffLeave.setId(null);
staffLeaveService.save(staffLeave, context);
}
return Rest.ok();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.staff.web; package com.mortals.xhx.module.staff.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery; import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.company.model.CompanyEntity; import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.model.CompanyQuery; import com.mortals.xhx.module.company.model.CompanyQuery;
import com.mortals.xhx.module.company.service.CompanyService; import com.mortals.xhx.module.company.service.CompanyService;
...@@ -96,4 +99,28 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ ...@@ -96,4 +99,28 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
entity.setPositionName(positionEntity.getPositionName()); entity.setPositionName(positionEntity.getPositionName());
} }
} }
/**
* 员工离职
*/
@PostMapping(value = "leave")
public String leave(@RequestBody StaffEntity staff) {
JSONObject ret = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "查询" + this.getModuleDesc() + "员工离职";
try {
Rest<Void> rest = this.service.leave(staff, getContext());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_DATA, model);
recordSysLog(request, busiDesc + "【成功】");
} catch (Exception e) {
log.error("离职", e);
this.doException(request, busiDesc, model, e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, e.getMessage());
}
return ret.toJSONString();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.staff.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.staff.model.StaffLeaveEntity;
import com.mortals.xhx.module.staff.service.StaffLeaveService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 员工离职信息
*
* @author zxfei
* @date 2023-10-18
*/
@RestController
@RequestMapping("staff/leave")
public class StaffLeaveController extends BaseCRUDJsonBodyMappingController<StaffLeaveService,StaffLeaveEntity,Long> {
@Autowired
private ParamService paramService;
public StaffLeaveController(){
super.setModuleDesc( "员工离职信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "companyIds", CompanyIdsEnum.getEnumMap());
this.addDict(model, "staffStatus", StaffStatusEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###员工离职信息列表
POST {{baseUrl}}/staff/leave/list
Content-Type: application/json
{
"name":"joh7ci",
"companyIds":"6rbbtq",
"staffStatus":3,
"page":1,
"size":10
}
###员工离职信息更新与保存
POST {{baseUrl}}/staff/leave/save
Authorization: {{authToken}}
Content-Type: application/json
{
"name":"niexgl",
"photoPath":"a3m1se",
"email":"numqu9",
"phoneNumber":"wwnpco",
"companyIds":"toxqog",
"companyName":"nq4jfs",
"positionName":"kakeio",
"staffStatus":3,
"leaveDate":"1697558400000",
"remark":"qozn6l",
"sumViews":0,
"viewsByDay":0,
"sendBusinessCardTimes":0,
}
> {%
client.global.set("StaffLeave_id", JSON.parse(response.body).data.id);
%}
###员工离职信息查看
GET {{baseUrl}}/staff/leave/info?id={{StaffLeave_id}}
Accept: application/json
###员工离职信息编辑
GET {{baseUrl}}/staff/leave/edit?id={{StaffLeave_id}}
Accept: application/json
###员工离职信息删除
GET {{baseUrl}}/staff/leave/delete?id={{StaffLeave_id}}
Authorization: {{authToken}}
Accept: application/json
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment