嘉兆bug优化0706

feature/jiazhao
Mlin 2 years ago
parent 544dfc98e4
commit 01e0880de7

@ -137,7 +137,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
table.setSqlwhere(sqlWhere);
List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
String columns = null;
String columns = "";
List<String> fields = new ArrayList<>();
List<SearchConditionGroup> allConditions = getAllConditions();
@ -638,7 +638,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
DBType dbType = DBType.get(new RecordSet().getDBType());
StringBuilder sb = new StringBuilder(" where 1=1 ");
if (params.containsKey("lastName")) {
sb.append(" and t.status = 1");
// sb.append(" and t.status = 1");
sb.append(" and t.status < 4");
}
for (Map.Entry<String, Object> entry : params.entrySet()) {
String key = entry.getKey();
@ -659,6 +660,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
JobPO jobById = getJobMapper().getJobById(Long.parseLong(value));
if (null != jobById) {
sb.append(" and t.jobtitle ='").append(Util.null2String(jobById.getEcJobTitle())).append("' and t.subcompanyid1 = '").append(Util.null2String(jobById.getEcCompany())).append("' and t.departmentId ='").append(Util.null2String(jobById.getEcDepartment())).append("'");
} else {
sb = new StringBuilder(" where 1 = 2 ");
break;
}
}
@ -1097,7 +1101,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
break;
case SELECT://选择框
if (!"-1".equals(value)) {
sb.append(" and ").append(tableSql).append(" = '").append(value).append("' ");
if ("t.status".equalsIgnoreCase(tableSql) && "10".equals(value)) {
sb.append(" and ").append(tableSql).append(" < 4 ");
} else {
sb.append(" and ").append(tableSql).append(" = '").append(value).append("' ");
}
}
break;
case DATE:
@ -1168,15 +1176,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private void addEmptyForSelect(SearchConditionItem searchConditionItem) {
searchConditionItem.setValue("-1");
if ("-1_hrm_status".equals(searchConditionItem.getDomkey()[0])) {
searchConditionItem.setValue("1");
// 默认赋值 在职状态
searchConditionItem.setValue("10");
}
List<SearchConditionOption> options = searchConditionItem.getOptions();
SearchConditionOption searchConditionOption = new SearchConditionOption();
searchConditionOption.setKey("-1");
searchConditionOption.setShowname("全部");
options.add(0, searchConditionOption);
options.forEach(item -> {
item.setSelected(false);
});
options.forEach(item -> item.setSelected(false));
}
/**

@ -565,7 +565,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
// 同步部门负责人
getJclOrgMapMapper().insertBmfzrToMapJZ(level,grade);
RecordSet rs = new RecordSet();
rs.execute("select c.id as id,c.departmentid as departmentid from hrmdepartment a \n" +
rs.execute("select c.id,a.id as departmentid from hrmdepartment a \n" +
"inner join hrmdepartmentdefined b on a.id=b.DEPTID\n" +
"inner join hrmresource c on cast(b.BMFZR as varchar(10))=cast(c.ID as varchar(10)) ");//sqlserver版
while (rs.next()) {
@ -576,10 +576,56 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
//清除部门合并、转移造成的脏数据
getJclOrgMapMapper().deleteJobNull(date);
//刷新在岗数、编制数(从岗位向上刷,岗位不需处理)
List<JclOrgMap> jclOrgMaps = getJclOrgMapMapper().getJclOrgMapByType("3",date);
for (JclOrgMap jclOrgMap : jclOrgMaps){
int id = jclOrgMap.getId();
countJobAndPlans("3",id,currentDate);
// List<JclOrgMap> jclOrgMaps = getJclOrgMapMapper().getJclOrgMapByType("3",date);
// for (JclOrgMap jclOrgMap : jclOrgMaps){
// int id = jclOrgMap.getId();
// countJobAndPlans("3",id,currentDate);
// }
// 同步人员数据
String queryDept = "select id from hrmdepartment a where nvl(a.canceled,0)='0' ";
RecordSet recordSet = new RecordSet();
recordSet.execute(queryDept);
while (recordSet.next()) {
String deptId = Util.null2String(recordSet.getString("id"));
// 处理部门(含子部门人数)
String recSql = "with children as\n" +
"(select id,supdepid from HrmDepartment where id = '6'\n" +
"union all \n" +
"select b.id,b.supdepid from children a inner join HrmDepartment b on a.id=b.supdepid\n" +
")select * from children";
rs.execute(recSql);
while (rs.next()) {
}
String getSupDeptSql = "select wm_concat(id) as allSupDept from hrmdepartment a start with a.id=" + deptId + " connect by a.supdepid=prior a.id";
rs.execute(getSupDeptSql);
String allSupDeptIds = null;
if (rs.next()) {
allSupDeptIds = Util.null2String(rs.getString("allSupDept"));
}
String getZrs = "select nvl(sum(zrs),0) zrs from (\n" +
"select a.departmentid,count(id) as zrs from hrmresource a where a.status<4 group by a.departmentid\n" +
") b where b.departmentid in (" + allSupDeptIds + ")";
rs.execute(getZrs);
String zrs = "0";
if (rs.next()) {
zrs = Util.null2String(rs.getString("zrs"));
}
rs.execute("update junc_org_map set fonjob = '" + zrs + "' where ftype=2 and fdateend>sysdate and fobjid=" + deptId);
// 找出没有下级的人员
String noHaveChildSql = "select a.id,a.managerid from hrmresource a \n" +
"inner join (select id from hrmresource where departmentid='" + deptId + "'\n" +
"MINUS\n" +
"select managerid from hrmresource a \n" +
"where a.managerid in (select id from hrmresource where departmentid='" + deptId + "')\n" +
"and a.departmentid='" + deptId + "') b on a.id=b.id";
rs.execute(noHaveChildSql);
while (rs.next()) {
String id = Util.null2String(rs.getString("id"));
String managerid = Util.null2String(rs.getString("managerid"));
// handleSuperior(id, managerid, deptId);
}
}
return "同步成功";
}

Loading…
Cancel
Save