Pārlūkot izejas kodu

兼职与离职

yuanzhi_kuang 2 mēneši atpakaļ
vecāks
revīzija
4fe693ee05

+ 135 - 0
GDYSL/deployed_metas/com/kingdee/shr/compensation/app/RetMoneyFacade.facade

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<facade xmlns="com.kingdee.bos.metadata">
+    <package>com.kingdee.shr.compensation.app</package>
+    <name>RetMoneyFacade</name>
+    <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].alias</alias>
+    <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].description</description>
+    <userDefined>true</userDefined>
+    <bosType>E9D4CD3B</bosType>
+    <stereoType>false</stereoType>
+    <businessImplName>com.kingdee.shr.compensation.RetMoneyFacade</businessImplName>
+    <businessControllerName>com.kingdee.shr.compensation.app.RetMoneyFacadeController</businessControllerName>
+    <accessLevel>public</accessLevel>
+    <subClassingMode>normal</subClassingMode>
+    <methods>
+        <method>
+            <name>retMoney</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].description</description>
+            <innerID>95f6569e-5afd-428b-b63f-206820e58295</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Required</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+        <method>
+            <name>synSalaryData</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].description</description>
+            <innerID>c1e9fceb-8006-4e0a-865f-e36dc6251453</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Supports</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+        <method>
+            <name>synmpPosOrgRelatio</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].description</description>
+            <innerID>24ce3c75-7bda-4afe-9eb2-d5b332a33ba4</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Supports</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+    </methods>
+    <resource>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="薪酬追溯处理" />
+            <lang locale="zh_HK" value="薪酬追溯處理" />
+            <lang locale="zh_TW" value="薪酬追溯處理" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="薪酬追溯处理" />
+            <lang locale="zh_HK" value="薪酬追溯處理" />
+            <lang locale="zh_TW" value="薪酬追溯處理" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].extendedProperty.userDefined">
+            <lang locale="en_US" value="true" />
+            <lang locale="zh_CN" value="true" />
+            <lang locale="zh_TW" value="true" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="推送报文" />
+            <lang locale="zh_HK" value="推送報文" />
+            <lang locale="zh_TW" value="推送報文" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="null" />
+            <lang locale="zh_HK" value="null" />
+            <lang locale="zh_TW" value="null" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步预入薪酬设计" />
+            <lang locale="zh_HK" value="同步預入薪酬設計" />
+            <lang locale="zh_TW" value="同步預入薪酬設計" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步预入薪酬设计" />
+            <lang locale="zh_HK" value="同步預入薪酬設計" />
+            <lang locale="zh_TW" value="同步預入薪酬設計" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步任职信息" />
+            <lang locale="zh_HK" value="同步任職信息" />
+            <lang locale="zh_TW" value="同步任職信息" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步任职信息" />
+            <lang locale="zh_HK" value="同步任職信息" />
+            <lang locale="zh_TW" value="同步任職信息" />
+        </rs>
+    </resource>
+</facade>
+

+ 135 - 0
GDYSL/metadata/com/kingdee/shr/compensation/app/RetMoneyFacade.facade

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<facade xmlns="com.kingdee.bos.metadata">
+    <package>com.kingdee.shr.compensation.app</package>
+    <name>RetMoneyFacade</name>
+    <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].alias</alias>
+    <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].description</description>
+    <userDefined>true</userDefined>
+    <bosType>E9D4CD3B</bosType>
+    <stereoType>false</stereoType>
+    <businessImplName>com.kingdee.shr.compensation.RetMoneyFacade</businessImplName>
+    <businessControllerName>com.kingdee.shr.compensation.app.RetMoneyFacadeController</businessControllerName>
+    <accessLevel>public</accessLevel>
+    <subClassingMode>normal</subClassingMode>
+    <methods>
+        <method>
+            <name>retMoney</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].description</description>
+            <innerID>95f6569e-5afd-428b-b63f-206820e58295</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Required</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+        <method>
+            <name>synSalaryData</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].description</description>
+            <innerID>c1e9fceb-8006-4e0a-865f-e36dc6251453</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Supports</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+        <method>
+            <name>synmpPosOrgRelatio</name>
+            <isListenerMethod>false</isListenerMethod>
+            <alias>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].alias</alias>
+            <description>facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].description</description>
+            <innerID>24ce3c75-7bda-4afe-9eb2-d5b332a33ba4</innerID>
+            <accessLevel>public</accessLevel>
+            <subClassingMode>normal</subClassingMode>
+            <returnValueType />
+            <metadataRef />
+            <transactionAttribute>Supports</transactionAttribute>
+            <userDefined>true</userDefined>
+            <userDefinedLogic />
+            <exceptions>
+                <bizException>
+                    <key name="package" value="com.kingdee.eas.common" />
+                    <key name="name" value="EASBizException" />
+                </bizException>
+            </exceptions>
+            <configured>false</configured>
+        </method>
+    </methods>
+    <resource>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="薪酬追溯处理" />
+            <lang locale="zh_HK" value="薪酬追溯處理" />
+            <lang locale="zh_TW" value="薪酬追溯處理" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="薪酬追溯处理" />
+            <lang locale="zh_HK" value="薪酬追溯處理" />
+            <lang locale="zh_TW" value="薪酬追溯處理" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].extendedProperty.userDefined">
+            <lang locale="en_US" value="true" />
+            <lang locale="zh_CN" value="true" />
+            <lang locale="zh_TW" value="true" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="推送报文" />
+            <lang locale="zh_HK" value="推送報文" />
+            <lang locale="zh_TW" value="推送報文" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[retMoney].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="null" />
+            <lang locale="zh_HK" value="null" />
+            <lang locale="zh_TW" value="null" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步预入薪酬设计" />
+            <lang locale="zh_HK" value="同步預入薪酬設計" />
+            <lang locale="zh_TW" value="同步預入薪酬設計" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synSalaryData].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步预入薪酬设计" />
+            <lang locale="zh_HK" value="同步預入薪酬設計" />
+            <lang locale="zh_TW" value="同步預入薪酬設計" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].alias">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步任职信息" />
+            <lang locale="zh_HK" value="同步任職信息" />
+            <lang locale="zh_TW" value="同步任職信息" />
+        </rs>
+        <rs key="facade[com.kingdee.shr.compensation.app.RetMoneyFacade].methods.method[synmpPosOrgRelatio].description">
+            <lang locale="en_US" value="null" />
+            <lang locale="zh_CN" value="同步任职信息" />
+            <lang locale="zh_HK" value="同步任職信息" />
+            <lang locale="zh_TW" value="同步任職信息" />
+        </rs>
+    </resource>
+</facade>
+

+ 83 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/AbstractPluralitySubFacadeControllerBean.java

@@ -0,0 +1,83 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import javax.ejb.*;
+import java.rmi.RemoteException;
+import com.kingdee.bos.*;
+import com.kingdee.bos.util.BOSObjectType;
+import com.kingdee.bos.metadata.IMetaDataPK;
+import com.kingdee.bos.metadata.rule.RuleExecutor;
+import com.kingdee.bos.metadata.MetaDataPK;
+//import com.kingdee.bos.metadata.entity.EntityViewInfo;
+import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
+import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
+//import com.kingdee.bos.dao.IObjectPK;
+import com.kingdee.bos.dao.IObjectValue;
+import com.kingdee.bos.dao.IObjectCollection;
+import com.kingdee.bos.service.ServiceContext;
+import com.kingdee.bos.service.IServiceContext;
+import com.kingdee.eas.framework.Result;
+import com.kingdee.eas.framework.LineResult;
+import com.kingdee.eas.framework.exception.EASMultiException;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+
+import com.kingdee.eas.common.EASBizException;
+import java.lang.String;
+
+
+
+public abstract class AbstractPluralitySubFacadeControllerBean extends AbstractBizControllerBean implements PluralitySubFacadeController
+{
+    protected AbstractPluralitySubFacadeControllerBean()
+    {
+    }
+
+    protected BOSObjectType getBOSType()
+    {
+        return new BOSObjectType("A8411F30");
+    }
+
+    public void autoPluralitEnd(Context ctx, String personId, String curdate, int offset) throws BOSException, EASBizException
+    {
+        try {
+            ServiceContext svcCtx = createServiceContext(new MetaDataPK("28044960-f04f-4523-ac82-3d53d3763e06"), new Object[]{ctx, personId, curdate, new Integer(offset)});
+            invokeServiceBefore(svcCtx);
+              if(!svcCtx.invokeBreak()) {
+            _autoPluralitEnd(ctx, personId, curdate, offset);
+            }
+            invokeServiceAfter(svcCtx);
+        } catch (BOSException ex) {
+            throw ex;
+        } catch (EASBizException ex0) {
+            throw ex0;
+        } finally {
+            super.cleanUpServiceState();
+        }
+    }
+    protected void _autoPluralitEnd(Context ctx, String personId, String curdate, int offset) throws BOSException, EASBizException
+    {    	
+        return;
+    }
+
+    public void resignCreateEnd(Context ctx, String personId, String endDate) throws BOSException, EASBizException
+    {
+        try {
+            ServiceContext svcCtx = createServiceContext(new MetaDataPK("30847b82-b812-43d3-be17-fa9bfa469cf2"), new Object[]{ctx, personId, endDate});
+            invokeServiceBefore(svcCtx);
+              if(!svcCtx.invokeBreak()) {
+            _resignCreateEnd(ctx, personId, endDate);
+            }
+            invokeServiceAfter(svcCtx);
+        } catch (BOSException ex) {
+            throw ex;
+        } catch (EASBizException ex0) {
+            throw ex0;
+        } finally {
+            super.cleanUpServiceState();
+        }
+    }
+    protected void _resignCreateEnd(Context ctx, String personId, String endDate) throws BOSException, EASBizException
+    {    	
+        return;
+    }
+
+}

+ 20 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/IPluralitySubFacade.java

@@ -0,0 +1,20 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import com.kingdee.bos.BOSException;
+//import com.kingdee.bos.metadata.*;
+import com.kingdee.bos.framework.*;
+import com.kingdee.bos.util.*;
+import com.kingdee.bos.Context;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.util.*;
+import com.kingdee.eas.common.EASBizException;
+import java.lang.String;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.framework.*;
+
+public interface IPluralitySubFacade extends IBizCtrl
+{
+    public void autoPluralitEnd(String personId, String curdate, int offset) throws BOSException, EASBizException;
+    public void resignCreateEnd(String personId, String endDate) throws BOSException, EASBizException;
+}

+ 66 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/PluralitySubFacade.java

@@ -0,0 +1,66 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import com.kingdee.bos.framework.ejb.EJBRemoteException;
+import com.kingdee.bos.util.BOSObjectType;
+import java.rmi.RemoteException;
+import com.kingdee.bos.framework.AbstractBizCtrl;
+import com.kingdee.bos.orm.template.ORMObject;
+
+import com.kingdee.eas.custom.facade.plurality.*;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.util.*;
+import com.kingdee.eas.common.EASBizException;
+import java.lang.String;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.framework.*;
+
+public class PluralitySubFacade extends AbstractBizCtrl implements IPluralitySubFacade
+{
+    public PluralitySubFacade()
+    {
+        super();
+        registerInterface(IPluralitySubFacade.class, this);
+    }
+    public PluralitySubFacade(Context ctx)
+    {
+        super(ctx);
+        registerInterface(IPluralitySubFacade.class, this);
+    }
+    public BOSObjectType getType()
+    {
+        return new BOSObjectType("A8411F30");
+    }
+    private PluralitySubFacadeController getController() throws BOSException
+    {
+        return (PluralitySubFacadeController)getBizController();
+    }
+    /**
+     *自动终止兼职-User defined method
+     *@param personId 人员id
+     *@param curdate 指定日期
+     *@param offset 日期偏移范围
+     */
+    public void autoPluralitEnd(String personId, String curdate, int offset) throws BOSException, EASBizException
+    {
+        try {
+            getController().autoPluralitEnd(getContext(), personId, curdate, offset);
+        }
+        catch(RemoteException err) {
+            throw new EJBRemoteException(err);
+        }
+    }
+    /**
+     *离职后生成兼职终止-User defined method
+     *@param personId 人员id
+     *@param endDate 结束日期
+     */
+    public void resignCreateEnd(String personId, String endDate) throws BOSException, EASBizException
+    {
+        try {
+            getController().resignCreateEnd(getContext(), personId, endDate);
+        }
+        catch(RemoteException err) {
+            throw new EJBRemoteException(err);
+        }
+    }
+}

+ 23 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/PluralitySubFacadeController.java

@@ -0,0 +1,23 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import com.kingdee.bos.BOSException;
+//import com.kingdee.bos.metadata.*;
+import com.kingdee.bos.framework.*;
+import com.kingdee.bos.util.*;
+import com.kingdee.bos.Context;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.util.*;
+import com.kingdee.eas.common.EASBizException;
+import java.lang.String;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.framework.*;
+
+import java.rmi.RemoteException;
+import com.kingdee.bos.framework.ejb.BizController;
+
+public interface PluralitySubFacadeController extends BizController
+{
+    public void autoPluralitEnd(Context ctx, String personId, String curdate, int offset) throws BOSException, EASBizException, RemoteException;
+    public void resignCreateEnd(Context ctx, String personId, String endDate) throws BOSException, EASBizException, RemoteException;
+}

+ 230 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/PluralitySubFacadeControllerBean.java

@@ -0,0 +1,230 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.eas.framework.CoreBaseCollection;
+import com.kingdee.eas.framework.CoreBaseInfo;
+import com.kingdee.eas.hr.affair.*;
+import com.kingdee.eas.hr.base.AffairActionReasonFactory;
+import com.kingdee.eas.hr.base.AffairActionReasonInfo;
+import com.kingdee.eas.hr.base.ApproveTypeEnum;
+import com.kingdee.eas.hr.base.HRBillStateEnum;
+import com.kingdee.eas.hr.base.HRBizDefineFactory;
+import com.kingdee.eas.hr.base.HRBizDefineInfo;
+import com.kingdee.eas.util.app.ContextUtil;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.jdbc.rowset.IRowSet;
+import com.kingdee.util.DateTimeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import java.sql.SQLException;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.HashMap;
+import com.kingdee.bos.*;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.hr.utils.DateUtil;
+
+import java.lang.String;
+
+public class PluralitySubFacadeControllerBean extends AbstractPluralitySubFacadeControllerBean
+{
+    private static Logger logger =
+        Logger.getLogger("com.kingdee.eas.custom.facade.plurality.PluralitySubFacadeControllerBean");
+    
+    @Override
+    protected void _autoPluralitEnd(Context ctx, String personId, String curdate, int offset) throws BOSException, EASBizException {
+    	super._autoPluralitEnd(ctx, personId,curdate, offset);
+    	//变动类型
+		AffairActionReasonInfo reasonInfo = AffairActionReasonFactory.getLocalInstance(ctx).getAffairActionReasonInfo(" where number = '0211' ");
+		HRBizDefineInfo defineInfo = HRBizDefineFactory.getLocalInstance(ctx).getHRBizDefineInfo( " where number = 'SHR19' " );
+		HashMap<String, Object> params = new HashMap  ();
+		params.put("reasonInfo", reasonInfo);
+		params.put("defineInfo", defineInfo);
+		Date bizDate = new Date();
+		//查询所有当天日期的离职单
+		if (StringUtils.isNotBlank(curdate)) {
+			bizDate = DateUtil.stringToDate(curdate, "yyyy-MM-dd");
+		}
+		Date startDate = DateUtil.getDateStartTime(bizDate);
+		Date endDate = DateUtil.getDateEndTime(bizDate);
+		if( offset > 0 ){
+			endDate = DateUtil.add(endDate, offset) ;
+		}else if( offset < 0 ) {
+			startDate = DateUtil.add(startDate, offset) ;
+		}
+
+    	//查询兼职单
+		StringBuilder sbu = new StringBuilder();
+		sbu.append(" select  bill.fid billId   from T_HR_PluralityAddBizBill bill ");
+		sbu.append(" left join  T_HR_PluralityAddBizBillEntry entry on bill.FEntryId = entry.fbillid ");
+		sbu.append(" where  bill.fbillstate = '3'  "  );
+		sbu.append(" and  entry.fenddate >= '" + startDate+"' " );
+		sbu.append(" and  entry.fenddate <= '" + endDate+"' " );
+		if( StringUtils.isNotBlank(personId)){
+			sbu.append(" and  entry.fpersonid = " + personId );
+		}
+		IRowSet rowSet = DbUtil.executeQuery(ctx, sbu.toString());
+		 
+		try {
+			while(rowSet.next()) {
+				String billId = rowSet.getString("billId");
+				newDelBill(  ctx,   billId , params);
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+	 
+
+	}
+
+
+	private  void  newDelBill(Context ctx, String billId,HashMap<String, Object> params) throws BOSException, EASBizException {
+
+		IPluralityAddBizBill addIns = PluralityAddBizBillFactory.getLocalInstance(ctx);
+		PluralityAddBizBillInfo addInfo = addIns.getPluralityAddBizBillInfo(new ObjectUuidPK(billId));
+		//创建新集合
+		CoreBaseCollection delCol = new CoreBaseCollection();
+		PluralityDelBizBillInfo delInfo = new PluralityDelBizBillInfo();
+//		delInfo.setAdminOrg(addInfo.getAdminOrg());
+		delInfo.setHrOrgUnit(addInfo.getHrOrgUnit());
+		delInfo.setBizDate(new Date());
+		delInfo.setCU(addInfo.getCU());
+		delInfo.setApplier(addInfo.getApplier());
+		//分录数据
+		PluralityAddBizBillEntryCollection addEntrys = addInfo.getEntrys();
+		//分录赋值
+		PluralityDelBizBillEntryCollection addEntryData = addEntryData(addEntrys,  params);
+		delInfo.put("entrys", addEntryData);
+		delInfo.setApplyDate(new Date());
+		delInfo.setBizDate(new Date());
+		delInfo.setCreator(ContextUtil.getCurrentUserInfo(ctx));
+		delInfo.setHrOrgUnit(addInfo.getHrOrgUnit());
+		delInfo.setIsMulti(addInfo.isIsMulti() );
+		delInfo.setUseDefault(addInfo.isUseDefault());
+		delInfo.setIsMultiEntry(addInfo.isIsMultiEntry());
+		delInfo.setBillState(HRBillStateEnum.SAVED);
+		delInfo.setApproveType(ApproveTypeEnum.DIRECT);
+	 
+//		delCol.add(delInfo);
+		//保存数据库
+		IPluralityDelBizBill delIns = PluralityDelBizBillFactory.getLocalInstance(ctx);
+		delIns.addnew(delInfo);
+		delInfo.setBillState(HRBillStateEnum.AUDITED);
+		delIns.submitEffect((CoreBaseInfo)delInfo);
+		logger.error("兼职单审核完");
+	}
+
+
+
+	/**
+	 * 分录赋值
+	 * @param addEntrys
+	 * @return
+	 */
+	private PluralityDelBizBillEntryCollection  addEntryData(PluralityAddBizBillEntryCollection addEntrys,HashMap<String, Object> params){
+		PluralityDelBizBillEntryCollection delEntryCol  = new PluralityDelBizBillEntryCollection();
+		for(int i =0 ;i< addEntrys.size();i++){
+			PluralityAddBizBillEntryInfo addEntryInfo = addEntrys.get(i);
+			PluralityDelBizBillEntryInfo delEntryInfo = new PluralityDelBizBillEntryInfo();
+			delEntryInfo.setPerson(addEntryInfo.getPerson());
+			delEntryInfo.setDescription("自动终止");
+
+
+			delEntryInfo.setAffairActionReason((AffairActionReasonInfo)params.get("reasonInfo"));
+			delEntryInfo.setHrBizDefine((HRBizDefineInfo)params.get("defineInfo"));
+			delEntryInfo.setDefaultLocale(addEntryInfo.getDefaultLocale());
+			delEntryInfo.setHrOrgUnit(addEntryInfo.getHrOrgUnit());
+			//兼职组织- 
+			delEntryInfo.setOldEmpType(addEntryInfo.getEmpType());
+			delEntryInfo.setOldAdminOrg(addEntryInfo.getAdminOrg());
+			delEntryInfo.setOldPosition(addEntryInfo.getPosition());
+			delEntryInfo.setOldCompany(addEntryInfo.getCompany());
+			//任职职位-现任职位
+			delEntryInfo.setEmpType(addEntryInfo.getOldEmpType());
+			delEntryInfo.setMainPosition(addEntryInfo.getOldPosition());
+			delEntryInfo.setMainAdminOrg(addEntryInfo.getOldAdminOrg());
+			//任职部门-现任部门
+			delEntryInfo.setMainDepartment(addEntryInfo.getOldAdminOrg());
+			delEntryInfo.setMainCompany(addEntryInfo.getOldCompany());
+			//不需要
+//			delEntryInfo.setPosition(addEntryInfo.getOldPosition());
+//			delEntryInfo.setAdminOrg(addEntryInfo.getOldAdminOrg());
+			delEntryInfo.setBeginDate(addEntryInfo.getBizDate());
+			delEntryInfo.setEmployerUnit(addEntryInfo.getEmployerUnit());
+			delEntryInfo.put("pthwage", addEntryInfo.get("pthwage"));
+			delEntryInfo.put("ptlmanager", addEntryInfo.get("ptlmanager"));
+//			if(params.containsKey("isResign") && Boolean.getBoolean(params.get("isResign").toString()) ) {
+//				
+//			}
+			//结束日期
+			if(params.containsKey("endDate") ) {
+				try {
+					Date  endDate = DateTimeUtils.parseDate( params.get("endDate").toString(),  "yyyy-MM-dd");
+					delEntryInfo.setBizDate(endDate);
+				} catch (ParseException e) {
+					e.printStackTrace();
+				}
+			}else {
+				delEntryInfo.setBizDate(addEntryInfo.getEndDate());
+			}
+			delEntryCol.add(delEntryInfo);
+		}
+		return delEntryCol;
+	}
+    
+    
+	
+	
+	@Override
+	protected void _resignCreateEnd(Context ctx, String personId, String endDate) throws BOSException, EASBizException {
+		super._resignCreateEnd(ctx, personId, endDate);
+		if(StringUtils.isBlank(endDate)) {
+			endDate = DateUtil.dateToString(new Date(), "yyyy-MM-dd");
+		}
+		
+		//变动类型
+		AffairActionReasonInfo reasonInfo = AffairActionReasonFactory.getLocalInstance(ctx).getAffairActionReasonInfo(" where number = '0211' ");
+		HRBizDefineInfo defineInfo = HRBizDefineFactory.getLocalInstance(ctx).getHRBizDefineInfo( " where number = 'SHR19' " );
+		HashMap<String, Object> params = new HashMap<String,Object> ();
+		params.put("reasonInfo", reasonInfo);
+		params.put("defineInfo", defineInfo);
+		params.put("isResign", true);
+		params.put("endDate", endDate);
+    	//查询兼职单
+		StringBuilder sbu = new StringBuilder();
+		sbu.append(" select  bill.fid billId  , delen.fid  delId from T_HR_PluralityAddBizBill bill ");
+		sbu.append(" left join  T_HR_PluralityAddBizBillEntry entry on bill.FId = entry.fbillid "); 
+		sbu.append(" left join T_HR_PluralityDelBizBillEntry  delen   ");
+		sbu.append(" on  entry.fpersonid = delen.fpersonid   ");
+		sbu.append(" and  entry.foldpositionid = delen.FMainPositionID  ");
+		sbu.append(" and   (   ");
+		sbu.append(" entry.cfpthwage = delen.cfpthwage   ");
+		sbu.append(" OR  ( entry.cfpthwage IS NULL AND delen.cfpthwage IS NULL  ) ");
+		sbu.append("  )   ");
+		sbu.append(" where  bill.fbillstate = '3'  ");
+		sbu.append(" and  entry.fpersonid = '" + personId+"'" );
+		sbu.append(" and  ( entry.fenddate >= {" + endDate+"}  or entry.fenddate is null ) ");
+		
+		 
+		IRowSet rowSet = DbUtil.executeQuery(ctx, sbu.toString());
+ 
+			try {
+				while(rowSet.next()) {
+					String billId = rowSet.getString("billId");
+					String delId = rowSet.getString("delId");
+					if(StringUtils.isBlank(delId)) {
+						newDelBill(  ctx,   billId ,params);
+					}
+				}
+			} catch (SQLException e) {
+				e.printStackTrace();
+			}
+ 
+		
+		
+		
+		
+	}
+    
+    
+}

+ 30 - 0
GDYSL/src/com/kingdee/eas/custom/facade/plurality/PluralitySubFacadeFactory.java

@@ -0,0 +1,30 @@
+package com.kingdee.eas.custom.facade.plurality;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.BOSObjectFactory;
+import com.kingdee.bos.util.BOSObjectType;
+import com.kingdee.bos.Context;
+
+public class PluralitySubFacadeFactory
+{
+    private PluralitySubFacadeFactory()
+    {
+    }
+    public static com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade getRemoteInstance() throws BOSException
+    {
+        return (com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade)BOSObjectFactory.createRemoteBOSObject(new BOSObjectType("A8411F30") ,com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade.class);
+    }
+    
+    public static com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade getRemoteInstanceWithObjectContext(Context objectCtx) throws BOSException
+    {
+        return (com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade)BOSObjectFactory.createRemoteBOSObjectWithObjectContext(new BOSObjectType("A8411F30") ,com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade.class, objectCtx);
+    }
+    public static com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade getLocalInstance(Context ctx) throws BOSException
+    {
+        return (com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade)BOSObjectFactory.createBOSObject(ctx, new BOSObjectType("A8411F30"));
+    }
+    public static com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade getLocalInstance(String sessionID) throws BOSException
+    {
+        return (com.kingdee.eas.custom.facade.plurality.IPluralitySubFacade)BOSObjectFactory.createBOSObject(sessionID, new BOSObjectType("A8411F30"));
+    }
+}

+ 233 - 0
GDYSL/src/com/kingdee/eas/hr/affair/app/PluralityDelBizBillControllerBeanEx.java

@@ -0,0 +1,233 @@
+package com.kingdee.eas.hr.affair.app;
+
+import java.sql.Date;
+import java.sql.SQLException;
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.IObjectPK;
+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.affair.IPluralityAddBizBillEntry;
+import com.kingdee.eas.hr.affair.IPluralityDelBizBill;
+import com.kingdee.eas.hr.affair.PluralityAddBizBillEntryFactory;
+import com.kingdee.eas.hr.affair.PluralityAddBizBillEntryInfo;
+import com.kingdee.eas.hr.affair.PluralityDelBizBillEntryCollection;
+import com.kingdee.eas.hr.affair.PluralityDelBizBillEntryInfo;
+import com.kingdee.eas.hr.affair.PluralityDelBizBillFactory;
+import com.kingdee.eas.hr.affair.PluralityDelBizBillInfo;
+import com.kingdee.eas.hr.affair.app.PluralityDelBizBillControllerBean;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.jdbc.rowset.IRowSet;
+
+/**
+ * 扩展了PluralityDelBizBillControllerBean类,增加了在提交单据后的endDate更新逻辑。
+ */
+public class PluralityDelBizBillControllerBeanEx extends PluralityDelBizBillControllerBean {
+
+    /**
+     * 覆盖父类的_submitEffect方法,在提交单据后更新endDate。
+     * @param ctx 上下文对象
+     * @param model 单据模型
+     * @return 单据主键
+     * @throws BOSException 业务基础服务异常
+     * @throws EASBizException EAS业务异常
+     */
+    @Override
+    protected IObjectPK _submitEffect(Context ctx, CoreBaseInfo model) throws BOSException, EASBizException {
+        // 调用父类的_submitEffect方法获取单据主键
+        IObjectPK objectPk = super._submitEffect(ctx, model);
+        // 更新endDate
+        updateEndDate(ctx, model);
+        return objectPk;
+    }
+
+    
+    /**
+     * 覆盖父类的_submit方法,在提交单据后更新endDate。
+     * @param ctx 上下文对象
+     * @param model 单据模型
+     * @return 单据主键
+     * @throws BOSException 业务基础服务异常
+     * @throws EASBizException EAS业务异常
+     */
+    @Override
+    protected IObjectPK _submit(Context ctx, IObjectValue model) throws BOSException, EASBizException {
+        // 调用父类的_submit方法获取单据主键
+        IObjectPK objectPk = super._submit(ctx, model);
+        // 更新endDate
+        updateEndDate(ctx, model);
+        return objectPk;
+    }
+
+    /**
+     * 更新单据中的endDate字段。
+     * @param ctx 上下文对象
+     * @param model 单据模型
+     * @throws EASBizException EAS业务异常
+     * @throws BOSException 业务基础服务异常
+     */
+    public void updateEndDate(Context ctx, IObjectValue model) throws EASBizException, BOSException {
+        // 将模型转换为PluralityDelBizBillInfo类型
+        PluralityDelBizBillInfo billInfo = (PluralityDelBizBillInfo) model;
+        // 获取单据ID
+        String billId = billInfo.getId().toString();
+        // 获取单据条目集合
+        PluralityDelBizBillEntryCollection entrys = billInfo.getEntrys();
+        // 如果条目集合不为空且大小大于0,则遍历条目集合
+        if (null != entrys && entrys.size() > 0) {
+            for (int i = 0; i < entrys.size(); i++) {
+                // 获取单据条目信息
+                PluralityDelBizBillEntryInfo entryInfo = entrys.get(i);
+                // 检查并更新添加单据的endDate
+                checkAddBill(ctx, entryInfo.getId().toString(),1);
+            }
+        }
+    }
+
+    /**
+     * 检查并更新添加单据的endDate。
+     * @param ctx 上下文对象
+     * @param entryId 单据条目ID
+     * @param type  1:审核 ; 0:反审核
+     * @throws BOSException 业务基础服务异常
+     * @throws EASBizException EAS业务异常
+     */
+    private void checkAddBill(Context ctx, String entryId, int type) throws BOSException, EASBizException {
+//        // 创建删除单据条目集合
+//        CoreBaseCollection delEnCol = new CoreBaseCollection();
+
+        // 构建SQL查询语句
+        StringBuilder sbu = new StringBuilder();
+        sbu.append(" select  bill.fid addId  , entry.fid  addEnId ,entry.fendDate addEndDate  ");
+        // SQL语句中重复的select关键字可能是错误,这里假设应该是逗号
+        sbu.append(" ,entry.cfoldEndDate oldAddEDate  , delen.fbizDate  newEDate  ");
+        sbu.append(" from T_HR_PluralityAddBizBill  bill ");
+        sbu.append(" left join  T_HR_PluralityAddBizBillEntry  entry on bill.FId = entry.fbillid ");
+        sbu.append(" left join  T_HR_PluralityDelBizBillEntry  delen   ");
+        sbu.append(" on  entry.fpersonid = delen.fpersonid   ");
+        sbu.append(" and  entry.foldpositionid = delen.FMainPositionID  ");
+        sbu.append(" and   (   ");
+        sbu.append(" entry.cfpthwage = delen.cfpthwage   ");
+        sbu.append(" OR  ( entry.cfpthwage IS NULL AND delen.cfpthwage IS NULL  ) ");
+        sbu.append("  )   ");
+        sbu.append(" where  bill.fbillstate = '3'  ");
+        sbu.append(" and  delen.fid = '" + entryId + "'");
+        
+        if( type == 0 ) {
+        	restoreAddBillEndDate(ctx, sbu.toString());
+        }else if( type == 1 ) {
+        	updateAddBillEndDate(ctx, sbu.toString());
+        }
+        
+    }
+    
+    
+    
+    private  void  updateAddBillEndDate(Context ctx, String sqlStr) {
+        // 创建添加单据条目集合
+        CoreBaseCollection addEnCol = new CoreBaseCollection();
+    	try {
+            // 获取添加单据条目实例
+            IPluralityAddBizBillEntry addEnIns = PluralityAddBizBillEntryFactory.getLocalInstance(ctx);
+            // 执行SQL查询
+            IRowSet rowSet = DbUtil.executeQuery(ctx, sqlStr);
+            // 遍历查询结果
+            while (rowSet.next()) {
+            	// 获取添加单据条目ID
+            	String addEnId = rowSet.getString("addEnId");
+            	// 获取 原兼职单上创建时的日期,第一次写兼职结束时是空的;
+            	Date oldAddEDate = rowSet.getDate("oldAddEDate");
+            	// 获取oldEDate
+            	Date addEndDate = rowSet.getDate("addEndDate");
+            	// 获取新的endDate
+            	Date newEDate = rowSet.getDate("newEDate");
+            	// 如果添加单据条目ID为空,则进行更新操作
+            	
+            	// 获取兼职单据条目信息
+            	PluralityAddBizBillEntryInfo addInfo = addEnIns.getPluralityAddBizBillEntryInfo(new ObjectUuidPK(addEnId));
+            	if ( null == oldAddEDate) {
+            		//原结束日期 = 单据创建时的结束日期
+            		addInfo.put("oldEndDate", addEndDate);
+            	}
+            	// 设置更新前的endDate
+            	addInfo.put("endDate", newEDate);
+            	addEnCol.add(addInfo);
+            }
+         // 更新添加单据条目集合
+            addEnIns.update(addEnCol);
+        } catch (BOSException | SQLException | EASBizException e) {
+            e.printStackTrace();
+        }
+        
+    	
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    /**
+     * 反审核后执行
+     */
+    @Override
+    protected void _untiCheckBizBill(Context ctx, String billId) throws BOSException, EASBizException {
+    	super._untiCheckBizBill(ctx, billId);
+    	
+    	IPluralityDelBizBill delIns = PluralityDelBizBillFactory.getLocalInstance(ctx);
+    	PluralityDelBizBillInfo delInfo = delIns.getPluralityDelBizBillInfo(new ObjectUuidPK(billId));
+    	PluralityDelBizBillEntryCollection entrys = delInfo.getEntrys();
+    	for(int i = 0; i < entrys.size(); i++ ) {
+    		PluralityDelBizBillEntryInfo entryInfo = entrys.get(i);
+    		checkAddBill(ctx, entryInfo.getId().toString(), 0);
+    	}
+    }
+    
+    
+    
+    
+    /**
+     * 反审核之后恢复原时间
+     * @param ctx
+     * @param sqlStr
+     */
+    private  void  restoreAddBillEndDate(Context ctx, String sqlStr) {
+        // 创建添加单据条目集合
+        CoreBaseCollection addEnCol = new CoreBaseCollection();
+    	try {
+            // 获取添加单据条目实例
+            IPluralityAddBizBillEntry addEnIns = PluralityAddBizBillEntryFactory.getLocalInstance(ctx);
+            // 执行SQL查询
+            IRowSet rowSet = DbUtil.executeQuery(ctx, sqlStr);
+            // 遍历查询结果
+            while (rowSet.next()) {
+            	// 获取添加单据条目ID
+            	String addEnId = rowSet.getString("addEnId");
+            	// 获取 原兼职单上创建时的日期,第一次写兼职结束时是空的;
+            	Date oldAddEDate = rowSet.getDate("oldAddEDate");
+            	// 获取兼职单据条目信息
+            	PluralityAddBizBillEntryInfo addInfo = addEnIns.getPluralityAddBizBillEntryInfo(new ObjectUuidPK(addEnId));
+            	if ( null != oldAddEDate) {
+            		// 设置更新前的endDate
+                	addInfo.put("endDate", oldAddEDate);
+            	}
+            	addEnCol.add(addInfo);
+            }
+         // 更新添加单据条目集合
+            addEnIns.update(addEnCol);
+        } catch (BOSException | SQLException | EASBizException e) {
+            e.printStackTrace();
+        }
+        
+    	
+    }
+    
+    
+    
+}

+ 97 - 9
GDYSL/src/com/kingdee/eas/hr/affair/app/ResignBizBillControllerBeanEx.java

@@ -3,8 +3,12 @@ package com.kingdee.eas.hr.affair.app;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.dao.IObjectPK;
+import com.kingdee.bos.dao.ormapping.ObjectStringPK;
 import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
 import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.person.IPerson;
 import com.kingdee.eas.basedata.person.PersonFactory;
 import com.kingdee.eas.basedata.person.PersonInfo;
 import com.kingdee.eas.common.EASBizException;
@@ -27,6 +31,7 @@ import java.util.List;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
 
 /**
@@ -81,7 +86,11 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
         for (int i = 0; i < entryCollection.size(); i++) {
         	HRAffairBizBillEntryInfo affairEntry = (HRAffairBizBillEntryInfo)entryCollection.get(i);
            	//兼职终止单; 202503
-        	createPDelFromEntry(ctx, entryCollection.get(i));
+        	ResignBizBillEntryInfo resignBizBillEntryInfo = entryCollection.get(i);
+        	createPDelFromEntry(ctx, resignBizBillEntryInfo);
+        	//更新人员档案上的兼职失效日期
+        	updateJobEndTime(ctx, resignBizBillEntryInfo.getId().toString());
+        	
         	String personId = affairEntry.getPerson().getId().toString();
         	String sql = "/*dialect*/update T_HR_SFixAdjustSalary a set CFHisLeffectDay = FLeffectDay,FLeffectDay = b.FBIZDATE from T_HR_ResignBizBillEntry b where a.FPERSONID = b.FPERSONID and a.FLEFFECTDAY > b.FBIZDATE and a.FPERSONID = '"+personId+"'";
         	logger.error("更新薪酬结构失效日期SQL:"+sql);
@@ -99,6 +108,7 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
     @Override
     protected IObjectPK _submitEffect(Context ctx, CoreBaseInfo model) throws BOSException, EASBizException {
     	IObjectPK objectPk = super._submitEffect(ctx, model);
+    	//邮件发送移动
 //    	ResignBizBillInfo resignBizBillInfo = ResignBizBillFactory.getLocalInstance(ctx).getResignBizBillInfo(objectPk);
 //    	ResignBizBillEntryCollection entrys = resignBizBillInfo.getEntrys();
 //    	try {
@@ -206,6 +216,9 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
         
         //离职反审批后还原薪酬结构失效日期
         for (int i = 0; i < entryCollection.size(); i++) {
+        	//更新人员档案上的兼职失效日期
+        	ResignBizBillEntryInfo resignBizBillEntryInfo = entryCollection.get(i);
+        	reJobEndTime(ctx, resignBizBillEntryInfo.getId() );
         	HRAffairBizBillEntryInfo affairEntry = (HRAffairBizBillEntryInfo)entryCollection.get(i);
         	String personId = affairEntry.getPerson().getId().toString();
         	String sql = "/*dialect*/update T_HR_SFixAdjustSalary set FLeffectDay = CFHisLeffectDay where CFHisLeffectDay is not null "
@@ -218,8 +231,8 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
     
     
     /**
-     * 创建兼职终止单
-     * 202503
+     * 创建兼职终止单等二开内容
+     * 202503  暂未调用; 已有其他方法调用其中总内容
      * @throws BOSException 
      * @throws EASBizException 
      */
@@ -228,13 +241,17 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
     	//人员 , 开始时间, 职位,部门,  兼职时薪
 		ResignBizBillInfo billInfo = ResignBizBillFactory.getLocalInstance(ctx).getResignBizBillInfo(new ObjectUuidPK(billId));
 		ResignBizBillEntryCollection entrys = billInfo.getEntrys();
-		if(entrys.size()>0){
-			ResignBizBillEntryInfo resignBizBillEntryInfo = entrys.get(0);
-			createPDelFromEntry(ctx, resignBizBillEntryInfo);
-		}
-    	
+		//暂未调用;
+//		for(int i = 0 ; i<entrys.size();i++){
+//			ResignBizBillEntryInfo resignBizBillEntryInfo = entrys.get(i);
+//			createPDelFromEntry(ctx, resignBizBillEntryInfo);
+//			BOSUuid id = resignBizBillEntryInfo.getId();
+//			updateJobEndTime(ctx,id.toString()  );
+//		}
     }
     
+    
+    
     /**
      * 根据离职单分录的数据生成兼职单
      * @param ctx
@@ -250,15 +267,86 @@ public class ResignBizBillControllerBeanEx extends ResignBizBillControllerBean{
 		pluralityIns.resignCreateEnd(personId, dateStr);
     }
     
+    
+    
     @Override
     protected void _entryEffectCommon(Context ctx, BOSUuid billId) throws BOSException, EASBizException {
     	super._entryEffectCommon(ctx, billId);
     	
-
 	}
     
     
+    /**
+     * 审核后,更新人员档案上的兼职人员任职结束时间
+     * 全职或兼职 等于 兼职 人员离职时,离职时间更新到员工提报单中的结束时间,如果离职单反审批,员工提报单主职则继续使用人员档案兼职类人员任职结束时间时间;
+     * @param ctx
+     * @param billId
+     * @throws BOSException
+     * @throws EASBizException
+     */
+    private void updateJobEndTime(Context ctx, String billId) throws BOSException, EASBizException {
+    	//全职或兼职 等于 兼职 人员离职时,离职时间更新到员工提报单中的结束时间,如果离职单反审批,员工提报单主职则继续使用人员档案兼职类人员任职结束时间时间;
+    	IResignBizBillEntry reEnIns = ResignBizBillEntryFactory .getLocalInstance(ctx);
+		ResignBizBillEntryInfo enInfo =  reEnIns.getResignBizBillEntryInfo( new ObjectUuidPK(billId.toString()));
+		PersonInfo person = enInfo.getPerson();
+		//离职日期
+		Date bizDate = enInfo.getBizDate();
+		IPerson pIns = PersonFactory.getLocalInstance(ctx);
+	 
+		SelectorItemCollection sic = new SelectorItemCollection();
+		sic.add(new SelectorItemInfo("ftorpt.number"));
+		sic.add(new SelectorItemInfo("ftorpt"));
+		sic.add(new SelectorItemInfo("jobEndTime"));
+		PersonInfo personInfo = pIns.getPersonInfo(new ObjectUuidPK(person.getId().toString()),sic);
+		CoreBaseInfo torpt  = (CoreBaseInfo) personInfo.get("ftorpt");
+		
+		if(null != torpt)  {
+			String torptNum = torpt.getString("number");
+			if(StringUtils.equals(torptNum, "PART")) {
+				Date jobEndTime = personInfo.getDate("jobEndTime");
+				PersonInfo upPerson = pIns.getPersonInfo(new ObjectUuidPK(person.getId().toString()));
+				upPerson.put( "jobEndTime", bizDate) ; 
+				pIns.update(new ObjectStringPK(upPerson.getId().toString()), upPerson) ;
+				enInfo.put("oldJobEndTime", jobEndTime );
+				reEnIns.update(new ObjectStringPK(enInfo.getId().toString()), enInfo) ;
+			}
+		}
+    }
+    
    
+    /**
+     * 反审核后,恢复人员档案上的兼职人员任职结束时间
+     * 全职或兼职 等于 兼职 人员离职时,离职时间更新到员工提报单中的结束时间,如果离职单反审批,员工提报单主职则继续使用人员档案兼职类人员任职结束时间时间;
+     * @param ctx
+     * @param billId
+     * @throws BOSException
+     * @throws EASBizException
+     */
+    private void reJobEndTime(Context ctx, BOSUuid billId) throws BOSException, EASBizException {
+    	//全职或兼职 等于 兼职 人员离职时,离职时间更新到员工提报单中的结束时间,如果离职单反审批,员工提报单主职则继续使用人员档案兼职类人员任职结束时间时间;
+    	IResignBizBillEntry reEnIns = ResignBizBillEntryFactory .getLocalInstance(ctx);
+		ResignBizBillEntryInfo enInfo =  reEnIns.getResignBizBillEntryInfo( new ObjectUuidPK(billId.toString()));
+		PersonInfo person = enInfo.getPerson();
+		//离职日期
+		Date oldETime = enInfo.getDate("oldJobEndTime");
+		IPerson pIns = PersonFactory.getLocalInstance(ctx);
+		SelectorItemCollection sic = new SelectorItemCollection();
+		sic.add(new SelectorItemInfo("ftorpt.number"));
+		sic.add(new SelectorItemInfo("ftorpt"));
+		PersonInfo personInfo = pIns.getPersonInfo(new ObjectUuidPK(person.getId().toString()),sic);
+		CoreBaseInfo torpt  = (CoreBaseInfo) personInfo.get("ftorpt");
+		if( null != torpt ) {
+			String torptNum = torpt.getString("number");
+			if( StringUtils.equals(torptNum, "PART") ) {
+				PersonInfo upPerson = pIns.getPersonInfo(new ObjectUuidPK(person.getId().toString()));
+				if(null!= oldETime) {
+					upPerson.put( "jobEndTime", oldETime) ; 
+					pIns.update(new ObjectStringPK(upPerson.getId().toString()), upPerson) ;
+				}
+			}
+		}
+    }
+    
     
     
 }

+ 135 - 110
GDYSL/src/com/kingdee/shr/compensation/app/RetMoneyFacadeControllerBean.java

@@ -1,10 +1,6 @@
-//
-// Source code recreated from a .class file by IntelliJ IDEA
-// (powered by FernFlower decompiler)
-//
-
 package com.kingdee.shr.compensation.app;
 
+// 导入必要的类
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.eas.common.EASBizException;
@@ -23,53 +19,64 @@ import java.util.HashSet;
 import org.apache.log4j.Logger;
 
 public class RetMoneyFacadeControllerBean extends AbstractRetMoneyFacadeControllerBean {
+    // 定义日志记录器
     private static Logger logger = Logger.getLogger("com.kingdee.shr.compensation.app.RetMoneyFacadeControllerBean");
 
+    // 构造函数
     public RetMoneyFacadeControllerBean() {
     }
 
+    // 重写父类的_retMoney方法,用于回溯薪资
     protected void _retMoney(Context ctx) throws BOSException, EASBizException {
+        // 定义SQL查询语句,用于获取符合条件的薪资调整记录
         String sql = "/*dialect*/ SELECT FMONEY ,FID ,FPERSONID ,FCMPITEMID,FEFFECTDAY ,FLEFFECTDAY,CFTraceability,CFRetroactiveDate,foldfixadjustsalaryid   FROM T_HR_SFixAdjustSalary where  sysdate between   FEFFECTDAY  and FLEFFECTDAY and CFTraceability='Yes'   and (CFIsRet is null or CFIsRet=0)";
-        HashSet list = new HashSet();
-        logger.error("sql" + sql);
-        IRowSet rs = DbUtil.executeQuery(ctx, sql);
+        HashSet<String> list = new HashSet<>(); // 用于存储处理过的薪资调整记录ID
+        logger.error("sql" + sql); // 记录SQL查询语句到日志中
+        IRowSet rs = DbUtil.executeQuery(ctx, sql); // 执行SQL查询,获取结果集
 
         try {
             BigDecimal money;
-            for(; rs.next(); logger.error("end mainid ==============" + money)) {
-                BigDecimal sumMoney = BigDecimal.ZERO;
-                money = rs.getBigDecimal("FMONEY");
-                logger.error("statrt mainid ==============" + money);
-                Date cfretroactivedate = rs.getDate("cfretroactivedate");
-                logger.error("cfretroactivedate " + DateTimeUtils.format(cfretroactivedate));
-                String personid = rs.getString("FPERSONID");
-                logger.error("personid " + personid);
-                String cmpitemid = rs.getString("FCMPITEMID");
-                Date mainEffectday = rs.getDate("FEFFECTDAY");
-                Date mainLeffectday = rs.getDate("FLEFFECTDAY");
-                String mainleftdayYearMonth = DateTimeUtils.format(mainEffectday, "yyyy-MM");
-                logger.error("mainleftdayYearMonth " + mainleftdayYearMonth);
-                String oldfixadjustsalaryid = rs.getString("foldfixadjustsalaryid");
-                String id = rs.getString("fid");
+            // 遍历结果集中的每一行记录
+            for (; rs.next(); logger.error("end mainid ==============" + money)) {
+                BigDecimal sumMoney = BigDecimal.ZERO; // 初始化回溯薪资总额为0
+                money = rs.getBigDecimal("FMONEY"); // 获取当前记录的薪资调整金额
+                logger.error("statrt mainid ==============" + money); // 记录当前薪资调整金额到日志中
+                Date cfretroactivedate = rs.getDate("cfretroactivedate"); // 获取回溯日期
+                logger.error("cfretroactivedate " + DateTimeUtils.format(cfretroactivedate)); // 记录回溯日期到日志中
+                String personid = rs.getString("FPERSONID"); // 获取员工ID
+                logger.error("personid " + personid); // 记录员工ID到日志中
+                String cmpitemid = rs.getString("FCMPITEMID"); // 获取薪资调整项目ID
+                Date mainEffectday = rs.getDate("FEFFECTDAY"); // 获取薪资调整生效日期
+                Date mainLeffectday = rs.getDate("FLEFFECTDAY"); // 获取薪资调整失效日期
+                String mainleftdayYearMonth = DateTimeUtils.format(mainEffectday, "yyyy-MM"); // 格式化生效日期为“年-月”
+                logger.error("mainleftdayYearMonth " + mainleftdayYearMonth); // 记录生效日期的“年-月”到日志中
+                String oldfixadjustsalaryid = rs.getString("foldfixadjustsalaryid"); // 获取旧的薪资调整ID
+                String id = rs.getString("fid"); // 获取当前薪资调整记录ID
+                list.add(id); // 将当前记录ID添加到处理过的记录ID集合中
+
+                // 定义子查询SQL语句,用于获取特定员工的薪资调整历史记录
                 String detialSql = "/*dialect*/ select FEFFECTDAY ,FLEFFECTDAY,FMONEY,fid from T_HR_SFixAdjustSalary where FCMPITEMID='" + cmpitemid + "' " + " and fid ='" + oldfixadjustsalaryid + "' and  FPERSONID='" + personid + "' " + "   and (CFIsRet is null or CFIsRet=0) order by FEFFECTDAY asc ";
-                logger.error("detial sql " + detialSql);
-                list.add(id);
-                IRowSet dettaiRs = DbUtil.executeQuery(ctx, detialSql);
-                logger.error("cfretroactivedate " + cfretroactivedate);
-                String detialid;
+                logger.error("detial sql " + detialSql); // 记录子查询SQL语句到日志中
+                IRowSet dettaiRs = DbUtil.executeQuery(ctx, detialSql); // 执行子查询,获取结果集
+
+                // 如果子查询结果集不为空且包含记录
                 if (dettaiRs != null && dettaiRs.size() > 0) {
-                    while(dettaiRs.next()) {
-                        detialid = dettaiRs.getString("fid");
-                        logger.error("start detialid================================= " + dettaiRs.getString("fid"));
-                        BigDecimal detailMony = dettaiRs.getBigDecimal("FMONEY");
-                        logger.error("dettaiRs:retMoney " + detailMony);
-                        BigDecimal retMoney = money.subtract(dettaiRs.getBigDecimal("FMONEY"));
-                        logger.error("retMoney " + retMoney);
-                        Date effectday = dettaiRs.getDate("FEFFECTDAY");
-                        Date leffectday = dettaiRs.getDate("FLEFFECTDAY");
-                        logger.error("detial_effectday " + DateTimeUtils.format(effectday));
-                        logger.error("detial_leffectday " + DateTimeUtils.format(leffectday));
-                        logger.error("detial_leffectday_before " + cfretroactivedate.before(effectday));
+                    String detialid;
+                    // 遍历子查询结果集中的每一行记录
+                    while (dettaiRs.next()) {
+                        detialid = dettaiRs.getString("fid"); // 获取子查询记录的ID
+                        logger.error("start detialid================================= " + dettaiRs.getString("fid")); // 记录子查询记录的ID到日志中
+                        BigDecimal detailMony = dettaiRs.getBigDecimal("FMONEY"); // 获取子查询记录的薪资调整金额 10000
+                        logger.error("dettaiRs:retMoney " + detailMony); // 记录子查询记录的薪资调整金额到日志中
+                        BigDecimal retMoney = money.subtract(detailMony); // 计算回溯薪资
+                        logger.error("retMoney " + retMoney); // 记录回溯薪资到日志中 2000
+                        Date effectday = dettaiRs.getDate("FEFFECTDAY"); // 获取子查询记录的生效日期
+                        Date leffectday = dettaiRs.getDate("FLEFFECTDAY"); // 获取子查询记录的失效日期
+                        logger.error("detial_effectday " + DateTimeUtils.format(effectday)); // 记录子查询记录的生效日期到日志中
+                        logger.error("detial_leffectday " + DateTimeUtils.format(leffectday)); // 记录子查询记录的失效日期到日志中
+                        logger.error("detial_leffectday_before " + cfretroactivedate.before(effectday)); // 记录回溯日期是否在生效日期之前
+
+                        // 初始化变量
                         HashSet<String> monthSet = null;
                         int months = 0;
                         String beginYearMonth;
@@ -80,112 +87,126 @@ public class RetMoneyFacadeControllerBean extends AbstractRetMoneyFacadeControll
                         BigDecimal arrMoney;
                         long cntdays;
 
+                        // 如果回溯日期在生效日期之前
                         if (cfretroactivedate.before(effectday)) {
-                            beginYearMonth = DateTimeUtils.format(effectday, "yyyy-MM");
-                            logger.error("beginYearMonth" + beginYearMonth);
-                            endYearMonth = DateTimeUtils.format(leffectday, "yyyy-MM");
-                            logger.error("endYearMonth" + endYearMonth);
-                            monthSet = getMonthBetweenDate(effectday, leffectday);
-                            logger.error("monthSet" + monthSet);
-                            months = this.getAllMonth(effectday, leffectday);
-                            logger.error("detial_months " + months);
-                            detiailbeginday = DateTimeUtils.getDay(effectday);
-                            logger.error("detiailbeginday " + detiailbeginday);
-                            lastDate = this.getlengthOfMonth(effectday);
-                            if (detiailbeginday != 1) {
-                                days = DateTimeUtils.getDay(lastDate);
-                                logger.error("detial_all_days " + days);
-                                arrMoney = retMoney.divide(new BigDecimal(days), 5).setScale(2);
-                                logger.error("detial_arrMoney " + arrMoney);
-                                cntdays = this.getDaysBetweenDates(effectday, (Date)(lastDate.after(leffectday) ? leffectday : lastDate)) + 1L;
-                                logger.error("detial_cntdays " + cntdays);
-                                sumMoney = sumMoney.add(arrMoney.multiply(new BigDecimal(cntdays)));
-                                logger.error("detial_sumMoney " + sumMoney);
-                                monthSet.remove(beginYearMonth);
+                            beginYearMonth = DateTimeUtils.format(effectday, "yyyy-MM"); // 格式化生效日期为“年-月”
+                            logger.error("beginYearMonth" + beginYearMonth); // 记录生效日期的“年-月”到日志中
+                            endYearMonth = DateTimeUtils.format(leffectday, "yyyy-MM"); // 格式化失效日期为“年-月”
+                            logger.error("endYearMonth" + endYearMonth); // 记录失效日期的“年-月”到日志中
+                            monthSet = getMonthBetweenDate(effectday, leffectday); // 获取生效日期和失效日期之间的月份集合
+                            logger.error("monthSet" + monthSet); // 记录月份集合到日志中
+                            months = this.getAllMonth(effectday, leffectday); // 计算生效日期和失效日期之间的月份数
+                            logger.error("detial_months " + months); // 记录月份数到日志中
+                            detiailbeginday = DateTimeUtils.getDay(effectday); // 获取生效日期的天数
+                            logger.error("detiailbeginday " + detiailbeginday); // 记录生效日期的天数到日志中
+                            lastDate = this.getlengthOfMonth(effectday); // 获取生效日期所在月份的最后一天
+                            if (detiailbeginday != 1) { // 如果生效日期不是该月的第一天
+                                days = DateTimeUtils.getDay(lastDate); // 获取最后一天的天数
+                                logger.error("detial_all_days " + days); // 记录最后一天的天数到日志中
+                                arrMoney = retMoney.divide(new BigDecimal(days), 5).setScale(2); // 计算回溯薪资的平均分配金额
+                                logger.error("detial_arrMoney " + arrMoney); // 记录平均分配金额到日志中
+                                cntdays = this.getDaysBetweenDates(effectday, (Date) (lastDate.after(leffectday) ? leffectday : lastDate)) + 1L; // 计算回溯日期到最后一天的天数
+                                logger.error("detial_cntdays " + cntdays); // 记录天数到日志中
+                                sumMoney = sumMoney.add(arrMoney.multiply(new BigDecimal(cntdays))); // 计算回溯薪资总额
+                                logger.error("detial_sumMoney " + sumMoney); // 记录回溯薪资总额到日志中
+                                monthSet.remove(beginYearMonth); // 移除生效日期的“年-月”月份
                             }
 
+                            // 如果生效日期所在月份等于失效日期所在月份
                             if (mainleftdayYearMonth.equals(endYearMonth)) {
-                                monthSet.remove(endYearMonth);
+                                monthSet.remove(endYearMonth); // 移除失效日期的“年-月”月份
                             }
                         } else {
-                            months = this.getAllMonth(cfretroactivedate, leffectday);
-                            beginYearMonth = DateTimeUtils.format(cfretroactivedate, "yyyy-MM");
-                            logger.error("beginYearMonth" + beginYearMonth);
-                            endYearMonth = DateTimeUtils.format(leffectday, "yyyy-MM");
-                            logger.error("endYearMonth" + endYearMonth);
-                            monthSet = getMonthBetweenDate(cfretroactivedate, leffectday);
-                            logger.error("monthSet" + monthSet);
-                            logger.error("detial_months " + months);
-                            detiailbeginday = DateTimeUtils.getDay(cfretroactivedate);
-                            logger.error("detiailbeginday " + detiailbeginday);
-                            lastDate = this.getlengthOfMonth(cfretroactivedate);
-                            if (detiailbeginday != 1) {
-                                days = DateTimeUtils.getDay(lastDate);
-                                logger.error("detial_all_days " + days);
-                                arrMoney = retMoney.divide(new BigDecimal(days), 5).setScale(2);
-                                logger.error("arrMoney " + arrMoney);
-                                cntdays = this.getDaysBetweenDates(cfretroactivedate, (Date)(lastDate.after(leffectday) ? leffectday : lastDate)) + 1L;
-                                logger.error("detial_cntdays " + cntdays);
-                                sumMoney = sumMoney.add(arrMoney.multiply(new BigDecimal(cntdays)));
-                                logger.error("detial_sumMoney " + sumMoney);
-                                monthSet.remove(endYearMonth);
+                            // 如果回溯日期不在生效日期之前
+                            months = this.getAllMonth(cfretroactivedate, leffectday); // 计算回溯日期和失效日期之间的月份数
+                            beginYearMonth = DateTimeUtils.format(cfretroactivedate, "yyyy-MM"); // 格式化回溯日期为“年-月”
+                            logger.error("beginYearMonth" + beginYearMonth); // 记录回溯日期的“年-月”到日志中
+                            endYearMonth = DateTimeUtils.format(leffectday, "yyyy-MM"); // 格式化失效日期为“年-月”
+                            logger.error("endYearMonth" + endYearMonth); // 记录失效日期的“年-月”到日志中
+                            monthSet = getMonthBetweenDate(cfretroactivedate, leffectday); // 获取回溯日期和失效日期之间的月份集合
+                            logger.error("monthSet" + monthSet); // 记录月份集合到日志中
+                            logger.error("detial_months " + months); // 记录月份数到日志中
+                            detiailbeginday = DateTimeUtils.getDay(cfretroactivedate); // 获取回溯日期的天数
+                            logger.error("detiailbeginday " + detiailbeginday); // 记录回溯日期的天数到日志中
+                            lastDate = this.getlengthOfMonth(cfretroactivedate); // 获取回溯日期所在月份的最后一天
+                            if (detiailbeginday != 1) { // 如果回溯日期不是该月的第一天
+                                days = DateTimeUtils.getDay(lastDate); // 获取最后一天的天数
+                                logger.error("detial_all_days " + days); // 记录最后一天的天数到日志中
+                                arrMoney = retMoney.divide(new BigDecimal(days), BigDecimal.ROUND_HALF_DOWN).setScale(2); // 计算回溯薪资的平均分配金额
+                                logger.error("arrMoney " + arrMoney); // 记录平均分配金额到日志中
+                                cntdays = this.getDaysBetweenDates(cfretroactivedate, (Date) (lastDate.after(leffectday) ? leffectday : lastDate)) + 1L; // 计算回溯日期到最后一天的天数
+                                logger.error("detial_cntdays " + cntdays); // 记录天数到日志中
+                                sumMoney = sumMoney.add(arrMoney.multiply(new BigDecimal(cntdays))); // 计算回溯薪资总额
+                                logger.error("detial_sumMoney " + sumMoney); // 记录回溯薪资总额到日志中
+                                monthSet.remove(endYearMonth); // 移除失效日期的“年-月”月份
                             }
 
+                            // 如果回溯日期所在月份等于失效日期所在月份
                             if (mainleftdayYearMonth.equals(endYearMonth)) {
-                                monthSet.remove(endYearMonth);
+                                monthSet.remove(endYearMonth); // 移除失效日期的“年-月”月份
                             }
                         }
 
-                        logger.error("monthSet ret " + monthSet);
+                        logger.error("monthSet ret " + monthSet); // 记录剩余月份集合到日志中
+                        // 如果剩余月份集合不为空
                         if (monthSet.size() > 0) {
-                            sumMoney = sumMoney.add(retMoney.multiply(new BigDecimal(monthSet.size())));
+                            sumMoney = sumMoney.add(retMoney.multiply(new BigDecimal(monthSet.size()))); // 计算回溯薪资总额
                         }
 
-                        logger.error("sumMoney " + sumMoney);
-                        list.add(detialid);
-                        logger.error("end detialid================================= " + dettaiRs.getString("fid"));
+                        logger.error("sumMoney " + sumMoney); // 记录回溯薪资总额到日志中
+                        list.add(detialid); // 将子查询记录的ID添加到处理过的记录ID集合中
+                        logger.error("end detialid================================= " + dettaiRs.getString("fid")); // 记录子查询记录的ID到日志中
                     }
                 } else {
-                    logger.error("没有调薪历史都是0");
-                    sumMoney = BigDecimal.ZERO;
+                    logger.error("没有调薪历史都是0"); // 记录没有调薪历史的情况
+                    sumMoney = BigDecimal.ZERO; // 设置回溯薪资总额为0
                 }
 
-                detialid = "select * from CT_CUS_PersonPayForm where CFPersonID ='" + personid + "' and CFAdjustSalary='" + id + "' ";
-                logger.error("exiSql sql " + detialid);
-                IRowSet extRs = DbUtil.executeQuery(ctx, detialid);
+                // 定义SQL语句,用于检查是否存在特定的员工薪资支付表记录
+                String exiSql = "select * from CT_CUS_PersonPayForm where CFPersonID ='" + personid + "' and CFAdjustSalary='" + id + "' ";
+                logger.error("exiSql sql " + exiSql); // 记录SQL语句到日志中
+                IRowSet extRs = DbUtil.executeQuery(ctx, exiSql); // 执行SQL查询,获取结果集
+
                 String insertSql;
+                // 如果结果集不为空且包含记录
                 if (extRs != null && extRs.size() > 0) {
+                    // 定义SQL语句,用于更新员工薪资支付表中的回溯薪资
                     insertSql = "update  CT_CUS_PersonPayForm set CFRetMoney=" + sumMoney.setScale(2, 5) + " where  CFAdjustSalary='" + id + "' ";
-                    logger.error("updateSql " + insertSql);
-                    DbUtil.execute(ctx, insertSql);
+                    logger.error("updateSql " + insertSql); // 记录SQL语句到日志中
+                    DbUtil.execute(ctx, insertSql); // 执行SQL更新操作
                 } else {
+                    // 如果结果集为空或不包含记录
+                    // 定义SQL语句,用于向员工薪资支付表中插入新的回溯薪资记录
                     insertSql = " /*dialect*/ insert into CT_CUS_PersonPayForm(fid,CFPersonID,CFMonth,CFRetMoney,cfadjustsalary) values(newbosid('5FB9A7AC'),'" + personid + "',to_date('" + DateTimeUtils.format(mainEffectday) + "','yyyy-MM-dd')" + "," + sumMoney.setScale(2, 5) + ",'" + id + "')";
-                    logger.error("insertSql " + insertSql);
-                    DbUtil.execute(ctx, insertSql);
+                    logger.error("insertSql " + insertSql); // 记录SQL语句到日志中
+                    DbUtil.execute(ctx, insertSql); // 执行SQL插入操作
                 }
             }
 
-            String idStr = CmpStrUtil.convertListToString(list.toArray());
-            logger.error("insqlInstance idStr " + CmpStrUtil.convertListToString(list.toArray()));
+            String idStr = CmpStrUtil.convertListToString(list.toArray()); // 将处理过的记录ID集合转换为字符串
+            logger.error("insqlInstance idStr " + CmpStrUtil.convertListToString(list.toArray())); // 记录处理过的记录ID字符串到日志中
+            // 定义SQL语句,用于更新薪资调整表中的回溯标记
             String updateAdjustSalarySql = "update T_HR_SFixAdjustSalary set cfisret=1 where fid in ( " + idStr + ") ";
-            logger.error("updateAdjustSalarySql" + updateAdjustSalarySql);
-            DbUtil.execute(ctx, updateAdjustSalarySql);
+            logger.error("updateAdjustSalarySql" + updateAdjustSalarySql); // 记录SQL语句到日志中
+            DbUtil.execute(ctx, updateAdjustSalarySql); // 执行SQL更新操作
         } catch (SQLException var32) {
-            var32.printStackTrace();
-            throw new BOSException("回算出错");
+            var32.printStackTrace(); // 打印SQL异常堆栈信息
+            throw new BOSException("回算出错"); // 抛出自定义的BOSException异常
         } catch (ParseException var33) {
-            var33.printStackTrace();
-            throw new BOSException("回算出错");
+            var33.printStackTrace(); // 打印日期解析异常堆栈信息
+            throw new BOSException("回算出错"); // 抛出自定义的BOSException异常
         }
     }
 
+    // 获取特定年份和月份的天数
     public int getALlDays(int year, int month) {
         Calendar calendar = Calendar.getInstance();
         calendar.set(year, month, 1);
-        int daysInMonth = calendar.getActualMaximum(5);
+        int daysInMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
         return daysInMonth;
     }
 
+    // 计算两个日期之间的月份数
     public int getAllMonth(Date beginDate, Date endDate) {
         LocalDate startDatetmp = LocalDate.of(DateTimeUtils.getYear(beginDate), DateTimeUtils.getMonth(beginDate), DateTimeUtils.getDay(beginDate));
         LocalDate endDatetmp = LocalDate.of(DateTimeUtils.getYear(endDate), DateTimeUtils.getMonth(endDate), DateTimeUtils.getDay(endDate));
@@ -198,6 +219,7 @@ public class RetMoneyFacadeControllerBean extends AbstractRetMoneyFacadeControll
         return months;
     }
 
+    // 获取特定日期所在月份的最后一天
     public Date getlengthOfMonth(Date date) throws ParseException {
         logger.error("getlengthOfMonth—date" + date);
         LocalDate currentDate = LocalDate.of(DateTimeUtils.getYear(date), DateTimeUtils.getMonth(date), DateTimeUtils.getDay(date));
@@ -209,6 +231,7 @@ public class RetMoneyFacadeControllerBean extends AbstractRetMoneyFacadeControll
         return DateTimeUtils.parseDate(tempDate);
     }
 
+    // 计算两个日期之间的天数
     public long getDaysBetweenDates(Date start, Date end) {
         Calendar cal = Calendar.getInstance();
         cal.setTime(start);
@@ -219,14 +242,16 @@ public class RetMoneyFacadeControllerBean extends AbstractRetMoneyFacadeControll
         return diff / 86400000L;
     }
 
+    // 获取两个日期之间的月份集合
     public static HashSet<String> getMonthBetweenDate(Date startTime, Date endTime) {
-        HashSet<String> list = new HashSet();
+        HashSet<String> list = new HashSet<>();
 
-        for(Calendar calendar = Calendar.getInstance(); startTime.getTime() <= endTime.getTime(); startTime = calendar.getTime()) {
+        // 遍历两个日期之间的月份
+        for (Calendar calendar = Calendar.getInstance(); startTime.getTime() <= endTime.getTime(); startTime = calendar.getTime()) {
             logger.error("getMonthBetweenDate—tempDate" + DateTimeUtils.format(startTime, "yyyy-MM"));
             list.add(DateTimeUtils.format(startTime, "yyyy-MM"));
             calendar.setTime(startTime);
-            calendar.add(2, 1);
+            calendar.add(Calendar.MONTH, 1);
         }
 
         return list;