!23 编制表接口 表结构更新

Merge pull request !23 from dxfeng/feature/dxf
pull/24/MERGE
dxfeng 3 years ago committed by Gitee
commit 4102c56e7c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -346,7 +346,7 @@ CREATE TABLE JCL_ORG_STAFFPLAN (
time_end date NULL,
company_id varchar(100) NULL,
description text NULL,
status int NULL,
forbidden_tag int NULL,
creator int null,
delete_type int null,
create_time date null,
@ -363,10 +363,10 @@ CREATE TABLE JCL_ORG_STAFF (
job_id int null,
staff_num int null,
control_policy int null,
staff_permanent_num int null,
permanent_num int null,
freeze_num int null,
lack_status int null,
staff_description varchar(100) NULL,
staff_desc varchar(100) NULL,
description text null,
creator int null,
delete_type int null,
@ -380,7 +380,7 @@ CREATE TABLE JCL_ORG_STAFFS (
id int auto_increment NOT NULL,
staff_id int null,
business_type int null,
business_change_num int null,
change_num int null,
business_source int null,
requestid int null,
creator int null,

@ -347,7 +347,7 @@ CREATE TABLE JCL_ORG_STAFFPLAN (
TIME_END DATE NULL,
COMPANY_ID NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL,
STATUS NUMBER NULL,
FORBIDDEN_TAG NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
@ -364,10 +364,10 @@ CREATE TABLE JCL_ORG_STAFF (
JOB_ID NUMBER NULL,
STAFF_NUM NUMBER NULL,
CONTROL_POLICY NUMBER NULL,
STAFF_PERMANENT_NUM NUMBER NULL,
PERMANENT_NUM NUMBER NULL,
FREEZE_NUM NUMBER NULL,
LACK_STATUS NUMBER NULL,
STAFF_DESCRIPTION NVARCHAR2(100) NULL,
STAFF_DESC NVARCHAR2(100) NULL,
DESCRIPTION NVARCHAR2(1000) NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
@ -381,7 +381,7 @@ CREATE TABLE JCL_ORG_STAFFS (
ID NUMBER NOT NULL,
STAFF_ID NUMBER NULL,
BUSINESS_TYPE NUMBER NULL,
BUSINESS_CHANGE_NUM NUMBER NULL,
CHANGE_NUM NUMBER NULL,
BUSINESS_SOURCE NUMBER NULL,
REQUESTID NUMBER NULL,
CREATOR NUMBER NULL,

@ -346,7 +346,7 @@ CREATE TABLE JCL_ORG_STAFFPLAN (
time_end date NULL,
company_id varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text NULL,
status int NULL,
forbidden_tag int NULL,
creator int null,
delete_type int null,
create_time date null,
@ -363,10 +363,10 @@ CREATE TABLE JCL_ORG_STAFF (
job_id int null,
staff_num int null,
control_policy int null,
staff_permanent_num int null,
permanent_num int null,
freeze_num int null,
lack_status int null,
staff_description varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
staff_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
description text null,
creator int null,
delete_type int null,
@ -380,7 +380,7 @@ CREATE TABLE JCL_ORG_STAFFS (
id int IDENTITY(1,1) NOT NULL,
staff_id int null,
business_type int null,
business_change_num int null,
change_num int null,
business_source int null,
requestid int null,
creator int null,

@ -0,0 +1,13 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Path("/bs/hrmorganization/staff")
public class StaffController extends com.engine.organization.web.StaffController {
}

@ -0,0 +1,13 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Path("/bs/hrmorganization/staffplan")
public class StaffPlanController extends com.engine.organization.web.StaffPlanController {
}

@ -0,0 +1,38 @@
package com.engine.organization.entity.staff.bo;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.entity.staff.po.StaffPO;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffBO {
public static StaffPO convertParamToPO(StaffSearchParam param, Long employeeId) {
if (param == null) {
return null;
}
return StaffPO.builder()
.id(param.getId())
.planId(param.getPlanId())
.compId(param.getCompId())
.deptId(param.getDeptId())
.jobId(param.getJobId())
.staffNum(param.getStaffNum())
.controlPolicy(param.getControlPolicy())
.permanentNum(param.getPermanentNum())
.freezeNum(param.getFreezeNum())
.lackStatus(param.getLackStatus())
.staffDesc(param.getStaffDesc())
.description(param.getDescription())
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.creator(employeeId)
.build();
}
}

@ -0,0 +1,35 @@
package com.engine.organization.entity.staff.bo;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import com.engine.organization.entity.staff.po.StaffPlanPO;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffPlanBO {
public static StaffPlanPO convertParamToPO(StaffPlanSearchParam param, Long employeeId) {
if (param == null) {
return null;
}
return StaffPlanPO.builder()
.id(param.getId())
.planNo(param.getPlanNo())
.planName(param.getPlanName())
.planYear(param.getPlanYear())
.timeStart(param.getTimeStart())
.timeEnd(param.getTimeEnd())
.companyId(param.getCompanyId())
.description(param.getDescription())
.forbiddenTag(param.getForbiddenTag() == null ? 0 : param.getForbiddenTag() ? 0 : 1)
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.creator(employeeId)
.build();
}
}

@ -0,0 +1,57 @@
package com.engine.organization.entity.staff.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StaffPlanSearchParam {
/**
*
*/
private Long id;
/**
*
*/
private String planNo;
/**
*
*/
private String planName;
/**
*
*/
private Integer planYear;
/**
*
*/
private Date timeStart;
/**
*
*/
private Date timeEnd;
/**
*
*/
private String companyId;
/**
*
*/
private String description;
/**
*
*/
private Boolean forbiddenTag;
}

@ -0,0 +1,68 @@
package com.engine.organization.entity.staff.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StaffSearchParam {
/**
*
*/
private Long id;
/**
* id
*/
private Long planId;
/**
*
*/
private Long compId;
/**
*
*/
private Long deptId;
/**
*
*/
private Long jobId;
/**
*
*/
private Integer staffNum;
/**
*
*/
private Integer controlPolicy;
/**
*
*/
private Integer permanentNum;
/**
*
*/
private Integer freezeNum;
/**
*
*/
private Integer lackStatus;
/**
*
*/
private String staffDesc;
/**
*
*/
private String description;
}

@ -0,0 +1,75 @@
package com.engine.organization.entity.staff.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StaffPO {
/**
*
*/
private Long id;
/**
* id
*/
private Long planId;
/**
*
*/
private Long compId;
/**
*
*/
private Long deptId;
/**
*
*/
private Long jobId;
/**
*
*/
private Integer staffNum;
/**
*
*/
private Integer controlPolicy;
/**
*
*/
private Integer permanentNum;
/**
*
*/
private Integer freezeNum;
/**
*
*/
private Integer lackStatus;
/**
*
*/
private String staffDesc;
/**
*
*/
private String description;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
}

@ -37,11 +37,11 @@ public class StaffPlanPO {
/**
*
*/
private Date time_start;
private Date timeStart;
/**
*
*/
private Date time_end;
private Date timeEnd;
/**
*
*/

@ -0,0 +1,70 @@
package com.engine.organization.entity.staff.vo;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableColumn;
import com.engine.organization.annotation.OrganizationTableOperate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508",
fields = "t.id, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
fromSql = "FROM jcl_org_staffplan t ",
orderby = "id desc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除")
}
)
public class StaffPlanTableVO {
/**
*
*/
private Long id;
/**
*
*/
@OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no")
private String planNo;
/**
*
*/
@OrganizationTableColumn(text = "名称", width = "16%", column = "plan_name")
private String planName;
/**
*
*/
@OrganizationTableColumn(text = "年度", width = "16%", column = "plan_year")
private Integer planYear;
/**
*
*/
@OrganizationTableColumn(text = "时间开始", width = "16%", column = "time_start")
private Date timeStart;
/**
*
*/
@OrganizationTableColumn(text = "时间结束", width = "16%", column = "time_end")
private Date timeEnd;
/**
*
*/
@OrganizationTableColumn(text = "状态", width = "16%", column = "forbidden_tag")
private Integer forbiddenTag;
}

@ -0,0 +1,83 @@
package com.engine.organization.entity.staff.vo;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableColumn;
import com.engine.organization.annotation.OrganizationTableOperate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508",
fields = "id,plan_id,comp_id,dept_id,job_id,staff_num,permanent_num,freeze_num,lack_status,staff_desc",
fromSql = "FROM jcl_org_staff t ",
orderby = "id desc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除"),
@OrganizationTableOperate(index = "2", text = "变更")
}
)
public class StaffTableVO {
/**
*
*/
private Long id;
/**
* id
*/
@OrganizationTableColumn(text = "方案", width = "10%", column = "plan_id", transmethod = "com.engine.organization.transmethod.StaffPlanTransMethod.getSpanById")
private String planId;
/**
*
*/
@OrganizationTableColumn(text = "分部", width = "10%", column = "comp_id", transmethod = "com.engine.organization.transmethod.CompTransMethod.getSpanById")
private String compId;
/**
*
*/
@OrganizationTableColumn(text = "部门", width = "10%", column = "dept_id", transmethod = "com.engine.organization.transmethod.DepartmentTransMethod.getSpanById")
private String deptId;
/**
*
*/
@OrganizationTableColumn(text = "岗位", width = "10%", column = "job_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSpanById")
private String jobId;
/**
*
*/
@OrganizationTableColumn(text = "编制数", width = "10%", column = "staff_num")
private Integer staffNum;
/**
*
*/
@OrganizationTableColumn(text = "在编", width = "10%", column = "permanent_num")
private Integer permanentNum;
/**
*
*/
@OrganizationTableColumn(text = "冻结数", width = "10%", column = "freeze_num")
private Integer freezeNum;
/**
*
*/
@OrganizationTableColumn(text = "缺编状态", width = "10%", column = "lack_status")
private Integer lackStatus;
/**
*
*/
@OrganizationTableColumn(text = "编制描述", width = "10%", column = "staff_desc")
private String staffDesc;
}

@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @description: TODO
@ -60,6 +61,15 @@ public interface CompMapper {
List<CompPO> listByNo(@Param("compNo") String compNo);
/**
*
*
* @param ids
* @return
*/
List<Map<String, Object>> listCompsByIds(@Param("ids") Collection<Long> ids);
/**
* /
*

@ -197,6 +197,18 @@
</if>
</select>
<select id="listCompsByIds" resultType="java.util.Map">
select
id,
comp_name as name
from jcl_org_comp t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp
<set>

@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @Author weaver_cl
@ -27,6 +28,8 @@ public interface DepartmentMapper {
*/
List<DepartmentPO> listParent();
List<Map<String,Object>> listDeptsByIds(@Param("ids") Collection<Long> ids);
/**
*
*

@ -118,6 +118,17 @@
#{id}
</foreach>
</select>
<select id="listDeptsByIds" resultType="java.util.Map">
select
id,
dept_name as name
from jcl_org_dept t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<sql id="likeSQL">

@ -0,0 +1,47 @@
package com.engine.organization.mapper.staff;
import com.engine.organization.entity.staff.po.StaffPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
/**
* @Author dxfeng
* @Description: TODO
* @Date 2022/5/25
* @Version V1.0
**/
public interface StaffMapper {
/**
* ID
* @param id
* @return
*/
StaffPO getStaffByID(@Param("id") long id);
/**
*
* @param staffPO
* @return
*/
int insertIgnoreNull(StaffPO staffPO);
/**
*
*
* @param staffPO
* @return
*/
int updateStaff(StaffPO staffPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
}

@ -0,0 +1,177 @@
<?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="com.engine.organization.mapper.staff.StaffMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.staff.po.StaffPO">
<result column="id" property="id"/>
<result column="plan_id" property="planId"/>
<result column="comp_id" property="compId"/>
<result column="dept_id" property="deptId"/>
<result column="job_id" property="jobId"/>
<result column="staff_num" property="staffNum"/>
<result column="control_policy" property="controlPolicy"/>
<result column="permanent_num" property="permanentNum"/>
<result column="freeze_num" property="freezeNum"/>
<result column="lack_status" property="lackStatus"/>
<result column="staff_desc" property="staffDesc"/>
<result column="description" property="description"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.plan_id
, t.comp_id
, t.dept_id
, t.job_id
, t.staff_num
, t.control_policy
, t.permanent_num
, t.freeze_num
, t.lack_status
, t.staff_desc
, t.description
</sql>
<select id="getStaffByID" parameterType="com.engine.organization.entity.staff.po.StaffPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_staff t where id = #{id} AND delete_type = 0
</select>
<update id="updateStaff" parameterType="com.engine.organization.entity.staff.po.StaffPO">
update jcl_org_staff
<set>
creator=#{creator},
update_time=#{updateTime},
plan_id=#{planId},
comp_id=#{compId},
dept_id=#{deptId},
job_id=#{jobId},
staff_num=#{staffNum},
control_policy=#{controlPolicy},
permanent_num=#{permanentNum},
freeze_num=#{freezeNum},
lack_status=#{lackStatus},
staff_desc=#{staffDesc},
description=#{description},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_staff
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="planId != null ">
plan_id,
</if>
<if test="compId != null ">
comp_id,
</if>
<if test="deptId != null ">
dept_id,
</if>
<if test="jobId != null ">
job_id,
</if>
<if test="staffNum != null ">
staff_num,
</if>
<if test="controlPolicy != null ">
control_policy,
</if>
<if test="permanentNum != null ">
permanent_num,
</if>
<if test="freezeNum != null ">
freeze_num,
</if>
<if test="lackStatus != null ">
lack_status,
</if>
<if test="staffDesc != null ">
staff_desc,
</if>
<if test="description != null ">
description,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="planId != null ">
#{planId},
</if>
<if test="compId != null ">
#{compId},
</if>
<if test="deptId != null ">
#{deptId},
</if>
<if test="jobId != null ">
#{jobId},
</if>
<if test="staffNum != null ">
#{staffNum},
</if>
<if test="controlPolicy != null ">
#{controlPolicy},
</if>
<if test="permanentNum != null ">
#{permanentNum},
</if>
<if test="freezeNum != null ">
#{freezeNum},
</if>
<if test="lackStatus != null ">
#{lackStatus},
</if>
<if test="staffDesc != null ">
#{staffDesc},
</if>
<if test="description != null ">
#{description},
</if>
</trim>
</insert>
<update id="deleteByIds">
UPDATE jcl_org_staff
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,67 @@
package com.engine.organization.mapper.staff;
import com.engine.organization.entity.staff.po.StaffPlanPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @Author dxfeng
* @Description: TODO
* @Date 2022/5/25
* @Version V1.0
**/
public interface StaffPlanMapper {
/**
* No
*
* @param planNo
* @return
*/
List<StaffPlanPO> listByNo(@Param("planNo") String planNo);
List<Map<String,Object>> listPlansByIds(@Param("ids") Collection<Long> ids);
/**
* ID
* @param id
* @return
*/
StaffPlanPO getStaffPlanByID(@Param("id") long id);
/**
*
* @param staffPlanPO
* @return
*/
int insertIgnoreNull(StaffPlanPO staffPlanPO);
/**
*
*
* @param staffPlanPO
* @return
*/
int updateStaffPlan(StaffPlanPO staffPlanPO);
/**
*
*
* @param staffPlanPO
* @return
*/
int updateForbiddenTagById(StaffPlanPO staffPlanPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
}

@ -0,0 +1,174 @@
<?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="com.engine.organization.mapper.staff.StaffPlanMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.staff.po.StaffPlanPO">
<result column="id" property="id"/>
<result column="plan_no" property="planNo"/>
<result column="plan_name" property="planName"/>
<result column="plan_year" property="planYear"/>
<result column="time_start" property="timeStart"/>
<result column="time_end" property="timeEnd"/>
<result column="company_id" property="companyId"/>
<result column="description" property="description"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.plan_no
, t.plan_name
, t.plan_year
, t.time_start
, t.time_end
, t.company_id
, t.description
, t.forbidden_tag
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getStaffPlanByID" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_staffplan t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_staffplan t where plan_no = #{planNo} AND delete_type = 0
</select>
<select id="listPlansByIds" resultType="java.util.Map">
select
id,
plan_name as name
from jcl_org_staffplan t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateStaffPlan" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
update jcl_org_staffplan
<set>
creator=#{creator},
update_time=#{updateTime},
plan_no=#{planNo},
plan_name=#{planName},
plan_year=#{planYear},
time_start=#{timeStart},
time_end=#{timeEnd},
company_id=#{companyId},
description=#{description},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_staffplan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="planNo != null ">
plan_no,
</if>
<if test="planName != null ">
plan_name,
</if>
<if test="planYear != null ">
plan_year,
</if>
<if test="timeStart != null ">
time_start,
</if>
<if test="timeEnd != null ">
time_end,
</if>
<if test="companyId != null ">
company_id,
</if>
<if test="description != null ">
description,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="planNo != null ">
#{planNo},
</if>
<if test="planName != null ">
#{planName},
</if>
<if test="planYear != null ">
#{planYear},
</if>
<if test="timeStart != null ">
#{timeStart},
</if>
<if test="timeEnd != null ">
#{timeEnd},
</if>
<if test="companyId != null ">
#{companyId},
</if>
<if test="description != null ">
#{description},
</if>
0,
</trim>
</insert>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO">
update jcl_org_staffplan
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_staffplan
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,74 @@
package com.engine.organization.service;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import java.util.Collection;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public interface StaffPlanService {
/**
*
*
* @param params
* @return
*/
Map<String, Object> listPage(StaffPlanSearchParam params);
/**
*
* @param param
* @return
*/
int saveStaffPlan(StaffPlanSearchParam param);
/**
*
*
* @param param
* @return
*/
int updateStaffPlan(StaffPlanSearchParam param);
/**
*
*
* @param params
*/
int updateForbiddenTagById(StaffPlanSearchParam params);
/**
* ID
*
* @param ids
*/
int deleteByIds(Collection<Long> ids);
/**
*
*
* @param params
* @return
*/
Map<String, Object> getSearchCondition(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
Map<String, Object> getForm(Map<String, Object> params);
/**
*
* @return
*/
Map<String, Object> getHasRight();
}

@ -0,0 +1,67 @@
package com.engine.organization.service;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import java.util.Collection;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public interface StaffService {
/**
*
*
* @param params
* @return
*/
Map<String, Object> listPage(StaffSearchParam params);
/**
*
* @param param
* @return
*/
int saveStaff(StaffSearchParam param);
/**
*
*
* @param param
* @return
*/
int updateStaff(StaffSearchParam param);
/**
* ID
*
* @param ids
*/
int deleteByIds(Collection<Long> ids);
/**
*
*
* @param params
* @return
*/
Map<String, Object> getSearchCondition(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
Map<String, Object> getForm(Map<String, Object> params);
/**
*
* @return
*/
Map<String, Object> getHasRight();
}

@ -131,20 +131,16 @@ public class CompServiceImpl extends Service implements CompService {
public int updateComp(Map<String, Object> params) {
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
String groupId = (String) params.get("viewCondition");
int updateBaseComp = 0;
CompPO compPO = CompBO.convertParamToPO(searchParam, (long) user.getUID());
if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) {
// 更新主表数据
updateBaseComp = getCompMapper().updateBaseComp(compPO);
} else {
// 更新主表拓展表
updateBaseComp = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, compPO.getId());
}
int updateCount = 0;
// 更新主表数据
updateCount += getCompMapper().updateBaseComp(compPO);
// 更新主表拓展表
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, compPO.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, compPO.getId());
return updateBaseComp;
return updateCount;
}
@Override

@ -58,9 +58,9 @@ public class ExtServiceImpl extends Service implements ExtService {
Map<String, Object> compExtMap = getExtMapper().listCompExt(tableName, fields, id);
// 组装拓展页内容
for (ExtendInfoPO extendInfoPO : infoPOList) {
SearchConditionItem item = ExtendInfoBO.getSearchConditionItem(user, viewAttr, extendInfoPO, compExtMap.get(extendInfoPO.getFieldName()));
SearchConditionItem item = ExtendInfoBO.getSearchConditionItem(user, viewAttr, extendInfoPO, null == compExtMap ? null : compExtMap.get(extendInfoPO.getFieldName()));
item.setFieldcol(16);
if (null != item && 2 == viewAttr && 1 == extendInfoPO.getIsrequired()) {
if ( 2 == viewAttr && 1 == extendInfoPO.getIsrequired()) {
item.setViewAttr(3);
item.setRules("required|string");
}
@ -150,19 +150,17 @@ public class ExtServiceImpl extends Service implements ExtService {
@Override
public void updateExtDT(User user, String extendType, String tableName, Map<String, Object> params, Long id) {
List<ExtendInfoPO> dtInfoPOList = getExtendInfoMapper().listFields(extendType, "", "");
Map<Long, String> groups = dtInfoPOList.stream().collect(Collectors.toMap(ExtendInfoPO::getExtendGroupId, ExtendInfoPO::getTableName, (k1, k2) -> k1));
List<ExtendInfoPO> dtInfoPOList = getExtendInfoMapper().listFields(extendType, "", tableName);
List<Long> groupIds = dtInfoPOList.stream().map(ExtendInfoPO::getExtendGroupId).distinct().collect(Collectors.toList());
Map<Long, List<ExtendInfoPO>> poMaps = dtInfoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId));
// 删除原有明细表数据
groups.forEach((k, v) -> {
if (v.toLowerCase().contains("_dt")) getExtDTMapper().deleteByMainID(v, id);
});
getExtDTMapper().deleteByMainID(tableName, id);
for (Map.Entry<Long, String> entry : groups.entrySet()) {
int rowNum = Util.getIntValue((String) params.get("rownum" + entry.getKey()));
List<ExtendInfoPO> filterS = dtInfoPOList.stream().filter(item -> entry.getKey().equals(item.getExtendGroupId())).collect(Collectors.toList());
for (Long groupId : groupIds) {
int rowNum = Util.getIntValue((String) params.get("rownum" + groupId));
List<ExtendInfoPO> filterS = poMaps.get(groupId);
for (int i = 0; i < rowNum; i++) {
Map<String, Object> map = new HashMap<>();
for (ExtendInfoPO extendInfoPO : filterS) {
if (BROWSER_TYPE == extendInfoPO.getControlType()) {
map.put(extendInfoPO.getFieldName() + "span", params.get(extendInfoPO.getFieldName() + "span_" + i));
@ -174,7 +172,7 @@ public class ExtServiceImpl extends Service implements ExtService {
map.put("delete_type", 0);
map.put("create_time", new Date());
map.put("update_time", new Date());
getExtDTMapper().insertCompExtDT(entry.getValue(), map);
getExtDTMapper().insertCompExtDT(tableName, map);
}
}
}

@ -0,0 +1,235 @@
package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.staff.bo.StaffPlanBO;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import com.engine.organization.entity.staff.po.StaffPlanPO;
import com.engine.organization.entity.staff.vo.StaffPlanTableVO;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.service.StaffPlanService;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.StringUtil;
import weaver.general.Util;
import java.util.*;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffPlanServiceImpl extends Service implements StaffPlanService {
private StaffPlanMapper getStaffPlanMapper() {
return MapperProxyFactory.getProxy(StaffPlanMapper.class);
}
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
@Override
public Map<String, Object> listPage(StaffPlanSearchParam params) {
OrganizationWeaTable<StaffPlanTableVO> table = new OrganizationWeaTable<>(user, StaffPlanTableVO.class);
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(params, (long) user.getUID());
String sqlWhere = buildSqlWhere(staffPlanPO);
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
return result.getResultMap();
}
@Override
public int saveStaffPlan(StaffPlanSearchParam param) {
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(param.getPlanNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
return getStaffPlanMapper().insertIgnoreNull(staffPlanPO);
}
@Override
public int updateStaffPlan(StaffPlanSearchParam param) {
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
}
@Override
public int updateForbiddenTagById(StaffPlanSearchParam params) {
StaffPlanPO staffPlanPO = StaffPlanPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
return getStaffPlanMapper().updateForbiddenTagById(staffPlanPO);
}
@Override
public int deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
return getStaffPlanMapper().deleteByIds(ids);
}
@Override
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
// 编号
SearchConditionItem planNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "planNo");
// 名称
SearchConditionItem planNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "planName");
// 年度
SearchConditionItem planYearItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "年度", "179", "planYear", "");
// 时间开始
SearchConditionItem timeStartItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 2, "时间开始", "timeStart");
// 时间结束
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 2, "时间结束", "timeEnd");
// 适用公司
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "适用公司", "162", "companyId", "compBrowser");
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
// 状态
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
SearchConditionOption disableOption = new SearchConditionOption("false", "禁用");
selectOptions.add(enableOption);
selectOptions.add(disableOption);
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "禁用标记", "forbiddenTag");
conditionItems.add(planNoItem);
conditionItems.add(planNameItem);
conditionItems.add(planYearItem);
conditionItems.add(timeStartItem);
conditionItems.add(timeEndItem);
conditionItems.add(companyIdtItem);
conditionItems.add(descriptionItem);
conditionItems.add(forbiddenTagItem);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
// 编号
SearchConditionItem planNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "planNo");
planNoItem.setRules("required|string");
// 名称
SearchConditionItem planNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "planName");
planNameItem.setRules("required|string");
// 年度
SearchConditionItem planYearItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "年度", "178", "planYear", "");
planYearItem.setRules("required|string");
// 时间开始
SearchConditionItem timeStartItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 3, "时间开始", "timeStart");
timeStartItem.setRules("required|string");
// 时间结束
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 3, "时间结束", "timeEnd");
timeEndItem.setRules("required|string");
// 适用公司
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "companyId", "162", "planYear", "compBrowser");
companyIdtItem.setRules("required|string");
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
// 编辑状态下赋值操作
String id = Util.null2String(params.get("id"));
if (!StringUtil.isEmpty(id)) {
StaffPlanPO staffPlanPO = getStaffPlanMapper().getStaffPlanByID(Integer.parseInt(id));
OrganizationAssert.notNull(staffPlanPO, "选择的数据不存在,或数据已删除");
planNoItem.setValue(staffPlanPO.getPlanNo());
planNameItem.setValue(staffPlanPO.getPlanName());
planYearItem.setValue(staffPlanPO.getPlanYear());
timeStartItem.setValue(staffPlanPO.getTimeStart());
timeEndItem.setValue(staffPlanPO.getTimeEnd());
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(QueryParam.builder().ids(staffPlanPO.getCompanyId().toString()).build().getIds());
browserBean.setReplaceDatas(maps);
companyIdtItem.setBrowserConditionParam(browserBean);
descriptionItem.setValue(staffPlanPO.getDescription());
// 编辑状态下,编号只读
planNoItem.setViewAttr(1);
}
selectItems.add(planNoItem);
selectItems.add(planNameItem);
selectItems.add(planYearItem);
selectItems.add(timeStartItem);
selectItems.add(timeEndItem);
selectItems.add(companyIdtItem);
selectItems.add(descriptionItem);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getHasRight() {
return MenuBtn.getCommonBtnDatas();
}
/**
*
*
* @param staffPlanPO
* @return
*/
private String buildSqlWhere(StaffPlanPO staffPlanPO) {
DBType dbType = DBType.get(new RecordSet().getDBType());
String sqlWhere = " where t.delete_type ='0' ";
String planNo = staffPlanPO.getPlanNo();
if (StringUtils.isNotBlank(planNo)) {
sqlWhere += " AND t.plan_no " + dbType.like(planNo);
}
String planName = staffPlanPO.getPlanName();
if (StringUtils.isNotBlank(planName)) {
sqlWhere += " AND t.plan_name " + dbType.like(planName);
}
Integer planYear = staffPlanPO.getPlanYear();
if (null != planYear) {
sqlWhere += " AND t.plan_year = '" + planYear + "'";
}
Date timeStart = staffPlanPO.getTimeStart();
if (null != timeStart) {
sqlWhere += " AND t.time_start = '" + timeStart + "'";
}
Date timeEnd = staffPlanPO.getTimeEnd();
if (null != timeEnd) {
sqlWhere += " AND t.time_end = '" + timeEnd + "'";
}
String companyId = staffPlanPO.getDescription();
if (StringUtils.isNotBlank(companyId)) {
sqlWhere += " AND t.companyId = '" + companyId + "'";
}
String description = staffPlanPO.getDescription();
if (StringUtils.isNotBlank(description)) {
sqlWhere += " AND t.description " + dbType.like(description);
}
Integer forbiddenTag = staffPlanPO.getForbiddenTag();
if (null != forbiddenTag) {
sqlWhere += " AND t.forbidden_tag = '" + forbiddenTag + "'";
}
return sqlWhere;
}
}

@ -0,0 +1,249 @@
package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.staff.bo.StaffBO;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.entity.staff.vo.StaffTableVO;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.service.StaffService;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.StringUtil;
import weaver.general.Util;
import java.util.*;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffServiceImpl extends Service implements StaffService {
private StaffMapper getStaffMapper() {
return MapperProxyFactory.getProxy(StaffMapper.class);
}
private StaffPlanMapper getStaffPlanMapper() {
return MapperProxyFactory.getProxy(StaffPlanMapper.class);
}
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private DepartmentMapper getDepartmentMapper() {
return MapperProxyFactory.getProxy(DepartmentMapper.class);
}
@Override
public Map<String, Object> listPage(StaffSearchParam params) {
OrganizationWeaTable<StaffTableVO> table = new OrganizationWeaTable<>(user, StaffTableVO.class);
StaffPO staffPO = StaffBO.convertParamToPO(params, (long) user.getUID());
String sqlWhere = buildSqlWhere(staffPO);
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
return result.getResultMap();
}
@Override
public int saveStaff(StaffSearchParam param) {
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
return getStaffMapper().insertIgnoreNull(staffPO);
}
@Override
public int updateStaff(StaffSearchParam param) {
StaffPO staffPlanPO = StaffBO.convertParamToPO(param, (long) user.getUID());
return getStaffMapper().updateStaff(staffPlanPO);
}
@Override
public int deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
return getStaffMapper().deleteByIds(ids);
}
@Override
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
// 方案
SearchConditionItem planIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案", "161", "planId", "staffPlanBrowser");
// 分部
SearchConditionItem compIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
// 部门
SearchConditionItem deptIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "deptId", "deptBrowser");
// 岗位
SearchConditionItem jobIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "161", "jobId", "jobBrowser");
// 编制数
SearchConditionItem staffNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "编制数", "staffNum");
// 在编
SearchConditionItem permanentNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "在编", "permanentNum");
// 冻结数
SearchConditionItem freezeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "冻结数", "freezeNum");
// 缺编状态
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption lackOption = new SearchConditionOption("1", "缺编");
SearchConditionOption fullOption = new SearchConditionOption("2", "满员");
SearchConditionOption overOption = new SearchConditionOption("3", "超编");
selectOptions.add(lackOption);
selectOptions.add(fullOption);
selectOptions.add(overOption);
SearchConditionItem lackStatusItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "缺编状态", "lackStatus");
// 编制描述
SearchConditionItem staffDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编制描述", "staffDesc");
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
conditionItems.add(planIdtItem);
conditionItems.add(compIdtItem);
conditionItems.add(deptIdtItem);
conditionItems.add(jobIdtItem);
conditionItems.add(staffNumItem);
conditionItems.add(permanentNumItem);
conditionItems.add(freezeNumItem);
conditionItems.add(lackStatusItem);
conditionItems.add(staffDescItem);
conditionItems.add(descriptionItem);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
// 方案
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "方案", "161", "planId", "staffPlanBrowser");
planIdItem.setRules("required|string");
// 分部
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "分部", "161", "compId", "compBrowser");
compIdItem.setRules("required|string");
// 部门
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "部门", "161", "deptId", "deptBrowser");
deptIdItem.setRules("required|string");
// 岗位
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "岗位", "161", "jobId", "jobBrowser");
jobIdItem.setRules("required|string");
// 编制数
SearchConditionItem staffNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "编制数", "staffNum");
staffNumItem.setRules("required|string");
// 控制策略
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption option1 = new SearchConditionOption("1", "弱控");
SearchConditionOption option2 = new SearchConditionOption("2", "强控");
SearchConditionOption option3 = new SearchConditionOption("3", "不控");
selectOptions.add(option1);
selectOptions.add(option2);
selectOptions.add(option3);
SearchConditionItem controlPolicyItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "控制策略", "controlPolicy");
controlPolicyItem.setViewAttr(3);
controlPolicyItem.setRules("required|string");
// 编辑状态下赋值操作
String id = Util.null2String(params.get("id"));
if (!StringUtil.isEmpty(id)) {
StaffPO staffPO = getStaffMapper().getStaffByID(Integer.parseInt(id));
OrganizationAssert.notNull(staffPO, "选择的数据不存在,或数据已删除");
BrowserBean planIdItemBean = planIdItem.getBrowserConditionParam();
List<Map<String, Object>> maps = getStaffPlanMapper().listPlansByIds(QueryParam.builder().ids(staffPO.getPlanId().toString()).build().getIds());
planIdItemBean.setReplaceDatas(maps);
planIdItem.setBrowserConditionParam(planIdItemBean);
}
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getHasRight() {
return MenuBtn.getCommonBtnDatas();
}
/**
*
*
* @param staffPO
* @return
*/
private String buildSqlWhere(StaffPO staffPO) {
DBType dbType = DBType.get(new RecordSet().getDBType());
String sqlWhere = " where t.delete_type ='0' ";
Long planId = staffPO.getPlanId();
if (null != planId) {
sqlWhere += " AND t.plan_id = '" + planId + "'";
}
Long compId = staffPO.getCompId();
if (null != compId) {
sqlWhere += " AND t.comp_id = '" + compId + "'";
}
Long deptId = staffPO.getDeptId();
if (null != deptId) {
sqlWhere += " AND t.dept_id = '" + deptId + "'";
}
Long jobId = staffPO.getJobId();
if (null != jobId) {
sqlWhere += " AND t.job_id = '" + jobId + "'";
}
Integer staffNum = staffPO.getStaffNum();
if (null != staffNum) {
sqlWhere += " AND t.staff_num = '" + staffNum + "'";
}
Integer controlPolicy = staffPO.getControlPolicy();
if (null != controlPolicy) {
sqlWhere += " AND t.control_policy = '" + controlPolicy + "'";
}
Integer permanentNum = staffPO.getPermanentNum();
if (null != permanentNum) {
sqlWhere += " AND t.permanent_num = '" + permanentNum + "'";
}
Integer freezeNum = staffPO.getFreezeNum();
if (null != freezeNum) {
sqlWhere += " AND t.freeze_num = '" + freezeNum + "'";
}
Integer lackStatus = staffPO.getLackStatus();
if (null != lackStatus) {
sqlWhere += " AND t.lack_status = '" + lackStatus + "'";
}
String staffDesc = staffPO.getStaffDesc();
if (StringUtils.isNotBlank(staffDesc)) {
sqlWhere += " AND t.staff_desc " + dbType.like(staffDesc);
}
String description = staffPO.getDescription();
if (StringUtils.isNotBlank(description)) {
sqlWhere += " AND t.description " + dbType.like(description);
}
return sqlWhere;
}
}

@ -0,0 +1,25 @@
package com.engine.organization.transmethod;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class CompTransMethod {
public static String getSpanById(String planId) {
CompMapper compMapper = MapperProxyFactory.getProxy(CompMapper.class);
List<Map<String, Object>> maps = compMapper.listCompsByIds(QueryParam.builder().ids(planId).build().getIds());
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
return names;
}
}

@ -0,0 +1,25 @@
package com.engine.organization.transmethod;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class DepartmentTransMethod {
public static String getSpanById(String planId) {
DepartmentMapper departmentMapper = MapperProxyFactory.getProxy(DepartmentMapper.class);
List<Map<String, Object>> maps = departmentMapper.listDeptsByIds(QueryParam.builder().ids(planId).build().getIds());
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
return names;
}
}

@ -0,0 +1,18 @@
package com.engine.organization.transmethod;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class JobTransMethod {
public static String getSpanById(String planId) {
//JobMapper compMapper = MapperProxyFactory.getProxy(CompMapper.class);
//List<Map<String, Object>> maps = compMapper.listCompsByIds(QueryParam.builder().ids(planId).build().getIds());
//String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
//return names;
return "";
}
}

@ -0,0 +1,25 @@
package com.engine.organization.transmethod;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffPlanTransMethod {
public static String getSpanById(String planId) {
StaffPlanMapper planMapper = MapperProxyFactory.getProxy(StaffPlanMapper.class);
List<Map<String, Object>> maps = planMapper.listPlansByIds(QueryParam.builder().ids(planId).build().getIds());
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
return names;
}
}

@ -0,0 +1,176 @@
package com.engine.organization.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.StaffWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffController {
public StaffWrapper getStaffWrapper(User user) {
return ServiceUtil.getService(StaffWrapper.class, user);
}
/**
* list
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getTable")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listStaff(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
StaffSearchParam param = JSONObject.toJavaObject((JSON) JSON.toJSON(map), StaffSearchParam.class);
return ReturnResult.successed(getStaffWrapper(user).listPage(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@POST
@Path("/saveStaff")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveStaff(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffWrapper(user).saveStaff(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updateStaff")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateStaff(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffWrapper(user).updateStaff(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* ID
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/deleteByIds")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QueryParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffWrapper(user).deleteByIds(param.getIds()));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSearchCondition")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getStaffWrapper(user).getSearchCondition(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getStaffWrapper(user).getForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getHasRight")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffWrapper(user).getHasRight());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

@ -0,0 +1,196 @@
package com.engine.organization.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.QueryParam;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.StaffPlanWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffPlanController {
public StaffPlanWrapper getStaffPlanWrapper(User user) {
return ServiceUtil.getService(StaffPlanWrapper.class, user);
}
/**
* list
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getTable")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listStaffPlan(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
StaffPlanSearchParam param = JSONObject.toJavaObject((JSON) JSON.toJSON(map), StaffPlanSearchParam.class);
return ReturnResult.successed(getStaffPlanWrapper(user).listPage(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@POST
@Path("/saveStaffPlan")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveStaffPlan(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffPlanSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffPlanWrapper(user).saveStaffPlan(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updateStaffPlan")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateStaffPlan(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffPlanSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffPlanWrapper(user).updateStaffPlan(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/updateForbiddenTagById")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateForbiddenTagById(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffPlanSearchParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffPlanWrapper(user).updateForbiddenTagById(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* ID
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/deleteByIds")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QueryParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffPlanWrapper(user).deleteByIds(param.getIds()));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSearchCondition")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getStaffPlanWrapper(user).getSearchCondition(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getStaffPlanWrapper(user).getForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getHasRight")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getStaffPlanWrapper(user).getHasRight());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

@ -0,0 +1,102 @@
package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import com.engine.organization.service.StaffPlanService;
import com.engine.organization.service.impl.StaffPlanServiceImpl;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;
import java.util.Collection;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffPlanWrapper extends Service {
private StaffPlanService getStaffPlanService(User user) {
return ServiceUtil.getService(StaffPlanServiceImpl.class, user);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> listPage(StaffPlanSearchParam params) {
return getStaffPlanService(user).listPage(params);
}
/**
*
*
* @param param
* @return
*/
public int saveStaffPlan(StaffPlanSearchParam param) {
return getStaffPlanService(user).saveStaffPlan(param);
}
/**
*
*
* @param param
* @return
*/
public int updateStaffPlan(StaffPlanSearchParam param) {
return getStaffPlanService(user).updateStaffPlan(param);
}
/**
*
*
* @param params
*/
public int updateForbiddenTagById(StaffPlanSearchParam params) {
return getStaffPlanService(user).updateForbiddenTagById(params);
}
/**
* ID
*
* @param ids
*/
public int deleteByIds(@Param("ids") Collection<Long> ids) {
return getStaffPlanService(user).deleteByIds(ids);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getStaffPlanService(user).getSearchCondition(params);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getForm(Map<String, Object> params) {
return getStaffPlanService(user).getForm(params);
}
/**
*
*
* @return
*/
public Map<String, Object> getHasRight() {
return getStaffPlanService(user).getHasRight();
}
}

@ -0,0 +1,93 @@
package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.service.StaffService;
import com.engine.organization.service.impl.StaffServiceImpl;
import weaver.hrm.User;
import java.util.Collection;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/25
* @version: 1.0
*/
public class StaffWrapper extends Service {
private StaffService getStaffService(User user) {
return ServiceUtil.getService(StaffServiceImpl.class, user);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> listPage(StaffSearchParam params) {
return getStaffService(user).listPage(params);
}
/**
*
*
* @param param
* @return
*/
public int saveStaff(StaffSearchParam param) {
return getStaffService(user).saveStaff(param);
}
/**
*
*
* @param param
* @return
*/
public int updateStaff(StaffSearchParam param) {
return getStaffService(user).updateStaff(param);
}
/**
* ID
*
* @param ids
*/
public int deleteByIds(Collection<Long> ids) {
return getStaffService(user).deleteByIds(ids);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getStaffService(user).getSearchCondition(params);
}
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getForm(Map<String, Object> params) {
return getStaffService(user).getForm(params);
}
/**
*
*
* @return
*/
public Map<String, Object> getHasRight() {
return getStaffService(user).getHasRight();
}
}
Loading…
Cancel
Save