优化假期发放余额,流程,优化出勤逻辑,优化日历排班导出,首页

main
liuliang 3 months ago
parent ea461ed164
commit 4320d173e5

@ -0,0 +1,11 @@
package com.api.jucailinkq.attendance.component.page;
import com.engine.jucailinkq.attendance.component.page.web.PersonPageAction;
import lombok.extern.slf4j.Slf4j;
import javax.ws.rs.Path;
@Path("/attendance/personpage")
@Slf4j
public class PersonPageActionApi extends PersonPageAction {
}

@ -62,6 +62,7 @@ public class KQDoDeleteProxyCmd extends AbstractCommandProxy<Map<String,Object>>
if (workFlowHandleTacis.support(workflowType)){
map.put("requestId",requestid);
map.put("operate","dodelete");
map.put("workflowid",workflowid);
workFlowHandleTacis.reset(map);
}
}

@ -58,6 +58,7 @@ public class KQDoRepossessedProxyCmd extends AbstractCommandProxy<Map<String,Obj
if (workFlowHandleTacis.support(workflowType)){
map.put("requestId",requestId);
map.put("operate","dorepossesse");
map.put("workflowid",workflowid);
workFlowHandleTacis.reset(map);
}
}

@ -80,7 +80,12 @@ public class RecordDataCmd extends AbstractCommonCommand<Map<String,Object>> {
recordDataList = recordDataList.subList(0,8);
}
if (dataList.size() >0){
sql = "select subcompanyid1,departmentid,jobtitle from hrmresource where id=?";
List<Map<String,Object>> userList = DbTools.getSqlToList(sql,userId);
sql = "update uf_jcl_kq_cqjg set sjzt=1,cqsc="+attendanceDuration+",cqzt="+cqzt+",fxrq='"+DateUtil.getCurrentTime()+"',rqlx="+rqlx+",sfxx="+sfxx;
if (DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.getCurrentDate()))>=0){
sql = sql+",fbid="+userList.get(0).get("subcompanyid1")+",bm="+userList.get(0).get("departmentid")+",szjg="+userList.get(0).get("subcompanyid1");
}
if (classInfo.size() == 0 || classInfo.get(0).get("bcxx") == null || "".equals(classInfo.get(0).get("bcxx"))){
sql = sql + ",bc=NULL,bcbdxx=NULL,";
}else {

@ -0,0 +1,45 @@
package com.engine.jucailinkq.attendance.attendanceanalysis.cmd.getclockInpoint;
import com.engine.jucailinkq.attendance.attendanceanalysis.cmd.getclockInpoint.biz.AbstractAdjustClockPointAction;
import com.engine.jucailinkq.attendance.attendanceanalysis.dto.clockpoint.ClockPointDTO;
import com.engine.jucailinkq.attendance.attendanceanalysis.dto.clockpoint.ClockPointInfo;
import com.engine.jucailinkq.attendance.enums.ClassSegmentTypeEnum;
import com.engine.jucailinkq.common.util.Utils;
import com.google.common.collect.Lists;
import weaver.general.Util;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*/
public class AdjustByEvectionCmd extends AbstractAdjustClockPointAction {
@Override
public List<ClockPointDTO> execute(ClockPointInfo clockPointInfo) {
String analysisDate = clockPointInfo.getAnalysisDate();
//卡点集合
List<ClockPointDTO> clcokInPointList = clockPointInfo.getClcokInPointList();
//出差以及请假
List<Map<String, Object>> askForLeaveAndEvctionScheduleList = clockPointInfo.getAskForLeaveAndEvctionScheduleList();
List<Map<String, Object>> evectionScheduleList = askForLeaveAndEvctionScheduleList.stream().filter(e-> ClassSegmentTypeEnum.EVECTION.getKey().equals(e.get("bdlx"))).collect(Collectors.toList());
List<ClockPointDTO> adjustClcokInPointList = Lists.newArrayList();
for (Map<String, Object> evectionSchedule:evectionScheduleList){
String kssj = Utils.getkssjTime(evectionSchedule,analysisDate);
String jssj = Utils.getjssjTime(evectionSchedule,analysisDate);
String ksdk = evectionSchedule.get("ksdk").toString();
String jsdk = evectionSchedule.get("jsdk").toString();
}
return null;
}
}

@ -10,6 +10,7 @@ import com.engine.jucailinkq.attendance.workflow.service.AllowanceService;
import com.engine.jucailinkq.attendance.workflow.service.impl.AllowanceServiceImpl;
import com.engine.common.util.*;
import com.engine.jucailinkq.common.cmd.GetPersonBySuitOrganzationCmd;
import com.engine.jucailinkq.common.exception.AttendanceRunTimeException;
import com.engine.jucailinkq.common.service.CommonService;
import com.engine.jucailinkq.common.service.impl.CommonServiceImpl;
import com.engine.jucailinkq.common.util.*;
@ -195,7 +196,15 @@ public class AttendanceAnalysisJob extends BaseCronJob {
List<String> analysisDateList = Lists.newArrayList((Set<String>)attendanceCycle.get(userId));
try {
if (leaveAndEntry.equals("1")){
analysisDateList = analysisDateList.stream().filter(e->"".equals(companystartDate) || DateUtil.getTime(e).compareTo(DateUtil.getTime(companystartDate)) >0).sorted(Comparator.comparing(e -> DateUtil.getTime(e).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
}else {
analysisDateList = analysisDateList.stream().filter(e->"".equals(companystartDate) || DateUtil.getTime(e).compareTo(DateUtil.getTime(companystartDate)) >=0).sorted(Comparator.comparing(e -> DateUtil.getTime(e).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
}
if (analysisDateList.size() == 0){
throw new AttendanceRunTimeException("分析日期没用值");
}
//日期对应的打卡数据
Map<String,Map<String,Object>> clockInTimeMap = Maps.newHashMap();

@ -267,7 +267,7 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
}
}else if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx) || ClassSegmentTypeEnum.EARLY_OVERTIME.getKey().equals(bdlx)
|| ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
|| ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx) || ClassSegmentTypeEnum.OVERTIME_IN_CLASS.getKey().equals(bdlx)){
//加班
List<Map<String,Object>> workTimeItems = Lists.newArrayList();
if (ClassSegmentTypeEnum.EXTENDED_OVERTIME.getKey().equals(bdlx)){
@ -281,6 +281,10 @@ public class AbnormalAttendanceServiceImpl extends Service implements AbnormalAt
}else if (ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(bdlx)){
earlyParams.put("workfor",WorkForTimeEnum.PLAN_WORK_OVERTIME.getKey());
workTimeItems = (List<Map<String,Object>>)classInfo.get("jblx");
}else if (ClassSegmentTypeEnum.OVERTIME_IN_CLASS.getKey().equals(bdlx)){
earlyParams.put("workfor",WorkForTimeEnum.OVERTIME_IN_CLASS.getKey());
Map<String,Object> result = commandExecutor.execute(new WorkOvertimeItemCmd(earlyParams));
workTimeItems = (List<Map<String,Object>>)result.get("attendanceItems");
}
List<Map<String,Object>> beEarlyItems = getBeEarlyItems(earlyParams);
if (workTimeItems.size() > 0 && beEarlyItems.size() >0){

@ -49,9 +49,9 @@ public class AttendanceanalysisAction {
log.info("********AttendanceanalysisAction start********");
Map<String,Object> paramMap = ParamUtil.request2Map(request);
// Map<String,Object> paramMap = Maps.newHashMap();
// paramMap.put("startDate","2024-12-10");
// paramMap.put("endDate","2024-12-10");
// paramMap.put("userIds","84");
// paramMap.put("startDate","2025-01-15");
// paramMap.put("endDate","2025-01-15");
// paramMap.put("userIds","23");
String startDate = Util.null2String(paramMap.get("startDate"));
String startBeforeDate = DateUtil.beforeDay(startDate,2);
@ -91,7 +91,7 @@ public class AttendanceanalysisAction {
CommonUtil.checkHavePermission();
if ("".equals(userIds)){
log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate is not null";
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where changedate is not null";
//获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);
@ -207,7 +207,7 @@ public class AttendanceanalysisAction {
}
}else {
log.info("********AttendanceanalysisAction prepare start******");
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate is not null and resourceid in ("+userIds+")";
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where changedate is not null and resourceid in ("+userIds+")";
//获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);

@ -117,7 +117,8 @@ public class AttendanceAnalysisWrapper extends Service {
!"3".equals(analysisDateAttendaceResult.get(0).get("sjzt")))) {
/**人员换了部门,需班次、分部、部门继续走老的*/
if (analysisDateAttendaceResult!=null && analysisDateAttendaceResult.size() >0 && (!analysisDateAttendaceResult.get(0).get("fbid").equals(subcompanyid1) || !analysisDateAttendaceResult.get(0).get("bm").equals(departmentid))){
if (analysisDateAttendaceResult!=null && analysisDateAttendaceResult.size() >0 && (!analysisDateAttendaceResult.get(0).get("fbid").equals(subcompanyid1) || !analysisDateAttendaceResult.get(0).get("bm").equals(departmentid))
&& DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.beforeDay(DateUtil.getCurrentDate(),1))) <0){
String olddepartmentid = analysisDateAttendaceResult.get(0).get("bm").toString();
String oldsubCompanyid = analysisDateAttendaceResult.get(0).get("fbid").toString();
@ -264,7 +265,8 @@ public class AttendanceAnalysisWrapper extends Service {
Map<String, Object> schedulMap = null;
List<Map<String, Object>> analysisDateAttendanceItems =Lists.newArrayList();
/**人员换了部门,需班次、分部、部门继续走老的*/
if (attendaceResult!=null && attendaceResult.size() >0 && (!attendaceResult.get(0).get("fbid").equals(subcompanyid1) || !attendaceResult.get(0).get("bm").equals(departmentid))){
if (attendaceResult!=null && attendaceResult.size() >0 && (!attendaceResult.get(0).get("fbid").equals(subcompanyid1) || !attendaceResult.get(0).get("bm").equals(departmentid)) &&
DateUtil.getTime(analysisDate).compareTo(DateUtil.getTime(DateUtil.getCurrentDate())) <0){
String olddepartmentid = attendaceResult.get(0).get("bm").toString();
String oldsubCompanyid = attendaceResult.get(0).get("fbid").toString();
@ -536,8 +538,13 @@ public class AttendanceAnalysisWrapper extends Service {
List<Map<String, Object>> recordData = Lists.newArrayList();
recordData.addAll(vactionList);
recordData.addAll(evectionResultList);
abnormalClockInListByEvction = abnormalClockInListByEvction.stream().filter(e -> (boolean) e.get("record")).collect(Collectors.toList());
recordData.addAll(abnormalClockInListByEvction);
List<Map<String, Object>> needRecordAbnormalList = abnormalClockInListByEvction.stream().filter(e -> (boolean) e.get("record")).collect(Collectors.toList());
if (needRecordAbnormalList.size() ==0 && abnormalClockInListByEvction.size() >0){
needRecordAbnormalList = abnormalClockInListByEvction.stream().filter(e->ClassSegmentTypeEnum.WORK_TIME.getKey().equals(e.get("bdlx"))).collect(Collectors.toList());
}
recordData.addAll(needRecordAbnormalList);
List<Map<String, Object>> workOverTimeItemList = (List<Map<String, Object>>)recordWorkOverTime.get("workOverTimeItemList");
if (workOverTimeItemList.size() > 0){
recordData.addAll(workOverTimeItemList);
@ -561,7 +568,7 @@ public class AttendanceAnalysisWrapper extends Service {
recordParam.put("overTimeHolidayList",recordWorkOverTime.get("overTimeHolidayList") == null?Lists.newArrayList():recordWorkOverTime.get("overTimeHolidayList"));
recordParam.put("overTimeResultList",recordWorkOverTime.get("overTimeResultList") == null?Lists.newArrayList():recordWorkOverTime.get("overTimeResultList"));
log.debug("recordParam : {}", recordParam);
if (abnormalClockInListByEvction.size() > 0) {
if (needRecordAbnormalList.size() > 0) {
recordParam.put("cqzt", CheckBoxEnum.CHECKED.getKey());
} else {
recordParam.put("cqzt", CheckBoxEnum.UNCHECKED.getKey());

@ -415,8 +415,8 @@ public class UpdateAttendanceResultWrapper extends Service {
Map<String, Object> map = Maps.newHashMap();
List<Map<String, Object>> resultList = Lists.newArrayList();
log.info("recordEvection evectionList :[{}]",evectionList);
log.info("recordEvection evectionItems :[{}]",evectionItems);
log.debug("recordEvection evectionList :[{}]",evectionList);
log.debug("recordEvection evectionItems :[{}]",evectionItems);
for (int i=0;i<evectionList.size();i++){
Map<String, Object> resultMap = Maps.newHashMap();
String kssj = evectionList.get(i).get("ksrq") + " "+evectionList.get(i).get("kssj");

@ -6,14 +6,12 @@ import com.engine.jucailinkq.attendance.component.ImportAndExport.service.ExcelE
import com.engine.jucailinkq.attendance.component.ImportAndExport.service.param.ImportParam;
import com.engine.jucailinkq.attendance.component.calendarscheduling.service.WorkRulesService;
import com.engine.jucailinkq.attendance.component.calendarscheduling.service.impl.WorkRulesServiceImpl;
import com.engine.jucailinkq.attendance.component.persongroup.commonutil.PersongroupCommonUtil;
import com.engine.jucailinkq.attendance.enums.ApplicableOrganizationEnum;
import com.engine.jucailinkq.attendance.enums.SchedulingApproachEnum;
import com.engine.jucailinkq.common.exception.AttendanceRunTimeException;
import com.engine.common.util.*;
import com.engine.jucailinkq.common.util.CommonUtil;
import com.engine.jucailinkq.common.util.DateUtil;
import com.engine.jucailinkq.common.util.DbTools;
import com.engine.jucailinkq.common.util.Utils;
import com.engine.jucailinkq.common.util.*;
import com.engine.jucailinkq.common.util.excel.ExcelParseHelper;
import com.engine.jucailinkq.common.util.excel.ExcelSupport;
import com.engine.jucailinkq.common.util.excel.ExcelUtil;
@ -60,7 +58,8 @@ public class ExcelExportImportServiceImpl extends Service implements ExcelExport
log.debug("查询条件:{}",paramMap);
Map<String, Object> scheduleResult = getWorkRulesService(user).getDepartSchedule(paramMap);
List<WeaTableColumn> columns = buildScheduleColumns((List<Map<String, Object>>) scheduleResult.get("columns"));
List<Map<String, Object>> records = buildScheduleRecords((List<Map<String, Object>>) scheduleResult.get("datas"));
List<Map<String, Object>> datas = (List<Map<String, Object>>) scheduleResult.get("datas");
List<Map<String, Object>> records = buildScheduleRecords(datas);
List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称
@ -79,6 +78,9 @@ public class ExcelExportImportServiceImpl extends Service implements ExcelExport
excelSheetData.addAll(rows);
String dateTime = Util.null2String(paramMap.get("dateTime"));
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, dateTime, columns.size());
}
@ -94,15 +96,28 @@ public class ExcelExportImportServiceImpl extends Service implements ExcelExport
log.debug("查询条件:{}",paramMap);
Map<String, Object> scheduleResult = getWorkRulesService(user).getDepartSchedule(paramMap);
List<WeaTableColumn> columns = buildScheduleColumns((List<Map<String, Object>>) scheduleResult.get("columns"));
List<Map<String, Object>> records = buildScheduleRecords((List<Map<String, Object>>) scheduleResult.get("datas"));
List<Map<String, Object>> datas = (List<Map<String, Object>>) scheduleResult.get("datas");
List<Map<String, Object>> records = buildScheduleRecords(datas);
List<List<Object>> excelSheetData = new ArrayList<>();
//工作簿名称
String sheetName = "日历排班";
excelSheetData.add(Arrays.asList(columns.stream().map(WeaTableColumn::getText).toArray()));
String sql = "select id,mc,attendance_organization from uf_jcl_kq_bcxx";
List<Map<String, Object>> bcData = DbTools.getSqlToList(sql);
Map<String,List<Map<String, Object>>> bcDataGroup = bcData.stream().collect(Collectors.groupingBy(e->e.get("id").toString()));
String modeId = Utils.getFormmodeIdMap().get("uf_jcl_kq_bcxx");
sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?";
List<Map<String,Object>> organizationList = DbTools.getSqlToList(sql,modeId);
ExtensionClassHolder.setPersonBelongGroupThreadLocal(PersongroupCommonUtil.getAllpersonBelongGroup());
CommonUtil.initPersonInfromation();
//工作簿数据
List<List<Object>> rows = new LinkedList<>();
List<List<String>> classNameRows = new LinkedList<>();
for (Map<String, Object> recordData : records) {
List<Object> row = new LinkedList<>();
for (WeaTableColumn column : columns) {
@ -110,23 +125,36 @@ public class ExcelExportImportServiceImpl extends Service implements ExcelExport
}
rows.add(row);
}
for (Map<String, Object> data:datas){
String resourceId = data.get("resourceId").toString();
Set<String> bcids = CommonUtil.getAllDataIds(resourceId,organizationList,DateUtil.getCurrentDate());
List<String> classNamerow = new LinkedList<>();
for (String bcid:bcids){
if (bcDataGroup.get(bcid) != null && bcDataGroup.get(bcid).size()>0){
classNamerow.add(bcDataGroup.get(bcid).get(0).get("mc").toString());
}
}
classNameRows.add(classNamerow);
}
excelSheetData.addAll(rows);
String dateTime = Util.null2String(paramMap.get("dateTime"));
//获取下拉列表中的值
String sql = "select mc from uf_jcl_kq_bcxx;";
List<Map<String, Object>> bcData = DbTools.getSqlToList(sql);
List<String> bcMcList = new ArrayList<>();
if (bcData.size() > 0) {
bcMcList = bcData.stream().map(e -> e.get("mc").toString()).collect(Collectors.toList());
bcMcList = bcData.stream().filter(e->Util.null2String(e.get("attendance_organization")).equals("")).map(e -> e.get("mc").toString()).collect(Collectors.toList());
}
//配置下拉列表的区域信息,依次为开始行、结束行、开始列、结束列
List<Integer> dropdownRange = new ArrayList<>();
dropdownRange.add(2);
dropdownRange.add(records.size() + 1);
dropdownRange.add(4);
dropdownRange.add(columns.size() + 3);
return ExcelUtil.genWorkbookV2WithDropdownList1(excelSheetData, sheetName, dateTime, columns.size(), bcMcList.toArray(new String[0]), dropdownRange);
return ExcelUtil.genWorkbookV2WithDropdownList1(excelSheetData, sheetName, dateTime, columns.size(), bcMcList, dropdownRange, classNameRows);
}
private List<Map<String, Object>> buildScheduleRecords(List<Map<String, Object>> dataInfo) {

@ -47,8 +47,12 @@ public class WorkRulesServiceImpl extends Service implements WorkRulesService {
Set<String> bcids = Sets.newHashSet();
ExtensionClassHolder.setPersonBelongGroupThreadLocal(PersongroupCommonUtil.getAllpersonBelongGroup());
CommonUtil.initPersonInfromation();
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?";
List<Map<String,Object>> organizationList = DbTools.getSqlToList(sql,modeId);
if (resourceIds !=null && !"".equals(resourceIds)){
for (String resourceId :resourceIds.split(",")){
bcids.addAll(CommonUtil.getAllDataIds(resourceId,modeId,DateUtil.getCurrentDate()));
bcids.addAll(CommonUtil.getAllDataIds(resourceId,organizationList,DateUtil.getCurrentDate()));
}
}
WeaTable table = new WeaTable();
String pageId = "936b04850b7b478cafd59d1cf4cb9fc1";

@ -0,0 +1,102 @@
package com.engine.jucailinkq.attendance.component.page.cmd;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.jucailinkq.common.util.DateUtil;
import com.engine.jucailinkq.common.util.DbTools;
import com.google.common.collect.Maps;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class GetPersonPageServiceCmd extends AbstractCommonCommand<Map<String,Object>> {
public GetPersonPageServiceCmd(Map<String,Object> params, User user){
this.params=params;
this.user=user;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
String generateDate = Util.null2String(params.get("generateDate"));
String userId = Util.null2String(params.get("userId"));
if ("".equals(userId)){
userId = String.valueOf(user.getUID());
}
String nowDate = Util.null2String(params.get("nowDate"));
if ("".equals(nowDate)){
nowDate = DateUtil.getCurrentDate();
}
String nowYearDate = nowDate.split("-")[0]+"-01-01";
String nowYearendDate = nowDate.split("-")[0]+"-12-31";
Map<String,Object> resultMap = Maps.newHashMap();
String sql = "select * from uf_jcl_kq_jqye where ygid=? and yqsxrq>=? and sxrq<=?";
List<Map<String, Object>> holidayDataList = DbTools.getSqlToList(sql,userId,nowDate,nowDate);
Map<String,List<Map<String, Object>>> holidayDataGroup = holidayDataList.stream().collect(Collectors.groupingBy(e->e.get("jqid").toString()));
Map<String,Map<String,Object>> holidayMap = Maps.newHashMap();
sql = "select id,mc name from uf_jcl_kq_kqxm";
Map<String,Object> itemMap = DbTools.getSqlToMapList(sql);
for (Map.Entry<String,List<Map<String, Object>>> entry:holidayDataGroup.entrySet()){
String jqid = entry.getKey();
List<Map<String, Object>> dataList = entry.getValue();
List<Map<String, Object>> oldData = dataList.stream().filter(e-> DateUtil.getTime(e.get("sxrq").toString())
.compareTo(DateUtil.getTime(nowYearDate)) <0).collect(Collectors.toList());
List<Map<String, Object>> nowData = dataList.stream().filter(e-> DateUtil.getTime(e.get("sxrq").toString())
.compareTo(DateUtil.getTime(nowYearDate)) >=0 && DateUtil.getTime(e.get("sxrq").toString())
.compareTo(DateUtil.getTime(nowYearendDate)) <=0).collect(Collectors.toList());
double allHoliday = dataList.stream().mapToDouble(e->Double.valueOf(e.get("wxsc").toString())).sum();
double oldHoliday = oldData.stream().mapToDouble(e->Double.valueOf(e.get("wxsc").toString())).sum();
double nowHoliday = allHoliday-oldHoliday;
Map<String,Object> map = Maps.newHashMap();
map.put("allHoliday",allHoliday);
map.put("oldHoliday",oldHoliday);
map.put("nowHoliday",nowHoliday);
map.put("holidayName",Util.null2String(itemMap.get(jqid)));
holidayMap.put(jqid,map);
}
resultMap.put("holiday",holidayMap);
int diffdays = DateUtil.getDays(generateDate, Calendar.DAY_OF_MONTH);
String startDate = generateDate + "-01";
String endDate = generateDate + "-" + diffdays;
sql = "select * from uf_jcl_kq_cqjg where ygid=? and rq>=? and rq<=?";
List<Map<String,Object>> attendaceResultList = DbTools.getSqlToList(sql,userId,startDate,endDate);
for (Map<String,Object> attendaceResult:attendaceResultList){
Map<String,Object> attendaceResultItem = Maps.newHashMap();
for (int i=1;i<=8;i++){
String xm = "xm" + i;
String sc = "sc" + i;
String item = Util.null2String(attendaceResult.get(xm));
if (!"".equals(item)){
String time = attendaceResult.get(sc).toString();
double havedAskforTime = attendaceResultItem.get(item) == null?0:Double.valueOf(attendaceResultItem.get(item).toString());
havedAskforTime = havedAskforTime+Double.valueOf(Util.null2String(time).equals("")?"1":Util.null2String(time));
attendaceResultItem.put(item,havedAskforTime);
}
}
Map<String,Object> attendaceResultItemName = Maps.newHashMap();
for (Map.Entry<String,Object> entry:attendaceResultItem.entrySet()){
attendaceResultItemName.put(Util.null2String(itemMap.get(entry.getKey())),entry.getValue());
}
attendaceResult.put("attendaceResultItemName",attendaceResultItemName);
}
resultMap.put("attendaceResult",attendaceResultList);
return resultMap;
}
}

@ -0,0 +1,8 @@
package com.engine.jucailinkq.attendance.component.page.service;
import java.util.Map;
public interface PersonPageService {
Map<String,Object> getPersonPageService(Map<String,Object> params);
}

@ -0,0 +1,16 @@
package com.engine.jucailinkq.attendance.component.page.service.impl;
import com.engine.core.impl.Service;
import com.engine.jucailinkq.attendance.component.page.cmd.GetPersonPageServiceCmd;
import com.engine.jucailinkq.attendance.component.page.service.PersonPageService;
import java.util.Map;
public class PersonPageServiceImpl extends Service implements PersonPageService {
@Override
public Map<String, Object> getPersonPageService(Map<String, Object> params) {
return commandExecutor.execute(new GetPersonPageServiceCmd(params,user));
}
}

@ -0,0 +1,47 @@
package com.engine.jucailinkq.attendance.component.page.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.jucailinkq.attendance.component.calendarscheduling.service.WorkRulesService;
import com.engine.jucailinkq.attendance.component.calendarscheduling.service.impl.WorkRulesServiceImpl;
import com.engine.jucailinkq.attendance.component.page.service.PersonPageService;
import com.engine.jucailinkq.attendance.component.page.service.impl.PersonPageServiceImpl;
import com.engine.jucailinkq.common.util.ApiReturnTools;
import lombok.extern.slf4j.Slf4j;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import java.util.Map;
@Slf4j
public class PersonPageAction {
private PersonPageService getPersonPageService(User user) {
return ServiceUtil.getService(PersonPageServiceImpl.class,user);
}
/**
*
* @return
*/
@POST
@Path("/getPersonPageData")
@Produces({"text/plain"})
public String saveScheduleResult(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
Map<String,Object> paramMap = ParamUtil.request2Map(request);
User user = HrmUserVarify.getUser(request, response);
Map<String,Object> dataMap = getPersonPageService(user).getPersonPageService(paramMap);
return ApiReturnTools.success(dataMap);
}catch (Exception e){
log.error("execute fail,catch error: [{}]",e);
return ApiReturnTools.error("500","saveApplicableOrganization error");
}
}
}

@ -34,7 +34,7 @@ public class VocationCmd extends AbstractCommonCommand<Map<String,Object>> {
public Map<String, Object> execute(CommandContext commandContext) {
List<Map<String,Object>> vocationList = (List<Map<String,Object>>)params.get("vocationList");
List<Map<String,Object>> userList = (List<Map<String,Object>>)params.get("userList");
List<Map<String,Object>> userfilter = userList.stream().filter(e->"-1".equals(e.get("scopeid"))).collect(Collectors.toList());
List<Map<String,Object>> userfilter = userList.stream().filter(e->"1".equals(e.get("scopeid"))).collect(Collectors.toList());
Map<String,Object> userMap = userfilter.size()>0?userfilter.get(0):Maps.newHashMap();
for (Map<String,Object> vocation : vocationList){

@ -83,7 +83,7 @@ public class ByIntervalPayMentWay implements HolidayGenerationWay{
//相差天数
int betweenDays = DateUtil.getBetWeenDays(qsrq, releaseDate.split(" ")[0]);
//相差月份
int betweenMonth = DateUtil.getBetWeenMonths(qsrq, releaseDate.split(" ")[0]);
int betweenMonth = DateUtil.getBetWeenMonthsNeedDayOfMonth(qsrq, releaseDate.split(" ")[0]);
//总工龄天数
int allWorkDays = Double.valueOf(ljcrglyfslwz).intValue() * 30 + betweenDays;
//总月数

@ -84,7 +84,7 @@ public class BySchedulePaymentWay implements HolidayGenerationWay{
//相差天数
int betweenDays = DateUtil.getBetWeenDays(qsrq, releaseDate.split(" ")[0]);
//相差月份
int betweenMonth = DateUtil.getBetWeenMonths(qsrq, releaseDate.split(" ")[0]);
int betweenMonth = DateUtil.getBetWeenMonthsNeedDayOfMonth(qsrq, releaseDate.split(" ")[0]);
//总工龄天数
int allWorkDays = Double.valueOf(ljcrglyfslwz).intValue() * 30 + betweenDays;
//总月数
@ -304,6 +304,7 @@ public class BySchedulePaymentWay implements HolidayGenerationWay{
}else {
int months = releaseDateMonths-divideTimeMonths+1;
restTime = getRestTime(months,endYearmap);
restTime += getRestTime(divideTimeMonths-1,beginYearmap);
}
}
}

@ -86,7 +86,7 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
//相差天数
int betweenDays = DateUtil.getBetWeenDays(qsrq, releaseDate.split(" ")[0]);
//相差月份
int betweenMonth = DateUtil.getBetWeenMonths(qsrq, releaseDate.split(" ")[0]);
int betweenMonth = DateUtil.getBetWeenMonthsNeedDayOfMonth(qsrq, releaseDate.split(" ")[0]);
//总工龄天数
int allWorkDays = Double.valueOf(ljcrglyfslwz).intValue() * 30 + betweenDays;
//总月数

@ -36,7 +36,7 @@ public class VocationServiceImpl extends Service implements VocationService {
String sql = "select a.id userid,a.*,b.* from hrmresource a left join cus_fielddata b on a.id=b.id where a.status <> '5' and a.status <> '4' and a.status <> '7' and a.id in (";
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where (type_n = 5 or type_n = 7) and changedate is not null";
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where changedate is not null";
//获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);

@ -1,5 +1,6 @@
package com.engine.jucailinkq.attendance.workflow.action;
import com.engine.jucailinkq.attendance.workflow.enums.WorkFlowTypeEnum;
import com.engine.jucailinkq.attendance.workflow.service.MakeUpClockInService;
import com.engine.jucailinkq.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
import com.engine.jucailinkq.common.util.CommonUtil;
@ -26,10 +27,11 @@ public class EvctionCheckAction implements Action {
@Override
public String execute(RequestInfo requestInfo) {
String requestid = requestInfo.getRequestid();
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.EVECTION,requestInfo.getWorkflowid());
//出差人员
String ccr = mainTableData.get("ccr");
try {

@ -3,6 +3,7 @@ package com.engine.jucailinkq.attendance.workflow.action;
import com.engine.common.util.ServiceUtil;
import com.engine.jucailinkq.attendance.component.AttendanceCycle.service.AttendanceCycleService;
import com.engine.jucailinkq.attendance.component.AttendanceCycle.service.impl.AttendanceCycleServiceImpl;
import com.engine.jucailinkq.attendance.workflow.enums.WorkFlowTypeEnum;
import com.engine.jucailinkq.attendance.workflow.service.MakeUpClockInService;
import com.engine.jucailinkq.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
import com.engine.jucailinkq.common.util.CommonUtil;
@ -31,7 +32,7 @@ public class EvectionApproveAction implements Action {
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.EVECTION,requestInfo.getWorkflowid());
//出差人员
String ccr = mainTableData.get("ccr");
try {

@ -1,6 +1,7 @@
package com.engine.jucailinkq.attendance.workflow.action;
import com.engine.common.util.ServiceUtil;
import com.engine.jucailinkq.attendance.workflow.enums.WorkFlowTypeEnum;
import com.engine.jucailinkq.attendance.workflow.service.MakeUpClockInService;
import com.engine.jucailinkq.attendance.workflow.service.impl.MakeUpClockInServiceImpl;
import com.engine.jucailinkq.common.util.CommonUtil;
@ -30,9 +31,9 @@ public class EvectionArchivingAction implements Action {
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.EVECTION,requestInfo.getWorkflowid());
//出差人员
String ccr = mainTableData.get("ccr");
// String ccr = mainTableData.get("ccr");
try {
//记录需要更改出勤结果数据状态的人员、日期信息
List<Map<String, String>> empDateList = new ArrayList<>();
@ -41,6 +42,7 @@ public class EvectionArchivingAction implements Action {
//遍历明细表1
for (Map<String, String> data : detailTableData) {
dateList = DateUtil.getDatesBetween(data.get("ksrq"), "".equals(Util.null2String(data.get("jsrq"))) ? data.get("ksrq") : data.get("jsrq"));
String ccr = data.get("ccr");
for (String date : dateList) {
//收集需要更改出勤结果数据状态的人员、日期信息
empDateItem = new HashMap<>();

@ -33,7 +33,7 @@ public class OvertimePlanApproveAction implements Action {
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN,requestInfo.getWorkflowid());
//加班人员
String jbry = mainTableData.get("jbry");
try {

@ -31,7 +31,7 @@ public class OvertimePlanArchivingAction implements Action {
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN,requestInfo.getWorkflowid());
//加班人员
String jbry = mainTableData.get("jbry");
try {

@ -35,7 +35,7 @@ public class OvertimePlanCheckAction implements Action {
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo);
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, WorkFlowTypeEnum.OVERTIME_PLAN,requestInfo.getWorkflowid());
log.info("OvertimePlanCheckAction_start, detailTableData_size : {}",detailTableData.size());
log.info("detailTableData : [{}]", detailTableData);
//加班人员

@ -30,7 +30,7 @@ public class BatchAskForLeaveWorkFlowApproveAction implements Action {
String requestid = requestInfo.getRequestid();
log.debug("**********BatchAskForLeaveWorkFlowApproveAction import data start**********");
// 流程表单明细表数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detailTableData : [{}]", detailTableData);
Map<String,List<Map<String, String>>> detailGroupMap = detailTableData.stream().collect(Collectors.groupingBy(e-> Util.null2String(e.get("qjr"))));

@ -31,14 +31,14 @@ public class BatchAskForLeaveWorkFlowArchivingAction implements Action {
public String execute(RequestInfo requestInfo) {
String requestid = requestInfo.getRequestid();
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE);
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("mainTableData : [{}]",mainTableData);
// 流程表单明细表1数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detailTableData : [{}]",detailTableData);
//流程表单明细表2数据
List<Map<String, String>> detailTable2 = CommonUtil.getDetailTableInfo(requestInfo,1,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTable2 = CommonUtil.getDetailTableInfo(requestInfo,1,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detailTable2Data : [{}]",detailTable2);
//第一笔开始时间

@ -38,20 +38,20 @@ public class BatchAskForLeaveWorkFlowBackAction implements Action {
String jlzt = Util.null2String(qjllData.get("jlzt"));
// 流程表单主表数据
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE);
HashMap<String,String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("mainTableData : [{}]",mainTableData);
// 流程表单明细表1数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detailTableData : [{}]",detailTableData);
String detail1TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[0].getTableDBName(),0,WorkFlowTypeEnum.ASKFORLEAVE);
String detail1TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[0].getTableDBName(),0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detail1ableName : [{}]", detail1TableName);
//流程表单明细表2数据
List<Map<String, String>> detailTable2 = CommonUtil.getDetailTableInfo(requestInfo,1,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTable2 = CommonUtil.getDetailTableInfo(requestInfo,1,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("BatchAskForLeaveWorkFlowBackAction-detailTable2Data : [{}]",detailTable2);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[1].getTableDBName(),1,WorkFlowTypeEnum.ASKFORLEAVE);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[1].getTableDBName(),1,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
log.info("detail2ableName : [{}]", detail2TableName);
sql = "select id,jqid,sxrq,ktsc,yxsc,wxsc,yqsxrq,ztsc from uf_jcl_kq_jqye order by sxrq";

@ -39,22 +39,32 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
public String execute(RequestInfo requestInfo) {
String requestid = requestInfo.getRequestid();
int billid = requestInfo.getRequestManager().getBillid();
// String requestid = "921921";
// int billid = 62;
log.info("billid : [{}]",billid);
User user = new User(Integer.parseInt("1"));
try {
// 流程表单主表数据
HashMap<String, String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE);
HashMap<String, String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
// String querysql = "select * from formtable_main_228 where id=?";
// Map<String,Object> mainTableData = DbTools.getSqlToMap(querysql,billid);
log.info("mainTableData : [{}]", mainTableData);
// 流程表单明细表1数据
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo, 0,WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTableData = CommonUtil.getDetailTableInfo(requestInfo, 0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
// querysql = "select * from formtable_main_228_dt1 where mainid=?";
//List<Map<String, String>> detailTableData = DbTools.getSqlToListStr(querysql,billid);
log.info("detailTableData : [{}]", detailTableData);
String detail1TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[0].getTableDBName(),0,WorkFlowTypeEnum.ASKFORLEAVE);
String detail1TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[0].getTableDBName(),0,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
//String detail1TableName = "formtable_main_228_dt1";
log.info("detail1TableName : [{}]", detail1TableName);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[1].getTableDBName(),1,WorkFlowTypeEnum.ASKFORLEAVE);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(requestInfo.getDetailTableInfo().getDetailTable()[1].getTableDBName(),1,WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
//String detail2TableName= "formtable_main_228_dt2";
log.info("detail2TableName : [{}]", detail2TableName);
//流程表单明细表3数据
List<Map<String, String>> detailTable3Data = CommonUtil.getDetailTableInfo(requestInfo,2, WorkFlowTypeEnum.ASKFORLEAVE);
List<Map<String, String>> detailTable3Data = CommonUtil.getDetailTableInfo(requestInfo,2, WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
//querysql = "select * from formtable_main_228_dt3 where mainid=?";
//List<Map<String, String>> detailTable3Data = DbTools.getSqlToListStr(querysql,billid);
log.info("detailTable3Data : [{}]", detailTable3Data);
//20241127需求变更明细表1存在数据时直接走原有校验逻辑明细表1没有数据时就根据明细表3重新生成明细表1数据然后继续原有校验逻辑
Map<String, Object> params = new HashMap<>();
@ -145,7 +155,7 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
empIdToName = data.stream().collect(Collectors.toMap(e->Util.null2String(e.get("id")),e->Util.null2String(e.get("lastname"))));
}
//获取假期类型的考勤项目
sql = "select id, mc, hsdw, zdyzsl, yxyz from uf_jcl_kq_kqxm where xmlx=?";
sql = "select id, mc, hsdw, zdyzsl, yxyz,qzsyyxjb,jcbyxsyqjb,yxsydjb from uf_jcl_kq_kqxm where xmlx=?";
List<Map<String,Object>> holidayItemList = DbTools.getSqlToList(sql, AttendanceItemTypeEnum.HOLIDAY.getKey());
Map<String, Map<String,Object>> kqxmInfo = holidayItemList.stream().collect(Collectors.toMap(e->Util.null2String(e.get("id")), e->e));
@ -164,12 +174,7 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
for(Map.Entry<String,List<Map<String,String>>> entry : detail1TabDataGroupByJqlx.entrySet()) {
if (checkAmountJqIdList.contains(entry.getKey())) {
sql = "select id,jqid,sxrq,ktsc,yxsc,wxsc,yqsxrq,ztsc,ygid from uf_jcl_kq_jqye where jqid=? and sxrq <= ? order by yqsxrq, modedatacreatedate, modedatacreatetime";
List<Map<String, Object>> holidayBalanceList = DbTools.getSqlToList(sql, entry.getKey(), minStartDate);
if (holidayBalanceList.size() > 0) {
holidayBalanceMap.putAll(holidayBalanceList.stream().collect(Collectors.toMap(e -> e.get("id").toString(), e -> e)));
jqlxToJqye.put(entry.getKey(), holidayBalanceList);
}
sql = "select id,mc,hsdw,hsl,jcbyxsyqjb,yxsydjb,qzsyyxjb from uf_jcl_kq_kqxm where id=?";
Map<String, Object> holidayItem = DbTools.getSqlToMap(sql, entry.getKey());
//假期核算单位
@ -200,7 +205,22 @@ public class BatchAskForLeaveWorkFlowSubmitAction implements Action {
//收集使用该假期类型的人员id
empIds.add(Util.null2String(detailData.get("qjr")));
}
List<Map<String, Object>> holidayPriorityItemList = Lists.newArrayList();
CommonUtil.getHolidayPriorityItem(holidayPriorityItemList,kqxmInfo,holidayItem);
jqlxToEmpIds.put(entry.getKey(), empIds);
for (Map<String, Object> map:holidayPriorityItemList){
jqlxToEmpIds.put(map.get("id").toString(),empIds);
}
holidayPriorityItemList.add(holidayItem);
for (Map<String, Object> holidayPriorityItem:holidayPriorityItemList){
sql = "select id,jqid,sxrq,ktsc,yxsc,wxsc,yqsxrq,ztsc,ygid from uf_jcl_kq_jqye where jqid=? and sxrq <= ? order by yqsxrq, modedatacreatedate, modedatacreatetime";
List<Map<String, Object>> holidayBalanceList = DbTools.getSqlToList(sql, holidayPriorityItem.get("id"), minStartDate);
if (holidayBalanceList.size() > 0) {
holidayBalanceMap.putAll(holidayBalanceList.stream().collect(Collectors.toMap(e -> e.get("id").toString(), e -> e)));
jqlxToJqye.put(holidayPriorityItem.get("id").toString(), holidayBalanceList);
}
}
}
}
//校验假期余额使用是否满足要求,并且区分核算单位“天”和“小时”

@ -30,7 +30,7 @@ public class GenerateWorkflowVocationAction implements Action {
public String execute(RequestInfo requestInfo) {
try {
log.info("**GenerateWorkflowVocationAction start***");
HashMap<String, String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE);
HashMap<String, String> mainTableData = CommonUtil.getMainTableInfo(requestInfo, WorkFlowTypeEnum.ASKFORLEAVE,requestInfo.getWorkflowid());
String qjry = mainTableData.get("xingm");
Map<String,String> formmodeIdMap = Utils.getFormmodeIdMap();
//假期额度模块id
@ -43,7 +43,7 @@ public class GenerateWorkflowVocationAction implements Action {
Map<String,Object> result = new GetPersonVocationBySuitOrganzation(params).execute(null);
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where type_n = 5 or type_n = 7 and resourceid=?";
String queryDepartEmployeeSql = "select resourceid ,changedate,type_n from HRMSTATUSHISTORY where resourceid=?";
//获取离职日期
List<Map<String,Object>> departEmployeeList = DbTools.getSqlToList(queryDepartEmployeeSql,qjry);
Map<String,Object> departEmployeeMap = CommonUtil.getDepartEmployeeMap(departEmployeeList);

@ -37,13 +37,14 @@ public class AskForLeaveWorkflowDataReset implements WorkFlowHandleTacis{
String tableName = requestMap.get("lcbd").toString();
String requestId = requestMap.get("requestId").toString();
String operate = requestMap.get("operate").toString();
String workflowid = requestMap.get("workflowid").toString();
Map<String,Object> mainMap = null;
List<Map<String, Object>> detailTableData = null;
List<Map<String, Object>> detailTable2 = null;
String detail1TableName = CommonUtil.getDetailTableInfoTableName(tableName+"_dt1",0,WorkFlowTypeEnum.ASKFORLEAVE);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(tableName+"_dt2",1,WorkFlowTypeEnum.ASKFORLEAVE);
String detail1TableName = CommonUtil.getDetailTableInfoTableName(tableName+"_dt1",0,WorkFlowTypeEnum.ASKFORLEAVE,workflowid);
String detail2TableName = CommonUtil.getDetailTableInfoTableName(tableName+"_dt2",1,WorkFlowTypeEnum.ASKFORLEAVE,workflowid);
if (operate.equals("dodelete")){
//删除流程

@ -35,6 +35,8 @@ public class BatchAskForLeaveWorkflowDataReset implements WorkFlowHandleTacis{
String tableName = requestMap.get("lcbd").toString();
String requestId = requestMap.get("requestId").toString();
String operate = requestMap.get("operate").toString();
String workflowid = requestMap.get("workflowid").toString();
Map<String,Object> mainMap = null;
List<Map<String, Object>> detailTableData = null;

@ -2,6 +2,7 @@ package com.engine.jucailinkq.attendance.workflow.proxy.tactics;
import com.alibaba.fastjson.JSONObject;
import com.engine.jucailinkq.attendance.workflow.enums.WorkFlowTypeEnum;
import com.engine.jucailinkq.common.util.CommonUtil;
import com.engine.jucailinkq.common.util.DateUtil;
import com.engine.jucailinkq.common.util.DbTools;
import com.google.common.collect.Lists;
@ -34,9 +35,13 @@ public class EvectionDataReset implements WorkFlowHandleTacis{
String tableName = requestMap.get("lcbd").toString();
String requestId = requestMap.get("requestId").toString();
String operate = requestMap.get("operate").toString();
String workflowid = requestMap.get("workflowid").toString();
Map<String,Object> mainMap = null;
List<Map<String, Object>> detailTableData = null;
String detail1TableName = CommonUtil.getDetailTableInfoTableName(tableName+"_dt1",0,WorkFlowTypeEnum.EVECTION,workflowid);
if (operate.equals("dodelete")){
//删除流程
String sql = "select deletetabledata from workflow_requestdeletelog where request_id=? and (isvalid is null or isvalid <> '1')";
@ -51,7 +56,7 @@ public class EvectionDataReset implements WorkFlowHandleTacis{
String sql = "select * from "+tableName+" where requestid=?";
mainMap = DbTools.getSqlToList(sql,requestId).get(0);
// 流程表单明细表1数据
sql = "select * from "+tableName+"_dt1 where mainid=?";
sql = "select * from "+detail1TableName+" where mainid=?";
detailTableData = DbTools.getSqlToList(sql,mainMap.get("id"));
}
log.info("detailTableData : [{}]",detailTableData);

@ -146,6 +146,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
log.info("mainTableData : {}", mainTableData);
// 流程表单明细表1数据
List<Map<String, String>> detailTableData = (List<Map<String, String>>)params.get("detailTableData");
String checkCycle = Util.null2String(params.get("checkCycle"));
//需要校验假期额度的假期类型
List<String> checkAmountJqIdList = CommonUtil.getJqInfoWithAmount();
//开始日期、结束日期、请假方式、开始时间、结束时间、假期类型、请假时长
@ -263,10 +264,13 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
String modeId = formmodeIdMap.get("uf_jcl_kq_jqed");
for(Map.Entry<String,List<Map<String,String>>> entry : leaveDetailGroupByEmp.entrySet()) {
//校验该人员的考勤周期是否正常
if (!checkCycle.equals("0")){
//需要检验
boolean kqCycleAllow = kqCycleCheck(entry.getKey(), entry.getValue(), errorMessage, empIdToName.get(entry.getKey()));
if (!kqCycleAllow) {
continue;
}
}
//20241021逻辑变更根据考勤项目的“优先使用项目”信息获取所有可使用假期余额信息
Map<String, List<Map<String, Object>>> canUseJqyeInfo = new HashMap<>();
//20241107需求变更获取所有可使用假期余额信息列表并按照失效期+级联优先级排序
@ -304,7 +308,34 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
entry.getValue(), editedEmpLeaveInfo.get(entry.getKey()), jbIdToHsdw, empIdToDateRatedHours.get(entry.getKey()));
}
if (detailListItem.size() > 0) {
completeLeaveDetailList.addAll(detailListItem);
Map<String,List<Map<String,String>>> detailGroup = detailListItem.stream().collect(Collectors.groupingBy(e->Util.null2String(e.get("ksrq"))+"&"+Util.null2String(e.get("jsrq"))));
List<Map<String,String>> newDetailListItem = Lists.newArrayList();
for (Map.Entry<String,List<Map<String,String>>> detailEntry :detailGroup.entrySet()){
String date = detailEntry.getKey();
List<Map<String,String>> detailList = detailEntry.getValue();
if (detailList.size() > 1){
String jqye = "";
double qjsc = 0;
for (Map<String,String> map:detailList){
if (!Util.null2String(map.get("jqye")).equals("")){
jqye += map.get("jqye")+",";
}
qjsc +=Double.valueOf(map.get("qjsc"));
}
if (!jqye.equals("")){
jqye = jqye.substring(0,jqye.length()-1);
}
detailList.get(0).put("jqye",jqye);
detailList.get(0).put("qjsc",Util.null2String(qjsc));
detailList.get(0).put("qjlx",holidayPriorityItemList.get(holidayPriorityItemList.size()-1).get("id").toString());
detailList.get(0).put("qjlxName",holidayPriorityItemList.get(holidayPriorityItemList.size()-1).get("mc").toString());
newDetailListItem.add(detailList.get(0));
}else {
newDetailListItem.addAll(detailList);
}
}
completeLeaveDetailList.addAll(newDetailListItem);
}
}

@ -216,16 +216,19 @@ public class CommonUtil {
/**
* id
* @param resourceId
* @param modeId
* @param date
* @return
*/
public static Set<String> getAllDataIds(String resourceId,String modeId,String date){
public static Set<String> getAllDataIds(String resourceId,List<Map<String,Object>> organizationList,String date){
String sql = "select dxlx,dataid,dx from uf_jcl_syzz where modeid=?";
List<Map<String,Object>> organizationList = DbTools.getSqlToList(sql,modeId);
sql = "select id,departmentid,subcompanyid1 from hrmresource where id =?";
Map<String,Object> departMentMap = DbTools.getSqlToMap(sql,resourceId);
Map<String, Map<String, Object>> personInformation = ExtensionClassHolder.getPersonInformationThreadLocal();
String sql = "select id,departmentid,subcompanyid1 from hrmresource where id =?";
Map<String,Object> departMentMap = null;
if (personInformation == null){
departMentMap = DbTools.getSqlToMap(sql,resourceId);
}else {
departMentMap = personInformation.get(resourceId);
}
Set<String> dataIds = Sets.newHashSet();
Map<String, List<Map<String,Object>>> organizationListGroupBydxlx = organizationList.stream().collect(Collectors.groupingBy(e ->e.get("dxlx").toString()));
//对象类型为人员
@ -345,9 +348,9 @@ public class CommonUtil {
* @param requestInfo
* @return
*/
public static HashMap<String,String> getMainTableInfo(RequestInfo requestInfo, WorkFlowTypeEnum workFlowTypeEnum){
String sql = "select a.yszdm id,a.lczdm name,b.lclx from uf_jcl_kq_kqlcsz_dt1 a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=?";
Map<String,Object> mappingMap = DbTools.getSqlToMapList(sql,workFlowTypeEnum.getKey());
public static HashMap<String,String> getMainTableInfo(RequestInfo requestInfo, WorkFlowTypeEnum workFlowTypeEnum,String workflowId){
String sql = "select a.yszdm id,a.lczdm name,b.lclx from uf_jcl_kq_kqlcsz_dt1 a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=? and ljid=?";
Map<String,Object> mappingMap = DbTools.getSqlToMapList(sql,workFlowTypeEnum.getKey(),workflowId);
HashMap<String,String> mainMap = new HashMap<String,String>();
HashMap<String,String> resultMap = new HashMap<String,String>();
Property[] properties = requestInfo.getMainTableInfo().getProperty();// 获取表单主字段信息
@ -409,7 +412,7 @@ public class CommonUtil {
* @param request
* @return
*/
public static List<Map<String, String>> getDetailTableInfo(RequestInfo request, int index,WorkFlowTypeEnum workFlowTypeEnum) {
public static List<Map<String, String>> getDetailTableInfo(RequestInfo request, int index,WorkFlowTypeEnum workFlowTypeEnum,String workflowId) {
String queryTable = "uf_jcl_kq_kqlcsz_dt2";
if (workFlowTypeEnum == WorkFlowTypeEnum.ASKFORLEAVE || workFlowTypeEnum == WorkFlowTypeEnum.BATCH_ASKFORLEAVE){
@ -418,8 +421,8 @@ public class CommonUtil {
queryTable = "uf_jcl_kq_kqlcsz_dt3";
}
}
String sql = "select a.yszdm,a.lczdm,a.lczdszb from "+queryTable+" a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=?";
List<Map<String,Object>> mappingList = DbTools.getSqlToList(sql,workFlowTypeEnum.getKey());
String sql = "select a.yszdm,a.lczdm,a.lczdszb from "+queryTable+" a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=? and ljid=?";
List<Map<String,Object>> mappingList = DbTools.getSqlToList(sql,workFlowTypeEnum.getKey(),workflowId);
String tableName = null;
for (Map<String,Object> map:mappingList){
if (map.get("lczdszb") != null && !map.get("lczdszb").equals("")){
@ -457,7 +460,7 @@ public class CommonUtil {
/**
*
*/
public static String getDetailTableInfoTableName(String tableName, int index,WorkFlowTypeEnum workFlowTypeEnum){
public static String getDetailTableInfoTableName(String tableName, int index,WorkFlowTypeEnum workFlowTypeEnum,String workflowId){
String queryTable = "uf_jcl_kq_kqlcsz_dt2";
if (workFlowTypeEnum == WorkFlowTypeEnum.ASKFORLEAVE || workFlowTypeEnum == WorkFlowTypeEnum.BATCH_ASKFORLEAVE){
if (index == 1){
@ -465,8 +468,8 @@ public class CommonUtil {
queryTable = "uf_jcl_kq_kqlcsz_dt3";
}
}
String sql = "select a.yszdm,a.lczdm,a.lczdszb from "+queryTable+" a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=?";
List<Map<String,Object>> mappingList = DbTools.getSqlToList(sql,workFlowTypeEnum.getKey());
String sql = "select a.yszdm,a.lczdm,a.lczdszb from "+queryTable+" a left join uf_jcl_kq_kqlcsz b on a.mainid=b.id where lclx=? and ljid=?";
List<Map<String,Object>> mappingList = DbTools.getSqlToList(sql,workFlowTypeEnum.getKey(),workflowId);
for (Map<String,Object> map:mappingList){
if (map.get("lczdszb") != null && !map.get("lczdszb").equals("")){
tableName= map.get("lczdszb").toString();
@ -1312,7 +1315,7 @@ public class CommonUtil {
if (list.size() > 1){
list = list.stream().sorted(Comparator.comparing(e->DateUtil.getTime(e.get("changedate").toString()).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
}
if (list.size() > 0 && Util.null2String(list.get(list.size()-1).get("type_n")).equals("5")){
if (list.size() > 0 && (Util.null2String(list.get(list.size()-1).get("type_n")).equals("5") || Util.null2String(list.get(list.size()-1).get("type_n")).equals("6") || Util.null2String(list.get(list.size()-1).get("type_n")).equals("1"))){
resultMap.put(userid,list.get(list.size()-1).get("changedate"));
}
}
@ -1348,4 +1351,14 @@ public class CommonUtil {
throw new AttendanceRunTimeException("请联系管理员获得密钥");
}
}
public static void getHolidayPriorityItem(List<Map<String, Object>> holidayPriorityItemList, Map<String, Map<String, Object>> holidayItemInfos, Map<String, Object> holidayItem) {
boolean useFirstItemSign = CheckBoxEnum.CHECKED.getKey().equals(holidayItem.get("qzsyyxjb")) && CheckBoxEnum.CHECKED.getKey().equals(holidayItem.get("jcbyxsyqjb"));
String useFirstItemId = useFirstItemSign ? Util.null2String(holidayItem.get("yxsydjb")) : "";
if (!"".equals(useFirstItemId) && holidayItemInfos.get(useFirstItemId) != null) {
holidayPriorityItemList.add(0, holidayItemInfos.get(useFirstItemId));
//获取下一级优先使用项目
getHolidayPriorityItem(holidayPriorityItemList, holidayItemInfos, holidayItemInfos.get(useFirstItemId));
}
}
}

@ -190,9 +190,28 @@ public class DateUtil {
YearMonth endYearMonth = YearMonth.from(endDate);
int betweenMonth = (int) ChronoUnit.MONTHS.between(startYearMonth, endYearMonth);
// if (startDate.getDayOfMonth()>endDate.getDayOfMonth()){
// betweenMonth= betweenMonth-1;
// }
if (startDate.getDayOfMonth()>endDate.getDayOfMonth()){
betweenMonth= betweenMonth-1;
}
return betweenMonth;
}
/**
*
* @param startTime yyyy-MM-dd
* @return
*/
public static int getBetWeenMonthsNeedDayOfMonth(String startTime,String endTime){
LocalDateTime startDate = DateUtil.getTime(startTime);
LocalDateTime endDate = DateUtil.getTime(endTime);
YearMonth startYearMonth = YearMonth.from(startDate);
YearMonth endYearMonth = YearMonth.from(endDate);
int betweenMonth = (int) ChronoUnit.MONTHS.between(startYearMonth, endYearMonth);
if (startDate.getDayOfMonth()>endDate.getDayOfMonth()){
betweenMonth= betweenMonth-1;
}
return betweenMonth;
}

@ -37,6 +37,28 @@ public class DbTools {
}
return result;
}
public static List<Map<String,String>> getSqlToListStr(String sql,Object...value){
RecordSet rs = thread.get();
List<Map<String,String>> result = new ArrayList<>();
if (value == null || value.length <=0 || "".equals(value)){
rs.executeQuery(sql);
}else {
rs.executeQuery(sql,value);
}
while (rs.next()){
Map<String,String> dataMap = new HashMap<>();
String[] columns = rs.getColumnName();
for (String column:columns){
dataMap.put(column.toLowerCase(),rs.getString(column));
if (column.toLowerCase().equals("keyid")){
dataMap.put("key",rs.getString(column));
}
}
result.add(dataMap);
}
return result;
}
public static List<Map<String,Object>> getSqlToListKeySmallLetter(String sql,Object...value){
RecordSet rs = thread.get();

@ -2,6 +2,7 @@ package com.engine.jucailinkq.common.util;
import com.engine.jucailinkq.attendance.attendanceanalysis.cmd.getclockInpoint.biz.AbstractAdjustClockPointAction;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -14,6 +15,7 @@ public class ExtensionClassHolder {
*/
private static ThreadLocal<List<AbstractAdjustClockPointAction>> adjustClockPointActionThreadLocal = new ThreadLocal<>();
/**
*
*/

@ -190,7 +190,7 @@ public class ExcelUtil {
return workbook;
}
public static HSSFWorkbook genWorkbookV2WithDropdownList1(List<List<Object>> rowList, String sheetName, String title, int titleCellNum, String[] dropdownData, List<Integer> deopdownRange) {
public static HSSFWorkbook genWorkbookV2WithDropdownList1(List<List<Object>> rowList, String sheetName, String title, int titleCellNum, List<String>dropdownData, List<Integer> deopdownRange,List<List<String>> classNameRows) {
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
// 设置title样式
HSSFCellStyle titleCellStyle = hssfWorkbook.createCellStyle();
@ -227,14 +227,21 @@ public class ExcelUtil {
//默认行高
sheet.setDefaultRowHeightInPoints(18);
//设置下拉列表
int startIndex = deopdownRange.get(0);
for (List<String> classNameRow:classNameRows){
Map<String, String> boxMap = new HashMap<>();
boxMap.put("班次名称", String.join(",", dropdownData));
classNameRow.addAll(dropdownData);
boxMap.put("班次名称", String.join(",", classNameRow));
//指定将下拉框添加至1-10行0-0列。即第一列的第2到11行
HSSFDataValidation dataValidation = createBox("班次名称", boxMap , deopdownRange.get(0), deopdownRange.get(1), deopdownRange.get(2), deopdownRange.get(3));
HSSFDataValidation dataValidation = createBox("班次名称", boxMap , startIndex, startIndex, deopdownRange.get(2), deopdownRange.get(3));
if(dataValidation != null) {
sheet.addValidationData(dataValidation);
}
sheet.addValidationData(dataValidation);
startIndex++;
}
// 合并第一行的前titleCellNum个单元格
CellRangeAddress cellRangeAddress = new CellRangeAddress(0, 0, 0, titleCellNum - 1);
sheet.addMergedRegion(cellRangeAddress);

Loading…
Cancel
Save