编制上报 编制变更
parent
184580bb39
commit
77d27801b4
@ -0,0 +1,50 @@
|
||||
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/06/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StaffsPO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 编制ID
|
||||
*/
|
||||
private Long staffId;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private Integer businessType;
|
||||
/**
|
||||
* 编制变动数
|
||||
*/
|
||||
private Integer changeNum;
|
||||
/**
|
||||
* 业务来源
|
||||
*/
|
||||
private Integer businessSource;
|
||||
/**
|
||||
* 关联流程
|
||||
*/
|
||||
private Integer requestId;
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.engine.organization.mapper.staff;
|
||||
|
||||
import com.engine.organization.entity.staff.po.StaffsPO;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface StaffsMapper {
|
||||
/**
|
||||
* 插入编制方案
|
||||
*
|
||||
* @param staffsPO
|
||||
* @return
|
||||
*/
|
||||
int insertIgnoreNull(StaffsPO staffsPO);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
<?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.StaffsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.staff.po.StaffsPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="staff_id" property="staffId"/>
|
||||
<result column="business_type" property="businessType"/>
|
||||
<result column="change_num" property="changeNum"/>
|
||||
<result column="business_source" property="businessSource"/>
|
||||
<result column="requestid" property="requestId"/>
|
||||
<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.staff_id
|
||||
, t.business_type
|
||||
, t.change_num
|
||||
, t.business_source
|
||||
, t.staff_num
|
||||
, t.requestid
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffsPO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_staffs
|
||||
<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="staffId != null ">
|
||||
staff_id,
|
||||
</if>
|
||||
<if test="businessType != null ">
|
||||
business_type,
|
||||
</if>
|
||||
<if test="changeNum != null ">
|
||||
change_num,
|
||||
</if>
|
||||
<if test="businessSource != null ">
|
||||
business_source,
|
||||
</if>
|
||||
<if test="requestId != null ">
|
||||
requestid,
|
||||
</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="staffId != null ">
|
||||
#{staffId},
|
||||
</if>
|
||||
<if test="businessType != null ">
|
||||
#{businessType},
|
||||
</if>
|
||||
<if test="changeNum != null ">
|
||||
#{changeNum},
|
||||
</if>
|
||||
<if test="businessSource != null ">
|
||||
#{businessSource},
|
||||
</if>
|
||||
<if test="requestId != null ">
|
||||
#{requestId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
package com.engine.organization.transmethod;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffTransMethod {
|
||||
public static String getLackSpan(String lackStatus) {
|
||||
String lackSpan = "";
|
||||
switch (lackStatus) {
|
||||
case "1":
|
||||
lackSpan = "缺编";
|
||||
break;
|
||||
case "2":
|
||||
lackSpan = "满员";
|
||||
break;
|
||||
case "3":
|
||||
lackSpan = "超编";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
return lackSpan;
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package weaver.interfaces.organization.action;
|
||||
|
||||
import com.engine.organization.entity.staff.bo.StaffBO;
|
||||
import com.engine.organization.entity.staff.po.StaffPO;
|
||||
import com.engine.organization.entity.staff.po.StaffsPO;
|
||||
import com.engine.organization.mapper.staff.StaffMapper;
|
||||
import com.engine.organization.mapper.staff.StaffsMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffChangeAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
Integer requestid = Integer.parseInt(requestInfo.getRequestid());
|
||||
Long companyId = null;
|
||||
Long departmentId = null;
|
||||
Long jobId = null;
|
||||
Integer changeNum = null;
|
||||
Integer businessSource = null;
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] property = mainTableInfo.getProperty();
|
||||
// 取表单数据赋值
|
||||
for (int i = 0; i < property.length; i++) {
|
||||
String name = property[i].getName();
|
||||
String value = Util.null2String(property[i].getValue());
|
||||
if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) {
|
||||
switch (name) {
|
||||
case "fb":
|
||||
companyId = Long.parseLong(value);
|
||||
break;
|
||||
case "bm":
|
||||
departmentId = Long.parseLong(value);
|
||||
break;
|
||||
case "gw":
|
||||
jobId = Long.parseLong(value);
|
||||
|
||||
break;
|
||||
case "bzbds":
|
||||
changeNum = Integer.parseInt(value);
|
||||
break;
|
||||
case "ywly":
|
||||
businessSource = Integer.parseInt(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 根据分部、部门、岗位 定位具体编制信息
|
||||
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffByFilter(companyId, departmentId, jobId);
|
||||
if (null != staffPO) {
|
||||
|
||||
// 插入明细表
|
||||
StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(businessSource).requestId(requestid).build();
|
||||
MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO);
|
||||
|
||||
// 更新编制表
|
||||
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
|
||||
|
||||
StaffBO.buildStaffDesc(staffPO);
|
||||
|
||||
MapperProxyFactory.getProxy(StaffMapper.class).updateStaff(staffPO);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue