9060 1 semana atrás
pai
commit
60a73c28a8

+ 3 - 2
GDYSL/src/com/kingdee/eas/custom/facade/EarlyWarningFacadeControllerBean.java

@@ -59,9 +59,10 @@ public class EarlyWarningFacadeControllerBean extends AbstractEarlyWarningFacade
 				String jobGradeName = rowSet.getString("jobgradename");
 				if(StringUtils.isNotBlank(jobGradeName)) {
 					jobGradeName = jobGradeName.replace("L", "");
-					int gradeLevel = Integer.parseInt(jobGradeName);
+					jobGradeName = jobGradeName.replace("-", ".");
+					Double gradeLevel = Double.parseDouble(jobGradeName);
 					//获取职等为1-10的用户ID
-					if(gradeLevel>=1 && gradeLevel<=10) {
+					if(gradeLevel>=1D && gradeLevel<=16D) {
 						userIdSet.add(rowSet.getString("fid"));
 					}
 				}

+ 71 - 17
GDYSL/src/com/kingdee/eas/custom/facade/leave/LeaveAllowanceFacadeControllerBean.java

@@ -1,5 +1,6 @@
 package com.kingdee.eas.custom.facade.leave;
 
+import com.google.common.collect.Maps;
 import com.grapecity.documents.excel.D;
 import com.kingdee.bos.dao.IObjectPK;
 import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
@@ -15,6 +16,7 @@ import com.kingdee.eas.custom.bd.param.ParamCollection;
 import com.kingdee.eas.custom.bd.param.ParamFactory;
 import com.kingdee.eas.hr.ats.*;
 import com.kingdee.eas.util.app.ContextUtil;
+import com.kingdee.shr.base.syssetting.app.osf.OSFAppUtil;
 import com.kingdee.util.DateTimeUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
@@ -147,15 +149,24 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
             }
 
             // 年假额度生成
-            generateAnnualLeave(ctx, year, personNum, currentDate);
-
+           // generateAnnualLeave(ctx, year, personNum, currentDate);
+            Map<String,String> param = Maps.newHashMap();
+            param.put("year",String.valueOf(year));
+            param.put("personNum",personNum);
+            param.put("currentDate",DateTimeUtils.formatDate(currentDate));
+            OSFAppUtil.callService(ctx,"leaveAllowanceService",param);
             // 下年年假额度生成
             if (isGenerateNextYearAnnualLeave) {
                 int nextYear = year + 1;
                 Date nextYearCurrentDay = DateTimeUtils.addYear(currentDate, 1);
-                generateAnnualLeave(ctx, nextYear, personNum, nextYearCurrentDay);
+               // generateAnnualLeave(ctx, nextYear, personNum, nextYearCurrentDay);
+                Map<String,String> nextParam = Maps.newHashMap();
+                nextParam.put("year",String.valueOf(nextYear));
+                nextParam.put("personNum",personNum);
+                nextParam.put("currentDate",DateTimeUtils.formatDate(currentDate));
+                OSFAppUtil.callService(ctx,"leaveAllowanceService",nextParam);
             }
-        } catch (ParseException e) {
+        } catch (ParseException | EASBizException e) {
             throw new BOSException(e);
         }
 
@@ -171,6 +182,27 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
      */
     private void generateAnnualLeave(Context ctx, int year, String personNum, Date currentDate) throws BOSException {
         try {
+            String updateHolidaypolicy = "/*dialect*/MERGE INTO T_HR_ATS_HolidayLimit AS hl \n" +
+                    "            USING ( \n" +
+
+                        "            select\n" +
+                        "            hl.fid,\n" +
+                        "            af.fproposerid, hpf.fid AS holiday_policy_id \n" +
+                        "            from \n" +
+                        "            T_HR_ATS_AtsHolidayFile af \n" +
+                        "            left  JOIN T_HR_ATS_HolidayPolicy hpf ON  hpf.fholidaypolicysetid = af.fholidaypolicysetid \n" +
+                        "            left JOIN T_HR_ATS_HolidayType ht ON  ht.FID = hpf.fholidaytypeid \n" +
+                        "            left join T_HR_ATS_HolidayLimit hl on af.FPROPOSERID =hl.fproposerid  \n" +
+                        "            where ht.FNUMBER = 'JQLX000001Y' and hl.fholidaypolicyid in( \n" +
+                        "            select hp.fid from T_HR_ATS_HolidayPolicy hp \n" +
+                        "            inner JOIN T_HR_ATS_HolidayType ht ON  ht.FID = hp.fholidaytypeid \n" +
+                        "            where ht.FNUMBER = 'JQLX000001Y' \n" +
+                        "            ) \n" +
+                        "            and to_char(hl.fcyclebegindate,'yyyy')='"+year+"' \n"+
+                    "            ) AS src ON hl.fid = src.fid  and to_char(hl.fcyclebegindate,'yyyy') ='"+year+"' \n" +
+                    "            WHEN MATCHED THEN \n" +
+                    "            UPDATE SET hl.fname_l3=hl.fholidaypolicyid,hl.fholidaypolicyid = src.holiday_policy_id";
+            DbUtil.execute(ctx,updateHolidaypolicy);
             Date nowDate = new Date();
             // 考勤制度和年假id对应
             Map<String, String> holidayPolicyMap = new HashMap<String, String>();
@@ -209,17 +241,17 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                     "coalesce(l.FUSEDLIMIT,0) FUSEDLIMIT,coalesce(l.FREEZELIMIT,0) FREEZELIMIT,coalesce(l.cflastcarryforward,0) cflastcarryforward," +
                     "coalesce(l.cfcarryforward,0) cfcarryforward,coalesce(l.CFEntitlementLimit,0) CFEntitlementLimit,coalesce(l.CFInitializedLimit,0) CFInitializedLimit, " +
                     "ebe.FPROBATION,ebe.FPLANFORMALDATE,hp.fid holidayPolicyId,l.fisleftconvert isleftconvert  " +
-                    " from T_BD_Person p  " +
+                    " from T_HR_ATS_AtsHolidayFile f " +
+                    " left join T_BD_Person p on f.fproposerid = p.fid " +
                     " left join T_HR_EmpOrgRelation eo on p.fid = eo.fpersonid and eo.fleffdt='2199-12-31 00:00:00' " +
                     " left join CT_MP_Fullorpart fp on fp.fid = p.cfftorptid " +
-                    " left join T_HR_ATS_AtsHolidayFile f on f.fproposerid = p.fid " +
 
                     //" left join T_HR_ATS_HolidayPolicySet hps on f.fholidaypolicysetid = hps.fid " +
                     //" left join T_HR_ATS_HolidayPolicy hp on  hp.FHOLIDAYPOLICYSETID = hps.fid " +
                     " left join T_HR_ATS_HolidayType ht on ht.FNUMBER = 'JQLX000001Y'  " +
                     " left join T_HR_ATS_HolidayPolicy hp on  ht.FID =hp.fholidaytypeid " +
-//					" and hps.fid = hp.fholidaypolicysetid " +
-                    " left join T_HR_ATS_HolidayLimit l on hp.fid = l.FHOLIDAYPOLICYID and l.FPROPOSERID = p.fid and l.FCYCLEBEGINDATE >= p.fhiredate and l.FCYCLEBEGINDATE <=  p.FLEFFDT  and l.fyear =  " + year +
+                    " and f.fholidaypolicysetid = hp.fholidaypolicysetid " +
+                    " left join T_HR_ATS_HolidayLimit l on hp.fid = l.FHOLIDAYPOLICYID and l.FPROPOSERID = p.fid and l.FCYCLEBEGINDATE >= p.fhiredate and l.FCYCLEBEGINDATE <= p.FLEFFDT  and l.fyear =  " + year +
 //					" left join T_HR_EmpEnrollBizBillEntry ebe on ebe.FPERSONID = p.fid and ebe.FBIZDATE = p.fhiredate " +
 //					" left join T_HR_EmpEnrollBizBill eb on ebe.FBILLID = eb.FID and eb.FBILLSTATE = 3 " +
 //					" left join T_HR_ResignBizBillEntry rbe on rbe.FPERSONID = p.fid and p.fhiredate = rbe.FENTERDATE " +
@@ -271,9 +303,9 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                 int joinDateYear = iRowSet.getInt("joinDateYear");
                 // 入职日期
                 Date joinDate = iRowSet.getDate("fhiredate");
-                java.sql.Date fplanformaldate = iRowSet.getDate("FPLANFORMALDATE");
+                 Date fplanformaldate = iRowSet.getDate("FPLANFORMALDATE");
                 // 离职日期
-                java.sql.Date leaveDate = iRowSet.getDate("leaveDate");
+                 Date leaveDate = iRowSet.getDate("leaveDate");
                 // 标准额度=额度规则(折算额度)+初始化额度+从去年结转-结转到明年
                 BigDecimal standardLimit = BigDecimal.ZERO;
                 // 折算标准额度
@@ -418,12 +450,19 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                 realLimit = standardLimit.add(addOrSubLimit);
                 // 剩余额度 = 实际额度-已用额度-在途额度
                 remainLimit = realLimit.subtract(usedLimit).subtract(freezeLimit);
+                BigDecimal addOrSub=BigDecimal.ZERO;
+                if(remainLimit.compareTo(BigDecimal.valueOf(30))>0){
+                    addOrSub = BigDecimal.valueOf(30).subtract(remainLimit);
 
+                }
                 if (StringUtils.isNotEmpty(limitId)) {
                     HolidayLimitInfo holidayLimitInfo = new HolidayLimitInfo();
                     holidayLimitInfo.setId(BOSUuid.read(limitId));
                     // 标准额度
                     holidayLimitInfo.setStandardLimit(standardLimit);
+                    //增减
+                    addOrSubLimit=addOrSubLimit.add(addOrSub);
+                    holidayLimitInfo.setAddOrSubLimit(addOrSubLimit);
                     // 折算标准额度
                     holidayLimitInfo.setBigDecimal("convertedLimit", convertedLimit);
                     // 未折算标准额度
@@ -433,10 +472,10 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                     holidayLimitInfo.setBigDecimal("lastCarryforward", lastCarryforward);
                     holidayLimitInfo.setBigDecimal("Carryforward", carryforward);
                     // 默认值
-                    holidayLimitInfo.setCycleBeginDate(yearFirstDay);
-                    holidayLimitInfo.setCycleEndDate(yearLastDay);
-                    holidayLimitInfo.setEffectDate(yearFirstDay);
-                    holidayLimitInfo.setDelayDate(yearLastDay);
+//                    holidayLimitInfo.setCycleBeginDate(yearFirstDay);
+//                    holidayLimitInfo.setCycleEndDate(yearLastDay);
+//                    holidayLimitInfo.setEffectDate(yearFirstDay);
+//                    holidayLimitInfo.setDelayDate(yearLastDay);
 
                     // 离职情况
                     if (leaveDate != null && DateTimeUtils.getYear(currentDate) == DateTimeUtils.getYear(leaveDate) && joinDate.compareTo(leaveDate) < 0) {
@@ -480,18 +519,21 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                     if (leaveDate != null && 1 == isleftconvert && leaveDate.getTime() <= holidayLimitInfo.getCycleEndDate().getTime()) {
                         //deleteList.add(limitId);
                         continue;
+                    }else {
+
+                        updateList.add(holidayLimitInfo);
                     }
-                    updateList.add(holidayLimitInfo);
                 } else {
                     HolidayLimitInfo holidayLimitInfo = new HolidayLimitInfo();
                     holidayLimitInfo.setStandardLimit(standardLimit);
                     holidayLimitInfo.setBigDecimal("convertedLimit", convertedLimit);
                     holidayLimitInfo.setBigDecimal("entitlementLimit", entitlementLimit);
+
                     holidayLimitInfo.setRealLimit(realLimit);
                     holidayLimitInfo.setRemainLimit(remainLimit);
                     holidayLimitInfo.setFreezeLimit(BigDecimal.ZERO);
                     holidayLimitInfo.setUsedLimit(BigDecimal.ZERO);
-                    holidayLimitInfo.setAddOrSubLimit(BigDecimal.ZERO);
+                    holidayLimitInfo.setAddOrSubLimit(addOrSub);
                     holidayLimitInfo.setPreOverdraftLimit(BigDecimal.ZERO);
                     if (DateTimeUtils.getYear(currentDate) == DateTimeUtils.getYear(joinDate)) {
                         holidayLimitInfo.setCycleBeginDate(joinDate);
@@ -517,6 +559,7 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                     if (leaveDate != null && DateTimeUtils.getYear(currentDate) == DateTimeUtils.getYear(leaveDate)) {
                         holidayLimitInfo.setCycleEndDate(leaveDate);
                         holidayLimitInfo.setDelayDate(leaveDate);
+                        holidayLimitInfo.setIsLeftConvert(true);
                     } else {
                         holidayLimitInfo.setCycleEndDate(yearLastDay);
                         holidayLimitInfo.setDelayDate(yearLastDay);
@@ -560,8 +603,10 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
                     // 如果假期额度在离职日期之后,不生成
                     if (leaveDate != null && 1 == isleftconvert && leaveDate.getTime() <= holidayLimitInfo.getCycleEndDate().getTime()) {
                         continue;
+                    }else {
+
+                        addList.add(holidayLimitInfo);
                     }
-                    addList.add(holidayLimitInfo);
                 }
             }
             if (addList.size() > 0) {
@@ -795,9 +840,18 @@ public class LeaveAllowanceFacadeControllerBean extends AbstractLeaveAllowanceFa
             if (lastYearList.size() > 0) {
                 SelectorItemCollection sc = new SelectorItemCollection();
                 sc.add(new SelectorItemInfo("Carryforward"));
+                sc.add(new SelectorItemInfo("LastCarryforward"));
                 HolidayLimitFactory.getLocalInstance(ctx).updatePartialBatchData(lastYearList, sc);
             }
             if (thisYearList.size() > 0) {
+                SelectorItemCollection sc = new SelectorItemCollection();
+                sc.add(new SelectorItemInfo("Carryforward"));
+                sc.add(new SelectorItemInfo("LastCarryforward"));
+                sc.add(new SelectorItemInfo("standardLimit"));
+                sc.add(new SelectorItemInfo("realLimit"));
+                sc.add(new SelectorItemInfo("remainLimit"));
+                sc.add(new SelectorItemInfo("lastUpdateUser"));
+                sc.add(new SelectorItemInfo("lastUpdateTime"));
                 HolidayLimitFactory.getLocalInstance(ctx).updateBatchData(thisYearList);
             }
 

+ 17 - 8
GDYSL/src/com/kingdee/eas/hr/affair/app/EmpEnrollBizBillControllerBeanEx.java

@@ -62,15 +62,24 @@ public class EmpEnrollBizBillControllerBeanEx extends EmpEnrollBizBillController
         }
     }
     
+//    @Override
+//    protected void _auditEntryEffect(Context ctx, BOSUuid billID) throws BOSException, EASBizException {
+//    	super._auditEntryEffect(ctx, billID);
+//    	String emailSql = "/*dialect*/ UPDATE T_HR_PersonContactMethod AS a SET CFPrivateemail = b.CFPEMAIL "
+//    			+ "FROM T_HR_EmpEnrollBizBillEntry AS b "
+//    			+ "JOIN t_bd_person AS c ON c.fnumber = b.FEMPNUMBER "
+//    			+ "WHERE a.FPERSONID = c.fid AND b.FBILLID = '"+billID+"'";
+//    	logger.error("更新员工联系方式私人邮箱SQL:"+emailSql);
+//    	DbUtil.execute(ctx, emailSql);
+//    }
     @Override
     protected void _auditEntryEffect(Context ctx, BOSUuid billID) throws BOSException, EASBizException {
-    	super._auditEntryEffect(ctx, billID);
-    	String emailSql = "/*dialect*/ UPDATE T_HR_PersonContactMethod AS a SET CFPrivateemail = b.CFPEMAIL "
-    			+ "FROM T_HR_EmpEnrollBizBillEntry AS b "
-    			+ "JOIN t_bd_person AS c ON c.fnumber = b.FEMPNUMBER "
-    			+ "WHERE a.FPERSONID = c.fid AND b.FBILLID = '"+billID+"'";
-    	logger.error("更新员工联系方式私人邮箱SQL:"+emailSql);
-    	DbUtil.execute(ctx, emailSql);
+        super._auditEntryEffect(ctx, billID);
+        String emailSql = "/*dialect*/ UPDATE T_HR_PersonContactMethod AS a SET CFPrivateemail = b.CFPEMAIL FROM T_HR_EmpEnrollBizBillEntry AS b JOIN t_bd_person AS c ON c.fnumber = b.FEMPNUMBER WHERE a.FPERSONID = c.fid AND b.FBILLID = '" + billID + "'";
+        logger.error("更新员工联系方式私人邮箱SQL:" + emailSql);
+        DbUtil.execute(ctx, emailSql);
+        String gtiitEmailSql = "/*dialect*/ UPDATE T_BD_Person as a set CFGtiitemail = b.CFGTIITEMAIL from T_HR_EmpEnrollBizBillEntry as b where a.fnumber=b.FEMPNUMBER and b.FBILLID = '" + billID + "'";
+        logger.error("更新员工信息是否有广以邮箱SQL:" + gtiitEmailSql);
+        DbUtil.execute(ctx, gtiitEmailSql);
     }
-    
 }

+ 82 - 15
GDYSL/websrc/com/kingdee/shr/customer/gtiit/handler/AtsOverTimeBillBatchEditHandlerEx.java

@@ -1,5 +1,6 @@
 package com.kingdee.shr.customer.gtiit.handler;
 
+import java.math.BigDecimal;
 import java.sql.SQLException;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
@@ -16,6 +17,7 @@ import java.util.Set;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.kingdee.eas.hr.ats.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
 import org.springframework.ui.ModelMap;
@@ -24,10 +26,6 @@ import org.springframework.util.LinkedMultiValueMap;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.eas.framework.CoreBaseInfo;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillEntryCollection;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillEntryInfo;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillInfo;
-import com.kingdee.eas.hr.ats.AttendFileStateEnum;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.shr.ats.web.handler.AtsOverTimeBillBatchEditHandler;
@@ -45,10 +43,12 @@ import com.kingdee.shr.customer.gtiit.util.DateTimeUtils;
  */
 public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditHandler{
 
-	
-	private static Logger logger =
-	        Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.AtsOverTimeBillBatchEditHandlerEx");
-	
+
+
+
+
+	private static Logger logger = Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.AtsOverTimeBillBatchEditHandlerEx");
+
 	public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
 		Context ctx = SHRContext.getInstance().getContext();
 		String otDate = request.getParameter("otDate");
@@ -109,12 +109,78 @@ public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditH
 	
 	@Override
 	protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
-			throws SHRWebException {
+			throws SHRWebException
+	{
+
 		super.beforeSubmit(request, response, model);
 		checkOverTime(model);
 		checkCompensate(model);
+		countSumTime(model);
 	}
-	
+
+	public void submitEffectAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+			throws SHRWebException, BOSException
+	{
+		CoreBaseInfo model = (CoreBaseInfo)request.getAttribute("dynamic_model");
+		countSumTime(model);
+		super.submitEffectAction(request, response, modelMap);
+	}
+
+
+
+
+	private void countSumTime(CoreBaseInfo model)
+			throws ShrWebBizException
+	{
+		logger.error("进入多人加班单提交重算时间方法");
+		AtsOverTimeBillInfo billInfo = (AtsOverTimeBillInfo)model;
+		AtsOverTimeBillEntryCollection entries = billInfo.getEntries();
+		BigDecimal weekdayHour = BigDecimal.ZERO;
+		BigDecimal restdayHour = BigDecimal.ZERO;
+		BigDecimal holidayHour = BigDecimal.ZERO;
+		BigDecimal totalDuration = BigDecimal.ZERO;
+		BigDecimal compensatoryTotal = BigDecimal.ZERO;
+		BigDecimal totalOvertimePay = BigDecimal.ZERO;
+		for (int i = 0; i < entries.size(); i++) {
+			AtsOverTimeBillEntryInfo entryInfo = entries.get(i);
+			String otTypeId = "";
+			String otCompensId = "";
+
+			OverTimeTypeInfo otType = entryInfo.getOtType();
+
+			BigDecimal applyOtTime = entryInfo.getApplyOTTime() == null ? BigDecimal.ZERO : entryInfo.getApplyOTTime();
+
+			OverTimeCompensInfo otCompens = entryInfo.getOtCompens();
+			if (otType != null) {
+				otTypeId = otType.getId().toString();
+			}
+			if (otCompens != null) {
+				otCompensId = otCompens.getId().toString();
+			}
+			if (StringUtils.equals(otTypeId, "rBy0u1YgQ9C1OxcM85mxyY6C/nU="))
+				weekdayHour = weekdayHour.add(applyOtTime);
+			else if (StringUtils.equals(otTypeId, "zr+ur5D4RA+2bdVZ2VPqp46C/nU="))
+				restdayHour = restdayHour.add(applyOtTime);
+			else if (StringUtils.equals(otTypeId, "sRWUOt7sRpOY0TCo6NMqGY6C/nU=")) {
+				holidayHour = holidayHour.add(applyOtTime);
+			}
+
+			if (StringUtils.equals(otCompensId, "AERg0TIcSnaM40EKvJCdRKlrTmA="))
+				compensatoryTotal = compensatoryTotal.add(applyOtTime);
+			else if (StringUtils.equals(otCompensId, "zkbt5bMLQ3ehUivmKbtBOqlrTmA=")) {
+				totalOvertimePay = totalOvertimePay.add(applyOtTime);
+			}
+		}
+		totalDuration = weekdayHour.add(restdayHour).add(holidayHour);
+
+		billInfo.put("weekdayHour", weekdayHour);
+		billInfo.put("restdayHour", restdayHour);
+		billInfo.put("holidayHour", holidayHour);
+		billInfo.put("totalDuration", totalDuration);
+		billInfo.put("compensatoryTotal", compensatoryTotal);
+		billInfo.put("totalOvertimePay", totalOvertimePay);
+	}
+
 	private void checkCompensate(CoreBaseInfo model) throws ShrWebBizException {
 		Context ctx = SHRContext.getInstance().getContext();
 		AtsOverTimeBillInfo billInfo = (AtsOverTimeBillInfo) model;
@@ -161,9 +227,10 @@ public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditH
 					String jobGradeName = rowSet.getString("jobgradename");
 					if(StringUtils.isNotBlank(jobGradeName)) {
 						jobGradeName = jobGradeName.replace("L", "");
-						int gradeLevel = Integer.parseInt(jobGradeName);
-						if(gradeLevel>=8) {
-							throw new ShrWebBizException("Employee ("+personIdByNameMap.get(rowSet.getString("fid"))+") with a rank greater than or equal to L8 is not allowed to submit overtime compensation forms with overtime pay as the compensation type");
+						jobGradeName = jobGradeName.replace("-", ".");
+						Double gradeLevel = Double.parseDouble(jobGradeName);
+						if (gradeLevel >= 13D) {
+							throw new ShrWebBizException("Employee ("+personIdByNameMap.get(rowSet.getString("fid"))+") with a rank greater than or equal to L13 is not allowed to submit overtime compensation forms with overtime pay as the compensation type");
 						}
 					}
 				}
@@ -189,7 +256,6 @@ public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditH
 		}
 		
 	}
-	
 	private void checkOverTime(CoreBaseInfo model) throws ShrWebBizException {
 		Context ctx = SHRContext.getInstance().getContext();
 		AtsOverTimeBillInfo billInfo = (AtsOverTimeBillInfo) model;
@@ -258,5 +324,6 @@ public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditH
 			}
 		}
 	}
-	
+
+
 }

+ 89 - 35
GDYSL/websrc/com/kingdee/shr/customer/gtiit/handler/PerAtsOverTimeBillBatchEditHandlerEx.java

@@ -1,37 +1,9 @@
 package com.kingdee.shr.customer.gtiit.handler;
 
-import java.sql.SQLException;
-import java.time.Instant;
-import java.time.LocalTime;
-import java.time.ZoneId;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.LinkedMultiValueMap;
-
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
-import com.kingdee.bos.dao.IObjectValue;
-import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
-import com.kingdee.eas.common.EASBizException;
-import com.kingdee.eas.framework.CoreBaseCollection;
 import com.kingdee.eas.framework.CoreBaseInfo;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillEntryCollection;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillEntryFactory;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillEntryInfo;
-import com.kingdee.eas.hr.ats.AtsOverTimeBillInfo;
-import com.kingdee.eas.hr.ats.AttendFileStateEnum;
+import com.kingdee.eas.hr.ats.*;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.shr.ats.web.handler.PerAtsOverTimeBillBatchEditHandler;
@@ -41,13 +13,36 @@ import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
 import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
 import com.kingdee.shr.customer.gtiit.util.BaseUtil;
 import com.kingdee.shr.customer.gtiit.util.DateTimeUtils;
-import com.kingdee.util.LocaleUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.LinkedMultiValueMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.sql.SQLException;
+import java.time.Instant;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.*;
+
+
+
+
+
+
+
+
+
+
+
+
 
 public class PerAtsOverTimeBillBatchEditHandlerEx extends PerAtsOverTimeBillBatchEditHandler {
 
 	private static Logger logger = Logger
 			.getLogger("com.kingdee.shr.customer.gtiit.handler.PerAtsOverTimeBillBatchEditHandlerEx");
-
 	public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
 			throws SHRWebException {
 		Context ctx = SHRContext.getInstance().getContext();
@@ -116,6 +111,64 @@ public class PerAtsOverTimeBillBatchEditHandlerEx extends PerAtsOverTimeBillBatc
 		checkOverSubmitDate();
 		checkOverTime(model);
 		checkCompensate(model);
+		countSumTime(model);
+	}
+
+
+
+
+
+
+	private void countSumTime(CoreBaseInfo model)
+			throws ShrWebBizException
+	{
+		logger.error("进入多人加班单提交重算时间方法");
+		AtsOverTimeBillInfo billInfo = (AtsOverTimeBillInfo)model;
+		AtsOverTimeBillEntryCollection entries = billInfo.getEntries();
+		BigDecimal weekdayHour = BigDecimal.ZERO;
+		BigDecimal restdayHour = BigDecimal.ZERO;
+		BigDecimal holidayHour = BigDecimal.ZERO;
+		BigDecimal totalDuration = BigDecimal.ZERO;
+		BigDecimal compensatoryTotal = BigDecimal.ZERO;
+		BigDecimal totalOvertimePay = BigDecimal.ZERO;
+		for (int i = 0; i < entries.size(); i++) {
+			AtsOverTimeBillEntryInfo entryInfo = entries.get(i);
+			String otTypeId = "";
+			String otCompensId = "";
+
+			OverTimeTypeInfo otType = entryInfo.getOtType();
+
+			BigDecimal applyOtTime = entryInfo.getApplyOTTime() == null ? BigDecimal.ZERO : entryInfo.getApplyOTTime();
+
+			OverTimeCompensInfo otCompens = entryInfo.getOtCompens();
+			if (otType != null) {
+				otTypeId = otType.getId().toString();
+			}
+			if (otCompens != null) {
+				otCompensId = otCompens.getId().toString();
+			}
+			if (StringUtils.equals(otTypeId, "rBy0u1YgQ9C1OxcM85mxyY6C/nU="))
+				weekdayHour = weekdayHour.add(applyOtTime);
+			else if (StringUtils.equals(otTypeId, "zr+ur5D4RA+2bdVZ2VPqp46C/nU="))
+				restdayHour = restdayHour.add(applyOtTime);
+			else if (StringUtils.equals(otTypeId, "sRWUOt7sRpOY0TCo6NMqGY6C/nU=")) {
+				holidayHour = holidayHour.add(applyOtTime);
+			}
+
+			if (StringUtils.equals(otCompensId, "AERg0TIcSnaM40EKvJCdRKlrTmA="))
+				compensatoryTotal = compensatoryTotal.add(applyOtTime);
+			else if (StringUtils.equals(otCompensId, "zkbt5bMLQ3ehUivmKbtBOqlrTmA=")) {
+				totalOvertimePay = totalOvertimePay.add(applyOtTime);
+			}
+		}
+		totalDuration = weekdayHour.add(restdayHour).add(holidayHour);
+
+		billInfo.put("weekdayHour", weekdayHour);
+		billInfo.put("restdayHour", restdayHour);
+		billInfo.put("holidayHour", holidayHour);
+		billInfo.put("totalDuration", totalDuration);
+		billInfo.put("compensatoryTotal", compensatoryTotal);
+		billInfo.put("totalOvertimePay", totalOvertimePay);
 	}
 
 	/**
@@ -194,10 +247,11 @@ public class PerAtsOverTimeBillBatchEditHandlerEx extends PerAtsOverTimeBillBatc
 					String jobGradeName = rowSet.getString("jobgradename");
 					if (StringUtils.isNotBlank(jobGradeName)) {
 						jobGradeName = jobGradeName.replace("L", "");
-						int gradeLevel = Integer.parseInt(jobGradeName);
-						if (gradeLevel >= 8) {
+						jobGradeName = jobGradeName.replace("-", ".");
+						Double gradeLevel = Double.parseDouble(jobGradeName);
+						if (gradeLevel >= 13D) {
 							throw new ShrWebBizException("Employee (" + personIdByNameMap.get(rowSet.getString("fid"))
-									+ ") with a rank greater than or equal to L8 is not allowed to submit overtime compensation forms with overtime pay as the compensation type");
+									+ ") with a rank greater than or equal to L13 is not allowed to submit overtime compensation forms with overtime pay as the compensation type");
 						}
 					}
 				}
@@ -226,7 +280,6 @@ public class PerAtsOverTimeBillBatchEditHandlerEx extends PerAtsOverTimeBillBatc
 		}
 
 	}
-
 	private void checkOverTime(CoreBaseInfo model) throws ShrWebBizException {
 		Context ctx = SHRContext.getInstance().getContext();
 		AtsOverTimeBillInfo billInfo = (AtsOverTimeBillInfo) model;
@@ -303,4 +356,5 @@ public class PerAtsOverTimeBillBatchEditHandlerEx extends PerAtsOverTimeBillBatc
 		}
 	}
 
+
 }

+ 3 - 2
GDYSL/websrc/com/kingdee/shr/customer/gtiit/handler/PerAtsOverTimeBillBatchEditHandlerTestEx.java

@@ -159,8 +159,9 @@ public class PerAtsOverTimeBillBatchEditHandlerTestEx extends PerAtsOverTimeBill
 					String jobGradeName = rowSet.getString("jobgradename");
 					if (StringUtils.isNotBlank(jobGradeName)) {
 						jobGradeName = jobGradeName.replace("L", "");
-						int gradeLevel = Integer.parseInt(jobGradeName);
-						if (gradeLevel >= 8) {
+						jobGradeName = jobGradeName.replace("-", ".");
+						Double gradeLevel = Double.parseDouble(jobGradeName);
+						if (gradeLevel >= 13) {
 							throw new ShrWebBizException("Employee (" + personIdByNameMap.get(rowSet.getString("fid"))
 									+ ") with a rank greater than or equal to L8 is not allowed to submit overtime compensation forms with overtime pay as the compensation type");
 						}