Browse Source

优化更新

yuanzhi_kuang 3 tháng trước cách đây
mục cha
commit
6697374771

+ 8 - 5
src/com/kingdee/eas/custom/calcdailypay/task/AutoSubDayDetailFacadeControllerBean.java

@@ -79,13 +79,16 @@ public class AutoSubDayDetailFacadeControllerBean extends AbstractAutoSubDayDeta
 
     private void executeSubmit(Context ctx, LocalDate date) throws BOSException, EASBizException, SQLException {
         // 这里是executeSubmit的具体实现
-    	String field = "";
+    	String field1 = "S64";
 		CalSubmitItemCollection subColl = CalSubmitItemFactory.getLocalInstance(ctx)
 				.getCalSubmitItemCollection("SELECT ID,FieldSn,number  where  number = '"+SubConstants.COMRATE+"'");
 		if(subColl.size()>0) {
 			CalSubmitItemInfo calSubmitItemInfo = subColl.get(0);
 			int fieldSn = calSubmitItemInfo.getFieldSn();
-			field = "S"+fieldSn ;
+			field1 = "S"+fieldSn ;
+		}else{
+			field1 = "S64";
+			logger.error("查询薪酬项目编码,没有找到"+SubConstants.COMRATE+"字段数据");
 		}
         // 假设你需要将日期格式化为特定格式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -110,13 +113,13 @@ public class AutoSubDayDetailFacadeControllerBean extends AbstractAutoSubDayDeta
 //        			BatchSubmitShemeBillControllerBeanEx batchSubmitShemeBillControllerBeanEx = new BatchSubmitShemeBillControllerBeanEx();
 //        			batchSubmitShemeBillControllerBeanEx._save(ctx,model);
         			billIns.save(new ObjectUuidPK(model.getId()),model);
-        			String checkSql = "SELECT "+field +"  FROM  T_HR_TimepieceBillEntry  WHERE  FBillID  = '"+model.getId().toString()+"'   ";
+        			String checkSql = "SELECT "+field1 +"  FROM  T_HR_TimepieceBillEntry  WHERE  FBillID  = '"+model.getId().toString()+"'   ";
         			IRowSet executeQuery = DbUtil.executeQuery(ctx, checkSql);
 					boolean isOk = true;
         			while(executeQuery.next()) {
-        				String value = executeQuery.getString(field);
+        				String value = executeQuery.getString(field1);
 						if(value == null ) {
-							logger.error("日提报单"+model.getNumber()+"的"+field+"字段值为空,无法提交");
+							logger.error("日提报单"+model.getNumber()+"的"+field1+"字段值为空,无法提交");
 							isOk = false;
 							break;
 						}

+ 14 - 6
src/com/kingdee/shr/compensation/app/integrate/BatchSubmitShemeBillControllerBeanEx.java

@@ -39,7 +39,7 @@ import org.apache.log4j.Logger;
 public class BatchSubmitShemeBillControllerBeanEx extends BatchSubmitShemeBillControllerBean {
 	private static final Logger logger = Logger.getLogger(BatchSubmitShemeBillControllerBeanEx.class);
 
-	private static  SimpleDateFormat  SDF = new SimpleDateFormat("yyyy-MM-dd");
+//	private static  SimpleDateFormat  SDF = new SimpleDateFormat("yyyy-MM-dd");
 
 	private static Map<String,String> FEILDS = new HashMap();
 
@@ -69,7 +69,8 @@ public class BatchSubmitShemeBillControllerBeanEx extends BatchSubmitShemeBillCo
 				String personId = entryInfo.getPerson().getId().toString();
 				selectPerson.add(personId);
 				Date effectDate = entryInfo.getEffectDate();
-				String formattedEffectDate = SDF.format(effectDate);
+				SimpleDateFormat  sf =new SimpleDateFormat("yyyy-MM-dd");
+				String formattedEffectDate = sf.format(effectDate);
 				selectDate.add(formattedEffectDate);
 			 
 			}
@@ -131,7 +132,7 @@ public class BatchSubmitShemeBillControllerBeanEx extends BatchSubmitShemeBillCo
 			itemNums = tempList.toArray(new String[0]);
 			logger.error("日提报赋值的字段"+itemNums.toString());
 
-			if(ObjectUtils.isEmpty(FEILDS)) {
+			if(null == FEILDS || ObjectUtils.isEmpty(FEILDS) || FEILDS.size() == 0) {
 				FEILDS = SubmitShemeUtils.getFeilds(ctx);
 			}
 		
@@ -153,14 +154,18 @@ public class BatchSubmitShemeBillControllerBeanEx extends BatchSubmitShemeBillCo
 				BatchSubmitShemeBillEntryInfo entry = entrys.get(i);
 				String pId = entry.getPerson().getId().toString();
 				Date effectDate = entry.getEffectDate();
-				String eDate = SDF.format(effectDate);
+				SimpleDateFormat  sdf = new SimpleDateFormat("yyyy-MM-dd");
+				String eDate = sdf.format(effectDate);
 				String key = pId + "_" + eDate;
+//				System.out.println("获取点检率key:" + key);
 				HashMap valMap = mesData.get(key);
-				
+
 				if (ObjectUtils.isEmpty(valMap)) {
+					System.out.println("获取点检率为空,跳出");
 					continue;
 				}
- 
+				//输出valMap的数据到控制台
+//				System.out.println("获取点检率valMap:" + valMap.toString());
 				//最后这个是id
 				Object[] paraObj = new Object[itemNums.length + 1];
 				setParamsVal(itemNums, checkbillIds, entry, valMap, paraObj,field); 
@@ -207,12 +212,15 @@ public class BatchSubmitShemeBillControllerBeanEx extends BatchSubmitShemeBillCo
 			}else {
 				//变更
 				paraObj[j] = valMap.get(valFeild);
+
 			}
 			if( j == itemNums.length-1 ) {
 				paraObj[itemNums.length] =  entry.getId().toString();
 				checkbillIds.add(FEILDS.get(SubConstants.MESID));
 			}
 		}
+		//输出paraObj值到控制台
+		System.out.println("paraObj:"+paraObj.toString());
 	}
 
 	

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

@@ -2,23 +2,25 @@ package com.kingdee.shr.compensation.app.utils;
 
 public class SubConstants {
     // 完成率
-    public static final String COMRATE = "MQ005";
+    public static final String COMRATE = "MQYW001";
     // 岗位类型
-    public static final String JOBTYPE = "MQ004";
-    // 技能等级 SKILLLEVEL
-    public static final String SKILLLEVEL = "MQ003";
+    public static final String JOBTYPE = "MQYW002";
+    // 技能等级 SKILLLEVEL  20250808 去除
+//    public static final String SKILLLEVEL = "MQYW006";
     // 是否现场作业 On site
-    public static final String ONSITE = "MQ007";
+    public static final String ONSITE = "MQYW004";
     // 班组任职 Team app  --shr 是否片长
-    public static final String TEAMAPP = "MQ012";
+    public static final String TEAMAPP = "MQYW003";
     // 工资序列 Salary seq  MQ运维工资序列
-    public static final String SALARYSEQ = "MQ015";
+    public static final String SALARYSEQ = "MQYW005";
     //MES的id
     public static String MESID = "MESID";
     //锁定标识
     public static String BOOLEANFIELD = "boolean01";
     
     
-    public static String[] ITEMNUMS = {COMRATE,JOBTYPE,SKILLLEVEL,ONSITE,TEAMAPP,SALARYSEQ};
+//    public static String[] ITEMNUMS = {COMRATE,JOBTYPE,SKILLLEVEL,ONSITE,TEAMAPP,SALARYSEQ};
+    //SKILLLEVEL  20250808 去除
+    public static String[] ITEMNUMS = {COMRATE,JOBTYPE,ONSITE,TEAMAPP,SALARYSEQ};
 
 }

+ 11 - 8
src/com/kingdee/shr/compensation/app/utils/SubmitShemeUtils.java

@@ -54,7 +54,7 @@ public class SubmitShemeUtils {
 //    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  SimpleDateFormat  SDF = new SimpleDateFormat("yyyy-MM-dd");
     
     private static Map<String,String> FEILDS = new HashMap();
 	private static  HashMap<String,String> JOBTYPEMAP =  new HashMap();
@@ -65,13 +65,13 @@ public class SubmitShemeUtils {
 	 * 从中间表获取mes数据
 	 */
 	public static HashMap<String,HashMap>  getMesData( Context ctx ,HashSet<String> selectPerson,DateRange dateRange) {
-		if(ObjectUtils.isEmpty(FEILDS)) {
+		if(null == FEILDS || ObjectUtils.isEmpty(FEILDS) || FEILDS.size() == 0) {
 			getFeilds(ctx);
 		}
 		//获取技能等级
-		if(ObjectUtils.isEmpty(JOBTYPEMAP)) {
+//		if(ObjectUtils.isEmpty(JOBTYPEMAP)) {
 			getJobType(ctx);
-		}
+//		}
 		HashMap<String, HashMap> checkMap = new HashMap();
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 		try {
@@ -93,7 +93,8 @@ public class SubmitShemeUtils {
 				String checkbillId  = rst.getString("fid");
 				String pId = rst.getString("cfPersonId");
 				Date bizDate = rst.getDate("cfbizDate");
-				String eDate = SDF.format(bizDate);
+				SimpleDateFormat  sdf = new SimpleDateFormat("yyyy-MM-dd");
+				String eDate = sdf.format(bizDate);
 				String key = pId+"_"+eDate;
 				HashMap<String,String> valMap = new HashMap();
 				BigDecimal comrate = rst.getBigDecimal("CFComrate");
@@ -105,7 +106,8 @@ public class SubmitShemeUtils {
 					cFpositiontype = "";
 				}
 				valMap.put(FEILDS.get(SubConstants.JOBTYPE), cFpositiontype);
-				valMap.put(FEILDS.get(SubConstants.SKILLLEVEL), rst.getString("cfskillLevel"));
+				//20250808 去除技能等级
+//				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"));
@@ -192,7 +194,8 @@ public class SubmitShemeUtils {
 			BatchSubmitShemeBillEntryInfo entry = entrys.get(i);
 			String pId = entry.getPerson().getId().toString();
 			Date effectDate = entry.getEffectDate();
-			String eDate = SDF.format(effectDate);
+			SimpleDateFormat  sdf = new SimpleDateFormat("yyyy-MM-dd");
+			String eDate = sdf.format(effectDate);
 			String key = pId + "_" + eDate;
 			HashMap valMap = mesData.get(key);
 
@@ -264,7 +267,7 @@ public class SubmitShemeUtils {
 	
 	/**
 	 * 更新点检率
-	 * @param request
+	 * @param
 	 * @param ctx
 	 * @param info
 	 */