浏览代码

年假申请后,考勤显示调整,年假算正常上班考勤

yanliming 11 月之前
父节点
当前提交
27cfef813a

+ 3 - 3
common/src/main/java/com/jpsoft/shinestar/modules/base/entity/PersonInfo.java

@@ -212,7 +212,7 @@ public class PersonInfo implements Serializable {
     @ApiModelProperty(value = "所在单位角色编号")
     private String personRoleId;
 
-    @ApiModelProperty(value="工作状态:1-工作,2-外出,3-出差,4-休假")
+    @ApiModelProperty(value="工作状态:1-工作,2-外出,3-出差,4-休假,7-休假")
     private String workStatus;
 
     public String getWorkStatusN(){
@@ -229,8 +229,8 @@ public class PersonInfo implements Serializable {
         }
         else if(WorkStatus.VOCATION.equals(workStatus)){
             text = "休假";
-        }else if (WorkStatus.QUIT.equals(workStatus)){
-            text = "离职";
+        }else if (WorkStatus.YEAR.equals(workStatus)){
+            text = "年假";
         }
         return text;
     }

+ 1 - 0
common/src/main/java/com/jpsoft/shinestar/modules/base/entity/WorkStatus.java

@@ -6,4 +6,5 @@ public class WorkStatus {
     public final static String TRAVEL = "3";
     public final static String VOCATION = "4";
     public final static String QUIT = "5";
+    public final static String YEAR = "7";
 }

+ 3 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/dao/YearRequestForLeaveInfoDAO.java

@@ -1,5 +1,6 @@
 package com.jpsoft.shinestar.modules.business.dao;
 
+import java.util.Date;
 import java.util.List;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.shinestar.modules.business.entity.YearRequestForLeaveInfo;
@@ -14,6 +15,8 @@ public interface YearRequestForLeaveInfoDAO {
 	YearRequestForLeaveInfo get(String id);
 	int delete(String id);
 	List<YearRequestForLeaveInfo> list();
+	List<YearRequestForLeaveInfo> findByPersonIdAndDate(Long personId, Date attendanceDate);
 	List<YearRequestForLeaveInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 	List<YearRequestForLeaveInfo> mobileSearch(Map<String, Object> searchParams, List<Sort> sortList);
+    List<YearRequestForLeaveInfo> findByPersonIdAndSEDate(Long personId, Date startDate, Date endDate);
 }

+ 24 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/dto/PersonInfoDayWSADTO.java

@@ -58,6 +58,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(onWorkResult)){
             text = "请假";
         }
+        else if("14".equals(onWorkResult)){
+            text = "年假";
+        }
         else if("50".equals(onWorkResult)){
             text = "未打卡";
         }
@@ -108,6 +111,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(offWorkResult)){
             text = "请假";
         }
+        else if("14".equals(offWorkResult)){
+            text = "年假";
+        }
         else if("50".equals(offWorkResult)){
             text = "未打卡";
         }
@@ -162,6 +168,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(onWorkResult1)){
             text = "请假";
         }
+        else if("14".equals(onWorkResult1)){
+            text = "年假";
+        }
         else if("50".equals(onWorkResult1)){
             text = "未打卡";
         }
@@ -216,6 +225,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(offWorkResult1)){
             text = "请假";
         }
+        else if("14".equals(offWorkResult1)){
+            text = "年假";
+        }
         else if("50".equals(offWorkResult1)){
             text = "未打卡";
         }
@@ -276,6 +288,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(onWorkResult2)){
             text = "请假";
         }
+        else if("14".equals(onWorkResult2)){
+            text = "年假";
+        }
         else if("50".equals(onWorkResult2)){
             text = "未打卡";
         }
@@ -330,6 +345,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(offWorkResult2)){
             text = "请假";
         }
+        else if("14".equals(offWorkResult2)){
+            text = "年假";
+        }
         else if("50".equals(offWorkResult2)){
             text = "未打卡";
         }
@@ -389,6 +407,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(onWorkResult3)){
             text = "请假";
         }
+        else if("14".equals(onWorkResult3)){
+            text = "年假";
+        }
         else if("50".equals(onWorkResult3)){
             text = "未打卡";
         }
@@ -443,6 +464,9 @@ public class PersonInfoDayWSADTO {
         else if("13".equals(offWorkResult3)){
             text = "请假";
         }
+        else if("14".equals(offWorkResult3)){
+            text = "年假";
+        }
         else if("50".equals(offWorkResult3)){
             text = "未打卡";
         }

+ 2 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/dto/PersonInfoMonthWSADTO.java

@@ -37,6 +37,8 @@ public class PersonInfoMonthWSADTO {
     private BigDecimal businessTripNum;
     @ApiModelProperty(value = "请假天数")
     private BigDecimal leaveNum;
+    @ApiModelProperty(value = "年假天数")
+    private BigDecimal yearLeaveNum;
     @ApiModelProperty(value = "休息天数")
     private BigDecimal restDays;
     @ApiModelProperty(value = "企业全称,为空则保存企业名称")

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

@@ -1,5 +1,7 @@
 package com.jpsoft.shinestar.modules.business.service;
 
+import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -18,6 +20,8 @@ public interface YearRequestForLeaveInfoService {
 	void logic(YearRequestForLeaveInfo yearRequestForLeaveInfo) throws Exception;
 	int delete(String id);
 	List<YearRequestForLeaveInfo> list();
+	List<YearRequestForLeaveInfo> findByPersonIdAndDate(Long personId, Date attendanceDate);
+    BigDecimal sumDaysByPersonIdAndTimeRange(Long personId, Date startDate, Date endDate);
 	Page<YearRequestForLeaveInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Page<YearRequestForLeaveInfo> pageMobileSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	void approvalRequestForLeave(PersonInfo personInfo, String id, String approvalOpinions, String approvalExplain, int status) throws Exception;

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

@@ -9,9 +9,11 @@ import com.jpsoft.shinestar.modules.base.service.*;
 import com.jpsoft.shinestar.modules.business.dao.WorkScheduleAttendanceDAO;
 import com.jpsoft.shinestar.modules.business.entity.RequestForLeaveInfo;
 import com.jpsoft.shinestar.modules.business.entity.WorkScheduleAttendance;
+import com.jpsoft.shinestar.modules.business.entity.YearRequestForLeaveInfo;
 import com.jpsoft.shinestar.modules.business.service.MeetingPersonRecodeService;
 import com.jpsoft.shinestar.modules.business.service.RequestForLeaveInfoService;
 import com.jpsoft.shinestar.modules.business.service.WorkScheduleAttendanceService;
+import com.jpsoft.shinestar.modules.business.service.YearRequestForLeaveInfoService;
 import com.jpsoft.shinestar.modules.common.dto.Sort;
 import com.jpsoft.shinestar.modules.common.utils.JwtUtil2;
 import com.jpsoft.shinestar.modules.common.utils.StringUtils;
@@ -106,6 +108,9 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
     @Autowired
     private MeetingPersonRecodeService meetingPersonRecodeService;
 
+    @Autowired
+    private YearRequestForLeaveInfoService yearRequestForLeaveInfoService;
+
     private  ExecutorService threadPool = Executors.newFixedThreadPool(1);
 
     @Override
@@ -1067,6 +1072,14 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
                         }
                     }
 
+                    List<YearRequestForLeaveInfo> yearRequestForLeaveInfoList1 = yearRequestForLeaveInfoService.findByPersonIdAndDate(personInfo.getId(), attendanceTime.toDate());
+
+                    if(yearRequestForLeaveInfoList1.size()>0){
+                        saveWorkAttendance(personInfo.getId(), new BigDecimal(0), attendanceTime.toDate(), dateStr,
+                                personScheduleId, workShiftId, "0", 0, classify, "7");
+                        return;
+                    }
+
                     //查询人员考勤时段是否有加班
                     if(workOverPerson!=null && workOver!=null){
                         if("1".equals(classify)){
@@ -1147,6 +1160,7 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
         searchParams.put("result",result);
         searchParams.put("noWorkStatus","3");
         searchParams.put("noWorkStatus4","4");
+        searchParams.put("noWorkStatus7","7");
         List<WorkScheduleAttendance> wsaList = workScheduleAttendanceDAO.findAbsenteeismGroupByPersonIdAndMonthsAndResult(personId,startDate,endDate, searchParams);
         BigDecimal absenteeismNum = BigDecimal.ZERO;
 

+ 31 - 0
common/src/main/java/com/jpsoft/shinestar/modules/business/service/impl/YearRequestForLeaveInfoServiceImpl.java

@@ -1,6 +1,7 @@
 package com.jpsoft.shinestar.modules.business.service.impl;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.*;
 import javax.annotation.Resource;
 
@@ -25,6 +26,7 @@ import com.jpsoft.shinestar.modules.workflow.service.ProcinstService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
+import org.joda.time.Hours;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -114,6 +116,11 @@ public class YearRequestForLeaveInfoServiceImpl implements YearRequestForLeaveIn
 		// TODO Auto-generated method stub
 		return yearRequestForLeaveInfoDAO.list();
 	}
+
+    @Override
+    public List<YearRequestForLeaveInfo> findByPersonIdAndDate(Long personId, Date attendanceDate) {
+        return yearRequestForLeaveInfoDAO.findByPersonIdAndDate(personId, attendanceDate);
+    }
 		
 	@Override
 	public Page<YearRequestForLeaveInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
@@ -132,6 +139,30 @@ public class YearRequestForLeaveInfoServiceImpl implements YearRequestForLeaveIn
 		return page;
 	}
 
+    @Override
+    public BigDecimal sumDaysByPersonIdAndTimeRange(Long personId, Date startDate, Date endDate){
+        //查询时间段与出差交集部分
+        List<YearRequestForLeaveInfo> boList = yearRequestForLeaveInfoDAO.findByPersonIdAndSEDate(personId,startDate,endDate);
+        BigDecimal totalAttendanceNum = BigDecimal.ZERO;
+
+        for(YearRequestForLeaveInfo yearRequestForLeaveInfo : boList){
+//            if(bo.getEstimatedTime() != null) {
+//                BigDecimal et = new BigDecimal(bo.getEstimatedTime());
+//                totalAttendanceNum = totalAttendanceNum.add(et);
+//            }
+            //查询交集部分小时数
+            Date maxStartDate = yearRequestForLeaveInfo.getStartTime().compareTo(startDate)>0 ? yearRequestForLeaveInfo.getStartTime() : startDate;
+            Date minEndDate = yearRequestForLeaveInfo.getEndTime().compareTo(endDate)<0 ? yearRequestForLeaveInfo.getEndTime() : endDate;
+
+            int hours = Hours.hoursBetween(new DateTime(maxStartDate),new DateTime(minEndDate)).getHours();
+            BigDecimal days = new BigDecimal(hours).divide(new BigDecimal(24),1, RoundingMode.HALF_UP);
+
+            totalAttendanceNum = totalAttendanceNum.add(days);
+        }
+
+        return totalAttendanceNum;
+    }
+
 
 	@Override
 	public void logic(YearRequestForLeaveInfo yearRequestForLeaveInfo) throws Exception {

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

@@ -82,7 +82,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
     private ProcinstService procinstService;
 
     @Autowired
-	private CustomerDiningRecordService customerDiningRecordService;
+    private CustomerDiningRecordService customerDiningRecordService;
 
     @Autowired
     private ProcessSetService processSetService;
@@ -161,14 +161,14 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
     }
 
     @Override
-    public void examineSubmit(String procinstActUserIds, PersonPopedom personPopedom, String status, String content) throws Exception{
+    public void examineSubmit(String procinstActUserIds, PersonPopedom personPopedom, String status, String content) throws Exception {
         List<String> idList = Arrays.asList(procinstActUserIds.split(","));
 
         if (idList.size() > 0) {
             for (String id : idList) {
                 ProcinstActUser procinstActUser = get(id);
 
-                log.warn("actUser={},action={}",procinstActUser.getId(),procinstActUser.getAction());
+                log.warn("actUser={},action={}", procinstActUser.getId(), procinstActUser.getAction());
 
                 if (procinstActUser != null && "0".equals(procinstActUser.getAction())) {
                     ProcinstActivity procinstActivity = procinstActivityService.get(procinstActUser.getProcinstActivityId());
@@ -179,7 +179,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                     ProcessTemplate processTemplate = processTemplateService.get(processActivity.getProcessTemplateId());
                     ProcessSet processSet = processSetService.get(processTemplate.getProcessSetId());
 
-                    log.warn("procInstId={},type={}",procinst.getId(),procinst.getType());
+                    log.warn("procInstId={},type={}", procinst.getId(), procinst.getType());
 
                     String businessStatus = null;
                     AdjustShift adjustShift = null;
@@ -222,10 +222,10 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                     }
                     //接待就餐
                     CustomerDiningRecord customerDiningRecord = null;
-                    if ("9".equals(procinst.getType())){
-                    	customerDiningRecord = customerDiningRecordService.get(procinst.getBusinessKey());
+                    if ("9".equals(procinst.getType())) {
+                        customerDiningRecord = customerDiningRecordService.get(procinst.getBusinessKey());
                         businessStatus = customerDiningRecord.getStatus();
-					}
+                    }
                     //年假
                     YearRequestForLeaveInfo yearRequestForLeaveInfo = null;
                     if ("11".equals(procinst.getType())) {
@@ -234,7 +234,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
 
                     }
 
-                    if (!"0".equals(businessStatus)){
+                    if (!"0".equals(businessStatus)) {
                         throw new Exception("业务非待审核状态");
                     }
 
@@ -242,7 +242,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                     List<ProcinstActUser> procinstActUserList = findByProcinstActivityIdActionType(procinstActUser.getProcinstActivityId(), "0", "1");
 
                     log.warn("ProcInstActivity={},查询此步骤还有多少人未审核:{},operation={}",
-                            procinstActUser.getProcinstActivityId(),procinstActUserList.size(),processActivity.getOperation());
+                            procinstActUser.getProcinstActivityId(), procinstActUserList.size(), processActivity.getOperation());
 
                     //如果未审核人的数量大于1个,则查询此步骤是或签还是会签
                     if (procinstActUserList.size() > 1) {
@@ -310,16 +310,16 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                         //	RequestForLeaveInfo requestForLeaveInfo = requestForLeaveInfoService.get(procinst.getBusinessKey());
 
                                         //请假审核
-                                        if (requestForLeaveInfo.getStatus() == 0){
+                                        if (requestForLeaveInfo.getStatus() == 0) {
                                             requestForLeaveInfo.setStatus(1);
                                             double days = 0;
-                                            if(StringUtils.isNotEmpty(requestForLeaveInfo.getDays())) {
+                                            if (StringUtils.isNotEmpty(requestForLeaveInfo.getDays())) {
                                                 days = Double.parseDouble(requestForLeaveInfo.getDays());
                                             }
 
-                                            if (days>=4){
+                                            if (days >= 4) {
                                                 requestForLeaveInfo.setEnableCancel(true);
-                                            }else {
+                                            } else {
                                                 if ("2".equals(requestForLeaveInfo.getLeaveType()) || "5".equals(requestForLeaveInfo.getLeaveType()) || "6".equals(requestForLeaveInfo.getLeaveType())) {
                                                     requestForLeaveInfo.setEnableCancel(true);
                                                 }
@@ -329,10 +329,9 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 requestForLeaveInfo.setEnableCancel(true);
                                             }*/
 
-                                        }
-                                        else {
+                                        } else {
                                             //销假审核
-                                            if ("0".equals(requestForLeaveInfo.getCancelStatus())){
+                                            if ("0".equals(requestForLeaveInfo.getCancelStatus())) {
                                                 requestForLeaveInfo.setCancelStatus(status);
                                                 requestForLeaveInfo.setCancelTime(new Date());
                                                 requestForLeaveInfo.setEnableCancel(false);
@@ -372,12 +371,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                         carryThingsOutFactoryService.update(carryThingsOutFactory);
                                     }
 
-									//接口就餐
-									if ("9".equals(procinst.getType())) {
-										customerDiningRecord.setStatus(status);
-										customerDiningRecord.setUpdateTime(new Date());
-										customerDiningRecordService.update(customerDiningRecord);
-									}
+                                    //接口就餐
+                                    if ("9".equals(procinst.getType())) {
+                                        customerDiningRecord.setStatus(status);
+                                        customerDiningRecord.setUpdateTime(new Date());
+                                        customerDiningRecordService.update(customerDiningRecord);
+                                    }
 
                                     //年假
                                     if ("11".equals(procinst.getType())) {
@@ -386,8 +385,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                         yearRequestForLeaveInfoService.update(yearRequestForLeaveInfo);
                                     }
 
-                                }
-                                else {
+                                } else {
                                     log.warn("有下个步骤,修改下个步骤的状态");
                                     procinstActivity1.setStatus("1");
                                     procinstActivityService.update(procinstActivity1);
@@ -411,7 +409,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                     if ("2".equals(procinst.getType())) {
                                                         RequestForLeaveInfo requestForLeaveInfo1 = requestForLeaveInfoService.get(procinst.getBusinessKey());
                                                         typeName = "请假";
-                                                        if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())){
+                                                        if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())) {
                                                             typeName = "销假";
                                                         }
 
@@ -428,13 +426,13 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                     if ("8".equals(procinst.getType())) {
                                                         typeName = "携物出厂";
                                                     }
-                                                    if ("9".equals(procinst.getType())){
-                                                    	typeName = "接待就餐";
-													}
+                                                    if ("9".equals(procinst.getType())) {
+                                                        typeName = "接待就餐";
+                                                    }
                                                     if ("11".equals(procinst.getType())) {
                                                         typeName = "年假";
                                                     }
-                                                   WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的" + typeName + "信息待审核", personInfo.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + procinst.getBusinessKey() + "&procinstActUserId=" + procinstActUser1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                                    WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的" + typeName + "信息待审核", personInfo.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + procinst.getBusinessKey() + "&procinstActUserId=" + procinstActUser1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                                                 } catch (Exception ex) {
                                                     ex.printStackTrace();
                                                 }
@@ -464,7 +462,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                             if ("2".equals(procinst.getType())) {
                                                 RequestForLeaveInfo requestForLeaveInfo1 = requestForLeaveInfoService.get(procinst.getBusinessKey());
                                                 typeName = "请假";
-                                                if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())){
+                                                if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())) {
                                                     typeName = "销假";
                                                 }
                                                 PersonPopedom personPopedom1 = personPopedomService.get(requestForLeaveInfo1.getPersonPopedomId());
@@ -479,7 +477,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                             }
                                             if ("4".equals(procinst.getType()) || "5".equals(procinst.getType())) {
                                                 typeName = "补卡";
-                                               SupplementWork supplementWork1 = supplementWorkService.get(procinst.getBusinessKey());
+                                                SupplementWork supplementWork1 = supplementWorkService.get(procinst.getBusinessKey());
                                                 PersonPopedom personPopedom1 = personPopedomService.get(supplementWork1.getPersonPopedomId());
                                                 personInfo1 = personInfoService.get(personPopedom1.getPersonId());
 
@@ -498,7 +496,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 personInfo1 = personInfoService.get(personPopedom1.getPersonId());
 
                                             }
-                                            if ("9".equals(procinst.getType())){
+                                            if ("9".equals(procinst.getType())) {
                                                 typeName = "接待就餐";
                                                 CustomerDiningRecord customerDiningRecord1 = customerDiningRecordService.get(procinst.getBusinessKey());
                                                 PersonPopedom personPopedom1 = personPopedomService.get(customerDiningRecord1.getPersonPopedomId());
@@ -511,13 +509,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 PersonPopedom personPopedom1 = personPopedomService.get(yearRequestForLeaveInfo1.getPersonPopedomId());
                                                 personInfo1 = personInfoService.get(personPopedom1.getPersonId());
                                             }
-                                            WechatMessageUtil.sendCCRemindMessage(personInfo.getOpenId(), "[抄送]" + typeName +"审核通过", personInfo1.getName(), typeName, typeName+"审核", DateUtil.format(procinst.getCreateTime(),"yyyy-MM-dd HH:mm:ss"),"已抄送",wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + procinst.getBusinessKey() + "&procinstActUserId=" + ccProcinstActUer.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                            WechatMessageUtil.sendCCRemindMessage(personInfo.getOpenId(), "[抄送]" + typeName + "审核通过", personInfo1.getName(), typeName, typeName + "审核", DateUtil.format(procinst.getCreateTime(), "yyyy-MM-dd HH:mm:ss"), "已抄送", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + procinst.getBusinessKey() + "&procinstActUserId=" + ccProcinstActUer.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                                         }
                                     }).start();
 
                                 }
-                            }
-                            else if ("3".equals(status)) {
+                            } else if ("3".equals(status)) {
                                 log.warn("审核拒绝,删除其他的或签,删除此申请流程其他未处理的待审核记录");
                                 procinstActUserList.remove(procinstActUser);
                                 procinstActUser.setAction(status);
@@ -559,12 +556,11 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 //请假
                                 if ("2".equals(procinst.getType())) {
                                     //请假审核
-                                    if (requestForLeaveInfo.getStatus() == 0){
+                                    if (requestForLeaveInfo.getStatus() == 0) {
                                         requestForLeaveInfo.setStatus(Integer.parseInt(status));
-                                    }
-                                    else {
+                                    } else {
                                         //销假审核
-                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())){
+                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())) {
                                             requestForLeaveInfo.setCancelStatus(status);
                                             requestForLeaveInfo.setCancelTime(new Date());
                                             requestForLeaveInfo.setEnableCancel(true);
@@ -604,16 +600,16 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                     carryThingsOutFactoryService.update(carryThingsOutFactory);
                                 }
 
-								//接待就餐
-								if ("9".equals(procinst.getType())) {
-									customerDiningRecord.setStatus(status);
-									customerDiningRecord.setUpdateTime(new Date());
-									customerDiningRecordService.update(customerDiningRecord);
-								}
+                                //接待就餐
+                                if ("9".equals(procinst.getType())) {
+                                    customerDiningRecord.setStatus(status);
+                                    customerDiningRecord.setUpdateTime(new Date());
+                                    customerDiningRecordService.update(customerDiningRecord);
+                                }
 
                                 //年假
                                 if ("11".equals(procinst.getType())) {
-                                    if (yearRequestForLeaveInfo.getStatus() == 0){
+                                    if (yearRequestForLeaveInfo.getStatus() == 0) {
                                         yearRequestForLeaveInfo.setStatus(Integer.parseInt(status));
                                     }
                                     yearRequestForLeaveInfo.setUpdateTime(new Date());
@@ -631,7 +627,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
 
                             //审核拒绝
                             if ("3".equals(status)) {
-                                log.warn("会签审核拒绝,actUserId={}",procinstActUser.getId());
+                                log.warn("会签审核拒绝,actUserId={}", procinstActUser.getId());
 
                                 for (ProcinstActUser procinstActUser1 : procinstActUserList) {
                                     procinstActUser1.setDelFlag(true);
@@ -665,18 +661,17 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 }
                                 if ("2".equals(procinst.getType())) {
                                     //请假审核
-                                    if (requestForLeaveInfo.getStatus() == 0){
+                                    if (requestForLeaveInfo.getStatus() == 0) {
                                         requestForLeaveInfo.setStatus(Integer.parseInt(status));
-                                    }
-                                    else {
+                                    } else {
                                         //销假审核
-                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())){
+                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())) {
                                             requestForLeaveInfo.setCancelStatus(status);
                                             requestForLeaveInfo.setCancelTime(new Date());
                                             requestForLeaveInfo.setEnableCancel(true);
                                         }
                                     }
-                                  //  requestForLeaveInfo.setStatus(Integer.parseInt(status));
+                                    //  requestForLeaveInfo.setStatus(Integer.parseInt(status));
                                     requestForLeaveInfo.setUpdateTime(new Date());
                                     requestForLeaveInfoService.update(requestForLeaveInfo);
                                 }
@@ -705,12 +700,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                     carryThingsOutFactory.setUpdateTime(new Date());
                                     carryThingsOutFactoryService.update(carryThingsOutFactory);
                                 }
-								//接待就餐
-								if ("9".equals(procinst.getType())) {
-									customerDiningRecord.setStatus(status);
-									customerDiningRecord.setUpdateTime(new Date());
-									customerDiningRecordService.update(customerDiningRecord);
-								}
+                                //接待就餐
+                                if ("9".equals(procinst.getType())) {
+                                    customerDiningRecord.setStatus(status);
+                                    customerDiningRecord.setUpdateTime(new Date());
+                                    customerDiningRecordService.update(customerDiningRecord);
+                                }
 
                                 //年假
                                 if ("11".equals(procinst.getType())) {
@@ -720,13 +715,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 }
                             }
                         }
-                    }
-                    else {
+                    } else {
                         log.warn("未审核人的数量等于1,不用区分或签和会签");
 
                         //审核通过
                         if ("1".equals(status)) {
-                            log.warn("审核通过,actUserId={}",procinstActUser.getId());
+                            log.warn("审核通过,actUserId={}", procinstActUser.getId());
 
                             procinstActUser.setAction(status);
                             procinstActUser.setRemark(content);
@@ -745,7 +739,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                             int activityIndex = procinstActivity.getActivityIndex() + 1;
                             ProcinstActivity procinstActivity1 = procinstActivityService.findByActivityIndexAndProcinstId(activityIndex, procinstActivity.getProcinstId());
 
-                            log.warn("查询是否有下个步骤,procInstId={},activityIndex={},result={}",procinstActivity.getProcinstId(),activityIndex,procinstActivity1!=null);
+                            log.warn("查询是否有下个步骤,procInstId={},activityIndex={},result={}", procinstActivity.getProcinstId(), activityIndex, procinstActivity1 != null);
 
                             if (procinstActivity1 == null) {
                                 log.warn("没有下个步骤则整个流程完毕");
@@ -773,7 +767,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 //todo 如果调整当天之前的班次则重新生成考勤
                                                 Date now = new Date();
 
-                                                if(workPersonScheduling.getSchedulingDay()!=null && workPersonScheduling.getSchedulingDay().before(now)) {
+                                                if (workPersonScheduling.getSchedulingDay() != null && workPersonScheduling.getSchedulingDay().before(now)) {
                                                     DateTime startTime = new DateTime(workPersonScheduling.getSchedulingDay());
                                                     DateTime endTime = startTime; //updatePersonAttendance会自动加一天
 
@@ -792,19 +786,19 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 //请假
                                 if ("2".equals(procinst.getType())) {
                                     //请假审核
-                                    if (requestForLeaveInfo.getStatus() == 0){
+                                    if (requestForLeaveInfo.getStatus() == 0) {
                                         requestForLeaveInfo.setStatus(Integer.parseInt(status));
 //                                        if ("2".equals(requestForLeaveInfo.getLeaveType()) || "5".equals(requestForLeaveInfo.getLeaveType()) || "6".equals(requestForLeaveInfo.getLeaveType())){
 //                                            requestForLeaveInfo.setEnableCancel(true)
 //                                        }
                                         double days = 0;
-                                        if(StringUtils.isNotEmpty(requestForLeaveInfo.getDays())) {
+                                        if (StringUtils.isNotEmpty(requestForLeaveInfo.getDays())) {
                                             days = Double.parseDouble(requestForLeaveInfo.getDays());
                                         }
 
-                                        if (days>=4){
+                                        if (days >= 4) {
                                             requestForLeaveInfo.setEnableCancel(true);
-                                        }else {
+                                        } else {
                                             if ("2".equals(requestForLeaveInfo.getLeaveType()) || "5".equals(requestForLeaveInfo.getLeaveType()) || "6".equals(requestForLeaveInfo.getLeaveType())) {
                                                 requestForLeaveInfo.setEnableCancel(true);
                                             }
@@ -812,16 +806,15 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                         /*if (("1".equals(requestForLeaveInfo.getLeaveType())&&days>=4) ||"2".equals(requestForLeaveInfo.getLeaveType()) || "5".equals(requestForLeaveInfo.getLeaveType()) || "6".equals(requestForLeaveInfo.getLeaveType())){
                                             requestForLeaveInfo.setEnableCancel(true);
                                         }*/
-                                    }
-                                    else {
+                                    } else {
                                         //销假审核
-                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())){
+                                        if ("0".equals(requestForLeaveInfo.getCancelStatus())) {
                                             requestForLeaveInfo.setCancelStatus(status);
                                             requestForLeaveInfo.setCancelTime(new Date());
                                         }
                                     }
 
-                                  //  requestForLeaveInfo.setStatus(1);
+                                    //  requestForLeaveInfo.setStatus(1);
                                     requestForLeaveInfo.setUpdateTime(new Date());
                                     requestForLeaveInfoService.update(requestForLeaveInfo);
 
@@ -854,12 +847,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                     carryThingsOutFactoryService.update(carryThingsOutFactory);
                                 }
 
-								//接待就餐
-								if ("9".equals(procinst.getType())) {
-									customerDiningRecord.setStatus(status);
-									customerDiningRecord.setUpdateTime(new Date());
-									customerDiningRecordService.update(customerDiningRecord);
-								}
+                                //接待就餐
+                                if ("9".equals(procinst.getType())) {
+                                    customerDiningRecord.setStatus(status);
+                                    customerDiningRecord.setUpdateTime(new Date());
+                                    customerDiningRecordService.update(customerDiningRecord);
+                                }
 
                                 //年假
                                 if ("11".equals(procinst.getType())) {
@@ -867,8 +860,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                     yearRequestForLeaveInfo.setUpdateTime(new Date());
                                     yearRequestForLeaveInfoService.update(yearRequestForLeaveInfo);
                                 }
-                            }
-                            else {
+                            } else {
                                 log.warn("有下个步骤,修改下个步骤的状态");
 
                                 procinstActivity1.setStatus("1");
@@ -890,10 +882,10 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 if ("2".equals(procinst.getType())) {
                                                     RequestForLeaveInfo requestForLeaveInfo1 = requestForLeaveInfoService.get(procinst.getBusinessKey());
                                                     typeName = "请假";
-                                                    if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())){
+                                                    if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())) {
                                                         typeName = "销假";
                                                     }
-                                                   // typeName = "请假";
+                                                    // typeName = "请假";
                                                 }
                                                 if ("3".equals(procinst.getType())) {
                                                     typeName = "出差";
@@ -907,10 +899,10 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                                 if ("8".equals(procinst.getType())) {
                                                     typeName = "携物出厂";
                                                 }
-                                                if ("9".equals(procinst.getType())){
-                                                	typeName = "接待就餐";
-												}
-                                                if ("11".equals(procinst.getType())){
+                                                if ("9".equals(procinst.getType())) {
+                                                    typeName = "接待就餐";
+                                                }
+                                                if ("11".equals(procinst.getType())) {
                                                     typeName = "年假";
                                                 }
                                                 WechatMessageUtil.sendEvenMessage(personInfo.getOpenId(), "有一条新的" + typeName + "信息待审核", personInfo.getName(), com.jpsoft.shinestar.modules.common.utils.StringUtils.getApprovalNo(), "前往处理", wxConfig.getPortalUrl() + "xsy/approval/infosp?id=" + procinst.getBusinessKey() + "&procinstActUserId=" + procinstActUser1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
@@ -943,7 +935,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                         if ("2".equals(procinst.getType())) {
                                             RequestForLeaveInfo requestForLeaveInfo1 = requestForLeaveInfoService.get(procinst.getBusinessKey());
                                             typeName = "请假";
-                                            if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())){
+                                            if (requestForLeaveInfo1.getStatus() == 1 && "0".equals(requestForLeaveInfo1.getCancelStatus())) {
                                                 typeName = "销假";
                                             }
                                             PersonPopedom personPopedom1 = personPopedomService.get(requestForLeaveInfo1.getPersonPopedomId());
@@ -977,7 +969,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                             personInfo1 = personInfoService.get(personPopedom1.getPersonId());
 
                                         }
-                                        if ("9".equals(procinst.getType())){
+                                        if ("9".equals(procinst.getType())) {
                                             typeName = "接待就餐";
                                             CustomerDiningRecord customerDiningRecord1 = customerDiningRecordService.get(procinst.getBusinessKey());
                                             PersonPopedom personPopedom1 = personPopedomService.get(customerDiningRecord1.getPersonPopedomId());
@@ -990,7 +982,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                             PersonPopedom personPopedom1 = personPopedomService.get(yearRequestForLeaveInfo1.getPersonPopedomId());
                                             personInfo1 = personInfoService.get(personPopedom1.getPersonId());
                                         }
-                                        WechatMessageUtil.sendCCRemindMessage(personInfo.getOpenId(), "[抄送]" + typeName +"审核通过", personInfo1.getName(), typeName, typeName+"审核", DateUtil.format(procinst.getCreateTime(),"yyyy-MM-dd HH:mm:ss"),"已抄送",wxConfig.getPortalUrl() + "xsy/approval/info?id=" + procinst.getBusinessKey() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                        WechatMessageUtil.sendCCRemindMessage(personInfo.getOpenId(), "[抄送]" + typeName + "审核通过", personInfo1.getName(), typeName, typeName + "审核", DateUtil.format(procinst.getCreateTime(), "yyyy-MM-dd HH:mm:ss"), "已抄送", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + procinst.getBusinessKey() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                                     }
                                 }).start();
                             }
@@ -998,7 +990,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
 
                         //审核拒绝
                         if ("3".equals(status)) {
-                            log.warn("审核拒绝,actUserId={}",procinstActUser.getId());
+                            log.warn("审核拒绝,actUserId={}", procinstActUser.getId());
 
                             procinstActUserList.remove(procinstActUser);
                             procinstActUser.setAction(status);
@@ -1031,18 +1023,17 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                             }
                             if ("2".equals(procinst.getType())) {
                                 //请假审核
-                                if (requestForLeaveInfo.getStatus() == 0){
+                                if (requestForLeaveInfo.getStatus() == 0) {
                                     requestForLeaveInfo.setStatus(Integer.parseInt(status));
-                                }
-                                else {
+                                } else {
                                     //销假审核
-                                    if ("0".equals(requestForLeaveInfo.getCancelStatus())){
+                                    if ("0".equals(requestForLeaveInfo.getCancelStatus())) {
                                         requestForLeaveInfo.setCancelStatus(status);
                                         requestForLeaveInfo.setCancelTime(new Date());
                                         requestForLeaveInfo.setEnableCancel(true);
                                     }
                                 }
-                              //  requestForLeaveInfo.setStatus(Integer.parseInt(status));
+                                //  requestForLeaveInfo.setStatus(Integer.parseInt(status));
                                 requestForLeaveInfo.setUpdateTime(new Date());
                                 requestForLeaveInfoService.update(requestForLeaveInfo);
                             }
@@ -1075,12 +1066,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 carryThingsOutFactoryService.update(carryThingsOutFactory);
                             }
 
-							//接待就餐
-							if ("9".equals(procinst.getType())) {
-								customerDiningRecord.setStatus(status);
-								customerDiningRecord.setUpdateTime(new Date());
-								customerDiningRecordService.update(customerDiningRecord);
-							}
+                            //接待就餐
+                            if ("9".equals(procinst.getType())) {
+                                customerDiningRecord.setStatus(status);
+                                customerDiningRecord.setUpdateTime(new Date());
+                                customerDiningRecordService.update(customerDiningRecord);
+                            }
 
                             //年假
                             if ("11".equals(procinst.getType())) {
@@ -1131,7 +1122,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                             new Thread(() -> {
                                 String statusN = "";
                                 String typeNameN = "请假";
-                                if ("5".equals(requestForLeaveInfo1.getCancelStatus())){
+                                if ("5".equals(requestForLeaveInfo1.getCancelStatus())) {
                                     if (requestForLeaveInfo1.getStatus() == 1) {
                                         statusN = "同意";
 
@@ -1146,12 +1137,12 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                     if (requestForLeaveInfo1.getStatus() == 3) {
                                         statusN = "拒绝";
                                     }
-                                }else {
+                                } else {
                                     typeNameN = "销假";
-                                    if ("1".equals(requestForLeaveInfo1.getCancelStatus())){
-                                        statusN ="同意";
+                                    if ("1".equals(requestForLeaveInfo1.getCancelStatus())) {
+                                        statusN = "同意";
                                     }
-                                    if ("3".equals(requestForLeaveInfo1.getCancelStatus())){
+                                    if ("3".equals(requestForLeaveInfo1.getCancelStatus())) {
                                         statusN = "拒绝";
                                     }
                                 }
@@ -1159,7 +1150,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                                 PersonInfo person = personInfoService.get(requestForLeaveInfo1.getPersonId());
 
                                 String accessToken = JwtUtil2.createToken(jwtSecret, person.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-                                WechatMessageUtil.sendExamine(person.getOpenId(), typeNameN+"审核" + statusN, person.getName(), "1", statusN, typeNameN, "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + requestForLeaveInfo1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                                WechatMessageUtil.sendExamine(person.getOpenId(), typeNameN + "审核" + statusN, person.getName(), "1", statusN, typeNameN, "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + requestForLeaveInfo1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
                             }).start();
                         }
                     }
@@ -1230,7 +1221,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                     }
 
                     //加班
-                    if (("6".equals(procinst.getType()) || "7".equals(procinst.getType())) && workOver!=null) {
+                    if (("6".equals(procinst.getType()) || "7".equals(procinst.getType())) && workOver != null) {
 //                        WorkOver workOver1 = workOverService.get(procinst.getBusinessKey());
                         List<WorkOverPerson> workOverPersonList = workOverPersonService.findByWorkOverId(workOver.getId());
                         if (!"0".equals(workOver.getStatus()) && workOverPersonList.size() > 0) {
@@ -1248,7 +1239,7 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                             workOver.setRemark(statusN);
                             workOverService.update(workOver);
 
-                            log.warn("更新加班记录,workOverId={},remark={}",workOver.getId(),workOver.getRemark());
+                            log.warn("更新加班记录,workOverId={},remark={}", workOver.getId(), workOver.getRemark());
 
                             final WorkOver fWorkOver = workOver;
                             final String fStatusN = statusN;
@@ -1292,48 +1283,48 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                         }
                     }
 
-					//接待就餐
-					if ("9".equals(procinst.getType())) {
-						CustomerDiningRecord customerDiningRecord1 = customerDiningRecordService.get(procinst.getBusinessKey());
+                    //接待就餐
+                    if ("9".equals(procinst.getType())) {
+                        CustomerDiningRecord customerDiningRecord1 = customerDiningRecordService.get(procinst.getBusinessKey());
 
-						if (!"0".equals(customerDiningRecord1.getStatus())) {
-							new Thread(() -> {
-								String statusN = "";
-								if ("1".equals(customerDiningRecord1.getStatus())) {
-									statusN = "同意";
-								}
-								if ("3".equals(customerDiningRecord1.getStatus())) {
-									statusN = "拒绝";
-								}
-								PersonPopedom personPopedom1 = personPopedomService.findByIdIgnoreDel(customerDiningRecord1.getPersonPopedomId());
+                        if (!"0".equals(customerDiningRecord1.getStatus())) {
+                            new Thread(() -> {
+                                String statusN = "";
+                                if ("1".equals(customerDiningRecord1.getStatus())) {
+                                    statusN = "同意";
+                                }
+                                if ("3".equals(customerDiningRecord1.getStatus())) {
+                                    statusN = "拒绝";
+                                }
+                                PersonPopedom personPopedom1 = personPopedomService.findByIdIgnoreDel(customerDiningRecord1.getPersonPopedomId());
 
-								PersonInfo person = personInfoService.findByIdIgnoreDel(personPopedom1.getPersonId());
+                                PersonInfo person = personInfoService.findByIdIgnoreDel(personPopedom1.getPersonId());
 
-								String accessToken = JwtUtil2.createToken(jwtSecret, person.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
-								WechatMessageUtil.sendExamine(person.getOpenId(), "接待就餐审核" + statusN, person.getName(), "1", statusN, "接待就餐", "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + customerDiningRecord1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
-							}).start();
-						}
-					}
+                                String accessToken = JwtUtil2.createToken(jwtSecret, person.getId() + "", DateTime.now().plusHours(30 * 24).toDate());
+                                WechatMessageUtil.sendExamine(person.getOpenId(), "接待就餐审核" + statusN, person.getName(), "1", statusN, "接待就餐", "前往查看", wxConfig.getPortalUrl() + "xsy/approval/info?id=" + customerDiningRecord1.getId() + "&formId=" + processSet.getFormId() + "&token=" + accessToken, wxConfig.getAppId(), wxConfig.getAppSecret());
+                            }).start();
+                        }
+                    }
 
 
                     //年假
                     if ("11".equals(procinst.getType())) {
                         YearRequestForLeaveInfo yearRequestForLeaveInfo1 = yearRequestForLeaveInfoService.get(procinst.getBusinessKey());
 
-                        if (!"0".equals(yearRequestForLeaveInfo1.getStatus())) {
+                        if (yearRequestForLeaveInfo1.getStatus() != 0) {
                             new Thread(() -> {
                                 String statusN = "";
-                                if ("1".equals(yearRequestForLeaveInfo1.getStatus())) {
+                                if (yearRequestForLeaveInfo1.getStatus() == 1) {
                                     statusN = "同意";
 
                                     try {
-                                        //出差修改人员状态
+                                        //年假修改人员状态
                                         yearRequestForLeaveInfoService.logic(yearRequestForLeaveInfo1);
                                     } catch (Exception ex) {
                                         ex.printStackTrace();
                                     }
                                 }
-                                if ("3".equals(yearRequestForLeaveInfo1.getStatus())) {
+                                if (yearRequestForLeaveInfo1.getStatus() == 3) {
                                     statusN = "拒绝";
                                 }
 
@@ -1361,8 +1352,8 @@ public class ProcinstActUserServiceImpl implements ProcinstActUserService {
                 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.getDelFlag() == null || workScheduleAttendance.getDelFlag()) {
+                        workScheduleAttendance = workScheduleAttendanceService.findByScheduleAttendanceId(workScheduleAttendance.getPersonScheduleId(), workScheduleAttendance.getWorkShiftId(), workScheduleAttendance.getClassify());
 
                         if (workScheduleAttendance != null) {
                             supplementWorkPerson.setScheduleAttendanceId(workScheduleAttendance.getId());

+ 6 - 0
common/src/main/resources/mapper/business/WorkScheduleAttendance.xml

@@ -285,6 +285,9 @@
         <if test="searchParams.noWorkStatus != null">
             AND work_status != #{searchParams.noWorkStatus}
         </if>
+        <if test="searchParams.noWorkStatus7 != null">
+            AND work_status != #{searchParams.noWorkStatus7}
+        </if>
     </select>
 
     <select id="findByPersonIdShiftIdAttendanceDateClassifyResult" resultMap="WorkScheduleAttendanceMap">
@@ -474,6 +477,9 @@
         <if test="searchParams.noWorkStatus4 != null">
             AND a.work_status != #{searchParams.noWorkStatus4}
         </if>
+        <if test="searchParams.noWorkStatus7 != null">
+            AND a.work_status != #{searchParams.noWorkStatus7}
+        </if>
         <if test="searchParams.workStatus != null">
             AND a.work_status = #{searchParams.workStatus}
         </if>

+ 37 - 0
common/src/main/resources/mapper/business/YearRequestForLeaveInfo.xml

@@ -164,6 +164,25 @@
 	<select id="list" resultMap="YearRequestForLeaveInfoMap">
 		select * from business_year_request_for_leave_info
 	</select>
+	<select id="findByPersonIdAndDate" resultMap="YearRequestForLeaveInfoMap">
+		<!--考勤时间需要大于出差开始时间,避免从12点请到24点时,把上午的下班卡算进去-->
+		<![CDATA[
+            SELECT a.* FROM
+            business_year_request_for_leave_info a
+            LEFT JOIN base_person_popedom b ON a.person_popedom_id = b.id_ AND b.del_flag = 0
+            where
+            b.person_id=#{personId}
+            and
+            a.start_time<#{attendanceDate}
+            and
+            (a.end_time is null or a.end_time>=#{attendanceDate})
+            and
+            a.status_= 1
+            and
+            a.del_flag=0
+            order by a.create_time desc limit 1
+        ]]>
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="YearRequestForLeaveInfoMap">
 		<![CDATA[
 			select a.*,
@@ -308,4 +327,22 @@
 			${sort.name} ${sort.order}
 		</foreach>
 	</select>
+    <select id="findByPersonIdAndSEDate" resultMap="YearRequestForLeaveInfoMap">
+        <![CDATA[
+            SELECT a.* FROM
+            business_year_request_for_leave_info a
+            LEFT JOIN base_person_popedom b ON a.person_popedom_id = b.id_ AND b.del_flag = 0
+            where
+            b.person_id=#{personId}
+            and
+            a.start_time<=#{endDate}
+            and
+            a.end_time>=#{startDate}
+            and
+            a.status_=1
+            and
+            a.del_flag=0
+            order by a.create_time desc
+        ]]>
+    </select>
 </mapper>

+ 38 - 10
web/src/main/java/com/jpsoft/shinestar/modules/business/controller/WorkScheduleAttendanceController.java

@@ -11,11 +11,8 @@ import com.jpsoft.shinestar.modules.business.dto.PersonInfoMonthWSADTO;
 import com.jpsoft.shinestar.modules.business.entity.SupplementWork;
 import com.jpsoft.shinestar.modules.business.entity.SupplementWorkPerson;
 import com.jpsoft.shinestar.modules.business.entity.WorkScheduleAttendance;
-import com.jpsoft.shinestar.modules.business.service.RequestForLeaveInfoService;
-import com.jpsoft.shinestar.modules.business.service.SupplementWorkPersonService;
-import com.jpsoft.shinestar.modules.business.service.SupplementWorkService;
+import com.jpsoft.shinestar.modules.business.service.*;
 import com.jpsoft.shinestar.modules.common.dto.MessageResult;
-import com.jpsoft.shinestar.modules.business.service.WorkScheduleAttendanceService;
 import com.jpsoft.shinestar.modules.common.utils.OSSUtil;
 import com.jpsoft.shinestar.modules.sys.service.DataDictionaryService;
 import io.swagger.annotations.Api;
@@ -83,6 +80,9 @@ public class WorkScheduleAttendanceController {
     @Autowired
     private SupplementWorkPersonService supplementWorkPersonService;
 
+    @Autowired
+    private YearRequestForLeaveInfoService yearRequestForLeaveInfoService;
+
     @Autowired
     private OSSConfig ossConfig;
 
@@ -386,6 +386,10 @@ public class WorkScheduleAttendanceController {
                 //BigDecimal businessTripNum = workScheduleAttendanceService.findBusinessTripNum(pi.getId(),startDate,endDate,searchParams11);
                 wsaDTO.setBusinessTripNum(businessTripNum);
 
+                //请年假天数yearLeaveNum
+                BigDecimal yearLeaveNum = yearRequestForLeaveInfoService.sumDaysByPersonIdAndTimeRange(pi.getId(), startDate, endDate);
+                wsaDTO.setYearLeaveNum(yearLeaveNum);
+
                 //先查总班次 确认正常上班和休息
 //                List<WorkPersonScheduling> startWorkPersonScheduling
 //                        = workPersonSchedulingService.findByPersonIdSDateAndEDate(pi.getId(),startDate,endDate,false);
@@ -399,6 +403,9 @@ public class WorkScheduleAttendanceController {
                 //加上出差天数
                 BigDecimal days = totalAttendanceDays.add(businessTripNum);
 
+                //加上年假天数
+                days = days.add(yearLeaveNum);
+
                 wsaDTO.setTotalAttendanceDays(days);
                 //迟到分钟lateMinutes
                 Map<String, Object> searchParams3 = new HashMap<>();
@@ -445,6 +452,7 @@ public class WorkScheduleAttendanceController {
                 Map<String, Object> searchParams9 = new HashMap<>();
                 searchParams9.put("result", "0");
                 searchParams9.put("noWorkStatus", "3");//出差未打卡不算
+                searchParams9.put("noWorkStatus7", "7");//年假未打卡不算
                 int notSwipingNum = workScheduleAttendanceService.findCountByParams(pi.getId(), startDate, endDate, searchParams9);
                 wsaDTO.setNotSwipingNum(notSwipingNum);
                 //签到次数signNum
@@ -980,7 +988,12 @@ public class WorkScheduleAttendanceController {
                                     } else if ("4".equals(wsa.getWorkStatus())) {
                                         //请假
                                         onWorkResult = "13";
-                                    } else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
+                                    }
+                                    else if ("7".equals(wsa.getWorkStatus())) {
+                                        //年假
+                                        onWorkResult = "14";
+                                    }
+                                    else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
                                         onWorkResult = "";
                                     } else {
                                         onWorkResult = wsa.getResult();
@@ -992,7 +1005,7 @@ public class WorkScheduleAttendanceController {
                                         onLateLeaveMinuteN = formatTime(wsa.getLateLeaveMinute().intValue());
                                     }
                                     onLateLeaveMinute = onLateLeaveMinute;
-                                    if ("0".equals(wsa.getResult()) && !"3".equals(wsa.getWorkStatus())) {
+                                    if ("0".equals(wsa.getResult()) && !"3".equals(wsa.getWorkStatus())&& !"7".equals(wsa.getWorkStatus())) {
                                         notSwipingNum++;
                                     }
                                 } else if ("2".equals(wsa.getClassify())) {
@@ -1019,7 +1032,12 @@ public class WorkScheduleAttendanceController {
                                     } else if ("4".equals(wsa.getWorkStatus())) {
                                         //请假
                                         offWorkResult = "13";
-                                    } else if (StringUtils.isNotEmpty(wsa.getWorkOverPersonId())) {
+                                    }
+                                    else if ("7".equals(wsa.getWorkStatus())) {
+                                        //请假
+                                        offWorkResult = "14";
+                                    }
+                                    else if (StringUtils.isNotEmpty(wsa.getWorkOverPersonId())) {
                                         //为加班 只有下班存在 加班字段不为空代表加班
                                         offWorkResult = "12";
                                     } else {
@@ -1032,7 +1050,7 @@ public class WorkScheduleAttendanceController {
                                         offLateLeaveMinuteN = formatTime(wsa.getLateLeaveMinute().intValue());
                                     }
                                     offLateLeaveMinute = offLateLeaveMinute;
-                                    if ("0".equals(wsa.getResult()) && !"3".equals(wsa.getWorkStatus())) {
+                                    if ("0".equals(wsa.getResult()) && !"3".equals(wsa.getWorkStatus())&& !"7".equals(wsa.getWorkStatus())) {
                                         notSwipingNum++;
                                     }
                                 }
@@ -1295,7 +1313,12 @@ public class WorkScheduleAttendanceController {
                                     } else if ("4".equals(wsa.getWorkStatus())) {
                                         //请假
                                         onWorkResult = "13";
-                                    } else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
+                                    }
+                                    else if ("7".equals(wsa.getWorkStatus())) {
+                                        //请假
+                                        onWorkResult = "14";
+                                    }
+                                    else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
                                         onWorkResult = "";
                                     } else {
                                         onWorkResult = wsa.getResult();
@@ -1334,7 +1357,12 @@ public class WorkScheduleAttendanceController {
                                     } else if ("4".equals(wsa.getWorkStatus())) {
                                         //请假
                                         offWorkResult = "13";
-                                    } else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
+                                    }
+                                    else if ("7".equals(wsa.getWorkStatus())) {
+                                        //年假
+                                        offWorkResult = "14";
+                                    }
+                                    else if (StringUtils.isEmpty(wsa.getWorkStatus())) {
                                         offWorkResult = "";
                                     } else if (StringUtils.isNotEmpty(wsa.getWorkOverPersonId())) {
                                         //为加班 只有下班存在 加班字段不为空代表加班