五院杭州中心 引入产品功能 时点花名册
This commit is contained in:
parent
20bb581122
commit
ddb6e038a2
|
|
@ -0,0 +1,5 @@
|
|||
#\u4EBA\u5458\u4EFB\u804C\u8BB0\u5F55\u8868
|
||||
eModeId=336
|
||||
|
||||
#\u65F6\u70B9\u529F\u80FD\u542F\u7528\u65E5\u671F
|
||||
startDate=
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.api.jclproduct.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 11:06 AM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Path("/jclproduct/report")
|
||||
public class EmployeeRecordReportAction extends com.engine.jclproduct.web.EmployeeRecordReportAction{
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.api.jclproduct.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:12 PM
|
||||
* @Description: 人员任职记录
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Path("/jclproduct/employee")
|
||||
public class EmploymentRecordAction extends com.engine.jclproduct.web.EmploymentRecordAction{
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface CheckboxPopedom {
|
||||
|
||||
String id() default "";
|
||||
|
||||
String showmethod() default "";
|
||||
|
||||
String popedompara() default "";
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface OperatePopedom {
|
||||
|
||||
boolean async() default true;
|
||||
|
||||
String transmethod() default "";
|
||||
|
||||
String otherpara() default "";
|
||||
|
||||
String otherpara2() default "";
|
||||
|
||||
String column() default "";
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface TableTitle {
|
||||
int labelId() default -1;
|
||||
String title();
|
||||
String dataIndex();
|
||||
String key();
|
||||
boolean display() default true;
|
||||
String width() default "";
|
||||
boolean sorter() default false;
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface WeaverTable {
|
||||
|
||||
String pageId() default "";
|
||||
|
||||
/**
|
||||
* 数据库字段,以','分割,例如:"id, name, description"
|
||||
*/
|
||||
String fields() default "";
|
||||
|
||||
/**
|
||||
* 表名 ,例如:"FROM hrsa_tax_agent"
|
||||
*/
|
||||
String fromSql() default "";
|
||||
|
||||
/**
|
||||
* 条件
|
||||
*/
|
||||
String where() default "";
|
||||
|
||||
/**
|
||||
* 分组
|
||||
*/
|
||||
String groupby() default "";
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
String orderby() default "";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
String primarykey() default "";
|
||||
|
||||
/**
|
||||
* 去重
|
||||
*/
|
||||
boolean distinct() default false;
|
||||
|
||||
|
||||
/**
|
||||
* 排序方式
|
||||
* @return
|
||||
*/
|
||||
String sortway() default "desc";
|
||||
|
||||
/**
|
||||
* 操作按钮
|
||||
*/
|
||||
WeaverTableOperate[] operates() default {};
|
||||
|
||||
/**
|
||||
* 操作按钮权限控制
|
||||
* @return
|
||||
*/
|
||||
OperatePopedom operatePopedom() default @OperatePopedom;
|
||||
|
||||
/**
|
||||
* 列表选择框
|
||||
*/
|
||||
WeaTableType tableType() default WeaTableType.NONE;
|
||||
|
||||
CheckboxPopedom checkboxPopedom() default @CheckboxPopedom;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface WeaverTableColumn {
|
||||
|
||||
String text() default "";
|
||||
|
||||
int labelId() default -1;
|
||||
|
||||
String width() default "";
|
||||
|
||||
String column() default "";
|
||||
|
||||
boolean display() default true;
|
||||
|
||||
String orderkey() default "";
|
||||
|
||||
String transmethod() default "";
|
||||
|
||||
// 额外参数
|
||||
String otherPara() default "";
|
||||
|
||||
// 多语言转换
|
||||
boolean multiLanguage() default false;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.jclproduct.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 1:48 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface WeaverTableOperate {
|
||||
|
||||
String text() default "";
|
||||
|
||||
int labelId() default -1;
|
||||
|
||||
String href() default "";
|
||||
|
||||
String index() default "0";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.engine.jclproduct.component;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.*;
|
||||
import com.engine.jclproduct.annotation.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.hrm.User;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class WeaverWeaTable<T> extends WeaTable {
|
||||
|
||||
public WeaverWeaTable(User user, Class clazz) {
|
||||
|
||||
boolean isAnno = clazz.isAnnotationPresent(WeaverTable.class);
|
||||
if (isAnno) {
|
||||
WeaverTable table = (WeaverTable) clazz.getAnnotation(WeaverTable.class);
|
||||
String pageId = table.pageId();
|
||||
super.setPageID(pageId);
|
||||
String pageUid = pageId + "_" + user.getUID();
|
||||
super.setPageUID(pageUid);
|
||||
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||
super.setPagesize(pageSize);
|
||||
String backfields = table.fields();
|
||||
super.setBackfields(backfields);
|
||||
String sql = table.fromSql();
|
||||
super.setSqlform(sql);
|
||||
String where = table.where();
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
super.setSqlwhere(where);
|
||||
}
|
||||
String orderby = table.orderby();
|
||||
if (StringUtils.isNotBlank(orderby)) {
|
||||
super.setSqlorderby(orderby);
|
||||
}
|
||||
String sortway = table.sortway();
|
||||
if (StringUtils.isNotBlank(sortway)) {
|
||||
super.setSqlsortway(sortway);
|
||||
}
|
||||
String groupby = table.groupby();
|
||||
if (StringUtils.isNotBlank(groupby)) {
|
||||
super.setSqlgroupby(groupby);
|
||||
}
|
||||
boolean distinct = table.distinct();
|
||||
super.setSqlisdistinct(String.valueOf(distinct));
|
||||
String primarykey = table.primarykey();
|
||||
if (StringUtils.isNotBlank(primarykey)) {
|
||||
super.setSqlprimarykey(primarykey);
|
||||
}
|
||||
WeaverTableOperate[] operates = table.operates();
|
||||
if (operates != null && operates.length > 0) {
|
||||
List<WeaTableOperate> operateList = new ArrayList<>();
|
||||
Arrays.stream(operates).forEach(o -> {
|
||||
String text = o.text();
|
||||
int labelId = o.labelId();
|
||||
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, user.getLanguage());
|
||||
if (StringUtils.isNotBlank(htmlLabelName)) {
|
||||
text = htmlLabelName;
|
||||
}
|
||||
WeaTableOperate weaTableOperate = new WeaTableOperate(text, o.href(), o.index());
|
||||
operateList.add(weaTableOperate);
|
||||
});
|
||||
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||
OperatePopedom popedoms = table.operatePopedom();
|
||||
WeaTablePopedom popedom = new WeaTablePopedom();
|
||||
if (popedoms != null && !"".equals(popedoms.transmethod())) {
|
||||
popedom.setTransmethod(popedoms.transmethod());
|
||||
popedom.setOtherpara(popedoms.otherpara());
|
||||
weaTableOperates.setPopedom(popedom);
|
||||
}
|
||||
weaTableOperates.setOperate(operateList);
|
||||
super.setOperates(weaTableOperates);
|
||||
}
|
||||
|
||||
WeaTableType weaTableTypeEnum = table.tableType();
|
||||
//设置check是否可用
|
||||
if (weaTableTypeEnum == WeaTableType.CHECKBOX) {
|
||||
super.setTableType(weaTableTypeEnum);
|
||||
CheckboxPopedom checkPopedom = table.checkboxPopedom();
|
||||
WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom();
|
||||
if (checkPopedom != null && !"".equals(checkPopedom.showmethod())) {
|
||||
checkboxpopedom.setShowmethod(checkPopedom.showmethod());
|
||||
checkboxpopedom.setPopedompara(checkPopedom.popedompara());
|
||||
}
|
||||
super.setCheckboxpopedom(checkboxpopedom);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field f : fields) {
|
||||
boolean isanno = f.isAnnotationPresent(WeaverTableColumn.class);
|
||||
if (isanno) {
|
||||
WeaverTableColumn columnAnn = f.getAnnotation(WeaverTableColumn.class);
|
||||
String text = columnAnn.text();
|
||||
int labelId = columnAnn.labelId();
|
||||
String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, user.getLanguage());
|
||||
if (StringUtils.isNotBlank(htmlLabelName)) {
|
||||
text = htmlLabelName;
|
||||
}
|
||||
String width = columnAnn.width();
|
||||
String column = columnAnn.column();
|
||||
String orderkey = columnAnn.orderkey();
|
||||
boolean display = columnAnn.display();
|
||||
WeaTableColumn weaTableColumn = new WeaTableColumn(width, text, column, orderkey);
|
||||
String transmethod = columnAnn.transmethod();
|
||||
|
||||
if (StringUtils.isNotBlank(transmethod)) {
|
||||
weaTableColumn.setTransmethod(transmethod);
|
||||
}
|
||||
String otherPara = columnAnn.otherPara();
|
||||
if (StringUtils.isNotBlank(otherPara)) {
|
||||
weaTableColumn.setOtherpara(otherPara);
|
||||
} else {
|
||||
// 未设置其他参数,但是设置了多语言,自动添加其它参数为语言类型
|
||||
if (columnAnn.multiLanguage()) {
|
||||
weaTableColumn.setOtherpara(String.valueOf(user.getLanguage()));
|
||||
}
|
||||
}
|
||||
if (!display) {
|
||||
weaTableColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
}
|
||||
super.getColumns().add(weaTableColumn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.engine.jclproduct.entity.bo;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.jclproduct.entity.po.*;
|
||||
import com.engine.jclproduct.utils.EmploymentUtil;
|
||||
import weaver.common.DateUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 5:31 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmploymentRecordBo {
|
||||
|
||||
|
||||
public static List<EmploymentRecordPo> buildEmploymentRecordPo(List<HrmresourcePo> hrmresourcePos) {
|
||||
List<EmploymentRecordPo> employmentRecordPos = new ArrayList<>();
|
||||
if (CollectionUtil.isEmpty(hrmresourcePos)) {
|
||||
return employmentRecordPos;
|
||||
}
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
//失效日期默认最大值
|
||||
return hrmresourcePos.stream().map(e-> {
|
||||
Map<String, Integer> map = EmploymentUtil.dateSplitExample(e.getCompanyStartDate());
|
||||
return EmploymentRecordPo.builder()
|
||||
.userId(e.getUserId())
|
||||
.workcode(e.getWorkcode())
|
||||
.employeeStatus(e.getStatus())
|
||||
.changType(EmploymentUtil.getChangeType(e.getStatus()))
|
||||
.startDate("".equals(e.getCompanyStartDate())?currentDate:e.getCompanyStartDate())
|
||||
.stopDate("9999-12-31") //失效日期默认最大值
|
||||
.departmentId(e.getDepartmentId())
|
||||
.subCompanyId(e.getSubcompanyId())
|
||||
.superior(e.getManagerId())
|
||||
.position(e.getJobTitle())
|
||||
.companyStartDate(e.getCompanyStartDate())
|
||||
.workyear(e.getCompanyWorkyear())
|
||||
.entryDateYear(map.get("year"))
|
||||
.entryDateMonth(map.get("month"))
|
||||
.entryDateDay(map.get("day"))
|
||||
.sex(e.getSex())
|
||||
.birthday(e.getBirthday())
|
||||
.build();}
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<OrganizationRecordPo> buildOrganizationRecordPo(List<SubCompanyPo> subCompanyPos, List<DepartmentPo> departmentPos) {
|
||||
List<OrganizationRecordPo> organizationRecordPos = new ArrayList<>();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(subCompanyPos)){
|
||||
subCompanyPos.forEach(e -> organizationRecordPos.add(setOrganizationRecordPo(e,null,0)));
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(departmentPos)) {
|
||||
departmentPos.forEach(e -> organizationRecordPos.add(setOrganizationRecordPo(null,e,1)));
|
||||
}
|
||||
|
||||
return organizationRecordPos;
|
||||
}
|
||||
|
||||
|
||||
public static OrganizationRecordPo setOrganizationRecordPo(SubCompanyPo sub,DepartmentPo dept,Integer type) {
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
if (type == 0) {
|
||||
return OrganizationRecordPo.builder()
|
||||
.orgStatus(sub.getCanceled() == 1 ? 1 : 0)
|
||||
.startDate(currentDate)
|
||||
.stopDate("9999-12-31")
|
||||
.oId(sub.getSubcompanyId())
|
||||
.oType(0)
|
||||
.oName(sub.getSubcompanyName())
|
||||
.oParentId(sub.getSupsubcomId())
|
||||
.changeType(sub.getCanceled() == 1 ? 2 : 0)
|
||||
.showorder(sub.getShoworder())
|
||||
.organizationCode(sub.getSubcompanyCode())
|
||||
.build();
|
||||
}else {
|
||||
return OrganizationRecordPo.builder()
|
||||
.orgStatus(dept.getCanceled() == 1 ? 1 : 0)
|
||||
.startDate(currentDate)
|
||||
.stopDate("9999-12-31")
|
||||
.oId(dept.getDepartmentId())
|
||||
.oType(1)
|
||||
.oName(dept.getDepartmentmark())
|
||||
.oParentId(dept.getSupdepId())
|
||||
.oChargeId(dept.getBmfzr())
|
||||
.changeType(dept.getCanceled() == 1 ? 2 : 0)
|
||||
.showorder(dept.getShoworder())
|
||||
.organizationCode(dept.getDepartmentCode())
|
||||
.belongSub(dept.getSubcompanyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static EmploymentRecordPo setEmploymentRecordPo(HrmresourcePo h){
|
||||
Map<String, Integer> map = EmploymentUtil.dateSplitExample(h.getCompanyStartDate());
|
||||
|
||||
//处理其他参数
|
||||
return EmploymentRecordPo.builder()
|
||||
.userId(h.getUserId())
|
||||
.workcode(h.getWorkcode())
|
||||
.employeeStatus(h.getStatus())
|
||||
.changType(EmploymentUtil.getChangeType(h.getStatus()))
|
||||
.startDate(DateUtil.getCurrentDate())
|
||||
.stopDate("9999-12-31")
|
||||
.departmentId(h.getDepartmentId())
|
||||
.subCompanyId(h.getSubcompanyId())
|
||||
.superior(h.getManagerId())
|
||||
.position(h.getJobTitle())
|
||||
.companyStartDate(h.getCompanyStartDate())
|
||||
.workyear(h.getCompanyWorkyear())
|
||||
.entryDateYear(map.get("year"))
|
||||
.entryDateMonth(map.get("month"))
|
||||
.entryDateDay(map.get("day"))
|
||||
.sex(h.getSex())
|
||||
.birthday(h.getBirthday())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.jclproduct.entity.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/31 10:38 AM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TransferParam {
|
||||
|
||||
private Integer changeOldDept;
|
||||
|
||||
private Integer changeNewDept;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/23 3:43 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DataDutyPo {
|
||||
|
||||
private HrmresourcePo hrmresourceUpdate;
|
||||
|
||||
private HrmresourcePo hrmresourceInsert;
|
||||
|
||||
private List<EmploymentRecordPo> employmentRecordInsert;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/7 2:58 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DepartmentPo {
|
||||
|
||||
private Integer departmentId;
|
||||
|
||||
private String departmentmark;
|
||||
|
||||
private Integer subcompanyId;
|
||||
|
||||
private Integer supdepId;
|
||||
|
||||
private float showorder;
|
||||
|
||||
private Integer canceled;
|
||||
|
||||
private String departmentCode;
|
||||
|
||||
private String bmfzr;
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EmploymentRecordPo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private String workcode;
|
||||
|
||||
private Integer employeeStatus;
|
||||
|
||||
private Integer changType;
|
||||
|
||||
private String startDate;
|
||||
|
||||
private String stopDate;
|
||||
|
||||
private Integer departmentId;
|
||||
|
||||
private Integer subCompanyId;
|
||||
|
||||
private Integer superior;
|
||||
|
||||
private Integer position;
|
||||
|
||||
private Integer changeOldSuperior;
|
||||
|
||||
private Integer changeNewSuperior;
|
||||
|
||||
private Integer changeOldJob;
|
||||
|
||||
private Integer changeNewJob;
|
||||
|
||||
private Integer changeOldDept;
|
||||
|
||||
private Integer changeNewDept;
|
||||
|
||||
private String companyStartDate;
|
||||
|
||||
private String workyear;
|
||||
|
||||
private Integer entryDateYear;
|
||||
|
||||
private Integer entryDateMonth;
|
||||
|
||||
private Integer entryDateDay;
|
||||
|
||||
private String expectedLastWorkDate;
|
||||
|
||||
private String lastWorkDate;
|
||||
|
||||
private String probationStartDate;
|
||||
|
||||
private String probationActualStopDate;
|
||||
|
||||
private String regularizationDate;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private String birthday;
|
||||
|
||||
|
||||
/**
|
||||
* 建模默认字段
|
||||
*/
|
||||
private Integer formModeId;
|
||||
private String modeDataCreateDate;
|
||||
private String modeDataCreateTime;
|
||||
private Integer modeDataCreater;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HrmresourcePo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private String workcode;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String companyStartDate;
|
||||
|
||||
private String companyWorkyear;
|
||||
|
||||
/**
|
||||
* 试用期结束日期不取(转正日期默认为试用期结束)
|
||||
*/
|
||||
private String probationendDate;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private String birthday;
|
||||
|
||||
private Integer jobTitle;
|
||||
|
||||
private Integer departmentId;
|
||||
|
||||
private Integer subcompanyId;
|
||||
|
||||
private Integer managerId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/8 3:04 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrganizationRecordPo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer orgStatus;
|
||||
|
||||
private String startDate;
|
||||
|
||||
private String stopDate;
|
||||
|
||||
private Integer oId;
|
||||
|
||||
private Integer oType;
|
||||
|
||||
private String oName;
|
||||
|
||||
private Integer oParentId;
|
||||
|
||||
private String oChargeId;
|
||||
|
||||
private Integer changeType;
|
||||
|
||||
private String newName;
|
||||
|
||||
private Integer newParentId;
|
||||
|
||||
private String newOChargeId;
|
||||
|
||||
private String oldName;
|
||||
|
||||
private Integer oldParentId;
|
||||
|
||||
private String oldOChargeId;
|
||||
|
||||
private float showorder;
|
||||
|
||||
private String organizationCode;
|
||||
|
||||
//部门所属分部
|
||||
private Integer belongSub;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.jclproduct.entity.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/7 2:53 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SubCompanyPo {
|
||||
|
||||
private Integer subcompanyId;
|
||||
|
||||
private String subcompanyName;
|
||||
|
||||
private Integer companyId;
|
||||
|
||||
private Integer supsubcomId;
|
||||
|
||||
private float showorder;
|
||||
|
||||
private Integer canceled;
|
||||
|
||||
private String subcompanyCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/30 2:24 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CaluResourceVo {
|
||||
|
||||
private Integer key;
|
||||
|
||||
private Integer superKey;
|
||||
|
||||
private String departmentName;
|
||||
|
||||
private Integer startNumber;
|
||||
|
||||
private Integer entryNumber;
|
||||
|
||||
private Integer transferNumber;
|
||||
|
||||
private Integer leaveNumber;
|
||||
|
||||
private Integer onNumber;
|
||||
|
||||
private Integer outNumber;
|
||||
|
||||
private Integer endNumber;
|
||||
|
||||
private List<CaluResourceVo> children;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "3824ecae-fa94-4020-be40-b78eb2831f32",
|
||||
fields = "t.id," +
|
||||
"t.startDate," +
|
||||
"t.stopDate," +
|
||||
"t.userId," +
|
||||
"t.workcode," +
|
||||
"t.employeeStatus," +
|
||||
"t.subCompanyId," +
|
||||
"t.departmentId," +
|
||||
"t.position," +
|
||||
"t.superior," +
|
||||
"t.companyStartDate," +
|
||||
"t.expectedLastWorkDate," +
|
||||
"t.lastWorkDate," +
|
||||
"t.probationActualStopDate," +
|
||||
"t.regularizationDate," +
|
||||
"t.workyear," +
|
||||
"t.sex," +
|
||||
"t.birthday",
|
||||
fromSql = "FROM uf_EmploymentRecord t ",
|
||||
orderby = "userid",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class LeaveResourceVo {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
@WeaverTableColumn(column = "startDate",text = "生效日期", display = false)
|
||||
private String startDate;
|
||||
|
||||
@WeaverTableColumn(column = "stopDate",text = "失效日期", display = false)
|
||||
private String stopDate;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@WeaverTableColumn( text = "姓名", width = "10%", column = "userId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String userId;
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@WeaverTableColumn( text = "工号", width = "10%", column = "workcode")
|
||||
private String workcode;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "employeeStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.statusName")
|
||||
private String employeeStatus;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部", width = "10%", column = "subCompanyId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String subCompanyId;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门", width = "10%", column = "departmentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String departmentId;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@WeaverTableColumn( text = "岗位", width = "10%", column = "position",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.jobTitleName")
|
||||
private String position;
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
@WeaverTableColumn( text = "直接上级", width = "10%", column = "superior",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private Integer superior;
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "入职日期", width = "10%", column = "companyStartDate")
|
||||
private Integer companyStartDate;
|
||||
/**
|
||||
* 退休日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "退休日期", width = "10%", column = "expectedLastWorkDate")
|
||||
private Integer expectedLastWorkDate;
|
||||
/**
|
||||
* 离职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "离职日期", width = "10%", column = "lastWorkDate")
|
||||
private Integer lastWorkDate;
|
||||
/**
|
||||
* 转正日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "转正日期", width = "10%", column = "regularizationDate")
|
||||
private Integer regularizationDate;
|
||||
/**
|
||||
* 司龄
|
||||
*/
|
||||
// @WeaverTableColumn( text = "司龄", width = "10%", column = "workyear")
|
||||
// private Integer workyear;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@WeaverTableColumn( text = "性别", width = "10%", column = "sex",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexName")
|
||||
private String sex;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@WeaverTableColumn( text = "生日", width = "10%", column = "birthday")
|
||||
private String birthday;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "195fd81d-95fb-4568-af05-1a564c863e21",
|
||||
fields = "t.id," +
|
||||
"t.orgStatus," +
|
||||
"t.organizationCode," +
|
||||
"t.oName," +
|
||||
"t.oParentId," +
|
||||
"t.oChargeId," +
|
||||
"t.belongSub," +
|
||||
"t.showorder",
|
||||
fromSql = "FROM uf_orgChange t",
|
||||
orderby = "showorder",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TimeDepartmentVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "orgStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexOrgStatus")
|
||||
private String orgStatus;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门编码", width = "10%", column = "organizationCode")
|
||||
private String organizationCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门名称", width = "10%", column = "oName")
|
||||
private String oName;
|
||||
|
||||
/**
|
||||
* 上级部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "上级部门", width = "10%", column = "oParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String oParentId;
|
||||
|
||||
|
||||
/**
|
||||
* 部门负责人
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门负责人", width = "10%", column = "oChargeId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String oChargeId;
|
||||
|
||||
/**
|
||||
* 所属分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "所属分部", width = "10%", column = "belongSub",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String belongSub;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@WeaverTableColumn( text = "显示顺序", width = "10%", column = "showorder")
|
||||
private String showorder;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "6f201832-a940-4225-a4c9-3f4b96ff5b89",
|
||||
fields = "t.id," +
|
||||
"t.startDate," +
|
||||
"t.stopDate," +
|
||||
"t.userId," +
|
||||
"t.workcode," +
|
||||
"t.employeeStatus," +
|
||||
"t.subCompanyId," +
|
||||
"t.departmentId," +
|
||||
"t.position," +
|
||||
"t.superior," +
|
||||
"t.companyStartDate," +
|
||||
"t.expectedLastWorkDate," +
|
||||
"t.lastWorkDate," +
|
||||
"t.probationActualStopDate," +
|
||||
"t.regularizationDate," +
|
||||
"t.workyear," +
|
||||
"t.sex," +
|
||||
"t.birthday",
|
||||
fromSql = "FROM uf_EmploymentRecord t ",
|
||||
orderby = "userid",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TimeResourceVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
@WeaverTableColumn(column = "startDate",text = "生效日期", display = false)
|
||||
private String startDate;
|
||||
|
||||
@WeaverTableColumn(column = "stopDate",text = "失效日期", display = false)
|
||||
private String stopDate;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@WeaverTableColumn( text = "姓名", width = "10%", column = "userId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String userId;
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@WeaverTableColumn( text = "工号", width = "10%", column = "workcode")
|
||||
private String workcode;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "employeeStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.statusName")
|
||||
private String employeeStatus;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部", width = "10%", column = "subCompanyId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String subCompanyId;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门", width = "10%", column = "departmentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String departmentId;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@WeaverTableColumn( text = "岗位", width = "10%", column = "position",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.jobTitleName")
|
||||
private String position;
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
@WeaverTableColumn( text = "直接上级", width = "10%", column = "superior",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private Integer superior;
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "入职日期", width = "10%", column = "companyStartDate")
|
||||
private Integer companyStartDate;
|
||||
/**
|
||||
* 退休日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "退休日期", width = "10%", column = "expectedLastWorkDate")
|
||||
private Integer expectedLastWorkDate;
|
||||
/**
|
||||
* 离职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "离职日期", width = "10%", column = "lastWorkDate")
|
||||
private Integer lastWorkDate;
|
||||
/**
|
||||
* 转正日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "转正日期", width = "10%", column = "regularizationDate")
|
||||
private Integer regularizationDate;
|
||||
/**
|
||||
* 司龄
|
||||
*/
|
||||
// @WeaverTableColumn( text = "司龄", width = "10%", column = "workyear")
|
||||
// private Integer workyear;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@WeaverTableColumn( text = "性别", width = "10%", column = "sex",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexName")
|
||||
private String sex;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@WeaverTableColumn( text = "生日", width = "10%", column = "birthday")
|
||||
private String birthday;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "ab83519e-1df8-48a0-9c4b-4ba60aa69c5e",
|
||||
fields = "t.id," +
|
||||
"t.orgStatus," +
|
||||
"t.organizationCode," +
|
||||
"t.oName," +
|
||||
"t.oParentId," +
|
||||
"t.showorder",
|
||||
fromSql = "FROM uf_orgChange t",
|
||||
orderby = "showorder",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TimeSubCompanyVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "orgStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexOrgStatus")
|
||||
private String orgStatus;
|
||||
|
||||
/**
|
||||
* 分部编码
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部编码", width = "10%", column = "organizationCode")
|
||||
private String organizationCode;
|
||||
|
||||
/**
|
||||
* 分部名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部名称", width = "10%", column = "oName")
|
||||
private String oName;
|
||||
|
||||
/**
|
||||
* 上级分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "上级分部", width = "10%", column = "oParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String oParentId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@WeaverTableColumn( text = "显示顺序", width = "10%", column = "showorder")
|
||||
private String showorder;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "4e0e4e0b-2440-4446-a9c6-e7fd44301bf7",
|
||||
fields = "t.id," +
|
||||
"t.orgStatus," +
|
||||
"t.oName," +
|
||||
"t.belongSub," +
|
||||
"t.oldName," +
|
||||
"t.oldOChargeId," +
|
||||
"t.newName," +
|
||||
"t.newParentId," +
|
||||
"t.newOChargeId," +
|
||||
"t.showorder",
|
||||
fromSql = "FROM uf_orgChange t",
|
||||
orderby = "showorder",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TransDepartmentVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "orgStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexOrgStatus")
|
||||
private String orgStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "部门名称", width = "10%", column = "oName")
|
||||
private String oName;
|
||||
|
||||
/**
|
||||
* 所属分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "所属分部", width = "10%", column = "belongSub",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String belongSub;
|
||||
|
||||
/**
|
||||
* 变动前部门名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动前部门名称", width = "10%", column = "oldName")
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 变动前上级部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动前上级部门", width = "10%", column = "oldParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String oldParentId;
|
||||
|
||||
/**
|
||||
* 变动前部门负责人
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动前部门负责人", width = "10%", column = "oldOChargeId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String oldOChargeId;
|
||||
|
||||
/**
|
||||
* 变动后部门名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动后部门名称", width = "10%", column = "newName")
|
||||
private String newName;
|
||||
|
||||
/**
|
||||
* 变动后上级部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动后上级部门", width = "10%", column = "newParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String newParentId;
|
||||
|
||||
/**
|
||||
* 变动后部门负责人
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动后部门负责人", width = "10%", column = "newOChargeId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String newOChargeId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "f3fbe166-778d-4ed7-b026-528c3262fa48",
|
||||
fields = "t.id," +
|
||||
"t.orgStatus," +
|
||||
"t.oName," +
|
||||
"t.oldName," +
|
||||
"t.oldParentId," +
|
||||
"t.newName," +
|
||||
"t.newParentId",
|
||||
fromSql = "FROM uf_orgChange t",
|
||||
orderby = "showorder",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TransSubCompanyVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "5%", column = "orgStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexOrgStatus")
|
||||
private String orgStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 分部名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部名称", width = "10%", column = "oName")
|
||||
private String oName;
|
||||
|
||||
/**
|
||||
* 变动前分部名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动前分部名称", width = "10%", column = "oldName")
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 变动前上级分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动前上级分部", width = "10%", column = "oldParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String oldParentId;
|
||||
|
||||
|
||||
/**
|
||||
* 变动后分部名称
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动后分部名称", width = "10%", column = "newName")
|
||||
private String newName;
|
||||
|
||||
/**
|
||||
* 变动后上级分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "变动后上级分部", width = "10%", column = "newParentId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String newParentId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.engine.jclproduct.entity.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.jclproduct.annotation.WeaverTable;
|
||||
import com.engine.jclproduct.annotation.WeaverTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:22 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@WeaverTable(pageId = "ba7d8752-a037-4b1a-b1dc-7361f78f0683",
|
||||
fields = "t.id," +
|
||||
"t.startDate," +
|
||||
"t.stopDate," +
|
||||
"t.userId," +
|
||||
"t.workcode," +
|
||||
"t.employeeStatus," +
|
||||
"t.subCompanyId," +
|
||||
"t.changeNewDept," +
|
||||
"t.changeNewJob," +
|
||||
"t.changeNewSuperior," +
|
||||
"t.changeOldDept," +
|
||||
"t.changeOldJob," +
|
||||
"t.changeOldSuperior," +
|
||||
"t.companyStartDate," +
|
||||
"t.lastWorkDate," +
|
||||
"t.workyear," +
|
||||
"t.sex," +
|
||||
"t.birthday",
|
||||
fromSql = "FROM uf_EmploymentRecord t ",
|
||||
orderby = "userid",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
)
|
||||
public class TransferResourceVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@WeaverTableColumn(column = "id",text = "序号", display = false)
|
||||
private Integer id;
|
||||
|
||||
|
||||
|
||||
@WeaverTableColumn(column = "startDate",width = "10%",text = "调动日期")
|
||||
private String startDate;
|
||||
|
||||
@WeaverTableColumn(column = "stopDate",width = "10%",text = "失效日期", display = false)
|
||||
private String stopDate;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@WeaverTableColumn( text = "姓名", width = "10%", column = "userId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private String userId;
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@WeaverTableColumn( text = "工号", width = "10%", column = "workcode")
|
||||
private String workcode;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@WeaverTableColumn( text = "状态", width = "10%", column = "employeeStatus",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.statusName")
|
||||
private String employeeStatus;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@WeaverTableColumn( text = "分部", width = "10%", column = "subCompanyId",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.subCompanyName")
|
||||
private String subCompanyId;
|
||||
/**
|
||||
* 新部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "新部门", width = "10%", column = "changeNewDept",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String changeNewDept;
|
||||
/**
|
||||
* 新岗位
|
||||
*/
|
||||
@WeaverTableColumn( text = "新岗位", width = "10%", column = "changeNewJob",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.jobTitleName")
|
||||
private String changeNewJob;
|
||||
/**
|
||||
* 新直接上级
|
||||
*/
|
||||
@WeaverTableColumn( text = "新直接上级", width = "10%", column = "changeNewSuperior",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private Integer changeNewSuperior;
|
||||
/**
|
||||
* 原部门
|
||||
*/
|
||||
@WeaverTableColumn( text = "原部门", width = "10%", column = "changeOldDept",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.departmentName")
|
||||
private String changeOldDept;
|
||||
/**
|
||||
* 原岗位
|
||||
*/
|
||||
@WeaverTableColumn( text = "原岗位", width = "10%", column = "changeOldJob",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.jobTitleName")
|
||||
private String changeOldJob;
|
||||
/**
|
||||
* 原直接上级
|
||||
*/
|
||||
@WeaverTableColumn( text = "原直接上级", width = "10%", column = "changeOldSuperior",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.resourceName")
|
||||
private Integer changeOldSuperior;
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "入职日期", width = "10%", column = "companyStartDate")
|
||||
private Integer companyStartDate;
|
||||
|
||||
/**
|
||||
* 离职日期
|
||||
*/
|
||||
@WeaverTableColumn( text = "离职日期", width = "10%", column = "lastWorkDate")
|
||||
private Integer lastWorkDate;
|
||||
|
||||
/**
|
||||
* 司龄
|
||||
*/
|
||||
// @WeaverTableColumn( text = "司龄", width = "10%", column = "workyear")
|
||||
// private Integer workyear;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@WeaverTableColumn( text = "性别", width = "10%", column = "sex",transmethod = "com.engine.jclproduct.transmethod.EmReportTransMethod.sexName")
|
||||
private String sex;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.engine.jclproduct.service;
|
||||
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 11:10 AM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface EmployeeRecordReportService {
|
||||
|
||||
/**
|
||||
* @Description: 人事花名册(总)
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/25 2:19 PM
|
||||
* @param: [params]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String,Object> commonReport(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 时点花名册
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/25 2:21 PM
|
||||
* @param: []
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String, Object> timeResourece(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 离职员工花名册
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/25 2:21 PM
|
||||
* @param: []
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String, Object> leaveResourece(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 人员调动记录
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/25 2:21 PM
|
||||
* @param: []
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String, Object> transferResourece(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 管理幅度统计
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/25 2:21 PM
|
||||
* @param: []
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String, Object> caluResourece(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 管理幅度统计导出
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/11/1 11:42 AM
|
||||
* @param: [request, response]
|
||||
* @return: org.apache.poi.xssf.usermodel.XSSFWorkbook
|
||||
*/
|
||||
XSSFWorkbook reportExport(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* @Description: 组织(总)
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/11/8 4:16 PM
|
||||
* @param: [params]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String,Object> orgReport(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.jclproduct.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:23 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface EmploymentRecordService {
|
||||
|
||||
/**
|
||||
* @Description: 初始化人员任职记录表 当前在职人员数据(只初始化一次)
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/10/22 4:36 PM
|
||||
* @param: []
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String,Object> initPerson();
|
||||
|
||||
/**
|
||||
* @Description: 初始化组织变动表 人员资源分部(部门)中间表 (只初始化一次)
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2024/11/7 2:24 PM
|
||||
* @param: []
|
||||
* @return: java.lang.Object
|
||||
*/
|
||||
Map<String,Object> initOrganization();
|
||||
}
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
package com.engine.jclproduct.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.jclproduct.component.WeaverWeaTable;
|
||||
import com.engine.jclproduct.entity.param.TransferParam;
|
||||
import com.engine.jclproduct.entity.vo.*;
|
||||
import com.engine.jclproduct.service.EmployeeRecordReportService;
|
||||
import com.engine.jclproduct.utils.EmploymentUtil;
|
||||
import com.engine.jclproduct.utils.ExcelUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 11:11 AM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmployeeRecordReportServiceImpl extends Service implements EmployeeRecordReportService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> commonReport(Map<String, Object> params) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String selectedKey = Util.null2String(params.get("selectedKey"));
|
||||
switch (selectedKey) {
|
||||
case "0":
|
||||
result = timeResourece(params);
|
||||
break;
|
||||
case "1":
|
||||
result = leaveResourece(params);
|
||||
break;
|
||||
case "2":
|
||||
result = transferResourece(params);
|
||||
break;
|
||||
case "3":
|
||||
result = caluResourece(params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> timeResourece(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
|
||||
WeaverWeaTable<TimeResourceVo> table = new WeaverWeaTable<>(user, TimeResourceVo.class);
|
||||
String sqlWhere = buildtimeResoureceSql(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> leaveResourece(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
|
||||
WeaverWeaTable<TimeResourceVo> table = new WeaverWeaTable<>(user, LeaveResourceVo.class);
|
||||
String sqlWhere = buildLeaveResoureceSql(params);
|
||||
sqlWhere += " and employeeStatus in (5)";
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> transferResourece(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
|
||||
WeaverWeaTable<TimeResourceVo> table = new WeaverWeaTable<>(user, TransferResourceVo.class);
|
||||
String sqlWhere = buildtransferResoureceSql(params);
|
||||
sqlWhere += " and changType in (2)";
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> caluResourece(Map<String, Object> params) {
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<String, Object> resultMap = new HashMap<>(4);
|
||||
|
||||
List<CaluResourceVo> caluResourceVos = new ArrayList<>();
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
String date = Util.null2String(params.get("date"));
|
||||
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
||||
|
||||
String sql = "select id,supdepid,departmentname from hrmdepartment where (canceled is null or canceled != 1) ";
|
||||
if(!"".equals(departmentId)){
|
||||
ArrayList<String> lists = new ArrayList<>();
|
||||
lists.add(departmentId);
|
||||
departmentComInfo.getAllChildDeptByDepId(lists,departmentId);
|
||||
String join = CollectionUtil.join(lists, ",");
|
||||
sql += " and id in ("+join+")";
|
||||
}
|
||||
|
||||
sql += " order by showorder,id asc";
|
||||
|
||||
//1.获取部门数据信息
|
||||
rs.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
caluResourceVos.add(CaluResourceVo.builder()
|
||||
.key(Util.getIntValue(rs.getString("id")))
|
||||
.superKey(Util.getIntValue(rs.getString("supdepid"),0))
|
||||
.departmentName(Util.null2String(rs.getString("departmentname")))
|
||||
.build());
|
||||
}
|
||||
|
||||
//2.人数统计计算
|
||||
String firstDayOfMonth = EmploymentUtil.firstDayOfMonth(date);
|
||||
String lastDayOfMonth = EmploymentUtil.lastDayOfMonth(date);
|
||||
//期初人数
|
||||
Map<Integer, Integer> startMap = EmploymentUtil.sumPerson(firstDayOfMonth, "0,1,2,3");
|
||||
//期末人数
|
||||
Map<Integer, Integer> endMap = EmploymentUtil.sumPerson(lastDayOfMonth, "0,1,2,3");
|
||||
//入职人数
|
||||
Map<Integer, Integer> entryMap = EmploymentUtil.rangePerson(firstDayOfMonth, lastDayOfMonth, "0");
|
||||
//转正人数
|
||||
Map<Integer, Integer> transferMap = EmploymentUtil.rangePerson(firstDayOfMonth, lastDayOfMonth, "1");
|
||||
//离职人数
|
||||
Map<Integer, Integer> leaveMap = EmploymentUtil.rangePerson(firstDayOfMonth, lastDayOfMonth, "4,5");
|
||||
//调动信息
|
||||
List<TransferParam> transferList = EmploymentUtil.transferPerson(firstDayOfMonth, lastDayOfMonth);
|
||||
|
||||
|
||||
|
||||
caluResourceVos.forEach(e-> {
|
||||
e.setStartNumber(startMap.getOrDefault(e.getKey(), 0));
|
||||
e.setEntryNumber(entryMap.getOrDefault(e.getKey(), 0));
|
||||
e.setTransferNumber(transferMap.getOrDefault(e.getKey(), 0));
|
||||
e.setLeaveNumber(leaveMap.getOrDefault(e.getKey(), 0));
|
||||
int oldCount = (int) transferList.stream()
|
||||
.filter(param -> param.getChangeOldDept() != null && param.getChangeOldDept().equals(e.getKey()))
|
||||
.count();
|
||||
int newCount = (int) transferList.stream()
|
||||
.filter(param -> param.getChangeNewDept() != null && param.getChangeNewDept().equals(e.getKey()))
|
||||
.count();
|
||||
e.setOnNumber(newCount);
|
||||
e.setOutNumber(oldCount);
|
||||
e.setEndNumber(endMap.getOrDefault(e.getKey(), 0));
|
||||
});
|
||||
|
||||
|
||||
resultMap.put("caluResourceVos",caluResourceVos);
|
||||
//3.构建上下级关系
|
||||
List<CaluResourceVo> topLevelResources = new ArrayList<>();
|
||||
|
||||
Map<Integer, CaluResourceVo> resourceMap = caluResourceVos.stream()
|
||||
.collect(Collectors.toMap(CaluResourceVo::getKey, Function.identity()));
|
||||
|
||||
caluResourceVos.forEach(resource -> {
|
||||
if (resource.getSuperKey() == 0 || String.valueOf(resource.getKey()).equals(departmentId)) {
|
||||
// 如果 superKey 为 0,说明是顶级元素 或者departmentId出现
|
||||
topLevelResources.add(resource);
|
||||
} else {
|
||||
CaluResourceVo parent = resourceMap.get(resource.getSuperKey());
|
||||
if (parent != null) {
|
||||
if (parent.getChildren() == null) {
|
||||
parent.setChildren( new ArrayList<>());
|
||||
}
|
||||
parent.getChildren().add(resource);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
resultMap.put("dataSource",topLevelResources);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook reportExport(Map<String, Object> params) {
|
||||
String sheetName = "管理幅度统计";
|
||||
Map<String, Object> map = caluResourece(params);
|
||||
List<CaluResourceVo> caluResourceVos =(List<CaluResourceVo>) map.get("caluResourceVos");
|
||||
List<Object> headerList = Arrays.asList("部门名称","期初人数","入职人数","转正人数","离职人数","调入人数","调出人数","期末人数");
|
||||
List<List<Object>> rows = new LinkedList<>();
|
||||
for (CaluResourceVo hr : caluResourceVos) {
|
||||
List<Object> row = new LinkedList<>();
|
||||
row.add(hr.getDepartmentName());
|
||||
row.add(hr.getStartNumber());
|
||||
row.add(hr.getEntryNumber());
|
||||
row.add(hr.getTransferNumber());
|
||||
row.add(hr.getLeaveNumber());
|
||||
row.add(hr.getOnNumber());
|
||||
row.add(hr.getOutNumber());
|
||||
row.add(hr.getEndNumber());
|
||||
rows.add(row);
|
||||
}
|
||||
List<List<Object>> excelSheetData = new ArrayList<>();
|
||||
excelSheetData.add(headerList);
|
||||
excelSheetData.addAll(rows);
|
||||
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> orgReport(Map<String, Object> params) {
|
||||
Map<String, Object> result = new HashMap<>(8);
|
||||
String selectedKey = Util.null2String(params.get("selectedKey"));
|
||||
switch (selectedKey) {
|
||||
case "0":
|
||||
result = timeOrganization(params);
|
||||
break;
|
||||
case "1":
|
||||
result = transOrganization(params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, Object> transOrganization(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
String type = Util.null2String(params.get("type"));
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
if ("0".equals(type)) {
|
||||
WeaverWeaTable<TransSubCompanyVo> table = new WeaverWeaTable<>(user, TransSubCompanyVo.class);
|
||||
String sqlWhere = buildtransOrgSql(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
result.putAll(table.makeDataResult());
|
||||
}else {
|
||||
WeaverWeaTable<TransDepartmentVo> table = new WeaverWeaTable<>(user, TransDepartmentVo.class);
|
||||
String sqlWhere = buildtransOrgSql(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
result.putAll(table.makeDataResult());
|
||||
}
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private String buildtransOrgSql(Map<String, Object> params) {
|
||||
String pointValue = Util.null2String(params.get("pointValue"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String endDate = Util.null2String(params.get("endDate"));
|
||||
String type = Util.null2String(params.get("type"));
|
||||
|
||||
String sql = getLeaveSql(pointValue,startDate,endDate);
|
||||
String sqlWhere = " where changeType = 1 and oType = "+type+sql;
|
||||
String statusValue = Util.null2String(params.get("statusValue"));
|
||||
if (StringUtils.isNotBlank(statusValue)) {
|
||||
sqlWhere += " and orgStatus in ("+statusValue+")";
|
||||
}
|
||||
String subCompanyId = Util.null2String(params.get("subCompanyId"));
|
||||
if (StringUtils.isNotBlank(subCompanyId)) {
|
||||
if("0".equals(type)) {
|
||||
sqlWhere += " and oId ="+subCompanyId;
|
||||
}else {
|
||||
sqlWhere += " and belongSub ="+subCompanyId;
|
||||
}
|
||||
}
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
if (StringUtils.isNotBlank(departmentId) && "1".equals(type)) {
|
||||
sqlWhere += " and oId ="+departmentId;
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
|
||||
}
|
||||
|
||||
private Map<String, Object> timeOrganization(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>(8);
|
||||
String type = Util.null2String(params.get("type"));
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
if ("0".equals(type)) {
|
||||
WeaverWeaTable<TimeSubCompanyVo> table = new WeaverWeaTable<>(user, TimeSubCompanyVo.class);
|
||||
String sqlWhere = buildtimeOrgSql(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
result.putAll(table.makeDataResult());
|
||||
}else {
|
||||
WeaverWeaTable<TimeDepartmentVo> table = new WeaverWeaTable<>(user, TimeDepartmentVo.class);
|
||||
String sqlWhere = buildtimeOrgSql(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
result.putAll(table.makeDataResult());
|
||||
}
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private String buildtimeOrgSql(Map<String, Object> params) {
|
||||
String pointValue = Util.null2String(params.get("pointValue"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String type = Util.null2String(params.get("type"));
|
||||
|
||||
String sql = getPointSql(pointValue,startDate);
|
||||
String sqlWhere = " where oType = "+type+" and "+sql;
|
||||
|
||||
String statusValue = Util.null2String(params.get("statusValue"));
|
||||
if (StringUtils.isNotBlank(statusValue)) {
|
||||
sqlWhere += " and orgStatus in ("+statusValue+")";
|
||||
}
|
||||
String subCompanyId = Util.null2String(params.get("subCompanyId"));
|
||||
if (StringUtils.isNotBlank(subCompanyId)) {
|
||||
if("0".equals(type)) {
|
||||
sqlWhere += " and oId ="+subCompanyId;
|
||||
}else {
|
||||
sqlWhere += " and belongSub ="+subCompanyId;
|
||||
}
|
||||
}
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
if (StringUtils.isNotBlank(departmentId) && "1".equals(type)) {
|
||||
sqlWhere += " and oId ="+departmentId;
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
private String buildtransferResoureceSql(Map<String, Object> params) {
|
||||
String pointValue = Util.null2String(params.get("pointValue"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String endDate = Util.null2String(params.get("endDate"));
|
||||
String sql = getLeaveSql(pointValue,startDate,endDate);
|
||||
String sqlWhere = " where 1=1 "+sql;
|
||||
String resourceId = Util.null2String(params.get("resourceId"));
|
||||
if (StringUtils.isNotBlank(resourceId)) {
|
||||
sqlWhere += " and userId ="+resourceId;
|
||||
}
|
||||
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
if (StringUtils.isNotBlank(departmentId)) {
|
||||
sqlWhere += " and departmentId ="+departmentId;
|
||||
}
|
||||
|
||||
String statusValue = Util.null2String(params.get("statusValue"));
|
||||
if (StringUtils.isNotBlank(statusValue)) {
|
||||
sqlWhere += " and employeeStatus in ("+statusValue+")";
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
private String buildLeaveResoureceSql(Map<String, Object> params) {
|
||||
String pointValue = Util.null2String(params.get("pointValue"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String endDate = Util.null2String(params.get("endDate"));
|
||||
String sql = getLeaveSql(pointValue,startDate,endDate);
|
||||
String sqlWhere = " where 1=1 "+sql;
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
if (StringUtils.isNotBlank(departmentId)) {
|
||||
sqlWhere += " and departmentId ="+departmentId;
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
private String getLeaveSql(String pointValue, String startDate, String endDate) {
|
||||
String sql = "";
|
||||
switch (pointValue){
|
||||
case "0":
|
||||
break;
|
||||
case "1":
|
||||
String today = DateUtil.getCurrentDate();
|
||||
sql += " and startDate = '"+today+"' and stopDate >= '"+today+"'";
|
||||
break;
|
||||
case "2":
|
||||
String firstDayOfWeek = DateUtil.getFirstDayOfWeek();
|
||||
String lastDayOfWeek = DateUtil.getLastDayOfWeek();
|
||||
sql += " and startDate >= '"+firstDayOfWeek+"' and startDate <= '"+lastDayOfWeek+"' and stopDate >= '"+lastDayOfWeek+"'";
|
||||
break;
|
||||
case "3":
|
||||
String firstDayOfMonth = DateUtil.getFirstDayOfMonthToString();
|
||||
String lastDayOfMonth = DateUtil.getLastDayOfMonthToString();
|
||||
sql += " and startDate >= '"+firstDayOfMonth+"' and startDate <= '"+lastDayOfMonth+"' and stopDate >= '"+lastDayOfMonth+"'";
|
||||
break;
|
||||
case "5":
|
||||
String firstDayOfYear = DateUtil.getFirstDayOfYear();
|
||||
String lastDayOfYear = DateUtil.getLastDayOfYear();
|
||||
sql += " and startDate >= '"+firstDayOfYear+"' and startDate <= '"+lastDayOfYear+"' and stopDate >= '"+lastDayOfYear+"'";
|
||||
break;
|
||||
case "7":
|
||||
String firstDayOfPreviousMonth = EmploymentUtil.firstDayOfPreviousMonth();
|
||||
String lastDayOfPreviousMonth = EmploymentUtil.lastDayOfPreviousMonth();
|
||||
sql += " and startDate >= '"+firstDayOfPreviousMonth+"' and startDate <= '"+lastDayOfPreviousMonth+"' and stopDate >= '"+lastDayOfPreviousMonth+"'";
|
||||
break;
|
||||
case "8":
|
||||
String firstDayOfPreviousYear = EmploymentUtil.firstDayOfPreviousYear();
|
||||
String lastDayOfPreviousYear = EmploymentUtil.lastDayOfPreviousYear();
|
||||
sql += " and startDate >= '"+firstDayOfPreviousYear+"' and startDate <= '"+lastDayOfPreviousYear+"' and stopDate >= '"+lastDayOfPreviousYear+"'";
|
||||
break;
|
||||
case "6":
|
||||
sql += " and startDate >= '"+startDate+"' and startDate <= '"+endDate+"' and stopDate >= '"+endDate+"'";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
private String buildtimeResoureceSql(Map<String, Object> params) {
|
||||
String pointValue = Util.null2String(params.get("pointValue"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
|
||||
String sql = getPointSql(pointValue,startDate);
|
||||
String sqlWhere = " where 1=1 and "+sql;
|
||||
|
||||
String statusValue = Util.null2String(params.get("statusValue"));
|
||||
if (StringUtils.isNotBlank(statusValue)) {
|
||||
sqlWhere += " and employeeStatus in ("+statusValue+")";
|
||||
}
|
||||
|
||||
String resourceId = Util.null2String(params.get("resourceId"));
|
||||
if (StringUtils.isNotBlank(resourceId)) {
|
||||
sqlWhere += " and userId ="+resourceId;
|
||||
}
|
||||
|
||||
String departmentId = Util.null2String(params.get("departmentId"));
|
||||
if (StringUtils.isNotBlank(departmentId)) {
|
||||
sqlWhere += " and departmentId ="+departmentId;
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
private String getPointSql(String pointValue, String startDate) {
|
||||
String sql = "";
|
||||
switch (pointValue){
|
||||
case "0":
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
sql += " startDate <= '"+currentDate+"' and stopDate >= '"+currentDate+"'";
|
||||
break;
|
||||
case "1":
|
||||
String yesterday = DateUtil.getYesterday();
|
||||
sql += " startDate <= '"+yesterday+"' and stopDate >= '"+yesterday+"'";
|
||||
break;
|
||||
case "2":
|
||||
String firstDayOfWeek = DateUtil.getFirstDayOfWeek();
|
||||
sql += " startDate <= '"+firstDayOfWeek+"' and stopDate >= '"+firstDayOfWeek+"'";
|
||||
break;
|
||||
case "3":
|
||||
String lastDayOfWeek = DateUtil.getLastDayOfWeek();
|
||||
sql += " startDate <= '"+lastDayOfWeek+"' and stopDate >= '"+lastDayOfWeek+"'";
|
||||
break;
|
||||
case "4":
|
||||
String firstDayOfMonth = DateUtil.getFirstDayOfMonthToString();
|
||||
sql += " startDate <= '"+firstDayOfMonth+"' and stopDate >= '"+firstDayOfMonth+"'";
|
||||
break;
|
||||
case "5":
|
||||
String lastDayOfMonth = DateUtil.getLastDayOfMonthToString();
|
||||
sql += " startDate <= '"+lastDayOfMonth+"' and stopDate >= '"+lastDayOfMonth+"'";
|
||||
break;
|
||||
case "7":
|
||||
String firstDayOfYear = DateUtil.getFirstDayOfYear();
|
||||
sql += " startDate <= '"+firstDayOfYear+"' and stopDate >= '"+firstDayOfYear+"'";
|
||||
break;
|
||||
case "8":
|
||||
String lastDayOfYear = DateUtil.getLastDayOfYear();
|
||||
sql += " startDate <= '"+lastDayOfYear+"' and stopDate >= '"+lastDayOfYear+"'";
|
||||
break;
|
||||
case "9":
|
||||
String firstDayOfPreviousMonth = EmploymentUtil.firstDayOfPreviousMonth();
|
||||
sql += " startDate <= '"+firstDayOfPreviousMonth+"' and stopDate >= '"+firstDayOfPreviousMonth+"'";
|
||||
break;
|
||||
case "10":
|
||||
String lastDayOfPreviousMonth = EmploymentUtil.lastDayOfPreviousMonth();
|
||||
sql += " startDate <= '"+lastDayOfPreviousMonth+"' and stopDate >= '"+lastDayOfPreviousMonth+"'";
|
||||
break;
|
||||
case "11":
|
||||
String firstDayOfPreviousYear = EmploymentUtil.firstDayOfPreviousYear();
|
||||
sql += " startDate <= '"+firstDayOfPreviousYear+"' and stopDate >= '"+firstDayOfPreviousYear+"'";
|
||||
break;
|
||||
case "12":
|
||||
String lastDayOfPreviousYear = EmploymentUtil.lastDayOfPreviousYear();
|
||||
sql += " startDate <= '"+lastDayOfPreviousYear+"' and stopDate >= '"+lastDayOfPreviousYear+"'";
|
||||
break;
|
||||
case "6":
|
||||
sql += " startDate <= '"+startDate+"' and stopDate >= '"+startDate+"'";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return sql;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.engine.jclproduct.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.jclproduct.entity.bo.EmploymentRecordBo;
|
||||
import com.engine.jclproduct.entity.po.*;
|
||||
import com.engine.jclproduct.service.EmploymentRecordService;
|
||||
import com.engine.jclproduct.utils.EmploymentUtil;
|
||||
import com.weaver.file.ConfigOperator;
|
||||
import com.weaver.general.BaseBean;
|
||||
import com.weaver.general.TimeUtil;
|
||||
import com.weaver.general.Util;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:23 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmploymentRecordServiceImpl extends Service implements EmploymentRecordService {
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> initPerson() {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//1.任职记录表初始化数据 只执行一次
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select count(1) as num from uf_EmploymentRecord");
|
||||
rs.next();
|
||||
int num = Util.getIntValue(rs.getString("num"));
|
||||
if (num > 0) {
|
||||
map.put("msg","员工任职记录表已经初始化,不可重复执行");
|
||||
return map;
|
||||
}
|
||||
|
||||
//2.获取当前人员表人员信息
|
||||
List<HrmresourcePo> hrmresourcePoList = EmploymentUtil.getHrmResources();
|
||||
|
||||
hrmresourcePoList.forEach(e-> rs.executeUpdate("insert into uf_hrmresource_day(userId,workcode,companystartdate,companyworkyear," +
|
||||
" birthday,jobtitle,departmentid,subcompanyid,managerid,status,sex) values(?,?,?,?,?,?,?,?,?,?,?)",e.getUserId(),e.getWorkcode(),
|
||||
e.getCompanyStartDate(),e.getCompanyWorkyear(),e.getBirthday(),e.getJobTitle(),e.getDepartmentId(),e.getSubcompanyId(),e.getManagerId(),e.getStatus(),e.getSex()));
|
||||
|
||||
map.put("msg1","人力资源中间表初始化完成,当前共"+hrmresourcePoList.size()+"条数据");
|
||||
|
||||
List<EmploymentRecordPo> employmentPos = EmploymentRecordBo.buildEmploymentRecordPo(hrmresourcePoList);
|
||||
BaseBean bb = new BaseBean();
|
||||
String formModeId = bb.getPropValue("jclproduct", "eModeId");
|
||||
|
||||
String modeDataCreateDate = DateUtil.getCurrentDate();
|
||||
String modeDataCreateTime = TimeUtil.getOnlyCurrentTimeString();
|
||||
ConfigOperator configOperator = new ConfigOperator();
|
||||
configOperator.setProp("jclproduct.properties", "startDate", modeDataCreateDate);
|
||||
|
||||
employmentPos.forEach(e-> rs.executeUpdate("insert into uf_EmploymentRecord(userId,workcode,employeeStatus,changType,startDate,stopDate," +
|
||||
" departmentId,subCompanyId,superior,position,companyStartDate,workyear,entryDateYear,entryDateMonth,entryDateDay," +
|
||||
" sex,birthday,formmodeid,modeDataCreateDate,modeDataCreateTime,modeDataCreater) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
e.getUserId(),e.getWorkcode(),e.getEmployeeStatus(),e.getChangType(),e.getStartDate(),e.getStopDate(),e.getDepartmentId(),
|
||||
e.getSubCompanyId(),e.getSuperior(),e.getPosition(),e.getCompanyStartDate(),e.getWorkyear(),e.getEntryDateYear(),e.getEntryDateMonth(),
|
||||
e.getEntryDateDay(),e.getSex(),e.getBirthday(),formModeId,modeDataCreateDate,modeDataCreateTime,1));
|
||||
|
||||
map.put("msg2","员工任职记录表初始化完成,人力资源表共"+employmentPos.size()+"条数据");
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> initOrganization() {
|
||||
Map<String, Object> map = new HashMap<>(8);
|
||||
//1.任职记录表初始化数据 只执行一次
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select count(1) as num from uf_orgChange");
|
||||
rs.next();
|
||||
int num = Util.getIntValue(rs.getString("num"));
|
||||
if (num > 0) {
|
||||
map.put("msg","组织变更记录表已经初始化,不可重复执行");
|
||||
return map;
|
||||
}
|
||||
|
||||
//1.人力资源分部中间表
|
||||
List<SubCompanyPo> subCompany = EmploymentUtil.getSubCompany();
|
||||
subCompany.forEach(e -> rs.executeUpdate("insert into uf_hrmsubcompany(subcompanyId,subcompanyName,companyId,supsubcomId,showorder,canceled,subcompanyCode) values(?,?,?,?,?,?,?)",e.getSubcompanyId(),
|
||||
e.getSubcompanyName(),e.getCompanyId(),e.getSupsubcomId(),e.getShoworder(),e.getCanceled(),e.getSubcompanyCode()));
|
||||
map.put("msg1","人力资源分部中间表初始化完成,共"+subCompany.size()+"条数据");
|
||||
|
||||
//2.人力资源部门中间表
|
||||
List<DepartmentPo> department = EmploymentUtil.getDepartment();
|
||||
department.forEach(e -> rs.executeUpdate("insert into uf_hrmdepartment(departmentId,departmentmark,subcompanyId,supdepId,showorder,canceled,departmentCode,bmfzr) values(?,?,?,?,?,?,?,?)",e.getDepartmentId(),
|
||||
e.getDepartmentmark(),e.getSubcompanyId(),e.getSupdepId(),e.getShoworder(),e.getCanceled(),e.getDepartmentCode(),e.getBmfzr()));
|
||||
|
||||
map.put("msg2","人力资源部门中间表初始化完成,共"+department.size()+"条数据");
|
||||
|
||||
//3.组织变更记录表
|
||||
List<OrganizationRecordPo> organizationRecordPos = EmploymentRecordBo.buildOrganizationRecordPo(subCompany, department);
|
||||
organizationRecordPos.forEach(e -> rs.executeUpdate("insert into uf_orgChange(orgStatus,startDate,stopDate,oId,oType,oName,oParentId,oChargeId,changeType,showorder,organizationCode,belongSub) values(?,?,?,?,?,?,?,?,?,?,?,?)",e.getOrgStatus(),
|
||||
e.getStartDate(),e.getStopDate(),e.getOId(),e.getOType(),e.getOName(),e.getOParentId(),e.getOChargeId(),e.getChangeType(),e.getShoworder(),e.getOrganizationCode(),e.getBelongSub()));
|
||||
|
||||
|
||||
map.put("msg3","组织变更记录表初始化完成,共"+organizationRecordPos.size()+"条数据");
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.engine.jclproduct.transmethod;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 2:34 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmReportTransMethod {
|
||||
|
||||
public static String subCompanyName(String id) {
|
||||
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
return subCompanyComInfo.getSubCompanyname(id);
|
||||
}
|
||||
|
||||
public static String departmentName(String id) {
|
||||
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
||||
try {
|
||||
return departmentComInfo.getDepartmentName(id);
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static String jobTitleName(String id) {
|
||||
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
||||
return jobTitlesComInfo.getJobTitlesname(id);
|
||||
}
|
||||
|
||||
public static String resourceName(String id) {
|
||||
try {
|
||||
List<String> ids = Arrays.stream(id.split(","))
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
||||
List<String> names = ids.stream()
|
||||
.map(resourceComInfo::getLastname)
|
||||
.collect(Collectors.toList());
|
||||
return CollectionUtil.join(names,",");
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static String sexName(String id) {
|
||||
return "1".equals(id) ? "女":"男";
|
||||
}
|
||||
|
||||
public static String statusName(String id) {
|
||||
String name = "";
|
||||
switch (id){
|
||||
case "0":
|
||||
name = "试用";
|
||||
break;
|
||||
case "1":
|
||||
name = "正式";
|
||||
break;
|
||||
case "2":
|
||||
name = "临时";
|
||||
break;
|
||||
case "3":
|
||||
name = "试用延期";
|
||||
break;
|
||||
case "4":
|
||||
name = "解聘";
|
||||
break;
|
||||
case "5":
|
||||
name = "离职";
|
||||
break;
|
||||
case "6":
|
||||
name = "退休";
|
||||
break;
|
||||
case "7":
|
||||
name = "无效";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public static String sexOrgStatus(String id) {
|
||||
return "1".equals(id) ? "封存":"启用";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,305 @@
|
|||
package com.engine.jclproduct.utils;
|
||||
|
||||
import com.engine.jclproduct.entity.param.TransferParam;
|
||||
import com.engine.jclproduct.entity.po.DepartmentPo;
|
||||
import com.engine.jclproduct.entity.po.EmploymentRecordPo;
|
||||
import com.engine.jclproduct.entity.po.HrmresourcePo;
|
||||
import com.engine.jclproduct.entity.po.SubCompanyPo;
|
||||
import com.weaver.general.Util;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Year;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/23 10:14 AM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmploymentUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 变动类型
|
||||
* @return
|
||||
*/
|
||||
public static Integer getChangeType(Integer status){
|
||||
|
||||
Integer changeType = null;
|
||||
|
||||
switch (status){
|
||||
case 0: case 2: case 3:
|
||||
changeType = 0;
|
||||
break;
|
||||
case 1:
|
||||
changeType = 1;
|
||||
break;
|
||||
case 4: case 5: case 6: case 7:
|
||||
changeType = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return changeType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 年月日
|
||||
* @param companysDate
|
||||
* @return
|
||||
*/
|
||||
public static Map<String,Integer> dateSplitExample(String companysDate){
|
||||
|
||||
if ("".equals(companysDate)) {
|
||||
companysDate = DateUtil.getCurrentDate();
|
||||
}
|
||||
LocalDate date = LocalDate.parse(companysDate);
|
||||
return new HashMap<String,Integer>(4){
|
||||
{
|
||||
put("year",date.getYear());
|
||||
put("month",date.getMonthValue());
|
||||
put("day",date.getDayOfMonth());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前人员表人员信息
|
||||
* @return
|
||||
*/
|
||||
public static List<HrmresourcePo> getHrmResources(){
|
||||
List<HrmresourcePo> hrmresourcePoList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,workcode,status,companystartdate,companyworkyear,sex,birthday,jobtitle,departmentid,subcompanyid1,managerid from hrmresource order by id asc");
|
||||
while (rs.next()) {
|
||||
hrmresourcePoList.add(HrmresourcePo.builder()
|
||||
.userId(Util.getIntValue(rs.getString("id")))
|
||||
.workcode(Util.null2String(rs.getString("workcode")))
|
||||
.status(Util.getIntValue(rs.getString("status")))
|
||||
.companyStartDate(Util.null2String(rs.getString("companystartdate")))
|
||||
.companyWorkyear("".equals(Util.null2String(rs.getString("companyworkyear"))) ? "0.00" : Util.null2String(rs.getString("companyworkyear")))
|
||||
.sex(Util.getIntValue(rs.getString("sex")))
|
||||
.birthday(Util.null2String(rs.getString("birthday")))
|
||||
.jobTitle(Util.getIntValue(rs.getString("jobtitle")))
|
||||
.departmentId(Util.getIntValue(rs.getString("departmentid")))
|
||||
.subcompanyId(Util.getIntValue(rs.getString("subcompanyid1")))
|
||||
.managerId(Util.getIntValue(rs.getString("managerid")))
|
||||
.build());
|
||||
}
|
||||
|
||||
return hrmresourcePoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前分部表信息
|
||||
* @return
|
||||
*/
|
||||
public static List<SubCompanyPo> getSubCompany() {
|
||||
List<SubCompanyPo> subCompanyPoList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,subcompanyname,companyid,supsubcomid,showorder,canceled,subcompanycode from hrmsubcompany order by showorder asc");
|
||||
while (rs.next()) {
|
||||
subCompanyPoList.add(SubCompanyPo.builder()
|
||||
.subcompanyId(Util.getIntValue(rs.getString("id")))
|
||||
.subcompanyName(Util.null2String(rs.getString("subcompanyname")))
|
||||
.companyId(Util.getIntValue(rs.getString("companyid")))
|
||||
.supsubcomId(Util.getIntValue(rs.getString("supsubcomid")))
|
||||
.showorder(Util.getFloatValue(rs.getString("showorder")))
|
||||
.canceled(Util.getIntValue(rs.getString("canceled")))
|
||||
.subcompanyCode(Util.null2String(rs.getString("subcompanycode")))
|
||||
.build());
|
||||
}
|
||||
return subCompanyPoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当前部门表信息
|
||||
* @return
|
||||
*/
|
||||
public static List<DepartmentPo> getDepartment() {
|
||||
List<DepartmentPo> departmentPoList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select a.id,departmentmark,subcompanyid1,supdepid,showorder,canceled,departmentcode,b.bmfzr from hrmdepartment a\n" +
|
||||
" left join hrmdepartmentdefined b on a.id = b.deptid order by showorder asc");
|
||||
while (rs.next()) {
|
||||
departmentPoList.add(DepartmentPo.builder()
|
||||
.departmentId(Util.getIntValue(rs.getString("id")))
|
||||
.departmentmark(Util.null2String(rs.getString("departmentmark")))
|
||||
.subcompanyId(Util.getIntValue(rs.getString("subcompanyid1")))
|
||||
.supdepId(Util.getIntValue(rs.getString("supdepid")))
|
||||
.showorder(Util.getFloatValue(rs.getString("showorder")))
|
||||
.canceled(Util.getIntValue(rs.getString("canceled")))
|
||||
.departmentCode(Util.null2String(rs.getString("departmentcode")))
|
||||
.bmfzr(Util.null2String(rs.getString("bmfzr")))
|
||||
.build());
|
||||
}
|
||||
return departmentPoList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 任职记录 各种状态下 相关变动日期记录
|
||||
* @param recordPo
|
||||
*/
|
||||
public static void dutyStatusDate(EmploymentRecordPo recordPo) {
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
switch (recordPo.getEmployeeStatus()){
|
||||
case 0:
|
||||
recordPo.setProbationStartDate(currentDate);
|
||||
break;
|
||||
case 1:
|
||||
recordPo.setRegularizationDate(currentDate);
|
||||
break;
|
||||
case 4: case 5:
|
||||
recordPo.setLastWorkDate(currentDate);
|
||||
break;
|
||||
case 7:
|
||||
recordPo.setExpectedLastWorkDate(currentDate);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期字符串 与当前日期比较
|
||||
* @param dateStr1
|
||||
* @return
|
||||
*/
|
||||
public static boolean compareDate(String dateStr1){
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
boolean result = false;
|
||||
try {
|
||||
LocalDate inputDate = LocalDate.parse(dateStr1, formatter);
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
// 判断当前日期是否大于传入的日期
|
||||
if (today.isAfter(inputDate)) {
|
||||
result = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static String firstDayOfPreviousMonth() {
|
||||
LocalDate now = LocalDate.now();
|
||||
YearMonth previousMonth = YearMonth.from(now).minusMonths(1);
|
||||
LocalDate firstDayOfPreviousMonth = previousMonth.atDay(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return firstDayOfPreviousMonth.format(formatter);
|
||||
}
|
||||
|
||||
|
||||
public static String lastDayOfPreviousMonth() {
|
||||
LocalDate now = LocalDate.now();
|
||||
YearMonth previousMonth = YearMonth.from(now).minusMonths(1);
|
||||
LocalDate lastDayOfPreviousMonth = previousMonth.atEndOfMonth();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return lastDayOfPreviousMonth.format(formatter);
|
||||
}
|
||||
|
||||
|
||||
public static String firstDayOfPreviousYear() {
|
||||
LocalDate now = LocalDate.now();
|
||||
Year previousYear = Year.from(now).minusYears(1);
|
||||
LocalDate firstDayOfPreviousYear = previousYear.atDay(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return firstDayOfPreviousYear.format(formatter);
|
||||
}
|
||||
|
||||
public static String lastDayOfPreviousYear() {
|
||||
LocalDate now = LocalDate.now();
|
||||
Year previousYear = Year.from(now).minusYears(1);
|
||||
LocalDate lastDayOfPreviousYear = previousYear.atMonth(12).atEndOfMonth();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return lastDayOfPreviousYear.format(formatter);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String firstDayOfMonth(String yearMonthStr) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
YearMonth yearMonth = YearMonth.parse(yearMonthStr, formatter);
|
||||
LocalDate firstDayOfMonth = yearMonth.atDay(1);
|
||||
return firstDayOfMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String lastDayOfMonth(String yearMonthStr) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
YearMonth yearMonth = YearMonth.parse(yearMonthStr, formatter);
|
||||
LocalDate lastDayOfMonth = yearMonth.atEndOfMonth();
|
||||
return lastDayOfMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Map<Integer,Integer> sumPerson(String date,String employeeStatus) {
|
||||
Map<Integer,Integer> map = new HashMap<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select count(1) as nums,departmentid" +
|
||||
" from uf_EmploymentRecord where employeeStatus in ("+employeeStatus+") " +
|
||||
" and startDate <= '"+date+"' and stopDate >= '"+date+"'" +
|
||||
" group by departmentid");
|
||||
while (rs.next()) {
|
||||
int departmentid = Util.getIntValue(rs.getString("departmentid"));
|
||||
int nums = Util.getIntValue(rs.getString("nums"));
|
||||
map.put(departmentid,nums);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public static Map<Integer,Integer> rangePerson(String startDate,String endDate,String employeeStatus) {
|
||||
Map<Integer,Integer> map = new HashMap<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select count(1) as nums,departmentid" +
|
||||
" from uf_EmploymentRecord where employeeStatus in ("+employeeStatus+") and changtype != 2" +
|
||||
" and startDate >= '"+startDate+"' and startDate <= '"+endDate+"' and stopDate >= '"+endDate+"'" +
|
||||
" group by departmentid");
|
||||
while (rs.next()) {
|
||||
int departmentid = Util.getIntValue(rs.getString("departmentid"));
|
||||
int nums = Util.getIntValue(rs.getString("nums"));
|
||||
map.put(departmentid,nums);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public static List<TransferParam> transferPerson(String startDate,String endDate) {
|
||||
List<TransferParam> paramList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select changeOldDept,changeNewDept " +
|
||||
" from uf_EmploymentRecord where changtype = 2 " +
|
||||
" and startDate >= '"+startDate+"' and startDate <= '"+endDate+"' and stopDate >= '"+endDate+"'");
|
||||
while (rs.next()) {
|
||||
int changeOldDept = Util.getIntValue(rs.getString("changeOldDept"));
|
||||
int changeNewDept = Util.getIntValue(rs.getString("changeNewDept"));
|
||||
paramList.add(TransferParam.builder().changeNewDept(changeNewDept).changeOldDept(changeOldDept).build());
|
||||
}
|
||||
return paramList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.engine.jclproduct.utils;
|
||||
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import java.util.List;
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/1 4:56 PM
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ExcelUtil {
|
||||
|
||||
public static XSSFWorkbook genWorkbookV2(List<List<Object>> rowList, String sheetName) {
|
||||
XSSFWorkbook workbook = new XSSFWorkbook();
|
||||
|
||||
// 设置title样式
|
||||
XSSFCellStyle titleCellStyle = workbook.createCellStyle();
|
||||
XSSFFont titleFont = workbook.createFont();
|
||||
titleFont.setFontName("仿宋");
|
||||
titleFont.setFontHeightInPoints((short) 15);
|
||||
titleCellStyle.setFont(titleFont);
|
||||
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
titleCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());//背景色
|
||||
titleCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
|
||||
// 设置主体样式
|
||||
XSSFCellStyle cellStyle = workbook.createCellStyle();
|
||||
XSSFFont font = workbook.createFont();
|
||||
font.setFontName("宋体");
|
||||
font.setFontHeightInPoints((short) 10);// 设置字体大小
|
||||
cellStyle.setFont(font);// 选择需要用到的字体格式
|
||||
cellStyle.setWrapText(true);
|
||||
|
||||
XSSFSheet sheet = workbook.createSheet(sheetName);
|
||||
//自适应宽度
|
||||
sheet.autoSizeColumn(0, true);
|
||||
//默认列宽
|
||||
sheet.setDefaultColumnWidth(25);
|
||||
//默认行高
|
||||
sheet.setDefaultRowHeightInPoints(18);
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
List<Object> infoList = rowList.get(rowIndex);
|
||||
XSSFRow row = sheet.createRow(rowIndex);
|
||||
for (int cellIndex = 0; cellIndex < infoList.size(); cellIndex++) {
|
||||
XSSFCell cell = row.createCell(cellIndex);
|
||||
if (rowIndex == 0) {
|
||||
cell.setCellStyle(titleCellStyle);
|
||||
} else {
|
||||
cell.setCellStyle(cellStyle);
|
||||
}
|
||||
Object o = infoList.get(cellIndex);
|
||||
if (o instanceof String) {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
} else if (o instanceof Boolean) {
|
||||
cell.setCellType(CellType.BOOLEAN);
|
||||
cell.setCellValue(String.valueOf(o));
|
||||
} else {
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(o == null ? "" : o.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.engine.jclproduct.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.jclproduct.service.EmployeeRecordReportService;
|
||||
import com.engine.jclproduct.service.impl.EmployeeRecordReportServiceImpl;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
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.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/25 11:08 AM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmployeeRecordReportAction {
|
||||
|
||||
private EmployeeRecordReportService getService(User user) {
|
||||
return ServiceUtil.getService(EmployeeRecordReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/record/employee")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String commonReport(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("datas",getService(user).commonReport(ParamUtil.request2Map(request)));
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/employee/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response reportExport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).reportExport(ParamUtil.request2Map(request));
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "报表导出" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/record/organization")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String orgReport(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("datas",getService(user).orgReport(ParamUtil.request2Map(request)));
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.engine.jclproduct.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.jclproduct.service.EmploymentRecordService;
|
||||
import com.engine.jclproduct.service.impl.EmploymentRecordServiceImpl;
|
||||
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.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:22 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class EmploymentRecordAction {
|
||||
|
||||
private EmploymentRecordService getService(User user) {
|
||||
return ServiceUtil.getService(EmploymentRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/initPerson")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String initPerson(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("datas",getService(user).initPerson());
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/initOrganization")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String initOrganization(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> data = new HashMap<>(8);
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
data.put("datas",getService(user).initOrganization());
|
||||
data.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
data.put("api_status", false);
|
||||
data.put("msg", "catch exception : " + e.getMessage());
|
||||
}
|
||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package weaver.interfaces.jclproduct;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.jclproduct.entity.bo.EmploymentRecordBo;
|
||||
import com.engine.jclproduct.entity.po.DataDutyPo;
|
||||
import com.engine.jclproduct.entity.po.EmploymentRecordPo;
|
||||
import com.engine.jclproduct.entity.po.HrmresourcePo;
|
||||
import com.engine.jclproduct.utils.EmploymentUtil;
|
||||
import com.weaver.file.ConfigOperator;
|
||||
import com.weaver.general.BaseBean;
|
||||
import com.weaver.general.TimeUtil;
|
||||
import com.weaver.general.Util;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/22 4:24 PM
|
||||
* @Description: 人员入转调离 任职变化 记录任务
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public class EmploymentRecordCrob extends BaseCronJob {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
//1.获取当前人员信息数据
|
||||
List<HrmresourcePo> hrmresourcePoList = EmploymentUtil.getHrmResources();
|
||||
|
||||
//人员信息表更新集合
|
||||
List<HrmresourcePo> hrmresourceUpdate = new ArrayList<>();
|
||||
|
||||
//人员信息表新增集合
|
||||
List<HrmresourcePo> hrmresourceInsert = new ArrayList<>();
|
||||
|
||||
//任职记录表新增集合
|
||||
List<EmploymentRecordPo> employmentRecordInsert = new ArrayList<>();
|
||||
|
||||
BaseBean bb = new BaseBean();
|
||||
String formModeId = bb.getPropValue("jclproduct", "eModeId");
|
||||
|
||||
String modeDataCreateDate = DateUtil.getCurrentDate();
|
||||
String modeDataCreateTime = TimeUtil.getOnlyCurrentTimeString();
|
||||
ConfigOperator configOperator = new ConfigOperator();
|
||||
configOperator.setProp("jclproduct.properties", "startDate", modeDataCreateDate);
|
||||
|
||||
//2.与人力资源中间表对比每一条人员数据 todo 数据量大的情况下线程处理
|
||||
hrmresourcePoList.forEach(hrmresource->{
|
||||
|
||||
//1.入转调离 人员数据变化处理
|
||||
DataDutyPo dataDutyPo = dutyDatasChange(hrmresource);
|
||||
if (dataDutyPo.getHrmresourceUpdate() != null) {
|
||||
hrmresourceUpdate.add(dataDutyPo.getHrmresourceUpdate());
|
||||
}
|
||||
if (dataDutyPo.getHrmresourceInsert() != null) {
|
||||
hrmresourceInsert.add(dataDutyPo.getHrmresourceInsert());
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(dataDutyPo.getEmploymentRecordInsert())) {
|
||||
employmentRecordInsert.addAll(dataDutyPo.getEmploymentRecordInsert());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
bb.writeLog("hrmresourceUpdate:"+hrmresourceUpdate.size());
|
||||
bb.writeLog("hrmresourceInsert:"+hrmresourceInsert.size());
|
||||
bb.writeLog("employmentRecordInsert:"+employmentRecordInsert.size());
|
||||
//3.人员信息中间表
|
||||
//更新
|
||||
hrmresourceUpdate.forEach(e -> rs.executeUpdate("update uf_hrmresource_day set status=?,companystartdate=?,companyworkyear=?," +
|
||||
" sex=?,birthday=?,jobtitle=?,departmentid=?,subcompanyid=?,managerid=? where userid=?",e.getStatus(),e.getCompanyStartDate(),
|
||||
e.getCompanyWorkyear(),e.getSex(),e.getBirthday(),e.getJobTitle(),e.getDepartmentId(),e.getSubcompanyId(),e.getManagerId(),e.getUserId()));
|
||||
|
||||
//插入
|
||||
hrmresourceInsert.forEach(e-> rs.executeUpdate("insert into uf_hrmresource_day(userId,workcode,companystartdate,companyworkyear," +
|
||||
" birthday,jobtitle,departmentid,subcompanyid,managerid,status,sex) values(?,?,?,?,?,?,?,?,?,?,?)",e.getUserId(),e.getWorkcode(),
|
||||
e.getCompanyStartDate(),e.getCompanyWorkyear(),e.getBirthday(),e.getJobTitle(),e.getDepartmentId(),e.getSubcompanyId(),e.getManagerId(),e.getStatus(),e.getSex()));
|
||||
|
||||
|
||||
//4.人员任职记录表
|
||||
employmentRecordInsert.forEach(e->{
|
||||
|
||||
//1.更新上一条数据stopDate
|
||||
List<EmploymentRecordPo> list = new ArrayList<>();
|
||||
rs.executeQuery("select id,startDate from uf_EmploymentRecord where userid = ?",e.getUserId());
|
||||
while (rs.next()) {
|
||||
list.add(EmploymentRecordPo.builder().id(Util.getIntValue(rs.getString("id"))).startDate(Util.null2String(rs.getString("startDate"))).build());
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
String date = DateUtil.getCurrentDate();
|
||||
EmploymentRecordPo latest = list.stream()
|
||||
.max(Comparator.comparing(EmploymentRecordPo::getId))
|
||||
.orElse(null);
|
||||
assert latest != null;
|
||||
if (EmploymentUtil.compareDate(latest.getStartDate())) {
|
||||
date = DateUtil.getYesterday();
|
||||
}
|
||||
|
||||
rs.executeUpdate("update uf_EmploymentRecord set stopDate = ? where id = ?",date,latest.getId());
|
||||
}
|
||||
|
||||
|
||||
//2.新增数据
|
||||
rs.executeUpdate("insert into uf_EmploymentRecord(userId,workcode,employeeStatus,changType,startDate,stopDate," +
|
||||
" departmentId,subCompanyId,superior,position,changeOldSuperior,changeNewSuperior,changeOldJob,changeNewJob,changeOldDept,changeNewDept," +
|
||||
" companyStartDate,workyear,entryDateYear,entryDateMonth,entryDateDay,expectedLastWorkDate,lastWorkDate,probationActualStopDate,regularizationDate," +
|
||||
" sex,birthday,formmodeid,modeDataCreateDate,modeDataCreateTime,modeDataCreater) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
e.getUserId(),e.getWorkcode(),e.getEmployeeStatus(),e.getChangType(),e.getStartDate(),e.getStopDate(),e.getDepartmentId(),
|
||||
e.getSubCompanyId(),e.getSuperior(),e.getPosition(),e.getChangeOldSuperior(),e.getChangeNewSuperior(),
|
||||
e.getChangeOldJob(),e.getChangeNewJob(),e.getChangeOldDept(),e.getChangeNewDept(),e.getCompanyStartDate(),
|
||||
e.getWorkyear(),e.getEntryDateYear(),e.getEntryDateMonth(),e.getEntryDateDay(), e.getExpectedLastWorkDate(),
|
||||
e.getLastWorkDate(),e.getProbationActualStopDate(),e.getRegularizationDate(),e.getSex(),e.getBirthday(),formModeId,modeDataCreateDate,modeDataCreateTime,1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 入转调离 人员数据变化处理
|
||||
* @param hrmresource
|
||||
*/
|
||||
private DataDutyPo dutyDatasChange(HrmresourcePo hrmresource){
|
||||
DataDutyPo dataDutyPo = new DataDutyPo();
|
||||
RecordSet rs = new RecordSet();
|
||||
//2.1 根据userid获取上一次人员中间表数据作对比
|
||||
rs.executeQuery("select id,userid,workcode,status,companystartdate,companyworkyear,sex,birthday," +
|
||||
" jobtitle,departmentid,subcompanyid,managerid from uf_hrmresource_day where userid = ?",hrmresource.getUserId());
|
||||
|
||||
if (rs.next()) {
|
||||
//3.数据存在作比较
|
||||
HrmresourcePo lastResource = HrmresourcePo.builder()
|
||||
.id(Util.getIntValue(rs.getString("id")))
|
||||
.status(Util.getIntValue(rs.getString("status")))
|
||||
.companyWorkyear(Util.null2String(rs.getString("companyworkyear")))
|
||||
.subcompanyId(Util.getIntValue(rs.getString("subcompanyid")))
|
||||
.departmentId(Util.getIntValue(rs.getString("departmentid")))
|
||||
.jobTitle(Util.getIntValue(rs.getString("jobtitle")))
|
||||
.managerId(Util.getIntValue(rs.getString("managerid")))
|
||||
.build();
|
||||
|
||||
//3.0 数据一致不做处理
|
||||
//3.11 人员状态比较
|
||||
List<EmploymentRecordPo> employmentRecords = new ArrayList<>();
|
||||
if (!hrmresource.getStatus().equals(lastResource.getStatus())) {
|
||||
//状态变更
|
||||
EmploymentRecordPo employmentRecord = EmploymentRecordBo.setEmploymentRecordPo(hrmresource);
|
||||
//记录各种状态下日期
|
||||
EmploymentUtil.dutyStatusDate(employmentRecord);
|
||||
employmentRecords.add(employmentRecord);
|
||||
|
||||
}
|
||||
|
||||
//3.12 调动状态比较(分别是 部门 岗位 人员上级 任一个条件发生变化 都记录为调动)
|
||||
if (!hrmresource.getDepartmentId().equals(lastResource.getDepartmentId())
|
||||
|| !hrmresource.getJobTitle().equals(lastResource.getJobTitle())
|
||||
|| !hrmresource.getManagerId().equals(lastResource.getManagerId())){
|
||||
|
||||
EmploymentRecordPo employmentRecord = EmploymentRecordBo.setEmploymentRecordPo(hrmresource);
|
||||
// 记录调动下新旧组织数据留痕
|
||||
employmentRecord.setChangeOldDept(lastResource.getDepartmentId());
|
||||
employmentRecord.setChangeOldJob(lastResource.getJobTitle());
|
||||
employmentRecord.setChangeOldSuperior(lastResource.getManagerId());
|
||||
|
||||
employmentRecord.setChangeNewDept(hrmresource.getDepartmentId());
|
||||
employmentRecord.setChangeNewJob(hrmresource.getJobTitle());
|
||||
employmentRecord.setChangeNewSuperior(hrmresource.getManagerId());
|
||||
|
||||
//调动
|
||||
employmentRecord.setChangType(2);
|
||||
employmentRecords.add(employmentRecord);
|
||||
}
|
||||
|
||||
|
||||
if (!hrmresource.getStatus().equals(lastResource.getStatus())
|
||||
|| !hrmresource.getDepartmentId().equals(lastResource.getDepartmentId())
|
||||
|| !hrmresource.getJobTitle().equals(lastResource.getJobTitle())
|
||||
|| !hrmresource.getManagerId().equals(lastResource.getManagerId())) {
|
||||
//3.1 数据不一致,人员中间表更新
|
||||
hrmresource.setId(lastResource.getId());
|
||||
dataDutyPo.setHrmresourceUpdate(hrmresource);
|
||||
//3.2 数据不一致,任职记录表新增
|
||||
dataDutyPo.setEmploymentRecordInsert(employmentRecords);
|
||||
}
|
||||
|
||||
}else {
|
||||
//4.数据不存在作新增
|
||||
//4.1 人员中间表新增
|
||||
dataDutyPo.setHrmresourceInsert(hrmresource);
|
||||
//4.2 任职记录表新增
|
||||
List<EmploymentRecordPo> recordList = Collections.singletonList(EmploymentRecordBo.setEmploymentRecordPo(hrmresource));
|
||||
dataDutyPo.setEmploymentRecordInsert(recordList);
|
||||
}
|
||||
|
||||
return dataDutyPo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
package weaver.interfaces.jclproduct;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.jclproduct.entity.bo.EmploymentRecordBo;
|
||||
import com.engine.jclproduct.entity.po.DepartmentPo;
|
||||
import com.engine.jclproduct.entity.po.OrganizationRecordPo;
|
||||
import com.engine.jclproduct.entity.po.SubCompanyPo;
|
||||
import com.engine.jclproduct.utils.EmploymentUtil;
|
||||
import com.weaver.general.Util;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/11/11 10:25 AM
|
||||
* @Description: 组织启用 封存 变动记录(上级变动 名称变动 负责人变动)
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class OrganizationRecordCrob extends BaseCronJob {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
//1.获取当前分部信息数据
|
||||
List<SubCompanyPo> subCompany = EmploymentUtil.getSubCompany();
|
||||
|
||||
//2.获取当前部门信息数据
|
||||
List<DepartmentPo> department = EmploymentUtil.getDepartment();
|
||||
|
||||
//3.分部中间表更新集合
|
||||
List<SubCompanyPo> subCompanyUpdate = new ArrayList<>();
|
||||
|
||||
//4.分部中间表新增集合
|
||||
List<SubCompanyPo> subCompanyInsert = new ArrayList<>();
|
||||
|
||||
//5.部门中间表更新集合
|
||||
List<DepartmentPo> departmentUpdate = new ArrayList<>();
|
||||
|
||||
//6.部门中间表新增集合
|
||||
List<DepartmentPo> departmentInsert = new ArrayList<>();
|
||||
|
||||
//7.组织变动表新增集合
|
||||
List<OrganizationRecordPo> organizationRecordInsert = new ArrayList<>();
|
||||
|
||||
|
||||
//8.分部数据对比
|
||||
subCompany.forEach(e -> dutySubChange(e,subCompanyUpdate,subCompanyInsert,organizationRecordInsert));
|
||||
|
||||
//9.部门数据对比
|
||||
department.forEach(e-> dutyDeptChange(e,departmentUpdate,departmentInsert,organizationRecordInsert));
|
||||
|
||||
//10.数据更新(todo 是否考虑事务一致性)
|
||||
subCompanyUpdate.forEach(e-> rs.executeUpdate("update uf_hrmsubcompany set subcompanyName=?,supsubcomId=?,showorder=?,canceled=?,subcompanyCode=? where subcompanyId = ?",e.getSubcompanyName(),
|
||||
e.getSupsubcomId(),e.getShoworder(),e.getCanceled(),e.getSubcompanyCode(),e.getSubcompanyId()));
|
||||
|
||||
subCompanyInsert.forEach(e-> rs.executeUpdate("insert into uf_hrmsubcompany(subcompanyId,subcompanyName,supsubcomId,showorder,canceled,subcompanyCode) values(?,?,?,?,?,?)",e.getSubcompanyId(),e.getSubcompanyName(),
|
||||
e.getSupsubcomId(),e.getShoworder(),e.getCanceled(),e.getSubcompanyCode()));
|
||||
|
||||
departmentUpdate.forEach(e-> rs.executeUpdate("update uf_hrmdepartment set departmentmark=?,subcompanyId=?,supdepId=?,showorder=?,canceled=?,departmentCode=?,bmfzr=? where departmentId = ?",e.getDepartmentmark(),e.getSubcompanyId(),
|
||||
e.getSupdepId(),e.getShoworder(),e.getCanceled(),e.getDepartmentCode(),e.getBmfzr(),e.getDepartmentId()));
|
||||
|
||||
departmentInsert.forEach(e -> rs.executeUpdate("insert into uf_hrmdepartment(departmentId,departmentmark,subcompanyId,supdepId,showorder,canceled,departmentCode,bmfzr) values(?,?,?,?,?,?,?,?)",e.getDepartmentId(),e.getDepartmentmark(),e.getSubcompanyId(),
|
||||
e.getSupdepId(),e.getShoworder(),e.getCanceled(),e.getDepartmentCode(),e.getBmfzr()));
|
||||
|
||||
organizationRecordInsert.forEach(e -> {
|
||||
//1.更新上一条数据stopDate
|
||||
List<OrganizationRecordPo> list = new ArrayList<>();
|
||||
rs.executeQuery("select id,startDate from uf_orgChange where OId = ? and oType = ?",e.getOId(),e.getOType());
|
||||
while (rs.next()) {
|
||||
list.add(OrganizationRecordPo.builder().id(Util.getIntValue(rs.getString("id"))).startDate(Util.null2String(rs.getString("startDate"))).build());
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
String date = DateUtil.getCurrentDate();
|
||||
OrganizationRecordPo latest = list.stream()
|
||||
.max(Comparator.comparing(OrganizationRecordPo::getId))
|
||||
.orElse(null);
|
||||
assert latest != null;
|
||||
if (EmploymentUtil.compareDate(latest.getStartDate())) {
|
||||
date = DateUtil.getYesterday();
|
||||
}
|
||||
rs.executeUpdate("update uf_orgChange set stopDate = ? where id = ?",date,latest.getId());
|
||||
}
|
||||
|
||||
rs.executeUpdate("insert into uf_orgChange(orgStatus,startDate,stopDate,oId,oType,oName,oParentId,oChargeId,changeType,showorder,organizationCode,newName,newParentId,newOChargeId,oldName,oldParentId,oldOChargeId,belongSub) " +
|
||||
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",e.getOrgStatus(), e.getStartDate(),e.getStopDate(),e.getOId(),e.getOType(),e.getOName(),e.getOParentId(),e.getOChargeId(),e.getChangeType(),e.getShoworder(),e.getOrganizationCode(),e.getNewName(),
|
||||
e.getNewParentId(),e.getNewOChargeId(),e.getOldName(),e.getOldParentId(),e.getOldOChargeId(),e.getBelongSub());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门数据变化
|
||||
* @param departmentPo
|
||||
* @param departmentUpdate
|
||||
* @param departmentInsert
|
||||
* @param organizationRecordInsert
|
||||
*/
|
||||
private void dutyDeptChange(DepartmentPo departmentPo, List<DepartmentPo> departmentUpdate, List<DepartmentPo> departmentInsert, List<OrganizationRecordPo> organizationRecordInsert) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//2.1 根据departmentId获取上一次部门中间表数据作对比
|
||||
rs.executeQuery("select departmentId,departmentmark,subcompanyId,supdepId,showorder,canceled,departmentCode,bmfzr from uf_hrmdepartment where departmentId = ?",departmentPo.getDepartmentId());
|
||||
if (rs.next()) {
|
||||
DepartmentPo lastDepartmentPo = DepartmentPo.builder()
|
||||
.departmentId(Util.getIntValue(rs.getString("departmentId")))
|
||||
.departmentmark(Util.null2String(rs.getString("departmentmark")))
|
||||
.subcompanyId(Util.getIntValue(rs.getString("subcompanyId")))
|
||||
.supdepId(Util.getIntValue(rs.getString("supdepId")))
|
||||
.showorder(Util.getFloatValue(rs.getString("showorder")))
|
||||
.canceled(Util.getIntValue(rs.getString("canceled")))
|
||||
.departmentCode(Util.null2String(rs.getString("departmentCode")))
|
||||
.bmfzr(Util.null2String(rs.getString("bmfzr")))
|
||||
.build();
|
||||
//1.状态比较
|
||||
if (!departmentPo.getCanceled().equals(lastDepartmentPo.getCanceled())) {
|
||||
departmentUpdate.add(departmentPo);
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(null, departmentPo, 1);
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
//2.变动比较
|
||||
if (!departmentPo.getSupdepId().equals(lastDepartmentPo.getSupdepId())
|
||||
|| !departmentPo.getDepartmentmark().equals(lastDepartmentPo.getDepartmentmark())
|
||||
|| !departmentPo.getBmfzr().equals(lastDepartmentPo.getBmfzr())) {
|
||||
departmentUpdate.add(departmentPo);
|
||||
// 记录调动下新旧组织数据留痕
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(null, departmentPo, 1);
|
||||
organizationRecordPo.setChangeType(1);
|
||||
organizationRecordPo.setOldParentId(lastDepartmentPo.getSupdepId());
|
||||
organizationRecordPo.setOldName(lastDepartmentPo.getDepartmentmark());
|
||||
organizationRecordPo.setOldOChargeId(lastDepartmentPo.getBmfzr());
|
||||
organizationRecordPo.setNewParentId(departmentPo.getSupdepId());
|
||||
organizationRecordPo.setNewName(departmentPo.getDepartmentmark());
|
||||
organizationRecordPo.setNewOChargeId(departmentPo.getBmfzr());
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
}else {
|
||||
departmentInsert.add(departmentPo);
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(null, departmentPo, 1);
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分部数据变化
|
||||
* @param subCompanyPo
|
||||
* @param subCompanyUpdate
|
||||
* @param subCompanyInsert
|
||||
*/
|
||||
private void dutySubChange(SubCompanyPo subCompanyPo, List<SubCompanyPo> subCompanyUpdate, List<SubCompanyPo> subCompanyInsert,List<OrganizationRecordPo> organizationRecordInsert) {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
//2.1 根据subcompanyId获取上一次分部中间表数据作对比
|
||||
rs.executeQuery("select subcompanyId,subcompanyName,supsubcomId,showorder,canceled,subcompanyCode from uf_hrmsubcompany where subcompanyId = ?",subCompanyPo.getSubcompanyId());
|
||||
if (rs.next()) {
|
||||
//数据存在作比较
|
||||
SubCompanyPo lastSubCompany = SubCompanyPo.builder()
|
||||
.subcompanyId(Util.getIntValue(rs.getString("subcompanyId")))
|
||||
.subcompanyName(Util.null2String(rs.getString("subcompanyname")))
|
||||
.supsubcomId(Util.getIntValue(rs.getString("supsubcomId")))
|
||||
.showorder(Util.getFloatValue(rs.getString("showorder")))
|
||||
.canceled(Util.getIntValue(rs.getString("canceled")))
|
||||
.subcompanyCode(Util.null2String(rs.getString("subcompanycode")))
|
||||
.build();
|
||||
|
||||
// 状态比较 (启用 封存 E9物理删除无比较意义)
|
||||
if (!subCompanyPo.getCanceled().equals(lastSubCompany.getCanceled())) {
|
||||
subCompanyUpdate.add(subCompanyPo);
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(subCompanyPo, null, 0);
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
|
||||
//变动比较
|
||||
if (!subCompanyPo.getSupsubcomId().equals(lastSubCompany.getSupsubcomId())
|
||||
|| !subCompanyPo.getSubcompanyName().equals(lastSubCompany.getSubcompanyName())) {
|
||||
subCompanyUpdate.add(subCompanyPo);
|
||||
// 记录调动下新旧组织数据留痕
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(subCompanyPo, null, 0);
|
||||
organizationRecordPo.setChangeType(1);
|
||||
organizationRecordPo.setOldParentId(lastSubCompany.getSupsubcomId());
|
||||
organizationRecordPo.setOldName(lastSubCompany.getSubcompanyName());
|
||||
organizationRecordPo.setNewParentId(subCompanyPo.getSupsubcomId());
|
||||
organizationRecordPo.setNewName(subCompanyPo.getSubcompanyName());
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
|
||||
}else {
|
||||
//数据不存在新增
|
||||
subCompanyInsert.add(subCompanyPo);
|
||||
OrganizationRecordPo organizationRecordPo = EmploymentRecordBo.setOrganizationRecordPo(subCompanyPo, null, 0);
|
||||
organizationRecordInsert.add(organizationRecordPo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue