Browse Source

考勤记录查看完善。

zq 1 year ago
parent
commit
01a98d86d0

+ 34 - 27
web/src/main/java/com/jpsoft/shinestar/modules/mobile/controller/WorkAttendanceApiController.java

@@ -244,17 +244,20 @@ public class WorkAttendanceApiController {
                         //   if (fillAttendance != null) {
                         if (StringUtils.isNotBlank(workDTO.getSupplementWorkPersonId())){
                             SupplementWorkPerson supplementWorkPerson = supplementWorkPersonService.get(workDTO.getSupplementWorkPersonId());
-                            SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
 
-                            dto.setSupplementWorkId(supplementWork.getId());
-                            //   workDTO.setFillAttendanceId(fillAttendance.getId());
-                            dto.setStatus(supplementWork.getStatus());
-                            if (supplementWork.getStatus().equals("0")) {
-                                dto.setStatusN("审核中");
-                            } else if (supplementWork.getStatus().equals("1")) {
-                                dto.setStatusN("通过");
-                            } else if (supplementWork.getStatus().equals("3")) {
-                                dto.setStatusN("拒绝");
+                            if (supplementWorkPerson!=null) {
+                                SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
+
+                                dto.setSupplementWorkId(supplementWork.getId());
+                                //   workDTO.setFillAttendanceId(fillAttendance.getId());
+                                dto.setStatus(supplementWork.getStatus());
+                                if (supplementWork.getStatus().equals("0")) {
+                                    dto.setStatusN("审核中");
+                                } else if (supplementWork.getStatus().equals("1")) {
+                                    dto.setStatusN("通过");
+                                } else if (supplementWork.getStatus().equals("3")) {
+                                    dto.setStatusN("拒绝");
+                                }
                             }
                         } else {
                             dto.setStatusN("未处理");
@@ -267,18 +270,18 @@ public class WorkAttendanceApiController {
                             dto.setResult("4");
                         }
                     } else if (workDTO.getResult().equals("1")) {
-
                         if (StringUtils.isNotBlank(workDTO.getSupplementWorkPersonId())){
                             SupplementWorkPerson supplementWorkPerson = supplementWorkPersonService.get(workDTO.getSupplementWorkPersonId());
-                            SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
-
-                            dto.setSupplementWorkId(supplementWork.getId());
-                            if ("1".equals(supplementWork.getStatus())){
-                                dto.setStatus("1");
-                                dto.setStatusN("审核通过");
-                            }
 
+                            if (supplementWorkPerson!=null) {
+                                SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
 
+                                dto.setSupplementWorkId(supplementWork.getId());
+                                if ("1".equals(supplementWork.getStatus())) {
+                                    dto.setStatus("1");
+                                    dto.setStatusN("审核通过");
+                                }
+                            }
                             //   workDTO.setFillAttendanceId(fillAttendance.getId());
                         }
 
@@ -746,15 +749,19 @@ public class WorkAttendanceApiController {
             List<SupplementWorkPerson> supplementWorkPersonList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
             if (supplementWorkPersonList.size()>0){
                 for (SupplementWorkPerson supplementWorkPerson : supplementWorkPersonList){
-                    PersonPopedom personPopedom1 = personPopedomService.get(supplementWorkPerson.getPersonPopedomId());
-                    if (personPopedom1 != null){
-                        PersonInfo personInfo = personInfoService.get(personPopedom1.getPersonId());
-                        if (StringUtils.isBlank(name)){
-                            name = personInfo.getName();
-                            nameId = String.valueOf(personInfo.getId());
-                        }else {
-                            name = name + "," + personInfo.getName();
-                            nameId = nameId + "," + personInfo.getId();
+
+                    if (supplementWorkPerson!=null) {
+                        PersonPopedom personPopedom1 = personPopedomService.get(supplementWorkPerson.getPersonPopedomId());
+
+                        if (personPopedom1 != null) {
+                            PersonInfo personInfo = personInfoService.get(personPopedom1.getPersonId());
+                            if (StringUtils.isBlank(name)) {
+                                name = personInfo.getName();
+                                nameId = String.valueOf(personInfo.getId());
+                            } else {
+                                name = name + "," + personInfo.getName();
+                                nameId = nameId + "," + personInfo.getId();
+                            }
                         }
                     }
                 }