فهرست منبع

提交bug修改

9060 2 ماه پیش
والد
کامیت
f3ce94a372
17فایلهای تغییر یافته به همراه2624 افزوده شده و 1365 حذف شده
  1. 52 7
      js/addon/customer/compensationjzt/CmpCalDynamicListExExEx.js
  2. 4 2
      js/addon/customer/compensationjzt/IncomeTaxDeclareListEx.js
  3. 43 2
      js/addon/customer/compensationjzt/InterInitDynamicListEx.js
  4. 36 23
      js/addon/customer/compensationjzt/TaxPersonRecordListEx.js
  5. 7 4
      src/com/kingdee/eas/custom/shuiyou/incomeTax/TaxPersonReportExFacadeControllerBean.java
  6. 36 17
      src/com/kingdee/eas/custom/shuiyou/taxCal/TaxCalFacadeControllerBean.java
  7. 296 205
      websrc/com/kingdee/eas/custom/compensation/handler/CmpCalDynamicListHandlerExExEx.java
  8. 853 166
      websrc/com/kingdee/eas/custom/compensation/handler/IncomeTaxDeclareListHandlerEx.java
  9. 110 97
      websrc/com/kingdee/eas/custom/compensation/service/SynIncomeTaxDeclareService.java
  10. 1 1
      websrc/com/kingdee/eas/custom/individualback/TaxPersonRecordListHandlerExEx.java
  11. 1 1
      websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxDirectDeductionListHandlerEx.java
  12. 276 243
      websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxPersonRecordListHandlerEx.java
  13. 2 1
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadFeedback.java
  14. 2 1
      websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetQuerySpecialAmountFeedback.java
  15. 305 19
      websrc/com/kingdee/eas/custom/shuiyou/taxCal/inter/InterInitDynamicListHandlerEx.java
  16. 290 290
      websrc/com/kingdee/eas/custom/shuiyou/taxCal/service/GetASynIndividualIncomeTaxFeedback.java
  17. 310 286
      websrc/com/kingdee/eas/custom/shuiyou/taxCal/service/SubmitAsynTaxCalRequestService.java

+ 52 - 7
js/addon/customer/compensationjzt/CmpCalDynamicListExExEx.js

@@ -1,24 +1,69 @@
-shr.defineClass("shr.compensation.CmpCalDynamicListEx", shr.compensation.CmpCalDynamicList, {
+shr.defineClass("shr.compensation.CmpCalDynamicListExExEx", shr.compensation.CmpCalDynamicListExEx, {
 
     initalizeDOM: function () {
         var _self = this;
-        shr.compensation.CmpCalDynamicListEx.superClass.initalizeDOM.call(_self);
+        shr.compensation.CmpCalDynamicListExExEx.superClass.initalizeDOM.call(_self);
     },
-    /**
-     * 同步人员纳税信息
+       /**
+     * 个税反算同步
      */
-    synTaxPersonRecordAction(){
+	   taxPaymentBackSynAction(){
         var _self = this;
-        //_self.cmpschemeid 获取计算规则ID
+        // _self.cmpschemeid 获取计算规则ID
+        $.block.show({
+            text: '正在同步,请勿操作!',
+            })
         _self.remoteCall({
-            method: 'synTaxPersonRecord',
+            method: 'taxPaymentBackSyn',
             param: {
                 cmpschemeid:_self.cmpschemeid
             },
             async: false,
             success: function (data) {
                 console.log(data);
+                if(data){
+                    $.block.hide()
+                    shr.showInfo({
+                        message: data.msg
+                        , hideAfter: 2
+                    });
+                }
             }, error: function (response) {
+                $.block.hide()
+                shr.showError({
+                    message: response.summary
+                    , hideAfter: 2
+                });
+            }
+        });
+    }
+    ,
+	   /**
+     * 个税反算
+     */
+	   taxPaymentBackCalculateAction(){
+        var _self = this;
+        // _self.cmpschemeid 获取计算规则ID
+        $.block.show({
+            text: '正在同步,请勿操作!',
+            })
+        _self.remoteCall({
+            method: 'taxPaymentBackCalculate',
+            param: {
+                cmpschemeid:_self.cmpschemeid
+            },
+            async: false,
+            success: function (data) {
+                console.log(data);
+                if(data){
+                    $.block.hide()
+                    shr.showInfo({
+                        message: data.msg
+                        , hideAfter: 2
+                    });
+                }
+            }, error: function (response) {
+                $.block.hide()
                 shr.showError({
                     message: response.summary
                     , hideAfter: 2

+ 4 - 2
js/addon/customer/compensationjzt/IncomeTaxDeclareListEx.js

@@ -218,8 +218,9 @@ shr.defineClass("shr.compensation.IncomeTaxDeclareListEx", shr.compensation.Inco
                 shr.urlLocate(shr.getContextPath() + "/dynamic.do", param);
                 shr.showWarning({
                     message: "已提交金税系统更正申报"
-					_self.reloadGrid();
+
                 });
+				_self.queryGrid();
             };
 
             if (_self.isNeedExportFilePassword('#updateDeclare')) {
@@ -279,8 +280,9 @@ shr.defineClass("shr.compensation.IncomeTaxDeclareListEx", shr.compensation.Inco
                 success: function (res) {
                     shr.showWarning({
                         message: "已提交金税系统撤销更正"
-						_self.reloadGrid();
+
                     });
+					_self.queryGrid();
                 }
             });
         }

+ 43 - 2
js/addon/customer/compensationjzt/InterInitDynamicListEx.js

@@ -81,6 +81,47 @@ shr.defineClass("shr.compensation.InterInitDynamicListEx", shr.compensation.Inte
         });
     },
 
-
-
+deleteTaxDataAction: function () {
+        var _self = this;
+        var billIds = this.getSelectedIds("initdetail.id");
+        if (!billIds) {
+            shr.showWarning({
+                message: '请先选中表格中的数据',
+                hideAfter: "5"
+            });
+            return;
+        } else if (!_self.hasTaxImp) {
+            shr.showError({
+                message: '操作失败,需开通云服务后才能使用,请系统管理员前往【系统设置-云服务设置-云服务注册及连接】进行注册。'
+            });
+            return;
+        } else {
+            _self.remoteCall({
+                method: "checkTaxConfigData",
+                param: {
+                    selectedData: billIds,
+                    fieldName_key: "initdetail.id"
+                },
+                success: function (data) {
+                    var message;
+                    if (data) {
+                        message = '以下员工已接口算税,删除后确认数据也将同步删除,确认要删除吗?' + data;
+                    } else {
+                        message = '您是否要删除初算数据?删除后不可恢复,请确认。';
+                    }
+                    shr.showConfirm(message, function () {
+                        _self.doDeleteInitData(billIds);
+                    });
+                }
+            });
+        }
+    },
+  doDeleteInitData: function (billIds) {
+        var _self = this;
+        _self.doRemoteWithBatchAction({
+            method: "deleteInitData",
+            selectedData: billIds,
+            fieldName_key: "initdetail.id"
+        });
+    }
 });

+ 36 - 23
js/addon/customer/compensationjzt/TaxPersonRecordListEx.js

@@ -3,6 +3,32 @@ shr.defineClass("shr.compensation.TaxPersonRecordListEx", shr.compensation.TaxPe
 		shr.compensation.TaxPersonRecordListEx.superClass.initalizeDOM.call(this);
 		var _self = this;
 	},
+	getTaxPeriodDialog: function() {
+		var line = jsBizMultLan.com_taxPersonRecordList_27286400_i18n_22;//'选择报送月份';
+		var msg1 = jsBizMultLan.com_taxPersonRecordList_27286400_i18n_23;//'说明:';
+		var msg2 = jsBizMultLan.com_taxPersonRecordList_27286400_i18n_24;//'1、	当月新增人员,或任职受雇从业信息有变更的人员需要进行人员报送;';
+		var msg3 = jsBizMultLan.com_taxPersonRecordList_27286400_i18n_25;//'2、	已报送成功的人员在发起下一次人员报送任务之前,始终有效,无需每月都报送。';
+		var html = ['<div id="taxPeriodDialog" style="padding:5px;">',
+			'<div class="photoState" style="margin-left:0px;">',
+			'<table width="100%">',
+			'<tr>',
+			'<td width="20%"><h6>' + line + '</h6></td>' ,
+			'<td width="40%">',
+			'<input type="text" id="taxPeriodDate" name="taxPeriodDate" class="input-height" style=""/>',
+			'</td>',
+			'<td width="40%"></td>',
+			'</tr>',
+			'</table>',
+			'<div style="color:#428bca;width:auto;height:auto;">' +
+			'<p>'+msg1+'</p>' +
+			'<p>'+msg2+'</p>' +
+			'<p>'+msg3+'</p>' +
+			'<p>3、报送月份与报税周期保持一致,例:3月工资在4月发放,则报送月份选择4月</p>',
+			'</div>',
+			'</div>',
+			'</div>'].join('');
+		return html;
+	},
 	/**
      * 同步人员纳税信息
      */
@@ -29,6 +55,9 @@ shr.defineClass("shr.compensation.TaxPersonRecordListEx", shr.compensation.TaxPe
 				        	'</div>',
 				        '</div>',
 		        	'</div>',
+					'<div style="color:red;width:auto;height:auto;">' +
+					'<p>所属年月说明:为当月算薪期间</p>',
+					'</div>',
 		        '</div>'];
 		var saveSettingButton = _self.getSaveSettingButton();
 		buttons.push(saveSettingButton);
@@ -69,24 +98,24 @@ shr.defineClass("shr.compensation.TaxPersonRecordListEx", shr.compensation.TaxPe
     			},
     	};
         $("#taxUnitF7").shrPromptBox(grid_f7_json);
-		$("#yearMonthData").shrDateTimePicker("disable")
+		// $("#yearMonthData").shrDateTimePicker("disable")
         shr.callHandler({
 		    handler: "com.kingdee.shr.compensation.web.handler.tax.TaxDeclareTaxUnitF7Handler",
 			action : "getPersonAllPermTaxUnit",
 			async: false,
 			param : {
 			},
-			error:function(ret){		
+			error:function(ret){
 				var message = ret.responseText;
 				shr.showWarning({
 					message : message,
                     hideAfter : 5
-				});			
+				});
 				return;
 			},
 			success : function(res){
-				// console.log(res);
-				$("#taxUnitF7").shrPromptBox("setValue",res);
+				console.log(res);
+				// $("#taxUnitF7").shrPromptBox("setValue",res);
 			}
 		});
         // _self.remoteCall({
@@ -113,7 +142,7 @@ shr.defineClass("shr.compensation.TaxPersonRecordListEx", shr.compensation.TaxPe
 				var selectedTaxUnits = $('#taxUnitF7').shrPromptBox("getValue");
 				var yearMonth =$('#yearMonthData').shrDateTimePicker("getValue");
 				if(!selectedTaxUnits||selectedTaxUnits.length==0){
-					shr.showError({message : '纳税单位不能为空',hideAfter : 5});	
+					shr.showError({message : '纳税单位不能为空',hideAfter : 5});
 					return;
 				}
 				if(!yearMonth||yearMonth==""){
@@ -151,25 +180,9 @@ shr.defineClass("shr.compensation.TaxPersonRecordListEx", shr.compensation.TaxPe
                         });
                     }
                 });
-			}	
+			}
 		}
 		return saveSettingButton;
 	},
-	
-	
-	
-	//任务监控
-	taskMonitorAction: function(){
-		var self = this;
-		var urlParam = {
-				//uipk : "com.kingdee.shr.compensation.app.taxCal.TaxCalTask.list",
-				uipk: "com.kingdee.eas.custom.shuiyou.task.app.Task.list",
-				catalog: "PERSON"
-			};
-		self.reloadPage(urlParam);
-	},
-	
-	
-	
     
 });

+ 7 - 4
src/com/kingdee/eas/custom/shuiyou/incomeTax/TaxPersonReportExFacadeControllerBean.java

@@ -350,15 +350,18 @@ public class TaxPersonReportExFacadeControllerBean extends AbstractTaxPersonRepo
                         }
                         person.put("xl",null);
                         person.put("skssq", sdyf);
+                        person.remove("sfkcjcfy");
+                        person.remove("khyh_sheng");
+                        person.put("rybscl", "否");//开户银行省份(名字)
+                        rylb.add(person);
+                        if(null!=rInfo){
+                            break;
+                        }
                         Optional<IsOverseaEnum> oversea = Optional.ofNullable(rInfo.getIsOversea());
                         person.put("rydq", "0".equals(oversea.orElse(IsOverseaEnum.NotOversea).getValue()) ? "境内" : "境外");
                         person.put("grgbbl", rInfo.getInvestmentRate());//个人投资总额
                         person.put("grgbze", rInfo.getInvestmentTotal());//个人投资比例
                         person.put("khyhsfmz", rInfo.getBankCardProvince());//开户银行省份(名字)
-                        person.put("rybscl", "否");//开户银行省份(名字)
-                        person.remove("sfkcjcfy");
-                        person.remove("khyh_sheng");
-                        rylb.add(person);
                     }
                     postBody.put("rylb", rylb);
                     String ip = propt.get("ip");

+ 36 - 17
src/com/kingdee/eas/custom/shuiyou/taxCal/TaxCalFacadeControllerBean.java

@@ -139,16 +139,34 @@ public class TaxCalFacadeControllerBean extends AbstractTaxCalFacadeControllerBe
         this.taskMap = new HashMap();
         //个税应用+税款计算初算明细表
         //任职受雇从业信息分录
-        String str = " SELECT t.fTaxUnitId," +
+//        String str = " SELECT t.fTaxUnitId," +
+//                " t.fPeriodBegin, " +
+//                " t.fIncomeItemId, " +
+//                " e.FAcceptId, " +
+//                " e.fid entryId," +
+//                " e.FSubmitStatus, " +
+//                " t.fid initId " +
+//                " from T_HR_STaxCalInitDetail t " +
+//                " left join T_HR_STaxPersonRecordEntry e  on t.fPersonId = e.fPersonId and t.fTaxUnitId = e.fTaxUnitId " +
+//                " where t.fid IN (" + initIds + ")";
+        String str = " SELECT t.fTaxUnitId, " +
                 " t.fPeriodBegin, " +
                 " t.fIncomeItemId, " +
                 " e.FAcceptId, " +
-                " e.fid entryId," +
+                " e.fid entryId, " +
                 " e.FSubmitStatus, " +
                 " t.fid initId " +
                 " from T_HR_STaxCalInitDetail t " +
-                " left join T_HR_STaxPersonRecordEntry e  on t.fPersonId = e.fPersonId and t.fTaxUnitId = e.fTaxUnitId " +
-                " where t.fid IN (" + initIds + ")";
+                " left join T_HR_STaxPersonRecordEntry e on t.fPersonId = e.fPersonId " +
+                " and t.fTaxUnitId = e.fTaxUnitId " +
+                " left join ( " +
+                " select max(FEMPLOYEDDATE) FEMPLOYEDDATE, " +
+                " FPERSONID " +
+                " from T_HR_STaxPersonRecordEntry " +
+                " group by FPERSONID " +
+                " ) t2 on t2.FPERSONID = e.FPERSONID " +
+                " where t.fid IN (" + initIds + ")"+
+                " and e.FEMPLOYEDDATE = t2.FEMPLOYEDDATE ";
         IRowSet rowSet = DbUtil.executeQuery(ctx, str);
         if (rowSet.size() < 1) {
             //未获取到需要算税的人员信息
@@ -197,20 +215,21 @@ public class TaxCalFacadeControllerBean extends AbstractTaxCalFacadeControllerBe
                 String notReportedPersonIds = getNotReportedPersonIds(list);
                 if (StringUtils.isEmpty(notReportedPersonIds)) {
                     paramMap.put("accept_id", (list.get(0)).getAcceptId());
-                } else if (!this.isFbSubmit) {//不是附表提交
-                    try {
-                        //人员报税信息报送_人员信息报送
-                        List relayTaskIDList = TaxPersonReportExFacadeFactory.getLocalInstance(ctx)
-                                .report(paramMap);
-                        if (null != relayTaskIDList && relayTaskIDList.size() > 0) {
-                            String relayTaskID = (String) relayTaskIDList.get(0);
-                            paramMap.put("RELAYTASK", relayTaskID);//前置任务id
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        throw new BOSException("人员报税信息报送_人员信息报送报错: " + e.getMessage());
-                    }
                 }
+//                else if (!this.isFbSubmit) {//不是附表提交
+//                    try {
+//                        //人员报税信息报送_人员信息报送
+//                        List relayTaskIDList = TaxPersonReportExFacadeFactory.getLocalInstance(ctx)
+//                                .report(paramMap);
+//                        if (null != relayTaskIDList && relayTaskIDList.size() > 0) {
+//                            String relayTaskID = (String) relayTaskIDList.get(0);
+//                            paramMap.put("RELAYTASK", relayTaskID);//前置任务id
+//                        }
+//                    } catch (Exception e) {
+//                        e.printStackTrace();
+//                        throw new BOSException("人员报税信息报送_人员信息报送报错: " + e.getMessage());
+//                    }
+//                }
                 //获取所得项目等于正常薪金工资的分录id
                 String taxSpeAddDedEntryIds = this.getTaxSpeAddDedEntryIds(list);
                 String reportTaskId = null;

+ 296 - 205
websrc/com/kingdee/eas/custom/compensation/handler/CmpCalDynamicListHandlerExExEx.java

@@ -18,6 +18,7 @@ import com.kingdee.bos.metadata.entity.FilterInfo;
 import com.kingdee.bos.metadata.entity.FilterItemInfo;
 import com.kingdee.bos.metadata.entity.SelectorItemCollection;
 import com.kingdee.bos.metadata.query.util.CompareType;
+import com.kingdee.bos.util.EASResource;
 import com.kingdee.eas.basedata.hraux.NationalityInfo;
 import com.kingdee.eas.basedata.person.IPerson;
 import com.kingdee.eas.basedata.person.PersonFactory;
@@ -35,23 +36,35 @@ import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
 import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
 import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
 import com.kingdee.eas.custom.shuiyou.utils.ClientProxyFactoryUtils;
+import com.kingdee.eas.hr.base.SqlParam;
+import com.kingdee.eas.hr.base.app.filter.FilterUtil;
+import com.kingdee.eas.hr.base.util.HRParamUtil;
 import com.kingdee.eas.hr.emp.IPersonPosition;
 import com.kingdee.eas.hr.emp.PersonPositionCollection;
 import com.kingdee.eas.hr.emp.PersonPositionFactory;
 import com.kingdee.eas.hr.emp.PersonPositionInfo;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
+import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
+import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.ml.SHRWebResource;
 import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
 import com.kingdee.shr.compensation.*;
+import com.kingdee.shr.compensation.app.formula.tax.Salary2TaxCalculator;
+import com.kingdee.shr.compensation.app.formula.tax.Salary2TaxCalculatorMgr;
 import com.kingdee.shr.compensation.app.incomeTax.*;
-import com.kingdee.shr.compensation.app.tax.ITaxUnit;
-import com.kingdee.shr.compensation.app.tax.TaxItemPlanInfo;
-import com.kingdee.shr.compensation.app.tax.TaxUnitFactory;
-import com.kingdee.shr.compensation.app.tax.TaxUnitInfo;
-import com.kingdee.shr.compensation.util.Base64Utils;
+import com.kingdee.shr.compensation.app.tax.*;
+import com.kingdee.shr.compensation.app.taxCal.CmpCalTaxCalExchangeFacadeFactory;
+import com.kingdee.shr.compensation.exception.CmpCalDynamicListBizException;
+import com.kingdee.shr.compensation.exception.ExceptionHandle;
+import com.kingdee.shr.compensation.helper.CalSchemeBizUtil;
+import com.kingdee.shr.compensation.helper.CmpConstants;
+import com.kingdee.shr.compensation.log.modUtils.WizardLogOperateUtils;
+import com.kingdee.shr.compensation.request.ParseRequestHelper;
+import com.kingdee.shr.compensation.util.*;
 import com.kingdee.shr.custom.compensation.accrue.handler.CmpCalDynamicListHandlerExEx;
 import com.kingdee.util.StringUtils;
 import org.apache.log4j.Logger;
@@ -59,8 +72,10 @@ import org.springframework.ui.ModelMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
 import java.math.BigDecimal;
 import java.sql.SQLException;
+import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -973,206 +988,6 @@ public class CmpCalDynamicListHandlerExExEx extends CmpCalDynamicListHandlerExEx
     }
 
 
-    ///**
-    // * 同步人员纳税信息
-    // *
-    // * @param request
-    // * @param response
-    // * @param modelMap
-    // * @throws ShrWebBizException
-    // * @throws BOSException
-    // */
-    //public void synTaxPersonRecordAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws ShrWebBizException, BOSException {
-    //    //计算规则ID
-    //    String cmpschemeid = request.getParameter("cmpschemeid");
-    //    if (StringUtils.isEmpty(cmpschemeid)) {
-    //        throw new ShrWebBizException("计算规则ID不可为空!!");
-    //    }
-    //    //计算规则
-    //    ICalScheme iCalScheme = CalSchemeFactory.getLocalInstance(ctx);
-    //    try {
-    //        CalSchemeInfo calSchemeInfo = iCalScheme.getCalSchemeInfo(new ObjectUuidPK(cmpschemeid));
-    //        //获取上一个月的计算规则  统计年:periodYear   统计月:periodMonth
-    //        LocalDate date = LocalDate.of(calSchemeInfo.getPeriodYear(), calSchemeInfo.getPeriodMonth(), 1);
-    //        LocalDate previousMonthDate = date.minusMonths(1);
-    //        //获取上个月的薪酬核算
-    //        //CalSchemeInfo calSchemeUp = iCalScheme.getCalSchemeInfo("where periodYear = '" + previousMonthDate.getYear() + "' and  periodMonth = '" + previousMonthDate.getMonthValue() + "'");
-    //        CmpCalTableCollection cmpCalTableCollectionUp = getCalSchemeColl(calSchemeInfo.getId().toString(), previousMonthDate.getYear(), previousMonthDate.getMonthValue());
-    //        logger.error("cmpCalTableCollectionUp--------" + cmpCalTableCollectionUp.size());
-    //
-    //        //获取当前的薪酬核算
-    //        CmpCalTableCollection cmpCalTableCollection = getCalSchemeColl(calSchemeInfo.getId().toString(), calSchemeInfo.getPeriodYear(), calSchemeInfo.getPeriodMonth());
-    //        logger.error("cmpCalTableCollection--------" + cmpCalTableCollection.size());
-    //
-    //        //保存上个月的核算人员
-    //        List<String> listUp = new ArrayList<>();
-    //        for (int i = 0; i < cmpCalTableCollectionUp.size(); i++) {
-    //            listUp.add(cmpCalTableCollectionUp.get(i).getPerson().getId().toString());
-    //        }
-    //
-    //        //保存当前月的核算人员
-    //        List<String> list = new ArrayList<>();
-    //        for (int i = 0; i < cmpCalTableCollection.size(); i++) {
-    //            list.add(cmpCalTableCollection.get(i).getPerson().getId().toString());
-    //        }
-    //
-    //        Set<String> setUp = new HashSet<>(listUp);
-    //        Set<String> set = new HashSet<>(list);
-    //
-    //        // 找出 上个月核算人员 中比 当前月核算人员 多的数据 为离职人员 修改人员纳税信息的 人员状态为非正常  离职日期为当前月最后一天
-    //        Set<String> pseronIdsUp = new HashSet<>(setUp);
-    //        pseronIdsUp.removeAll(set);
-    //
-    //        // 找出 当前月核算人员 中比 上个月核算人员 多的数据 为新增人员 创建人员纳税信息和任职受雇从业信息 人员状态为正常 任职受雇从业日期为当前月1号
-    //        Set<String> pseronIds = new HashSet<>(set);
-    //        pseronIds.removeAll(setUp);
-    //
-    //        SelectorItemCollection updateSic = new SelectorItemCollection();
-    //        updateSic.add("personStatus");
-    //        updateSic.add("departureDate");
-    //        //处理修改的人员纳税信息
-    //        ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
-    //        //判断修改人员ID大于0 则修改人员纳税信息
-    //        if (pseronIdsUp.size() > 0) {
-    //            //获取任职受雇从业信息   修改人员纳税信息的 人员状态为非正常  离职日期为当前月最后一天
-    //            TaxPersonRecordEntryCollection taxPersonRecordEntryCollUp = getTaxPersonRecordEntryColl(pseronIdsUp, iTaxPersonRecordEntry);
-    //            if (taxPersonRecordEntryCollUp.size() > 0) {
-    //                for (int i = 0; i < taxPersonRecordEntryCollUp.size(); i++) {
-    //                    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntryCollUp.get(i);
-    //                    //人员状态
-    //                    taxPersonRecordEntryInfo.setPersonStatus(PersonStatusEnum.NotNormal);
-    //                    //获取当前月的最后一天转成Date类型
-    //                    Date departureDate = Date.from(date.withDayOfMonth(date.lengthOfMonth()).atStartOfDay(ZoneId.systemDefault()).toInstant());
-    //                    //离职日期为当前月最后一天
-    //                    taxPersonRecordEntryInfo.setDepartureDate(departureDate);
-    //                    iTaxPersonRecordEntry.updatePartial(taxPersonRecordEntryInfo, updateSic);
-    //                }
-    //            }
-    //        }
-    //        //调用新增人员纳税信息方法
-    //        if (pseronIds.size() > 0) {
-    //            //Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()) 当前月第一天
-    //            addTaxPersonRecord(pseronIds, Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()));
-    //        }
-    //        Map res = new HashMap();
-    //        res.put("update", pseronIdsUp.size());
-    //        res.put("add", pseronIds.size());
-    //        JSONUtils.writeJson(response, res);
-    //    } catch (EASBizException e) {
-    //        e.printStackTrace();
-    //        throw new ShrWebBizException("计算规则ID【" + cmpschemeid + "】未获取到,请联系管理员!!");
-    //    } catch (SQLException e) {
-    //        throw new ShrWebBizException(e);
-    //    } catch (SHRWebException e) {
-    //        throw new ShrWebBizException(e);
-    //    }
-    //
-    //}
-
-    ///**
-    // * 新增人员纳税信息
-    // *
-    // * @param pseronIds
-    // */
-    //public void addTaxPersonRecord(Set<String> pseronIds, Date oneDay) throws BOSException, EASBizException, SQLException {
-    //    logger.error("addTaxPersonRecord--------新增开始");
-    //    //pseronIds.forEach(id -> {});
-    //    ITaxPersonRecord iTaxPersonRecord = TaxPersonRecordFactory.getLocalInstance(ctx);
-    //    IPerson iPerson = PersonFactory.getLocalInstance(ctx);
-    //    ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
-    //    //人员纳税分录对象
-    //    TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = new TaxPersonRecordEntryInfo();
-    //    SelectorItemCollection sic = new SelectorItemCollection();
-    //    sic.add("*");
-    //    FilterInfo filterInfo = new FilterInfo();
-    //    filterInfo.getFilterItems().add(new FilterItemInfo("id", pseronIds, CompareType.INCLUDE));
-    //    EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, sic, null);
-    //    PersonCollection personCollection = iPerson.getPersonCollection(entityViewInfo);
-    //    if (personCollection.size() > 0) {
-    //        for (int i = 0; i < personCollection.size(); i++) {
-    //            PersonInfo personInfo = personCollection.get(i);
-    //            boolean exists = iTaxPersonRecordEntry.exists("where person = '" + personInfo.getId().toString() + "'");
-    //            if (!exists) {
-    //
-    //                TaxPersonRecordInfo taxPersonRecordInfo = new TaxPersonRecordInfo();
-    //                //人员
-    //                taxPersonRecordInfo.setPerson(personInfo);
-    //                //证件类型
-    //                if (personInfo.getIdCardNO() != null || personInfo.getPassportNO() != null) {
-    //                    if (null == personInfo.getIdCardNO()) {
-    //                        //护照
-    //                        taxPersonRecordInfo.setCardType(CardTypeEnum.Passport);
-    //                        taxPersonRecordInfo.setCardNumber(personInfo.getPassportNO());
-    //                        //纳税人类型
-    //                        taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.NotResident);
-    //                    }
-    //                    if (null == personInfo.getPassportNO()) {
-    //                        //证件号
-    //                        taxPersonRecordInfo.setCardType(CardTypeEnum.IdCard);
-    //                        taxPersonRecordInfo.setCardNumber(personInfo.getIdCardNO());
-    //                        //纳税人类型
-    //                        taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.Resident);
-    //
-    //                    }
-    //                } else {
-    //                    logger.error(personInfo.getName() + "护照和身份证为空,证件类型保存失败!");
-    //                }
-    //                //性别
-    //                taxPersonRecordInfo.setGender(personInfo.getGender());
-    //                //出生日期
-    //                taxPersonRecordInfo.setBirthday(personInfo.getBirthday());
-    //                //国籍
-    //                taxPersonRecordInfo.setNationality(personInfo.getNationality());
-    //                //是否境外人员
-    //                taxPersonRecordInfo.setIsOversea(IsOverseaEnum.NotOversea);
-    //                //手机号码
-    //                taxPersonRecordInfo.setPhoneNumber(personInfo.getCell());
-    //                iTaxPersonRecord.save(taxPersonRecordInfo);
-    //                //保存分录数据
-    //                taxPersonRecordEntryInfo.setPerson(personInfo);
-    //                taxPersonRecordEntryInfo.setBill(taxPersonRecordInfo);
-    //                //获取纳税单位
-    //                String sql = getSalaryOrgMappingByPersonId(personInfo.getId().toString());
-    //                IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-    //                ITaxUnit iTaxUnit = TaxUnitFactory.getLocalInstance(ctx);
-    //                if (iRowSet.size() > 0) {
-    //                    while (iRowSet.next()) {
-    //                        TaxUnitInfo taxUnitInfo = iTaxUnit.getTaxUnitInfo("where number = '" + iRowSet.getString("nsdwmc") + "'");
-    //                        taxPersonRecordEntryInfo.setTaxUnit(taxUnitInfo);
-    //                        //人员状态
-    //                        taxPersonRecordEntryInfo.setPersonStatus(PersonStatusEnum.Normal);
-    //                        //获取当前月的最后一天转成Date类型 //任职受雇从业日期为当前月第一天
-    //                        taxPersonRecordEntryInfo.setEmployedDate(oneDay);
-    //                        //报送状态
-    //                        taxPersonRecordEntryInfo.setSubmitStatus(SubmitStatusEnum.NotSubmit);
-    //                        iTaxPersonRecordEntry.save(taxPersonRecordEntryInfo);
-    //                    }
-    //                } else {
-    //                    logger.error("iRowSet-----Sql---" + sql);
-    //                    logger.error("iRowSet--------" + personInfo.getName() + "未获取到纳税单位,字段保存失败!!");
-    //                }
-    //            }
-    //        }
-    //    }
-    //    logger.error("addTaxPersonRecord--------新增结束");
-    //}
-
-
-    ///**
-    // * 获取任职受雇从业信息
-    // *
-    // * @param pseronIds 员工ID集合
-    // * @return
-    // * @throws BOSException
-    // */
-    //public TaxPersonRecordEntryCollection getTaxPersonRecordEntryColl(Set<String> pseronIds, ITaxPersonRecordEntry iTaxPersonRecordEntry) throws BOSException {
-    //    //获取当前月的薪酬计算
-    //    FilterInfo filterInfo = new FilterInfo();
-    //    filterInfo.getFilterItems().add(new FilterItemInfo("bill.person", pseronIds, CompareType.INCLUDE));
-    //    EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
-    //    return iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(entityViewInfo);
-    //}
-
     /**
      * 通过计算规则id获取薪酬核算数据
      *
@@ -1194,4 +1009,280 @@ public class CmpCalDynamicListHandlerExExEx extends CmpCalDynamicListHandlerExEx
         CmpCalTableCollection cmpCalTableCollection = iCmpCalTable.getCmpCalTableCollection(entityViewInfo);
         return cmpCalTableCollection;
     }
+    public String beforeSubmitPreDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException, BOSException, SQLException {
+        String cmpSchemeId = request.getParameter("cmpschemeid");
+        this.verifyMultiUipkScheme(request, cmpSchemeId);
+        Context ctx = SHRContext.getInstance().getContext();
+        String language = ctx.getLocale().getLanguage();
+        CalSchemeInfo calSchemeInfo = CalSchemeBizUtil.getCalSchemeInfo(ctx, cmpSchemeId);
+        if (!calSchemeInfo.isIsUseForTaxCal()) {
+            throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label_tax_item_plan", ctx.getLocale()));
+        } else {
+            TaxItemPlanShemeRelCollection taxItemPlanList = calSchemeInfo.getTaxItemPlanList();
+            if (null != taxItemPlanList && !taxItemPlanList.isEmpty()) {
+                StringBuilder incomeItemIds = new StringBuilder();
+
+                for(int i = 0; i < taxItemPlanList.size(); ++i) {
+                    if (taxItemPlanList.get(i).getTaxItemPlan().getIncomeItem() == null) {
+                        throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label239", ctx.getLocale()));
+                    }
+
+                    if (incomeItemIds.length() > 0) {
+                        incomeItemIds.append(",");
+                    }
+
+                    incomeItemIds.append(taxItemPlanList.get(i).getTaxItemPlan().getIncomeItem().getId().toString());
+                }
+
+                String filterSql = this.getCalKeyFromSeesion(request);
+
+
+                String calSql = "select FID from T_HR_SCmpCalTable where FCalState = 4 and FID in (" + filterSql + ") and (FisNotNeedCal = 0 or FisNotNeedCal is null)";
+                IRowSet rowSet = null;
+
+                try {
+                    rowSet = DbUtil.executeQuery(ctx, calSql);
+                } catch (BOSException e) {
+                    logger.error(e.getMessage(), e);
+                }
+
+                int tcal = rowSet == null ? 0 : rowSet.size();
+                if (tcal < 1) {
+                    throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label223", ctx.getLocale()));
+                } else {
+                    CmpTaxUtil cmpTaxUtil = new CmpTaxUtil();
+                    Map<String, Date> taxYearRange = cmpTaxUtil.getTaxYearRange(ctx, calSchemeInfo);
+                    int taxYear = cmpTaxUtil.getTaxYear(ctx, calSchemeInfo);
+                    if (null == taxYearRange) {
+                        throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label224", ctx.getLocale()));
+                    } else {
+                        Date taxBeginDate = (Date)taxYearRange.get("beginDate");
+                        int periodYear = calSchemeInfo.getPeriodYear();
+                        int periodMonth = calSchemeInfo.getPeriodMonth();
+                        Calendar max = Calendar.getInstance();
+                        max.set(periodYear, periodMonth - 1, 2);
+                        int result = 0;
+                        Calendar min = Calendar.getInstance();
+                        min.setTime(taxBeginDate);
+                        min.set(min.get(1), min.get(2), 1);
+
+                        while(min.before(max)) {
+                            ++result;
+                            min.add(2, 1);
+                        }
+
+                        Calendar calendar = Calendar.getInstance();
+                        calendar.set(taxYear, result - 1, 1, 0, 0, 0);
+                        Map<String, Object> obj = new HashMap();
+                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+                        obj.put("taxPeriodDate", format.format(calendar.getTime()));
+                        boolean isCal = true;
+
+                        try {
+                            isCal = HRParamUtil.getParamOfHR(ctx, "shr_cmp_026", (String)null);
+                        } catch (Exception e) {
+                            ExceptionHandle.handleException(e);
+                        }
+
+                        StringBuilder personNames = new StringBuilder();
+                        int count = 0;
+                        if (isCal) {
+                            String getCalDetailSQL = " SELECT DISTINCT PERSON.FNAME_" + language + " NAME,PERSON.FNUMBER PERSONNUMBER " + " FROM T_HR_SCMPCALTABLE CAL " + " INNER JOIN T_BD_PERSON PERSON ON CAL.FPERSONID = PERSON.FID " + " inner JOIN T_HR_STAXCALINITDETAIL DETAIL ON DETAIL.FCMPCALTABLEID = CAL.FID " + " WHERE CAL.FID IN (" + calSql + ") " + " AND DETAIL.FINCOMEITEMID in " + CmpStrUtil.buildInSql(incomeItemIds.toString()) + " AND DETAIL.FPERIODBEGIN = " + CmpDateUtil.toKSqlDate(calendar.getTime()) + " AND DETAIL.FDATASTATE = " + 10 + " AND DETAIL.FSTATE IN (20,40) ";
+
+                            for(IRowSet var35 = DbUtil.executeQuery(ctx, getCalDetailSQL); var35.next(); ++count) {
+                                if (count > 5) {
+                                    personNames.append(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label225"), var35.size()));
+                                    break;
+                                }
+
+                                if (personNames.length() > 0) {
+                                    personNames.append("、");
+                                }
+
+                                personNames.append(var35.getString("NAME")).append("(").append(var35.getString("PERSONNUMBER")).append(")");
+                            }
+                        } else {
+                            String getTaxCalInitDetailSQL = " SELECT distinct person.fname_" + language + " personName,person.fnumber personNumber " + " FROM T_HR_STaxCalInitDetail detail  " + " inner join T_HR_SCmpCalTable cal on detail.fcmpcaltableid = cal.FID  " + " inner join T_BD_Person person on detail.fpersonid = person.fid " + " where detail.fpersonid in ( select A.fpersonid from T_HR_SCMPCALTABLE A where a.FTAXUNITID = detail.ftaxunitid and a.fid IN (" + calSql + ")) " + " and detail.fincomeitemid in " + CmpStrUtil.buildInSql(incomeItemIds.toString()) + " and detail.fPERIODBEGIN = " + CmpDateUtil.toKSqlDate(calendar.getTime()) + " and detail.fdatastate = " + 10 + " and detail.fstate in (20,40) ";
+
+                            for(IRowSet rowSet1 = DbUtil.executeQuery(ctx, getTaxCalInitDetailSQL); rowSet1.next(); ++count) {
+                                if (count > 5) {
+                                    personNames.append(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label225"), rowSet1.size()));
+                                    break;
+                                }
+
+                                if (personNames.length() > 0) {
+                                    personNames.append("、");
+                                }
+
+                                personNames.append(rowSet1.getString("personName")).append("(").append(rowSet1.getString("PERSONNUMBER")).append(")");
+                            }
+                        }
+
+                        StringBuilder confirmMessage = new StringBuilder();
+                        if (!StringUtils.isEmpty(personNames.toString())) {
+                            String prefix = EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label226", ctx.getLocale());
+                            confirmMessage.append(prefix).append(personNames.toString().replaceFirst(",", ""));
+                        }
+
+                        if (!StringUtils.isEmpty(confirmMessage.toString())) {
+                            obj.put("confirmMsg", confirmMessage.toString());
+                            obj.put("confirm", true);
+                        } else {
+                            obj.put("confirm", false);
+                        }
+
+                        JSONUtils.writeJson(response, obj);
+                        return null;
+                    }
+                }
+            } else {
+                throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label_tax_item_plan", ctx.getLocale()));
+            }
+        }
+    }
+    private String getCalKeyFromSeesion(HttpServletRequest request) throws SHRWebException {
+        String filterSql = "";
+        if (!StringUtils.isEmpty(request.getParameter("selectedData"))) {
+            filterSql = "'" + CmpStrUtil.join(request.getParameter("selectedData").split(","), "','", (String)null) + "'";
+        } else {
+            HttpSession session = request.getSession();
+            Object cmpschemeid = ParseRequestHelper.getParameterByRequest(request, "cmpschemeid");
+            Object sqlParamObject = session.getAttribute(cmpschemeid == null ? "" : cmpschemeid.toString() + "sqlParam");
+            SqlParam param = null;
+            if (sqlParamObject instanceof Map) {
+                Map<String, Object> sqlParamMap = (Map)sqlParamObject;
+                param = (SqlParam)sqlParamMap.get(cmpschemeid == null ? "" : cmpschemeid.toString() + "sqlParam");
+            } else {
+                param = (SqlParam)session.getAttribute(cmpschemeid == null ? "" : cmpschemeid.toString() + "sqlParam");
+            }
+
+            Map<String, String> map = new HashMap();
+            map.put("cmp_ctb.id", "cmp_ctb.id");
+            param.setSelectMapping(map);
+            String originalSql = "";
+
+            try {
+                originalSql = FilterUtil.getSql(SHRContext.getInstance().getContext(), param);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+            String key = "cal_" + originalSql;
+            String tempName = "";
+
+            try {
+                tempName = null == BaseUtils.getCacheMap(key) ? null : BaseUtils.getCacheMap(key).toString();
+                if (null != tempName) {
+                    return tempName;
+                }
+
+                filterSql = this.util.getTempTable(key, originalSql);
+            } catch (Exception var12) {
+                filterSql = this.util.getTempTable(key, originalSql);
+            }
+        }
+
+        return filterSql;
+    }
+    private void verifyMultiUipkScheme(HttpServletRequest request, String cmpschemeid) throws SHRWebException {
+        HttpSession session = request.getSession();
+        String uipk = request.getParameter("uipk");
+        Object uipkObj = session.getAttribute(cmpschemeid + "uipk");
+        String queryUipk = uipkObj == null ? "" : uipkObj.toString();
+        if (!StringUtils.isEmpty(queryUipk) && !queryUipk.equals(uipk)) {
+            throw new ShrWebBizException(new com.kingdee.shr.compensation.exception.CmpCalDynamicListBizException(com.kingdee.shr.compensation.exception.CmpCalDynamicListBizException.EXCEPTION148));
+        } else {
+            String cmpSchemeId = String.valueOf(session.getAttribute("calscheme")).trim();
+            if (!cmpSchemeId.equals(cmpschemeid)) {
+                throw new ShrWebBizException(new com.kingdee.shr.compensation.exception.CmpCalDynamicListBizException(CmpCalDynamicListBizException.EXCEPTION149));
+            }
+        }
+    }
+
+    public String submitPreDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        String cmpSchemeId = request.getParameter("cmpschemeid");
+        String zeroIncome = request.getParameter("isZeroIncome");
+        boolean isZeroIncome = Boolean.parseBoolean(zeroIncome);
+        this.verifyMultiUipkScheme(request, cmpSchemeId);
+        String uid = "";
+
+        try {
+            BaseUtils.clearCacheMap();
+            Salary2TaxCalculator cal = new Salary2TaxCalculator();
+            Salary2TaxCalculatorMgr.addTask(cal);
+            uid = cal.getUID();
+            String taxPeriodDate = request.getParameter("taxPeriodDate");
+            String filterSql = this.getCalKeyFromSeesion(request);
+
+
+            String calSql = "select FID from T_HR_SCmpCalTable where FID in (" + filterSql + ") and (FisNotNeedCal = 0 or FisNotNeedCal is null) and FEMPLOYEETYPEID not in(select fid from T_HR_BDEmployeeType where FNUMBER in('JZT006','JZT022') ) ";
+            HashMap<String, String> mapParam = new HashMap();
+            mapParam.put("cmpschemeid", cmpSchemeId);
+            mapParam.put("uid", uid);
+            mapParam.put("cmpcalid", calSql);
+            mapParam.put("filterSql", filterSql);
+            mapParam.put("taxPeriodDate", taxPeriodDate);
+            Context ctx = SHRContext.getInstance().getContext();
+
+            Map<String, Object> rmap;
+            try {
+                if (!isZeroIncome) {
+                    rmap = CmpCalTaxCalExchangeFacadeFactory.getLocalInstance(ctx).submitData(mapParam);
+                } else {
+                    rmap = CmpCalTaxCalExchangeFacadeFactory.getLocalInstance(ctx).genZeroIncome(mapParam);
+                }
+            } catch (Exception e) {
+                throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label227", ctx.getLocale()) + e.getMessage());
+            }
+
+            if (rmap == null || rmap.get("UID") == null || StringUtils.isEmpty(rmap.get("UID").toString())) {
+                throw new ShrWebBizException(rmap + " " + EASResource.getString("com.kingdee.shr.compensation.resource.TaxCalBaseResource", "label228", ctx.getLocale()));
+            }
+
+            BatchMessageTipsHeader header = (BatchMessageTipsHeader)rmap.get("header");
+
+            String calSql2 = "select FID,fname_l2,fnumber from T_HR_SCmpCalTable where FCalState = 4 and FID in (" + filterSql + ") and (FisNotNeedCal = 0 or FisNotNeedCal is null) and FEMPLOYEETYPEID in(select fid from T_HR_BDEmployeeType where FNUMBER in('JZT006','JZT022') )";
+            IRowSet rowSet2 = null;
+
+            try {
+                rowSet2 = DbUtil.executeQuery(ctx, calSql2);
+            } catch (BOSException e) {
+                logger.error(e.getMessage(), e);
+            }
+            String billId = header.getBillId()==null?"":header.getBillId();
+            String[] ids =billId.split(",");
+            List<String> idsList = new ArrayList<>();
+            idsList.addAll(Arrays.asList(ids));
+            while (rowSet2.next()) {
+                String id = rowSet2.getString("fid");
+                String fname_l2 = rowSet2.getString("fname_l2");
+                String fnumber = rowSet2.getString("fnumber");
+                idsList.add(id);
+                BatchMessageTipsBody body = new BatchMessageTipsBody();
+                body.setId(id);
+                body.setMuitTipsState(Boolean.FALSE);
+                body.setMuitTipsMessage("劳务派遣(内部)和业务外包(内部)的人员不允许进行个税初算数据提交");
+                List<Object> messageListExt = new ArrayList();
+                messageListExt.add(fnumber);
+                messageListExt.add(fname_l2);
+                messageListExt.add("");
+                messageListExt.add("");
+                body.addMessageListExt(messageListExt);
+                header.addResult(body);
+                header.setFailureCount(header.getFailureCount() + 1);
+            }
+            header.setBillId(CmpStrUtil.convertListToString(idsList));
+            JSONUtils.SUCCESS(header);
+        } catch (Exception e) {
+            ExceptionHandle.handleException(e);
+        } finally {
+            if (!StringUtils.isEmpty(uid)) {
+                Salary2TaxCalculatorMgr.removeTask(uid, "");
+            }
+
+        }
+
+        request.setAttribute(CmpConstants.CMP_LOG_OPERATE, WizardLogOperateUtils.getOperateLocalCmpScheme(request));
+        return null;
+    }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 853 - 166
websrc/com/kingdee/eas/custom/compensation/handler/IncomeTaxDeclareListHandlerEx.java


+ 110 - 97
websrc/com/kingdee/eas/custom/compensation/service/SynIncomeTaxDeclareService.java

@@ -1,6 +1,7 @@
 package com.kingdee.eas.custom.compensation.service;
 
 import cn.com.servyou.dto.ApiResponse;
+import cn.com.servyou.dto.declare.DataImportFeedback;
 import cn.com.servyou.dto.declare.Feedback;
 import cn.com.servyou.rmi.client.ClientProxyFactory;
 import cn.com.servyou.service.DeclarationRequest;
@@ -12,10 +13,7 @@ import com.kingdee.bos.bsf.service.app.IHRMsfService;
 import com.kingdee.bos.ctrl.swing.StringUtils;
 import com.kingdee.bos.dao.IObjectPK;
 import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
-import com.kingdee.bos.metadata.entity.EntityViewInfo;
-import com.kingdee.bos.metadata.entity.FilterInfo;
-import com.kingdee.bos.metadata.entity.FilterItemInfo;
-import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.*;
 import com.kingdee.bos.metadata.query.util.CompareType;
 import com.kingdee.bos.util.BOSUuid;
 import com.kingdee.eas.basedata.person.IPerson;
@@ -55,9 +53,9 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
     Logger logger = Logger.getLogger("com.kingdee.eas.custom.compensation.service.SynIncomeTaxDeclareService");
 
     public Object process(Context context, Map map) throws EASBizException, BOSException {
-        //接口日志实体
+        //鎺ュ彛鏃ュ織瀹炰綋
         LogInfoInfo logInfo = new LogInfoInfo();
-        //入口
+        //鍏ュ彛
         logInfo.setEntrance(this.getClass().getName());
         logInfo.setBizDate(new Date());
         Map resMap = new HashMap();
@@ -70,39 +68,54 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
         logger.error("param--------" + param);
         ObjectMapper mapper = new ObjectMapper();
         try {
-            //客户端代理工厂
+            SelectorItemCollection sc = new SelectorItemCollection();
+            sc.add(new SelectorItemInfo("declareStatus"));
+            //瀹㈡埛绔�唬鐞嗗伐鍘�
             ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory();
-            //算税请求接口
+            //绠楃◣璇锋眰鎺ュ彛
             DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest();
-            //申报数据反馈  requestId:请求Id   reportType:申报所得类型[1:综合所得;2:分类所得;3:非居民所得;4:限售股所得]
-            ApiResponse<Feedback> feedback = declarationRequest.getFeedback(requestId, "1");
-            logInfo.setInterfaceAddress("/gateway/iit/report/getFeedback");//接口地址
-            logInfo.setInterfaceName("getFeedback");//接口名
+            //鐢虫姤鏁版嵁鍙嶉�  requestId锛氳�姹侷d   reportType:鐢虫姤鎵€寰楃被鍨媅1:缁煎悎鎵€寰�;2:鍒嗙被鎵€寰�;3:闈炲眳姘戞墍寰�;4:闄愬敭鑲℃墍寰梋
+            ApiResponse<DataImportFeedback> feedback = declarationRequest.getDataImportFeedback(requestId, "1");
+            logInfo.setInterfaceAddress("/gateway/iit/report/getDataImportFeedback");//鎺ュ彛鍦板潃
+            logInfo.setInterfaceName("getFeedback");//鎺ュ彛鍚�
+            logInfo.setInParameter((String) map.get("paramData"));
             logger.error("feedback--------" + mapper.writeValueAsString(feedback));
             String status = feedback.getHead().getStatus();
-            Feedback body = null;
+            DataImportFeedback body = null;
             if ("N".equals(status)) {
-                //请求失败响应
+                //璇锋眰澶辫触鍝嶅簲
                 String msg = feedback.getHead().getMsg();
                 //throw new BOSException(msg);
-                logInfo.setStatus("处理中");
+                logInfo.setStatus("澶勭悊涓�");
                 return MessageResult.FAILED(msg);
             } else {
-                //调用成功
-                //请求id
+                //璋冪敤鎴愬姛
+                //璇锋眰id
                 body = feedback.getBody();
-                logInfo.setOutParameter(mapper.writeValueAsString(body));//回参
-                if (body.getDeclarationStateCode().equals("6") || body.getDeclarationStateCode().equals("5")) {
+                logInfo.setOutParameter(mapper.writeValueAsString(feedback));//鍥炲弬
+                if (body.getFeedbackState().compareTo("1")==0) {
                     saveTaxDeclaration(context, param);
+                    logInfo.setStatus("鎴愬姛");
+                    IIncomeTaxDeclar iId = IncomeTaxDeclarFactory.getLocalInstance(context);
+                    String taxDeclarId= param.get("taxDeclarId").toString();
+                    IncomeTaxDeclarInfo taxDeclarInfo = iId.getIncomeTaxDeclarInfo(new ObjectUuidPK(taxDeclarId));
+                    taxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS);
+                    iId.updatePartial(taxDeclarInfo,sc);
+                }else {
+                    logInfo.setStatus("鐢虫姤澶辫触");
+                    IIncomeTaxDeclar iId = IncomeTaxDeclarFactory.getLocalInstance(context);
+                    String taxDeclarId = param.get("taxDeclarId").toString();
+                    IncomeTaxDeclarInfo taxDeclarInfo = iId.getIncomeTaxDeclarInfo(new ObjectUuidPK(taxDeclarId));
+                    taxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_FAIL);
+                    iId.updatePartial(taxDeclarInfo, sc);
                 }
-                logInfo.setStatus("成功");
             }
             LogInfoFactory.getLocalInstance(context).addnew(logInfo);
             return MessageResult.SUCCESS(mapper.writeValueAsString(body));
         } catch (IOException e) {
             e.printStackTrace();
-            logInfo.setErrorInfo(e.getMessage());//错误信息
-            logInfo.setStatus("失败");
+            logInfo.setErrorInfo(e.getMessage());//閿欒�淇℃伅
+            logInfo.setStatus("澶辫触");
             LogInfoFactory.getLocalInstance(context).save(logInfo);
             //throw new BOSException(e);
             return MessageResult.ERROR(e.getMessage());
@@ -110,15 +123,15 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
     }
 
     /**
-     * 保存个税申报结果
+     * 淇濆瓨涓�◣鐢虫姤缁撴灉
      *
      * @param param
      */
     public void saveTaxDeclaration(Context ctx, JSONObject param) throws BOSException, EASBizException {
         logger.error("saveTaxDeclaration------------------");
-        //个税申报ID
+        //涓�◣鐢虫姤ID
         //String taxDeclarId = param.getString("taxDeclarId");
-        //个税申报批次号
+        //涓�◣鐢虫姤鎵规�鍙�
         String taxDeclarBatchNo = param.getString("taxDeclarBatchNo");
         IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);
         IncomeTaxDeclarCollection incomeTaxDeclarCollection = iIncomeTaxDeclar.getIncomeTaxDeclarCollection("where batchNo = '" + taxDeclarBatchNo + "'");
@@ -129,18 +142,18 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
             incomeTaxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS);
             iIncomeTaxDeclar.updatePartial(incomeTaxDeclarInfo, updateSic);
         }
-        ////个税应用+税款计算最终拆分明细表
+        ////涓�◣搴旂敤+绋庢�璁$畻鏈€缁堟媶鍒嗘槑缁嗚〃
         //ITaxCalConfigDetail taxCalConfigDetail = TaxCalConfigDetailFactory.getLocalInstance(ctx);
         //TaxCalConfigDetailCollection taxCalConfigDetailCollection = taxCalConfigDetail.getTaxCalConfigDetailCollection("select *,incomeItem.*, person.* where batchNo = '" + taxDeclarBatchNo + "' and state = '20'");
         //for (int i = 0; i < taxCalConfigDetailCollection.size(); i++) {
         //    TaxCalConfigDetailInfo taxCalConfigDetailInfo = taxCalConfigDetailCollection.get(i);
-        //    //员工信息
+        //    //鍛樺伐淇℃伅
         //    PersonInfo person = taxCalConfigDetailInfo.getPerson();
         //}
         try {
-            //个税申报表
+            //涓�◣鐢虫姤琛�
             ITaxDeclaration iTaxDeclaration = TaxDeclarationFactory.getLocalInstance(ctx);
-            //个税项目
+            //涓�◣椤圭洰
             ITaxIncomeItem iTaxIncomeItem = TaxIncomeItemFactory.getLocalInstance(ctx);
             IPerson iPerson = PersonFactory.getLocalInstance(ctx);
             List<Map<String, Object>> taxDeclarationDate = getTaxDeclarationDate(ctx, taxDeclarBatchNo);
@@ -159,50 +172,50 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
                 logger.error("taxDeclarationCollection.size------------------" + taxDeclarationCollection.size());
                 if (taxDeclarationCollection.size() <= 0) {
                     TaxDeclarationInfo taxDeclarationInfo = new TaxDeclarationInfo();
-                    //员工
+                    //鍛樺伐
                     PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK((String) map.get("personId")));
                     taxDeclarationInfo.setPerson(personInfo);
-                    //证件号
+                    //璇佷欢鍙�
                     taxDeclarationInfo.setIdNO(personInfo.getIdCardNO());
-                    //证件类型
+                    //璇佷欢绫诲瀷
                     TaxPersonRecordInfo taxPersonRecordInfo = TaxPersonRecordFactory.getLocalInstance(ctx).getTaxPersonRecordCollection("where person = '" + personInfo.getId() + "'").get(0);
                     String alias = taxPersonRecordInfo.getCardType().getAlias();
                     taxDeclarationInfo.setIdType(alias);
-                    //纳税单位
+                    //绾崇◣鍗曚綅
                     TaxUnitInfo taxUnitInfo = new TaxUnitInfo();
                     taxUnitInfo.setId(BOSUuid.read((String) map.get("taxunitId")));
                     taxDeclarationInfo.setTaxUnit(taxUnitInfo);
-                    //税款所属期间起始时间
+                    //绋庢�鎵€灞炴湡闂磋捣濮嬫椂闂�
                     taxDeclarationInfo.setTaxPeriodBegin((Date) map.get("periodbegin"));
-                    //税款所属期间截止时间
+                    //绋庢�鎵€灞炴湡闂存埅姝㈡椂闂�
                     taxDeclarationInfo.setTaxPeriodEnd((Date) map.get("periodend"));
-                    //个税项目
+                    //涓�◣椤圭洰
                     taxDeclarationInfo.setProceedItem(taxIncomeItemInfo.getName());
-                    taxDeclarationInfo.setCost((BigDecimal) map.get("t25"));//费用
-                    taxDeclarationInfo.setIncome((BigDecimal) map.get(" t1"));//收入
-                    taxDeclarationInfo.setExemptIncome((BigDecimal) map.get("t2"));//免税收入
-                    taxDeclarationInfo.setBasicPension((BigDecimal) map.get("t3"));//基本养老保险费
-                    taxDeclarationInfo.setBasicMedical((BigDecimal) map.get("t4"));//基本医疗保险费
-                    taxDeclarationInfo.setUnemployment((BigDecimal) map.get("t5"));//失业保险费
-                    taxDeclarationInfo.setHousingFund((BigDecimal) map.get("t6"));//住房公积金
-                    taxDeclarationInfo.setChildEducateSum((BigDecimal) map.get("t7"));//累计子女教育
-                    taxDeclarationInfo.setContinueEducateSum((BigDecimal) map.get("t8"));//累计继续教育
-                    taxDeclarationInfo.setLoanInterestSum((BigDecimal) map.get("t9"));//累计住房贷款利息
-                    taxDeclarationInfo.setHousingRentSum((BigDecimal) map.get("t10"));//累计住房租金
-                    taxDeclarationInfo.setOldSupportSum((BigDecimal) map.get("t11"));//累计赡养老人
-                    taxDeclarationInfo.setIncomeSum((BigDecimal) map.get("t20"));//累计收入额
-                    taxDeclarationInfo.setDeductionSum((BigDecimal) map.get("t24"));//累计减除费用
-                    taxDeclarationInfo.setSpecialDeductSum((BigDecimal) map.get("t26"));//累计专项扣除
-                    taxDeclarationInfo.setOtherDeductionSum((BigDecimal) map.get("t28"));//累计其他扣除
-                    taxDeclarationInfo.setAllowDonationSum((BigDecimal) map.get("t29"));//累计准予扣除的捐赠
-                    taxDeclarationInfo.setTaxableIncomeSum((BigDecimal) map.get("t30"));//累计应纳税所得额
-                    taxDeclarationInfo.setTaxRatio((BigDecimal) map.get("t31"));//税率
-                    taxDeclarationInfo.setQuickDeduct((BigDecimal) map.get("t32"));//速算扣除数
-                    taxDeclarationInfo.setTaxPayableSum((BigDecimal) map.get("t33"));//累计应纳税额
-                    taxDeclarationInfo.setTaxCreditSum((BigDecimal) map.get("t34"));//累计减免税额
-                    taxDeclarationInfo.setTaxSupOrRefund((BigDecimal) map.get("t38"));//应补/退税额
-                    taxDeclarationInfo.setInFantSum((BigDecimal) map.get("t45"));//累计婴幼儿照护费用
-                    taxDeclarationInfo.setPersonalPension((BigDecimal) map.get("t46"));//累计个人养老金
+                    taxDeclarationInfo.setCost((BigDecimal) map.get("t25"));//璐圭敤
+                    taxDeclarationInfo.setIncome((BigDecimal) map.get(" t1"));//鏀跺叆
+                    taxDeclarationInfo.setExemptIncome((BigDecimal) map.get("t2"));//鍏嶇◣鏀跺叆
+                    taxDeclarationInfo.setBasicPension((BigDecimal) map.get("t3"));//鍩烘湰鍏昏€佷繚闄╄垂
+                    taxDeclarationInfo.setBasicMedical((BigDecimal) map.get("t4"));//鍩烘湰鍖荤枟淇濋櫓璐�
+                    taxDeclarationInfo.setUnemployment((BigDecimal) map.get("t5"));//澶变笟淇濋櫓璐�
+                    taxDeclarationInfo.setHousingFund((BigDecimal) map.get("t6"));//浣忔埧鍏�Н閲�
+                    taxDeclarationInfo.setChildEducateSum((BigDecimal) map.get("t7"));//绱��瀛愬コ鏁欒偛
+                    taxDeclarationInfo.setContinueEducateSum((BigDecimal) map.get("t8"));//绱��缁х画鏁欒偛
+                    taxDeclarationInfo.setLoanInterestSum((BigDecimal) map.get("t9"));//绱��浣忔埧璐锋�鍒╂伅
+                    taxDeclarationInfo.setHousingRentSum((BigDecimal) map.get("t10"));//绱��浣忔埧绉熼噾
+                    taxDeclarationInfo.setOldSupportSum((BigDecimal) map.get("t11"));//绱��璧″吇鑰佷汉
+                    taxDeclarationInfo.setIncomeSum((BigDecimal) map.get("t20"));//绱��鏀跺叆棰�
+                    taxDeclarationInfo.setDeductionSum((BigDecimal) map.get("t24"));//绱��鍑忛櫎璐圭敤
+                    taxDeclarationInfo.setSpecialDeductSum((BigDecimal) map.get("t26"));//绱��涓撻」鎵i櫎
+                    taxDeclarationInfo.setOtherDeductionSum((BigDecimal) map.get("t28"));//绱��鍏朵粬鎵i櫎
+                    taxDeclarationInfo.setAllowDonationSum((BigDecimal) map.get("t29"));//绱��鍑嗕簣鎵i櫎鐨勬崘璧�
+                    taxDeclarationInfo.setTaxableIncomeSum((BigDecimal) map.get("t30"));//绱��搴旂撼绋庢墍寰楅�
+                    taxDeclarationInfo.setTaxRatio((BigDecimal) map.get("t31"));//绋庣巼
+                    taxDeclarationInfo.setQuickDeduct((BigDecimal) map.get("t32"));//閫熺畻鎵i櫎鏁�
+                    taxDeclarationInfo.setTaxPayableSum((BigDecimal) map.get("t33"));//绱��搴旂撼绋庨�
+                    taxDeclarationInfo.setTaxCreditSum((BigDecimal) map.get("t34"));//绱��鍑忓厤绋庨�
+                    taxDeclarationInfo.setTaxSupOrRefund((BigDecimal) map.get("t38"));//搴旇ˉ/閫€绋庨�
+                    taxDeclarationInfo.setInFantSum((BigDecimal) map.get("t45"));//绱��濠村辜鍎跨収鎶よ垂鐢�
+                    taxDeclarationInfo.setPersonalPension((BigDecimal) map.get("t46"));//绱��涓�汉鍏昏€侀噾
                     logger.error("taxDeclarationInfo------------------" + taxDeclarationInfo);
                     IObjectPK save = iTaxDeclaration.save(taxDeclarationInfo);
                     logger.error("taxDeclarationInfo----------save--------" + save);
@@ -219,7 +232,7 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
     }
 
     /***
-     * 封装个税申报数据
+     * 灏佽�涓�◣鐢虫姤鏁版嵁
      * @param batchNo
      * @return
      */
@@ -230,48 +243,48 @@ public class SynIncomeTaxDeclareService implements IHRMsfService {
         IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
         while (iRowSet.next()) {
             Map map = new HashMap();
-            map.put("personId", iRowSet.getString("personId"));//员工Id
-            map.put("taxunitId", iRowSet.getString("taxunitId"));//纳税单位Id
-            map.put("periodbegin", iRowSet.getDate("periodbegin"));//税款所属期间起始时间
-            map.put("periodend", iRowSet.getDate("periodend"));//税款所属期间截止时间
-            map.put("incomeitmemId", iRowSet.getString("incomeitmemId"));//个税项目Id
+            map.put("personId", iRowSet.getString("personId"));//鍛樺伐Id
+            map.put("taxunitId", iRowSet.getString("taxunitId"));//绾崇◣鍗曚綅Id
+            map.put("periodbegin", iRowSet.getDate("periodbegin"));//绋庢�鎵€灞炴湡闂磋捣濮嬫椂闂�
+            map.put("periodend", iRowSet.getDate("periodend"));//绋庢�鎵€灞炴湡闂存埅姝㈡椂闂�
+            map.put("incomeitmemId", iRowSet.getString("incomeitmemId"));//涓�◣椤圭洰Id
             logger.error("getTaxDeclarationDate------iRowSet.getBigDecimal(t1)--------" + iRowSet.getBigDecimal("t1"));
-            map.put("t1", iRowSet.getBigDecimal("t1") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t1"));//本期免税收入
-            map.put("t2", iRowSet.getBigDecimal("t2") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t2"));//基本养老保险费
-            map.put("t3", iRowSet.getBigDecimal("t3") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t3"));//基本医疗保险费
-            map.put("t4", iRowSet.getBigDecimal("t4") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t4"));//失业保险费
-            map.put("t5", iRowSet.getBigDecimal("t5") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t5"));//住房公积金
-            map.put("t6", iRowSet.getBigDecimal("t6") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t6"));//累计子女教育
-            map.put("t7", iRowSet.getBigDecimal("t7") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t7"));//累计继续教育
-            map.put("t8", iRowSet.getBigDecimal("t8") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t8"));//累计住房贷款利息
-            map.put("t9", iRowSet.getBigDecimal("t9") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t9"));//累计住房租金
-            map.put("t10", iRowSet.getBigDecimal("t10") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t10"));//累计赡养老人
-            map.put("t25", iRowSet.getBigDecimal("t25") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t25"));//本期收入
-            map.put("t11", iRowSet.getBigDecimal("t11") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t11"));//其他
-            map.put("t15", iRowSet.getBigDecimal("t15") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t15"));//本期累计收入
-            map.put("t20", iRowSet.getBigDecimal("t20") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t20"));//本期累计免税收入
-            map.put("t22", iRowSet.getBigDecimal("t22") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t22"));//累计减除费用
-            map.put("t24", iRowSet.getBigDecimal("t24") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t24"));//累计专项扣除
-            map.put("t26", iRowSet.getBigDecimal("t26") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t26"));//累计其他扣除
-            map.put("t28", iRowSet.getBigDecimal("t28") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t28"));//累计准予扣除的捐赠
-            map.put("t29", iRowSet.getBigDecimal("t29") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t29"));//累计应纳税所得额
-            map.put("t30", iRowSet.getBigDecimal("t30") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t30"));//税率
-            map.put("t31", iRowSet.getBigDecimal("t31") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t31"));//速算扣除数
-            map.put("t32", iRowSet.getBigDecimal("t32") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t32"));//累计应纳税额
-            map.put("t33", iRowSet.getBigDecimal("t33") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t33"));//累计减免税额
-            map.put("t34", iRowSet.getBigDecimal("t34") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t34"));//累计应扣缴税额
-            map.put("t35", iRowSet.getBigDecimal("t35") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t35"));//累计已预缴税额
-            map.put("t36", iRowSet.getBigDecimal("t36") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t36"));//本期应补(退)税额
-            map.put("t38", iRowSet.getBigDecimal("t38") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t38"));//备注
-            map.put("t41", iRowSet.getBigDecimal("t41") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t41"));//累计婴幼儿照护费用
-            map.put("t45", iRowSet.getBigDecimal("t45") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t45"));//累计个人养老金
+            map.put("t1", iRowSet.getBigDecimal("t1") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t1"));//鏈�湡鍏嶇◣鏀跺叆
+            map.put("t2", iRowSet.getBigDecimal("t2") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t2"));//鍩烘湰鍏昏€佷繚闄╄垂
+            map.put("t3", iRowSet.getBigDecimal("t3") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t3"));//鍩烘湰鍖荤枟淇濋櫓璐�
+            map.put("t4", iRowSet.getBigDecimal("t4") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t4"));//澶变笟淇濋櫓璐�
+            map.put("t5", iRowSet.getBigDecimal("t5") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t5"));//浣忔埧鍏�Н閲�
+            map.put("t6", iRowSet.getBigDecimal("t6") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t6"));//绱��瀛愬コ鏁欒偛
+            map.put("t7", iRowSet.getBigDecimal("t7") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t7"));//绱��缁х画鏁欒偛
+            map.put("t8", iRowSet.getBigDecimal("t8") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t8"));//绱��浣忔埧璐锋�鍒╂伅
+            map.put("t9", iRowSet.getBigDecimal("t9") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t9"));//绱��浣忔埧绉熼噾
+            map.put("t10", iRowSet.getBigDecimal("t10") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t10"));//绱��璧″吇鑰佷汉
+            map.put("t25", iRowSet.getBigDecimal("t25") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t25"));//鏈�湡鏀跺叆
+            map.put("t11", iRowSet.getBigDecimal("t11") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t11"));//鍏朵粬
+            map.put("t15", iRowSet.getBigDecimal("t15") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t15"));//鏈�湡绱��鏀跺叆
+            map.put("t20", iRowSet.getBigDecimal("t20") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t20"));//鏈�湡绱��鍏嶇◣鏀跺叆
+            map.put("t22", iRowSet.getBigDecimal("t22") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t22"));//绱��鍑忛櫎璐圭敤
+            map.put("t24", iRowSet.getBigDecimal("t24") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t24"));//绱��涓撻」鎵i櫎
+            map.put("t26", iRowSet.getBigDecimal("t26") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t26"));//绱��鍏朵粬鎵i櫎
+            map.put("t28", iRowSet.getBigDecimal("t28") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t28"));//绱��鍑嗕簣鎵i櫎鐨勬崘璧�
+            map.put("t29", iRowSet.getBigDecimal("t29") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t29"));//绱��搴旂撼绋庢墍寰楅�
+            map.put("t30", iRowSet.getBigDecimal("t30") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t30"));//绋庣巼
+            map.put("t31", iRowSet.getBigDecimal("t31") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t31"));//閫熺畻鎵i櫎鏁�
+            map.put("t32", iRowSet.getBigDecimal("t32") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t32"));//绱��搴旂撼绋庨�
+            map.put("t33", iRowSet.getBigDecimal("t33") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t33"));//绱��鍑忓厤绋庨�
+            map.put("t34", iRowSet.getBigDecimal("t34") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t34"));//绱��搴旀墸缂寸◣棰�
+            map.put("t35", iRowSet.getBigDecimal("t35") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t35"));//绱��宸查�缂寸◣棰�
+            map.put("t36", iRowSet.getBigDecimal("t36") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t36"));//鏈�湡搴旇ˉ锛堥€€锛夌◣棰�
+            map.put("t38", iRowSet.getBigDecimal("t38") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t38"));//澶囨敞
+            map.put("t41", iRowSet.getBigDecimal("t41") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t41"));//绱��濠村辜鍎跨収鎶よ垂鐢�
+            map.put("t45", iRowSet.getBigDecimal("t45") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("t45"));//绱��涓�汉鍏昏€侀噾
             list.add(map);
         }
         return list;
     }
 
     /**
-     * 查询个税申报人员数据
+     * 鏌ヨ�涓�◣鐢虫姤浜哄憳鏁版嵁
      *
      * @param batchNo
      * @return

+ 1 - 1
websrc/com/kingdee/eas/custom/individualback/TaxPersonRecordListHandlerExEx.java

@@ -415,7 +415,7 @@ public class TaxPersonRecordListHandlerExEx extends TaxPersonRecordListHandlerEx
         sb.append("FPeriodMonth = '").append(month).append("'").append("\n");
         sb.append(" and ").append("\n");
         sb.append("FTaxUnitID = '").append(taxUnitId).append("'").append("\n");
-        sb.append("and FEMPLOYEETYPEID not in(").append("select fid from T_HR_BDEmployeeType where FNUMBER='JZT006' ").append(") ").append("\n");
+        sb.append("and FEMPLOYEETYPEID not in(").append("select fid from T_HR_BDEmployeeType where FNUMBER in('JZT006','JZT022') ").append(") ").append("\n");
         return sb.toString();
     }
 }

+ 1 - 1
websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxDirectDeductionListHandlerEx.java

@@ -340,7 +340,7 @@ public class TaxDirectDeductionListHandlerEx extends TaxDirectDeductionListHandl
             String[] periods=period.split("-");
             map.put("period", periods[0]+"-01");
         } else {
-            map.put("period", (thisYear-1) + "-01");
+            map.put("period", (thisYear) + "-01");
         }
         try {
             List<IObjectPK> list = this._staffCollection(ctx,map);

+ 276 - 243
websrc/com/kingdee/eas/custom/shuiyou/six/handler/TaxPersonRecordListHandlerEx.java

@@ -28,9 +28,12 @@ import com.kingdee.eas.framework.CoreBaseInfo;
 import com.kingdee.eas.framework.util.FilterUtility;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
+import com.kingdee.shr.base.permission.api.auth.SHRUserOrgPermissionApi;
+import com.kingdee.shr.base.syssetting.app.filter.HRFilterUtils;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.util.SHRPermissionWebUtils;
 import com.kingdee.shr.base.syssetting.util.SqlFilter;
 import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
 import com.kingdee.shr.compensation.*;
@@ -80,7 +83,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     /**
-     * 人员报送
+     * 浜哄憳鎶ラ€�
      *
      * @param request
      * @param response
@@ -103,7 +106,6 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
 
                 TaxPersonRecordEntryCollection taxRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(oql);
 
-
                 for (int i = 0; i < taxRecordEntryCollection.size(); ++i) {
                     TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxRecordEntryCollection.get(i);
 
@@ -125,8 +127,8 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
 
             String filter = this.getFilter(request, response, modelMap);
             String curPersonPermTaxUnitSql = CmpTaxUnitPermFilter.getCurPersonPermTaxUnitSql(ctx);
-            String oql = "select id,submitStatus,person.id,personstatus,lastreportmonth  where (submitStatus=0 or submitStatus=3) ";
-            logger.error("------------>>>>_report" + oql);
+            String oql = "select id,submitStatus,taxUnit.id,person.id,personstatus,lastreportmonth  where (submitStatus=0 or submitStatus=3) ";
+            logger.error("------------>>>>_report锛�" + oql);
             if (!StringUtils.isEmpty(selectedIds)) {
                 oql = oql + " and taxUnit.id in (" + curPersonPermTaxUnitSql + ")";
                 oql = oql + " and id in (" + selectedIds + ")";
@@ -137,7 +139,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
 
                 oql = oql + " and " + filter;
             }
-            String msg = "该员工当月还有工资,不能申报为非正常人员。";
+            String msg = "璇ュ憳宸ュ綋鏈堣繕鏈夊伐璧勶紝涓嶈兘鐢虫姤涓洪潪姝e父浜哄憳銆�";
             Boolean bf = false;
             TaxPersonRecordEntryCollection taxRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(oql);
             if (null != taxRecordEntryCollection && taxRecordEntryCollection.size() != 0) {
@@ -147,9 +149,9 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                     if (PersonStatusEnum.NotNormal.equals(personStatusEnum)) {
                         String fid = info.getId().toString();
                         String personid = info.getPerson().getId().toString();
-                        String sel = "select fid from T_HR_SCmpCalTable where FPERSONID=? and FPERIODYEAR=? and FPERIODMONTH=?";
+                        String sel = "select fid from T_HR_SCmpCalTable where FPERSONID=? and FTaxUnitID=? and FPERIODYEAR=? and FPERIODMONTH=?";
                         String[] strs = taxPeriodDate.split("-");
-                        IRowSet rs = DbUtil.executeQuery(ctx, sel, new String[]{personid, strs[0], strs[1]});
+                        IRowSet rs = DbUtil.executeQuery(ctx, sel, new String[]{personid,info.getTaxUnit().getId().toString(), strs[0], strs[1]});
                         if (rs.next()) {
                             bf = true;
                             String upda = "update T_HR_STAXPERSONRECORDENTRY set FSUBMITSTATUS='3',FAILREASON=? where fid=?";
@@ -162,7 +164,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                 map.put("message", msg);
             } else {
 
-                System.err.println("------------>>>>reportAction:taxPeriodDate" + taxPeriodDate);
+                System.err.println("------------>>>>reportAction锛歵axPeriodDate" + taxPeriodDate);
                 ITaxPersonReportExFacade iTaxPersonReportFacade = TaxPersonReportExFacadeFactory.getLocalInstance(ctx);
                 Map<String, Object> paramMap = Maps.newHashMap();
                 paramMap.put("filter", filter);
@@ -176,7 +178,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         } catch (Exception var14) {
             var14.printStackTrace();
             logger.error(var14.getMessage(), var14);
-            System.err.println("--------------->>>>>>>>捕获异常:" + var14.getMessage().toString());
+            System.err.println("--------------->>>>>>>>鎹曡幏寮傚父锛�" + var14.getMessage().toString());
             throw new ShrWebBizException(var14.getMessage());
         }
     }
@@ -311,7 +313,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     protected List<IObjectPK> _report(Context ctx, String entryIDs, String taxPeriodDate, String filter) throws BOSException {
         String curPersonPermTaxUnitSql = CmpTaxUnitPermFilter.getCurPersonPermTaxUnitSql(ctx);
         String oql = "select *,bill.*,bill.person.*,bill.nationality.*,bill.position.*,bill.birthPlace.*,bill.eduLevel.*,bill.bank.name,bill.hrBank.name,taxUnit.id,taxUnit.areacode,taxUnit.name,taxUnit.taxNumber,taxUnit.areaCode,taxUnit.regNumber,taxUnit.declPassword,taxUnit.realPassword where (submitStatus=0 or submitStatus=3) ";
-        logger.error("------------>>>>_report" + oql);
+        logger.error("------------>>>>_report锛�" + oql);
         if (!StringUtils.isEmpty(entryIDs)) {
             oql = oql + " and taxUnit.id in (" + curPersonPermTaxUnitSql + ")";
             oql = oql + " and id in (" + entryIDs + ")";
@@ -360,22 +362,22 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                     reMap.put("TAXUNITID", taxUnitInfo.getId().toString());
                     Set<String> persons = this.getPersonsSet(taxPersonEntitys, sdyf);
                     reMap.put("persons", persons);
-                    //二开开始
+                    //浜屽紑寮€濮�
                     String bizNo = UUID.randomUUID().toString().replace("-", "");
-                    String qymc = taxUnitInfo.getName();//企业名称
-                    String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
-                    String smzh = "";//实名账号
-                    String smmm = "";//实名密码
-                    String jmsmmm = "";//加密实名密码
+                    String qymc = taxUnitInfo.getName();//浼佷笟鍚嶇О
+                    String mmlx = "0";//瀵嗙爜绫诲瀷 0琛ㄧず鐢虫姤瀵嗙爜锛�2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜
+                    String smzh = "";//瀹炲悕璐﹀彿
+                    String smmm = "";//瀹炲悕瀵嗙爜
+                    String jmsmmm = "";//鍔犲瘑瀹炲悕瀵嗙爜
                     String sbmm = "";
                     sbmm = (Base64Utils.decode(taxUnitInfo.getDeclPassword()));
-                    String jmsbmm = "";//申报密码加密
-                    String djxhid = taxUnitInfo.getRegNumber();//登记序号
-                    String nsrsbh = taxUnitInfo.getTaxNumber();//税号
-                    String areaid = taxUnitInfo.getAreaCode();//地区编码
-                    String bmbh = "";//部门编号
-                    String bmmc = "";//部门编码
-                    String skssq = sdyf;//所属期
+                    String jmsbmm = "";//鐢虫姤瀵嗙爜鍔犲瘑
+                    String djxhid = taxUnitInfo.getRegNumber();//鐧昏�搴忓彿
+                    String nsrsbh = taxUnitInfo.getTaxNumber();//绋庡彿
+                    String areaid = taxUnitInfo.getAreaCode();//鍦板尯缂栫爜
+                    String bmbh = "";//閮ㄩ棬缂栧彿
+                    String bmmc = "";//閮ㄩ棬缂栫爜
+                    String skssq = sdyf;//鎵€灞炴湡
                     String lzrqcl = "";
                     JSONObject postBody = new JSONObject();
                     postBody.put("bizNo", bizNo);
@@ -409,21 +411,21 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                         }
                         person.put("skssq", sdyf);
                         Optional<IsOverseaEnum> oversea = Optional.ofNullable(rInfo.getIsOversea());
-                        person.put("rydq", "0".equals(oversea.orElse(IsOverseaEnum.NotOversea).getValue()) ? "境内" : "境外");
-                        person.put("grgbbl", rInfo.getInvestmentRate());//个人投资总额
-                        person.put("grgbze", rInfo.getInvestmentTotal());//个人投资比例
-                        person.put("khyhsfmz", rInfo.getBankCardProvince());//开户银行省份(名字)
-                        person.put("rybscl", "否");//开户银行省份(名字)
+                        person.put("rydq", "0".equals(oversea.orElse(IsOverseaEnum.NotOversea).getValue()) ? "澧冨唴" : "澧冨�");
+                        person.put("grgbbl", rInfo.getInvestmentRate());//涓�汉鎶曡祫鎬婚�
+                        person.put("grgbze", rInfo.getInvestmentTotal());//涓�汉鎶曡祫姣斾緥
+                        person.put("khyhsfmz", rInfo.getBankCardProvince());//寮€鎴烽摱琛岀渷浠�(鍚嶅瓧)
+                        person.put("rybscl", "鍚�");//寮€鎴烽摱琛岀渷浠�(鍚嶅瓧)
                         rylb.add(person);
                     }
                     postBody.put("rylb", rylb);
                     String ip = propt.get("ip");
                     String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
-                    logger.error("===请求参数==" + postBody + "========");
+                    logger.error("===璇锋眰鍙傛暟==" + postBody + "========");
                     String post = localInstance.post(url, postBody.toJSONString());
                     System.out.println(post);
                     JSONObject postJSON = JSONObject.parseObject(post);
-                    //校验 请求是否成功
+                    //鏍¢獙 璇锋眰鏄�惁鎴愬姛
                     JSONObject head = postJSON.getJSONObject("head");
                     String code = (String) head.get("code");
                     if ("00000000".equals(code)) {
@@ -433,11 +435,11 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                         List<Object[]> recordEntryParamsList = this.getParamsList(entryBaseCollection, taskId);
                         String recordEntrySql = "update T_HR_STaxPersonRecordEntry set FSubmitStatus= ?, FIdentityStatus=?,CFTaskID=?, FLastReportMonth=?,FEndDate=? where fid =?";
                         DbUtil.executeBatch(ctx, recordEntrySql, recordEntryParamsList);
-                        logger.info("--------->>>>>更新报送状态、验证状态:recordEntrySql:" + recordEntrySql + "------>>>>recordEntryParamsList:" + recordEntryParamsList + "---------->>>addTask:" + taskId);
+                        logger.info("--------->>>>>鏇存柊鎶ラ€佺姸鎬併€侀獙璇佺姸鎬侊細recordEntrySql:" + recordEntrySql + "------>>>>recordEntryParamsList:" + recordEntryParamsList + "---------->>>addTask:" + taskId);
                         List<Object[]> recordParamsList = this.getParamsList(billBaseCollection, (String) null);
                         String recordSql = "update T_HR_STaxPersonRecord set FBankCardStatus=? where fid =?";
                         DbUtil.executeBatch(ctx, recordSql, recordParamsList);
-                        logger.info("--------->>>>>更新银行卡号状态:recordSql:" + recordSql + "------>>>>recordParamsList:" + recordParamsList);
+                        logger.info("--------->>>>>鏇存柊閾惰�鍗″彿鐘舵€侊細recordSql:" + recordSql + "------>>>>recordParamsList:" + recordParamsList);
                         arrayList.add(taskId);
                     }
                 }
@@ -445,7 +447,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
             }
         } catch (Exception var28) {
             logger.error(var28.getMessage(), var28);
-            logger.error("------------>>>>捕获异常:" + var28.getMessage());
+            logger.error("------------>>>>鎹曡幏寮傚父锛�" + var28.getMessage());
             throw new BOSException(var28.getMessage(), var28);
         }
     }
@@ -470,24 +472,24 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         FilterInfo filter = defaultEntityViewInfo.getFilter();
         HttpSession session = request.getSession();
         EntityViewInfo sessionEV = null;
+        Context ctx = SHRContext.getInstance().getContext();
         try {
             sessionEV = new EntityViewInfo((String) session.getAttribute("queryFilter"));
             FilterInfo filterInfo = new FilterInfo();
-            filterInfo.getFilterItems().add(new FilterItemInfo("person.id in(" + this.getSCmpCalTablePersonsSql(request, null, null) + ")"));
+            //String sql = SHRPermissionWebUtils.getCurrentRequestAdminOrgRangeSQL(request);
+
+            filterInfo.getFilterItems().add(new FilterItemInfo("person.id in(" + this.getSCmpCalTablePersonsSql(request, null, null,ctx) + ")"));
             if (FilterUtility.hasFilterItem(sessionEV.getFilter())) {
                 sessionEV.getFilter().mergeFilter(filterInfo, "AND");
-
             } else {
                 sessionEV.setFilter(filterInfo);
-
             }
             FilterInfo filterInfo2 = new FilterInfo();
-            filterInfo2.getFilterItems().add(new FilterItemInfo("person.id in(" + this.getSCmpCalTablePersonsSql(request, null, null) + ")"));
+            filterInfo2.getFilterItems().add(new FilterItemInfo("person.id in(" + this.getSCmpCalTablePersonsSql(request, null, null,ctx) + ")"));
             if (FilterUtility.hasFilterItem(filter)) {
                 defaultEntityViewInfo.getFilter().mergeFilter(filterInfo2, "AND");
             } else {
                 defaultEntityViewInfo.setFilter(filterInfo2);
-
             }
             session.setAttribute("queryFilter", sessionEV.toString());
         } catch (ParserException e) {
@@ -498,17 +500,17 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     /**
-     * 获取薪酬核算人员
-     *
-     * @param year    统计年
-     * @param month   统计月
-     * @param request 纳税单位
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
+     * 瑕佹牴鎹�綋鍓嶅憳宸ヨ�鏀跨粍缁囪寖鍥寸殑钖�叕鏍哥畻鐨勭粍缁囧�鑷存參杩囨护
+     * @param year    缁熻�骞�
+     * @param month   缁熻�鏈�
+     * @param request 绾崇◣鍗曚綅
      */
-    public String getSCmpCalTablePersonsSql(HttpServletRequest request, Integer year, Integer month) throws SHRWebException {
+    public String getSCmpCalTablePersonsSql(HttpServletRequest request, Integer year, Integer month,Context ctx) throws SHRWebException {
         String userAdminOrgRangeSql = this.assembleTreeDataUserAdminOrgRangeSQL(request);
         StringBuilder sb = new StringBuilder();
         sb.append("SELECT").append("\n");
-        sb.append("FPersonID as personId").append("\n");
+        sb.append(" DISTINCT FPersonID as personId").append("\n");
         sb.append("FROM T_HR_SCmpCalTable").append("\n");
         sb.append("WHERE").append("\n");
         if (null != year && null != month) {
@@ -517,8 +519,14 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
             sb.append("FPeriodMonth = '").append(month).append("'").append("\n");
             sb.append(" and ").append("\n");
         }
-        sb.append("FADMINORGUNITID in (").append(userAdminOrgRangeSql).append(")").append("\n");
-        sb.append("group by FPersonID ").append("\n");
+        String sql = CmpTaxUnitPermFilter.getCurPersonPermTaxUnitSql(ctx);
+        String inRange = "''";
+        if (!"".equals(sql)) {
+            sb.append("FTAXUNITID in ("+sql+")").append("\n");
+            sb.append(" and ").append("\n");
+        }
+        sb.append(" CFCalOrgUnitId in (").append(userAdminOrgRangeSql).append(")").append("\n");
+        //sb.append("group by FPersonID ").append("\n");
         return sb.toString();
     }
 
@@ -606,7 +614,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     public String personnelReportAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-        logger.error("==进入到==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
+        logger.error("==杩涘叆鍒�==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
         Context context = SHRContext.getInstance().getContext();
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Map<String, Object> returnMap = new HashMap<String, Object>();
@@ -623,23 +631,23 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
             for (int i = 0; i < taxUnitCollection.size(); i++) {
                 TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
                 String bizNo = UUID.randomUUID().toString().replace("-", "");
-                String qymc = taxUnitInfo.getName();//企业名称
-                String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
-                String smzh = "";//实名账号
-                String smmm = "";//实名密码
-                String jmsmmm = "";//加密实名密码
+                String qymc = taxUnitInfo.getName();//浼佷笟鍚嶇О
+                String mmlx = "0";//瀵嗙爜绫诲瀷 0琛ㄧず鐢虫姤瀵嗙爜锛�2琛ㄧず瀹炲悕璐﹀彿瀹炲悕瀵嗙爜
+                String smzh = "";//瀹炲悕璐﹀彿
+                String smmm = "";//瀹炲悕瀵嗙爜
+                String jmsmmm = "";//鍔犲瘑瀹炲悕瀵嗙爜
                 String sbmm = "";
                 if (taxUnitInfo.getDeclPassword() != null && !"".equals(taxUnitInfo.getDeclPassword())) {
                     byte[] decode = Base64.getDecoder().decode(taxUnitInfo.getDeclPassword());
-                    sbmm = new String(decode);//;//申报密码
+                    sbmm = new String(decode);//;//鐢虫姤瀵嗙爜
                 }
-                String jmsbmm = "";//申报密码加密
-                String djxhid = taxUnitInfo.getRegNumber();//登记序号
-                String nsrsbh = taxUnitInfo.getTaxNumber();//税号
-                String areaid = taxUnitInfo.getAreaCode();//地区编码
-                String bmbh = "";//部门编号
-                String bmmc = "";//部门编码
-                String skssq = taxPeriodDate;//所属期  ----还不知道怎么定这个东西
+                String jmsbmm = "";//鐢虫姤瀵嗙爜鍔犲瘑
+                String djxhid = taxUnitInfo.getRegNumber();//鐧昏�搴忓彿
+                String nsrsbh = taxUnitInfo.getTaxNumber();//绋庡彿
+                String areaid = taxUnitInfo.getAreaCode();//鍦板尯缂栫爜
+                String bmbh = "";//閮ㄩ棬缂栧彿
+                String bmmc = "";//閮ㄩ棬缂栫爜
+                String skssq = taxPeriodDate;//鎵€灞炴湡  ----杩樹笉鐭ラ亾鎬庝箞瀹氳繖涓�笢瑗�
                 String lzrqcl = "";
                 JSONObject postBody = new JSONObject();
                 postBody.put("bizNo", bizNo);
@@ -679,99 +687,99 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                     personInfo = new JSONObject();
                     TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntrys.get(j);
                     TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
-                    String xm = bill.getReportName();//姓名
-                    String zzlx = bill.getCardType().getAlias();//证件类型
-                    String zzhm = bill.getCardNumber();//证件号码
-                    String s = cardTypeReflection(zzlx);//证件类型
+                    String xm = bill.getReportName();//濮撳悕
+                    String zzlx = bill.getCardType().getAlias();//璇佷欢绫诲瀷
+                    String zzhm = bill.getCardNumber();//璇佷欢鍙风爜
+                    String s = cardTypeReflection(zzlx);//璇佷欢绫诲瀷
                     Boolean cardType = isCardType(s);
-                    String qtzzlx = "";//其他证件类型
-                    String qtzzhm = "";//其他证件号码
+                    String qtzzlx = "";//鍏朵粬璇佷欢绫诲瀷
+                    String qtzzhm = "";//鍏朵粬璇佷欢鍙风爜
                     if (cardType) {
-                        qtzzlx = cardTypeReflection(bill.getOtherCardType().getAlias());//其他证件类型
-                        qtzzhm = bill.getOtherCardNumber();//其他证件号码
+                        qtzzlx = cardTypeReflection(bill.getOtherCardType().getAlias());//鍏朵粬璇佷欢绫诲瀷
+                        qtzzhm = bill.getOtherCardNumber();//鍏朵粬璇佷欢鍙风爜
                     }
-                    String bmbh1 = "";//部门编码
-                    String rybscl = "";//人员报送策略
-                    String gh = "";//工号
-                    String skssq1 = taxPeriodDate;//所属期
-                    String lxdh = bill.getPhoneNumber(); //电话
-                    String nsrzt = taxPersonRecordEntryInfo.getPersonStatus().getValue();//人员状态
-                    String sfgy = taxPersonRecordEntryInfo.getEmployedType().getAlias();//任职受雇类型
-                    String rzndjyqk = "";//入职年度就业情形
-                    String rzsgrq = "";//受雇日期
-                    if ("雇员、保险营销员、证券经纪人".indexOf(sfgy) >= 0) {
+                    String bmbh1 = "";//閮ㄩ棬缂栫爜
+                    String rybscl = "";//浜哄憳鎶ラ€佺瓥鐣�
+                    String gh = "";//宸ュ彿
+                    String skssq1 = taxPeriodDate;//鎵€灞炴湡
+                    String lxdh = bill.getPhoneNumber(); //鐢佃瘽
+                    String nsrzt = taxPersonRecordEntryInfo.getPersonStatus().getValue();//浜哄憳鐘舵€�
+                    String sfgy = taxPersonRecordEntryInfo.getEmployedType().getAlias();//浠昏亴鍙楅泧绫诲瀷
+                    String rzndjyqk = "";//鍏ヨ亴骞村害灏变笟鎯呭舰
+                    String rzsgrq = "";//鍙楅泧鏃ユ湡
+                    if ("闆囧憳銆佷繚闄╄惀閿€鍛樸€佽瘉鍒哥粡绾�汉".indexOf(sfgy) >= 0) {
                         Date employedDate = taxPersonRecordEntryInfo.getEmployedDate();
                         rzsgrq = simpleDateFormat.format(employedDate);
                     }
-                    String xb = bill.getGender().getAlias();//性别
-                    String csny = simpleDateFormat.format(bill.getBirthday());//出生日期
-                    String gj = NationalityFactory.getLocalInstance(context).getNationalityInfo(new ObjectUuidPK(bill.getNationality().getId())).getName();//国际
-                    String rydq = bill.getIsOversea().getAlias();//是否境内
-                    if (rydq.equals("")) {
-                        rydq = "境内";
+                    String xb = bill.getGender().getAlias();//鎬у埆
+                    String csny = simpleDateFormat.format(bill.getBirthday());//鍑虹敓鏃ユ湡
+                    String gj = NationalityFactory.getLocalInstance(context).getNationalityInfo(new ObjectUuidPK(bill.getNationality().getId())).getName();//鍥介檯
+                    String rydq = bill.getIsOversea().getAlias();//鏄�惁澧冨唴
+                    if (rydq.equals("鍚�")) {
+                        rydq = "澧冨唴";
                     } else {
-                        rydq = "境外";
+                        rydq = "澧冨�";
                     }
-                    String lzrq = "";//离职日期
+                    String lzrq = "";//绂昏亴鏃ユ湡
                     if (nsrzt.equals("0")) {
                         lzrq = simpleDateFormat.format(taxPersonRecordEntryInfo.getDepartureDate());
                     }
-                    BigDecimal grgbbl = bill.getInvestmentRate();//个人投资总额
-                    BigDecimal grgbze = bill.getInvestmentTotal();//个人投资比例
-                    String sfcj = bill.isIsDisability() ? "是" : "否";
-                    String cjzjlx = "";//残疾证件类型
-                    String cjzh = "";//残疾证号
-                    if ("".equals(sfcj)) {
-                        cjzjlx = "";//           系统没有需要加
+                    BigDecimal grgbbl = bill.getInvestmentRate();//涓�汉鎶曡祫鎬婚�
+                    BigDecimal grgbze = bill.getInvestmentTotal();//涓�汉鎶曡祫姣斾緥
+                    String sfcj = bill.isIsDisability() ? "鏄�" : "鍚�";
+                    String cjzjlx = "";//娈嬬柧璇佷欢绫诲瀷
+                    String cjzh = "";//娈嬬柧璇佸彿
+                    if ("鏄�".equals(sfcj)) {
+                        cjzjlx = "";//           绯荤粺娌℃湁闇€瑕佸姞
                         cjzh = bill.getDisCardNumber();
                     }
-                    String sfls = bill.isIsHero() ? "是" : "否";
+                    String sfls = bill.isIsHero() ? "鏄�" : "鍚�";
                     String lszh = "";
-                    if ("".equals(sfls)) {
+                    if ("鏄�".equals(sfls)) {
                         lszh = bill.getHeroCardNumber();
                     }
-                    String sfgl = ""; //是否孤老
-                    String sfzdw = "";//是否扣除减除费用
-                    String dzyx = "";//邮箱
+                    String sfgl = ""; //鏄�惁瀛よ€�
+                    String sfzdw = "";//鏄�惁鎵i櫎鍑忛櫎璐圭敤
+                    String dzyx = "";//閭��
                     String xl = "";
-                    String zw = "";//	职务
-                    String khyh = "";//	开户银行
-                    String khyhsfmz = "";//	开户银行省份
-                    String yhzh = "";//	银行账号
-                    String lxdz_sheng = "";//	居住省份
-                    String lxdz_shi = "";//	居住城市
-                    String lxdz_qx = "";//	居住区县
-                    String lxdz_jd = "";//	居住街道
-                    String lxdz = "";//	居住详细地址
-                    String hjszd_sheng = "";//	户籍省份
-                    String hjszd_shi = "";//	户籍城市
-                    String hjszd_qx = "";//	户籍区县
-                    String hjszd_jd = "";//	户籍街道
-                    String hjszd_xxdz = "";//	户籍详细地址
-                    String bz = "";//	备注
+                    String zw = "";//	鑱屽姟
+                    String khyh = "";//	寮€鎴烽摱琛�
+                    String khyhsfmz = "";//	寮€鎴烽摱琛岀渷浠�
+                    String yhzh = "";//	閾惰�璐﹀彿
+                    String lxdz_sheng = "";//	灞呬綇鐪佷唤
+                    String lxdz_shi = "";//	灞呬綇鍩庡競
+                    String lxdz_qx = "";//	灞呬綇鍖哄幙
+                    String lxdz_jd = "";//	灞呬綇琛楅亾
+                    String lxdz = "";//	灞呬綇璇︾粏鍦板潃
+                    String hjszd_sheng = "";//	鎴风睄鐪佷唤
+                    String hjszd_shi = "";//	鎴风睄鍩庡競
+                    String hjszd_qx = "";//	鎴风睄鍖哄幙
+                    String hjszd_jd = "";//	鎴风睄琛楅亾
+                    String hjszd_xxdz = "";//	鎴风睄璇︾粏鍦板潃
+                    String bz = "";//	澶囨敞
                     String csd = "";
                     String sssx = "";
-                    if (gj.indexOf("中国") < 0) {
+                    if (gj.indexOf("涓�浗") < 0) {
                         logger.error(JSONObject.toJSONString(bill.getBirthPlace()));
                         logger.error(bill.getBirthPlace().getId());
                         csd = BirthplaceFactory.getLocalInstance(context).
                                 getBirthplaceInfo(new ObjectUuidPK(bill.getBirthPlace().getId())).getName();
                         sssx = bill.getTaxReason().getAlias();
                     }
-                    String ss = "港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时";
+                    String ss = "娓�境灞呮皯鏉ュ線鍐呭湴閫氳�璇併€佹腐婢冲眳姘戝眳浣忚瘉銆佸彴婀惧眳姘戞潵寰€澶ч檰閫氳�璇併€佸彴婀惧眳姘戝眳浣忚瘉銆佸�鍥芥姢鐓с€佸�鍥戒汉姘镐箙灞呯暀韬�唤璇併€佸�鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丄銆佸�鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丅銆佸�鍥戒汉鏉ュ崕宸ヤ綔璁稿彲璇丆鏃�";
                     String scrjsj = "";
                     String yjljsj = "";
                     if (ss.indexOf(s) >= 0) {
                         scrjsj = simpleDateFormat.format(bill.getEntryDate());
                         yjljsj = simpleDateFormat.format(bill.getLeaveDate());
                     }
-                    String wjrlxdz_sheng = "";//	联系地省份
-                    String wjrlxdz_shi = "";//	联系地城市
-                    String wjrlxdz_qx = "";//	联系地区县
-                    String wjrlxdz_jd = "";//	联系地街道
-                    String wjrlxdz_xxdz = "";//	联系地详细地址
-                    String xmzw = "";//	中文名
-                    ss = "外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)";
+                    String wjrlxdz_sheng = "";//	鑱旂郴鍦扮渷浠�
+                    String wjrlxdz_shi = "";//	鑱旂郴鍦板煄甯�
+                    String wjrlxdz_qx = "";//	鑱旂郴鍦板尯鍘�
+                    String wjrlxdz_jd = "";//	鑱旂郴鍦拌�閬�
+                    String wjrlxdz_xxdz = "";//	鑱旂郴鍦拌�缁嗗湴鍧€
+                    String xmzw = "";//	涓�枃鍚�
+                    ss = "澶栧浗鎶ょ収銆佸�鍥戒汉姘镐箙灞呯暀韬�唤璇併€佸�鍥戒汉宸ヤ綔璁稿彲璇侊紙A绫伙級銆佸�鍥戒汉宸ヤ綔璁稿彲璇侊紙B绫伙級銆佸�鍥戒汉宸ヤ綔璁稿彲璇侊紙C绫伙級";
                     if (ss.indexOf(s) < 0) {
                         xmzw = bill.getChineseName();
                     }
@@ -786,9 +794,9 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                     personInfo.put("skssq", skssq1);
                     personInfo.put("lxdh", lxdh);
                     if (nsrzt.equals("1")) {
-                        nsrzt = "正常";
+                        nsrzt = "姝e父";
                     } else {
-                        nsrzt = "非正常";
+                        nsrzt = "闈炴�甯�";
                     }
                     personInfo.put("nsrzt", nsrzt);
                     personInfo.put("sfgy", sfgy);
@@ -841,16 +849,16 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                 postBody.put("rylb", rylb);
                 String ip = propt.get("ip");
                 String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
-                logger.error("===请求参数==" + postBody + "========");
+                logger.error("===璇锋眰鍙傛暟==" + postBody + "========");
 
                 String post = localInstance.post(url, postBody.toJSONString());
                 System.out.println(post);
                 JSONObject postJSON = JSONObject.parseObject(post);
-                //校验 请求是否成功
+                //鏍¢獙 璇锋眰鏄�惁鎴愬姛
                 JSONObject head = postJSON.getJSONObject("head");
                 if (head.getString("status").equals("N")) {
                     returnMap.put("code", 500);
-                    returnMap.put("error", "请求失败");
+                    returnMap.put("error", "璇锋眰澶辫触");
                     JSONUtils.SUCCESS(returnMap);
                     return null;
                 }
@@ -858,10 +866,10 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                 String string = body.getString("requestId");
 
                 String s = localInstance.addTask("personnelReportService", JSONUtil.toJsonStr(body), TaskCatalogEnum.PERSON, null);
-                logger.error("返回参数:" + post);
-                logger.error("返回参数:" + s);
+                logger.error("杩斿洖鍙傛暟锛�" + post);
+                logger.error("杩斿洖鍙傛暟锛�" + s);
                 returnMap.put("code", 200);
-                returnMap.put("info", "报送成功");
+                returnMap.put("info", "鎶ラ€佹垚鍔�");
                 JSONUtils.SUCCESS(returnMap);
             }
 
@@ -877,34 +885,34 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
 
     public String cardTypeReflection(String cardTypeName) {
         switch (cardTypeName) {
-            case "居民身份证":
-                return "居民身份证";
-            case "中国护照":
-                return "中国护照";
-            case "港澳居民来往内地通行证":
-                return "港澳居民来往内地通行证";
-            case "中华人民共和国港澳居民居住证":
-                return "港澳居民来往内地通行证";
-            case "台湾居民来往大陆通行证":
-                return "台湾居民来往大陆通行证";
-            case "中华人民共和国台湾居民居住证":
-                return "台湾居民居住证";
-            case "外国护照":
-                return "外国护照";
-            case "外国人永久居留身份证":
-                return "外国人永久居留身份证";
-            case "中华人民共和国外国人工作许可证(A类)":
-                return "外国人工作许可证(A类)";
-            case "中华人民共和国外国人工作许可证(B类)":
-                return "外国人工作许可证(B类)";
-            case "中华人民共和国外国人工作许可证(C类)":
-                return "外国人工作许可证(C类)";
+            case "灞呮皯韬�唤璇�":
+                return "灞呮皯韬�唤璇�";
+            case "涓�浗鎶ょ収":
+                return "涓�浗鎶ょ収";
+            case "娓�境灞呮皯鏉ュ線鍐呭湴閫氳�璇�":
+                return "娓�境灞呮皯鏉ュ線鍐呭湴閫氳�璇�";
+            case "涓�崕浜烘皯鍏卞拰鍥芥腐婢冲眳姘戝眳浣忚瘉":
+                return "娓�境灞呮皯鏉ュ線鍐呭湴閫氳�璇�";
+            case "鍙版咕灞呮皯鏉ュ線澶ч檰閫氳�璇�":
+                return "鍙版咕灞呮皯鏉ュ線澶ч檰閫氳�璇�";
+            case "涓�崕浜烘皯鍏卞拰鍥藉彴婀惧眳姘戝眳浣忚瘉":
+                return "鍙版咕灞呮皯灞呬綇璇�";
+            case "澶栧浗鎶ょ収":
+                return "澶栧浗鎶ょ収";
+            case "澶栧浗浜烘案涔呭眳鐣欒韩浠借瘉":
+                return "澶栧浗浜烘案涔呭眳鐣欒韩浠借瘉";
+            case "涓�崕浜烘皯鍏卞拰鍥藉�鍥戒汉宸ヤ綔璁稿彲璇侊紙A绫伙級":
+                return "澶栧浗浜哄伐浣滆�鍙�瘉锛圓绫伙級";
+            case "涓�崕浜烘皯鍏卞拰鍥藉�鍥戒汉宸ヤ綔璁稿彲璇侊紙B绫伙級":
+                return "澶栧浗浜哄伐浣滆�鍙�瘉锛圔绫伙級";
+            case "涓�崕浜烘皯鍏卞拰鍥藉�鍥戒汉宸ヤ綔璁稿彲璇侊紙C绫伙級":
+                return "澶栧浗浜哄伐浣滆�鍙�瘉锛圕绫伙級";
         }
         return "";
     }
 
     public Boolean isCardType(String cardType) {
-        String cardTypes = "港澳居民居住证,台湾居民居住证,外国人永久居留身份证,外国人工作许可证(A类),外国人工作许可证(B类),外国人工作许可证(C类)";
+        String cardTypes = "娓�境灞呮皯灞呬綇璇�,鍙版咕灞呮皯灞呬綇璇�,澶栧浗浜烘案涔呭眳鐣欒韩浠借瘉,澶栧浗浜哄伐浣滆�鍙�瘉锛圓绫伙級,澶栧浗浜哄伐浣滆�鍙�瘉锛圔绫伙級,澶栧浗浜哄伐浣滆�鍙�瘉锛圕绫伙級";
         if (cardTypes.indexOf(cardType) >= 0) {
             return true;
         } else {
@@ -913,8 +921,8 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     /**
-     * todo 薪酬核算关联人员纳税信息
-     * 同步人员纳税信息
+     * todo 钖�叕鏍哥畻鍏宠仈浜哄憳绾崇◣淇℃伅
+     * 鍚屾�浜哄憳绾崇◣淇℃伅
      *
      * @param request
      * @param response
@@ -927,10 +935,10 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         String yearMonth = (String) request.getParameter("yearMonth");
         String mack = (String) request.getParameter("mack");
         if (StringUtils.isEmpty(taxUnitIds)) {
-            throw new ShrWebBizException("纳税单位不可为空!!");
+            throw new ShrWebBizException("绾崇◣鍗曚綅涓嶅彲涓虹┖!!");
         }
         if (StringUtils.isEmpty(yearMonth)) {
-            throw new ShrWebBizException("所属年月不可为空!!");
+            throw new ShrWebBizException("鎵€灞炲勾鏈堜笉鍙�负绌�!!");
         }
         try {
             Context ctx = SHRContext.getInstance().getContext();
@@ -938,7 +946,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
             IPerson iPerson = PersonFactory.getLocalInstance(ctx);
 
             ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
-            //截取日期年月
+            //鎴�彇鏃ユ湡骞存湀
             String[] parts = yearMonth.split("-");
             int year = Integer.parseInt(parts[0]);
             int month = Integer.parseInt(parts[1]);
@@ -964,32 +972,32 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
             for (String taxUnitId : taxUnitIdArray) {
                 //IRowSet rsAlike = DbUtil.executeQuery(ctx,this.getSCmpCalTablePersonsSqlAlike(year,month,taxUnitId));
                 //if("AndNew".equals(mack)) {
-                    //新增
+                    //鏂板�
                     IRowSet rsAndNew = DbUtil.executeQuery(ctx, this.getSCmpCalTablePersonsSqlAndNew(year, month, taxUnitId));
                     while (rsAndNew.next()) {
                         String person = rsAndNew.getString("FPERSONID");
                         String scctId = rsAndNew.getString("scctId");
                         PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(person), sic);
-                        //保存
+                        //淇濆瓨
                         this.setTaxPersonRecordAndNew(personInfo, taxUnitId, yearMonth, oneDay, iTaxPersonRecord, iTaxPersonRecordEntry,scctId);
                     }
                 //}
                // if("Del".equals(mack)) {
-                    //删除
+                    //鍒犻櫎
                     IRowSet rsDel = DbUtil.executeQuery(ctx, this.getSCmpCalTablePersonsSqlDel(year, month, taxUnitId));
                     while (rsDel.next()) {
                         String person = rsDel.getString("FPERSONID");
                         PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(person), sic);
                         String rentryId = rsDel.getString("rentryId");
-                        //变更
+                        //鍙樻洿
                         this.setTaxPersonRecordDel(rentryId, oneDay, iTaxPersonRecordEntry);
                     }
                // }
             }
-            //第二遍处理变更
+            //绗�簩閬嶅�鐞嗗彉鏇�
             for (String taxUnitId : taxUnitIdArray) {
                 //if("Alter".equals(mack)) {
-                //变更
+                //鍙樻洿
                 IRowSet rsAlter = DbUtil.executeQuery(ctx, this.getSCmpCalTablePersonsSqlAlter(year, month, taxUnitId));
                 while (rsAlter.next()) {
                     String person = rsAlter.getString("FPERSONID");
@@ -998,7 +1006,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
                     String scctId = rsAlter.getString("scctId");
                     String rentryId = rsAlter.getString("rentryId");
                     String FBILLID = rsAlter.getString("FBILLID");
-                    //判断是否存在
+                    //鍒ゆ柇鏄�惁瀛樺湪
                     StringBuilder sel = new StringBuilder();
                     sel.append(" select fid from T_HR_STAXPERSONRECORDENTRY ");
                     sel.append(" where fpersonid='" + person + "' and FTaxUnitID ='" + scctTaxUnitID + "' and FPERSONSTATUS=1 ");
@@ -1017,8 +1025,8 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     /**
-     * 离职状态
-     * 在核算表里没查到该员工,在当前列表中能查到该员工,此情况为员工当月离职,处理逻辑为,把当前列表中状态为正常的这条数据做离职处理,状态改成非正常,离职日期为同步人员信息时选择月份的下个月月末
+     * 绂昏亴鐘舵€�
+     * 鍦ㄦ牳绠楄〃閲屾病鏌ュ埌璇ュ憳宸ワ紝鍦ㄥ綋鍓嶅垪琛ㄤ腑鑳芥煡鍒拌�鍛樺伐锛屾�鎯呭喌涓哄憳宸ュ綋鏈堢�鑱岋紝澶勭悊閫昏緫涓猴紝鎶婂綋鍓嶅垪琛ㄤ腑鐘舵€佷负姝e父鐨勮繖鏉℃暟鎹�仛绂昏亴澶勭悊锛岀姸鎬佹敼鎴愰潪姝e父锛岀�鑱屾棩鏈熶负鍚屾�浜哄憳淇℃伅鏃堕€夋嫨鏈堜唤鐨勪笅涓�湀鏈堟湯
      *
      * @param rentryId
      * @param oneDay
@@ -1028,7 +1036,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
      */
     public void setTaxPersonRecordDel(String rentryId, Date oneDay,
                                       ITaxPersonRecordEntry iTaxPersonRecordEntry) throws EASBizException, BOSException {
-        //变更
+        //鍙樻洿
         SelectorItemCollection sics = new SelectorItemCollection();
         sics.add("submitStatus");
         sics.add("departureDate");
@@ -1040,7 +1048,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         entryInfo.setSubmitStatus(SubmitStatusEnum.NotSubmit);
         Calendar departureDate = Calendar.getInstance();
         departureDate.setTime(oneDay);
-        departureDate.add(Calendar.MONTH, 1);
+        //departureDate.add(Calendar.MONTH, 1);
         departureDate.add(Calendar.DAY_OF_MONTH, -1);
         entryInfo.setDepartureDate(departureDate.getTime());
         entryInfo.setPersonStatus(PersonStatusEnum.NotNormal);
@@ -1048,60 +1056,60 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
     }
 
     /**
-     * 纳税单位不一致,说明员工发生了调动,此时,需要把当前列表中状态为正常的这条数据做离职处理,状态改成非正常,离职日期为同步人员信息时选择月份的下个月月末,并且新增一条纳税单位为
-     * 同步人员信息时选择的纳税单位下的纳税人员信息,受雇从业开始时间为同步人员信息时选择月份的下个月一号
+     * 绾崇◣鍗曚綅涓嶄竴鑷达紝璇存槑鍛樺伐鍙戠敓浜嗚皟鍔�紝姝ゆ椂锛岄渶瑕佹妸褰撳墠鍒楄〃涓�姸鎬佷负姝e父鐨勮繖鏉℃暟鎹�仛绂昏亴澶勭悊锛岀姸鎬佹敼鎴愰潪姝e父锛岀�鑱屾棩鏈熶负鍚屾�浜哄憳淇℃伅鏃堕€夋嫨鏈堜唤鐨勪笅涓�湀鏈堟湯锛屽苟涓旀柊澧炰竴鏉$撼绋庡崟浣嶄负
+     * 鍚屾�浜哄憳淇℃伅鏃堕€夋嫨鐨勭撼绋庡崟浣嶄笅鐨勭撼绋庝汉鍛樹俊鎭�紝鍙楅泧浠庝笟寮€濮嬫椂闂翠负鍚屾�浜哄憳淇℃伅鏃堕€夋嫨鏈堜唤鐨勪笅涓�湀涓€鍙�
      */
     public void setTaxPersonRecordAlter(PersonInfo personInfo, String billId, String scctTaxUnitID, String yearMonth, Date oneDay,
                                         String rentryId, ITaxPersonRecordEntry iTaxPersonRecordEntry,String sccid) throws EASBizException, BOSException {
-        //变更
-        //离职状态
+        //鍙樻洿
+        //绂昏亴鐘舵€�
         this.setTaxPersonRecordDel(rentryId, oneDay, iTaxPersonRecordEntry);
-        //人员纳税分录对象
+        //浜哄憳绾崇◣鍒嗗綍瀵硅薄
         TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = new TaxPersonRecordEntryInfo();
-        //证件类型
+        //璇佷欢绫诲瀷
         if (personInfo.getIdCardNO() != null || personInfo.getPassportNO() != null) {
             if (null == personInfo.getIdCardNO()) {
-                //护照
-                //纳税人类型
+                //鎶ょ収
+                //绾崇◣浜虹被鍨�
                 taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.NotResident);
             }
             if (null == personInfo.getPassportNO()) {
-                //证件号
-                //纳税人类型
+                //璇佷欢鍙�
+                //绾崇◣浜虹被鍨�
                 taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.Resident);
             }
             TaxPersonRecordInfo taxPersonRecordInfo = new TaxPersonRecordInfo();
             taxPersonRecordInfo.setId(BOSUuid.read(billId));
             taxPersonRecordEntryInfo.setBill(taxPersonRecordInfo);
-            //保存分录数据
+            //淇濆瓨鍒嗗綍鏁版嵁
             taxPersonRecordEntryInfo.setPerson(personInfo);
-            //获取纳税单位
+            //鑾峰彇绾崇◣鍗曚綅
             TaxUnitInfo taxUnitInfo = new TaxUnitInfo();
             taxUnitInfo.setId(BOSUuid.read(scctTaxUnitID));
             taxPersonRecordEntryInfo.setTaxUnit(taxUnitInfo);
             taxPersonRecordEntryInfo.setSimpleName(sccid);
 
-            //人员状态
+            //浜哄憳鐘舵€�
             taxPersonRecordEntryInfo.setPersonStatus(PersonStatusEnum.Normal);
-            //获取下月的最后一天转成Date类型 //任职受雇从业日期为当前月第一天
+            //鑾峰彇涓嬫湀鐨勬渶鍚庝竴澶╄浆鎴怐ate绫诲瀷 //浠昏亴鍙楅泧浠庝笟鏃ユ湡涓哄綋鍓嶆湀绗�竴澶�
             taxPersonRecordEntryInfo.setEmployedDate(oneDay);
-            //报送状态
+            //鎶ラ€佺姸鎬�
             taxPersonRecordEntryInfo.setSubmitStatus(SubmitStatusEnum.NotSubmit);
             taxPersonRecordEntryInfo.setLastReportMonth(yearMonth);
-            //任职受雇从业类型  默认雇员
+            //浠昏亴鍙楅泧浠庝笟绫诲瀷  榛樿�闆囧憳
             taxPersonRecordEntryInfo.setEmployedType(EmployedTypeEnum.Employee);
-            //是否扣除减除费用 默认是
+            //鏄�惁鎵i櫎鍑忛櫎璐圭敤 榛樿�鏄�
             taxPersonRecordEntryInfo.setDeductFees(DeductFeesEnum.Deduct);
             IObjectPK saveEntry = iTaxPersonRecordEntry.addnew(taxPersonRecordEntryInfo);
-            logger.error("saveEntry--------分录新增返回ID" + saveEntry);
+            logger.error("saveEntry--------鍒嗗綍鏂板�杩斿洖ID" + saveEntry);
         } else {
-            logger.error(personInfo.getName() + "护照和身份证为空,证件类型保存失败!");
+            logger.error(personInfo.getName() + "鎶ょ収鍜岃韩浠借瘉涓虹┖锛岃瘉浠剁被鍨嬩繚瀛樺け璐ワ紒");
         }
     }
 
     /**
-     * 1.在核算表里能查到该员工,在当前列表中查不到该员工,此情况为当月入职新员工,处理逻辑为新增一条纳税人员信息,纳税单位为同步人员信息时选择的纳税单位,状态为正常,受雇从业开始时间
-     * 为同步人员信息时选择月份的下个月一号
+     * 1.鍦ㄦ牳绠楄〃閲岃兘鏌ュ埌璇ュ憳宸ワ紝鍦ㄥ綋鍓嶅垪琛ㄤ腑鏌ヤ笉鍒拌�鍛樺伐锛屾�鎯呭喌涓哄綋鏈堝叆鑱屾柊鍛樺伐锛屽�鐞嗛€昏緫涓烘柊澧炰竴鏉$撼绋庝汉鍛樹俊鎭�紝绾崇◣鍗曚綅涓哄悓姝ヤ汉鍛樹俊鎭�椂閫夋嫨鐨勭撼绋庡崟浣嶏紝鐘舵€佷负姝e父锛屽彈闆囦粠涓氬紑濮嬫椂闂�
+     * 涓哄悓姝ヤ汉鍛樹俊鎭�椂閫夋嫨鏈堜唤鐨勪笅涓�湀涓€鍙�
      *
      * @param personInfo
      * @param taxUnitId
@@ -1122,7 +1130,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, sic, null);
         TaxPersonRecordCollection collection = iTaxPersonRecord.getTaxPersonRecordCollection(entityViewInfo);
 
-        //人员纳税分录对象
+        //浜哄憳绾崇◣鍒嗗綍瀵硅薄
         TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = new TaxPersonRecordEntryInfo();
         BOSUuid save = null;
         TaxPersonRecordInfo taxPersonRecordInfo = new TaxPersonRecordInfo();
@@ -1132,79 +1140,104 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         }
         if (null == save) {
             taxPersonRecordInfo = new TaxPersonRecordInfo();
-            //人员
+            //浜哄憳
             taxPersonRecordInfo.setPerson(personInfo);
-            //报税姓名
+            //鎶ョ◣濮撳悕
             taxPersonRecordInfo.setReportName(personInfo.getName());
-            //证件类型
+            //璇佷欢绫诲瀷
             if (personInfo.getIdCardNO() != null || personInfo.getPassportNO() != null) {
                 if (null == personInfo.getIdCardNO()) {
-                    //护照
+                    //鎶ょ収
                     taxPersonRecordInfo.setCardType(CardTypeEnum.Passport);
                     taxPersonRecordInfo.setCardNumber(personInfo.getPassportNO());
                 }
                 if (null == personInfo.getPassportNO()) {
-                    //证件号
+                    //璇佷欢鍙�
                     taxPersonRecordInfo.setCardType(CardTypeEnum.IdCard);
                     taxPersonRecordInfo.setCardNumber(personInfo.getIdCardNO());
                 }
-                //性别
+                //鎬у埆
                 taxPersonRecordInfo.setGender(personInfo.getGender());
-                //出生日期
+                //鍑虹敓鏃ユ湡
                 taxPersonRecordInfo.setBirthday(personInfo.getBirthday());
-                //国籍
+                //鍥界睄
                 taxPersonRecordInfo.setNationality(personInfo.getNationality());
-                //是否境外人员
+                //鏄�惁澧冨�浜哄憳
                 taxPersonRecordInfo.setIsOversea(IsOverseaEnum.NotOversea);
-                //手机号码
+                //鎵嬫満鍙风爜
                 taxPersonRecordInfo.setPhoneNumber(personInfo.getCell());
                 IObjectPK pk= iTaxPersonRecord.addnew(taxPersonRecordInfo);
                 taxPersonRecordInfo.setId(BOSUuid.read(pk.toString()));
             } else {
-                 new ShrWebBizException(personInfo.getName() + "护照和身份证为空,证件类型保存失败!");
+                 new ShrWebBizException(personInfo.getName() + "鎶ょ収鍜岃韩浠借瘉涓虹┖锛岃瘉浠剁被鍨嬩繚瀛樺け璐ワ紒");
             }
         }
         if (personInfo.getIdCardNO() != null || personInfo.getPassportNO() != null) {
             if (null == personInfo.getIdCardNO()) {
-                //纳税人类型
+                //绾崇◣浜虹被鍨�
                 taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.NotResident);
             }
             if (null == personInfo.getPassportNO()) {
-                //纳税人类型
+                //绾崇◣浜虹被鍨�
                 taxPersonRecordEntryInfo.setPayerType(PayerTypeEnum.Resident);
             }
         } else {
-            new ShrWebBizException(personInfo.getName() + "护照和身份证为空,证件类型保存失败!");
+            new ShrWebBizException(personInfo.getName() + "鎶ょ収鍜岃韩浠借瘉涓虹┖锛岃瘉浠剁被鍨嬩繚瀛樺け璐ワ紒");
         }
+
+        SelectorItemCollection sice = new SelectorItemCollection();
+        sice.add(new SelectorItemInfo("id"));
+        sice.add(new SelectorItemInfo("bill.id"));
+        sice.add("taxUnit.id");
+        FilterInfo filtereInfo = new FilterInfo();
+        filtereInfo.getFilterItems().add(new FilterItemInfo("bill.id", taxPersonRecordInfo.getId().toString(), CompareType.EQUALS));
+        EntityViewInfo entityVieweInfo = EntityViewInfo.getInstance(filterInfo, sice, null);
+        TaxPersonRecordEntryCollection collecetion = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection(entityVieweInfo);
+        TaxPersonRecordEntryInfo tp=null;
+        if(null!=collecetion&&collecetion.size()>0) {
+            for (int i=0;i<collecetion.size();i++) {
+                tp = collecetion.get(i);
+                System.out.println(JSONUtils.convertObjectToJson(iTaxPersonRecordEntry.getContext(),collecetion));
+                if(null!=tp.getTaxUnit()&&null!=tp.getTaxUnit().getId()&&taxUnitId.equals(tp.getTaxUnit().getId().toString())) {
+                    taxPersonRecordEntryInfo.setId(tp.getId());
+                }else {
+                    TaxPersonRecordEntryInfo tpOld = iTaxPersonRecordEntry.getTaxPersonRecordEntryInfo(new ObjectUuidPK(tp.getId()));
+                    tpOld.setPersonStatus(PersonStatusEnum.NotNormal);
+                    iTaxPersonRecordEntry.save(tpOld);
+                    System.out.println(JSONUtils.convertObjectToJson(iTaxPersonRecordEntry.getContext(),tpOld));
+                }
+            }
+        }
+
         taxPersonRecordEntryInfo.setBill(taxPersonRecordInfo);
         taxPersonRecordEntryInfo.setSimpleName(sccid);
-        //保存分录数据
+        //淇濆瓨鍒嗗綍鏁版嵁
         taxPersonRecordEntryInfo.setPerson(personInfo);
-        //获取纳税单位
+        //鑾峰彇绾崇◣鍗曚綅
         TaxUnitInfo taxUnitInfo = new TaxUnitInfo();
         taxUnitInfo.setId(BOSUuid.read(taxUnitId));
         taxPersonRecordEntryInfo.setTaxUnit(taxUnitInfo);
-        //人员状态
+        //浜哄憳鐘舵€�
         taxPersonRecordEntryInfo.setPersonStatus(PersonStatusEnum.Normal);
-        //获取下月的最后一天转成Date类型 //任职受雇从业日期为当前月第一天
+        //鑾峰彇涓嬫湀鐨勬渶鍚庝竴澶╄浆鎴怐ate绫诲瀷 //浠昏亴鍙楅泧浠庝笟鏃ユ湡涓哄綋鍓嶆湀绗�竴澶�
         taxPersonRecordEntryInfo.setEmployedDate(oneDay);
-        //报送状态
+        //鎶ラ€佺姸鎬�
         taxPersonRecordEntryInfo.setSubmitStatus(SubmitStatusEnum.NotSubmit);
         taxPersonRecordEntryInfo.setLastReportMonth(yearMonth);
-        //任职受雇从业类型  默认雇员
+        //浠昏亴鍙楅泧浠庝笟绫诲瀷  榛樿�闆囧憳
         taxPersonRecordEntryInfo.setEmployedType(EmployedTypeEnum.Employee);
-        //是否扣除减除费用 默认是
+        //鏄�惁鎵i櫎鍑忛櫎璐圭敤 榛樿�鏄�
         taxPersonRecordEntryInfo.setDeductFees(DeductFeesEnum.Deduct);
-        IObjectPK saveEntry = iTaxPersonRecordEntry.addnew(taxPersonRecordEntryInfo);
+        IObjectPK saveEntry = iTaxPersonRecordEntry.save(taxPersonRecordEntryInfo);
     }
 
     /**
-     * 获取薪酬核算人员
-     * 相同
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
+     * 鐩稿悓
      *
-     * @param year      统计年
-     * @param month     统计月
-     * @param taxUnitId 纳税单位
+     * @param year      缁熻�骞�
+     * @param month     缁熻�鏈�
+     * @param taxUnitId 绾崇◣鍗曚綅
      */
     public String getSCmpCalTablePersonsSqlAlike(Integer year, Integer month, String taxUnitId) {
         StringBuilder sb = new StringBuilder();
@@ -1214,19 +1247,19 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         sb.append(" and rentry.FPERSONSTATUS=1 and scct.FTaxUnitID=rentry.FTaxUnitID ");
         sb.append(" where scct.FPeriodYear =  '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
         sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
-        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER='JZT006'  ) ");
+        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022')  ) ");
         sb.append(" and rentry.fid is not null ");
         System.out.println("getSCmpCalTablePersonsSqlAlike" + sb);
         return sb.toString();
     }
 
     /**
-     * 获取薪酬核算人员
-     * 新增
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
+     * 鏂板�
      *
-     * @param year      统计年
-     * @param month     统计月
-     * @param taxUnitId 纳税单位
+     * @param year      缁熻�骞�
+     * @param month     缁熻�鏈�
+     * @param taxUnitId 绾崇◣鍗曚綅
      */
     public String getSCmpCalTablePersonsSqlAndNew(Integer year, Integer month, String taxUnitId) {
         StringBuilder sb = new StringBuilder();
@@ -1237,19 +1270,19 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         sb.append(" and rentry.FPERSONSTATUS=1 and scct.FTaxUnitID = rentry.FTaxUnitID ");
         sb.append(" where scct.FPeriodYear =  '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
         sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
-        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER='JZT006' ) ");
+        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022') ) ");
         sb.append(" and rentry.fid is null ");
         System.out.println("getSCmpCalTablePersonsSqlAndNew" + sb);
         return sb.toString();
     }
 
     /**
-     * 获取薪酬核算人员
-     * 变更
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
+     * 鍙樻洿
      *
-     * @param year      统计年
-     * @param month     统计月
-     * @param taxUnitId 纳税单位
+     * @param year      缁熻�骞�
+     * @param month     缁熻�鏈�
+     * @param taxUnitId 绾崇◣鍗曚綅
      */
     public String getSCmpCalTablePersonsSqlAlter(Integer year, Integer month, String taxUnitId) {
         StringBuilder sb = new StringBuilder();
@@ -1260,19 +1293,19 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         sb.append(" and rentry.FPERSONSTATUS=1 and scct.FTaxUnitID!=rentry.FTaxUnitID ");
         sb.append(" where scct.FPeriodYear =  '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
         sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
-        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER='JZT006' ) ");
+        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022') ) ");
         sb.append(" order by scct.FTaxUnitID,rentry.FTAXUNITID,rentry.fid ");
         System.out.println("getSCmpCalTablePersonsSqlAlter" + sb);
         return sb.toString();
     }
 
     /**
-     * 获取薪酬核算人员
-     * 删除
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
+     * 鍒犻櫎
      *
-     * @param year      统计年
-     * @param month     统计月
-     * @param taxUnitId 纳税单位
+     * @param year      缁熻�骞�
+     * @param month     缁熻�鏈�
+     * @param taxUnitId 绾崇◣鍗曚綅
      */
     public String getSCmpCalTablePersonsSqlDel(Integer year, Integer month, String taxUnitId) {
         StringBuilder sb = new StringBuilder();
@@ -1283,18 +1316,18 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         sb.append(" and scct.FTaxUnitID=rentry.FTaxUnitID ");
         sb.append(" and scct.FPeriodYear =  '"+year+"' and scct.FPeriodMonth = '"+month+"' ");
         sb.append(" and scct.FTaxUnitID ='"+taxUnitId+"' ");
-        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER='JZT006'  ) ");
+        sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022')  ) ");
         sb.append(" where rentry.FPERSONSTATUS=1  and rentry.FTaxUnitID ='"+taxUnitId+"' and scct.fid is null ");
         System.out.println("getSCmpCalTablePersonsSqlDel" + sb);
         return sb.toString();
     }
 
     /**
-     * 获取薪酬核算人员
+     * 鑾峰彇钖�叕鏍哥畻浜哄憳
      *
-     * @param year      统计年
-     * @param month     统计月
-     * @param taxUnitId 纳税单位
+     * @param year      缁熻�骞�
+     * @param month     缁熻�鏈�
+     * @param taxUnitId 绾崇◣鍗曚綅
      */
     public String getSCmpCalTablePersonsSql(Integer year, Integer month, String taxUnitId) {
         StringBuilder sb = new StringBuilder();
@@ -1307,7 +1340,7 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
         sb.append("FPeriodMonth = '").append(month).append("'").append("\n");
         sb.append(" and ").append("\n");
         sb.append("FTaxUnitID = '").append(taxUnitId).append("'").append("\n");
-        sb.append("and FEMPLOYEETYPEID not in(").append("select fid from T_HR_BDEmployeeType where FNUMBER='JZT006' ").append(") ").append("\n");
+        sb.append("and FEMPLOYEETYPEID not in(").append("select fid from T_HR_BDEmployeeType where FNUMBER in('JZT006','JZT022') ").append(") ").append("\n");
         return sb.toString();
     }
 }

+ 2 - 1
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetPensionDownloadFeedback.java

@@ -108,7 +108,8 @@ public class GetPensionDownloadFeedback implements IHRMsfService {
             updateljgrylj.append("update T_HR_STAXCALINITDETAIL set T46 =? where FCMPCALTABLEID=?");
             List<String[]> list = Lists.newArrayList();
             List<String[]> listR = Lists.newArrayList();
-            String result = facade.get(url, paramData);
+            paramMap.remove("initIds");
+            String result = facade.get(url,JSONUtil.toJsonStr(paramMap));
             JSONObject resultMap = JSONUtil.parseObj(result);
             JSONObject head = resultMap.getJSONObject("head");
             JSONArray body = resultMap.getJSONArray("body");

+ 2 - 1
websrc/com/kingdee/eas/custom/shuiyou/six/osf/GetQuerySpecialAmountFeedback.java

@@ -66,7 +66,8 @@ public class GetQuerySpecialAmountFeedback implements IHRMsfService {
 
             Map<String, Object> config = facade.getConfig();
             String url = config.get("ip") + URLConfigEnum.GETQUERYSPECIALAMOUNTFEEDBACK_VALUE;
-            String result = facade.get(url,paramData);
+            paramMap.remove("initIds");
+            String result = facade.get(url,JSONUtil.toJsonStr(paramMap));
             //»ñÈ¡±¾´ÎµÄÊý¾Ýid
             String taxIDS =initIds;
             StringBuilder sel = new StringBuilder();

+ 305 - 19
websrc/com/kingdee/eas/custom/shuiyou/taxCal/inter/InterInitDynamicListHandlerEx.java

@@ -3,39 +3,206 @@ package com.kingdee.eas.custom.shuiyou.taxCal.inter;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.util.EASResource;
+import com.kingdee.eas.common.EASBizException;
 import com.kingdee.eas.custom.shuiyou.taxCal.TaxCalFacadeFactory;
+import com.kingdee.eas.hr.ats.AtsUtil;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
 import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
+import com.kingdee.shr.base.syssetting.app.filter.HRFilterUtils;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.util.LocaleUtils;
+import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
 import com.kingdee.shr.compensation.app.tax.IsAllowedQuoted;
 import com.kingdee.shr.compensation.app.tax.TaxUnitCollection;
 import com.kingdee.shr.compensation.app.tax.TaxUnitFactory;
 import com.kingdee.shr.compensation.app.tax.TaxUnitInfo;
-import com.kingdee.shr.compensation.app.taxCal.TaxCalInitDetailStateEnum;
-import com.kingdee.shr.compensation.app.taxCal.TaxCalTaskCatalogEnum;
+import com.kingdee.shr.compensation.app.tax.base.TaxItemInfo;
+import com.kingdee.shr.compensation.app.taxCal.*;
 import com.kingdee.shr.compensation.exception.ExceptionHandle;
+import com.kingdee.shr.compensation.taxCal.VO.TaxCalDeleteVO;
+import com.kingdee.shr.compensation.util.CmpDateUtil;
 import com.kingdee.shr.compensation.util.CmpStrUtil;
+import com.kingdee.shr.compensation.util.CmpTaxUtil;
 import com.kingdee.shr.compensation.web.handler.taxCal.inter.InterInitDynamicListHandler;
 import com.kingdee.util.StringUtils;
+import org.apache.log4j.Logger;
 import org.springframework.ui.ModelMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;;
 import java.text.MessageFormat;
+import java.text.ParseException;
 import java.util.*;
 
 /**
- * @Description 税款计算_初算数据ListHandler扩展
+ * @Description 绋庢�璁$畻_鍒濈畻鏁版嵁ListHandler鎵╁睍
  * @Date 2024/8/30 13:59
  * @Created by Heyuan
  */
 public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
+    private static final Logger LOG = Logger.getLogger(InterInitDynamicListHandlerEx.class);
+    protected void setInitData(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap, Map<String, Object> initData) throws SHRWebException {
+        super.setInitData(request, response, modelMap, initData);
+        Context ctx = SHRContext.getInstance().getContext();
+        initData.put("hasTaxImp", true);
+    }
     /**
-     * 接口算税
+     * 娣诲姞闆跺伐璧勬姤绋庝汉鍛�
+     * @description:
+     * @author: lhbj
+     * @date: 2025/4/10 14:14
+     * @param: null
+     * @return:null
+     **/
+    public void createZeroIncomeAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        String periodDate = request.getParameter("periodDate");
+        String taxUnitId = request.getParameter("taxUnitId");
+        String personIds = request.getParameter("persons");
+        if (StringUtils.isEmpty(periodDate)) {
+            throw new ShrWebBizException("绋庢�鎵€灞炴湡涓嶈兘涓虹┖");
+        } else if (StringUtils.isEmpty(taxUnitId)) {
+            throw new ShrWebBizException("绾崇◣鍗曚綅涓嶈兘涓虹┖");
+        } else if (StringUtils.isEmpty(personIds)) {
+            throw new ShrWebBizException("鍛樺伐涓嶈兘涓虹┖");
+        } else {
+            Date periodBegin;
+            try {
+                periodBegin = CmpDateUtil.parseDate(periodDate);
+            } catch (ParseException var11) {
+                throw new ShrWebBizException("绋庢�鎵€灞炴湡鏍煎紡涓嶆�纭�");
+            }
+
+            if (null == periodBegin) {
+                throw new ShrWebBizException("绋庢�鎵€灞炴湡鏍煎紡涓嶆�纭�");
+            } else {
+                Context ctx = SHRContext.getInstance().getContext();
+
+                try {
+                    List<String> personList = new ArrayList();
+                    Collections.addAll(personList, personIds.split(","));
+                    BatchMessageTipsHeader header = TaxCalInitFacadeFactory.getLocalInstance(ctx).genZeroIncome(taxUnitId, CmpDateUtil.toSqlDate(periodBegin), personIds);
+                    String personIdsSql = CmpStrUtil.buildInSql(personIds);
+                    String PeriodBegin = CmpDateUtil.getDateStr(CmpDateUtil.toSqlDate(periodBegin));
+                    String PeriodEnd  = CmpDateUtil.getDateStr(CmpDateUtil.toSqlDate(CmpDateUtil.getEndOfMonth(periodBegin)));
+                    Map<String, String> taxItemConfigMap = this.getTaxItemMap(ctx);
+                    //鏇存柊鏄庣粏琛ㄦ暟鎹�
+                    StringBuilder updateSql = new StringBuilder();
+                    StringBuilder querySqlForUpdate = new StringBuilder();
+                    updateSql.append("update t_hr_sTaxCalInitDetail config set (").append("\n");
+                    for (String key : taxItemConfigMap.keySet()) {
+                        updateSql.append(taxItemConfigMap.get(key)).append(",").append("\n");
+                        querySqlForUpdate.append(taxItemConfigMap.get(key)).append(",").append("\n");
+                    }
+                    updateSql.deleteCharAt(updateSql.lastIndexOf(","));
+                    querySqlForUpdate.deleteCharAt(querySqlForUpdate.lastIndexOf(","));
+                    /**
+                     T66,
+                     T17,
+                     T13,
+                     T3,
+                     T5,
+                     T61,
+                     T62,
+                     T18,
+                     T65,
+                     T4,
+                     T14,
+                     T63,
+                     T64,
+                     T39,
+                     T16,
+                     T6,
+                     T12
+                     */
+                    updateSql.append(",fCmpCalTableId) = ( select ").append("s29,0,0,s136,s144,s16,s15,0,s17,s142,0,s14,s27,0,0,s132,0,sd.fid").append("\n");
+                    updateSql.append(" from T_HR_SCMPCALTABLE sd ");
+                    updateSql.append(" left join ( ");
+                    updateSql.append(" select fid,FPERSONID,FTAXUNITID, ");
+                    updateSql.append(" ADD_MONTHS(fPeriodBegin, -1) fPeriodBegin,ADD_MONTHS(fPeriodEnd, -1) fPeriodEnd ");
+                    updateSql.append(" from t_hr_sTaxCalInitDetail where FSTATE='10' ");
+                    updateSql.append(" and FPERSONID in " + CmpStrUtil.buildInSql(personIds) +" ");
+                    updateSql.append(" and FTAXUNITID = '" + taxUnitId +"' ");
+                    updateSql.append(" and to_char(fPeriodBegin,'yyyy-MM-dd') = '" + CmpDateUtil.toSqlDate(periodBegin) +"' ");
+                    updateSql.append(" and to_char(fPeriodEnd,'yyyy-MM-dd') = '" + CmpDateUtil.toSqlDate(CmpDateUtil.getEndOfMonth(periodBegin)) +"' ");
+                    updateSql.append(" ) sdt on sd.FPERSONID = sdt.FPERSONID ");
+                    updateSql.append(" and sd.FTAXUNITID = sdt.FTAXUNITID ");
+                    updateSql.append(" and sd.FBEGINDATE = sdt.fPeriodBegin ");
+                    updateSql.append(" and sd.FENDDATE = sdt.fPeriodEnd ");
+                    updateSql.append(" where config.fid = sdt.fid ) ");
+                    updateSql.append(" where config.fid in (select sdt.fid ");
+                    updateSql.append(" from T_HR_SCMPCALTABLE sd ");
+                    updateSql.append(" left join ( ");
+                    updateSql.append(" select fid,FPERSONID,FTAXUNITID, ");
+                    updateSql.append(" ADD_MONTHS(fPeriodBegin, -1) fPeriodBegin,ADD_MONTHS(fPeriodEnd, -1) fPeriodEnd ");
+                    updateSql.append(" from t_hr_sTaxCalInitDetail where FSTATE='10' ");
+                    updateSql.append(" and FPERSONID in " + CmpStrUtil.buildInSql(personIds) +" ");
+                    updateSql.append(" and FTAXUNITID = '" + taxUnitId +"' ");
+                    updateSql.append(" and to_char(fPeriodBegin,'yyyy-MM-dd') = '" + CmpDateUtil.toSqlDate(periodBegin) +"' ");
+                    updateSql.append(" and to_char(fPeriodEnd,'yyyy-MM-dd') = '" + CmpDateUtil.toSqlDate(CmpDateUtil.getEndOfMonth(periodBegin)) +"' ");
+                    updateSql.append(" ) sdt on sd.FPERSONID = sdt.FPERSONID ");
+                    updateSql.append(" and sd.FTAXUNITID = sdt.FTAXUNITID ");
+                    updateSql.append(" and sd.FBEGINDATE = sdt.fPeriodBegin ");
+                    updateSql.append(" and sd.FENDDATE = sdt.fPeriodEnd ");
+                    updateSql.append("  ) ");
+                    LOG.info("鏇存柊鏄庣粏琛╯ql: " + updateSql);
+                    DbUtil.execute(ctx, updateSql.toString());
+
+                    this.writeSuccessData(header);
+                } catch (Exception e) {
+                    LOG.error("createZeroIncome error: ", e);
+                    throw new SHRWebException(e.getMessage());
+                }
+            }
+        }
+    }
+    /**
+     * 鑾峰彇涓�◣椤圭洰
+     *
+     * @param ctx
+     * @return
+     * @throws BOSException
+     */
+    private  Map<String, String> getTaxItemMap(Context ctx) throws BOSException {
+        LinkedHashMap<String, String> taxItemInitMap = new LinkedHashMap<>();
+        //鑾峰彇鎵€鏈変釜绋庨」鐩�
+        Set<String> initSet = new HashSet();
+        initSet.add("jbylaobxf");//鍩烘湰鍏昏€佷繚闄�
+        initSet.add("jbylbxf");//鍩烘湰鍖荤枟淇濋櫓
+        initSet.add("sybxf");//澶变笟淇濋櫓
+        initSet.add("zfgjj");//浣忔埧鍏�Н閲�
+        initSet.add("nj");//浼佷笟骞撮噾
+        initSet.add("syjkbx");//鍟嗕笟鍋ュ悍淇濋櫓
+        initSet.add("zykcjze");//鍑嗕簣鎵i櫎鐨勬崘璧犻�
+        initSet.add("jmse");//鍑忓厤绋庨�
+        initSet.add("syylbx");//绋庡欢鍏昏€佷繚闄�
+        initSet.add("yxkcsf");//鍏佽�鎵i櫎鐨勭◣璐�
+        initSet.add("ycxbc");//涓€娆℃€цˉ鍋�
+        initSet.add("dyznjyzc");  // 瀛愬コ鏁欒偛鏀�嚭
+        initSet.add("dysylrzc");  // 璧″吇鑰佷汉鏀�嚭
+        initSet.add("dyfwdkzc");  // 鎴垮眿璐锋�鏀�嚭
+        initSet.add("dyzfzjzc");  // 浣忔埧绉熼噾鏀�嚭
+        initSet.add("dyjxjyzc");  // 缁х画鏁欒偛鏀�嚭
+        initSet.add("dyyyrzhzc");  // 濠村辜鍎跨収鎶ゆ敮鍑�
+        try {
+            for(String number : initSet){
+                com.kingdee.shr.compensation.app.tax.base.TaxItemInfo info =
+                        com.kingdee.shr.compensation.app.tax.base.TaxItemFactory.getLocalInstance(ctx)
+                        .getTaxItemInfo("where number = '" + number + "'");
+                taxItemInitMap.put(number, "T" + info.getFieldSn());
+            }
+        } catch (BOSException | EASBizException var5) {
+            var5.printStackTrace();
+            throw new BOSException("鑾峰彇涓�◣椤圭洰鎶ラ敊: " + var5.getMessage());
+        }
+        return taxItemInitMap;
+    }
+
+    /**
+     * 鎺ュ彛绠楃◣
      *
      * @param request
      * @param response
@@ -56,19 +223,24 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
         StringBuilder str = new StringBuilder();
         str.append(" SELECT DETAIL.FID ID,detail.FTaxUnitID, DETAIL.FSTATE, DETAIL.FPERIODEND, DETAIL.FINCOMEITEMID,RECORD.FID RECORDID, ENTRY.FID ENTRYID,ENTRY.FACCEPTID FACCEPTID,ENTRY.FSUBMITSTATUS, ENTRY.FEMPLOYEDDATE, ");
         str.append(" PERSON.FNAME_L2 NAME, PERSON.FNUMBER PERNUMBER, DETAIL.FPERIODBEGIN, ti.fName_l2 incomeItemName, detail.fPersonId, config.fState confirmState, config.fIsLast ");
-        //个税应用+税款计算初算明细表
+        //涓�◣搴旂敤+绋庢�璁$畻鍒濈畻鏄庣粏琛�
         str.append(" FROM t_hr_sTaxCalInitDetail DETAIL ");
-        //个税应用+税款计算最终拆分明细表
+        //涓�◣搴旂敤+绋庢�璁$畻鏈€缁堟媶鍒嗘槑缁嗚〃
         str.append(" left join t_hr_sTaxCalConfigDetail config ON DETAIL.fCmpCalTableId = config.fCmpCalTableId and DETAIL.fIncomeItemId = config.fIncomeItemId ");
-        //人员
+        //浜哄憳
         str.append(" INNER JOIN T_BD_PERSON PERSON ON DETAIL.FPERSONID = PERSON.FID ");
-        //人员报税
+        //浜哄憳鎶ョ◣
         str.append(" LEFT JOIN T_HR_STAXPERSONRECORD RECORD ON RECORD.FPERSONID = PERSON.FID ");
-        //个税所得项目
+        //涓�◣鎵€寰楅」鐩�
         str.append(" LEFT JOIN t_hr_sTaxIncomeItem ti ON DETAIL.fIncomeItemId = ti.fid ");
-        //任职受雇从业信息分录
-        str.append(" LEFT JOIN T_HR_STAXPERSONRECORDENTRY ENTRY ON DETAIL.FPERSONID = ENTRY.FPERSONID ");
-        str.append(" AND detail.FTaxUnitID = entry.FTaxUnitID ");
+        //浠昏亴鍙楅泧浠庝笟淇℃伅鍒嗗綍
+        str.append(" LEFT JOIN (select * from ");
+        str.append(" T_HR_STaxPersonRecordentry where fTaxUnitId||fPersonId||FLASTREPORTMONTH||FEMPLOYEDDATE in( ");
+        str.append("  select fTaxUnitId||fPersonId||max(FLASTREPORTMONTH)||max(FEMPLOYEDDATE) from T_HR_STaxPersonRecordentry where FSUBMITSTATUS=2 group by FTAXUNITID,FPERSONID  ");
+        str.append(" )) ENTRY ON DETAIL.FPERSONID = ENTRY.FPERSONID AND detail.FTaxUnitID = entry.FTaxUnitID ");
+
+//        str.append(" LEFT JOIN T_HR_STAXPERSONRECORDENTRY ENTRY ON DETAIL.FPERSONID = ENTRY.FPERSONID ");
+//        str.append(" AND detail.FTaxUnitID = entry.FTaxUnitID and ENTRY.FPERSONSTATUS=1 ");
         str.append(" WHERE DETAIL.FID IN (").append(filterSql).append(")");
         Map<String, Set<String>> personMap = new HashMap();
         ArrayList speAddParams = new ArrayList();
@@ -89,7 +261,7 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
             IRowSet rowSet1 = DbUtil.executeQuery(ctx, str.toString());
             while (rowSet1.next()) {
                 if (count == 0) {
-                    //周期开始
+                    //鍛ㄦ湡寮€濮�
                     periodBegin = rowSet1.getDate("FPERIODBEGIN");
                 }
                 ++count;
@@ -115,10 +287,10 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
                     msg = MessageFormat.format(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label73", ctx.getLocale()), TaxCalInitDetailStateEnum.getEnum(rowSet1.getInt("FSTATE")).getAlias());
                 } else if (20 == rowSet1.getInt("confirmState")) {
                     isSuccess = false;
-                    msg = "计算失败,该员工税款计算-结果数据已确认,不能重复计算";
+                    msg = "璁$畻澶辫触锛岃�鍛樺伐绋庢�璁$畻-缁撴灉鏁版嵁宸茬‘璁わ紝涓嶈兘閲嶅�璁$畻";
                 } else if (rowSet1.getInt("fIsLast") == 0 && rowSet1.getInt("confirmState") != 0) {
                     isSuccess = false;
-                    msg = "计算失败,该核算数据之后产生了新的算税任务,请先依次删除算税数据后再重算或者选择最后一条数据进行计算";
+                    msg = "璁$畻澶辫触锛岃�鏍哥畻鏁版嵁涔嬪悗浜х敓浜嗘柊鐨勭畻绋庝换鍔★紝璇峰厛渚濇�鍒犻櫎绠楃◣鏁版嵁鍚庡啀閲嶇畻鎴栬€呴€夋嫨鏈€鍚庝竴鏉℃暟鎹�繘琛岃�绠�";
                 } else if (rowSet1.getDate("FPERIODEND").before(rowSet1.getDate("FEMPLOYEDDATE"))) {
                     isSuccess = false;
                     msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label77", ctx.getLocale());
@@ -130,7 +302,7 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
                     msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label76", ctx.getLocale());
                 } else if ("0".equals(rowSet1.getString("FSubmitStatus")) || "3".equals(rowSet1.getString("FSubmitStatus"))) {
                     if (isAutoDeductBoolean && "8r0AAABCg2PDiOoP".equals(incomeItemID)) {
-                        msg = "该员工未进行人员报送,已同时生成人员报送任务、专项附加扣除申报任务和税款计算任务到税友系统,需要等待几分钟,可在任务执行监控中查看运行进度";
+                        msg = "璇ュ憳宸ユ湭杩涜�浜哄憳鎶ラ€侊紝宸插悓鏃剁敓鎴愪汉鍛樻姤閫佷换鍔°€佷笓椤归檮鍔犳墸闄ょ敵鎶ヤ换鍔″拰绋庢�璁$畻浠诲姟鍒扮◣鍙嬬郴缁燂紝闇€瑕佺瓑寰呭嚑鍒嗛挓锛屽彲鍦ㄤ换鍔℃墽琛岀洃鎺т腑鏌ョ湅杩愯�杩涘害";
                     } else {
                         msg = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label74", ctx.getLocale());
                     }
@@ -138,9 +310,9 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
                 if (isSuccess) {
                     ++sucsess;
                     String key = taxUnitId + "_" + personId + "_" + incomeItemID;
-                    //个税应用+税款计算初算明细表id
+                    //涓�◣搴旂敤+绋庢�璁$畻鍒濈畻鏄庣粏琛╥d
                     String initId = rowSet1.getString("ID");
-                    //添加map数据
+                    //娣诲姞map鏁版嵁
                     this.addPersonMap(key, personMap, initId);
                     Object[] param = new Object[]{taxUnitId, personId};
                     speAddParams.add(param);
@@ -171,7 +343,7 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
             for (Iterator i$ = personMap.entrySet().iterator(); i$.hasNext(); initIds.addAll((Collection) entry.getValue())) {
                 entry = (Map.Entry) i$.next();
                 if (initIds.size() >= 600) {
-                    //算税数据拼装facade,提交初始数据
+                    //绠楃◣鏁版嵁鎷艰�facade锛屾彁浜ゅ垵濮嬫暟鎹�
                     TaxCalFacadeFactory.getLocalInstance(ctx).submitInitData(CmpStrUtil.converCollectionToSql(initIds), (String) null, TaxCalTaskCatalogEnum.CAL);
                     //SYUtilsFacadeFactory.getLocalInstance(ctx).post()
                     initIds = new HashSet();
@@ -185,4 +357,118 @@ public class InterInitDynamicListHandlerEx extends InterInitDynamicListHandler {
         }
         this.writeSuccessData(header);
     }
+    public void deleteInitDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException, BOSException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String filterSql = this.getFilterSql(request, response, modelMap);
+        List<String> allIdList = new ArrayList<>();
+        Map<String, List<String>> succMap = new HashMap();
+        List<String> directlyList = new ArrayList<>();
+        BatchMessageTipsHeader header = new BatchMessageTipsHeader();
+        int success = 0;
+        int fail = 0;
+        String l = LocaleUtils.getShortCode(ctx);
+        StringBuilder str = new StringBuilder();
+        str.append("select detail.fid detailId, config.fid configId, detail.fState, detail.FTaxUnitID, detail.FPeriodBegin, config.fIsLast,");
+        str.append(" person.fName_").append(l).append(" personName, person.fNumber personNumber, item.fName_").append(l).append(" incomeItemName, config.fIsGenerateTaxDeclare, config.fState configState ");
+        str.append(" from T_HR_STaxCalInitDetail detail ");
+        str.append(" left join T_HR_STaxCalConfigDetail config on config.FCmpCalTableID = detail.FCmpCalTableID and config.fIncomeItemId = detail.fIncomeItemId");
+        str.append(" left join T_HR_STaxIncomeItem item on item.fid = detail.fIncomeItemId");
+        str.append(" left join T_BD_PERSON person on person.fid = detail.fPersonId");
+        str.append(" where detail.fid in (").append(filterSql).append(")");
+
+        try {
+            IRowSet rowSet = DbUtil.executeQuery(ctx, str.toString());
+
+            while(rowSet.next()) {
+                String detailId = rowSet.getString("detailId");
+                BatchMessageTipsBody body = new BatchMessageTipsBody();
+                body.setId(detailId);
+                String msg;
+                boolean isSuccess;
+                if (!StringUtils.isEmpty(rowSet.getString("configId")) && rowSet.getBoolean("fIsGenerateTaxDeclare")) {
+                    isSuccess = false;
+                    msg = "璇ュ憳宸ユ墍鍦ㄧ敵鎶ヨ〃宸茬粡鐢熸垚鐢虫姤鏁版嵁锛屼笉鍏佽�鍒犻櫎锛岃嫢闇€鍒犻櫎锛岃�杩涘叆涓�◣鐢虫姤鍒犻櫎鐢虫姤鏁版嵁";
+                } else if (!StringUtils.isEmpty(rowSet.getString("configId")) && rowSet.getInt("configState") == 20) {
+                    isSuccess = false;
+                    msg = "鍒犻櫎澶辫触锛岃�鍛樺伐绋庢�璁$畻-缁撴灉鏁版嵁宸茬‘璁わ紝涓嶅厑璁稿垹闄�";
+                } else if (!rowSet.getBoolean("fIsLast") && !StringUtils.isEmpty(rowSet.getString("configId"))) {
+                    isSuccess = false;
+                    msg = "鍒犻櫎澶辫触锛岃�鍛樺伐鐨勮�绗旀暟鎹�箣鍚庝骇鐢熶簡鏂扮殑绠楃◣浠诲姟锛岃�鍏堝垹闄ゆ渶鏂扮畻绋庢暟鎹�悗鍐嶈繘琛屾搷浣溿€�";
+                } else if (30 == rowSet.getInt("fState")) {
+                    isSuccess = false;
+                    msg = "鍒犻櫎澶辫触锛岄噾绋庣郴缁熺畻绋庤繘琛屼腑锛屼笉鍏佽�鍒犻櫎锛屽彲鍦ㄤ换鍔℃墽琛岀洃鎺т腑鏌ョ湅绠楃◣浠诲姟杩涘害";
+                } else if (StringUtils.isEmpty(rowSet.getString("configId"))) {
+                    isSuccess = true;
+                    msg = "鎿嶄綔鎴愬姛";
+                    directlyList.add(detailId);
+                } else {
+                    directlyList.add(detailId);
+                    isSuccess = true;
+                    msg = "鎿嶄綔鎴愬姛锛屽凡鎻愪氦鍒犻櫎绠楃◣浠诲姟鑷崇◣灞€绔�紝浠诲姟瀹屾垚鍚庡皢鍚屾�鍒犻櫎鍒濈畻鏁版嵁鍜岀‘璁ゆ暟鎹�紝鍙�湪浠诲姟鎵ц�鐩戞帶涓�煡鐪嬭繘搴�";
+                }
+
+                if (isSuccess) {
+                    ++success;
+                    if (!directlyList.contains(detailId)) {
+                        String key = rowSet.getString("FTaxUnitID") + "_" + CmpDateUtil.getDateStr(rowSet.getDate("FPeriodBegin"));
+                        if (succMap.containsKey(key)) {
+                            List<String> succList = (List)succMap.get(key);
+                            succList.add(detailId);
+                        } else {
+                            List<String> succList = new ArrayList<>();
+                            succList.add(detailId);
+                            succMap.put(key, succList);
+                        }
+                    }else {
+                        String key = rowSet.getString("FTaxUnitID") + "_" + CmpDateUtil.getDateStr(rowSet.getDate("FPeriodBegin"));
+                        if (succMap.containsKey(key)) {
+                            List<String> succList = (List)succMap.get(key);
+                            succList.add(detailId);
+                        } else {
+                            List<String> succList = new ArrayList<>();
+                            succList.add(detailId);
+                            succMap.put(key, succList);
+                        }
+                    }
+                } else {
+                    ++fail;
+                }
+
+                body.setMuitTipsState(isSuccess);
+                body.setMuitTipsMessage(msg);
+                List<Object> messageListExt = new ArrayList<>();
+                messageListExt.add(rowSet.getString("personName"));
+                messageListExt.add(rowSet.getString("personNumber"));
+                messageListExt.add(rowSet.getString("incomeItemName"));
+                body.addMessageListExt(messageListExt);
+                header.addResult(body);
+                allIdList.add(detailId);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        header.setBillId(CmpStrUtil.convertListToString(allIdList));
+        header.setFailureCount(fail);
+        header.setSuccessCount(success);
+        TaxCalDeleteVO param = new TaxCalDeleteVO();
+        param.setDirectlyList(directlyList);
+        param.setSuccMap(succMap);
+        param.setUserId(HRFilterUtils.getCurrentUserId(ctx));
+        //TaxCalInitDetailFactory.getLocalInstance(ctx).delete(param);
+        Map<String, List<String>> taxUnitMap = param.getSuccMap();
+        if (!taxUnitMap.isEmpty()) {
+            for(Map.Entry<String, List<String>> entry : taxUnitMap.entrySet()) {
+                this.deleteTaxCalInitData(ctx,CmpStrUtil.convertListToString(entry.getValue()));
+            }
+        }
+        JSONUtils.SUCCESS(header);
+    }
+    private void deleteTaxCalInitData(Context ctx, String initIds) throws BOSException {
+        String sql = "delete from T_HR_STaxCalConfigDetail WHERE FCmpCalTableID IN (select FCmpCalTableID from T_HR_STAXCALINITDETAIL WHERE FID IN (" + initIds + ") ) ";
+        String sql2 = "delete from T_HR_STAXCALINITDETAIL WHERE FID IN (" + initIds + ")  ";
+        DbUtil.execute(ctx, sql);
+        DbUtil.execute(ctx, sql2);
+    }
+
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 290 - 290
websrc/com/kingdee/eas/custom/shuiyou/taxCal/service/GetASynIndividualIncomeTaxFeedback.java


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 310 - 286
websrc/com/kingdee/eas/custom/shuiyou/taxCal/service/SubmitAsynTaxCalRequestService.java


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است