Explorar el Código

工资包更新

yuanzhi_kuang hace 2 días
padre
commit
c2b7ce8b00

+ 2 - 1
GDYSL/src/com/kingdee/eas/hr/affair/app/ResignBizBillControllerBeanEx.java

@@ -43,6 +43,7 @@ import org.apache.log4j.Logger;
  **/
 public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
 
+	
 	private static Logger logger =
 	        Logger.getLogger("com.kingdee.eas.hr.affair.app.ResignBizBillControllerBeanEx");
 	
@@ -87,7 +88,7 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
         	HRAffairBizBillEntryInfo affairEntry = (HRAffairBizBillEntryInfo)entryCollection.get(i);
            	//兼职终止单; 202503
         	ResignBizBillEntryInfo resignBizBillEntryInfo = entryCollection.get(i);
-        	createPDelFromEntry(ctx, resignBizBillEntryInfo);
+			createPDelFromEntry(ctx, resignBizBillEntryInfo);
         	//更新人员档案上的兼职失效日期
         	updateJobEndTime(ctx, resignBizBillEntryInfo.getId().toString());
         	

+ 27 - 15
GDYSL/src/com/kingdee/shr/compensation/service/CustomerFunctionSalaryService.java

@@ -40,22 +40,31 @@ public class CustomerFunctionSalaryService {
 	 * @throws BOSException 
 	 * @throws SQLException 
 	 */
-	public double getSalayBag(Map<String, Object> paramMap, HashMap<String, Object> tempMap, CalSchemeInfo calSchemeInfo ,String cmpItemId,String months, String mainTableRowFilter) throws BOSException, SQLException {
+	public double getSalayBag(Map<String, Object> paramMap, HashMap<String, Object> tempMap, CalSchemeInfo calSchemeInfo, String cmpItemId, String months, String mainTableRowFilter) throws BOSException, SQLException {
 		Context ctx = Tools.getInstance().getCtx();
 		String personId = (String)paramMap.get("T_HR_SCMPCALTABLE_FPERSONID");
-		String sql = "SELECT top 1 b.* FROM CT_SAL_SalaryBag a " + 
-				" left join CT_SAL_SalaryBagEntry b on a.fid = b.fbillId " + 
-				" where a.FBillState = 3 and CFPersonID = '" + personId + "' " + 
+		String sql = "SELECT top 1 b.* FROM CT_SAL_SalaryBag a  left join CT_SAL_SalaryBagEntry b on a.fid = b.fbillId  where a.FBillState = 3 and CFPersonID = '" +
+				personId + "' " +
 				" and a.CFCmpItemID = (select fid from T_HR_SCmpItem where FNumber = '" + cmpItemId + "') and b.CFMonths = '" + months + "'";
-		System.out.println("工资包查询sql:" + sql);
+		System.out.println("查询工资包"+ sql);
+				String countSql = "SELECT count(1) count FROM CT_SAL_SalaryBag a  left join CT_SAL_SalaryBagEntry b on a.fid = b.fbillId  where a.FBillState = 1 and CFPersonID = '" +
+						personId + "' " +
+						" and a.CFCmpItemID = (select fid from T_HR_SCmpItem where FNumber = '" + cmpItemId + "') and b.CFMonths = '" + months + "'";
+//		System.out.println("查询工资包"+ countSql);
+				IRowSet countRowSet = DbUtil.executeQuery(ctx, countSql);
+		int dataCount = 0;
+		while (countRowSet.next()){
+			dataCount = countRowSet.getInt("count");
+		}
+
 		IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
-		if(rowSet.next()) {
-			if(rowSet.getObject("CFAmountPayable")==null || rowSet.getDouble("CFAmountPayable")==0) {
-				return rowSet.getDouble("CFMoneys");
-			}else {
+		if (rowSet.next()) {
+			if (dataCount > 0){
 				return rowSet.getDouble("CFAmountPayable");
 			}
-		} 
+
+			return rowSet.getDouble("CFMoneys");
+		}
 		return 0.0D;
 	}
 	
@@ -113,8 +122,11 @@ public class CustomerFunctionSalaryService {
 	 * @param months
 	 * @return
 	 * @throws BOSException 
-	 * @throws SQLException 
-	 */
+	 * @throws SQLException
+	 * 取工资提报,对于AssignType来说, 0表示兼职,1表示主要任职,3表示 无
+	 * 参数takeType 0表示主职,1表示兼职
+	 * 2025改使用变动记录
+ 	 */
 	public double getPutForward(Map<String, Object> paramMap, HashMap<String, Object> tempMap, CalSchemeInfo calSchemeInfo ,String projectNumber,String date, String takeType, String isHour, String mainTableRowFilter) throws BOSException, SQLException {
 		Context ctx = Tools.getInstance().getCtx();
 		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@@ -142,7 +154,7 @@ public class CustomerFunctionSalaryService {
 			String hourSql = "SELECT sum(b.CFTOTALWORKHOURS) sumHour FROM T_HR_SBatchSubmitShemeBill a "
 					+ "left join T_HR_SchemeBillEntry b on a.fid=b.fbillid "
 					+ "left join T_HR_SCmpEmpORelation c on b.FCMPEMPORELATIONID=c.fid "
-					+ "left join T_HR_EmpPostExperienceHis d on d.fid=c.femppostexphisid "  
+					+ "left join T_HR_EmpOrgRelation d on d.fid=c.femporgrelationid "
 					+ "where year(b.FEFFECTDATE)="+year+" and month(b.FEFFECTDATE)="+month+" "
 					+ "and d.FASSIGNTYPE='"+assignType+"' and a.FBILLSTATE = '3' and b.fpersonid='"+personId+"'";
 			logger.error("查询员工全职总工时SQL:"+hourSql);
@@ -158,7 +170,7 @@ public class CustomerFunctionSalaryService {
 				String amountSql = "SELECT sum(b.CFTOTALAMOUNT) sumAmount FROM T_HR_SBatchSubmitShemeBill a "
 						+ "left join T_HR_SchemeBillEntry b on a.fid=b.fbillid "
 						+ "left join T_HR_SCmpEmpORelation c on b.FCMPEMPORELATIONID=c.fid "
-						+ "left join T_HR_EmpPostExperienceHis d on d.fid=c.femppostexphisid "  
+						+ "left join T_HR_EmpOrgRelation d on d.fid=c.femporgrelationid "
 						+ "where year(b.FEFFECTDATE)="+year+" and month(b.FEFFECTDATE)="+month+" "
 						+ "and d.FASSIGNTYPE='1' and a.FBILLSTATE = '3' and b.fpersonid='"+personId+"'";
 				logger.error("查询员工全职总金额SQL:"+amountSql);
@@ -210,7 +222,7 @@ public class CustomerFunctionSalaryService {
 			String amountSql = "SELECT sum(b.CFTOTALAMOUNT) sumAmount FROM T_HR_SBatchSubmitShemeBill a "
 					+ "left join T_HR_SchemeBillEntry b on a.fid=b.fbillid "
 					+ "left join T_HR_SCmpEmpORelation c on b.FCMPEMPORELATIONID=c.fid "
-					+ "left join T_HR_EmpPostExperienceHis d on d.fid=c.femppostexphisid "  
+					+ "left join T_HR_EmpOrgRelation d on d.fid=c.femporgrelationid "
 					+ "where year(b.FEFFECTDATE)="+year+" and month(b.FEFFECTDATE)="+month+" "
 					+ "and d.FASSIGNTYPE='0' and a.FBILLSTATE = '3' and b.fpersonid='"+personId+"'";
 			logger.error("查询员工兼职总金额SQL:"+amountSql);