generated from dxfeng/secondev-chapanda-feishu
入职流程 更新招聘需求、入职状态
This commit is contained in:
parent
dc121abcfd
commit
260cfe16ca
|
|
@ -0,0 +1,64 @@
|
|||
package weaver.interfaces.recruit.action;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 招聘 入职流程Action
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/02/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitEntryAction implements Action {
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
try {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, Object> mainDataMap = new HashMap<>();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
|
||||
// 入职关联招聘需求的入职人数+1
|
||||
String glzpxq = Util.null2String(mainDataMap.get("glzpxq"));
|
||||
if (StringUtils.isNotBlank(glzpxq)) {
|
||||
rs.executeQuery("select rzrs,zprs from uf_jcl_zp_zpxq where id = ? ", glzpxq);
|
||||
if (rs.next()) {
|
||||
int rzrs = Convert.toInt(rs.getString("rzrs"), 0) + 1;
|
||||
int zprs = rs.getInt("zprs");
|
||||
BigDecimal xqzhjd = new BigDecimal("0.00");
|
||||
if (zprs > 0) {
|
||||
xqzhjd = new BigDecimal(rzrs).divide(new BigDecimal(zprs), 2, RoundingMode.HALF_DOWN);
|
||||
}
|
||||
rs.executeUpdate("update uf_jcl_zp_zpxq set rzrs = ?,xqzhjd = ? where id = ? ", rzrs, xqzhjd, glzpxq);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新入职状态
|
||||
String xxcjid = Util.null2String(mainDataMap.get("xxcjid"));
|
||||
if (StringUtils.isNotBlank(xxcjid)) {
|
||||
rs.executeUpdate("update uf_jcl_rzgl set rzzt = 1 where xxcjid = ?", xxcjid);
|
||||
}
|
||||
return SUCCESS;
|
||||
} catch (Exception e) {
|
||||
rs.writeLog(e);
|
||||
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,6 @@ public class RecruitRecordAction implements Action {
|
|||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
{
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, Object> mainDataMap = new HashMap<>();
|
||||
|
|
@ -55,7 +54,6 @@ public class RecruitRecordAction implements Action {
|
|||
recordPo.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue