Jelajahi Sumber

测试更正

yuanzhi_kuang 1 hari lalu
induk
melakukan
2ac1b8cd2a

+ 2 - 3
src/com/kingdee/eas/custom/calcdailypay/task/AutoSubDayDetailFacadeControllerBean.java

@@ -89,7 +89,7 @@ public class AutoSubDayDetailFacadeControllerBean extends AbstractAutoSubDayDeta
         filter.getFilterItems().add(new FilterItemInfo("applyDate",  formattedDate , CompareType.LESS_EQUALS));
         filter.getFilterItems().add(new FilterItemInfo("applyDate",  formattedDate , CompareType.GREATER_EQUALS  ));
         EntityViewInfo viewInfo = new EntityViewInfo();
-       
+        viewInfo.setFilter(filter);
         try {
         	BatchSubmitShemeBillCollection batchSubmitShemeBillCollection = billIns.getBatchSubmitShemeBillCollection(viewInfo);
         	if (!batchSubmitShemeBillCollection.isEmpty()) {
@@ -109,9 +109,7 @@ public class AutoSubDayDetailFacadeControllerBean extends AbstractAutoSubDayDeta
     ////////////DefaultSubmitShemeBillListHandler_beforeSubmit////////////
     protected void beforeSubmit( Context ctx,CoreBaseInfo model)
     		throws SHRWebException {
-    	model.setInt("billState", 1);
     	BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
-    	
     	this.reAssembleModel(ctx, info);
     	this.verifyIsBillEntryEmpty(ctx, info);
     	
@@ -119,6 +117,7 @@ public class AutoSubDayDetailFacadeControllerBean extends AbstractAutoSubDayDeta
     		ISubmitBillVerifyInterface verifyInstance = this.getVerifyInstance(ctx, info);
     		verifyInstance.verify(ctx, info, this.getVerifyParams());
     		BudgetUtil.verifyBudget(ctx, info);
+    		model.setInt("billState", 1);
     	} catch (BOSException var8) {
     		throw new SHRWebException(var8.getMessage(), var8);
     	} catch (EASBizException var9) {

+ 2 - 2
src/com/kingdee/shr/compensation/app/utils/SubConstants.java

@@ -11,8 +11,8 @@ public class SubConstants {
     public static final String ONSITE = "MQ007";
     // 班组任职 Team app  --shr 是否片长
     public static final String TEAMAPP = "MQ012";
-    // 工资序列 Salary seq
-    public static final String SALARYSEQ = "MQ012";
+    // 工资序列 Salary seq  MQ运维工资序列
+    public static final String SALARYSEQ = "MQ015";
     //MES的id
     public static String MESID = "MESID";
     

+ 54 - 28
src/com/kingdee/shr/compensation/app/utils/SubmitShemeUtils.java

@@ -39,25 +39,25 @@ import org.apache.commons.lang3.StringUtils;
 
 public class SubmitShemeUtils {
 
-    private static String COMRATE = "MQ005";
-    //岗位类型
-    private static String JOBTYPE = "MQ004";
-    //技能等级 SKILLLEVEL
-    private static String SKILLLEVEL = "MQ003";
-    //是否现场作业 On site
-    private static String ONSITE = "MQ007";
-    //班组任职 Team app
-    private static String TEAMAPP = "MQ007";
-    //工资序列 Salary seq
-    private static String SALARYSEQ = "MQ007";
-    
-    private static String MESID = "MESID";
-    private static String[] ITEMNUMS = {SubConstants.COMRATE,SubConstants.JOBTYPE,SubConstants.SKILLLEVEL,SubConstants.ONSITE,SubConstants.TEAMAPP,SubConstants.SALARYSEQ};
+//    private static String COMRATE = "MQ005";
+//    //岗位类型
+//    private static String JOBTYPE = "MQ004";
+//    //技能等级 SKILLLEVEL
+//    private static String SKILLLEVEL = "MQ003";
+//    //是否现场作业 On site
+//    private static String ONSITE = "MQ007";
+//    //班组任职 Team app
+//    private static String TEAMAPP = "MQ007";
+//    //工资序列 Salary seq
+//    private static String SALARYSEQ = "MQ007";
+//    
+//    private static String MESID = "MESID";
+//    private static String[] ITEMNUMS = {SubConstants.COMRATE,SubConstants.JOBTYPE,SubConstants.SKILLLEVEL,SubConstants.ONSITE,SubConstants.TEAMAPP,SubConstants.SALARYSEQ};
     
     private static  SimpleDateFormat  SDF = new SimpleDateFormat("yyyy-MM-dd");
     
     private static Map<String,String> FEILDS = new HashMap();
-
+	private static  HashMap<String,String> JOBTYPEMAP =  new HashMap();
   
 
 
@@ -66,10 +66,13 @@ public class SubmitShemeUtils {
 	 */
 	public static HashMap<String,HashMap>  getMesData( Context ctx ,HashSet<String> selectPerson,DateRange dateRange) {
 		if(ObjectUtils.isEmpty(FEILDS)) {
-			SubmitShemeUtils.getFeilds(ctx);
+			getFeilds(ctx);
 		}
-		HashMap<String,HashMap> checkMap =  new HashMap();
-	
+		//获取技能等级
+		if(ObjectUtils.isEmpty(JOBTYPEMAP)) {
+			getJobType(ctx);
+		}
+		HashMap<String, HashMap> checkMap = new HashMap();
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 		try {
 			String sql = " select fid ,CFComrate, cfpersonId, cfpositiontype , cfskillLevel , cfonSite , cfteamApp , cfsalarysEq ,"
@@ -94,14 +97,19 @@ public class SubmitShemeUtils {
 				String key = pId+"_"+eDate;
 				HashMap<String,String> valMap = new HashMap();
 				BigDecimal comrate = rst.getBigDecimal("CFComrate");
-				valMap.put(FEILDS.get(COMRATE), comrate.toString());
-				//
-				valMap.put(FEILDS.get(JOBTYPE), rst.getString("cfpositiontype"));
-				valMap.put(FEILDS.get(SKILLLEVEL), rst.getString("cfskillLevel"));
-				valMap.put(FEILDS.get(ONSITE), rst.getString("cfonSite"));
-				valMap.put(FEILDS.get(TEAMAPP), rst.getString("cfteamApp"));
-				valMap.put(FEILDS.get(SALARYSEQ), rst.getString("cfsalarysEq"));
-				valMap.put(MESID, rst.getString("fid"));
+				valMap.put(FEILDS.get(SubConstants.COMRATE), comrate.toString());
+				String posiType = rst.getString("cfpositiontype");
+				//如果岗位类型包含在JOBTYPEMAP中,则取出对应的fid,否则设置空
+				String cFpositiontype = JOBTYPEMAP.get(posiType);
+				if(ObjectUtils.isEmpty(cFpositiontype)){
+					cFpositiontype = "";
+				}
+				valMap.put(FEILDS.get(SubConstants.JOBTYPE), cFpositiontype);
+				valMap.put(FEILDS.get(SubConstants.SKILLLEVEL), rst.getString("cfskillLevel"));
+				valMap.put(FEILDS.get(SubConstants.ONSITE), rst.getString("cfonSite"));
+				valMap.put(FEILDS.get(SubConstants.TEAMAPP), rst.getString("cfteamApp"));
+				valMap.put(FEILDS.get(SubConstants.SALARYSEQ), rst.getString("cfsalarysEq"));
+				valMap.put(SubConstants.MESID, rst.getString("fid"));
 				checkMap.put(key, valMap);
 			}
 
@@ -116,12 +124,30 @@ public class SubmitShemeUtils {
 	}
 
 
+	//获取岗位类型
+	private static void getJobType(Context ctx) {
+		String  jobTypeSql = " select  fname_l2 ,fid  from CT_MP_Yunweigwlx " ;
+		//查询sql并放入map
+		try {
+			IRowSet rst =  DbUtil.executeQuery(ctx, jobTypeSql);
+			while( rst.next() ) {
+				String  fname_l2 = rst.getString("fname_l2");
+				String  fid = rst.getString("fid");
+				JOBTYPEMAP.put(fname_l2 , fid );
+			}
+		}catch(BOSException e){
+			e.printStackTrace();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+	}
+
 
 	public  static Map<String,String>  getFeilds(Context ctx) {
 		CalSubmitItemCollection subColl = null;
 		try {
 			subColl = CalSubmitItemFactory.getLocalInstance(ctx)
-			        .getCalSubmitItemCollection("SELECT ID,FieldSn,number  where  number in (" + ToolUtils.aryToStr(ITEMNUMS) + ")");
+			        .getCalSubmitItemCollection("SELECT ID,FieldSn,number  where  number in (" + ToolUtils.aryToStr(SubConstants.ITEMNUMS) + ")");
 		} catch (BOSException e1) {
 			e1.printStackTrace();
 		}
@@ -173,7 +199,7 @@ public class SubmitShemeUtils {
 			}
 
 			if (isRowAssigned) {
-				checkbillIds.add(valMap.get(MESID).toString());
+				checkbillIds.add(valMap.get(SubConstants.MESID).toString());
 				assignedRows++; // 只有实际赋值的行才计数
 			}
 		}

+ 14 - 11
src/com/kingdee/shr/compensation/service/CalSubmitCusFunctionService.java

@@ -23,6 +23,11 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * ¼ÆËãÈÕ¿¼ÇÚº¯Êý;
+ * @author coyle
+ * 202505
+ */
 public class CalSubmitCusFunctionService extends SalaryCalFunction2 {
 	private static final Logger logger = LoggerFactory.getLogger(CalSubmitCusFunctionService.class);
 	private final SimpleDateFormat sdf_yyyy_MM_dd = new SimpleDateFormat("yyyy-MM-dd");
@@ -32,18 +37,18 @@ public class CalSubmitCusFunctionService extends SalaryCalFunction2 {
 	 
 
 	public double getAtsDataWithSubOrg(Context ctx, Map<String, Object> paramMap, HashMap<String, Object> tempMap,
-			String mainTableName, String mainTableRowFilter, String project, double isVac, String company,
-			double needSubOrg, double relativePeriod) {
+			String mainTableName, String mainTableRowFilter, String project, String company,
+			double needSubOrg) {
 		boolean haveSubOrg = 1.0D == needSubOrg;
-		boolean vacProject = 1.0D == isVac;
-		String key = "AtsResult:" + project + "-" + company + "-" + needSubOrg + "-" + isVac + "-" + relativePeriod;
+
+		String key = "AtsResult:" + project + "-" + company + "-" + needSubOrg;
 		Map<String, List<Object>> mapData = null;
 		List<Object> listData = null;
 		Map dateMap;
 		
 		if (tempMap.get(key) == null) {
 			Map<String, Map<String, String>> dataMap = this.getSubDataGroupByEffectDate(ctx, mainTableName,
-					mainTableRowFilter, relativePeriod);
+					mainTableRowFilter);
 			if (dataMap.isEmpty() || ((Map) dataMap.get("sqlMap")).isEmpty()) {
 				return 0.0D;
 			}
@@ -71,11 +76,9 @@ public class CalSubmitCusFunctionService extends SalaryCalFunction2 {
 				param.put("haveSubOrg", haveSubOrg);
 				param.put("attendProject", project);
 				List tempListData;
-				if (!vacProject) {
-					tempListData = (List) OSFExecutor.executeOSF(ctx, param, "getAttendSumByHrOrg");
-				} else {
-					tempListData = (List) OSFExecutor.executeOSF(ctx, param, "getDayAttendData");
-				}
+
+				tempListData = (List) OSFExecutor.executeOSF(ctx, param, "getDayAttendData");
+
 
 				if (tempListData != null) {
 					if (mapData == null) {
@@ -130,7 +133,7 @@ public class CalSubmitCusFunctionService extends SalaryCalFunction2 {
 	}
 
 	public Map<String, Map<String, String>> getSubDataGroupByEffectDate(Context ctx, String mainTableName,
-			String mainTableRowFilter, double relativePeriod) {
+			String mainTableRowFilter ) {
 		String sql = "select FID, FEffectDate, FPersonID from " + mainTableName + " where FID in (" + mainTableRowFilter
 				+ ")";
 		Map<String, List<String>> effectDateMap = new HashMap();