去除租户id条件
This commit is contained in:
parent
8c19bfeae0
commit
a81db8bb63
|
|
@ -187,4 +187,28 @@ public class EmployeeRelationController {
|
|||
return actionMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 员工管理-获取员工信息表和系统表字段
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getEmployeeColumns")
|
||||
@WeaPermission(publicPermission = true)
|
||||
public Map<String, Object> getEmployeeColumns(){
|
||||
Map<String, Object> actionMap = new HashMap<>();
|
||||
// 根据表名查询所有字段
|
||||
Map<String, Object> mapList = employeeRelationService.getEmployeeColumns();
|
||||
if(mapList.size()>0){
|
||||
log.error("getTableColumns.mapList:{}", mapList);
|
||||
actionMap.put("code","200");
|
||||
actionMap.put("msg","接口调用成功!");
|
||||
}else{
|
||||
actionMap.put("code","201");
|
||||
actionMap.put("msg","返回数据为空!");
|
||||
}
|
||||
actionMap.put("mapList",mapList);
|
||||
log.error("getTableColumns.actionMap:{}", actionMap);
|
||||
return actionMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ public class SynAllEmployeeInfoAction implements EsbServerlessRpcRemoteInterface
|
|||
}
|
||||
|
||||
public List<Map<String, Object>> queryEmployeesInfo() {
|
||||
String sql=" SELECT id,birthDate,first_work_date,hiredate,age,work_year,sl from uf_jcl_employee_information where delete_type=0 and TENANT_KEY='t7n9jpeaoa' " ;
|
||||
String sql=" SELECT id,birthDate,first_work_date,hiredate,age,work_year,sl from uf_jcl_employee_information where delete_type=0 " ;
|
||||
log.error("queryEmployeesInfo.sql:{}",sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
|
|
@ -90,7 +90,7 @@ public class SynAllEmployeeInfoAction implements EsbServerlessRpcRemoteInterface
|
|||
String firstWorkDateString = (String) objectMap.get("work_year");
|
||||
String joinDateString = (String) objectMap.get("sl");
|
||||
String sql = "update uf_jcl_employee_information set age = '" + birthDateString + "',work_year = '" + firstWorkDateString + "',sl = '" + joinDateString + "'" +
|
||||
" where id = '" + id + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where id = '" + id + "' and delete_type=0 ";
|
||||
log.error("updateEmployeesInfo.sql:{}", sql);
|
||||
rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
log.error("updateEmployeesInfo.rs:{}", rs);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class SynEmployeeAgeGlSlInfoAction implements EsbServerlessRpcRemoteInter
|
|||
}
|
||||
|
||||
public List<Map<String, Object>> queryEmployeesInfo() {
|
||||
String sql=" SELECT id,birthDate,first_work_date,hiredate,age,work_year,sl from uf_jcl_employee_information where delete_type=0 and TENANT_KEY='t7n9jpeaoa' " ;
|
||||
String sql=" SELECT id,birthDate,first_work_date,hiredate,age,work_year,sl from uf_jcl_employee_information where delete_type=0 " ;
|
||||
log.error("queryEmployeesInfo.sql:{}",sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
|
|
@ -87,7 +87,7 @@ public class SynEmployeeAgeGlSlInfoAction implements EsbServerlessRpcRemoteInter
|
|||
String firstWorkDateString = (String) objectMap.get("work_year");
|
||||
String joinDateString = (String) objectMap.get("sl");
|
||||
String sql = "update uf_jcl_employee_information set age = '" + birthDateString + "',work_year = '" + firstWorkDateString + "',sl = '" + joinDateString + "'" +
|
||||
" where id = '" + id + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where id = '" + id + "' and delete_type=0 ";
|
||||
log.error("updateEmployeesInfo.sql:{}", sql);
|
||||
rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
log.error("updateEmployeesInfo.rs:{}", rs);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class UpdateFileYgddInfoAction implements EsbServerlessRpcRemoteInterface
|
|||
}
|
||||
|
||||
public List<Map<String, Object>> queryYgddInfo(String requestId) {
|
||||
String sql=" SELECT * from uf_jcl_rydd where id = '" + requestId + "' and delete_type=0 and TENANT_KEY='t7n9jpeaoa' " ;
|
||||
String sql=" SELECT * from uf_jcl_rydd where id = '" + requestId + "' and delete_type=0 " ;
|
||||
log.error("queryYgddInfo222.sql:{}",sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
|
|
@ -60,7 +60,7 @@ public class UpdateFileYgddInfoAction implements EsbServerlessRpcRemoteInterface
|
|||
if (isTodayOrBefore(ddsxrq)) {
|
||||
//更新数据到员工基础信息表
|
||||
String sql = "update eteams.employee set department = '" + ddhbm + "',POSITION = '" + ddhgw + "',SUPERIOR = '" + ddhzjsj + "'" +
|
||||
" where id = '" + ddr + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where id = '" + ddr + "' and delete_type=0 ";
|
||||
log.error("UpdateYgddInfoAction222.sql:{}", sql);
|
||||
rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
log.error("UpdateYgddInfoAction222.rs:{}", rs);
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@ public class UpdateGlzzygidAction implements EsbServerlessRpcRemoteInterface {
|
|||
String str = "";
|
||||
int flag = 0;
|
||||
if(StringUtils.isNotBlank(sfzhm)){
|
||||
sql=" SELECT user from hr_userinfo where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and ID_NO = '" + sfzhm + "'" ;
|
||||
sql=" SELECT user from hr_userinfo where delete_type=0 and ID_NO = '" + sfzhm + "'" ;
|
||||
}else if(StringUtils.isNotBlank(sjh)){
|
||||
sql=" select id from eteams.employee where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and mobile = '" + sjh + "'" ;
|
||||
sql=" select id from eteams.employee where delete_type=0 and mobile = '" + sjh + "'" ;
|
||||
flag = 1;
|
||||
}else if(StringUtils.isNotBlank(yx)){
|
||||
sql=" select id from eteams.employee where delete_type=0 and TENANT_KEY='t7n9jpeaoa' and email = '" + yx + "'" ;
|
||||
sql=" select id from eteams.employee where delete_type=0 and email = '" + yx + "'" ;
|
||||
flag = 2;
|
||||
}else{
|
||||
return rs;
|
||||
|
|
@ -70,13 +70,13 @@ public class UpdateGlzzygidAction implements EsbServerlessRpcRemoteInterface {
|
|||
//更新员工信息表
|
||||
if(flag==0){
|
||||
str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" +
|
||||
" where id_no = '" + sfzhm + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where id_no = '" + sfzhm + "' and delete_type=0 ";
|
||||
}else if(flag==1) {
|
||||
str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" +
|
||||
" where mobile = '" + sjh + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where mobile = '" + sjh + "' and delete_type=0 ";
|
||||
}else {
|
||||
str = "update uf_jcl_employee_information set glzzyg = '" + userId + "'" +
|
||||
" where email = '" + yx + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where email = '" + yx + "' and delete_type=0 ";
|
||||
}
|
||||
log.error("queryEmployeeInfoBySfz.sql:{}",str);
|
||||
rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", str);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class UpdateYgddInfoAction implements EsbServerlessRpcRemoteInterface {
|
|||
}
|
||||
|
||||
public List<Map<String, Object>> queryYgddInfo() {
|
||||
String sql=" SELECT * from uf_jcl_rydd where delete_type=0 and TENANT_KEY='t7n9jpeaoa' " ;
|
||||
String sql=" SELECT * from uf_jcl_rydd where delete_type=0 " ;
|
||||
log.error("queryYgddInfo.sql:{}",sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
|
|
@ -60,7 +60,7 @@ public class UpdateYgddInfoAction implements EsbServerlessRpcRemoteInterface {
|
|||
if (isToday(ddsxrq)||"3".equals(status)) {
|
||||
//更新数据到员工基础信息表
|
||||
String sql = "update eteams.employee set department = '" + ddhbm + "',POSITION = '" + ddhgw + "',SUPERIOR = '" + ddhzjsj + "'" +
|
||||
" where id = '" + ddr + "' and TENANT_KEY = 't7n9jpeaoa' and delete_type=0 ";
|
||||
" where id = '" + ddr + "' and delete_type=0 ";
|
||||
log.error("UpdateYgddInfoAction.sql:{}", sql);
|
||||
rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
log.error("UpdateYgddInfoAction.rs:{}", rs);
|
||||
|
|
|
|||
|
|
@ -18,4 +18,6 @@ public interface EmployeeRelationService {
|
|||
String getFormField(String formId,String fieldId,String title);
|
||||
|
||||
boolean queryIsNotHaveScanTheCodeInfo(String mobile,String email,String identity);
|
||||
|
||||
Map<String, Object> getEmployeeColumns();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.weaver.seconddev.jcl.organization.service.impl;
|
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.weaver.ebuilder.datasource.api.conn.RecordDataSource;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.common.form.metadata.ModuleSource;
|
||||
import com.weaver.common.form.param.FieldManageParam;
|
||||
import com.weaver.ebuilder.datasource.api.conn.WeaverConnection;
|
||||
import com.weaver.ebuilder.form.client.entity.field.FieldsQueryDto;
|
||||
import com.weaver.ebuilder.form.client.entity.field.ModuleField;
|
||||
|
|
@ -9,7 +11,11 @@ import com.weaver.ebuilder.form.client.service.emobile.IEtFormDatasetService;
|
|||
import com.weaver.ebuilder.teams.etform.org.bean.EBSimpleEmployee;
|
||||
import com.weaver.seconddev.jcl.organization.controller.EmployeeRelationController;
|
||||
import com.weaver.seconddev.jcl.organization.service.EmployeeRelationService;
|
||||
import com.weaver.seconddev.jcl.organization.util.CommonUtils;
|
||||
import com.weaver.seconddev.jcl.organization.util.Constants;
|
||||
import com.weaver.seconddev.jcl.organization.util.DatabaseUtils;
|
||||
import com.weaver.teams.domain.user.SimpleEmployee;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -17,10 +23,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
||||
|
|
@ -31,6 +38,8 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
|||
private DatabaseUtils databaseUtils;
|
||||
@Autowired
|
||||
private IEtFormDatasetService etFormDataSetService;
|
||||
@Autowired
|
||||
private EmployeeInformationServiceImpl employeeInformationService;
|
||||
|
||||
|
||||
@Override
|
||||
|
|
@ -51,7 +60,7 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
String sql = "select id from uf_jcl_employee_information where id_no ='" + identity + "' and IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' and sfjrhmd = 1 ";
|
||||
String sql = "select id from uf_jcl_employee_information where id_no ='" + identity + "' and IS_DELETE = 0 and delete_type = 0 and sfjrhmd = 1 ";
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
log.error("queryLeaderPdByYear.recordList:{}", recordList);
|
||||
|
|
@ -133,7 +142,7 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
|||
if (StringUtils.isBlank(identity)&&StringUtils.isBlank(mobile)&&StringUtils.isBlank(email)) {
|
||||
flag = false;
|
||||
}else{
|
||||
String sql = "select id from uf_jcl_rzgl where IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' and (";
|
||||
String sql = "select id from uf_jcl_rzgl where IS_DELETE = 0 and delete_type = 0 and (";
|
||||
if (StringUtils.isNotBlank(identity)) {
|
||||
sql += " sfz_1mhf = '" + identity+ "' or";
|
||||
log.error("queryIsNotHaveScanTheCodeInfo.identity:{}", sql);
|
||||
|
|
@ -157,6 +166,78 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
|
|||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getEmployeeColumns() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String sql = "select form_id from form_table where table_name=? and delete_type='0'";
|
||||
List<String> paramList = Lists.newArrayList();
|
||||
paramList.add(Constants.EMPLOYEE_INFORMATION);
|
||||
String employee_form_id = CommonUtils.null2String(databaseUtils.getSqlList(sql,paramList).get(0).get("form_id"));
|
||||
log.error("employee_form_id : [{}]",employee_form_id);
|
||||
|
||||
sql = "select id,module from FORM where module='hrm' and ownership='personal'";
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> personFormList = databaseUtils.getDataSourceList(rs);
|
||||
log.error("getEmployeeColumns.personFormList:{}", personFormList);
|
||||
|
||||
//基本信息自定义字段表
|
||||
String personCustomfieldFormid=(String)personFormList.get(0).get("hrm");
|
||||
log.error("getEmployeeColumns.personCustomfieldFormid:{}", personCustomfieldFormid);
|
||||
|
||||
|
||||
List<String> formIdParamList = Lists.newArrayList();
|
||||
formIdParamList.add(employee_form_id);
|
||||
sql = "select id,group_name from form_field_group where form_id='" + employee_form_id + "' and delete_type='0'";
|
||||
Map<String, Object> rs2 = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> fieldGroupList = databaseUtils.getDataSourceList(rs2);
|
||||
log.error("getEmployeeColumns.fieldGroupList:{}", fieldGroupList);
|
||||
|
||||
Map<String,String> fieldGroup = fieldGroupList.stream().collect(Collectors.toMap(e->e.get("group_name").toString(),e->e.get("id").toString()));
|
||||
formIdParamList.add(personCustomfieldFormid);
|
||||
|
||||
/**
|
||||
* 员工信息表所有字段
|
||||
*/
|
||||
log.error("employeeInformationService : [{}]",employeeInformationService);
|
||||
FieldManageParam ownEntity = getFieldManageParam(employee_form_id, ModuleSource.ebuilderform);
|
||||
List<Map<Object, Object>> employeeFieldList = employeeInformationService.getFieldList(ownEntity,new SimpleEmployee());
|
||||
log.error("employeeFieldList : [{}]",employeeFieldList);
|
||||
//员工信息主表-基本信息字段
|
||||
List<Map<Object, Object>> mainFormBasicFieldList = employeeFieldList.stream().filter(e->fieldGroup.get(Constants.BASIC_INFORMATION).equals(e.get("groupId")) && "".equals(CommonUtils.null2String(e.get("subFormId")))).collect(Collectors.toList());
|
||||
//员工信息主表-账户信息字段
|
||||
List<Map<Object, Object>> mainFormAccountFieldList = employeeFieldList.stream().filter(e->fieldGroup.get(Constants.ACCOUNT_INFORMATION).equals(e.get("groupId")) && "".equals(CommonUtils.null2String(e.get("subFormId")))).collect(Collectors.toList());
|
||||
//员工信息主表-个人信息字段
|
||||
List<Map<Object, Object>> mainFormPersonFieldList = employeeFieldList.stream().filter(e->fieldGroup.get(Constants.PERSONAL_INFORMATION).equals(e.get("groupId")) && "".equals(CommonUtils.null2String(e.get("subFormId")))).collect(Collectors.toList());
|
||||
log.error("mainFormBasicFieldList : [{}]",mainFormBasicFieldList);
|
||||
/**
|
||||
* 人力资源-基本信息自定义字段
|
||||
*/
|
||||
FieldManageParam personCustomEntity = getFieldManageParam(personCustomfieldFormid,ModuleSource.hrm);
|
||||
log.error("personCustomEntity : [{}]",personCustomEntity);
|
||||
|
||||
List<Map<Object, Object>> personCustomFieldList = employeeInformationService.getFieldList(personCustomEntity,new SimpleEmployee());
|
||||
List<Map<Object, Object>> customFieldList = personCustomFieldList.stream().filter(e->!e.get("componentKey").equals("BaseField")).collect(Collectors.toList());
|
||||
|
||||
result.put("fieldGroupList",fieldGroupList);
|
||||
result.put("formIdParamList",formIdParamList);
|
||||
result.put("mainFormBasicFieldList",mainFormBasicFieldList);
|
||||
result.put("mainFormAccountFieldList",mainFormAccountFieldList);
|
||||
result.put("mainFormPersonFieldList",mainFormPersonFieldList);
|
||||
result.put("personCustomFieldList",personCustomFieldList);
|
||||
result.put("customFieldList",customFieldList);
|
||||
log.error("result : [{}]",result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private FieldManageParam getFieldManageParam(String formid,ModuleSource moduleSource){
|
||||
FieldManageParam entity = new FieldManageParam();
|
||||
entity.setFormId(Long.valueOf(formid));
|
||||
entity.setModule(moduleSource);
|
||||
entity.setNeedDataCount(true);
|
||||
entity.setNeedPanelField(true);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
private void GetTableAlterStatements() {
|
||||
//1.获取连接池实例
|
||||
|
|
|
|||
Loading…
Reference in New Issue