考勤假期拆分、休息班次生效加班计划、修改请假出差bug

zm_dev
liuliang 10 months ago
parent 138fc5c71b
commit 0a0cacca12

@ -1 +1 @@
аyГ~цЭ|дй~Й~хд|И}фЛ~ш}Т~М|юй~с}С}юЯ}У}Ь~к~Х}Н~г}ЭЖ|б}О}ЪрqчhаjЖkЛjВhТjгiлjфkзiУhЭlЩkуoжpжxЯuЭtЧvВvтwЛvа{иxяyТxЙvЮxЦvБyиxрzпwЧvзxаЫЧшСжМЧСъмЖСЪзнНШзЭдДоЩЪДвкдЩРыщчАяПЬэяЮчцПГЗУЪлощбЭхдЪтзЖТНБУщПсЩлэррЦькмИпЙПРжпАлиШФмюмШдшжиИЖъВнлОЙНиwбsСsЪvцsЕwаtПsщyАlГtДoфsшqлlЬqЦpЗrКlыsЖsвuрsХmхoьqЛrщlйjНZК\т^Й\ФZоVфZХXШ\РVИhбwчxкzБyп{Шzб|ш{оxОxЙ|фzд|яwи{ЗvБyК|ЦVеZюUаYфSТYхXе\цXэaцcвeщ_ЮWхWц^бTмRюTЫTПZсWж[ъTЕ]ы[ЪWТRДWгVоZГZЧUЮYСQсXЮWБYЦ[кZшgО~В~ыzю~л{РzвyК{Бxи~ц|М{ъ~тж|Ф}к~н}ычaчdВ]вhп]вaь^ГaК`гaй^ж_Ш]С]И]в^Т^в^и]Т]Х`ЯkКgшgюgЩgюhШcТ]жWЬkшiцqжh
<EFBFBD><EFBFBD>Y<EFBFBD>Y<EFBFBD>Y<EFBFBD>r<EFBFBD>t<EFBFBD><EFBFBD><EFBFBD>~<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>I

@ -12,18 +12,44 @@
<list default="true" id="baeb3dfb-5097-46c5-933e-6d1dab18b815" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.at" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.at" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.s" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat.values.s" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat_i" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/ade958e9-d72b-48ba-8be1-0441de7da9a5/entities/entities.dat_i" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/WEB-INF/sqllog/ecologysql" beforeDir="false" afterPath="$PROJECT_DIR$/WEB-INF/sqllog/ecologysql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/log/sdk.log" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/out/artifacts/hrm_attendance/hrm-attendance.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/hrm_attendance/hrm-attendance.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetScheduleResultListCmd.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/GetScheduleResultListCmd.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/MergeApairClockPoint.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/MergeApairClockPoint.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/ShiftServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/service/impl/ShiftServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/attendance/enums/ClockPointEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/attendance/enums/ClockPointEnum.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/common/util/CommonUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/common/util/CommonUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/com/engine/common/util/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/engine/common/util/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetAskForLeaveCmd.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetEvectionCmd.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetScheduleResultListCmd.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/GetScheduleResultListCmd.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/MergeApairClockPoint.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/cmd/getclockInpoint/MergeApairClockPoint.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/AskForLeaveServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/EvectionServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/ShiftServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/service/impl/ShiftServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/web/AttendanceanalysisAction.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/AttendanceAnalysisWrapper.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/action/askforleave/AskForLeaveWorkFlowSubmitAction.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/workflow/action/askforleave/AskForLeaveWorkFlowSubmitAction.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/attendance/enums/ClockPointEnum.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/attendance/enums/ClockPointEnum.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/common/util/CommonUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/common/util/CommonUtil.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/TestObj.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/TestObj.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/TestObj.java" beforeDir="false" afterPath="$PROJECT_DIR$/test/TestObj.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/engine/common/util/Utils.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/engine/common/util/Utils.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/Test.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/Test.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/test/Test.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -88,10 +114,10 @@
<recent name="D:\项目备份\考勤\hrm-attendance\src\com\engine\jucailin\cmd\calendar" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="workflow" />
<recent name="" />
<recent name="com.engine.attendance.attendanceanalysis.cmd.getclockInpoint" />
<recent name="vocation" />
<recent name="workflow" />
<recent name="calendarscheduling" />
</key>
</component>
@ -100,7 +126,15 @@
<command value="organzationList" />
</option>
</component>
<component name="RunManager" selected="Application.TestObj">
<component name="RunManager" selected="JUnit.Test.testAnalysis">
<configuration name="Test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Test" />
<module name="hrm-attendance" />
<shortenClasspath name="MANIFEST" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestMethod" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TestMethod" />
<module name="hrm-attendance" />
@ -157,23 +191,6 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Test.testRealse2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hrm-attendance" />
<shortenClasspath name="MANIFEST" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="TestAttendanceAllowance.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="TestAttendanceAllowance" />
<option name="MAIN_CLASS_NAME" value="TestAttendanceAllowance.Test" />
<option name="METHOD_NAME" value="testRealse2" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Test.testRealse3" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hrm-attendance" />
<shortenClasspath name="MANIFEST" />
@ -201,10 +218,10 @@
<recent_temporary>
<list>
<item itemvalue="JUnit.Test.testAnalysis" />
<item itemvalue="Application.Test" />
<item itemvalue="JUnit.Test2.testAnalysis" />
<item itemvalue="JUnit.Test.testRealse3" />
<item itemvalue="Application.TestMethod" />
<item itemvalue="JUnit.Test.testRealse2" />
</list>
</recent_temporary>
</component>
@ -694,7 +711,10 @@
<workItem from="1719365300280" duration="7628000" />
<workItem from="1719380573621" duration="14583000" />
<workItem from="1719405220886" duration="597000" />
<workItem from="1719452066813" duration="1908000" />
<workItem from="1719452066813" duration="7179000" />
<workItem from="1719467422078" duration="18814000" />
<workItem from="1719540209233" duration="6565000" />
<workItem from="1719552784074" duration="3553000" />
</task>
<servers />
</component>
@ -764,9 +784,14 @@
<option name="timeStamp" value="172" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/cmd/workovertime/GetOvertimeDurationCmd.java</url>
<line>63</line>
<option name="timeStamp" value="176" />
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java</url>
<line>414</line>
<option name="timeStamp" value="183" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/com/engine/attendance/attendanceanalysis/wrapper/UpdateAttendanceResultWrapper.java</url>
<line>422</line>
<option name="timeStamp" value="184" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,10 +1,12 @@
package com.engine.attendance.attendanceanalysis.cmd;
import com.engine.attendance.enums.AccountingUnitEnum;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassBelongToEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.DateUtil;
import com.engine.common.util.DbTools;
import com.engine.common.util.Utils;
@ -79,17 +81,49 @@ public class GetAskForLeaveCmd extends AbstractCommonCommand<Map<String,Object>>
}
sql = "select * from uf_jcl_kq_kqxm where id in ("+String.join(",",jplxSet)+")";
Map<String,List<Map<String,Object>>> collect = DbTools.getSqlToList(sql).stream().collect(Collectors.groupingBy(e->e.get("id").toString()));
List<Map<String,Object>> askForLeaveItemList = DbTools.getSqlToList(sql);
List<String> fatherItems = askForLeaveItemList.stream().filter(e->Util.null2String(e.get("sffzcx")).equals(CheckBoxEnum.CHECKED.getKey())).map(e->e.get("id").toString()).collect(Collectors.toList());
if (fatherItems.size() > 0){
sql = "select id keyid,mc kqxm,a.* from uf_jcl_kq_kqxm a where (xmzt is null or xmzt <> '0') and a.sjxm in ("+String.join(",",fatherItems)+")";
List<Map<String,Object>> sonItemList = DbTools.getSqlToList(sql);
Map<String,List<Map<String,Object>>> sonGroupMap = sonItemList.stream().collect(Collectors.groupingBy(e->e.get("sjxm").toString()));
for (Map<String,Object> attendanceItem :askForLeaveItemList){
if (CheckBoxEnum.CHECKED.getKey().equals(attendanceItem.get("sffzcx"))){
attendanceItem.put("sonItems",sonGroupMap.get(attendanceItem.get("id")));
}
}
}
Map<String,List<Map<String,Object>>> collect = askForLeaveItemList.stream().collect(Collectors.groupingBy(e->e.get("id").toString()));
for (Map<String,Object> askForLeaveData : haveAskForLeaveList){
Map<String,Object> askForLeaveItem = collect.get(askForLeaveData.get("jqlx")).get(0);
//是否分组呈现
String sffzcx = Util.null2String(askForLeaveItem.get("sffzcx"));
//全天请假
if (CheckBoxEnum.CHECKED.getKey().equals(askForLeaveData.get("qtj"))){
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
Map<String,Object> proportionMap = Utils.getClassSegmentTimeProportion(scheduleResult,analysisDate);
for (Map.Entry<String,Object> entry: proportionMap.entrySet()){
String bdlx = entry.getKey();
int betweenTimes = Integer.valueOf(entry.getValue().toString());
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,bdlx);
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),betweenTimes, AccountingUnitEnum.MINUTES));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}else {
Map<String,Object> map = Maps.newHashMap();
map.put("item",askForLeaveData.get("jqlx"));
map.put("itemduration",scheduleResult.get(0).get("edsc"));
resultList.add(map);
}
resultMap.put("alldayVaction",resultList);
}
@ -104,8 +138,8 @@ public class GetAskForLeaveCmd extends AbstractCommonCommand<Map<String,Object>>
put("bdlx", ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey());
put("dtkssj",askForLeaveData.get("kssj"));
put("dtjssj",askForLeaveData.get("jssj"));
put("ksdk",askForLeaveItem.get("fgsbxydk"));
put("jsdk",askForLeaveItem.get("lgsbxydk"));
put("ksdk",askForLeaveItem.get("lgsbxydk"));
put("jsdk",askForLeaveItem.get("fgsbxydk"));
put("tqdkfzs","60");
put("thdkfzs","60");
put("tqlghlfzs",askForLeaveItem.get("tqlghlfzs"));

@ -1,10 +1,12 @@
package com.engine.attendance.attendanceanalysis.cmd;
import com.engine.attendance.enums.AccountingUnitEnum;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassBelongToEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.DateUtil;
import com.engine.common.util.DbTools;
import com.engine.common.util.Utils;
@ -76,17 +78,49 @@ public class GetEvectionCmd extends AbstractCommonCommand<Map<String,Object>> {
return resultMap;
}
sql = "select * from uf_jcl_kq_kqxm where id in ("+String.join(",",cclxSet)+")";
Map<String,List<Map<String,Object>>> collect = DbTools.getSqlToList(sql).stream().collect(Collectors.groupingBy(e->e.get("id").toString()));
List<Map<String,Object>> evectionItemList = DbTools.getSqlToList(sql);
List<String> fatherItems = evectionItemList.stream().filter(e->Util.null2String(e.get("sffzcx")).equals(CheckBoxEnum.CHECKED.getKey())).map(e->e.get("id").toString()).collect(Collectors.toList());
if (fatherItems.size() > 0){
sql = "select id keyid,mc kqxm,a.* from uf_jcl_kq_kqxm a where (xmzt is null or xmzt <> '0') and a.sjxm in ("+String.join(",",fatherItems)+")";
List<Map<String,Object>> sonItemList = DbTools.getSqlToList(sql);
Map<String,List<Map<String,Object>>> sonGroupMap = sonItemList.stream().collect(Collectors.groupingBy(e->e.get("sjxm").toString()));
for (Map<String,Object> evectionItem :evectionItemList){
if (CheckBoxEnum.CHECKED.getKey().equals(evectionItem.get("sffzcx"))){
evectionItem.put("sonItems",sonGroupMap.get(evectionItem.get("id")));
}
}
}
Map<String,List<Map<String,Object>>> collect = evectionItemList.stream().collect(Collectors.groupingBy(e->e.get("id").toString()));
for (Map<String,Object> evectionData : haveEvectionList){
Map<String,Object> evectionItem = collect.get(evectionData.get("cclx")).get(0);
//是否分组呈现
String sffzcx = Util.null2String(evectionItem.get("sffzcx"));
//全天出差
if (CheckBoxEnum.CHECKED.getKey().equals(evectionData.get("qtcc"))){
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
Map<String,Object> proportionMap = Utils.getClassSegmentTimeProportion(scheduleResult,analysisDate);
for (Map.Entry<String,Object> entry: proportionMap.entrySet()){
String bdlx = entry.getKey();
int betweenTimes = Integer.valueOf(entry.getValue().toString());
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(evectionItem,bdlx);
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),betweenTimes, AccountingUnitEnum.MINUTES));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}else {
Map<String,Object> map = Maps.newHashMap();
map.put("item",evectionData.get("cclx"));
map.put("itemduration",scheduleResult.get(0).get("edsc"));
resultList.add(map);
}
resultMap.put("alldayEvection",resultList);
}
@ -101,8 +135,8 @@ public class GetEvectionCmd extends AbstractCommonCommand<Map<String,Object>> {
put("bdlx", ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey());
put("dtkssj",evectionData.get("kssj"));
put("dtjssj",evectionData.get("jssj"));
put("ksdk",evectionItem.get("fgsbxydk"));
put("jsdk",evectionItem.get("lgsbxydk"));
put("ksdk",evectionItem.get("lgsbxydk"));
put("jsdk",evectionItem.get("fgsbxydk"));
put("tqdkfzs","60");
put("thdkfzs","60");
put("tqlghlfzs",evectionItem.get("tqlghlfzs"));

@ -63,7 +63,7 @@ public class GetScheduleResultListCmd extends AbstractCommonCommand<Map<String,O
schedulMap.put("schedulingMapBydate",schedulingMapBydate);
Map<String,List<Map<String,Object>>> resultMap = Maps.newHashMap();
String sql = "select a.xxbdkzdjb,a.sfxx,a.id bcxx,a.edsc,a.zgzsc,a.bcsdxx,a.sfdx,a.sfkt,b.bdlx,a.btgz,a.fgsjd,a.zddxfz,a.dxhs,b.kssj dtkssj,b.jssj dtjssj,b.ksdk,b.jsdk,b.tqdkfzs,b.thdkfzs,b.edxss,b.sfdx dtsfdx,b.zddxfz dtzddxfz,b.dxhs dtdxhs,b.gsrq from uf_jcl_kq_bcxx a left join uf_jcl_kq_bcxx_dt1 b on a.id=b.mainid where a.id in (";
String sql = "select a.xxbdkzdjb,a.sfxx,a.id bcxx,a.edsc,a.zgzsc,a.bcsdxx,a.sfdx,a.sfkt,b.bdlx,a.btgz,a.fgsjd,a.zddxfz,a.dxhs,b.kssj dtkssj,b.jssj dtjssj,b.ksdk,b.jsdk,b.tqdkfzs,b.thdkfzs,b.edxss,b.edfzs,b.edts,b.sfdx dtsfdx,b.zddxfz dtzddxfz,b.dxhs dtdxhs,b.gsrq from uf_jcl_kq_bcxx a left join uf_jcl_kq_bcxx_dt1 b on a.id=b.mainid where a.id in (";
String bcxxIds = "";
for (Map.Entry<String,List<Map<String,Object>>> entry :schedulingMap.entrySet()){
if (!entry.getKey().equals("")){
@ -146,8 +146,8 @@ public class GetScheduleResultListCmd extends AbstractCommonCommand<Map<String,O
List<Map<String,Object>> overPlanattendanceItems = DbTools.getSqlToList(querySql,overtimePlan.get("jblx"));
map.put("bcxx",schedulingdateMap == null || schedulingdateMap.get(0) ==null ? "0" :schedulingdateMap.get(0).get("bcxx"));
map.put("bcsdxx",schedulingdateMap == null || schedulingdateMap.get(0) ==null ? "":schedulingdateMap.get(0).get("bcsdxx"));
map.put("bcxx",resultList == null || resultList.get(0) ==null ? "0" :resultList.get(0).get("bcxx"));
map.put("bcsdxx",resultList == null || resultList.get(0) ==null ? "":resultList.get(0).get("bcsdxx"));
if (resultList.size()>0){
map.put("edsc",Util.null2String(resultList.get(0).get("edsc")));
map.put("sfdx",Util.null2String(resultList.get(0).get("sfdx")));
@ -170,6 +170,7 @@ public class GetScheduleResultListCmd extends AbstractCommonCommand<Map<String,O
map.put("thdkfzs","60");
map.put("rqlx",dateMap.get(e.getKey()));
map.put("edxss",overtimePlan.get("jbsc"));
map.put("jblx",overPlanattendanceItems);
map.put("gsrq", ClassBelongToEnum.NOWDAY.getKey());
if (overPlanattendanceItems.size() >0){

@ -50,7 +50,14 @@ public class MergeApairClockPoint extends AbstractAdjustClockPointAction {
for (int j=startScheduleIndex+1;j<=endScheduleIndex;j++){
Map<String, Object> scheduleMap = scheduleResult.get(j);
if (!Utils.ifRestClassSegment(scheduleMap.get("bdlx").toString())){
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getkssjTime(scheduleMap,analysisDate)).pointType(ClockPointEnum.START).timeType(ClockPointEnum.EMPTY)
ClockPointEnum pointType = ClockPointEnum.START;
if (Utils.ifAskforOrEvctionClassSegment(scheduleMap.get("bdlx").toString())){
//当为请假出差时
pointType = ClockPointEnum.END;
}
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getkssjTime(scheduleMap,analysisDate)).pointType(pointType).timeType(ClockPointEnum.EMPTY)
.classSegmentType(scheduleMap.get("bdlx").toString()).record(false).build();
adjustClcokInPointList.add(clockPointDTO);
}
@ -66,7 +73,12 @@ public class MergeApairClockPoint extends AbstractAdjustClockPointAction {
for (int j=startScheduleIndex+1;j<=index;j++){
Map<String, Object> scheduleMap = scheduleResult.get(j);
if (!Utils.ifRestClassSegment(scheduleMap.get("bdlx").toString())){
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getkssjTime(scheduleMap,analysisDate)).pointType(ClockPointEnum.START).timeType(ClockPointEnum.AFTER)
ClockPointEnum pointType = ClockPointEnum.START;
if (Utils.ifAskforOrEvctionClassSegment(scheduleMap.get("bdlx").toString())){
//当为请假出差时
pointType = ClockPointEnum.END;
}
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getkssjTime(scheduleMap,analysisDate)).pointType(pointType).timeType(ClockPointEnum.AFTER)
.classSegmentType(scheduleMap.get("bdlx").toString()).record(false).clockTime(startPointDTO.getClockTime()).build();
// if (j<index){
// clockPointDTO.getClockTime().put("signdate",Utils.getjssjTime(scheduleMap,analysisDate).split(" ")[0]);
@ -85,7 +97,12 @@ public class MergeApairClockPoint extends AbstractAdjustClockPointAction {
for (int j=startScheduleIndex;j<endScheduleIndex;j++){
Map<String, Object> scheduleMap = scheduleResult.get(j);
if (!Utils.ifRestClassSegment(scheduleMap.get("bdlx").toString())){
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getjssjTime(scheduleMap,analysisDate)).pointType(ClockPointEnum.END).timeType(ClockPointEnum.EMPTY)
ClockPointEnum pointType = ClockPointEnum.END;
if (Utils.ifAskforOrEvctionClassSegment(scheduleMap.get("bdlx").toString())){
//当为请假出差时
pointType = ClockPointEnum.START;
}
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getjssjTime(scheduleMap,analysisDate)).pointType(pointType).timeType(ClockPointEnum.EMPTY)
.classSegmentType(scheduleMap.get("bdlx").toString()).record(false).build();
adjustClcokInPointList.add(clockPointDTO);
}
@ -100,7 +117,13 @@ public class MergeApairClockPoint extends AbstractAdjustClockPointAction {
for (int j=index;j<endScheduleIndex;j++){
Map<String, Object> scheduleMap = scheduleResult.get(j);
if (!Utils.ifRestClassSegment(scheduleMap.get("bdlx").toString())){
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getjssjTime(scheduleMap,analysisDate)).pointType(ClockPointEnum.END).timeType(ClockPointEnum.BEFORE)
ClockPointEnum pointType = ClockPointEnum.END;
if (Utils.ifAskforOrEvctionClassSegment(scheduleMap.get("bdlx").toString())){
//当为请假出差时
pointType = ClockPointEnum.START;
}
ClockPointDTO clockPointDTO = ClockPointDTO.builder().classTime(Utils.getjssjTime(scheduleMap,analysisDate)).pointType(pointType).timeType(ClockPointEnum.BEFORE)
.classSegmentType(scheduleMap.get("bdlx").toString()).record(false).clockTime(endPointDTO.getClockTime()).build();
// if (j>index){
// clockPointDTO.getClockTime().put("signdate",Utils.getkssjTime(scheduleMap,analysisDate).split(" ")[0]);

@ -86,7 +86,7 @@ public class AskForLeaveServiceImpl extends Service implements AskForLeaveServic
List<Map<String,Object>> offsetAskForLeaveAnomaly = Lists.newArrayList();
//请假时长,单位小时
int qjsc = param.get("qjsc") == null?0:Double.valueOf(Double.valueOf(param.get("qjsc").toString())*60).intValue();
int qjsc = param.get("qjsc") == null?0:Double.valueOf(Math.ceil(Double.valueOf(param.get("qjsc").toString())*60)).intValue();
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(param.get("tybcndbjlhbjs"));
//作用时段

@ -75,7 +75,7 @@ public class EvectionServiceImpl extends Service implements EvectionService {
abnormalClockInList = abnormalClockInList.stream().sorted(Comparator.comparing(e->Integer.valueOf(e.get("betweenMinutes").toString()))).collect(Collectors.toList());
//请假时长,单位小时
int ccsc = param.get("ccsc") == null?0:Double.valueOf(Double.valueOf(param.get("ccsc").toString())*60).intValue();
int ccsc = param.get("ccsc") == null?0:Double.valueOf(Math.ceil(Double.valueOf(param.get("ccsc").toString())*60)).intValue();
//同一天可抵消多个异常
List<Map<String,Object>> offsetEvectionAnomaly = Lists.newArrayList();
//作用时段

@ -338,7 +338,7 @@ public class ShiftServiceImpl extends Service implements ShiftService {
Map<String, Object> bcData = DbTools.getSqlToMap(bcSql);
String bcsdxx = Util.null2String(bcData.get("bcsdxx"));
String sql = "select a.xxbdkzdjb,a.sfxx,a.id bcxx,a.edsc,a.zgzsc,a.bcsdxx,a.sfdx,a.sfkt,b.bdlx,a.btgz,a.fgsjd,a.zddxfz,a.dxhs,b.kssj dtkssj,b.jssj dtjssj,b.ksdk,b.jsdk,b.tqdkfzs,b.thdkfzs,b.edxss,b.sfdx dtsfdx,b.zddxfz dtzddxfz,b.dxhs dtdxhs,b.gsrq from uf_jcl_kq_bcxx a left join uf_jcl_kq_bcxx_dt1 b on a.id=b.mainid where a.id =" + shiftId;
String sql = "select a.xxbdkzdjb,a.sfxx,a.id bcxx,a.edsc,a.zgzsc,a.bcsdxx,a.sfdx,a.sfkt,b.bdlx,a.btgz,a.fgsjd,a.zddxfz,a.dxhs,b.kssj dtkssj,b.jssj dtjssj,b.ksdk,b.jsdk,b.tqdkfzs,b.thdkfzs,b.edxss,b.edfzs,b.edts,b.sfdx dtsfdx,b.zddxfz dtzddxfz,b.dxhs dtdxhs,b.gsrq from uf_jcl_kq_bcxx a left join uf_jcl_kq_bcxx_dt1 b on a.id=b.mainid where a.id =" + shiftId;
List<Map<String,Object>> dataList = DbTools.getSqlToList(sql);
Map<String,List<Map<String,Object>>> resultMap = Maps.newHashMap();
List<Map<String,Object>> classs = Lists.newArrayList();

@ -44,8 +44,8 @@ public class AttendanceanalysisAction {
try {
Map<String,Object> paramMap = ParamUtil.request2Map(request);
// Map<String,Object> paramMap = Maps.newHashMap();
// paramMap.put("startDate","2024-06-13");
// paramMap.put("endDate","2024-06-13");
// paramMap.put("startDate","2024-06-21");
// paramMap.put("endDate","2024-06-21");
// paramMap.put("userIds","81");
String startDate = Util.null2String(paramMap.get("startDate"));

@ -6,6 +6,7 @@ import com.engine.attendance.attendanceanalysis.service.UtilService;
import com.engine.attendance.attendanceanalysis.service.impl.ComprehensiveWorkingHourServiceImpl;
import com.engine.attendance.attendanceanalysis.service.impl.UtilServiceImpl;
import com.engine.attendance.enums.CheckBoxEnum;
import com.engine.attendance.enums.ClassSegmentTypeEnum;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.DateUtil;
import com.engine.common.util.ServiceUtil;
@ -198,12 +199,18 @@ public class AttendanceAnalysisWrapper extends Service {
return null;
}
recordParam.put("rqlx", scheduleResult.get(0).get("rqlx"));
//休息班次,休息班打卡自动加班不算自动加班
//休息班次,休息班打卡自动加班不算自动加班,扣除原有的工作时段
if (scheduleResult.get(0).get("sfxx") != null && CheckBoxEnum.CHECKED.getKey().equals(scheduleResult.get(0).get("sfxx")) &&
scheduleResult.get(0).get("xxbdkzdjb") != null && CheckBoxEnum.UNCHECKED.getKey().equals(scheduleResult.get(0).get("xxbdkzdjb"))) {
List<Map<String,Object>> overTimePlanList = scheduleResult.stream().filter(e->e.get("bdlx").equals(ClassSegmentTypeEnum.OVERTIME_PLAN.getKey())).collect(Collectors.toList());
if (overTimePlanList.size() >0){
scheduleResult = scheduleResult.stream().filter(e->ClassSegmentTypeEnum.OVERTIME_PLAN.getKey().equals(e.get("bdlx")) || Utils.ifRestClassSegment(e.get("bdlx").toString()) || Utils.ifAskforOrEvctionClassSegment(e.get("bdlx").toString())).collect(Collectors.toList());
}else {
//没有加班计划,直接记为休息
updateAttendanceResultWrapper.recordRest(recordParam);
return null;
}
}
List<Map<String, Object>> askForLeaveAndEvctionSchedule = Lists.newArrayList();

@ -205,6 +205,8 @@ public class UpdateAttendanceResultWrapper extends Service {
String btj = Util.null2String(askForLeaveList.get(i).get("btj"));
//请假时长
String qjsc = Util.null2String(askForLeaveList.get(i).get("qjsc"));
//请假时长分钟数
int qjscMinute = "".equals(qjsc)?0:Double.valueOf(Math.ceil(Double.valueOf(qjsc)*60)).intValue();
//请假项目
Map<String,Object> askForLeaveItem = askForLeaveItems.get(askForLeaveList.get(i).get("jqlx"));
//自动移除时间区间内的非工作时长
@ -239,7 +241,7 @@ public class UpdateAttendanceResultWrapper extends Service {
askForLeaveService.askForLeaveByHalfDay(param);
}else if (!"".equals(qjsc)){
//时长请假
itemduration = Utils.getItemduration(hsl,hsdw,Double.valueOf(Double.valueOf(qjsc)*60).intValue(),AccountingUnitEnum.MINUTES);
itemduration = Utils.getItemduration(hsl,hsdw,qjscMinute,AccountingUnitEnum.MINUTES);
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultMap.put("itemduration",itemduration);
@ -259,16 +261,16 @@ public class UpdateAttendanceResultWrapper extends Service {
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
int total = offsetAskForLeaveAnomalyList.stream().mapToInt(e->Integer.valueOf(e.get("betweenMinutes").toString())).sum();
int more = 0;
if (total < Integer.valueOf(qjsc)*60){
more = Integer.valueOf(qjsc)*60-total;
if (total < qjscMinute){
more = qjscMinute-total;
}
List<Map<String,Object>> sortOffsetAskForLeaveAnomalyList = offsetAskForLeaveAnomalyList.stream().sorted(Comparator.comparing(e->Integer.valueOf(e.get("betweenMinutes").toString()))).collect(Collectors.toList());
for (int j=0;j<sortOffsetAskForLeaveAnomalyList.size();j++){
//异常班段类型
String bdlx = sortOffsetAskForLeaveAnomalyList.get(i).get("bdlx").toString();
//异常时间
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (j == 0){
int time = Integer.valueOf(sortOffsetAskForLeaveAnomalyList.get(i).get("betweenMinutes").toString());
if (j == sortOffsetAskForLeaveAnomalyList.size()-1){
time = time+more;
}
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,bdlx);
@ -276,7 +278,7 @@ public class UpdateAttendanceResultWrapper extends Service {
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),time,AccountingUnitEnum.MINUTES);
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",itemduration);
itemMap.put("item",itemMap.get("keyid"));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
@ -286,9 +288,9 @@ public class UpdateAttendanceResultWrapper extends Service {
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,ClassSegmentTypeEnum.WORK_TIME.getKey());
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),Double.valueOf(Double.valueOf(qjsc)*60).intValue(),AccountingUnitEnum.MINUTES);
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),qjscMinute,AccountingUnitEnum.MINUTES);
itemMap.put("itemduration",itemduration);
itemMap.put("item",itemMap.get("keyid"));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
@ -300,8 +302,8 @@ public class UpdateAttendanceResultWrapper extends Service {
if (CheckBoxEnum.CHECKED.getKey().equals(zdycbcndfgzsd)){
timeMinutes = Utils.removeRestTime(kssj,jssj,scheduleResult,analysisDate);
}
if (timeMinutes > Integer.valueOf(qjsc)*60){
timeMinutes = Integer.valueOf(qjsc)*60;
if (timeMinutes > qjscMinute){
timeMinutes = qjscMinute;
}
log.debug("recordAskForLeave timeMinutes [{}] ,hsl:{},hsdw",timeMinutes,hsl,hsdw);
itemduration = Utils.getItemduration(hsl,hsdw,timeMinutes,AccountingUnitEnum.MINUTES);
@ -322,7 +324,7 @@ public class UpdateAttendanceResultWrapper extends Service {
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),betweenTimes,AccountingUnitEnum.MINUTES));
itemMap.put("item",itemMap.get("keyid"));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
@ -362,14 +364,14 @@ public class UpdateAttendanceResultWrapper extends Service {
for (int i=0;i<evectionList.size();i++){
Map<String, Object> resultMap = Maps.newHashMap();
resultList.add(resultMap);
resultMap.put("item",evectionList.get(i).get("cclx"));
String kssj = evectionList.get(i).get("ksrq") + " "+evectionList.get(i).get("kssj");
String jssj = evectionList.get(i).get("jsrq")+ " "+evectionList.get(i).get("jssj");
//半天请假
String btj = Util.null2String(evectionList.get(i).get("btcc"));
//请假时长
String qjsc = Util.null2String(evectionList.get(i).get("ccsc"));
//出差时长
String ccsc = Util.null2String(evectionList.get(i).get("ccsc"));
//出差时长分钟数
int ccscMinute = "".equals(ccsc)?0:Double.valueOf(Math.ceil(Double.valueOf(ccsc)*60)).intValue();
//请假项目
Map<String,Object> evectionItem = evectionItems.get(evectionList.get(i).get("cclx"));
//自动移除时间区间内的非工作时长
@ -382,6 +384,13 @@ public class UpdateAttendanceResultWrapper extends Service {
String hsdw = Util.null2String(evectionItem.get("hsdw"));
//作用时间段
String zysd = Util.null2String(evectionItem.get("zysd"));
//是否分组呈现
String sffzcx = Util.null2String(evectionItem.get("sffzcx"));
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultList.add(resultMap);
resultMap.put("item",evectionList.get(i).get("cclx"));
}
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
@ -394,17 +403,60 @@ public class UpdateAttendanceResultWrapper extends Service {
if (CheckBoxEnum.CHECKED.getKey().equals(btj)){
//半天出差
evectionService.evectionByHalfDay(param);
}else if (!"".equals(qjsc)){
}else if (!"".equals(ccsc)){
//时长出差
itemduration = Utils.getItemduration(hsl,hsdw,Double.valueOf(Double.valueOf(qjsc)*60).intValue(),AccountingUnitEnum.MINUTES);
itemduration = Utils.getItemduration(hsl,hsdw,ccscMinute,AccountingUnitEnum.MINUTES);
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultMap.put("itemduration",itemduration);
param.put("ccsc",qjsc);
}
param.put("ccsc",ccsc);
param.put("tybcndbjlhbjs",tybcndbjlhbjs);
if (abnormalClockInList.size()>0){
Map<String,Object> map1 =evectionService.evectionByDurationTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
List<Map<String,Object>> offsetEvectionAnomalyList = (List<Map<String,Object>>)map1.get("offsetEvectionAnomaly");
offsetEvectionAnomaly.addAll(offsetEvectionAnomalyList);
//按时长请假,将标记请假作用的时段上的异常 按标准逻辑进行冲销如果冲销后还有多余时长如请假时长为1.5小时但员工当天有两个时段上各有不到30分钟的异常此时每个时段0.5小时需要冲销多出来的0.5小时放哪里,放到异常多的那个时段上
//有几个抵消异常计入几个请假考勤项目
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
int total = offsetEvectionAnomalyList.stream().mapToInt(e->Integer.valueOf(e.get("betweenMinutes").toString())).sum();
int more = 0;
if (total < ccscMinute){
more = ccscMinute-total;
}
List<Map<String,Object>> sortOffsetEvectionAnomalyList = offsetEvectionAnomalyList.stream().sorted(Comparator.comparing(e->Integer.valueOf(e.get("betweenMinutes").toString()))).collect(Collectors.toList());
for (int j=0;j<sortOffsetEvectionAnomalyList.size();j++){
//异常班段类型
String bdlx = sortOffsetEvectionAnomalyList.get(i).get("bdlx").toString();
//异常时间
int time = Integer.valueOf(sortOffsetEvectionAnomalyList.get(i).get("betweenMinutes").toString());
if (j == sortOffsetEvectionAnomalyList.size()-1){
time = time+more;
}
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(evectionItem,bdlx);
if (item != null){
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),time,AccountingUnitEnum.MINUTES);
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",itemduration);
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}
}else {
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(evectionItem,ClassSegmentTypeEnum.WORK_TIME.getKey());
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),ccscMinute,AccountingUnitEnum.MINUTES);
itemMap.put("itemduration",itemduration);
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}
}
}else {
@ -413,9 +465,11 @@ public class UpdateAttendanceResultWrapper extends Service {
if (CheckBoxEnum.CHECKED.getKey().equals(zdycbcndfgzsd)){
timeMinutes = Utils.removeRestTime(kssj,jssj,scheduleResult,analysisDate);
}
if (timeMinutes > ccscMinute){
timeMinutes = ccscMinute;
}
log.debug("recordEvection timeMinutes [{}] ,hsl:{},hsdw",timeMinutes,hsl,hsdw);
itemduration = Utils.getItemduration(hsl,hsdw,timeMinutes,AccountingUnitEnum.MINUTES);
resultMap.put("itemduration",itemduration);
param.put("kssj",kssj);
param.put("jssj",jssj);
if (abnormalClockInList.size()>0){
@ -423,6 +477,24 @@ public class UpdateAttendanceResultWrapper extends Service {
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
}
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
//按时间区间请假时 将连接的同一类型时段设置一种假别 计算出分钟时长后按核算量算出核算时长及单位即可
Map<String,Object> proportionMap = Utils.getAskLeaveAndEvctionProportion(kssj,jssj,scheduleResult,analysisDate);
for (Map.Entry<String,Object> entry: proportionMap.entrySet()){
String bdlx = entry.getKey();
int betweenTimes = Integer.valueOf(entry.getValue().toString());
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(evectionItem,bdlx);
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),betweenTimes,AccountingUnitEnum.MINUTES));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}else {
resultMap.put("itemduration",itemduration);
}
}
}
map.put("resultList",resultList);

@ -4,8 +4,8 @@ import com.finance.toolkit.BaseEnum;
public enum ClockPointEnum implements BaseEnum {
START("0","开始打卡时间点"),
END("1","结束打卡时间点"),
START("0","开始上班"),
END("1","结束上班"),
EMPTY("2","漏卡"),
EQUAL("3","打卡时间和班次时间相等"),
BEFORE("4","打卡时间在班次时间之前"),

@ -784,12 +784,14 @@ public class CommonUtil {
public static Map<String,Object> assembleAskForOrEvectionItem(Map<String,Object> itemMap,String bdlx){
List<Map<String,Object>> sonItems = (List<Map<String,Object>>)itemMap.get("sonItems");
String workfor = Utils.getWorkFor(bdlx);
if (sonItems != null && sonItems.size() > 0){
for (Map<String,Object> sonItem:sonItems){
String zysd = Util.null2String(sonItem.get("zysd"));
if (zysd.equals(workfor)){
return sonItem;
}
}
}
return null;
}

@ -467,6 +467,32 @@ public class Utils<T> {
return resultMap;
}
/**
* ,
* @return
*/
public static Map<String,Object> getClassSegmentTimeProportion(List<Map<String,Object>> scheduleResult,String analysisDate){
Map<String,Object> resultMap = Maps.newHashMap();
for (Map<String,Object> schedule: scheduleResult){
String bdlx = Util.null2String(schedule.get("bdlx"));
int edfzs = Util.null2String(schedule.get("edfzs")).equals("")?0:Integer.valueOf(Util.null2String(schedule.get("edfzs")));
if (!bdlx.equals(ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey()) && !bdlx.equals(ClassSegmentTypeEnum.EVECTION.getKey())){
if (bdlx.equals(ClassSegmentTypeEnum.OVERTIME_PLAN.getKey())){
String kssj = getkssjTime(schedule,analysisDate);
String jssj = getjssjTime(schedule,analysisDate);
edfzs = DateUtil.getBetWeenMinutes(kssj,jssj);
}
if (resultMap.get(bdlx) != null){
edfzs = edfzs + Integer.valueOf(resultMap.get(bdlx).toString());
}
resultMap.put(bdlx,edfzs);
}
}
return resultMap;
}
/**
*
* @param kssj
@ -872,6 +898,18 @@ public class Utils<T> {
return false;
}
}
/**
*
* @param classSegmentType
* @return
*/
public static boolean ifAskforOrEvctionClassSegment(String classSegmentType){
if (classSegmentType.equals(ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey()) || classSegmentType.equals(ClassSegmentTypeEnum.EVECTION.getKey())){
return true;
}else {
return false;
}
}
/**
* double

Binary file not shown.

@ -15,7 +15,7 @@ import java.util.stream.Collectors;
public class Test {
public static void main(String[] args) {
System.out.println((int) Math.ceil(Double.valueOf("0.18")*60));
// List<Integer> list = Lists.newArrayList();
// aa(list);
// System.out.println(list);

@ -0,0 +1,597 @@
package workflow;
import com.engine.attendance.attendanceanalysis.dto.clockpoint.ClockPointDTO;
import com.engine.attendance.attendanceanalysis.service.*;
import com.engine.attendance.attendanceanalysis.service.impl.*;
import com.engine.attendance.enums.*;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.DateUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.common.util.Utils;
import com.engine.core.impl.Service;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import weaver.general.Util;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class UpdateAttendanceResultWrapper extends Service {
private AbnormalAttendanceService beLateService = ServiceUtil.getService(AbnormalAttendanceServiceImpl.class);
private ForgetClockInService forgetClockInService = ServiceUtil.getService(ForgetClockInServiceImpl.class);
private AskForLeaveService askForLeaveService= ServiceUtil.getService(AskForLeaveServiceImpl.class);
private EvectionService evectionService= ServiceUtil.getService(EvectionServiceImpl.class);
private WorkOverTimeService workOverTimeService = ServiceUtil.getService(WorkOverTimeServiceImpl.class);
private ComprehensiveWorkingHourService comprehensiveWorkingHourService = ServiceUtil.getService(ComprehensiveWorkingHourServiceImpl.class);
private AllowanceService allowanceService = ServiceUtil.getService(AllowanceServiceImpl.class);
private UtilService utilService = ServiceUtil.getService(UtilServiceImpl.class);
/**
*
* */
public List<Map<String,Object>> recordAbnormalClockIn(Map<String,Object> params){
//卡点
List<ClockPointDTO> clcokInTimeDataList = (List<ClockPointDTO>)params.get("clcokInTimeData");
//考勤项目
List<Map<String,Object>> attendanceItems = (List<Map<String,Object>>)params.get("attendanceItems");
//排班
List<Map<String, Object>> scheduleResult = (List<Map<String,Object>>)params.get("scheduleResult");
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//人员
String userId = Util.null2String(params.get("userId"));
//请假集合
List<Map<String,Object>> askForLeaveList = (List<Map<String,Object>>)params.get("askForLeaveList");
//请假项目
Map<String,Map<String,Object>> askForLeaveItems = (Map<String,Map<String,Object>>)params.get("askForLeaveItems");
//出差集合
List<Map<String,Object>> evectionList = (List<Map<String,Object>>)params.get("evectionList");
//出差项目
Map<String,Map<String,Object>> evectionItems = (Map<String,Map<String,Object>>)params.get("evectionItems");
//以开始时间分割班次
Map<String,List<Map<String, Object>>> startScheduleResult = scheduleResult.stream().collect(Collectors.groupingBy(e->e.get("dtkssj").toString()));
//以结束时间分割班次
Map<String,List<Map<String, Object>>> endScheduleResult = scheduleResult.stream().collect(Collectors.groupingBy(e->e.get("dtjssj").toString()));
List<Map<String,Object>> resultList = Lists.newArrayList();
for (ClockPointDTO clcokInTimedto :clcokInTimeDataList){
//当天打卡数据
Map<String,Object> clcokInTimeData = clcokInTimedto.getClockTime();
//需要计算的班次打卡时间点
String pointTime = clcokInTimedto.getClassTime();
//start开始打卡时间点end结束打卡时间点
ClockPointEnum pointType = clcokInTimedto.getPointType();
//empty:漏卡equal:打卡时间和班次时间相等before打卡时间在班次时间之前after打卡时间在班次时间之后
ClockPointEnum timeType = clcokInTimedto.getTimeType();
//是否是请假、外出打卡
boolean ifevectionOrAskLeave = false;
if (ClassSegmentTypeEnum.ASK_FOR_LEAVE.getKey().equals(clcokInTimedto.getClassSegmentType()) ||
ClassSegmentTypeEnum.EVECTION.getKey().equals(clcokInTimedto.getClassSegmentType())){
ifevectionOrAskLeave = true;
}
//班次
Map<String, Object> classInfo = Maps.newHashMap();
if (ClockPointEnum.START.equals(pointType) && !ifevectionOrAskLeave){
classInfo = startScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.END.equals(pointType) && !ifevectionOrAskLeave){
classInfo = endScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.START.equals(pointType) && ifevectionOrAskLeave){
classInfo = endScheduleResult.get(pointTime.split(" ")[1]).get(0);
}else if (ClockPointEnum.END.equals(pointType) && ifevectionOrAskLeave){
classInfo = startScheduleResult.get(pointTime.split(" ")[1]).get(0);
}
if (ClockPointEnum.EMPTY.equals(timeType) || clcokInTimeData == null){
//漏卡
Map<String,Object> missCardParams = Maps.newHashMap();
missCardParams.put("classInfo",classInfo);
missCardParams.put("clcokInTimeData",clcokInTimeData);
missCardParams.put("attendanceItems",attendanceItems);
missCardParams.put("analysisDate",analysisDate);
missCardParams.put("userId",userId);
missCardParams.put("point",clcokInTimedto);
missCardParams.put("scheduleResult",scheduleResult);
log.debug("missCardParams classInfo: [{}],clcokInTimeData:[{}]",classInfo,clcokInTimeData);
List<Map<String,Object>> iforgetClockIn = forgetClockInService.forgetClockIn(missCardParams);
if (iforgetClockIn.size() >0){
iforgetClockIn.get(0).put("pointTime",pointTime);
iforgetClockIn.get(0).put("bdlx",classInfo.get("bdlx"));
iforgetClockIn.get(0).put("record",clcokInTimedto.isRecord());
iforgetClockIn.get(0).put("clcokInTimeData",clcokInTimeData);
resultList.add(iforgetClockIn.get(0));
}
}else if (ClockPointEnum.START.equals(pointType) && ClockPointEnum.AFTER.equals(timeType)){
//迟到
Map<String,Object> beLateParams = Maps.newHashMap();
beLateParams.put("classInfo",classInfo);
beLateParams.put("clcokInTimeData",clcokInTimeData);
beLateParams.put("attendanceItems",attendanceItems);
beLateParams.put("analysisDate",analysisDate);
beLateParams.put("userId",userId);
beLateParams.put("point",clcokInTimedto);
beLateParams.put("askForLeaveList",askForLeaveList);
beLateParams.put("askForLeaveItems",askForLeaveItems);
beLateParams.put("evectionList",evectionList);
beLateParams.put("evectionItems",evectionItems);
beLateParams.put("scheduleResult",scheduleResult);
log.debug("beLateParams classInfo: [{}],clcokInTimeData:[{}]",classInfo,clcokInTimeData);
List<Map<String,Object>> ifBeLate = beLateService.beLate(beLateParams);
if (ifBeLate.size() > 0){
ifBeLate.get(0).put("pointTime",pointTime);
ifBeLate.get(0).put("bdlx",classInfo.get("bdlx"));
ifBeLate.get(0).put("record",clcokInTimedto.isRecord());
ifBeLate.get(0).put("clcokInTimeData",clcokInTimeData);
resultList.add(ifBeLate.get(0));
}
}else if (ClockPointEnum.END.equals(pointType) && ClockPointEnum.BEFORE.equals(timeType)){
//早退
Map<String,Object> leaveEarlyParams = Maps.newHashMap();
leaveEarlyParams.put("classInfo",classInfo);
leaveEarlyParams.put("clcokInTimeData",clcokInTimeData);
leaveEarlyParams.put("attendanceItems",attendanceItems);
leaveEarlyParams.put("analysisDate",analysisDate);
leaveEarlyParams.put("userId",userId);
leaveEarlyParams.put("point",clcokInTimedto);
leaveEarlyParams.put("askForLeaveList",askForLeaveList);
leaveEarlyParams.put("askForLeaveItems",askForLeaveItems);
leaveEarlyParams.put("evectionList",evectionList);
leaveEarlyParams.put("evectionItems",evectionItems);
leaveEarlyParams.put("scheduleResult",scheduleResult);
log.debug("leaveEarlyParams classInfo: [{}],clcokInTimeData:[{}]",classInfo,clcokInTimeData);
List<Map<String,Object>> ifLeaveEarly = beLateService.leaveEarly(leaveEarlyParams);
if (ifLeaveEarly.size() > 0){
ifLeaveEarly.get(0).put("pointTime",pointTime);
ifLeaveEarly.get(0).put("bdlx",classInfo.get("bdlx"));
ifLeaveEarly.get(0).put("record",clcokInTimedto.isRecord());
ifLeaveEarly.get(0).put("clcokInTimeData",clcokInTimeData);
resultList.add(ifLeaveEarly.get(0));
}
}
}
// if (iforgetClockIn || ifBeLate ||ifLeaveEarly){
// return true;
// }
log.debug("abnormalClockInList : [{}]",resultList);
return resultList;
}
/**
*
* @param params
* @return
*/
public List<Map<String, Object>> recordWorkOverTime(Map<String,Object> params){
return workOverTimeService.recordWorkOverTime(params);
}
/**
*
* @param params
* @return
*/
public Map<String, Object> recordAskForLeave(Map<String,Object> params){
//请假项目
Map<String,Map<String,Object>> askForLeaveItems = (Map<String,Map<String,Object>>)params.get("askForLeaveItems");
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//排班
List<Map<String, Object>> scheduleResult = (List<Map<String,Object>>)params.get("scheduleResult");
//请假记录
List<Map<String, Object>> askForLeaveList = (List<Map<String,Object>>)params.get("askForLeaveList");
//异常记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)params.get("abnormalClockInList");
//请假抵消异常
List<Map<String,Object>> offsetAskForLeaveAnomaly = Lists.newArrayList();
Map<String, Object> map = Maps.newHashMap();
List<Map<String, Object>> resultList = Lists.newArrayList();
for (int i=0;i<askForLeaveList.size();i++){
Map<String, Object> resultMap = Maps.newHashMap();
String kssj = askForLeaveList.get(i).get("ksrq") + " "+askForLeaveList.get(i).get("kssj");
String jssj = askForLeaveList.get(i).get("jsrq")+ " "+askForLeaveList.get(i).get("jssj");
//半天请假
String btj = Util.null2String(askForLeaveList.get(i).get("btj"));
//请假时长
String qjsc = Util.null2String(askForLeaveList.get(i).get("qjsc"));
//请假时长分钟数
int qjscMinute = "".equals(qjsc)?0:Double.valueOf(Math.ceil(Double.valueOf(qjsc)*60)).intValue();
//请假项目
Map<String,Object> askForLeaveItem = askForLeaveItems.get(askForLeaveList.get(i).get("jqlx"));
//自动移除时间区间内的非工作时长
String zdycbcndfgzsd = Util.null2String(askForLeaveItem.get("zdycbcndfgzsd"));
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(askForLeaveItem.get("tybcndbjlhbjs"));
//作用时段
String zysd = Util.null2String(askForLeaveItem.get("zysd"));
//核算量
double hsl = Double.valueOf(Util.null2String(askForLeaveItem.get("hsl")));
//核算单位
String hsdw = Util.null2String(askForLeaveItem.get("hsdw"));
//是否分组呈现
String sffzcx = Util.null2String(askForLeaveItem.get("sffzcx"));
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultMap.put("item",askForLeaveList.get(i).get("jqlx"));
resultList.add(resultMap);
}
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
param.put("zysd",zysd);
param.put("scheduleResult",scheduleResult);
param.put("analysisDate",analysisDate);
double itemduration = 0;
if ("".equals(Util.null2String(askForLeaveList.get(i).get("kssj"))) || "".equals(Util.null2String(askForLeaveList.get(i).get("jssj")))){
//弹性请假,半天请假
if (CheckBoxEnum.CHECKED.getKey().equals(btj)){
//半天请假
askForLeaveService.askForLeaveByHalfDay(param);
}else if (!"".equals(qjsc)){
//时长请假
itemduration = Utils.getItemduration(hsl,hsdw,Double.valueOf(Double.valueOf(qjsc)*60).intValue(),AccountingUnitEnum.MINUTES);
if (!sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
resultMap.put("itemduration",itemduration);
}
param.put("qjsc",qjsc);
param.put("tybcndbjlhbjs",tybcndbjlhbjs);
if (abnormalClockInList.size()>0){
Map<String,Object> map1 = askForLeaveService.askForLeaveByDurationTime(param);
abnormalClockInList =(List<Map<String,Object>>)map1.get("abnormalClockInList");
List<Map<String,Object>> offsetAskForLeaveAnomalyList = (List<Map<String,Object>>)map1.get("offsetAskForLeaveAnomaly");
offsetAskForLeaveAnomaly.addAll(offsetAskForLeaveAnomalyList);
//按时长请假,将标记请假作用的时段上的异常 按标准逻辑进行冲销如果冲销后还有多余时长如请假时长为1.5小时但员工当天有两个时段上各有不到30分钟的异常此时每个时段0.5小时需要冲销多出来的0.5小时放哪里,放到异常多的那个时段上
//有几个抵消异常计入几个请假考勤项目
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
int total = offsetAskForLeaveAnomalyList.stream().mapToInt(e->Integer.valueOf(e.get("betweenMinutes").toString())).sum();
int more = 0;
if (total < qjscMinute){
more = qjscMinute-total;
}
List<Map<String,Object>> sortOffsetAskForLeaveAnomalyList = offsetAskForLeaveAnomalyList.stream().sorted(Comparator.comparing(e->Integer.valueOf(e.get("betweenMinutes").toString()))).collect(Collectors.toList());
for (int j=0;j<sortOffsetAskForLeaveAnomalyList.size();j++){
//异常班段类型
String bdlx = sortOffsetAskForLeaveAnomalyList.get(i).get("bdlx").toString();
//异常时间
int time = Integer.valueOf(abnormalClockInList.get(i).get("betweenMinutes").toString());
if (j == 0){
time = time+more;
}
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,bdlx);
if (item != null){
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),time,AccountingUnitEnum.MINUTES);
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",itemduration);
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}
}else {
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,ClassSegmentTypeEnum.WORK_TIME.getKey());
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemduration = Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),qjscMinute,AccountingUnitEnum.MINUTES);
itemMap.put("itemduration",itemduration);
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}
}
}else {
//按照开始时间,结束时间请假
int timeMinutes = DateUtil.getBetWeenMinutes(kssj,jssj);
if (CheckBoxEnum.CHECKED.getKey().equals(zdycbcndfgzsd)){
timeMinutes = Utils.removeRestTime(kssj,jssj,scheduleResult,analysisDate);
}
if (timeMinutes > qjscMinute){
timeMinutes = qjscMinute;
}
log.debug("recordAskForLeave timeMinutes [{}] ,hsl:{},hsdw",timeMinutes,hsl,hsdw);
itemduration = Utils.getItemduration(hsl,hsdw,timeMinutes,AccountingUnitEnum.MINUTES);
param.put("kssj",kssj);
param.put("jssj",jssj);
if (abnormalClockInList.size()>0){
Map<String,Object> map1 = askForLeaveService.askForLeaveByTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetAskForLeaveAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetAskForLeaveAnomaly"));
}
if (sffzcx.equals(CheckBoxEnum.CHECKED.getKey())){
//按时间区间请假时 将连接的同一类型时段设置一种假别 计算出分钟时长后按核算量算出核算时长及单位即可
Map<String,Object> proportionMap = Utils.getAskLeaveAndEvctionProportion(kssj,jssj,scheduleResult,analysisDate);
for (Map.Entry<String,Object> entry: proportionMap.entrySet()){
String bdlx = entry.getKey();
int betweenTimes = Integer.valueOf(entry.getValue().toString());
Map<String,Object> item = CommonUtil.assembleAskForOrEvectionItem(askForLeaveItem,bdlx);
if (item != null){
Map<String, Object> itemMap = Maps.newHashMap();
itemMap.put("itemduration",Utils.getItemduration(Double.valueOf(Util.null2String(item.get("hsl"))),Util.null2String(item.get("hsdw")),betweenTimes,AccountingUnitEnum.MINUTES));
itemMap.put("item",item.get("keyid"));
resultList.add(itemMap);
}
}
}else {
resultMap.put("itemduration",itemduration);
}
}
}
map.put("resultList",resultList);
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetAskForLeaveAnomaly",offsetAskForLeaveAnomaly);
return map;
}
/**
*
* @param params
* @return
*/
public Map<String, Object> recordEvection(Map<String,Object> params){
//外出项目
Map<String,Map<String,Object>> evectionItems = (Map<String,Map<String,Object>>)params.get("evectionItems");
//排班
List<Map<String, Object>> scheduleResult = (List<Map<String,Object>>)params.get("scheduleResult");
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//出差记录
List<Map<String, Object>> evectionList = (List<Map<String,Object>>)params.get("evectionList");
//异常记录
List<Map<String,Object>> abnormalClockInList = (List<Map<String,Object>>)params.get("abnormalClockInList");
//外出抵消异常
List<Map<String,Object>> offsetEvectionAnomaly = Lists.newArrayList();
Map<String, Object> map = Maps.newHashMap();
List<Map<String, Object>> resultList = Lists.newArrayList();
for (int i=0;i<evectionList.size();i++){
Map<String, Object> resultMap = Maps.newHashMap();
resultList.add(resultMap);
resultMap.put("item",evectionList.get(i).get("cclx"));
String kssj = evectionList.get(i).get("ksrq") + " "+evectionList.get(i).get("kssj");
String jssj = evectionList.get(i).get("jsrq")+ " "+evectionList.get(i).get("jssj");
//半天请假
String btj = Util.null2String(evectionList.get(i).get("btcc"));
//请假时长
String qjsc = Util.null2String(evectionList.get(i).get("ccsc"));
//请假项目
Map<String,Object> evectionItem = evectionItems.get(evectionList.get(i).get("cclx"));
//自动移除时间区间内的非工作时长
String zdycbcndfgzsd = Util.null2String(evectionItem.get("zdycbcndfgzsd"));
//同一天可抵消多个异常
String tybcndbjlhbjs = Util.null2String(evectionItem.get("tybcndbjlhbjs"));
//核算量
double hsl = Double.valueOf(Util.null2String(evectionItem.get("hsl")));
//核算单位
String hsdw = Util.null2String(evectionItem.get("hsdw"));
//作用时间段
String zysd = Util.null2String(evectionItem.get("zysd"));
Map<String,Object> param = Maps.newHashMap();
param.put("abnormalClockInList",abnormalClockInList);
param.put("zysd",zysd);
param.put("scheduleResult",scheduleResult);
param.put("analysisDate",analysisDate);
double itemduration = 0;
if ("".equals(Util.null2String(evectionList.get(i).get("kssj"))) || "".equals(Util.null2String(evectionList.get(i).get("jssj")))){
//弹性请假,半天出差
if (CheckBoxEnum.CHECKED.getKey().equals(btj)){
//半天出差
evectionService.evectionByHalfDay(param);
}else if (!"".equals(qjsc)){
//时长出差
itemduration = Utils.getItemduration(hsl,hsdw,Double.valueOf(Double.valueOf(qjsc)*60).intValue(),AccountingUnitEnum.MINUTES);
resultMap.put("itemduration",itemduration);
param.put("ccsc",qjsc);
param.put("tybcndbjlhbjs",tybcndbjlhbjs);
if (abnormalClockInList.size()>0){
Map<String,Object> map1 =evectionService.evectionByDurationTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
}
}
}else {
//按照开始时间,结束时间出差
int timeMinutes = DateUtil.getBetWeenMinutes(kssj,jssj);
if (CheckBoxEnum.CHECKED.getKey().equals(zdycbcndfgzsd)){
timeMinutes = Utils.removeRestTime(kssj,jssj,scheduleResult,analysisDate);
}
log.debug("recordEvection timeMinutes [{}] ,hsl:{},hsdw",timeMinutes,hsl,hsdw);
itemduration = Utils.getItemduration(hsl,hsdw,timeMinutes,AccountingUnitEnum.MINUTES);
resultMap.put("itemduration",itemduration);
param.put("kssj",kssj);
param.put("jssj",jssj);
if (abnormalClockInList.size()>0){
Map<String,Object> map1 = evectionService.evectionByTime(param);
abnormalClockInList = (List<Map<String,Object>>)map1.get("abnormalClockInList");
offsetEvectionAnomaly.addAll((List<Map<String,Object>>)map1.get("offsetEvectionAnomaly"));
}
}
}
map.put("resultList",resultList);
map.put("abnormalClockInList",abnormalClockInList);
map.put("offsetEvectionAnomaly",offsetEvectionAnomaly);
return map;
}
/**
* ,
* @param params
* @return
*/
public List<Map<String,Object>> recordNormal(Map<String,Object> params){
//排班
List<Map<String, Object>> scheduleResult = (List<Map<String,Object>>)params.get("scheduleResult");
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//人员
String userId = Util.null2String(params.get("userId"));
//日期类型
String rqlx = Util.null2String(scheduleResult.get(0).get("rqlx"));
List<Map<String, Object>> resultList = Lists.newArrayList();
Map<String,Object> normalParams = Maps.newHashMap();
// normalParams.put("userId",userId);
// normalParams.put("date",analysisDate);
// normalParams.put("classInfo",scheduleResult);
// normalParams.put("modeId",params.get("modeId"));
if (DateTypeEnum.WORK_DAY.getKey().equals(rqlx) || DateTypeEnum.CHANGECLASS.getKey().equals(rqlx)){
//工作日
normalParams.put("item",SystemItemEnum.WORK_DAY.getKey());
}else if (DateTypeEnum.HOLIDAY.getKey().equals(rqlx)){
//节假日
normalParams.put("item",SystemItemEnum.HOLIDAY.getKey());
}else if (DateTypeEnum.PUBLIC_RESTDAY.getKey().equals(rqlx) ||
DateTypeEnum.EXCHANGE_LEAVEDAY.getKey().equals(rqlx)){
//休息日
normalParams.put("item",SystemItemEnum.REST_DAY.getKey());
}
resultList.add(normalParams);
//commandExecutor.execute(new UpdateAttendanceResultsCmd(normalParams));
return resultList;
}
/**
*
* @param params
* @return
*/
public boolean recordNoClass(Map<String,Object> params){
//分析日期
String analysisDate = Util.null2String(params.get("analysisDate"));
//人员
String userId = Util.null2String(params.get("userId"));
//综合工时
List<Map<String,Object>> workHourItems = (List<Map<String,Object>>)params.get("workHourItems");
//津贴
Map<String,Object> allowanceMap = (Map<String,Object>)params.get("allowanceMap");
log.debug("userId : {} ,analysisDate: {} have no class",userId,analysisDate);
Map<String,Object> recordParam = Maps.newHashMap();
recordParam.put("userId",userId);
recordParam.put("analysisDate",analysisDate);
recordParam.put("recordData",Lists.newArrayList());
String rqlx = CommonUtil.getRqlx(userId,analysisDate);
recordParam.put("rqlx",rqlx);
recordParam.put("classInfo",Lists.newArrayList());
recordParam.put("recordDataTime",Maps.newHashMap());
recordParam.put("attendanceDuration",0);
recordParam.put("formmodeIdMap",Utils.getFormmodeIdMap());
List<Map<String, Object>> recordDataList = Lists.newArrayList();;
if (allowanceMap.get("ifnotWork") != null){
//次日免班
recordParam.put("cqzt",CheckBoxEnum.UNCHECKED.getKey());
utilService.recordItem(recordParam);
return false;
}
if (rqlx.equals(DateTypeEnum.WORK_DAY.getKey()) || rqlx.equals(DateTypeEnum.CHANGECLASS.getKey())){
recordParam.put("cqzt",CheckBoxEnum.CHECKED.getKey());
recordDataList.add(new HashMap(){{
put("item",SystemItemEnum.NO_SCHEDULING.getKey());
put("itemduration","NULL");
}});
}else {
recordParam.put("cqzt",CheckBoxEnum.UNCHECKED.getKey());
recordParam.put("sfxx",CheckBoxEnum.CHECKED.getKey());
}
if (workHourItems != null && workHourItems.size() >0 ){
//核算工时的日期类型
String hsgsdrqlx = Util.null2String(workHourItems.get(0).get("hsgsdrqlx"));
rqlx = Utils.getDateType(analysisDate,Util.null2String(workHourItems.get(0).get("qyrl")));
params.put("workHourItem",workHourItems.get(0));
if (CommonUtil.ifContainStr(hsgsdrqlx,rqlx,",")){
//走综合工时
comprehensiveWorkingHourService.excuteByWorkHour(params);
}else {
//没有排班
recordParam.put("recordData",recordDataList);
utilService.recordItem(recordParam);
}
}else {
//没有排班
recordParam.put("recordData",recordDataList);
utilService.recordItem(recordParam);
}
return false;
}
/**
*
* @param params
* @return
*/
public Map<String,Object> allowanceHandle(Map<String,Object> params){
return allowanceService.allowanceHandle(params);
}
/**
*
* @param params
* @return
*/
public Map<String,Object> removeAbnormal(Map<String,Object> params){
return allowanceService.removeAbnormal(params);
}
/**
*
* @param params
* @return
*/
public Map<String,Object> getAskForLeave(Map<String,Object> params){
return askForLeaveService.getAskForLeave(params);
}
/**
*
* @param params
* @return
*/
public Map<String,Object> getEvection(Map<String,Object> params){
return evectionService.getEvection(params);
}
/**
*
*/
public void recordRest(Map<String,Object> recordParam){
recordParam.put("recordData",Lists.newArrayList());
recordParam.put("recordDataTime",Maps.newHashMap());
recordParam.put("attendanceDuration",0);
recordParam.put("cqzt",CheckBoxEnum.UNCHECKED.getKey());
recordParam.put("sfxx",CheckBoxEnum.CHECKED.getKey());
utilService.recordItem(recordParam);
}
}
Loading…
Cancel
Save