2021-11-29 10:15:16 +08:00
|
|
|
|
package com.api.aiy_changeStatus.Impl;
|
|
|
|
|
|
|
|
|
|
import aiyh.utils.Util;
|
|
|
|
|
import aiyh.utils.zwl.common.ToolUtil;
|
|
|
|
|
import com.api.aiy_changeStatus.Impl.Util.ChangeStatusUtil;
|
|
|
|
|
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocReplaceComponent;
|
|
|
|
|
import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceAfter;
|
|
|
|
|
import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceBefore;
|
|
|
|
|
import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaAfterReplaceParam;
|
|
|
|
|
import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaBeforeReplaceParam;
|
|
|
|
|
import org.h2.util.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author EBU7-dev1-ayh
|
|
|
|
|
* @create 2021/11/27 0027 13:02
|
|
|
|
|
* 修改状态
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@WeaIocReplaceComponent("ChangeStatusService")
|
|
|
|
|
public class ChangeStatusImpl {
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++修改人员数据Start+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/finance/save", order = 1, description = "工资福利修改")
|
|
|
|
|
public void financeBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "id", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/systeminfo/save", order = 1, description = "系统信息修改")
|
|
|
|
|
public void systeminfoBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "id", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/resource/editResource", order = 1, description = "人员信息修改")
|
|
|
|
|
public void editResourceBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "id", 2);
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-01 10:22:22 +08:00
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/forgotPassword/saveResetPassword", order = 1, description = "重置密码")
|
|
|
|
|
public void saveResetPasswordBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "id", 2);
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-29 10:15:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 批量数据修改,数据类型为数组
|
|
|
|
|
*
|
|
|
|
|
* @param weaBeforeReplaceParam
|
|
|
|
|
*/
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/resource/saveBatch", order = 1, description = "批量修改人员数据")
|
|
|
|
|
public void saveBatchBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.batchChangeHrmResourceStatus(weaBeforeReplaceParam, "id", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchManagerid", order = 1, description = "批量修改直接上级")
|
|
|
|
|
public void saveBatchManageridBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "ids", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchJobtitle", order = 1, description = "批量调整职位")
|
|
|
|
|
public void saveBatchJobtitleBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "ids", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchResourceDeptid", order = 1, description = "批量调整部门")
|
|
|
|
|
public void saveBatchResourceDeptidBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "ids", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchAccounttype", order = 1, description = "批量修改主次账号")
|
|
|
|
|
public void saveBatchAccounttypeBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "ids", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchPassword", order = 1, description = "批量修改密码")
|
|
|
|
|
public void saveBatchPasswordBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "ids", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchDefaultPwd", order = 1, description = "批量重置密码")
|
|
|
|
|
public void saveBatchDefaultPwdBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "resourceIds", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmRedeploy", order = 1, description = "人员调动")
|
|
|
|
|
public void saveHrmRedeployBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "tempresourceid", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmExtend", order = 1, description = "人员续签")
|
|
|
|
|
public void saveHrmExtendBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "tempresourceid", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmHire", order = 1, description = "人员转正")
|
|
|
|
|
public void saveHrmHireBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "tempresourceid", 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* @WeaReplaceBefore(value = "/api/hrm/batchMaintenanceAdjustEdit/saveBatchUnlockStatus", order = 1, description = "批量解锁人员")
|
|
|
|
|
public void saveBatchUnlockStatusBfore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatusByIds(weaBeforeReplaceParam, "resourceIds", 2);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++修改人员数据END+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++添加人员数据Start+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmReHire", order = 1, description = "人员返聘")
|
|
|
|
|
public void saveHrmReHireBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "tempresourceid", 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@WeaReplaceAfter(value = "/api/hrm/resource/add/save", order = 1, description = "人员添加")
|
|
|
|
|
public String addResourceAfter(WeaAfterReplaceParam weaAfterReplaceParam) {
|
|
|
|
|
Map<String, Object> paramMap = weaAfterReplaceParam.getParamMap();
|
|
|
|
|
String loginId = Util.null2String(paramMap.get("loginid"));
|
|
|
|
|
String lastName = Util.null2String(paramMap.get("lastname"));
|
|
|
|
|
ToolUtil toolUtil = new ToolUtil();
|
|
|
|
|
toolUtil.writeErrorLog(weaAfterReplaceParam.getParamMap().toString());
|
|
|
|
|
toolUtil.writeErrorLog(loginId);
|
|
|
|
|
toolUtil.writeErrorLog(lastName);
|
|
|
|
|
if (StringUtils.isNullOrEmpty(loginId)) {
|
|
|
|
|
// 没有登录id
|
|
|
|
|
if (!StringUtils.isNullOrEmpty(lastName)) {
|
|
|
|
|
// 查询该名称的最后一名
|
|
|
|
|
String query = "select id from hrmresource where lastname = ? ORDER BY id desc limit 1";
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery(query, lastName);
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
toolUtil.writeErrorLog(rs.getString(1));
|
|
|
|
|
ChangeStatusUtil.changeStatus(rs.getString(1), 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
String query = "select id from hrmresource where loginid = ? ";
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery(query, loginId);
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
toolUtil.writeErrorLog(rs.getString(1));
|
|
|
|
|
ChangeStatusUtil.changeStatus(rs.getString(1), 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return weaAfterReplaceParam.getData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++添加人员数据END+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++离职人员数据Start+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmDismiss", order = 1, description = "人员离职")
|
|
|
|
|
public void saveHrmDismissBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "tempresourceid", 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmFire", order = 1, description = "人员解聘")
|
|
|
|
|
public void saveHrmFireBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "tempresourceid", 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@WeaReplaceBefore(value = "/api/hrm/statechange/saveHrmRetire", order = 1, description = "人员退修")
|
|
|
|
|
public void saveHrmRetireBefore(WeaBeforeReplaceParam weaBeforeReplaceParam) {
|
|
|
|
|
ChangeStatusUtil.changeHrmResourceStatus(weaBeforeReplaceParam, "tempresourceid", 3);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
+++++++++++++++++++++++++++++++++++++++++++离职员数据END+++++++++++++++++++++++++++++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|