|
|
|
@ -1,12 +1,17 @@
|
|
|
|
|
package com.engine.mzg.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.mzg.entity.SyncTableField;
|
|
|
|
|
import com.engine.mzg.exception.CustomizeRunTimeException;
|
|
|
|
|
import com.engine.mzg.service.RecruitMobileService;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.formmode.mzg.modeexpand.disc.AddDiscExpand;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
|
|
|
@ -53,6 +58,40 @@ public class RecruitMobileServiceImpl extends Service implements RecruitMobileSe
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> submitRegist(Map<String, Object> params) {
|
|
|
|
|
// 判断是否已经创建面试台账,未创建则插入数据,已创建则更新数据,发起面试流程后,不允许再次提交
|
|
|
|
|
String billId = Util.null2String(params.get("billId"));
|
|
|
|
|
String targetTable = Util.null2String(params.get("targetTable"));
|
|
|
|
|
String sourceTable = Util.null2String(params.get("sourceTable"));
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select id,mslcid from uf_recruit_ms where ypdjid = ? ", billId);
|
|
|
|
|
String msId = "";
|
|
|
|
|
String mslcId = "";
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
msId = rs.getString("id");
|
|
|
|
|
mslcId = rs.getString("mslcid");
|
|
|
|
|
}
|
|
|
|
|
// 是否新增面试数据
|
|
|
|
|
boolean isAdd = StringUtils.isBlank(msId);
|
|
|
|
|
if (StringUtils.isNotBlank(mslcId)) {
|
|
|
|
|
throw new CustomizeRunTimeException("当前数据已登记结束,无法重复提交");
|
|
|
|
|
}
|
|
|
|
|
rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable);
|
|
|
|
|
String mainId = "";
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
mainId = rs.getString("id");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(mainId)) {
|
|
|
|
|
// 查询配置的字段,更新或者插入数据
|
|
|
|
|
rs.executeQuery("select * from uf_recruit_table_dt1 where mainid = ? ", mainId);
|
|
|
|
|
List<SyncTableField> fields = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
fields.add(SyncTableField.builder().sourceField(rs.getString("source_field")).targetField(rs.getString("target_field")).build());
|
|
|
|
|
}
|
|
|
|
|
if(CollectionUtils.isNotEmpty(fields)){
|
|
|
|
|
throw new CustomizeRunTimeException("数据同步配置异常,请检查配置");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|