commit
b232148b09
@ -0,0 +1,41 @@
|
|||||||
|
package com.engine.organization.entity.hrmresource.param;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/5/29 2:54 PM
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class HrmStatusHistoryParam {
|
||||||
|
|
||||||
|
private Long resourceId;
|
||||||
|
|
||||||
|
private String changeDate;
|
||||||
|
|
||||||
|
private String changeReason;
|
||||||
|
|
||||||
|
private Integer oldJobtitleId;
|
||||||
|
|
||||||
|
private Integer newjobtitleId;
|
||||||
|
|
||||||
|
private Integer typeN;
|
||||||
|
|
||||||
|
private Integer oldDepartmentId;
|
||||||
|
|
||||||
|
private Integer newDepartmentId;
|
||||||
|
|
||||||
|
private Integer oldSubcompanyId;
|
||||||
|
|
||||||
|
private Integer newSubcompanyId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.engine.organization.util;
|
||||||
|
|
||||||
|
import com.engine.organization.entity.hrmresource.param.HrmStatusHistoryParam;
|
||||||
|
import com.engine.organization.entity.hrmresource.po.ResourceChartPO;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.hrm.company.DepartmentComInfo;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/5/29 2:50 PM
|
||||||
|
* @Description: 人员工作记录
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class HrmStatusHistoryUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param resourceChartPOList 调整前人员信息
|
||||||
|
* @param departmentID 调整后部门
|
||||||
|
*/
|
||||||
|
public static void personWorkRecord(List<ResourceChartPO> resourceChartPOList,Integer departmentID,String changeReason){
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
DepartmentComInfo comInfo = new DepartmentComInfo();
|
||||||
|
String subcompanyid1 = comInfo.getSubcompanyid1(String.valueOf(departmentID));
|
||||||
|
Integer newSub = "".equals(subcompanyid1) ? null : Integer.valueOf(subcompanyid1);
|
||||||
|
|
||||||
|
List<HrmStatusHistoryParam> historyParamList = new ArrayList<>();
|
||||||
|
resourceChartPOList.forEach(item -> historyParamList.add(HrmStatusHistoryParam.builder()
|
||||||
|
.resourceId(item.getId())
|
||||||
|
.changeDate(OrganizationDateUtil.getFormatLocalDate(LocalDate.now()))
|
||||||
|
.changeReason(changeReason)
|
||||||
|
.oldJobtitleId(item.getJobTitle())
|
||||||
|
.newjobtitleId(item.getJobTitle())
|
||||||
|
.typeN(4)
|
||||||
|
.oldDepartmentId(item.getDepartmentId())
|
||||||
|
.newDepartmentId(departmentID)
|
||||||
|
.oldSubcompanyId(item.getSubcompanyid1())
|
||||||
|
.newSubcompanyId(newSub)
|
||||||
|
.build()));
|
||||||
|
|
||||||
|
historyParamList.forEach(item -> {
|
||||||
|
rs.executeUpdate("insert into hrmstatushistory(resourceid,changedate,changereason,oldjobtitleid,newjobtitleid,type_n,olddepartmentid,newdepartmentid,oldsubcompanyid,newsubcompanyid) " +
|
||||||
|
" values(?,?,?,?,?,?,?,?,?,?)",item.getResourceId(),item.getChangeDate(),item.getChangeReason(),item.getOldJobtitleId(),item.getNewjobtitleId(),item.getTypeN(),
|
||||||
|
item.getOldDepartmentId(),item.getNewDepartmentId(),item.getOldSubcompanyId(),item.getNewSubcompanyId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue