明细表数据同步
This commit is contained in:
parent
9a57ee2794
commit
d08bd33f1f
|
|
@ -258,4 +258,31 @@ public class EmployeeRelationController {
|
|||
return actionMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工管理-删除表数据测试
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/deleteTableInfo")
|
||||
@WeaPermission(publicPermission = true)
|
||||
public Map<String, Object> deleteTableInfo(
|
||||
@RequestParam("tableName") String tableName,
|
||||
@RequestParam("deleteType") String deleteType,
|
||||
@RequestParam("id") String id){
|
||||
log.error("deleteTableInfo.tableName:{},id:{}", tableName,id);
|
||||
Map<String, Object> actionMap = new HashMap<>();
|
||||
// 根据表名查询所有字段
|
||||
List<Map<String, Object>> mapList = employeeRelationService.deleteTableInfo(tableName, deleteType,id);
|
||||
if(mapList.size()>0){
|
||||
log.error("deleteTableInfo.mapList:{}", mapList);
|
||||
actionMap.put("code","200");
|
||||
actionMap.put("msg","接口调用成功!");
|
||||
}else{
|
||||
actionMap.put("code","201");
|
||||
actionMap.put("msg","返回数据为空!");
|
||||
}
|
||||
actionMap.put("mapList",mapList);
|
||||
log.error("deleteTableInfo.actionMap:{}", actionMap);
|
||||
return actionMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.weaver.seconddev.jcl.organization.esb;
|
||||
|
||||
import cn.com.infosec.netsign.base.TransUtil;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.Gson;
|
||||
|
|
@ -24,6 +25,8 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
@ -58,6 +61,7 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
int code5 = 200;
|
||||
String ygxxid = null!=params.get("ygxxid")?String.valueOf(params.get("ygxxid").toString()):"";
|
||||
String glzzyg = null!=params.get("glzzyg")?String.valueOf(params.get("glzzyg").toString()):"";
|
||||
//String tenant_key = null!=params.get("tenant_key")?String.valueOf(params.get("tenant_key").toString()):"";
|
||||
log.error("SyncOrganizationPersonInfo.ygxxid : [{}].glzzyg:[{}]",ygxxid,glzzyg);
|
||||
SimpleEmployee employee = new SimpleEmployee();
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
|
@ -154,9 +158,7 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
employee_new.put("formdata",getIgnoreCase(employee_info, "id"));
|
||||
employee_new.put("status","normal");
|
||||
//状态字段换个对应
|
||||
employee_new.put("personnel_status",getIgnoreCase(employee_info, "personnel_status_jcl"));
|
||||
//学位字段
|
||||
employee_new.put("degree",getIgnoreCase(employee_info, "degreename"));
|
||||
employee_new.put("PERSONNEL_STATUS",getIgnoreCase(employee_info, "personnel_status_jcl"));
|
||||
//关联账号信息表
|
||||
employee_new.put("user_id",getIgnoreCase(employee_info, "id"));
|
||||
employee_new.put("create_time",nowData);
|
||||
|
|
@ -216,6 +218,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
//增加必填字段
|
||||
userInfo_new.put("USER", getIgnoreCase(employee_info, "id"));
|
||||
userInfo_new.put("FORM_DATA",getIgnoreCase(employee_info, "id"));
|
||||
//学位字段
|
||||
userInfo_new.put("DEGREE",containsKeyIgnoreCase(employee_info,"degreename")?getIgnoreCase(employee_info, "degreename"):null);
|
||||
userInfo_new.put("CREATE_TIME",nowData);
|
||||
userInfo_new.put("update_time",nowData);
|
||||
//插入
|
||||
|
|
@ -578,9 +582,16 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
*/
|
||||
public void updateAllYgxxDetailInfo(String ygxxid){
|
||||
log.error("updateAllYgxxDetailInfo.ygxxid:{}", ygxxid);
|
||||
//先删除原来记录
|
||||
String sql = "delete from hr_employment_record where USER_ID= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
//先查询表明有记录
|
||||
String str = "select * from hr_employment_record where USER_ID = '" + ygxxid + "' ";
|
||||
List<Map<String, Object>> strInfo = getYgxxDetailInfo(str);
|
||||
log.error("getYgxxDetailInfo.strInfo:{}", strInfo);
|
||||
//先删除原来记录(只能逻辑删除,更新时间也必须加上)
|
||||
String sql = "update hr_employment_record set delete_type = 1,update_time =? where USER_ID = ? ";
|
||||
List<String> paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
/**
|
||||
* 工作履历表
|
||||
* */
|
||||
|
|
@ -604,6 +615,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
gzllInfo_new.put("USER_ID",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
gzllInfo_new.put("ID",primarykey);
|
||||
//插入组织工作履历表
|
||||
cleanUpTime(gzllInfo_new);
|
||||
insert("hr_employment_record",gzllInfo_new);
|
||||
|
|
@ -611,9 +626,16 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
/**
|
||||
* 教育经历表
|
||||
* */
|
||||
//先查询表明有记录
|
||||
str = "select * from hr_education where employee_id = '" + ygxxid + "' ";
|
||||
List<Map<String, Object>> str2Info = getYgxxDetailInfo(str);
|
||||
log.error("getYgxxDetailInfo.str2Info:{}", str2Info);
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_education where employee_id= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_education set delete_type = 1,update_time =? where employee_id = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String jysql = "select * from uf_jcl_emp_jyjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> jyjlInfo = getYgxxDetailInfo(jysql);
|
||||
List<Map<String, Object>> jyjlColumns = getTableColumnsOfTableName("hr_education");
|
||||
|
|
@ -634,6 +656,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
jyjlInfo_new.put("employee_id",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
jyjlInfo_new.put("id",primarykey);
|
||||
//插入教育经历表
|
||||
cleanUpTime(jyjlInfo_new);
|
||||
insert("hr_education",jyjlInfo_new);
|
||||
|
|
@ -642,8 +668,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 家庭信息表
|
||||
* */
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_family where employee_id= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_family set delete_type = 1,update_time =? where employee_id = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String jtxxsql = "select * from uf_jcl_emp_jtxx where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> jtxxInfo = getYgxxDetailInfo(jtxxsql);
|
||||
List<Map<String, Object>> jtxxColumns = getTableColumnsOfTableName("hr_family");
|
||||
|
|
@ -664,6 +693,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
jtxxInfo_new.put("employee_id",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
jtxxInfo_new.put("id",primarykey);
|
||||
//插入家庭信息表
|
||||
cleanUpTime(jtxxInfo_new);
|
||||
insert("hr_family",jtxxInfo_new);
|
||||
|
|
@ -672,8 +705,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 表彰与奖励
|
||||
* */
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_rewards_before where Employeeid= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_rewards_before set delete_type = 1,update_time =? where Employeeid = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String bzsql = "select * from uf_jcl_emp_bzyjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> bzInfo = getYgxxDetailInfo(bzsql);
|
||||
List<Map<String, Object>> bzColumns = getTableColumnsOfTableName("hr_rewards_before");
|
||||
|
|
@ -694,6 +730,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
bzInfo_new.put("Employeeid",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
bzInfo_new.put("id",primarykey);
|
||||
//插入家庭信息表
|
||||
cleanUpTime(bzInfo_new);
|
||||
insert("hr_rewards_before",bzInfo_new);
|
||||
|
|
@ -702,8 +742,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 培训经历
|
||||
* */
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_train where employee_id= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_train set delete_type = 1,update_time =? where employee_id = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String pxsql = "select * from uf_jcl_emp_pxjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> pxInfo = getYgxxDetailInfo(pxsql);
|
||||
List<Map<String, Object>> pxColumns = getTableColumnsOfTableName("hr_train");
|
||||
|
|
@ -724,6 +767,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
pxInfo_new.put("employee_id",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
pxInfo_new.put("id",primarykey);
|
||||
//插入培训表
|
||||
cleanUpTime(pxInfo_new);
|
||||
insert("hr_train",pxInfo_new);
|
||||
|
|
@ -732,8 +779,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 语言能力
|
||||
* */
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_language where employee_id= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_language set delete_type = 1,update_time =? where employee_id = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String yysql = "select * from uf_jcl_emp_yynl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> yyInfo = getYgxxDetailInfo(yysql);
|
||||
List<Map<String, Object>> yyColumns = getTableColumnsOfTableName("hr_language");
|
||||
|
|
@ -754,6 +804,10 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
yyInfo_new.put("employee_id",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
yyInfo_new.put("id",primarykey);
|
||||
//插入培训表
|
||||
cleanUpTime(yyInfo_new);
|
||||
insert("hr_language",yyInfo_new);
|
||||
|
|
@ -762,8 +816,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 权威机构资格
|
||||
* */
|
||||
//先删除原来记录
|
||||
sql = "delete from hr_certification where employee_id= '" + ygxxid + "' and delete_type=0";
|
||||
deleteDetailData(sql);
|
||||
sql = "update hr_certification set delete_type = 1,update_time =? where employee_id = ? ";
|
||||
paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(ygxxid);
|
||||
deleteDetailData(sql,paramList);
|
||||
String qwsql = "select * from uf_jcl_emp_qwjgzgrz where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> qwInfo = getYgxxDetailInfo(qwsql);
|
||||
List<Map<String, Object>> qwColumns = getTableColumnsOfTableName("hr_certification");
|
||||
|
|
@ -784,12 +841,29 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
qwInfo_new.put("employee_id",ygxxid);
|
||||
}
|
||||
//跟换id值,然后主键冲突
|
||||
String primarykey = createPrimarykey();
|
||||
log.error("getYgxxDetailInfo.primarykey:{}", primarykey);
|
||||
qwInfo_new.put("id",primarykey);
|
||||
//插入权威机构表
|
||||
cleanUpTime(qwInfo_new);
|
||||
insert("hr_certification",qwInfo_new);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动生成eb表主键
|
||||
*/
|
||||
private String createPrimarykey(){
|
||||
SecureRandom random = new SecureRandom();
|
||||
long randomNumber = 0;
|
||||
// 生成一个18位的随机数
|
||||
do {
|
||||
// 生成一个18位随机数,范围从100000000000000000L到999999999999999999L
|
||||
randomNumber = 100000000000000000L + (long) (random.nextDouble() * 900000000000000000L);
|
||||
} while (randomNumber < 100000000000000000L || randomNumber > 999999999999999999L);
|
||||
return String.valueOf(randomNumber);
|
||||
}
|
||||
/**
|
||||
* 更新所有员工信息明细表
|
||||
* @return
|
||||
|
|
@ -799,6 +873,9 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
/**
|
||||
* 工作履历表
|
||||
* */
|
||||
//先删除原来记录
|
||||
String sql = "update hr_employment_record set delete_type = '1',update_time ='" + nowData + "' where USER_ID = '" + ygxxid + "' ";
|
||||
//deleteDetailData(sql);
|
||||
String gzsql = "select * from uf_jcl_emp_gzll where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0";
|
||||
List<Map<String, Object>> gzllInfo = getYgxxDetailInfo(gzsql);
|
||||
List<Map<String, Object>> gzllColumns = getTableColumnsOfTableName("hr_employment_record");
|
||||
|
|
@ -996,8 +1073,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
* 删除系统明细表数据
|
||||
* @return
|
||||
*/
|
||||
public void deleteDetailData(String sql){
|
||||
log.error("deleteDetailData.sql:{}", sql);
|
||||
public void deleteDetailData(String sql,List<String> paramList){
|
||||
log.error("deleteDetailData.sql:{},paramList:{}", sql, paramList);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
log.error("deleteDetailData.recordList:{}", recordList);
|
||||
|
|
|
|||
|
|
@ -24,4 +24,6 @@ public interface EmployeeRelationService {
|
|||
Map<String, Object> updateEmployeeColumns(String id,String glzzid);
|
||||
|
||||
Map<String, Object> checkMappingCum(String id);
|
||||
|
||||
List<Map<String, Object>> deleteTableInfo(String tableName,String deleteType,String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import com.weaver.ebuilder.coms.sdk.biz.QueryFilterBiz;
|
|||
import com.weaver.ebuilder.datasource.api.query.DwQueryBuilder;
|
||||
import com.weaver.ebuilder.datasource.api.query.dto.dw.ConditionTreeDto;
|
||||
import com.weaver.ebuilder.datasource.api.query.dto.dw.QueryDto;
|
||||
import com.weaver.ebuilder.form.base.parser.condition.EbuilderConditionBuilder;
|
||||
//import com.weaver.ebuilder.form.base.parser.condition.EbuilderConditionBuilder;
|
||||
import com.weaver.ebuilder.form.client.entity.field.ModuleField;
|
||||
import com.weaver.ebuilder.form.common.entity.approval.enums.ApprovalField;
|
||||
import com.weaver.form.controller.FormBaseController;
|
||||
|
|
@ -74,8 +74,8 @@ public class EmployeeInformationServiceImpl implements EmployeeInformationServic
|
|||
private FormFieldManageController fieldManageController;
|
||||
@Autowired
|
||||
private FormAuthenticationService formAuthenticationService;
|
||||
@Autowired
|
||||
private EbuilderConditionBuilder ebuilderConditionBuilder;
|
||||
// @Autowired
|
||||
// private EbuilderConditionBuilder ebuilderConditionBuilder;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getInformation(Employee employee) {
|
||||
|
|
@ -499,69 +499,69 @@ public class EmployeeInformationServiceImpl implements EmployeeInformationServic
|
|||
|
||||
@Override
|
||||
public Map<String, Object> queryData(SimpleEmployee simpleEmployee) {
|
||||
Map<String,Object> resultMap = Maps.newHashMap();
|
||||
String sql = "select id,app_id,form_id from ebdf_obj where table_name='uf_jcl_employee_information' and delete_type='0'";
|
||||
List<Map<String, Object>> recordList = databaseUtils.getSqlList(sql);
|
||||
String objId = CommonUtils.null2String(recordList.get(0).get("id"));
|
||||
String appId = CommonUtils.null2String(recordList.get(0).get("appId"));
|
||||
String formId = CommonUtils.null2String(recordList.get(0).get("form_id"));
|
||||
sql ="select id from ebdf_list where obj_id=? and name=? and delete_type='0' and (isdelete is null or isdelete='0')";
|
||||
List<Map<String, Object>> ebdfList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(objId,Constants.SET_BY_LIST));
|
||||
if (ebdfList.size() == 0){
|
||||
return resultMap;
|
||||
}
|
||||
String listId = CommonUtils.null2String(ebdfList.get(0));
|
||||
sql="select b.id,b.data_key,b.title,b.form_id,b.sub_form_id from form_field b left join ebdf_list_field a on a.field_id=b.id where a.list_id=? and a.delete_type='0' and (a.ismobile is null or a.ismobile='0') ";
|
||||
List<Map<String, Object>> dataList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(listId));
|
||||
Map<String,List<Map<String, Object>>> fieldMap = dataList.stream().collect(Collectors.groupingBy(e->CommonUtils.null2String(e.get("sub_form_id")).equals("")?e.get("form_id").toString():e.get("sub_form_id").toString()));
|
||||
List<String> list = Lists.newArrayList();
|
||||
for (Map.Entry<String,List<Map<String, Object>>> entry:fieldMap.entrySet()){
|
||||
list.add("'"+entry.getKey()+"'");
|
||||
}
|
||||
sql = "select form_id,table_name from form_table where form_id in ("+String.join(",",list)+")";
|
||||
List<Map<String, Object>> formTableList = databaseUtils.getSqlList(sql);
|
||||
//表id-表名
|
||||
Map<String, String> formTableMap =formTableList.stream().collect(Collectors.toMap(e->e.get("form_id").toString(),e->e.get("table_name").toString()));
|
||||
|
||||
sql = "select sxtj from uf_jcl_querycondition where ry=?";
|
||||
List<Map<String, Object>> conditionList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(String.valueOf(simpleEmployee.getId())));
|
||||
String conditionSql = "";
|
||||
if (conditionList.size() > 0){
|
||||
String sxtj = CommonUtils.null2String(conditionList.get(0).get("sxtj"));
|
||||
log.error("sxtj : "+sxtj);
|
||||
if (!sxtj.equals("")){
|
||||
|
||||
Map<String, Object> objInfosMap = new HashMap<>();
|
||||
Map<Long, Map<String, ModuleField>> objIdFieldIdFieldMap = new HashMap<>();
|
||||
List<ModuleField> fields = new ArrayList<>();
|
||||
for (ApprovalField approvalField : ApprovalField.values()) {
|
||||
ModuleField field = new ModuleField();
|
||||
field.setFieldId(approvalField.getFieldId());
|
||||
field.setFieldName(approvalField.getFieldName());
|
||||
field.setFieldColumn(approvalField.getFieldId());
|
||||
field.setFieldType(approvalField.getFieldType());
|
||||
field.setMultiSelect(false);
|
||||
fields.add(field);
|
||||
}
|
||||
Map<String, ModuleField> fieldIdFieldMap = new HashMap<>();
|
||||
for (ModuleField field : fields) {
|
||||
fieldIdFieldMap.put(field.getFieldId(), field);
|
||||
}
|
||||
objIdFieldIdFieldMap.put(-1L, fieldIdFieldMap);
|
||||
objInfosMap.put("objIdFieldIdFieldMap", objIdFieldIdFieldMap);
|
||||
|
||||
Gson gson = new Gson();
|
||||
Map<String,Object> filters = gson.fromJson(sxtj,Map.class);
|
||||
Map<String, Object> filterTree = QueryFilterBiz.analysisConfigFilter(filters, null);
|
||||
ConditionTreeDto conditionTreeDto = DwQueryBuilder.conditions(new JSONObject(filterTree), new ArrayList<>());
|
||||
com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto conditionDto = new com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto();
|
||||
String json = JSON.toJSONString(conditionTreeDto);
|
||||
conditionDto = JSON.parseObject(json, com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto.class);
|
||||
conditionSql = ebuilderConditionBuilder.getConditionSql(TenantRpcContext.getTenantKey(), null, "", -1L, objInfosMap, conditionDto);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// Map<String,Object> resultMap = Maps.newHashMap();
|
||||
// String sql = "select id,app_id,form_id from ebdf_obj where table_name='uf_jcl_employee_information' and delete_type='0'";
|
||||
// List<Map<String, Object>> recordList = databaseUtils.getSqlList(sql);
|
||||
// String objId = CommonUtils.null2String(recordList.get(0).get("id"));
|
||||
// String appId = CommonUtils.null2String(recordList.get(0).get("appId"));
|
||||
// String formId = CommonUtils.null2String(recordList.get(0).get("form_id"));
|
||||
// sql ="select id from ebdf_list where obj_id=? and name=? and delete_type='0' and (isdelete is null or isdelete='0')";
|
||||
// List<Map<String, Object>> ebdfList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(objId,Constants.SET_BY_LIST));
|
||||
// if (ebdfList.size() == 0){
|
||||
// return resultMap;
|
||||
// }
|
||||
// String listId = CommonUtils.null2String(ebdfList.get(0));
|
||||
// sql="select b.id,b.data_key,b.title,b.form_id,b.sub_form_id from form_field b left join ebdf_list_field a on a.field_id=b.id where a.list_id=? and a.delete_type='0' and (a.ismobile is null or a.ismobile='0') ";
|
||||
// List<Map<String, Object>> dataList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(listId));
|
||||
// Map<String,List<Map<String, Object>>> fieldMap = dataList.stream().collect(Collectors.groupingBy(e->CommonUtils.null2String(e.get("sub_form_id")).equals("")?e.get("form_id").toString():e.get("sub_form_id").toString()));
|
||||
// List<String> list = Lists.newArrayList();
|
||||
// for (Map.Entry<String,List<Map<String, Object>>> entry:fieldMap.entrySet()){
|
||||
// list.add("'"+entry.getKey()+"'");
|
||||
// }
|
||||
// sql = "select form_id,table_name from form_table where form_id in ("+String.join(",",list)+")";
|
||||
// List<Map<String, Object>> formTableList = databaseUtils.getSqlList(sql);
|
||||
// //表id-表名
|
||||
// Map<String, String> formTableMap =formTableList.stream().collect(Collectors.toMap(e->e.get("form_id").toString(),e->e.get("table_name").toString()));
|
||||
//
|
||||
// sql = "select sxtj from uf_jcl_querycondition where ry=?";
|
||||
// List<Map<String, Object>> conditionList = databaseUtils.getSqlList(sql,CommonUtils.getParamList(String.valueOf(simpleEmployee.getId())));
|
||||
// String conditionSql = "";
|
||||
// if (conditionList.size() > 0){
|
||||
// String sxtj = CommonUtils.null2String(conditionList.get(0).get("sxtj"));
|
||||
// log.error("sxtj : "+sxtj);
|
||||
// if (!sxtj.equals("")){
|
||||
//
|
||||
// Map<String, Object> objInfosMap = new HashMap<>();
|
||||
// Map<Long, Map<String, ModuleField>> objIdFieldIdFieldMap = new HashMap<>();
|
||||
// List<ModuleField> fields = new ArrayList<>();
|
||||
// for (ApprovalField approvalField : ApprovalField.values()) {
|
||||
// ModuleField field = new ModuleField();
|
||||
// field.setFieldId(approvalField.getFieldId());
|
||||
// field.setFieldName(approvalField.getFieldName());
|
||||
// field.setFieldColumn(approvalField.getFieldId());
|
||||
// field.setFieldType(approvalField.getFieldType());
|
||||
// field.setMultiSelect(false);
|
||||
// fields.add(field);
|
||||
// }
|
||||
// Map<String, ModuleField> fieldIdFieldMap = new HashMap<>();
|
||||
// for (ModuleField field : fields) {
|
||||
// fieldIdFieldMap.put(field.getFieldId(), field);
|
||||
// }
|
||||
// objIdFieldIdFieldMap.put(-1L, fieldIdFieldMap);
|
||||
// objInfosMap.put("objIdFieldIdFieldMap", objIdFieldIdFieldMap);
|
||||
//
|
||||
// Gson gson = new Gson();
|
||||
// Map<String,Object> filters = gson.fromJson(sxtj,Map.class);
|
||||
// Map<String, Object> filterTree = QueryFilterBiz.analysisConfigFilter(filters, null);
|
||||
// ConditionTreeDto conditionTreeDto = DwQueryBuilder.conditions(new JSONObject(filterTree), new ArrayList<>());
|
||||
// com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto conditionDto = new com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto();
|
||||
// String json = JSON.toJSONString(conditionTreeDto);
|
||||
// conditionDto = JSON.parseObject(json, com.weaver.ebuilder.teams.etform.base.query.ConditionTreeDto.class);
|
||||
// conditionSql = ebuilderConditionBuilder.getConditionSql(TenantRpcContext.getTenantKey(), null, "", -1L, objInfosMap, conditionDto);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -543,6 +543,28 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
|||
userInfo_new.put("listOfUserInfoColumns",listOfUserInfoColumns);
|
||||
return userInfo_new;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> deleteTableInfo(String tableName, String deleteType,String id) {
|
||||
//String sql = "delete from "+ tableName+ " where id = = '" + id + "' ";
|
||||
// 获取当前时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 定义日期时间格式化器
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 格式化当前日期
|
||||
String nowData = now.format(formatter);
|
||||
//String sql = "update "+ tableName+ " set delete_type = 1 ,update_time ='" + nowData + "' where id = '" + id + "' and tenant_key = 't7n9jpeaoa' ";
|
||||
String sql = "update hr_employment_record set delete_type = 1,update_time =? where USER_ID = ? ";
|
||||
log.error("deleteTableInfo.sql:{}",sql);
|
||||
List<String> paramList = new ArrayList<>();
|
||||
paramList.add(nowData);
|
||||
paramList.add(id);
|
||||
log.error("deleteTableInfo.paramList:{}",paramList);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getSqlList(sql,paramList);
|
||||
log.error("deleteTableInfo.recordList:{}",recordList);
|
||||
return recordList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得key名映射
|
||||
* @return
|
||||
|
|
|
|||
Loading…
Reference in New Issue