From dc2164c49a52e05a7bbef1b8e29a98ae8943d575 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 11 Oct 2024 10:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=97offer=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8F=92=E5=85=A5=E5=BE=85=E5=85=A5=E8=81=8C=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RecruitMobileServiceImpl.java | 106 +++++++++++++++++- 1 file changed, 102 insertions(+), 4 deletions(-) diff --git a/src/com/engine/mzg/service/impl/RecruitMobileServiceImpl.java b/src/com/engine/mzg/service/impl/RecruitMobileServiceImpl.java index bba38c5..66a8625 100644 --- a/src/com/engine/mzg/service/impl/RecruitMobileServiceImpl.java +++ b/src/com/engine/mzg/service/impl/RecruitMobileServiceImpl.java @@ -112,6 +112,7 @@ public class RecruitMobileServiceImpl extends Service implements RecruitMobileSe buildDataMap.put("ypdjid", billId); buildDataMap.put("mslx", "0"); buildDataMap.put("mszt", "0"); + buildDataMap.put("msjg", "3"); RecruitRecordSet.buildModeInsertFields(buildDataMap, 1); RecruitRecordSet.insertData(buildDataMap, targetTable); msId = String.valueOf(RecruitRecordSet.refreshRight(uuid, targetTable, formModeId, 1)); @@ -168,26 +169,42 @@ public class RecruitMobileServiceImpl extends Service implements RecruitMobileSe } RecordSet rs = new RecordSet(); - rs.executeQuery("select fkjg from uf_recruit_lytzs where modeuuid = ? ", uuid); + rs.executeQuery("select id,fkjg from uf_recruit_lytzs where modeuuid = ? ", uuid); String fkjg = ""; + String id = ""; if (rs.next()) { fkjg = rs.getString("fkjg"); + id = rs.getString("id"); } else { returnMap.put("description", "反馈失败,offer信息有误,请联系相应HR确认"); return returnMap; } - + // 查询是否存在待入职台账 + rs.executeQuery("select id from uf_recruit_drz where offerid = ?", id); + String entryDataId = ""; + if (rs.next()) { + entryDataId = rs.getString("id"); + } + returnMap.put("entryDataId", entryDataId); if (StringUtils.isNotBlank(fkjg) && !"0".equals(fkjg)) { - returnMap.put("description", "您已成功反馈,请勿重复反馈。"); + returnMap.put("description", "您已成功反馈,无需重复反馈。"); + returnMap.put("type", "info"); + returnMap.put("message", "已反馈"); + if (StringUtils.isNotBlank(entryDataId)) { + returnMap.put("description", "您已成功反馈,请勿重复反馈,请点击下方按钮完善入职信息"); + } return returnMap; } if ("1".equals(status)) { returnMap.put("type", "success"); returnMap.put("message", "已接受offer"); - returnMap.put("description", "您已接受offer,期待您的加入,请按期准备报道,如有问题可以联系相应HR"); + returnMap.put("description", "您已接受offer,期待您的加入,请按期准备报道,如有问题可以联系相应HR,请点击下方按钮完善入职信息"); rs.executeUpdate("update uf_recruit_lytzs set fkjg = ? where modeuuid = ? ", status, uuid); + // 同步面试信息,创建待入职数据 + entryDataId = createEntryData(params, id); + returnMap.put("entryDataId", entryDataId); } else if ("2".equals(status)) { returnMap.put("type", "info"); returnMap.put("message", "已拒绝offer"); @@ -216,4 +233,85 @@ public class RecruitMobileServiceImpl extends Service implements RecruitMobileSe } return fields; } + + /** + * 生成待归档数据 + * + * @param params + */ + private String createEntryData(Map params, String offerId) { + String mainId = ""; + String targetTable = "uf_recruit_drz"; + String sourceTable = "uf_recruit_ms"; + if (StringUtils.isBlank(offerId)) { + throw new CustomizeRunTimeException("数据流转异常,请联系HR确认"); + } + RecordSet rs = new RecordSet(); + rs.executeQuery("select xm from uf_recruit_lytzs where id = ?", offerId); + String msId = ""; + if (rs.next()) { + msId = rs.getString("xm"); + } + // 是否新增面试数据 + rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable); + String mainTableId = ""; + if (rs.next()) { + mainTableId = rs.getString("id"); + } + if (StringUtils.isNotBlank(mainTableId)) { + // 查询配置的字段,更新或者插入数据 + List fields = getSyncTableFields(mainTableId); + rs.executeQuery("select * from " + sourceTable + " where id = ? ", msId); + IgnoreCaseHashMap buildDataMap = new IgnoreCaseHashMap<>(); + if (rs.next()) { + for (SyncTableField field : fields) { + String value = RecruitUtil.parseBlankToNull(rs.getString(field.getSourceField())); + if (StringUtils.isNotBlank(value)) { + buildDataMap.put(field.getTargetField(), value); + } + } + // 新增 + String uuid = UUID.randomUUID().toString(); + buildDataMap.put("modeuuid", uuid); + int formModeId = RecruitCommon.getModeIdByTableName(targetTable); + buildDataMap.put("formmodeid", formModeId); + // 构建建模表基本数据 + buildDataMap.put("offerid", offerId); + buildDataMap.put("msid", msId); + RecruitRecordSet.buildModeInsertFields(buildDataMap, 1); + RecruitRecordSet.insertData(buildDataMap, targetTable); + mainId = String.valueOf(RecruitRecordSet.refreshRight(uuid, targetTable, formModeId, 1)); + + } + + // 更新明细表,明细表删除后重新插入数据 + if (StringUtils.isNotBlank(mainId)) { + rs.executeQuery("select * from uf_recruit_table where source_table like '" + sourceTable + "_dt%' and target_table like '" + targetTable + "_dt%' "); + while (rs.next()) { + mainTableId = rs.getString("id"); + String sourceDetailTable = rs.getString("source_table"); + String targetDetailTable = rs.getString("target_table"); + List syncTableFields = getSyncTableFields(mainTableId); + + // 删除明细表数据 + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(" delete from " + targetDetailTable + " where mainid = ?", mainId); + recordSet.executeQuery("select * from " + sourceDetailTable + " where mainid = ? ", msId); + while (recordSet.next()) { + buildDataMap = new IgnoreCaseHashMap<>(); + buildDataMap.put("mainid", mainId); + for (SyncTableField field : syncTableFields) { + String value = RecruitUtil.parseBlankToNull(recordSet.getString(field.getSourceField())); + if (StringUtils.isNotBlank(value)) { + buildDataMap.put(field.getTargetField(), value); + } + } + RecruitRecordSet.insertData(buildDataMap, targetDetailTable); + + } + } + } + } + return mainId; + } }