Ver código fonte

打卡管理-月结算排除跨月的一周,头部跨月的不排除

ZhangWenQiang 5 anos atrás
pai
commit
30e7409885

+ 6 - 2
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/wspunch/service/WsSettlementService.java

@@ -149,7 +149,9 @@ public class WsSettlementService extends CrudService<WsSettlementMapper, WsCompa
                 Date weekLastDate = localDate2Date(currentWeekList.get(1));
                 //判断本周是否跨月
                 boolean isNextMonth = isNextMonth(currentWeekList.get(0), currentWeekList.get(1), wsCompany);
-                if (!isNextMonth) {
+                //头部跨月的计算金额
+                boolean isFirstNextMonth = isNextMonth && i == 0;
+                if (!isNextMonth || isFirstNextMonth) {
                     wsPunchClockDto.setStartDate(weekFirstDate);
                     wsPunchClockDto.setEndDate(weekLastDate);
                     WsPunchClock wsPunchClockEntity = weekSettlement(wsPunchClockDto);
@@ -205,7 +207,9 @@ public class WsSettlementService extends CrudService<WsSettlementMapper, WsCompa
                 Date weekLastDate = localDate2Date(currentWeekList.get(1));
                 //判断本周是否跨月
                 boolean isNextMonth = isNextMonth(currentWeekList.get(0), currentWeekList.get(1), wsCompany);
-                if (!isNextMonth) {
+                //头部跨月的计算金额
+                boolean isFirstNextMonth = isNextMonth && i == 0;
+                if (!isNextMonth || isFirstNextMonth) {
                     wsPunchClockDto.setStartDate(weekFirstDate);
                     wsPunchClockDto.setEndDate(weekLastDate);
                     WsPunchClock wsPunchClockEntity = weekSettlement(wsPunchClockDto);