Sfoglia il codice sorgente

Merge branch 'master' of http://47.92.161.104:10080/shuzhan/shinestar-server

fulonglong 3 anni fa
parent
commit
7936481d6d
23 ha cambiato i file con 644 aggiunte e 93 eliminazioni
  1. 1 0
      common/src/main/java/com/jpsoft/shinestar/modules/base/dao/WorkShiftInfoDAO.java
  2. 2 0
      common/src/main/java/com/jpsoft/shinestar/modules/base/service/WorkShiftInfoService.java
  3. 5 0
      common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/WorkShiftInfoServiceImpl.java
  4. 6 0
      common/src/main/java/com/jpsoft/shinestar/modules/business/dao/WorkScheduleAttendanceDAO.java
  5. 3 1
      common/src/main/java/com/jpsoft/shinestar/modules/business/entity/SupplementWork.java
  6. 1 0
      common/src/main/java/com/jpsoft/shinestar/modules/business/entity/WorkScheduleAttendance.java
  7. 4 0
      common/src/main/java/com/jpsoft/shinestar/modules/business/service/WorkScheduleAttendanceService.java
  8. 1 1
      common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/SupplementWorkServiceImpl.java
  9. 25 4
      common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/WorkScheduleAttendanceServiceImpl.java
  10. 38 41
      common/src/main/java/com/jpsoft/shinestar/modules/workflow/service/impl/ProcinstActUserServiceImpl.java
  11. 3 3
      common/src/main/resources/mapper/base/PersonDeviceLog.xml
  12. 10 0
      common/src/main/resources/mapper/base/WorkShiftInfo.xml
  13. 10 0
      common/src/main/resources/mapper/business/SupplementWork.xml
  14. 32 5
      common/src/main/resources/mapper/business/WorkScheduleAttendance.xml
  15. 12 12
      web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonDeviceLogController.java
  16. 47 0
      web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonInfoController.java
  17. 267 0
      web/src/main/java/com/jpsoft/shinestar/modules/base/controller/WorkPersonSchedulingController.java
  18. 51 0
      web/src/main/java/com/jpsoft/shinestar/modules/base/controller/WorkShiftInfoController.java
  19. 104 7
      web/src/main/java/com/jpsoft/shinestar/modules/business/controller/SupplementWorkController.java
  20. 4 3
      web/src/main/java/com/jpsoft/shinestar/modules/business/controller/WorkScheduleAttendanceController.java
  21. 1 5
      web/src/main/java/com/jpsoft/shinestar/modules/mobile/controller/ExamineApiController.java
  22. 16 10
      web/src/main/java/com/jpsoft/shinestar/modules/mobile/controller/WorkAttendanceApiController.java
  23. 1 1
      web/src/main/java/com/jpsoft/shinestar/scheduled/UpdateWorkMinuteTask.java

+ 1 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/dao/WorkShiftInfoDAO.java

@@ -24,4 +24,5 @@ public interface WorkShiftInfoDAO {
 	List<WorkShiftInfo> findByCompanyIds(@Param("companyIds")List<String> companyIds);
 	String findNumberById(String id);
 	List<String> sortIdsByNumber(@Param("shiftIds")List<String> shiftIds);
+	WorkShiftInfo findByNumber(String number);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/service/WorkShiftInfoService.java

@@ -25,4 +25,6 @@ public interface WorkShiftInfoService {
 	String findNumberById(String id);
 
 	List<String> sortIdsByNumber(List<String> shiftIds);
+
+	WorkShiftInfo findByNumber(String number);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/service/impl/WorkShiftInfoServiceImpl.java

@@ -124,4 +124,9 @@ public class WorkShiftInfoServiceImpl implements WorkShiftInfoService {
 		return workShiftInfoDAO.sortIdsByNumber(shiftIds);
 	}
 
+	@Override
+	public WorkShiftInfo findByNumber(String number){
+		return workShiftInfoDAO.findByNumber(number);
+	}
+
 }

+ 6 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/dao/WorkScheduleAttendanceDAO.java

@@ -59,4 +59,10 @@ public interface WorkScheduleAttendanceDAO {
 	double findSumWorkMinuteByParams(Long personId, Date startDate, Date endDate, Map<String, Object> searchParams);
 
     List<Map> queryDuplicateRecord(Date startDate, int limit);
+
+	WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify);
+
+    void updateScheduleByPersonIdAndAttendanceDate(Long personId, String dateStr, String personScheduleId, String shiftId);
+
+    List<WorkScheduleAttendance> findByPersonIdAttendanceDateResult(Long personId, String attendanceDate, String result);
 }

+ 3 - 1
common/src/main/java/com/jpsoft/shinestar/modules/business/entity/SupplementWork.java

@@ -4,6 +4,8 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
 
 import org.springframework.data.annotation.Transient;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -70,5 +72,5 @@ public class SupplementWork {
     private String supplementTime;
 
     @Transient
-    private String members;
+    private List<Map> members;
 }

+ 1 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/entity/WorkScheduleAttendance.java

@@ -132,4 +132,5 @@ public class WorkScheduleAttendance {
 
     @Transient
     private WorkOverPerson workOverPerson;
+
 }

+ 4 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/service/WorkScheduleAttendanceService.java

@@ -87,4 +87,8 @@ public interface WorkScheduleAttendanceService {
     BigDecimal findSumWorkMinuteByParams(Long personId, Date startDate, Date endDate,Map<String, Object> searchParams);
 
 	List<Map> queryDuplicateRecord(Date startDate, int limit);
+
+	WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify);
+
+    List<WorkScheduleAttendance> findByPersonIdAttendanceDateResult(Long personId, String attendanceDate, String result);
 }

+ 1 - 1
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/SupplementWorkServiceImpl.java

@@ -159,11 +159,11 @@ public class SupplementWorkServiceImpl implements SupplementWorkService {
 
 		//考勤记录中记录补卡记录id
 		workScheduleAttendance.setSupplementWorkPersonId(supplementWorkPerson.getId());
+		workScheduleAttendanceService.update(workScheduleAttendance);
 
 		if(StringUtils.isNotEmpty(ids)){
 			update(supplementWork);
 			supplementWorkPersonService.update(supplementWorkPerson);
-			workScheduleAttendanceService.update(workScheduleAttendance);
 		}else {
 			insert(supplementWork);
 			supplementWorkPersonService.insert(supplementWorkPerson);

+ 25 - 4
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/WorkScheduleAttendanceServiceImpl.java

@@ -366,11 +366,11 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
 
             if (attendanceList.size() > 0) {
                 //重新生成考勤记录时,以前的记录则取历史工作状态
-                if(recordTime.before(DateTime.now().withTimeAtStartOfDay().toDate())) {
+//                if(recordTime.before(DateTime.now().withTimeAtStartOfDay().toDate())) {
                     //workStatus = attendanceList.get(0).getWorkStatus();
                     //查询当天工作状态
                     workStatus = queryWorkStatus(attendanceTime, personInfo);
-                }
+//                }
 
                 //可能存在考勤机离线后没有实时传输回打卡记录,这时需要判断数据库中已有该时间段打卡时间<当前打卡时间的数量
                 long count = attendanceList.stream().filter(item -> item.getRecordTime().compareTo(recordTime) < 0 && "1".equals(item.getResult())).count();
@@ -502,9 +502,9 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
             String workStatus = personInfo.getWorkStatus();
 
             //重新生成考勤记录时,以前的记录则取历史工作状态
-            if(recordTime.before(DateTime.now().withTimeAtStartOfDay().toDate())){
+//            if(recordTime.before(DateTime.now().withTimeAtStartOfDay().toDate())){
                 workStatus = queryWorkStatus(attendanceTime,personInfo);
-            }
+//            }
 
             if (attendanceList.size() > 0) {
                 //可能存在考勤机离线后没有实时传输回打卡记录,这时需要判断数据库中已有该时间段打卡时间<当前打卡时间 & 打卡状态是1 的数量
@@ -726,6 +726,13 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
         return attendanceList;
     }
 
+    @Override
+    public WorkScheduleAttendance findByScheduleAttendanceId(String personScheduleId, String workShiftId, String classify) {
+        WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceDAO.findByScheduleAttendanceId(personScheduleId, workShiftId, classify);
+
+        return workScheduleAttendance;
+    }
+
     @Override
     public WorkScheduleAttendance findLastByPersonScheduleIdAndClassify(String personScheduleId, String workShiftId, String classify) {
         WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceDAO.findLastByPersonScheduleIdAndClassify(personScheduleId, workShiftId, classify);
@@ -878,6 +885,15 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
                         else{
                             //删除非单天排班的班次考勤(排班变更)
                             workScheduleAttendanceDAO.deleteByPersonIdAndAttendanceDateAndExcludeSchedule(personInfo.getId(),dateStr,workPersonScheduling);
+
+//                            try {
+//                                //将补卡班次调整为新的排班班次
+//                                String[] shiftIds = workPersonScheduling.getShiftIds().split(",");
+//                                workScheduleAttendanceDAO.updateScheduleByPersonIdAndAttendanceDate(personInfo.getId(), dateStr, workPersonScheduling.getId(), shiftIds[0]);
+//                            }
+//                            catch (Exception ex){
+//                                log.error(ex.getMessage(),ex);
+//                            }
                         }
 
                         //查询班次
@@ -1299,4 +1315,9 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
     public List<Map> queryDuplicateRecord(Date startDate, int limit) {
         return workScheduleAttendanceDAO.queryDuplicateRecord(startDate,limit);
     }
+
+    @Override
+    public List<WorkScheduleAttendance> findByPersonIdAttendanceDateResult(Long personId, String attendanceDate, String result) {
+        return workScheduleAttendanceDAO.findByPersonIdAttendanceDateResult(personId,attendanceDate,result);
+    }
 }

+ 38 - 41
common/src/main/java/com/jpsoft/shinestar/modules/workflow/service/impl/ProcinstActUserServiceImpl.java

@@ -325,25 +325,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
 
                                     //补卡
                                     if ("4".equals(procinst.getType()) || "5".equals(procinst.getType())) {
-
-                                        if (supplementWork != null) {
-                                            supplementWork.setStatus(status);
-                                            supplementWork.setUpdateTime(new Date());
-                                            supplementWorkService.update(supplementWork);
-                                            List<SupplementWorkPerson> supplementWorkPersonList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
-                                            if (supplementWorkPersonList.size() > 0) {
-                                                for (SupplementWorkPerson supplementWorkPerson : supplementWorkPersonList) {
-                                                    WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceService.get(supplementWorkPerson.getScheduleAttendanceId());
-                                                    if (workScheduleAttendance != null) {
-                                                        workScheduleAttendance.setResult("1");
-                                                        workScheduleAttendance.setRemark("补卡");
-                                                        workScheduleAttendance.setUpdateTime(new Date());
-                                                        workScheduleAttendanceService.update(workScheduleAttendance);
-
-                                                    }
-                                                }
-                                            }
-                                        }
+                                        supplement(status, supplementWork);
                                     }
 
                                     //批量加班
@@ -641,7 +623,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 //出差
                                 if ("3".equals(procinst.getType())) {
                                     businessOut.setStatus(status);
-                                    businessOut.setCreateTime(new Date());
+                                    businessOut.setUpdateTime(new Date());
                                     businessOutService.update(businessOut);
                                 }
                                 //补卡
@@ -773,30 +755,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 //出差
                                 if ("3".equals(procinst.getType())) {
                                     businessOut.setStatus(status);
-                                    businessOut.setCreateTime(new Date());
+                                    businessOut.setUpdateTime(new Date());
                                     businessOutService.update(businessOut);
                                 }
                                 //补卡
                                 if ("4".equals(procinst.getType()) || "5".equals(procinst.getType())) {
-
-                                    if (supplementWork != null) {
-                                        supplementWork.setStatus(status);
-                                        supplementWork.setUpdateTime(new Date());
-                                        supplementWorkService.update(supplementWork);
-                                        List<SupplementWorkPerson> supplementWorkPersonList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
-                                        if (supplementWorkPersonList.size() > 0) {
-                                            for (SupplementWorkPerson supplementWorkPerson : supplementWorkPersonList) {
-                                                WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceService.get(supplementWorkPerson.getScheduleAttendanceId());
-
-                                                if (workScheduleAttendance != null) {
-                                                    workScheduleAttendance.setResult("1");
-                                                    workScheduleAttendance.setRemark("补卡");
-                                                    workScheduleAttendance.setUpdateTime(new Date());
-                                                    workScheduleAttendanceService.update(workScheduleAttendance);
-                                                }
-                                            }
-                                        }
-                                    }
+                                    supplement(status, supplementWork);
                                 }
                                 //批量加班
                                 if ("6".equals(procinst.getType()) || "7".equals(procinst.getType())) {
@@ -994,7 +958,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                             //出差
                             if ("3".equals(procinst.getType())) {
                                 businessOut.setStatus(status);
-                                businessOut.setCreateTime(new Date());
+                                businessOut.setUpdateTime(new Date());
                                 businessOutService.update(businessOut);
                             }
                             //补卡
@@ -1269,6 +1233,39 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
 
     }
 
+    private void supplement(String status, SupplementWork supplementWork) {
+        if (supplementWork != null) {
+            supplementWork.setStatus(status);
+            supplementWork.setUpdateTime(new Date());
+            supplementWorkService.update(supplementWork);
+            List<SupplementWorkPerson> supplementWorkPersonList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
+
+            if (supplementWorkPersonList.size() > 0) {
+                for (SupplementWorkPerson supplementWorkPerson : supplementWorkPersonList) {
+                    WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceService.get(supplementWorkPerson.getScheduleAttendanceId());
+
+                    if(workScheduleAttendance.getDelFlag()==null || workScheduleAttendance.getDelFlag()){
+                        workScheduleAttendance = workScheduleAttendanceService.findByScheduleAttendanceId(workScheduleAttendance.getPersonScheduleId(),workScheduleAttendance.getWorkShiftId(),workScheduleAttendance.getClassify());
+
+                        if (workScheduleAttendance != null) {
+                            supplementWorkPerson.setScheduleAttendanceId(workScheduleAttendance.getId());
+                            supplementWorkPersonService.update(supplementWorkPerson);
+                        }
+                    }
+
+                    if (workScheduleAttendance != null) {
+                        workScheduleAttendance.setResult("1");
+                        workScheduleAttendance.setRemark("补卡");
+                        workScheduleAttendance.setSupplementWorkPersonId(supplementWorkPerson.getId());
+                        workScheduleAttendance.setUpdateTime(new Date());
+
+                        workScheduleAttendanceService.update(workScheduleAttendance);
+                    }
+                }
+            }
+        }
+    }
+
 
     @Override
     public List<ProcinstActUser> findByProcinstActivityIdActionType(String procinstActivityId, String action, String type) {

+ 3 - 3
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -154,9 +154,9 @@
 		]]>
         <where>
             and a.del_flag = false
-            <if test="searchParams.deviceIdList != null">
-                and b.id_ in
-                <foreach item="item" collection="searchParams.deviceIdList"  open="(" separator="," close=")">
+            <if test="searchParams.deviceNoList != null">
+                and a.device_no in
+                <foreach item="item" collection="searchParams.deviceNoList"  open="(" separator="," close=")">
                     #{item}
                 </foreach>
             </if>

+ 10 - 0
common/src/main/resources/mapper/base/WorkShiftInfo.xml

@@ -199,4 +199,14 @@
         ORDER BY
         number_+0 ASC
     </select>
+    <select id="findByNumber" parameterType="string" resultMap="WorkShiftInfoMap">
+        SELECT
+        *
+        FROM
+        base_work_shift_info
+        WHERE
+        number_ = #{number}
+        and del_flag = 0
+        limit 1
+    </select>
 </mapper>

+ 10 - 0
common/src/main/resources/mapper/business/SupplementWork.xml

@@ -128,6 +128,16 @@
 		]]>
         <where>
             t1.del_flag=0
+            <if test="searchParams.swPersonName != null">
+                and exists (
+                    select swp.id_
+                    from business_supplement_work_person swp
+                    inner join base_person_popedom bpp on swp.person_popedom_id = bpp.id_
+                    inner join base_person_info bpi on bpi.id_ = bpp.person_id
+                    where swp.supplement_work_id = t1.id_
+                    and bpi.name_ like #{searchParams.swPersonName}
+                )
+            </if>
             <if test="searchParams.personName != null">
                 and t3.name_ like #{searchParams.personName}
             </if>

+ 32 - 5
common/src/main/resources/mapper/business/WorkScheduleAttendance.xml

@@ -191,6 +191,14 @@
         and del_flag=0
         order by record_time desc
     </select>
+    <select id="findByScheduleAttendanceId" resultMap="WorkScheduleAttendanceMap">
+        select * from business_work_schedule_attendance
+        where person_schedule_id=#{personScheduleId}
+        and work_shift_id = #{workShiftId}
+        and classify_=#{classify}
+        and del_flag=0
+        order by create_time desc
+    </select>
     <select id="findAttendanceDateByPersonAndMonths" resultType="date">
         SELECT DISTINCT
             attendance_date
@@ -341,6 +349,17 @@
         limit 1
     </select>
 
+    <select id="findByPersonIdAttendanceDateResult" resultMap="WorkScheduleAttendanceMap">
+        <![CDATA[
+        select * from business_work_schedule_attendance
+        ]]>
+        where del_flag = 0
+        and person_id = #{personId}
+        and attendance_date = #{attendanceDate}
+        and result_ = #{result}
+        order by record_time asc
+    </select>
+
     <select id="findPersonIdListRecordTimeResult" resultType="java.lang.Long">
         select DISTINCT(a.person_id) from business_work_schedule_attendance a
         where a.attendance_date = #{attendanceDate}
@@ -544,6 +563,19 @@
             and del_flag=0
         ]]>
     </update>
+    <update id="updateScheduleByPersonIdAndAttendanceDate">
+        <![CDATA[
+            update business_work_schedule_attendance
+            set
+            person_schedule_id=#{personScheduleId},
+            work_shift_id=#{workShiftId},
+            update_time=now()
+            where person_id=#{personId}
+            and attendance_date=#{attendanceDate}
+            and supplement_work_person_id is not null
+            and del_flag=0
+        ]]>
+    </update>
     <update id="updateWorkMinute" parameterType="com.jpsoft.shinestar.modules.business.entity.WorkScheduleAttendance">
         update business_work_schedule_attendance
         set work_minute=#{workMinute},update_time=#{updateTime}
@@ -661,17 +693,12 @@
     <select id="findEmptyWorkMinuteList" resultMap="WorkScheduleAttendanceMap">
         select * from
         business_work_schedule_attendance
-        FORCE INDEX(`idx_record_time`,`idx_classify_result`)
         where
         work_minute is null
         and
         classify_='2'
         and
-        result_ in ('1','2','3')
-        and
         del_flag=0
-        and
-        record_time>'2021-10-01'
         order by record_time asc
         limit ${limit}
     </select>

+ 12 - 12
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonDeviceLogController.java

@@ -125,10 +125,10 @@ public class PersonDeviceLogController {
             //需要查出已删除的设备
             List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(userCompanyId);
 
-            List<String> deviceIdList = new ArrayList<String>();
+            List<String> deviceNoList = new ArrayList<>();
 
             for (DeviceInfo deviceInfo : deviceInfoList) {
-                deviceIdList.add(deviceInfo.getId());
+                deviceNoList.add(deviceInfo.getDeviceNo());
             }
 
             //查询关联单位表
@@ -138,17 +138,17 @@ public class PersonDeviceLogController {
                 List<DeviceInfo> relateDevices = deviceInfoService.findByCompanyId(companyInfo.getId());
 
                 for (DeviceInfo deviceInfo : relateDevices) {
-                    if (!deviceIdList.contains(deviceInfo.getId())){
-                        deviceIdList.add(deviceInfo.getId());
+                    if (!deviceNoList.contains(deviceInfo.getDeviceNo())){
+                        deviceNoList.add(deviceInfo.getDeviceNo());
                     }
                 }
             }
 
-            if (deviceIdList.size() == 0) {
-                deviceIdList.add("-1");
+            if (deviceNoList.size() == 0) {
+                deviceNoList.add("-1");
             }
 
-            searchParams.put("deviceIdList", deviceIdList);
+            searchParams.put("deviceNoList", deviceNoList);
             searchParams.put("relateCompanyList", relateCompanyList);
 
             CompanyInfo companyInfo = companyInfoService.get(userCompanyId);
@@ -345,17 +345,17 @@ public class PersonDeviceLogController {
                 //去掉了删除判断
                 //需要查出已删除的设备
                 List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(userCompanyId);
-                List<String> deviceIdList = new ArrayList<String>();
+                List<String> deviceNoList = new ArrayList<String>();
 
                 for (DeviceInfo deviceInfo : deviceInfoList) {
-                    deviceIdList.add(deviceInfo.getId());
+                    deviceNoList.add(deviceInfo.getDeviceNo());
                 }
 
-                if (deviceIdList.size() == 0) {
-                    deviceIdList.add("-1");
+                if (deviceNoList.size() == 0) {
+                    deviceNoList.add("-1");
                 }
 
-                searchParams.put("deviceIdList", deviceIdList);
+                searchParams.put("deviceNoList", deviceNoList);
             }
 
             if (StringUtil.isNotEmpty(deviceNo)) {

+ 47 - 0
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonInfoController.java

@@ -1990,6 +1990,53 @@ public class PersonInfoController {
         return msgResult;
     }
 
+    @ApiOperation(value = "根据后勤公司查询用户")
+    @PostMapping("findByHqCompanyId")
+    public MessageResult<Object> findByHqCompanyId(String companyId) {
+        MessageResult<Object> msgResult = new MessageResult<>();
+
+        try {
+
+            Map<String,Object> searchParams = new HashMap<>();
+            if ("hq1".equals(companyId)) {
+                //外勤1
+                List<CompanyInfo> list1 = companyInfoService.findByClassify("1");
+                searchParams.put("companyInfos", list1);
+
+                searchParams.put("hqStatus", "1");
+            } else if ("hq2".equals(companyId)) {
+                //外勤2
+                List<CompanyInfo> list2 = companyInfoService.findByClassify("2");
+                searchParams.put("companyInfos", list2);
+
+                searchParams.put("hqStatus", "2");
+            } else {
+                CompanyInfo parentCompanyInfo = companyInfoService.get(companyId);
+                String parentCode = parentCompanyInfo.getCode();
+                searchParams.put("attendanceCompanyCode", parentCode + "%");
+                searchParams.put("hqStatus", parentCompanyInfo.getClassify());
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("b.sort_no","asc"));
+            sortList.add(new Sort("a.id_","asc"));
+            //用户左边列
+            Page<PersonInfo> personInfoPage = personInfoService.pageSearch(searchParams,0,10000,false,sortList);
+            List<PersonInfo> list = personInfoPage.getResult();
+
+            msgResult.setResult(true);
+            msgResult.setData(list);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
     @ApiOperation(value = "查询物业公司所在人员")
     @PostMapping("findByCompanyCode")
     public MessageResult<Object> findByCompanyCode(@RequestAttribute String subject) {

+ 267 - 0
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/WorkPersonSchedulingController.java

@@ -349,6 +349,147 @@ public class WorkPersonSchedulingController {
         return dataMap;
     }
 
+    @ApiOperation(value="查询后勤人员排班")
+    @RequestMapping(value = "findHqScheduling",method = RequestMethod.POST)
+    public Map<String,Object> findHqScheduling(
+            @RequestParam(value="personName",defaultValue="")  String personName,
+            @RequestParam(value="queryMonth",defaultValue="")  String queryMonth,
+            @RequestParam(value="companyId",defaultValue="")  String companyId,
+            @RequestParam(value="subordinate",defaultValue="false")  Boolean subordinate,
+            @RequestParam(name="pageIndex",defaultValue = "1") int pageIndex,
+            @RequestParam(name="pageSize",defaultValue = "10") int pageSize,
+            @RequestAttribute String subject) throws Exception{
+
+        //当前用户ID
+        System.out.println(subject);
+        Map<String,Object> dataMap = new HashMap<>();
+        try{
+            Map<String,Object> searchParams = new HashMap<>();
+            if (StringUtils.isNotEmpty(personName)) {
+                searchParams.put("name","%" + personName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(queryMonth)) {
+                searchParams.put("queryMonth",queryMonth);
+            }else{
+                throw new Exception("请选择查询日期!");
+            }
+
+            if (StringUtils.isNotEmpty(companyId)) {
+                if ("hq1".equals(companyId)) {
+                    //外勤1
+                    List<CompanyInfo> list1 = companyInfoService.findByClassify("1");
+                    searchParams.put("companyInfos", list1);
+
+                    searchParams.put("hqStatus", "1");
+                } else if ("hq2".equals(companyId)) {
+                    //外勤2
+                    List<CompanyInfo> list2 = companyInfoService.findByClassify("2");
+                    searchParams.put("companyInfos", list2);
+
+                    searchParams.put("hqStatus", "2");
+                } else {
+                    CompanyInfo parentCompanyInfo = companyInfoService.get(companyId);
+                    String parentCode = parentCompanyInfo.getCode();
+                    if (subordinate) {
+                        searchParams.put("attendanceCompanyCode", parentCode + "%");
+                    } else {
+                        searchParams.put("attendanceCompanyCode", parentCode);
+                    }
+
+                    searchParams.put("hqStatus", parentCompanyInfo.getClassify());
+                }
+            } else {
+                searchParams.put("querHq", "yes");
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("b.sort_no","asc"));
+            sortList.add(new Sort("a.id_","asc"));
+            //用户左边列
+            Page<PersonInfo> personInfoPage = personInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+            //头部是月份
+            Date queryDate = new SimpleDateFormat("yyyy-MM-dd").parse(queryMonth + "-01");
+            Map<String,Object> returnMap = getDayByMonth(queryDate);
+            List<Integer> days = (List<Integer>)returnMap.get("days");
+            int year = Integer.parseInt(returnMap.get("year").toString());
+            int month = Integer.parseInt(returnMap.get("month").toString());
+
+            List<Map<String,Object>> personList = new ArrayList<>();
+            List<Map> dayMapList = new ArrayList<>();
+            for(int i=0;i<days.size();i++){
+                int day = days.get(i);
+                Map map = new HashMap();
+                map.put("id",i);
+                map.put("day",day);
+                dayMapList.add(map);
+            }
+
+            for(PersonInfo personInfo : personInfoPage.getResult()){
+                List<WorkPersonScheduling> workDayList = workPersonSchedulingService.findByPersonIdYearMonth(personInfo.getId(),year,month);
+                Map<String,List> dayMap = new HashMap<>();
+
+
+                for(int i=0;i<days.size();i++){
+                    int day = days.get(i);
+                    List<String> numberList = new ArrayList<>();
+                    numberList.add("无");
+                    dayMap.put(String.valueOf(day),numberList);
+                }
+
+                for(WorkPersonScheduling wps : workDayList){
+                    //dayMap.put(sdf.format(wps.getSchedulingDay()),wps);
+                    String shiftNumbers = "";
+                    String[] shiftIds = null ;
+                    if(wps.getShiftIds() != null){
+                        shiftIds = wps.getShiftIds().split(",");
+                        for(int i=0;i<shiftIds.length;i++){
+                            String shiftId = shiftIds[i];
+                            String shiftNumber = (String)valueOperations.get("shift_number_" + shiftId);
+
+                            if(StringUtils.isEmpty(shiftNumber)){
+                                shiftNumber = workShiftInfoService.findNumberById(shiftId);
+                                valueOperations.set("shift_number_" + shiftId, shiftNumber);
+                            }
+
+                            if(i < shiftIds.length - 1) {
+                                shiftNumbers += shiftNumber + ",";
+                            }else{
+                                shiftNumbers += shiftNumber;
+                            }
+                        }
+                    }
+
+                    List<String> numberList = new ArrayList<>();
+                    numberList.add(shiftNumbers);
+                    dayMap.replace(wps.getDay().toString(),numberList);
+                }
+
+
+                Map<String,Object> mapPerson = new HashMap<>();
+
+                mapPerson.put("id",personInfo.getId());
+                mapPerson.put("name",personInfo.getName());
+                mapPerson.put("companyId",personInfo.getCompanyId());
+                mapPerson.put("companyName",personInfo.getCompanyName());
+                mapPerson.put("personNumberMap",dayMap);
+
+                personList.add(mapPerson);
+            }
+
+
+            dataMap.put("recordsTotal", personInfoPage.getTotal());
+            dataMap.put("totalPage", personInfoPage.getPages());
+            dataMap.put("personList", personList);
+            dataMap.put("dayList", dayMapList);
+        }catch (Exception ex){
+            ex.printStackTrace();
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return dataMap;
+    }
+
     public static Map<String,Object> getDayByMonth(Date queryMonth){
         Map<String,Object> returnMap = new HashMap<>();
         List list = new ArrayList();
@@ -479,6 +620,132 @@ public class WorkPersonSchedulingController {
         return msgResult;
     }
 
+    @ApiOperation(value="后勤排班班次")
+    @RequestMapping(value = "changeSchedulingHq",method = RequestMethod.POST)
+    public MessageResult<List> changeSchedulingHq(
+            @RequestParam(name="companyId",defaultValue = "") String companyId,
+            @RequestParam(name="personId",defaultValue = "") String personId,
+            String[] schedulingIds,
+            @DateTimeFormat(pattern = "yyyy-MM-dd") String startDate,
+            @DateTimeFormat(pattern = "yyyy-MM-dd") String endDate,
+            @RequestAttribute String subject,
+            HttpServletRequest request) throws Exception{
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        if(!valueOperations.setIfAbsent("changeScheduling_" + subject,true,3,TimeUnit.SECONDS)){
+            throw new Exception("操作过于频繁,请稍后再试!");
+        }
+
+        Map<String,Object> searchParams = new HashMap<>();
+        if (StringUtils.isNotEmpty(companyId)) {
+            if ("hq1".equals(companyId)) {
+                //外勤1
+                List<CompanyInfo> list1 = companyInfoService.findByClassify("1");
+                searchParams.put("companyInfos", list1);
+
+                searchParams.put("hqStatus", "1");
+            } else if ("hq2".equals(companyId)) {
+                //外勤2
+                List<CompanyInfo> list2 = companyInfoService.findByClassify("2");
+                searchParams.put("companyInfos", list2);
+
+                searchParams.put("hqStatus", "2");
+            } else {
+                CompanyInfo parentCompanyInfo = companyInfoService.get(companyId);
+                String parentCode = parentCompanyInfo.getCode();
+                searchParams.put("attendanceCompanyCode", parentCode);
+                searchParams.put("hqStatus", parentCompanyInfo.getClassify());
+            }
+        } else {
+            throw new Exception("请选择部门");
+        }
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("b.sort_no","asc"));
+        sortList.add(new Sort("a.id_","asc"));
+        //查询部门下人员
+        Page<PersonInfo> personInfoPage = personInfoService.pageSearch(searchParams,0,10000,false,sortList);
+        List<PersonInfo> personInfoList = personInfoPage.getResult();
+        if(StringUtils.isNotEmpty(personId)){
+            personInfoList = new ArrayList<>();
+            String [] pIds = personId.split(",");
+            for(String pId : pIds) {
+                PersonInfo personInfo = personInfoService.get(Long.valueOf(pId));
+                personInfoList.add(personInfo);
+            }
+        }
+
+        for(PersonInfo pi : personInfoList){
+            //查询需要排班的日期
+            List<Date> dateList = getDayByYear(startDate,endDate);
+            int num=0;
+            for(Date scheDate : dateList){
+                //如果num = 数组的长度
+                String shiftId = schedulingIds[num];
+                if(num == schedulingIds.length-1) {
+                    num = 0;
+                }else{
+                    num ++;
+                }
+                List<WorkShiftInfo> wsiList = null;
+                if(StringUtils.isNotEmpty(shiftId)) {
+                    String[] shiftIds =  shiftId.split(";");
+                    //String sortShiftIds = Arrays.stream(shiftIds).sorted(Comparator.naturalOrder()).collect(Collectors.joining(","));
+                    List<String> shiftIdsList = Arrays.asList(shiftIds);
+
+                    List<String> sortShiftIdsList = workShiftInfoService.sortIdsByNumber(shiftIdsList);
+                    //返回排序后参数
+
+                    shiftId = StringUtils.join(sortShiftIdsList,",");
+                }
+
+                Calendar calendar = Calendar.getInstance(Locale.CHINA);
+                calendar.setTime(scheDate);
+                int year = calendar.get(Calendar.YEAR);//年份
+                int month = calendar.get(Calendar.MONTH) + 1;//月份
+                int day = calendar.get(Calendar.DAY_OF_MONTH);
+
+                //先假删除
+                workPersonSchedulingService.deleteByPersonIdSchedulingDay(year,month,day,pi.getId());
+
+                WorkPersonScheduling workPersonScheduling = workPersonSchedulingService.findByYearMonthDayPersonId(year,month,day,pi.getId());
+                if(workPersonScheduling == null){
+                    workPersonScheduling = new WorkPersonScheduling();
+                    workPersonScheduling.setId(UUID.randomUUID().toString());
+                    workPersonScheduling.setDelFlag(false);
+                    workPersonScheduling.setCreateBy(subject);
+                    workPersonScheduling.setCreateTime(new Date());
+
+                    workPersonScheduling.setPersonId(pi.getId());
+                    workPersonScheduling.setYear(year);
+                    workPersonScheduling.setMonth(month);
+                    workPersonScheduling.setDay(day);
+                    workPersonScheduling.setSchedulingDay(scheDate);
+                    workPersonScheduling.setShiftIds(shiftId);
+                    //workPersonScheduling.setShiftNumbers(shiftNumber);
+
+                    workPersonSchedulingService.insert(workPersonScheduling);
+                }else{
+                    workPersonScheduling.setUpdateBy(subject);
+                    workPersonScheduling.setUpdateTime(new Date());
+
+                    workPersonScheduling.setPersonId(pi.getId());
+                    workPersonScheduling.setYear(year);
+                    workPersonScheduling.setMonth(month);
+                    workPersonScheduling.setDay(day);
+                    workPersonScheduling.setSchedulingDay(scheDate);
+                    workPersonScheduling.setShiftIds(shiftId);
+                    //workPersonScheduling.setShiftNumbers(shiftNumber);
+
+                    workPersonSchedulingService.update(workPersonScheduling);
+                }
+
+            }
+        }
+        msgResult.setResult(true);
+        return msgResult;
+    }
+
 
     @ApiOperation(value="根据年月日人查班次ID")
     @RequestMapping(value = "findWPSByParameter",method = RequestMethod.POST)

+ 51 - 0
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/WorkShiftInfoController.java

@@ -346,4 +346,55 @@ public class WorkShiftInfoController {
         msgResult.setResult(true);
         return msgResult;
     }
+
+    @ApiOperation(value="后勤部门班次列表")
+    @RequestMapping(value = "shiftHqList",method = RequestMethod.POST)
+    public MessageResult<List> shiftHqList(
+            @RequestParam(name="companyId",defaultValue = "") String companyId,
+            HttpServletRequest request){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        if (StringUtils.isNotEmpty(companyId)) {
+            //可以查所选单位下面所有的排班 like
+            List<WorkShiftInfo> list = new ArrayList<>();
+            if ("hq1".equals(companyId) || "hq2".equals(companyId)) {
+                //外勤1 0,46,47
+                WorkShiftInfo workShiftInfo0 = workShiftInfoService.findByNumber("0");
+                if(workShiftInfo0 != null) {
+                    workShiftInfo0.setWorkTime("");
+                    workShiftInfo0.setClosingTime("");
+                    list.add(workShiftInfo0);
+                }
+
+                WorkShiftInfo workShiftInfo46 = workShiftInfoService.findByNumber("46");
+                if(workShiftInfo46 != null) {
+                    list.add(workShiftInfo46);
+                }
+
+                WorkShiftInfo workShiftInfo47 = workShiftInfoService.findByNumber("47");
+                if(workShiftInfo47 != null) {
+                    list.add(workShiftInfo47);
+                }
+            } else {
+                CompanyInfo companyInfo = companyInfoService.get(companyId);
+                List<String> parentIds = Arrays.asList(companyInfo.getCode().split(","));
+                list = workShiftInfoService.findByCompanyIds(parentIds);
+                for(WorkShiftInfo wsi : list){
+                    if("0".equals(wsi.getNumber())){
+                        wsi.setWorkTime("");
+                        wsi.setClosingTime("");
+                    }
+                }
+            }
+
+
+
+            msgResult.setData(list);
+        }else{
+            msgResult.setData(null);
+        }
+
+        msgResult.setResult(true);
+        return msgResult;
+    }
 }

+ 104 - 7
web/src/main/java/com/jpsoft/shinestar/modules/business/controller/SupplementWorkController.java

@@ -3,8 +3,10 @@ package com.jpsoft.shinestar.modules.business.controller;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.util.StringUtil;
 import com.jpsoft.shinestar.config.OSSConfig;
+import com.jpsoft.shinestar.exception.CustomException;
 import com.jpsoft.shinestar.modules.base.entity.*;
 import com.jpsoft.shinestar.modules.base.service.CompanyInfoService;
+import com.jpsoft.shinestar.modules.base.service.PersonInfoService;
 import com.jpsoft.shinestar.modules.base.service.PersonPopedomService;
 import com.jpsoft.shinestar.modules.base.service.WorkShiftInfoService;
 import com.jpsoft.shinestar.modules.business.dto.UpdatePersonAttendanceDTO;
@@ -67,6 +69,9 @@ public class SupplementWorkController {
     @Autowired
     private PersonPopedomService personPopedomService;
 
+    @Autowired
+    private PersonInfoService personInfoService;
+
     @Autowired
     private WorkScheduleAttendanceService workScheduleAttendanceService;
 
@@ -211,6 +216,7 @@ public class SupplementWorkController {
             @RequestParam(value="hqCompanyId",defaultValue="") String hqCompanyId,
             @RequestParam(value="hqSubordinate",defaultValue="false") Boolean hqSubordinate,
             @RequestParam(value = "personName", defaultValue = "") String personName,
+            @RequestParam(value = "swPersonName", defaultValue = "") String swPersonName,
             @RequestParam(value = "status", defaultValue = "") String status,
             @RequestParam(value = "type", defaultValue = "") String type,
             @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
@@ -273,6 +279,10 @@ public class SupplementWorkController {
                 searchParams.put("personName", "%" + personName + "%");
             }
 
+            if (StringUtils.isNotEmpty(swPersonName)) {
+                searchParams.put("swPersonName", "%" + swPersonName + "%");
+            }
+
             if (StringUtil.isNotEmpty(status)) {
                 searchParams.put("status", status);
             }
@@ -305,13 +315,27 @@ public class SupplementWorkController {
                     }
                 }
 
-//                List<SupplementWorkPerson> personList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
-//
-//                String personNames = personList.stream()
-//                        .map((item) -> item.getPersonName())
-//                        .collect(Collectors.joining(","));
-//
-//                supplementWork.setMembers(personNames);
+                List<SupplementWorkPerson> personList = supplementWorkPersonService.findBySupplementWorkId(supplementWork.getId());
+
+                List<Map> members = new ArrayList<>();
+
+                for (SupplementWorkPerson supplementWorkPerson : personList) {
+                    Map<String,Object> member = new HashMap<>();
+
+                    member.put("id", supplementWorkPerson.getId());
+
+                    //补卡人
+                    member.put("name", supplementWorkPerson.getPersonName());
+
+                    //当前补卡对应考勤记录
+                    WorkScheduleAttendance wsa = workScheduleAttendanceService.findOneBySupplementWorkPersonId(supplementWorkPerson.getId());
+
+                    member.put("wsa", wsa);
+
+                    members.add(member);
+                }
+
+                supplementWork.setMembers(members);
             }
 
             if(exportFlag) {
@@ -336,4 +360,77 @@ public class SupplementWorkController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="查看补卡当天缺卡记录列表")
+    @RequestMapping(value = "missAttendanceList",method = RequestMethod.GET)
+    public MessageResult<List> missAttendanceList(String supplementWorkPersonId){
+        MessageResult<List> messageResult = new MessageResult<>();
+
+        try {
+            SupplementWorkPerson supplementWorkPerson = supplementWorkPersonService.get(supplementWorkPersonId);
+            PersonPopedom personPopedom = personPopedomService.get(supplementWorkPerson.getPersonPopedomId());
+            PersonInfo personInfo = personInfoService.get(personPopedom.getPersonId());
+
+            SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
+
+            String attendanceDate = supplementWork.getAttendanceDate().substring(0, 10);
+
+            List<WorkScheduleAttendance> attendanceList = workScheduleAttendanceService.findByPersonIdAttendanceDateResult(personInfo.getId(), attendanceDate, "0");
+
+            messageResult.setResult(true);
+            messageResult.setData(attendanceList);
+        }
+        catch (Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+
+            log.error(ex.getMessage(),ex);
+        }
+
+        return messageResult;
+    }
+
+    @ApiOperation(value="补卡")
+    @RequestMapping(value = "patchAttendance",method = RequestMethod.POST)
+    public MessageResult<String> patchAttendance(String supplementWorkPersonId,String workAttendanceId){
+        MessageResult<String> messageResult = new MessageResult<>();
+
+        try {
+            WorkScheduleAttendance workScheduleAttendance = workScheduleAttendanceService.findOneBySupplementWorkPersonId(supplementWorkPersonId);
+
+            if(workScheduleAttendance!=null){
+                throw new CustomException("当前补卡申请已生效!不能重复补卡!");
+            }
+
+//          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+            workScheduleAttendance = workScheduleAttendanceService.get(workAttendanceId);
+
+            SupplementWorkPerson supplementWorkPerson = supplementWorkPersonService.get(supplementWorkPersonId);
+//            PersonPopedom personPopedom = personPopedomService.get(supplementWorkPerson.getPersonPopedomId());
+//            PersonInfo personInfo = personInfoService.get(personPopedom.getPersonId());
+
+            //更新补卡记录
+            supplementWorkPerson.setScheduleAttendanceId(workScheduleAttendance.getId());
+            supplementWorkPerson.setUpdateTime(new Date());
+            supplementWorkPersonService.update(supplementWorkPerson);
+
+            //更新考勤记录
+            workScheduleAttendance.setResult("1");
+            workScheduleAttendance.setRemark("补卡");
+            workScheduleAttendance.setSupplementWorkPersonId(supplementWorkPerson.getId());
+            workScheduleAttendance.setUpdateTime(new Date());
+
+            workScheduleAttendanceService.update(workScheduleAttendance);
+
+            messageResult.setResult(true);
+        }
+        catch (Exception ex){
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+
+            log.error(ex.getMessage(),ex);
+        }
+
+        return messageResult;
+    }
 }

+ 4 - 3
web/src/main/java/com/jpsoft/shinestar/modules/business/controller/WorkScheduleAttendanceController.java

@@ -1425,9 +1425,7 @@ public class WorkScheduleAttendanceController {
             Map<String, Object> msgMap = new HashMap<>();
 
             List<Sort> sortList = new ArrayList<>();
-            sortList.add(new Sort("b.level_", "asc"));
-            sortList.add(new Sort("b.sort_no", "asc"));
-            sortList.add(new Sort("a.job_number", "asc"));
+            sortList.add(new Sort("a.hq_sort_no", "asc"));
 
             if (StringUtils.isNotEmpty(name)) {
                 String[] names = name.split(",");
@@ -2184,6 +2182,9 @@ public class WorkScheduleAttendanceController {
                 row.createCell(colIndex).setCellValue(jsonObject.getString("onWorkResult1N"));
                 colIndex++;
 
+                row.createCell(colIndex).setCellValue(jsonObject.getString("offWorkRecordTime1"));
+                colIndex++;
+
                 row.createCell(colIndex).setCellValue(jsonObject.getString("offWorkResult1N"));
                 colIndex++;
 

+ 1 - 5
web/src/main/java/com/jpsoft/shinestar/modules/mobile/controller/ExamineApiController.java

@@ -665,20 +665,16 @@ public class ExamineApiController {
             @ApiImplicitParam(name = "content", value = "审核意见",required = true,paramType = "form")
     })
     public MessageResult<Map> examineSubmit(String procinstActUserIds,String status,String content,String token, @RequestAttribute String subject) {
-
-
         MessageResult<Map> messageResult = new MessageResult<>();
-        try{
 
+        try{
             PersonInfo person = personInfoService.get(Long.parseLong(subject));
             PersonPopedom personPopedom = personPopedomService.get(person.getPopedom());
 
             procinstActUserService.examineSubmit(procinstActUserIds,personPopedom,status,content);
 
-
             messageResult.setCode(200);
             messageResult.setResult(true);
-
         }catch (Exception ex){
             log.error(ex.getMessage(),ex);
             messageResult.setCode(400);

+ 16 - 10
web/src/main/java/com/jpsoft/shinestar/modules/mobile/controller/WorkAttendanceApiController.java

@@ -142,17 +142,23 @@ public class WorkAttendanceApiController {
                      //   if (fillAttendance != null) {
                         if (StringUtils.isNotBlank(workDTO.getSupplementWorkPersonId())){
                             SupplementWorkPerson supplementWorkPerson = supplementWorkPersonService.get(workDTO.getSupplementWorkPersonId());
-                            SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
 
-                            workDTO.setSupplementWorkId(supplementWork.getId());
-                         //   workDTO.setFillAttendanceId(fillAttendance.getId());
-                            workDTO.setStatus(supplementWork.getStatus());
-                            if (supplementWork.getStatus().equals("0")) {
-                                workDTO.setStatusN("审核中");
-                            } else if (supplementWork.getStatus().equals("1")) {
-                                workDTO.setStatusN("通过");
-                            } else if (supplementWork.getStatus().equals("3")) {
-                                workDTO.setStatusN("拒绝");
+                            if(supplementWorkPerson!=null) {
+                                SupplementWork supplementWork = supplementWorkService.get(supplementWorkPerson.getSupplementWorkId());
+
+                                workDTO.setSupplementWorkId(supplementWork.getId());
+                                //   workDTO.setFillAttendanceId(fillAttendance.getId());
+                                workDTO.setStatus(supplementWork.getStatus());
+                                if (supplementWork.getStatus().equals("0")) {
+                                    workDTO.setStatusN("审核中");
+                                } else if (supplementWork.getStatus().equals("1")) {
+                                    workDTO.setStatusN("通过");
+                                } else if (supplementWork.getStatus().equals("3")) {
+                                    workDTO.setStatusN("拒绝");
+                                }
+                            }
+                            else{
+                                workDTO.setStatusN("未处理");
                             }
                         } else {
                             workDTO.setStatusN("未处理");

+ 1 - 1
web/src/main/java/com/jpsoft/shinestar/scheduled/UpdateWorkMinuteTask.java

@@ -22,7 +22,7 @@ public class UpdateWorkMinuteTask {
     @Autowired
     private WorkScheduleAttendanceService workScheduleAttendanceService;
 
-    @Scheduled(cron = "0 0/5 * * * ?")
+//    @Scheduled(cron = "0 0/5 * * * ?")
     public void run() {
         List<WorkScheduleAttendance> list = workScheduleAttendanceService.findEmptyWorkMinuteList(100);