中远重工正式员工增加人员性质查询

上海中远重工组织架构图
Chengliang 12 months ago
parent ad8a8bed37
commit f74d6da24c

@ -44,9 +44,12 @@ public class ChartPO {
private String id;
private String key;
// 部门层级
// 部门深度
private int departmentDepth;
//部门层级
private int deptLevel;
// 在编数
private int onJobNum;
// 编制数

@ -0,0 +1,27 @@
package com.engine.organization.entity.chart;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author liang.cheng
* @Date 2024/4/29 2:15 PM
* @Description:
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DetailConditionVO {
private String label;
private String value;
private Boolean disabled;
}

@ -1,6 +1,5 @@
package com.engine.organization.entity.chart;
import com.icbc.api.internal.apache.http.impl.cookie.S;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

@ -20,6 +20,8 @@ public class ModeHrmResourceParam {
private String departmentId;
private String nbValue;
private String wbValue;
}

@ -41,4 +41,13 @@ public interface ModeHrmResourceService {
* @return: int
*/
int selcetPersonCount(String departmentIds);
/**
* @Description:
* @Author: liang.cheng
* @Date: 2024/4/29 2:23 PM
* @param: [request2Map, user]
* @return: java.util.Map<java.lang.String,java.lang.Object>
*/
Map<String, Object> getDeptDetailCondition();
}

@ -208,8 +208,9 @@ public class ChartServiceImpl extends Service implements ChartService {
}
}
while (rs.next()) {
String type = rs.getString("type");
ChartPO chartPO = new ChartPO();
chartPO.setFtype(rs.getString("type"));
chartPO.setFtype(type);
chartPO.setFobjid(rs.getString("id"));
chartPO.setFname(rs.getString("name"));
chartPO.setParentId(s);
@ -218,14 +219,19 @@ public class ChartServiceImpl extends Service implements ChartService {
chartPO.setHasChildren(getHasChildren(chartPO.getFtype(), chartPO.getFobjid()).toString());
chartPO.setOnJobNum(isRealTime ? Util.getIntValue(rs.getString("on_job_num"),0) : Util.getIntValue(rs.getString("job_num"),0));
chartPO.setStaffNum(Util.getIntValue(rs.getString("staff_num"),0));
if ("2".equals(type)) {
chartPO.setDeptLevel(Util.getIntValue(rs.getString("bmcj"),0));
}
filterAndAddData(dataList, chartPO, hideDepartment);
//dataList.add(chartPO);
}
}
}
}
Map<String, Object> result = new HashMap<>();
Map<String, Object> result = new HashMap<>(4);
result.put("api_status", true);
result.put("data", dataList);
return result;
@ -373,12 +379,20 @@ public class ChartServiceImpl extends Service implements ChartService {
public Map<String, Object> getDepartmentNewDetail(Map<String, Object> params) {
String rootId = Util.null2String(params.get("rootId"));
String nbValue = Util.null2String(params.get("nbValue"));
String wbValue = Util.null2String(params.get("wbValue"));
String departmentId = rootId.split("_")[1];
ModeHrmResourceParam build = ModeHrmResourceParam.builder().departmentId(departmentId).build();
ModeHrmResourceParam build = ModeHrmResourceParam.builder()
.nbValue(nbValue)
.wbValue(wbValue)
.departmentId(departmentId)
.build();
String detauleType = Util.null2String(params.get("detauleType"));
String detauleType = Util.null2String(params.get("detailType"));
if (!"chart".equals(detauleType)) {
// 展示列表模块
return ServiceUtil.getService(ModeHrmResourceServiceImpl.class, user).chartResourceList(build);
@ -1395,8 +1409,8 @@ public class ChartServiceImpl extends Service implements ChartService {
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where (a.canceled is null or a.canceled != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,showorder,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '" + fObjId + "'";
} else {
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,showorder,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,showorder,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '" + fObjId + "'";
sql = "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,0,showorder,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,b.bmcj,showorder,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '" + fObjId + "'";
}
} else {
sql = "select a.id,a.subcompanyname as name,'1' as type,showorder,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where (canceled is null or canceled != '1') and supsubcomid = '" + fObjId + "'" +
@ -1414,7 +1428,7 @@ public class ChartServiceImpl extends Service implements ChartService {
if (showVirtual) {
sql = "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and supdepid = '" + fObjId + "'";
} else {
sql = "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.supdepid = '" + fObjId + "'";
sql = "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,b.bmcj,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.supdepid = '" + fObjId + "'";
}
} else {
sql = "select a.id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and supdepid = '" + fObjId + "'";
@ -1514,8 +1528,9 @@ public class ChartServiceImpl extends Service implements ChartService {
RecordSet recordSet = new RecordSet();
recordSet.executeQuery(sql);
while (recordSet.next()) {
String type = recordSet.getString("type");
ChartPO chartPO = new ChartPO();
chartPO.setFtype(recordSet.getString("type"));
chartPO.setFtype(type);
chartPO.setFobjid(recordSet.getString("id"));
chartPO.setFname(recordSet.getString("name"));
chartPO.setOnJobNum(isRealTime ? Util.getIntValue(recordSet.getString("on_job_num"),0) : Util.getIntValue(recordSet.getString("job_num"),0));
@ -1526,6 +1541,12 @@ public class ChartServiceImpl extends Service implements ChartService {
chartPO.setDepartmentDepth(getDepartmentDepth(chartPO, topChartPO));
// 小于、等于所选层级元素展开
chartPO.setExpand(inDepth(selectDepth, chartPO.getDepartmentDepth()) ? "1" : "0");
if ("2".equals(type)) {
chartPO.setDeptLevel(Util.getIntValue(recordSet.getString("bmcj"),0));
}
filterAndAddData(currentList, chartPO, hideDepartment);
//currentList.add(chartPO);
}

@ -3,6 +3,7 @@ package com.engine.organization.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.chart.ChartPO;
import com.engine.organization.entity.chart.DetailConditionVO;
import com.engine.organization.entity.chart.ResourceListColumns;
import com.engine.organization.entity.chart.params.ModeHrmResourceParam;
import com.engine.organization.entity.hrmresource.po.ResourceChartPO;
@ -19,6 +20,7 @@ import weaver.hrm.company.SubCompanyComInfo;
import weaver.hrm.resource.ResourceComInfo;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author liang.cheng
@ -35,10 +37,10 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
List<ResourceListColumns> resourceListColumns = getTableColumns();
List<Integer> allSupDepartment = getAllSupDepartment(param.getDepartmentId());
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment));
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue()));
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartNb,"1");
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment));
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment,param.getWbValue()));
resourceChartVOS.addAll(convertToVO(resourceChartWb,"2"));
@ -76,10 +78,10 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
//人员
List<Integer> allSupDepartment = getAllSupDepartment(param.getDepartmentId());
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment));
List<ResourceChartPO> resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue()));
List<ResourceChartVO> resourceChartVOS = convertToVO(resourceChartNb,"1");
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment));
List<ResourceChartPO> resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment,param.getWbValue()));
resourceChartVOS.addAll(convertToVO(resourceChartWb,"2"));
resourceChartVOS.forEach(item -> {
@ -117,16 +119,56 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
return totalCount;
}
@Override
public Map<String, Object> getDeptDetailCondition() {
RecordSet rs = new RecordSet();
List<DetailConditionVO> nbCondition = new ArrayList<>();
List<String> nbValue = new ArrayList<>();
List<DetailConditionVO> wbCondition = new ArrayList<>();
//内部职工
rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 0");
while (rs.next()) {
String mc = Util.null2String(rs.getString("mc"));
String bh = Util.null2String(rs.getString("bh"));
nbCondition.add(DetailConditionVO.builder().label(mc).value(bh).build());
nbValue.add(bh);
}
//外部人员
rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 1");
while (rs.next()) {
String mc = Util.null2String(rs.getString("mc"));
String bh = Util.null2String(rs.getString("bh"));
wbCondition.add(DetailConditionVO.builder().label(mc).value(bh).build());
}
Map<String,Object> datas = new HashMap<>(4);
datas.put("nbCondition",nbCondition);
datas.put("nbValue",nbValue);
datas.put("wbCondition",wbCondition);
return datas;
}
/**
*
* @param allSupDepartment
* @return
*/
private List<ResourceChartPO> selectNbPerson(Collection<Integer> allSupDepartment) {
RecordSet rs = new RecordSet();
private List<ResourceChartPO> selectNbPerson(Collection<Integer> allSupDepartment,String workType) {
List<ResourceChartPO> resourceChartPOS = new ArrayList<>();
if (StringUtils.isEmpty(workType)){
return resourceChartPOS;
}
List<String> result = Arrays.asList(workType.split(","));
workType = result.stream()
.map(s -> "'" + s + "'")
.collect(Collectors.joining(","));
RecordSet rs = new RecordSet();
String join = CollectionUtil.join(allSupDepartment, ",");
rs.executeQuery("select id,gh,xm,xb,bm,gw,sjhm from uf_zsygrzbdd where zt < 4 and bm in ("+join+")");
rs.executeQuery("select id,gh,xm,xb,bm,gw,sjhm from uf_zsygrzbdd where zt < 4 and bm in ("+join+") and ygxz in ("+workType+")");
while (rs.next()) {
ResourceChartPO build = ResourceChartPO.builder()
.id((long) Util.getIntValue(rs.getString("id")))
@ -148,11 +190,19 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
* @param allSupDepartment
* @return
*/
private List<ResourceChartPO> selectWbPerson(Collection<Integer> allSupDepartment) {
RecordSet rs = new RecordSet();
private List<ResourceChartPO> selectWbPerson(Collection<Integer> allSupDepartment,String workType) {
List<ResourceChartPO> resourceChartPOS = new ArrayList<>();
if (StringUtils.isEmpty(workType)){
return resourceChartPOS;
}
List<String> result = Arrays.asList(workType.split(","));
workType = result.stream()
.map(s -> "'" + s + "'")
.collect(Collectors.joining(","));
RecordSet rs = new RecordSet();
String join = CollectionUtil.join(allSupDepartment, ",");
rs.executeQuery("select id, gh,xm,xb,bmbz,gw,lxfs from uf_qlwbrydngljmb where zt < 4 and bmbz in ("+join+")");
rs.executeQuery("select id,gh,xm,xb,bmbz,gw,lxfs from uf_qlwbrydngljmb where zt < 4 and bmbz in ("+join+") and ygxz in ("+workType+")");
while (rs.next()) {
ResourceChartPO build = ResourceChartPO.builder()
.id((long) Util.getIntValue(rs.getString("id")))
@ -294,7 +344,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour
chartPO.setLocalDeptName(item.getDepartmentName());
chartPO.setJobTitle(item.getJobTitle());
chartPO.setExpand("1");
chartPO.setHasChildren("0");
chartPO.setHasChildren("false");
try {
String resourceId = getResourceIdByWorkCode(item.getWorkCode());
chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(resourceId));

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.chart.params.StatisticsParam;
import com.engine.organization.service.ModeHrmResourceService;
import com.engine.organization.service.impl.ModeHrmResourceServiceImpl;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.OrgChartWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -23,10 +25,15 @@ import java.util.Map;
public class OrgChartController {
public OrgChartWrapper getOrgChartWrapper(User user) {
return ServiceUtil.getService(OrgChartWrapper.class, user);
}
private ModeHrmResourceService getModeHrmResourceService(User user) {
return ServiceUtil.getService(ModeHrmResourceServiceImpl.class, user);
}
/**
*
*/
@ -66,6 +73,23 @@ public class OrgChartController {
return JSONObject.toJSONString(apidatas);
}
@GET
@Path("/getDeptDetailCondition")
@Produces(MediaType.APPLICATION_JSON)
public String getDeptDetailCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
Map<String, Object> apidatas = new HashMap<>(4);
try {
User user = HrmUserVarify.getUser(request, response);
apidatas = getModeHrmResourceService(user).getDeptDetailCondition();
} catch (Exception e) {
//异常处理
e.printStackTrace();
apidatas.put("api_status", false);
apidatas.put("api_errormsg", "catch exception : " + e.getMessage());
}
return JSONObject.toJSONString(apidatas);
}
@GET
@Path("/getDepartmentDetail")
@Produces(MediaType.APPLICATION_JSON)

Loading…
Cancel
Save