入职管理,身份证校验

This commit is contained in:
dxfeng 2023-10-10 11:06:09 +08:00
parent 0f69915b09
commit 3b0f62a3c0
2 changed files with 71 additions and 3 deletions

View File

@ -0,0 +1,41 @@
package com.engine.recruit.enums;
/**
* 入职状态枚举类
*
* @author:dxfeng
* @createTime: 2023/10/10
* @version: 1.0
*/
public enum EntryStatusEnum {
/**
* 入职状态
*/
PENDING("0", "待入职"),
EMPLOYED("0", "已入职"),
CANCEL("0", "取消入职");
EntryStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
private String value;
private String desc;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@ -1,8 +1,12 @@
package weaver.formmode.recruit.modeexpand.entrymanager;
import com.engine.recruit.enums.EntryStatusEnum;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.Util;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
@ -25,11 +29,34 @@ public class AddEntryModeExpand extends AbstractModeExpandJavaCodeNew {
billId = Util.getIntValue(requestInfo.getRequestid());
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
String dqypjd = Util.null2String(param.get("dqypjd"));
String pcid = Util.null2String(param.get("pcid"));
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, String> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
RecordSet rs = new RecordSet();
String pcid = mainDataMap.get("pcid");
String sfzh = mainDataMap.get("sfzh");
String rzzt = mainDataMap.get("rzzt");
// 根据身份证号判定只能有一个状态为待入职的数据
if (EntryStatusEnum.PENDING.getValue().equals(rzzt)) {
rs.executeQuery("select count(id) as num from uf_jcl_rzgl where sfzh = ? and id != ? and rzzt = ? ", sfzh, billId, rzzt);
int countNum = 0;
if (rs.next()) {
countNum = rs.getInt("num");
}
if (countNum > 0) {
result.put("errmsg", "当前身份证号已存在待入职状态数据");
result.put("flag", "false");
return result;
}
}
// 更新应聘者当前应聘阶段
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, pcid);
String dqypjd = Util.null2String(param.get("dqypjd"));
if (StringUtils.isNotBlank(dqypjd)) {
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, pcid);
}
}
}
} catch (Exception e) {