瀏覽代碼

Merge remote-tracking branch 'origin/master'

zhengqiang 4 年之前
父節點
當前提交
1550fb55cf

+ 28 - 2
web/src/main/java/com/jpsoft/shinestar/modules/business/controller/WorkScheduleAttendanceController.java

@@ -681,6 +681,9 @@ public class WorkScheduleAttendanceController {
             //List<Date> attendanceList = workScheduleAttendanceService.findAttendanceDateByPersonAndMonths(Long.valueOf(personId),months);
             List<Date> schedulingDayList = workPersonSchedulingService.findSchedulingDayByPersonIdSDateAndEDate(pi.getId(), sdf.parse(startMonth), sdf.parse(endMonth), true);
 
+            //统计班次次数
+            Map<String,Object> workShiftDayMap = new HashMap<>();
+
             for(Date attendanceDate : schedulingDayList) {
                 //wsaDTO.setPersonInfo(pi);
                 WorkPersonScheduling wps = workPersonSchedulingService.findByPersonIdSchedulingDay(pi.getId(), attendanceDate);
@@ -699,8 +702,22 @@ public class WorkScheduleAttendanceController {
                         int notSwipingNum = 0;
                         for (int i = 0; i < shiftIds.length; i++) {
                             String shiftId = shiftIds[i];
-                            String shiftNumber = workShiftInfoService.findNumberById(shiftId);
-                            shiftNumbers.add(shiftNumber);
+
+                            WorkShiftInfo workShiftInfo = workShiftInfoService.get(shiftId);
+                            String shiftNumber = workShiftInfo.getNumber();
+
+                            int workShiftNum = 0;
+                            if(workShiftDayMap.get(workShiftInfo.getName()) != null){
+                                workShiftNum = Integer.parseInt(workShiftDayMap.get(workShiftInfo.getName()).toString());
+                            }
+                            if(workShiftNum > 0){
+                                workShiftDayMap.replace(workShiftInfo.getName(),workShiftNum+1);
+                            }else{
+                                workShiftDayMap.put(workShiftInfo.getName(),workShiftNum+1);
+                            }
+
+
+                            shiftNumbers.add(workShiftInfo.getNumber());
 
                             List<WorkScheduleAttendance> wsaList = workScheduleAttendanceService.findByPersonIdAndShiftIdAndAttendanceDate(pi.getId(), shiftId, sdf.format(attendanceDate));
                             //单排班只有2条记录 1条上班1条下班
@@ -875,8 +892,17 @@ public class WorkScheduleAttendanceController {
                 }
             }
 
+
+
+            Set<Map.Entry<String, Object>> entryseSet = workShiftDayMap.entrySet();
+            String workShiftDayNotes = "";
+            for (Map.Entry<String, Object> entry:entryseSet) {
+                workShiftDayNotes = workShiftDayNotes +  "" + entry.getKey()+":"+entry.getValue() + "次;";
+            }
+
             resultMap.put("wsaList", wsaDTOList);
             resultMap.put("personInfo", pi);
+            resultMap.put("workShiftDayNotes", workShiftDayNotes);
 
             msgResult.setResult(true);
             msgResult.setData(resultMap);

+ 6 - 6
web/src/main/resources/application-dev.yml

@@ -5,17 +5,17 @@ server:
 
 spring:
   datasource:
-     url: jdbc:log4jdbc:mysql://192.168.33.20:3306/shine_star?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-     username: root
-     password: jpsoft2016
+     #url: jdbc:log4jdbc:mysql://192.168.33.20:3306/shine_star?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+     #username: root
+     #password: jpsoft2016
      #测试环境下
      #url: jdbc:log4jdbc:mysql://47.92.161.104:3336/jp_.shinestar._2.0?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
      #username: root
      #password: jpsoft8121234
      #正式环境下
-#     url: jdbc:log4jdbc:mysql://223.75.170.44:3366/shine_star?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-#     username: root
-#     password: jpsoft8121234
+     url: jdbc:log4jdbc:mysql://223.75.170.44:3366/shine_star?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+     username: root
+     password: jpsoft8121234
   devtools:
     add-properties: false
     restart: