#E10人事自助门户-生日人员接口新增hid,用户类型改为配置取grouoid

main
wangjie 1 year ago
parent 4e868d7d8b
commit 38c9b842a9

@ -8,6 +8,7 @@ import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
import com.weaver.seconddev.jcldoor.util.CommonUtils;
import com.weaver.seconddev.jcldoor.util.DatabaseUtils;
import com.weaver.teams.domain.user.SimpleEmployee;
import com.weaver.teams.security.context.UserContext;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -42,6 +43,7 @@ public class PortalBirthdayWishesCmd {
public Map<String, Object> getInfo(HttpServletRequest request, SimpleEmployee simpleEmployee) {
Map<String, Object> result = new HashMap<>(100);
JSONArray list = new JSONArray();
String hid = getHid();
try {
String groupId = "weaver-hr-service";
@ -112,6 +114,7 @@ public class PortalBirthdayWishesCmd {
}
result.put("list",list);
result.put("hid",hid);
return result;
}
@ -138,4 +141,88 @@ public class PortalBirthdayWishesCmd {
return sex;
}
public String getHid() {
String hid = "";
String groupId = "weaver-hr-service";
String sourceType = "LOGIC";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
String nowDay = sdf.format(new Date());
SimpleEmployee employee = UserContext.getCurrentUser();
long formdata = employee.getFormdata();
String tip_id = "";
String sql = " select id " +
" from hr_tip\n" +
" where TIP_TYPE='birthday'\n" +
" and TENANT_KEY='t7akvdnf84'\n" +
" and DELETE_TYPE='0' ";
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
if (recordList.size() > 0) {
Map<String, Object> recordMap = recordList.get(0);
tip_id = String.valueOf(recordMap.get("id"));
}
String tip_target_id = "";
if (StringUtils.isNotBlank(tip_id)) {
sql = " select id from hr_tip_target \n" +
" where TIP_ID = ? \n" +
" and TARGET_TYPE='colleague' \n" +
" and tip_time_type='sameDay' ";
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(tip_id);
sqlparam.add(sqlParamEntity);
Map<String, Object> result2 = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
List<Map<String, Object>> recordList2 = databaseUtils.getDataSourceList(result2);
if (recordList2.size() > 0) {
Map<String, Object> recordMap = recordList2.get(0);
tip_target_id = String.valueOf(recordMap.get("id"));
}
}
if (StringUtils.isNotBlank(tip_id) && StringUtils.isNotBlank(tip_target_id)) {
sql = " select id \n" +
" from hr_tip_send_history\n" +
" where history_date = ? \n" +
" and tip_id = ? \n" +
" and tip_target_id= ? \n" +
" order by create_time desc " +
" limit 1 ";
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(nowDay);
sqlparam.add(sqlParamEntity);
sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(tip_id);
sqlparam.add(sqlParamEntity);
sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(tip_target_id);
sqlparam.add(sqlParamEntity);
Map<String, Object> result3 = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
List<Map<String, Object>> recordList3 = databaseUtils.getDataSourceList(result3);
if (recordList3.size() > 0) {
Map<String, Object> recordMap = recordList3.get(0);
hid = String.valueOf(recordMap.get("id"));
}
}
}catch (Exception e){
log.error("getHid Exception"+e.getMessage());
}
return hid;
}
}

@ -5,6 +5,7 @@ import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
import com.weaver.framework.rpc.annotation.RpcReference;
import com.weaver.seconddev.jcldoor.util.CommonUtils;
import com.weaver.seconddev.jcldoor.util.DatabaseUtils;
import com.weaver.seconddev.jcldoor.util.JucailinPortalUtils;
import com.weaver.teams.client.doc.remote.DocClientService;
import com.weaver.teams.domain.user.SimpleEmployee;
import com.weaver.teams.security.context.UserContext;
@ -43,6 +44,11 @@ public class UserInfoCmd {
@RpcReference(group = "workflow")
WflRequestListRest wflRequestListRest;
@Autowired
private JucailinPortalUtils jucailinPortalUtils;
public String tenant_key = "t7akvdnf84" ;
/**
* -:478:80:128:128:239:439
*
@ -248,7 +254,10 @@ public class UserInfoCmd {
log.error("employee:"+employee.getEmployeeId());
long formdata = employee.getFormdata();
String groupId = "weaver-ebuilder-form-service";
// String groupId = "weaver-ebuilder-form-service";
String pkey = "field69.groupId";
//weaver-ebuilder-form-service
String groupId = jucailinPortalUtils.getUfPropData(pkey,tenant_key);
String sourceType = "LOGIC";
String sql =" select field69,field69_obj from eteams.Hrmemployeedefined where form_data_id='"+formdata+"'" ;

@ -906,7 +906,10 @@ public class WorkDataCmd {
log.error("employee:"+employee.getEmployeeId());
long formdata = employee.getFormdata();
String groupId = "weaver-ebuilder-form-service";
// String groupId = "weaver-ebuilder-form-service";
String pkey = "field69.groupId";
//weaver-ebuilder-form-service
String groupId = jucailinPortalUtils.getUfPropData(pkey,tenant_key);
String sourceType = "LOGIC";
String sql =" select field69,field69_obj from eteams.Hrmemployeedefined where form_data_id='"+formdata+"'" ;

Loading…
Cancel
Save