|
|
@ -6,6 +6,7 @@ import com.engine.core.impl.Service;
|
|
|
|
import com.engine.organization.entity.chart.*;
|
|
|
|
import com.engine.organization.entity.chart.*;
|
|
|
|
import com.engine.organization.entity.chart.params.ModeHrmResourceParam;
|
|
|
|
import com.engine.organization.entity.chart.params.ModeHrmResourceParam;
|
|
|
|
import com.engine.organization.entity.chart.params.StatisticsParam;
|
|
|
|
import com.engine.organization.entity.chart.params.StatisticsParam;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.staff.po.ModeStaffPO;
|
|
|
|
import com.engine.organization.enums.ModuleTypeEnum;
|
|
|
|
import com.engine.organization.enums.ModuleTypeEnum;
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
import com.engine.organization.service.ChartService;
|
|
|
|
import com.engine.organization.service.ChartService;
|
|
|
@ -754,7 +755,6 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
ArrayList<Integer> list = new ArrayList<>();
|
|
|
|
ArrayList<Integer> list = new ArrayList<>();
|
|
|
|
list.add(stp.getDataId());
|
|
|
|
list.add(stp.getDataId());
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
|
|
|
|
|
|
|
if (ModuleTypeEnum.departmentfielddefined.getValue().equals(stp.getType())) {
|
|
|
|
if (ModuleTypeEnum.departmentfielddefined.getValue().equals(stp.getType())) {
|
|
|
|
dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId()));
|
|
|
|
dept.getAllChildDeptByDepId(list,String.valueOf(stp.getDataId()));
|
|
|
|
String value = StringUtils.join(list,",");
|
|
|
|
String value = StringUtils.join(list,",");
|
|
|
@ -765,13 +765,32 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
|
String currentYearMonth = currentDateTime.format(formatter);
|
|
|
|
String currentYearMonth = currentDateTime.format(formatter);
|
|
|
|
|
|
|
|
|
|
|
|
// 部门编制人数向下汇总
|
|
|
|
// 部门编制人数向下汇总 20250122 优化需求
|
|
|
|
List<Integer> bzList = new ArrayList<>();
|
|
|
|
List<ModeStaffPO> bzList = new ArrayList<>();
|
|
|
|
rs.executeQuery("select bzrs from uf_bzgljmb where bm in ("+value+") and ny = ?",currentYearMonth);
|
|
|
|
rs.executeQuery("select bzrs,ny from uf_bzgljmb where bm in ("+value+")");
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
bzList.add(Util.getIntValue(rs.getString("bzrs"), 0));
|
|
|
|
int bzrs = Util.getIntValue(rs.getString("bzrs"), 0);
|
|
|
|
|
|
|
|
String ny = Util.null2String(rs.getString("ny"));
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(ny)) {
|
|
|
|
|
|
|
|
bzList.add(ModeStaffPO.builder().count(bzrs).monthYear(ny).build());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
if (bzList.size() > 0) {
|
|
|
|
|
|
|
|
Map<String, List<ModeStaffPO>> groupedByMonthYear = bzList.stream()
|
|
|
|
|
|
|
|
.collect(Collectors.groupingBy(ModeStaffPO::getMonthYear));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取最新的 monthYear
|
|
|
|
|
|
|
|
String latestMonthYear = groupedByMonthYear.keySet().stream()
|
|
|
|
|
|
|
|
.max(String::compareTo)
|
|
|
|
|
|
|
|
.orElse(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ModeStaffPO> modeStaffPOS = groupedByMonthYear.get(latestMonthYear);
|
|
|
|
|
|
|
|
sum = modeStaffPOS.stream().mapToInt(ModeStaffPO::getCount).sum();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int sum = bzList.stream().mapToInt(Integer::intValue).sum();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stp.setStaffNum(sum);
|
|
|
|
stp.setStaffNum(sum);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|