From 11d2e2cbc4f12a7bb85408f3676e9f5e2dcf359d Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 08 Jul 2021 09:48:08 +0800
Subject: [PATCH] 1.公司管理人
---
src/main/java/org/springblade/modules/employment/service/IEmploymentService.java | 44 +++++
src/main/java/org/springblade/modules/employment/service/impl/EmploymentServiceImpl.java | 49 ++++++
src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.xml | 27 +++
src/main/java/org/springblade/modules/employment/entity/Employment.java | 98 ++++++++++++
src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.java | 43 +++++
src/main/java/org/springblade/modules/employment/vo/EmploymentVO.java | 36 ++++
src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java | 11 -
src/main/java/org/springblade/modules/employment/dto/EmploymentDTO.java | 34 ++++
src/main/java/org/springblade/modules/employment/controller/EmploymentController.java | 136 +++++++++++++++++
9 files changed, 468 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/springblade/modules/employment/controller/EmploymentController.java b/src/main/java/org/springblade/modules/employment/controller/EmploymentController.java
new file mode 100644
index 0000000..0f8fe60
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/controller/EmploymentController.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.employment.entity.Employment;
+import org.springblade.modules.employment.vo.EmploymentVO;
+import org.springblade.modules.employment.service.IEmploymentService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/employment")
+@Api(value = "", tags = "接口")
+public class EmploymentController extends BladeController {
+
+ private final IEmploymentService employmentService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入employment")
+ public R<Employment> detail(Employment employment) {
+ Employment detail = employmentService.getOne(Condition.getQueryWrapper(employment));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入employment")
+ public R<IPage<Employment>> list(Employment employment, Query query) {
+ IPage<Employment> pages = employmentService.page(Condition.getPage(query), Condition.getQueryWrapper(employment));
+ return R.data(pages);
+ }
+
+ /**
+ * 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入employment")
+ public R<IPage<EmploymentVO>> page(EmploymentVO employment, Query query) {
+ IPage<EmploymentVO> pages = employmentService.selectEmploymentPage(Condition.getPage(query), employment);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入employment")
+ public R save(@Valid @RequestBody Employment employment) {
+ return R.status(employmentService.save(employment));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入employment")
+ public R update(@Valid @RequestBody Employment employment) {
+ return R.status(employmentService.updateById(employment));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入employment")
+ public R submit(@Valid @RequestBody Employment employment) {
+ return R.status(employmentService.saveOrUpdate(employment));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 8)
+ @ApiOperation(value = "删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(employmentService.removeByIds(Func.toLongList(ids)));
+ }
+
+ /**
+ * 保安就业记录
+ * @param cardid 身份证
+ * @return
+ */
+ @PostMapping("/selectEmploymentInfo")
+ public R selectEmploymentInfo(String cardid) {
+ return R.data(employmentService.selectEmploymentInfo(cardid));
+ }
+
+
+}
diff --git a/src/main/java/org/springblade/modules/employment/dto/EmploymentDTO.java b/src/main/java/org/springblade/modules/employment/dto/EmploymentDTO.java
new file mode 100644
index 0000000..02120e8
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/dto/EmploymentDTO.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.dto;
+
+import org.springblade.modules.employment.entity.Employment;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class EmploymentDTO extends Employment {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/employment/entity/Employment.java b/src/main/java/org/springblade/modules/employment/entity/Employment.java
new file mode 100644
index 0000000..e6b3663
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/entity/Employment.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+@Data
+@TableName("sys_employment")
+@ApiModel(value = "Employment对象", description = "Employment对象")
+public class Employment implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 公司名称
+ */
+ @ApiModelProperty(value = "公司名称")
+ private String corporateName;
+ /**
+ * 岗位
+ */
+ @ApiModelProperty(value = "岗位")
+ private String post;
+ /**
+ * 部门
+ */
+ @ApiModelProperty(value = "部门")
+ private String department;
+ /**
+ * 职责
+ */
+ @ApiModelProperty(value = "职责")
+ private String duty;
+
+ /**
+ * 身份证
+ */
+ @ApiModelProperty(value = "身份证")
+ private String cardid;
+ /**
+ * 入职时间
+ */
+ @ApiModelProperty(value = "入职时间")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date entryTime;
+ /**
+ * 离职时间
+ */
+ @ApiModelProperty(value = "离职时间")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date quitTime;
+ /**
+ * 离职原因
+ */
+ @ApiModelProperty(value = "离职原因")
+ private String leaving;
+
+
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.java b/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.java
new file mode 100644
index 0000000..7b5bf63
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.mapper;
+
+import org.springblade.modules.employment.entity.Employment;
+import org.springblade.modules.employment.vo.EmploymentVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+public interface EmploymentMapper extends BaseMapper<Employment> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param employment
+ * @return
+ */
+ List<EmploymentVO> selectEmploymentPage(IPage page, EmploymentVO employment);
+ List<Map<Object,String>> selectEmploymentInfo(String cardid);
+}
diff --git a/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.xml b/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.xml
new file mode 100644
index 0000000..1b3012b
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/mapper/EmploymentMapper.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.employment.mapper.EmploymentMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="employmentResultMap" type="org.springblade.modules.employment.entity.Employment">
+ <id column="id" property="id"/>
+ <result column="corporate_name" property="corporateName"/>
+ <result column="post" property="post"/>
+ <result column="department" property="department"/>
+ <result column="duty" property="duty"/>
+ <result column="entry_time" property="entryTime"/>
+ <result column="quit_time" property="quitTime"/>
+ <result column="leaving" property="leaving"/>
+ <result column="cardid" property="cardid"/>
+ </resultMap>
+
+
+ <select id="selectEmploymentPage" resultMap="employmentResultMap">
+ select * from sys_employment
+ </select>
+
+ <select id="selectEmploymentInfo" resultType="java.util.HashMap">
+ select * from sys_employment where cardid=#{cardid}
+ </select>
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/employment/service/IEmploymentService.java b/src/main/java/org/springblade/modules/employment/service/IEmploymentService.java
new file mode 100644
index 0000000..671f788
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/service/IEmploymentService.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.service;
+
+import org.springblade.modules.employment.entity.Employment;
+import org.springblade.modules.employment.vo.EmploymentVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 服务类
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+public interface IEmploymentService extends IService<Employment> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param employment
+ * @return
+ */
+ IPage<EmploymentVO> selectEmploymentPage(IPage<EmploymentVO> page, EmploymentVO employment);
+ List<Map<Object,String>> selectEmploymentInfo(String cardid);
+}
diff --git a/src/main/java/org/springblade/modules/employment/service/impl/EmploymentServiceImpl.java b/src/main/java/org/springblade/modules/employment/service/impl/EmploymentServiceImpl.java
new file mode 100644
index 0000000..3b66605
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/service/impl/EmploymentServiceImpl.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.service.impl;
+
+import org.springblade.modules.employment.entity.Employment;
+import org.springblade.modules.employment.vo.EmploymentVO;
+import org.springblade.modules.employment.mapper.EmploymentMapper;
+import org.springblade.modules.employment.service.IEmploymentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+@Service
+public class EmploymentServiceImpl extends ServiceImpl<EmploymentMapper, Employment> implements IEmploymentService {
+
+ @Override
+ public IPage<EmploymentVO> selectEmploymentPage(IPage<EmploymentVO> page, EmploymentVO employment) {
+ return page.setRecords(baseMapper.selectEmploymentPage(page, employment));
+ }
+
+ @Override
+ public List<Map<Object, String>> selectEmploymentInfo(String cardid) {
+ return baseMapper.selectEmploymentInfo(cardid);
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/employment/vo/EmploymentVO.java b/src/main/java/org/springblade/modules/employment/vo/EmploymentVO.java
new file mode 100644
index 0000000..7c71db8
--- /dev/null
+++ b/src/main/java/org/springblade/modules/employment/vo/EmploymentVO.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.employment.vo;
+
+import org.springblade.modules.employment.entity.Employment;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-07-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "EmploymentVO对象", description = "EmploymentVO对象")
+public class EmploymentVO extends Employment {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java b/src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java
index 2774a95..c3eeef3 100644
--- a/src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java
+++ b/src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java
@@ -56,11 +56,7 @@
*/
@ApiModelProperty(value = "持股比例")
private String shareholdingratio;
- /**
- * 最终受益股份
- */
- @ApiModelProperty(value = "最终受益股份")
- private String beneficial;
+
/**
* 出资金额
*/
@@ -83,11 +79,6 @@
@ApiModelProperty(value = "联系电话")
private String cell;
- /**
- * 租户ID
- */
- @ApiModelProperty(value = "租户ID")
- private String tenantid;
/**
* 统一社会信用代码
*/
--
Gitblit v1.9.3