部门筛选-新增操作,多应聘者、多反馈人数据插入处理

部门筛选-弃用删除操作Expand
This commit is contained in:
dxfeng 2023-09-19 10:31:17 +08:00
parent 09e56843aa
commit 086e0da3be
2 changed files with 40 additions and 91 deletions

View File

@ -48,8 +48,12 @@ public class AddDeptScreeningModeExpand extends AbstractModeExpandJavaCodeNew {
formModeId = rs.getInt("id");
}
// 填充数据集合信息
// 部门筛选ID
dataMap.put("bmsxid", requestInfo.getRequestid());
// 结果
dataMap.put("jg", "2");
// 填充建模数据基本信息
dataMap.put("formmodeid", formModeId);
dataMap.put("modedatacreater", requestInfo.getCreatorid());
String dateTime = DateUtil.getFullDate();
@ -63,7 +67,7 @@ public class AddDeptScreeningModeExpand extends AbstractModeExpandJavaCodeNew {
List<List<Object>> paramList = new ArrayList<>();
buildParamList(dataMap, paramList);
if (CollectionUtils.isNotEmpty(paramList)) {
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, bmsxid, ypz, ypzw, tdsj, fkr) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, bmsxid, ypz, ypzw, tdsj, jg, fkr) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
for (List<Object> objects : paramList) {
String uuid = UUID.randomUUID().toString();
objects.add(0, uuid);
@ -87,32 +91,41 @@ public class AddDeptScreeningModeExpand extends AbstractModeExpandJavaCodeNew {
* @param paramList 待插入数据集合
*/
private void buildParamList(Map<String, Object> map, List<List<Object>> paramList) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
String ypz = Util.null2String(map.get("ypz"));
String[] ypzIds = ypz.split(",");
for (String ypzId : ypzIds) {
if (StringUtils.isBlank(ypzId)) {
continue;
}
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
//部门筛选ID
param.add(map.get("bmsxid"));
// 应聘者
param.add(map.get("ypz"));
// 应聘职位
param.add(map.get("ypzw"));
// 投递时间
param.add(map.get("tdsj"));
// 反馈人
String fkr = Util.null2String(map.get("fkr"));
if (StringUtils.isNotBlank(fkr)) {
String[] fkrArray = fkr.split(",");
for (String fkrId : fkrArray) {
ArrayList<Object> objects = new ArrayList<>(param);
objects.add(fkrId);
paramList.add(objects);
//部门筛选ID
param.add(map.get("bmsxid"));
// 应聘者
param.add(ypzId);
// 应聘职位
param.add(map.get("ypzw"));
// 投递时间
param.add(map.get("tdsj"));
// 状态
param.add(map.get("jg"));
// 反馈人
String fkr = Util.null2String(map.get("fkr"));
if (StringUtils.isNotBlank(fkr)) {
String[] fkrArray = fkr.split(",");
for (String fkrId : fkrArray) {
ArrayList<Object> objects = new ArrayList<>(param);
objects.add(fkrId);
paramList.add(objects);
}
}
}
}

View File

@ -1,64 +0,0 @@
package weaver.formmode.recruit.departmentscreening;
import org.apache.commons.collections.CollectionUtils;
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.*;
/**
* <p>聚才林招聘</p>
* 部门筛选反馈数据删除更新/删除部门筛选数据
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class DeleteDeptScreeningFeedbackExpand extends AbstractModeExpandJavaCodeNew {
/**
* JCL_部门筛选(uf_jcl_bmsx)
*/
private static final String MODE_TABLE_NAME = "uf_jcl_bmsx";
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> dataMap = new HashMap<>();
for (Property property : properties) {
dataMap.put(property.getName(), property.getValue());
}
String bmsxid = Util.null2String(dataMap.get("bmsxid"));
String fkr = Util.null2String(dataMap.get("fkr"));
RecordSet rs = new RecordSet();
rs.executeQuery("select fkr from " + MODE_TABLE_NAME + " where id = ?", bmsxid);
if (rs.next()) {
String fkrStr = rs.getString("fkr");
List<String> strings = new ArrayList<>(Arrays.asList(fkrStr.split(",")));
strings.remove(fkr);
if (CollectionUtils.isEmpty(strings)) {
// 直接删除部门筛选数据
rs.executeUpdate("delete from " + MODE_TABLE_NAME + " where id = ?", bmsxid);
} else {
// 更新部门筛选数据的反馈人信息
rs.executeUpdate("update " + MODE_TABLE_NAME + " set fkr = ? where id = ?", StringUtils.join(strings, ","), bmsxid);
}
}
}
} catch (Exception e) {
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
}