#E10-29# 更新群聊及每天沟通的状态

main
shilei 1 year ago
parent af500f63d7
commit 7dd7f35407

@ -985,353 +985,353 @@ public class HrmSelfHelpController {
// } // }
@GetMapping("/testSapi80") // @GetMapping("/testSapi80")
@WeaPermission(publicPermission = true) // @WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi80(HttpServletRequest request){ // public WeaResult<Object> testSapi80(HttpServletRequest request){
//
log.error("testSapi80"); // log.error("testSapi80");
//
String pkey = "uf_zzfwcsh.taby.fieldId"; // String pkey = "uf_zzfwcsh.taby.fieldId";
String field_id = jucailinPortalUtils.getUfPropData(pkey,tenant_key); // String field_id = jucailinPortalUtils.getUfPropData(pkey,tenant_key);
log.error("field_id:"+field_id); // log.error("field_id:"+field_id);
//
String groupId = "weaver-ebuilder-form-service"; // String groupId = "weaver-ebuilder-form-service";
String sourceType = "LOGIC"; // String sourceType = "LOGIC";
//
String employeeId = request.getParameter("employeeId"); // String employeeId = request.getParameter("employeeId");
//
if(StringUtils.isBlank(employeeId)){ // if(StringUtils.isBlank(employeeId)){
employeeId = String.valueOf(UserContext.getCurrentEmployeeId()); // employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
} // }
//
List<Map<String,Object>> dataList = new ArrayList<Map<String,Object>>(); // List<Map<String,Object>> dataList = new ArrayList<Map<String,Object>>();
try{ // try{
//
if(StringUtils.isNotBlank(field_id)){ // if(StringUtils.isNotBlank(field_id)){
String sql = " select distinct taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and delete_type=0 and tenant_key ='"+tenant_key+"'"; // String sql = " select distinct taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and delete_type=0 and tenant_key ='"+tenant_key+"'";
log.error("sql:"+sql); // log.error("sql:"+sql);
//
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>(); // List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity(); // SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(employeeId); // sqlParamEntity.setValue(employeeId);
sqlparam.add(sqlParamEntity); // sqlparam.add(sqlParamEntity);
//
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); // Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result); // List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
if(recordList.size()>0){ // if(recordList.size()>0){
// /api/file/preview?type=redirect&imgFormat=small&fileId=977697615197618177&module=ebuilderform&authModule=ebuilderform&source=form&fieldId=977686869110833154&customParam=%7B%22dataId%22%3A%22977697666574729218%22%7D&refId=977697666574729218&folderId=8120831157448215424 // // /api/file/preview?type=redirect&imgFormat=small&fileId=977697615197618177&module=ebuilderform&authModule=ebuilderform&source=form&fieldId=977686869110833154&customParam=%7B%22dataId%22%3A%22977697666574729218%22%7D&refId=977697666574729218&folderId=8120831157448215424
dataList = getCustomeServiceData(groupId,sourceType,field_id,recordList,employeeId); // dataList = getCustomeServiceData(groupId,sourceType,field_id,recordList,employeeId);
}else{ // }else{
dataList = getDefaultServiceData(groupId,sourceType,field_id); // dataList = getDefaultServiceData(groupId,sourceType,field_id);
} // }
} // }
}catch (Exception e){ // }catch (Exception e){
log.error("testSapi51-Exception:"+e.getMessage()); // log.error("testSapi51-Exception:"+e.getMessage());
return WeaResult.fail(500,"程序执行异常"); // return WeaResult.fail(500,"程序执行异常");
} // }
return WeaResult.success(dataList); // return WeaResult.success(dataList);
} // }
//
//
/*** // /***
* // *
* @param groupId // * @param groupId
* @param sourceType // * @param sourceType
* @return // * @return
*/ // */
public Map<String,String> getCustomServiceTypeName(String groupId,String sourceType,String employeeId){ // public Map<String,String> getCustomServiceTypeName(String groupId,String sourceType,String employeeId){
//
Map<String,String> optionMap = new HashMap<String,String>(); // Map<String,String> optionMap = new HashMap<String,String>();
String sql = " select id,tabymmc from uf_zzfwrktaby where qy is not null and ry=? and delete_type=0 and tenant_key = '"+tenant_key+"'"; // String sql = " select id,tabymmc from uf_zzfwrktaby where qy is not null and ry=? and delete_type=0 and tenant_key = '"+tenant_key+"'";
log.error("getCustomServiceTypeName-sql:"+sql); // log.error("getCustomServiceTypeName-sql:"+sql);
//
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>(); // List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity(); // SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(employeeId); // sqlParamEntity.setValue(employeeId);
sqlparam.add(sqlParamEntity); // sqlparam.add(sqlParamEntity);
//
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); // Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
//
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result); // List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
for(int i=0;i<recordList.size();i++){ // for(int i=0;i<recordList.size();i++){
Map<String,Object> recordMap = recordList.get(i); // Map<String,Object> recordMap = recordList.get(i);
String value = String.valueOf(recordMap.get("id")); // String value = String.valueOf(recordMap.get("id"));
String name = String.valueOf(recordMap.get("tabymmc")); // String name = String.valueOf(recordMap.get("tabymmc"));
log.error("getCustomServiceTypeName-value:"+value+" name:"+name); // log.error("getCustomServiceTypeName-value:"+value+" name:"+name);
optionMap.put(value,name); // optionMap.put(value,name);
} // }
return optionMap; // return optionMap;
} // }
//
//
public List<Map<String,Object>> getCustomeServiceData(String groupId,String sourceType,String field_id,List<Map<String,Object>> recordList,String employeeId){ // public List<Map<String,Object>> getCustomeServiceData(String groupId,String sourceType,String field_id,List<Map<String,Object>> recordList,String employeeId){
//
Map<String,String> optionMap = getCustomServiceTypeName(groupId,sourceType,employeeId); // Map<String,String> optionMap = getCustomServiceTypeName(groupId,sourceType,employeeId);
//
for(int i=0;i<recordList.size();i++){ // for(int i=0;i<recordList.size();i++){
Map<String,Object> recordMap = recordList.get(i); // Map<String,Object> recordMap = recordList.get(i);
String taby = String.valueOf(recordMap.get("taby")); // String taby = String.valueOf(recordMap.get("taby"));
log.error("getCustemSelfServiceType-taby:"+taby); // log.error("getCustemSelfServiceType-taby:"+taby);
//
String tabyName = optionMap.get(taby); // String tabyName = optionMap.get(taby);
List<Map<String,Object>> customList = getCustomeServiceDataByType(groupId,sourceType,taby,employeeId); // List<Map<String,Object>> customList = getCustomeServiceDataByType(groupId,sourceType,taby,employeeId);
//
log.error("getCustemSelfServiceType-tabyName:"+tabyName); // log.error("getCustemSelfServiceType-tabyName:"+tabyName);
log.error("getCustemSelfServiceType-taby:"+taby); // log.error("getCustemSelfServiceType-taby:"+taby);
recordMap.put("menus",customList); // recordMap.put("menus",customList);
recordMap.put("name",tabyName); // recordMap.put("name",tabyName);
} // }
return recordList; // return recordList;
} // }
//
//
/*** // /***
* // *
* @param groupId // * @param groupId
* @param sourceType // * @param sourceType
* @param value // * @param value
* @param employeeId // * @param employeeId
* @return // * @return
*/ // */
public List<Map<String,Object>> getCustomeServiceDataByType(String groupId,String sourceType,String value,String employeeId){ // public List<Map<String,Object>> getCustomeServiceDataByType(String groupId,String sourceType,String value,String employeeId){
String sql = " select fwmc,fwdz,fwtb,taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and taby="+value+" and delete_type=0 and tenant_key = '"+tenant_key+"'"; // String sql = " select fwmc,fwdz,fwtb,taby from uf_zzfwrkpz where ry=? and qy is not null and taby is not null and taby="+value+" and delete_type=0 and tenant_key = '"+tenant_key+"'";
log.info("getSelfServiceData--sql:"+sql); // log.info("getSelfServiceData--sql:"+sql);
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>(); // List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity(); // SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(employeeId); // sqlParamEntity.setValue(employeeId);
sqlparam.add(sqlParamEntity); // sqlparam.add(sqlParamEntity);
//
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); // Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result); // List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
for(int i=0;i<recordList.size();i++){ // for(int i=0;i<recordList.size();i++){
Map<String,Object> recordMap = recordList.get(i); // Map<String,Object> recordMap = recordList.get(i);
String fwtb = String.valueOf(recordMap.get("fwtb")); // String fwtb = String.valueOf(recordMap.get("fwtb"));
String fwtburl = ""; // String fwtburl = "";
if(StringUtils.isNotBlank(fwtb)){ // if(StringUtils.isNotBlank(fwtb)){
fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small"; // fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small";
} // }
recordMap.put("fwtburl",fwtburl); // recordMap.put("fwtburl",fwtburl);
} // }
return recordList; // return recordList;
} // }
//
//
/*** // /***
* // * 默认数据
* @param groupId // * @param groupId
* @param sourceType // * @param sourceType
* @return // * @return
*/ // */
public List<Map<String,Object>> getDefaultServiceData(String groupId,String sourceType,String field_id){ // public List<Map<String,Object>> getDefaultServiceData(String groupId,String sourceType,String field_id){
//
String sql = " select name,value_key as taby from field_option where field_id=? and delete_type=0 and tenant_key = '"+tenant_key+"'"; // String sql = " select name,value_key as taby from field_option where field_id=? and delete_type=0 and tenant_key = '"+tenant_key+"'";
log.error("getDefaultServiceData-sql:"+sql); // log.error("getDefaultServiceData-sql:"+sql);
//
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>(); // List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity(); // SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(field_id); // sqlParamEntity.setValue(field_id);
sqlparam.add(sqlParamEntity); // sqlparam.add(sqlParamEntity);
//
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); // Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result); // List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
//
log.error("getDefaultServiceData-recordList:"+recordList.size()); // log.error("getDefaultServiceData-recordList:"+recordList.size());
//
for(int i=0;i<recordList.size();i++){ // for(int i=0;i<recordList.size();i++){
Map<String,Object> recordMap = recordList.get(i); // Map<String,Object> recordMap = recordList.get(i);
String taby = String.valueOf(recordMap.get("taby")); // String taby = String.valueOf(recordMap.get("taby"));
log.error("getDefaultServiceData-taby:"+taby); // log.error("getDefaultServiceData-taby:"+taby);
List<Map<String,Object>> defaultList = getDefaultServiceDataByType(groupId,sourceType,taby); // List<Map<String,Object>> defaultList = getDefaultServiceDataByType(groupId,sourceType,taby);
recordMap.put("menus",defaultList); // recordMap.put("menus",defaultList);
} // }
return recordList; // return recordList;
} // }
//
/*** // /***
* // * 默认数据
* @param groupId // * @param groupId
* @param sourceType // * @param sourceType
* @param value // * @param value
* @return // * @return
*/ // */
public List<Map<String,Object>> getDefaultServiceDataByType(String groupId,String sourceType,String value){ // public List<Map<String,Object>> getDefaultServiceDataByType(String groupId,String sourceType,String value){
String sql =" select t.taby,t.fwtb,t.fwmc,t.fwdz\n" + // String sql =" select t.taby,t.fwtb,t.fwmc,t.fwdz\n" +
" from uf_zzfwcsh t \n" + // " from uf_zzfwcsh t \n" +
" where t.delete_type=0 \n" + // " where t.delete_type=0 \n" +
" and t.taby= ? " + // " and t.taby= ? " +
" and t.tenant_key = '"+tenant_key+"'"; // " and t.tenant_key = '"+tenant_key+"'";
//
log.error("getDefaultServiceDataByType--sql:"+sql); // log.error("getDefaultServiceDataByType--sql:"+sql);
//
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>(); // List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity(); // SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(value); // sqlParamEntity.setValue(value);
sqlparam.add(sqlParamEntity); // sqlparam.add(sqlParamEntity);
//
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam); // Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result); // List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("getDefaultServiceDataByType--recordList:"+recordList.size()); // log.error("getDefaultServiceDataByType--recordList:"+recordList.size());
//
//
for(int i=0;i<recordList.size();i++){ // for(int i=0;i<recordList.size();i++){
Map<String,Object> recordMap = recordList.get(i); // Map<String,Object> recordMap = recordList.get(i);
String fwtb = String.valueOf(recordMap.get("fwtb")); // String fwtb = String.valueOf(recordMap.get("fwtb"));
String fwtburl = ""; // String fwtburl = "";
if(StringUtils.isNotBlank(fwtb)){ // if(StringUtils.isNotBlank(fwtb)){
fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small"; // fwtburl = "/api/file/preview?fileId="+fwtb+"&module=ebuilderform&authModule=ebuilderform&type=imgs&source=form&fieldId="+fwtb+"&imgFormat=small";
} // }
recordMap.put("fwtburl",fwtburl); // recordMap.put("fwtburl",fwtburl);
} // }
return recordList; // return recordList;
} // }
@GetMapping("/testSapi90")
@WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi90(HttpServletRequest request){
String groupId = "weaver-ebuilder-form-service";
String sourceType = "LOGIC";
Map<String,Object> dataMap = new HashMap<String,Object>();
dataMap.put("test","testSapi90");
try {
SimpleEmployee employee = UserContext.getCurrentUser();
log.error("employee:"+employee.getEmployeeId());
long formdata = employee.getFormdata();
dataMap.put("formdata",formdata);
log.error("formdata:"+formdata);
String sql =" select field69,field69_obj from eteams.Hrmemployeedefined where form_data_id=? " ;
dataMap.put("sql",sql);
log.error("getSelfServiceData--sql:"+sql);
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
SqlParamEntity sqlParamEntity = new SqlParamEntity();
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
sqlParamEntity.setValue(String.valueOf(formdata));
sqlparam.add(sqlParamEntity);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
dataMap.put("data90",recordList);
} catch (Exception e) {
e.printStackTrace();
log.error("testSapi10:"+e);
dataMap.put("count","-1");
}
return WeaResult.success(dataMap);
}
@GetMapping("/testSapi110")
@WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi110(HttpServletRequest request){
String groupId = "weaver-hr-service";
String sourceType = "LOGIC";
Map<String,Object> dataMap = new HashMap<String,Object>();
dataMap.put("test","testSapi110");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
String hip = "" ;
String nowDay = sdf.format(new Date());
SimpleEmployee employee = UserContext.getCurrentUser();
log.error("employee:"+employee.getEmployeeId());
long formdata = employee.getFormdata();
dataMap.put("formdata",formdata);
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' " ;
dataMap.put("sql",sql);
log.error("--sql:"+sql);
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' ";
log.error("--sql:"+sql);
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 ";
log.error("--sql:"+sql);
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(); // @GetMapping("/testSapi90")
sqlParamEntity.setParamType(SqlParamType.VARCHAR); // @WeaPermission(publicPermission = true)
sqlParamEntity.setValue(tip_target_id); // public WeaResult<Object> testSapi90(HttpServletRequest request){
sqlparam.add(sqlParamEntity); //
// String groupId = "weaver-ebuilder-form-service";
// String sourceType = "LOGIC";
//
// Map<String,Object> dataMap = new HashMap<String,Object>();
// dataMap.put("test","testSapi90");
//
// try {
// SimpleEmployee employee = UserContext.getCurrentUser();
// log.error("employee:"+employee.getEmployeeId());
//
// long formdata = employee.getFormdata();
// dataMap.put("formdata",formdata);
// log.error("formdata:"+formdata);
//
// String sql =" select field69,field69_obj from eteams.Hrmemployeedefined where form_data_id=? " ;
// dataMap.put("sql",sql);
//
// log.error("getSelfServiceData--sql:"+sql);
//
// List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
// SqlParamEntity sqlParamEntity = new SqlParamEntity();
// sqlParamEntity.setParamType(SqlParamType.VARCHAR);
// sqlParamEntity.setValue(String.valueOf(formdata));
// sqlparam.add(sqlParamEntity);
//
// Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
// List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
// dataMap.put("data90",recordList);
//
// } catch (Exception e) {
// e.printStackTrace();
// log.error("testSapi10:"+e);
// dataMap.put("count","-1");
// }
// return WeaResult.success(dataMap);
// }
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);
hip = String.valueOf(recordMap.get("id"));
}
}
log.error("--hip:"+hip);
dataMap.put("hip",hip);
} catch (Exception e) { // @GetMapping("/testSapi110")
e.printStackTrace(); // @WeaPermission(publicPermission = true)
log.error("testSapi10:"+e); // public WeaResult<Object> testSapi110(HttpServletRequest request){
dataMap.put("count","-1"); //
} // String groupId = "weaver-hr-service";
return WeaResult.success(dataMap); // String sourceType = "LOGIC";
} //
// Map<String,Object> dataMap = new HashMap<String,Object>();
// dataMap.put("test","testSapi110");
//
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// try {
//
// String hip = "" ;
// String nowDay = sdf.format(new Date());
// SimpleEmployee employee = UserContext.getCurrentUser();
// log.error("employee:"+employee.getEmployeeId());
//
// long formdata = employee.getFormdata();
// dataMap.put("formdata",formdata);
// 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' " ;
// dataMap.put("sql",sql);
// log.error("--sql:"+sql);
// 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' ";
// log.error("--sql:"+sql);
// 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 ";
// log.error("--sql:"+sql);
//
// 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);
// hip = String.valueOf(recordMap.get("id"));
// }
// }
// log.error("--hip:"+hip);
// dataMap.put("hip",hip);
//
// } catch (Exception e) {
// e.printStackTrace();
// log.error("testSapi10:"+e);
// dataMap.put("count","-1");
// }
// return WeaResult.success(dataMap);
// }
@ -1742,4 +1742,55 @@ public class HrmSelfHelpController {
} }
@GetMapping("/testSapi188")
@WeaPermission(publicPermission = true)
public WeaResult<Object> testSapi188(HttpServletRequest request){
String groupId = "weaver-ebuilder-form-service";
String sourceType = "LOGIC";
String code1 = "";
String code2 = "" ;
Map<String,Object> dataMap = new HashMap<String,Object>();
dataMap.put("test","testSapi188");
try {
String sql = " update uf_nj_cyqltjb set delete_type = 1,is_delete=1 where tenant_key='"+tenant_key+"' and delete_type=0 ";
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
Iterator<Map.Entry<String, Object>> iterator2 = result.entrySet().iterator();
while (iterator2.hasNext()){
Map.Entry<String, Object> next = iterator2.next();
log.error("insertCustomServiceData--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
}
if(result.containsKey("code")){
code1 = String.valueOf(result.get("code"));
}
} catch (Exception e) {
e.printStackTrace();
log.error("testSapi8:"+e);
}
try {
String sql = " update uf_nj_pjmrdlhhsl set delete_type = 1,is_delete=1 where tenant_key='"+tenant_key+"' and delete_type=0 ";
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
Iterator<Map.Entry<String, Object>> iterator2 = result.entrySet().iterator();
while (iterator2.hasNext()){
Map.Entry<String, Object> next = iterator2.next();
log.error("insertCustomServiceData--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
}
if(result.containsKey("code")){
code2 = String.valueOf(result.get("code"));
}
} catch (Exception e) {
e.printStackTrace();
log.error("testSapi8:"+e);
}
dataMap.put("code1",code1);
dataMap.put("code2",code2);
return WeaResult.success(dataMap);
}
} }

Loading…
Cancel
Save