From 336a91c928c4f68a2d1fc55745d0ff5d4313e524 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 24 Oct 2023 17:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E4=BF=A1=E6=81=AF=E9=87=87?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/recruit/conn/RecruitRecordSet.java | 4 ++++ .../impl/InductionManageServiceImpl.java | 23 +++++++++++++++---- .../engine/recruit/util/ResponseResult.java | 10 ++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/com/engine/recruit/conn/RecruitRecordSet.java b/src/com/engine/recruit/conn/RecruitRecordSet.java index a392ddb..e23cd6e 100644 --- a/src/com/engine/recruit/conn/RecruitRecordSet.java +++ b/src/com/engine/recruit/conn/RecruitRecordSet.java @@ -1,5 +1,6 @@ package com.engine.recruit.conn; +import com.engine.recruit.exception.CustomizeRunTimeException; import org.apache.commons.lang3.StringUtils; import weaver.common.DateUtil; import weaver.conn.RecordSet; @@ -54,6 +55,9 @@ public class RecruitRecordSet { String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")"; RecordSet rs = new RecordSet(); rs.executeUpdate(insertSql, dataList); + if (StringUtils.isNotBlank(rs.getExceptionMsg())) { + throw new CustomizeRunTimeException(rs.getExceptionMsg()); + } } /** diff --git a/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java b/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java index 8ea8c9f..47792c9 100644 --- a/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java +++ b/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java @@ -5,6 +5,7 @@ import com.engine.recruit.conn.RecruitDataMap; import com.engine.recruit.conn.RecruitRecordSet; import com.engine.recruit.enums.InfoCollectEnum; import com.engine.recruit.enums.PositionOperateEnum; +import com.engine.recruit.exception.CustomizeRunTimeException; import com.engine.recruit.service.InductionManageService; import com.engine.recruit.util.RecruitMessageUtils; import org.apache.commons.lang3.StringUtils; @@ -40,6 +41,14 @@ public class InductionManageServiceImpl extends Service implements InductionMana RecordSet rs = new RecordSet(); for (String billId : split) { + // 判断是否已发送信息采集,已发送的不重复发送 + rs.executeQuery("select a.id from uf_jcl_xxcj a inner join uf_jcl_rzgl b on a.xm = b.xm and a.sjh = b.sjhm where b.id = ? ", billId); + if (rs.next()) { + if (StringUtils.isNotBlank(rs.getString("id"))) { + continue; + } + } + // 根据入职管理信息完善信息采集表单 Map dataMap = new RecruitDataMap<>(); String uuid = UUID.randomUUID().toString(); @@ -72,9 +81,8 @@ public class InductionManageServiceImpl extends Service implements InductionMana // 发送短信 String mobile = Util.null2String(dataMap.get("sjh")); String messageContent = RecruitModeUtil.getRecruitPropValue("COLLECT_MESSAGE_CONTENT"); - // TODO if (StringUtils.isBlank(messageContent)) { - //throw new CustomizeRunTimeException("未获取到短信内容,请检查配置"); + throw new CustomizeRunTimeException("未获取到短信内容,请检查配置"); } else { RecruitMessageUtils.sendSMS(mobile, messageContent); } @@ -83,7 +91,7 @@ public class InductionManageServiceImpl extends Service implements InductionMana int id = RecruitRecordSet.refreshRight(uuid, "uf_jcl_xxcj", formModeId); // 更新状态为已发送,反填信息采集ID - rs.executeUpdate("update uf_jcl_rzgl set xxcj = ? ,xxcjid = ? where id = ? ", InfoCollectEnum.HAS_SENT, id, billId); + rs.executeUpdate("update uf_jcl_rzgl set xxcj = ? ,xxcjid = ? where id = ? ", InfoCollectEnum.HAS_SENT.getId(), id, billId); } return null; @@ -91,7 +99,14 @@ public class InductionManageServiceImpl extends Service implements InductionMana @Override public Map checkLoginInfo(Map param) { - return null; + RecordSet rs = new RecordSet(); + String mobile = Util.null2String(param.get("mobile")); + String pwd = Util.null2String(param.get("pwd")); + rs.executeQuery("select id from uf_jcl_xxcj where sjh = ? and mm = ?", mobile, pwd); + rs.next(); + return new HashMap() {{ + put("id", Util.getIntValue(rs.getString("id"))); + }}; } /** diff --git a/src/com/engine/recruit/util/ResponseResult.java b/src/com/engine/recruit/util/ResponseResult.java index 45e2e46..aa203ac 100644 --- a/src/com/engine/recruit/util/ResponseResult.java +++ b/src/com/engine/recruit/util/ResponseResult.java @@ -2,8 +2,8 @@ package com.engine.recruit.util; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; -import com.engine.recruit.exception.CustomizeRunTimeException; import com.engine.core.exception.ECException; +import com.engine.recruit.exception.CustomizeRunTimeException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; @@ -142,7 +142,7 @@ public class ResponseResult { */ private String Ok() { Map apidatas = new HashMap<>(); - apidatas.put("status", true); + apidatas.put("api_status", true); return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect); } @@ -152,7 +152,7 @@ public class ResponseResult { */ private String Ok(R r) { Map apidatas = new HashMap<>(); - apidatas.put("status", true); + apidatas.put("api_status", true); apidatas.put("data", r); String success = getJsonString(apidatas); if (isLog) { @@ -167,7 +167,7 @@ public class ResponseResult { */ private static String Error(String message) { Map apidatas = new HashMap<>(); - apidatas.put("status", false); + apidatas.put("api_status", false); apidatas.put("errormsg", message); return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect); } @@ -178,7 +178,7 @@ public class ResponseResult { */ private static String Error(String message, Exception e) { Map apidatas = new HashMap<>(); - apidatas.put("status", false); + apidatas.put("api_status", false); apidatas.put("errormsg", message); apidatas.put("error", e.getMessage()); return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);