|
@@ -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++; // 只有实际赋值的行才计数
|
|
|
}
|
|
|
}
|