IncomeTaxDeclareListHandlerEx.java 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. package com.kingdee.eas.custom.compensation.handler;
  2. import cn.com.servyou.dto.ApiResponse;
  3. import cn.com.servyou.dto.AsyncResult;
  4. import cn.com.servyou.dto.declare.CompanyDeclareRequest;
  5. import cn.com.servyou.dto.declare.DeclareCancelRequest;
  6. import cn.com.servyou.dto.declare.DeclareCorrectRequest;
  7. import cn.com.servyou.dto.tax.*;
  8. import cn.com.servyou.rmi.client.ClientProxyFactory;
  9. import cn.com.servyou.service.DeclarationRequest;
  10. import com.alibaba.fastjson.JSONObject;
  11. import com.fasterxml.jackson.core.JsonProcessingException;
  12. import com.fasterxml.jackson.databind.ObjectMapper;
  13. import com.google.gson.Gson;
  14. import com.google.gson.reflect.TypeToken;
  15. import com.kingdee.bos.BOSException;
  16. import com.kingdee.bos.Context;
  17. import com.kingdee.bos.dao.ormapping.impl.ImplUtils;
  18. import com.kingdee.bos.metadata.entity.*;
  19. import com.kingdee.bos.metadata.query.util.CompareType;
  20. import com.kingdee.bos.util.EASResource;
  21. import com.kingdee.eas.basedata.hraux.NationalityInfo;
  22. import com.kingdee.eas.basedata.person.PersonCollection;
  23. import com.kingdee.eas.basedata.person.PersonFactory;
  24. import com.kingdee.eas.basedata.person.PersonInfo;
  25. import com.kingdee.eas.common.EASBizException;
  26. import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
  27. import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
  28. import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
  29. import com.kingdee.eas.custom.shuiyou.utils.ClientProxyFactoryUtils;
  30. import com.kingdee.eas.util.app.DbUtil;
  31. import com.kingdee.jdbc.rowset.IRowSet;
  32. import com.kingdee.jdbc.rowset.IRowSetMetaData;
  33. import com.kingdee.shr.base.syssetting.context.SHRContext;
  34. import com.kingdee.shr.base.syssetting.exception.SHRWebException;
  35. import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
  36. import com.kingdee.shr.base.syssetting.web.dynamic.util.DynamicUtil;
  37. import com.kingdee.shr.base.syssetting.web.dynamic.util.MD5;
  38. import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
  39. import com.kingdee.shr.base.syssetting.web.util.UserUtil;
  40. import com.kingdee.shr.compensation.TaxDeclareStatusEnum;
  41. import com.kingdee.shr.compensation.TbTypeEnum;
  42. import com.kingdee.shr.compensation.app.incomeTax.ITaxPersonRecordEntry;
  43. import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryCollection;
  44. import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryFactory;
  45. import com.kingdee.shr.compensation.app.incomeTax.TaxPersonRecordEntryInfo;
  46. import com.kingdee.shr.compensation.app.tax.*;
  47. import com.kingdee.shr.compensation.app.tax.base.TaxIncomeItemInfo;
  48. import com.kingdee.shr.compensation.app.taxCal.*;
  49. import com.kingdee.shr.compensation.helper.CmpConstants;
  50. import com.kingdee.shr.compensation.taxCal.util.TaxCalcFileUtils;
  51. import com.kingdee.shr.compensation.util.*;
  52. import com.kingdee.shr.compensation.web.handler.tax.IncomeTaxDeclareListHandler;
  53. import com.kingdee.shr.compensation.web.handler.tax.dto.TaxDeclarExcelRowDTO;
  54. import com.kingdee.shr.compensation.web.handler.tax.dto.TaxDeclareDTO;
  55. import com.kingdee.util.StringUtils;
  56. import org.apache.log4j.Logger;
  57. import org.apache.poi.hssf.usermodel.*;
  58. import org.springframework.ui.ModelMap;
  59. import javax.servlet.http.HttpServletRequest;
  60. import javax.servlet.http.HttpServletResponse;
  61. import java.io.File;
  62. import java.io.FileNotFoundException;
  63. import java.io.FileOutputStream;
  64. import java.io.IOException;
  65. import java.lang.reflect.Type;
  66. import java.math.BigDecimal;
  67. import java.net.URLEncoder;
  68. import java.sql.SQLException;
  69. import java.text.SimpleDateFormat;
  70. import java.util.*;
  71. /**
  72. * @author qingwu
  73. * @date 2024/9/18
  74. * @apiNote 个税申报扩展
  75. */
  76. public class IncomeTaxDeclareListHandlerEx extends IncomeTaxDeclareListHandler {
  77. private static final Logger LOG = Logger.getLogger(IncomeTaxDeclareListHandlerEx.class);
  78. private Context ctx = SHRContext.getInstance().getContext();
  79. private ObjectMapper mapper = new ObjectMapper();
  80. /**
  81. * 个税申报
  82. *
  83. * @param request
  84. * @param response
  85. * @param modelMap
  86. */
  87. @Override
  88. public void taxDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException {
  89. LOG.error("taxDeclareAction-----------start-----------");
  90. Context ctx = SHRContext.getInstance().getContext();
  91. try {
  92. boolean isHaveTaxService = CmpTaxUtil.isHaveTaxService(ctx);
  93. if (!isHaveTaxService) {
  94. throw new ShrWebBizException(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label136", ctx.getLocale()));
  95. } else {
  96. String selectedId = request.getParameter("selectedId");
  97. Map<String, Object> resultMap = new HashMap();
  98. Map<String, Object> declareData = this.getDeclareData(ctx, selectedId);
  99. Map<String, Object> paramMap = new HashMap();
  100. paramMap.put("declaData", declareData.get("WATI_TO_DECLARE"));
  101. LOG.error("paramMap-----------" + paramMap);
  102. try {
  103. //纳税单位
  104. List<String> advanceDeclareInfo = (List) declareData.get("advanceDeclareInfo");
  105. LOG.error("advanceDeclareInfo------------" + advanceDeclareInfo);
  106. if (!advanceDeclareInfo.isEmpty()) {
  107. throw new ShrWebBizException(this.combineError(advanceDeclareInfo));
  108. }
  109. //个税审批 审批状态=审批通过的数据
  110. List<IncomeTaxDeclarInfo> waitToDeclareList = (List) paramMap.get("declaData");
  111. if (waitToDeclareList.size() <= 0) {
  112. resultMap.put("success", false);
  113. resultMap.put("excel", "");
  114. resultMap.put("hasErrData", true);
  115. resultMap.put("hasCheckDataErr", true);
  116. resultMap.put("info", "不可重复声申报!!");
  117. JSONUtils.SUCCESS(resultMap);
  118. return;
  119. }
  120. //检查纳税申报数据
  121. Map<String, Object> checkResultMap = this.checkTaxDeclareData(ctx, request, waitToDeclareList);
  122. Boolean hasErr = (Boolean) checkResultMap.get("hasErrData");
  123. if (hasErr != null && hasErr) {
  124. resultMap.put("success", false);
  125. resultMap.put("excel", checkResultMap.get("excel"));
  126. resultMap.put("hasErrData", true);
  127. resultMap.put("hasCheckDataErr", true);
  128. resultMap.put("info", "");
  129. JSONUtils.SUCCESS(resultMap);
  130. return;
  131. }
  132. String errMsg = this.checkTaxCalStatus(ctx, waitToDeclareList);
  133. if (null != errMsg) {
  134. resultMap.put("success", false);
  135. resultMap.put("dataError", true);
  136. resultMap.put("errMsg", errMsg);
  137. JSONUtils.SUCCESS(resultMap);
  138. return;
  139. }
  140. checkResultMap = this.checkIncomeTaxIssue(ctx, waitToDeclareList);
  141. if (checkResultMap != null) {
  142. checkResultMap.put("success", false);
  143. JSONUtils.SUCCESS(checkResultMap);
  144. return;
  145. }
  146. //errMsg = this.checkReductionItems(ctx, waitToDeclareList);
  147. //if (null != errMsg) {
  148. // resultMap.put("success", false);
  149. // resultMap.put("reductionError", true);
  150. // resultMap.put("errMsg", errMsg);
  151. // JSONUtils.SUCCESS(resultMap);
  152. // return;
  153. //}
  154. //Map<String, Object> taxDeclareResult = IncomeTaxDeclareFacadeFactory.getLocalInstance(ctx).taxDeclare(paramMap);
  155. //调佣税友纳税申报
  156. Map<String, Object> taxDeclareResult = callShuiYouTaxDeclare(paramMap);
  157. Boolean isSuccess = (Boolean) taxDeclareResult.get("success");
  158. resultMap.put("success", isSuccess);
  159. resultMap.put("excel", "");
  160. resultMap.put("hasErrData", !isSuccess);
  161. resultMap.put("hasCheckDataErr", false);
  162. resultMap.put("info", declareData.get("info"));
  163. } catch (Exception var17) {
  164. var17.printStackTrace();
  165. LOG.error(var17.getMessage(), var17);
  166. resultMap.put("success", false);
  167. resultMap.put("excel", "");
  168. resultMap.put("hasErrData", true);
  169. resultMap.put("hasCheckDataErr", false);
  170. resultMap.put("info", declareData.get("info"));
  171. resultMap.put("errorMsg", var17.getMessage());
  172. }
  173. LOG.error("taxDeclareAction-----------end-----------");
  174. JSONUtils.SUCCESS(resultMap);
  175. }
  176. } catch (JsonProcessingException e) {
  177. e.printStackTrace();
  178. throw new RuntimeException(e);
  179. }
  180. }
  181. /**
  182. * 调佣税友纳税申报
  183. *
  184. * @param paramMap
  185. * @return
  186. */
  187. public Map<String, Object> callShuiYouTaxDeclare(Map paramMap) {
  188. LOG.error("callShuiYouTaxDeclare--------------------paramMap" + paramMap);
  189. Map<String, Object> resultMap = new HashMap();
  190. resultMap.put("success", true);
  191. resultMap.put("msg", "");
  192. List<IncomeTaxDeclarInfo> waitToDeclareList = (List) paramMap.get("declaData");
  193. Map<String, Object> requestParamMap = new HashMap();
  194. List<Object[]> paramList = new ArrayList();
  195. try {
  196. if (waitToDeclareList != null && waitToDeclareList.size() > 0) {
  197. for (int i = 0; i < waitToDeclareList.size(); i++) {
  198. IncomeTaxDeclarInfo taxDeclarInfo = waitToDeclareList.get(i);
  199. JSONObject param = new JSONObject();
  200. param.put("taxDeclarId", taxDeclarInfo.getId());
  201. param.put("taxDeclarBatchNo", taxDeclarInfo.getBatchNo());
  202. //纳税单位
  203. TaxUnitInfo taxUnitInfo = taxDeclarInfo.getTaxUnit();
  204. //客户端代理工厂
  205. ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory();
  206. //算税请求接口
  207. DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest();
  208. //获取请求参数
  209. CompanyDeclareRequest declareRequestParameter = getDeclareRequestParameter(taxUnitInfo, taxDeclarInfo);
  210. LOG.error("declareRequestParameter-----------------" + mapper.writeValueAsString(declareRequestParameter));
  211. ApiResponse<AsyncResult> apiResponse = declarationRequest.send(declareRequestParameter);
  212. LOG.error("asyncResultApiResponse-----getCode-------" + apiResponse.getHead().getCode());
  213. LOG.error("asyncResultApiResponse-----getMsg--------" + apiResponse.getHead().getMsg());
  214. resultMap.put("msg", mapper.writeValueAsString(declareRequestParameter));
  215. if (apiResponse.getHead().getCode().equals("00000000")) {
  216. AsyncResult body = apiResponse.getBody();
  217. String requestId = body.getRequestId();
  218. LOG.error("requestId-----" + requestId);
  219. LOG.error("apiResponse-----" + mapper.writeValueAsString(apiResponse));
  220. //查询反算反馈结果
  221. ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx);
  222. //backTask(url,requestId,回调osf服务,自定义参数,任务类型)
  223. //isyUtilsFacade.backTask(isyUtilsFacade.getConfig().get("ip") + "/gateway/iit/reverseCalculateTax/getASynIndividualIncomeTaxFeedback", requestId, "synIndividualIncomeTaxService", jsonObject.toString(), TaskCatalogEnum.CAL_GET);
  224. JSONObject json = new JSONObject();
  225. json.put("requestId", requestId);
  226. json.put("param", param.toString());
  227. isyUtilsFacade.addTask("synIncomeTaxDeclareService", json.toJSONString(), TaskCatalogEnum.UN_CAL_GET, "");
  228. }
  229. }
  230. }
  231. } catch (Exception e) {
  232. e.printStackTrace();
  233. resultMap.put("success", false);
  234. resultMap.put("msg", e.getMessage());
  235. return resultMap;
  236. }
  237. return resultMap;
  238. }
  239. /**
  240. * 获取请求参数
  241. * 注意:
  242. * 1.解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报。
  243. * 2.解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。
  244. *
  245. * @param taxUnitInfo
  246. * @param taxDeclarInfo
  247. * @return
  248. */
  249. private CompanyDeclareRequest getDeclareRequestParameter(TaxUnitInfo taxUnitInfo,
  250. IncomeTaxDeclarInfo taxDeclarInfo
  251. ) throws BOSException, JsonProcessingException, EASBizException, SQLException {
  252. LOG.error("getDeclareRequestParameter-----------taxDeclarInfo-----" + taxDeclarInfo);
  253. CompanyDeclareRequest declareRequestPara = new CompanyDeclareRequest();
  254. Map<String, Object> requestParamMap = new HashMap();
  255. //随机id
  256. String bizNo = UUID.randomUUID().toString();
  257. LOG.error("bizNo:" + bizNo);
  258. //外部业务订单号*
  259. declareRequestPara.setBizNo(bizNo);
  260. //企业名称*
  261. declareRequestPara.setName(taxUnitInfo.getName());
  262. //税号*
  263. declareRequestPara.setTaxNo(taxUnitInfo.getTaxNumber());
  264. //行政区划代码*
  265. declareRequestPara.setArea(taxUnitInfo.getAreaCode());
  266. //登记序号
  267. declareRequestPara.setRegistrationNumber(taxUnitInfo.getRegNumber());
  268. String declPassword = taxUnitInfo.getDeclPassword();
  269. if (StringUtils.isEmpty(declPassword)) {
  270. throw new BOSException("申报密码不能为空!");
  271. }
  272. declareRequestPara.setDeclarePassword(Base64Utils.decode(declPassword));
  273. //所得月份
  274. String yearMonth = taxDeclarInfo.getYearMonth();
  275. String replaceYearMonth = yearMonth.replace("-", "");
  276. LOG.error("replaceYearMonth----------------" + replaceYearMonth);
  277. //税款所属期YYYYMM*
  278. declareRequestPara.setMonth(replaceYearMonth);
  279. //总金额
  280. //BigDecimal totalMoney = taxDeclarInfo.getTotalMoney();
  281. //应退税额
  282. //BigDecimal taxRebate = taxDeclarInfo.getTaxRebate();
  283. //总人数
  284. //long totalPerson = taxDeclarInfo.getTotalPerson();
  285. //申报表分类 1=预扣预缴申报表 2=分类所得申报表 3=非居民所得申报表
  286. //String tbTble = taxDeclarInfo.getTbType().getValue();
  287. //纳税单位ID
  288. //String taxUnitId = taxUnitInfo.getId().toString();
  289. //Map<String, Object> tbTypeMap = new HashMap();
  290. //if (totalMoney.compareTo(BigDecimal.ZERO) == 0) {
  291. // tbTypeMap.put("zje", 0.0);
  292. //} else {
  293. // tbTypeMap.put("zje", totalMoney);
  294. //}
  295. //
  296. //if (taxRebate.compareTo(BigDecimal.ZERO) == 0) {
  297. // tbTypeMap.put("ynse", 0.0);
  298. //} else {
  299. // tbTypeMap.put("ynse", taxRebate);
  300. //}
  301. //tbTypeMap.put("zrs", totalPerson);
  302. //Map<String, Object> dataMap = new HashMap();
  303. //if ("1".equals(tbTble)) {
  304. // dataMap.put("ykyj", tbTypeMap);
  305. //} else if ("2".equals(tbTble)) {
  306. // dataMap.put("flsd", tbTypeMap);
  307. //} else if ("3".equals(tbTble)) {
  308. // dataMap.put("fjm", tbTypeMap);
  309. //}
  310. //密码类型*
  311. declareRequestPara.setPasswordType("0");
  312. //离职日期处理策略 1、不传或传1,代表离职日期自动清空,即人员状态由“非正常”变更为“正常”时,离职日期字段自动清空,默认逻辑。
  313. //2、传2离职日期不自动清空,即人员状态由“非正常”变更为“正常”时,离职日期不自动清空,客户如需清空需对离职日期字段传入空字符串。
  314. //declareRequestPara.setResignDateStrategy();
  315. //批次号
  316. String batchNo = taxDeclarInfo.getBatchNo();
  317. LOG.error("taxCalConfigDetailCollection--------taxDeclarInfo---------" + taxDeclarInfo);
  318. //个税应用+税款计算最终拆分明细表
  319. ITaxCalConfigDetail taxCalConfigDetail = TaxCalConfigDetailFactory.getLocalInstance(ctx);
  320. TaxCalConfigDetailCollection taxCalConfigDetailCollection = taxCalConfigDetail.getTaxCalConfigDetailCollection("select *,incomeItem.*, person.* where batchNo = '" + batchNo + "' and state = '20'");
  321. LOG.error("taxCalConfigDetailCollection-----------------" + taxCalConfigDetailCollection.size());
  322. //员工信息ID
  323. Set personIds = new HashSet();
  324. //综合所得对象
  325. ComplexIncomeRequest complexIncomeRequest = new ComplexIncomeRequest();
  326. //正常工资薪金对象
  327. NormalSalarySpecIncome normalSalarySpecIncome = new NormalSalarySpecIncome();
  328. //正常工资薪金列表
  329. List<ComplexIncome> normalSalarySpec = new ArrayList();
  330. //全年一次性奖金收入
  331. List<ComplexIncome> annualOneTimeBonusIncome = new ArrayList();
  332. //全年一次性奖金收入
  333. List<ComplexIncome> laborRemunerationIncome = new ArrayList();
  334. if (taxCalConfigDetailCollection.size() > 0) {
  335. for (int i = 0; i < taxCalConfigDetailCollection.size(); i++) {
  336. TaxCalConfigDetailInfo taxCalConfigDetailInfo = taxCalConfigDetailCollection.get(i);
  337. //员工信息
  338. PersonInfo personInfo = taxCalConfigDetailInfo.getPerson();
  339. personIds.add(personInfo.getId().toString());
  340. //所得项目
  341. TaxIncomeItemInfo incomeItem = taxCalConfigDetailInfo.getIncomeItem();
  342. //本期收入
  343. Integer sre = null;
  344. String getSreSql = "select t1 from T_HR_STaxCalConfigDetail where fid ='" + taxCalConfigDetailInfo.getId().toString() + "'";
  345. IRowSet iRowSet = DbUtil.executeQuery(ctx, getSreSql);
  346. while (iRowSet.next()) {
  347. sre = iRowSet.getInt("t1");
  348. }
  349. LOG.error("incomeItem-----------------" + incomeItem);
  350. //所属项目名称
  351. String incomeItemName = incomeItem.getName();
  352. //所属项目编码
  353. String incomeItemNumber = incomeItem.getNumber();
  354. //正常工资薪金
  355. if ("zcgzxjlb".equals(incomeItemNumber)) {
  356. //getComplexIncome(员工信息对象 ,所属项目,本期收入)
  357. normalSalarySpec.add(getComplexIncome(personInfo, incomeItemName, sre));
  358. //正常工资薪金列表 保存数据
  359. normalSalarySpecIncome.setNormalSalarySpec(normalSalarySpec);
  360. LOG.error("normalSalarySpecIncome-----------------" + mapper.writeValueAsString(normalSalarySpecIncome));
  361. complexIncomeRequest.setNormalSalarySpecIncome(normalSalarySpecIncome);
  362. }
  363. //全年一次性奖金收入
  364. if ("qnycxjjlb".equals(incomeItemNumber)) {
  365. annualOneTimeBonusIncome.add(getComplexIncome(personInfo, incomeItemName, sre));
  366. LOG.error("annualOneTimeBonusIncome-----------------" + mapper.writeValueAsString(annualOneTimeBonusIncome));
  367. LOG.error("annualOneTimeBonusIncome-----------------" + annualOneTimeBonusIncome);
  368. LOG.error("annualOneTimeBonusIncome.size()-----------------" + annualOneTimeBonusIncome.size());
  369. //全年一次性奖金收入 保存数据
  370. complexIncomeRequest.setAnnualOneTimeBonusIncome(annualOneTimeBonusIncome);
  371. }
  372. //一般劳务报酬所得
  373. if ("lwbclb".equals(incomeItemNumber)) {
  374. laborRemunerationIncome.add(getComplexIncome(personInfo, incomeItemName, sre));
  375. LOG.error("laborRemunerationIncome-----------------" + mapper.writeValueAsString(laborRemunerationIncome));
  376. //一般劳务报酬所得 保存数据
  377. complexIncomeRequest.setLaborRemunerationIncome(laborRemunerationIncome);
  378. }
  379. }
  380. }
  381. //综合所得
  382. declareRequestPara.setComplexIncomeRequest(complexIncomeRequest);
  383. //企业员工列表
  384. List<DetailCompanyEmployee> companyEmployeeList = getCompanyEmployeeList(personIds);
  385. declareRequestPara.setCompanyEmployeeList(companyEmployeeList);
  386. LOG.error("companyEmployeeList-----------------" + mapper.writeValueAsString(companyEmployeeList));
  387. return declareRequestPara;
  388. }
  389. /***
  390. * 员工
  391. * @return
  392. */
  393. private ComplexIncome getComplexIncome(PersonInfo personInfo, String incomeItemName, Integer sre) {
  394. ComplexIncome complexIncome = new ComplexIncome();
  395. //姓名
  396. complexIncome.setName(personInfo.getName());
  397. //居民身份证
  398. if (personInfo.getIdCardNO() != null) {
  399. //证照号码
  400. complexIncome.setLicenseNumber(personInfo.getIdCardNO());
  401. //证照类型
  402. complexIncome.setLicenseType("居民身份证");
  403. }
  404. //中国护照不
  405. if (personInfo.getPassportNO() != null) {
  406. //证照类型
  407. complexIncome.setLicenseType("中国护照");
  408. //证照号码
  409. complexIncome.setLicenseNumber(personInfo.getPassportNO());
  410. }
  411. //收入额
  412. complexIncome.setIncome(new BigDecimal(sre));
  413. complexIncome.setIncomeItemName(incomeItemName);
  414. return complexIncome;
  415. }
  416. /**
  417. * 企业员工列表*
  418. *
  419. * @return
  420. */
  421. private List<DetailCompanyEmployee> getCompanyEmployeeList(Set personIds) throws BOSException, EASBizException {
  422. List<DetailCompanyEmployee> companyEmployeeList = new ArrayList<DetailCompanyEmployee>();
  423. SelectorItemCollection sic = new SelectorItemCollection();
  424. sic.add("*");
  425. FilterInfo filterInfo = new FilterInfo();
  426. filterInfo.getFilterItems().add(new FilterItemInfo("id", personIds, CompareType.INCLUDE));
  427. EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, sic, null); //获取人员数据
  428. PersonCollection personCollection = PersonFactory.getLocalInstance(ctx).getPersonCollection(entityViewInfo);
  429. if (personCollection.size() > 0) {
  430. for (int i = 0; i < personCollection.size(); i++) {
  431. PersonInfo personInfo = personCollection.get(i);
  432. companyEmployeeList.add(getDetailCompanyEmployee(personInfo));
  433. }
  434. }
  435. return companyEmployeeList;
  436. }
  437. /**
  438. * 人员
  439. *
  440. * @return
  441. */
  442. public DetailCompanyEmployee getDetailCompanyEmployee(PersonInfo personInfo) throws BOSException, EASBizException {
  443. //人员对象
  444. DetailCompanyEmployee detailCompanyEmployee = new DetailCompanyEmployee();
  445. ////姓名
  446. //detailCompanyEmployee.setName("何云");
  447. ////证件类型
  448. //detailCompanyEmployee.setLicenseType("居民身份证");
  449. ////证照号码
  450. //detailCompanyEmployee.setLicenseNumber("429004198601085125");
  451. //姓名
  452. detailCompanyEmployee.setName(personInfo.getName());
  453. //complexIncome.setName("何云");
  454. //居民身份证
  455. if (personInfo.getIdCardNO() != null) {
  456. //证照号码
  457. detailCompanyEmployee.setLicenseNumber(personInfo.getIdCardNO());
  458. //证照类型
  459. detailCompanyEmployee.setLicenseType("居民身份证");
  460. //人员地区
  461. detailCompanyEmployee.setArea("境内");
  462. }
  463. //中国护照
  464. if (personInfo.getPassportNO() != null) {
  465. //证照类型
  466. detailCompanyEmployee.setLicenseType("中国护照");
  467. //证照号码
  468. detailCompanyEmployee.setLicenseNumber(personInfo.getPassportNO());
  469. //人员地区
  470. detailCompanyEmployee.setArea("境外");
  471. }
  472. //电话号码
  473. detailCompanyEmployee.setPhone(personInfo.getCell());
  474. //人员状态
  475. detailCompanyEmployee.setState(personInfo.getEmployeeType().getName());
  476. //人员报税信息->任职受雇从业信息
  477. ITaxPersonRecordEntry iTaxPersonRecordEntry = TaxPersonRecordEntryFactory.getLocalInstance(ctx);
  478. TaxPersonRecordEntryCollection taxPersonRecordEntryCollection = iTaxPersonRecordEntry.getTaxPersonRecordEntryCollection("where person.id = '" + personInfo.getId() + "'");
  479. TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntryCollection.get(0);
  480. //任职受雇类型 可选择雇员、保险营销员、证券经纪人、其他、实习学生(全日制学历教育)
  481. //detailCompanyEmployee.setIsEmployee("其他");
  482. detailCompanyEmployee.setIsEmployee(taxPersonRecordEntryInfo.getEmployedType().getAlias());
  483. //受雇日期 YYYY-MM-DD,不能大于当前时间,任职受雇类型选择雇员、保险营销员、证券经纪人时必录
  484. SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
  485. detailCompanyEmployee.setEmployedDate(inputFormat.format(taxPersonRecordEntryInfo.getEmployedDate()));
  486. //性别
  487. detailCompanyEmployee.setGender(personInfo.getGender().getAlias());
  488. //出生日期
  489. detailCompanyEmployee.setBirthday(inputFormat.format(personInfo.getBirthday()));
  490. //国籍 nationality
  491. NationalityInfo nationality = personInfo.getNationality();
  492. detailCompanyEmployee.setNationality(nationality.getName());
  493. return detailCompanyEmployee;
  494. }
  495. private String getCheckSqlByType(Map<String, Object> incomeIdMap, String taxUnitId, String yearMonth, TbTypeEnum typeEnum) {
  496. StringBuilder sqlBuf = new StringBuilder();
  497. sqlBuf.append(" SELECT distinct tx.FTAXUNITID,t1.Fname_l2 as TAXNAME,p1.FNUMBER,p1.Fname_l2 as PERSONNAME, ti.fIncomeCode ");
  498. sqlBuf.append(" FROM T_HR_STaxCalConfigDetail tx ");
  499. sqlBuf.append(" left join T_HR_TAXUNIT as t1 on t1.fid = tx.FTaxUnitID ");
  500. sqlBuf.append(" left join T_BD_PERSON as p1 on p1.fid = tx.FPersonId ");
  501. sqlBuf.append(" left join t_hr_sTaxIncomeItem as ti on tx.fIncomeItemId = ti.fid ");
  502. String dateFilter = CmpSQLUtil.generateSqlDateFilter("tx.FPeriodBegin", "tx.FPeriodEnd", yearMonth);
  503. sqlBuf.append(" where ").append(dateFilter);
  504. sqlBuf.append(" and tx.FTAXUNITID='").append(taxUnitId).append("'");
  505. sqlBuf.append(" and tx.FSTATE=10");
  506. sqlBuf.append(" and tx.FIsLast=1");
  507. sqlBuf.append(" and tx.FIncomeItemId in ").append(incomeIdMap.get(typeEnum.getValue()));
  508. return sqlBuf.toString();
  509. }
  510. //private Map<String, Object> checkTaxDeclareData(Context ctx, List<IncomeTaxDeclarInfo> waitToDeclareList) throws BOSException {
  511. // Map<String, Object> checkDataResultMap = new HashMap();
  512. // return null;
  513. //}
  514. private Map<String, Object> checkTaxDeclareData(Context ctx, HttpServletRequest request, List<IncomeTaxDeclarInfo> waitToDeclareList) throws BOSException, SQLException, ShrWebBizException {
  515. Map<String, Object> checkDataResultMap = new HashMap();
  516. boolean hasErrData = false;
  517. if (waitToDeclareList != null && waitToDeclareList.size() > 0) {
  518. List<String> preCheckSql = new ArrayList();
  519. List<String> specCheckForPre = new ArrayList();
  520. List<String> notPersonCheckSql = new ArrayList();
  521. List<String> classifyCheckSql = new ArrayList();
  522. Map<String, Object> incomeIdMap = new HashMap();
  523. incomeIdMap.put("1", CmpTaxUtil.genIncomeItemId(ctx, "1"));
  524. incomeIdMap.put("2", CmpTaxUtil.genIncomeItemId(ctx, "2"));
  525. incomeIdMap.put("3", CmpTaxUtil.genIncomeItemId(ctx, "3"));
  526. Iterator i$ = waitToDeclareList.iterator();
  527. String yearMonth;
  528. while (i$.hasNext()) {
  529. IncomeTaxDeclarInfo declareInfo = (IncomeTaxDeclarInfo) i$.next();
  530. TbTypeEnum tbType = declareInfo.getTbType();
  531. String taxUnitId = declareInfo.getTaxUnit().getId().toString();
  532. yearMonth = declareInfo.getYearMonth();
  533. if (tbType != null) {
  534. if ("1".equals(tbType.getValue())) {
  535. preCheckSql.add(this.getCheckSqlByType(incomeIdMap, taxUnitId, yearMonth, TbTypeEnum.SB0701));
  536. specCheckForPre.add(this.getPreCheckSql(declareInfo));
  537. } else if ("3".equals(tbType.getValue())) {
  538. notPersonCheckSql.add(this.getCheckSqlByType(incomeIdMap, taxUnitId, yearMonth, TbTypeEnum.SB0703));
  539. } else {
  540. classifyCheckSql.add(this.getCheckSqlByType(incomeIdMap, taxUnitId, yearMonth, TbTypeEnum.SB0702));
  541. }
  542. }
  543. }
  544. Map<String, String> reasonOperaMap = new HashMap();
  545. reasonOperaMap.put("noCalDataReson", EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label140", ctx.getLocale()));
  546. reasonOperaMap.put("noCalDataOper", EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label141", ctx.getLocale()));
  547. reasonOperaMap.put("preDataReason", EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label142", ctx.getLocale()));
  548. reasonOperaMap.put("preDataOpera", EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label143", ctx.getLocale()));
  549. List<TaxDeclarExcelRowDTO> taxDeclareExcelRowDTOS = new ArrayList();
  550. taxDeclareExcelRowDTOS.addAll(this.getExceptData(ctx, preCheckSql, specCheckForPre, reasonOperaMap, TbTypeEnum.SB0701));
  551. taxDeclareExcelRowDTOS.addAll(this.getExceptData(ctx, classifyCheckSql, specCheckForPre, reasonOperaMap, TbTypeEnum.SB0702));
  552. taxDeclareExcelRowDTOS.addAll(this.getExceptData(ctx, notPersonCheckSql, specCheckForPre, reasonOperaMap, TbTypeEnum.SB0703));
  553. String filePath = "";
  554. if (taxDeclareExcelRowDTOS.size() > 0) {
  555. hasErrData = true;
  556. HSSFWorkbook workbook = new HSSFWorkbook();
  557. yearMonth = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label144", ctx.getLocale());
  558. this.fillTitle(ctx, workbook, yearMonth.split(","));
  559. this.fillWorkdBookData(workbook, taxDeclareExcelRowDTOS);
  560. SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
  561. File dir = new File(UserUtil.getUserTempDirAbsolutePath(request.getSession()));
  562. if (!dir.exists()) {
  563. dir.mkdirs();
  564. }
  565. String fileName = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label145", ctx.getLocale()) + "_" + format.format(new Date()) + ".xls";
  566. String realFileName = MD5.md5Hash(fileName);
  567. File file = new File(dir, realFileName);
  568. FileOutputStream out = null;
  569. try {
  570. out = new FileOutputStream(file);
  571. workbook.write(out);
  572. out.flush();
  573. } catch (FileNotFoundException var33) {
  574. LOG.error(var33.getMessage(), var33);
  575. } catch (IOException var34) {
  576. LOG.error(var34.getMessage(), var34);
  577. } finally {
  578. if (out != null) {
  579. try {
  580. out.close();
  581. } catch (IOException var32) {
  582. LOG.error(var32.getMessage(), var32);
  583. }
  584. }
  585. }
  586. Map<String, String> params = new HashMap();
  587. params.put("method", "tmp");
  588. params.put("file", realFileName);
  589. params.put("filename", fileName);
  590. filePath = DynamicUtil.assembleUrl("/downloadfile.do", params);
  591. }
  592. checkDataResultMap.put("excel", filePath);
  593. }
  594. checkDataResultMap.put("hasErrData", hasErrData);
  595. return checkDataResultMap;
  596. }
  597. private void fillTitle(Context ctx, HSSFWorkbook workbook, String[] titleArr) {
  598. HSSFSheet sheet = workbook.createSheet();
  599. HSSFRow createRow = sheet.createRow(0);
  600. HSSFCell infoCell = createRow.createCell(0);
  601. infoCell.setCellValue(EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label146", ctx.getLocale()));
  602. sheet.setColumnWidth(0, 12800);
  603. createRow = sheet.createRow(1);
  604. HSSFFont font = workbook.createFont();
  605. font.setColor((short) 8);
  606. font.setFontHeightInPoints((short) 12);
  607. font.setBoldweight((short) 700);
  608. HSSFCellStyle style = workbook.createCellStyle();
  609. style.setFont(font);
  610. style.setAlignment((short) 2);
  611. style.setVerticalAlignment((short) 1);
  612. if (titleArr != null && titleArr.length > 0) {
  613. for (int i = 0; i < titleArr.length; ++i) {
  614. HSSFCell cell = createRow.createCell(i);
  615. cell.setCellStyle(style);
  616. cell.setCellValue(titleArr[i]);
  617. if (i > 3) {
  618. sheet.setColumnWidth(i, 15360);
  619. } else {
  620. sheet.setColumnWidth(i, 7680);
  621. }
  622. }
  623. }
  624. }
  625. private void fillWorkdBookData(HSSFWorkbook workbook, List<TaxDeclarExcelRowDTO> dataList) {
  626. HSSFSheet sheet = workbook.getSheetAt(0);
  627. if (dataList != null && dataList.size() > 0) {
  628. for (int i = 0; i < dataList.size(); ++i) {
  629. HSSFRow row = sheet.createRow(i + 2);
  630. TaxDeclarExcelRowDTO excelRowDTO = (TaxDeclarExcelRowDTO) dataList.get(i);
  631. HSSFCell cell = row.createCell(0);
  632. cell.setCellValue(excelRowDTO.getPersonNum());
  633. cell = row.createCell(1);
  634. cell.setCellValue(excelRowDTO.getPersonName());
  635. cell = row.createCell(2);
  636. cell.setCellValue(excelRowDTO.getTaxName());
  637. cell = row.createCell(3);
  638. cell.setCellValue(excelRowDTO.getDeclarType());
  639. cell = row.createCell(4);
  640. cell.setCellValue(excelRowDTO.getReason());
  641. cell = row.createCell(5);
  642. cell.setCellValue(excelRowDTO.getOperation());
  643. }
  644. }
  645. }
  646. private String getSqlDateFilterLqDate(String dateStr) {
  647. String[] beginDateArr = dateStr.split("-");
  648. Calendar calendar = Calendar.getInstance();
  649. calendar.set(Integer.parseInt(beginDateArr[0]), Integer.parseInt(beginDateArr[1]) - 1, 1, 0, 0, 0);
  650. Date beginDate = calendar.getTime();
  651. return CmpDateUtil.toKSqlDate(beginDate);
  652. }
  653. private List<TaxDeclarExcelRowDTO> getExceptData(Context ctx, List<String> preCheckSql, List<String> specCheckForPre, Map<String, String> noCalDataOper, TbTypeEnum typeEnum) throws BOSException, SQLException, ShrWebBizException {
  654. List<TaxDeclarExcelRowDTO> taxDeclarExcelRowDTOS = new ArrayList();
  655. Iterator i$;
  656. String s;
  657. IRowSet rowSet;
  658. TaxDeclarExcelRowDTO taxDeclareExcelRow;
  659. if (preCheckSql != null && preCheckSql.size() > 0) {
  660. i$ = preCheckSql.iterator();
  661. while (i$.hasNext()) {
  662. s = (String) i$.next();
  663. rowSet = DbUtil.executeQuery(ctx, s);
  664. while (rowSet.next()) {
  665. taxDeclareExcelRow = new TaxDeclarExcelRowDTO();
  666. taxDeclareExcelRow.setPersonNum(rowSet.getString("FNUMBER"));
  667. taxDeclareExcelRow.setPersonName(rowSet.getString("PERSONNAME"));
  668. String taxUnitName = rowSet.getString("TAXNAME");
  669. taxDeclareExcelRow.setTaxName(taxUnitName);
  670. taxDeclareExcelRow.setDeclarType(typeEnum.getAlias());
  671. taxDeclareExcelRow.setReason((String) noCalDataOper.get("noCalDataReson"));
  672. taxDeclareExcelRow.setOperation((String) noCalDataOper.get("noCalDataOper"));
  673. String incomeCode = (String) noCalDataOper.get("fIncomeCode");
  674. taxDeclarExcelRowDTOS.add(taxDeclareExcelRow);
  675. }
  676. }
  677. }
  678. if ("1".equals(typeEnum.getValue()) && specCheckForPre != null && specCheckForPre.size() > 0) {
  679. i$ = specCheckForPre.iterator();
  680. while (i$.hasNext()) {
  681. s = (String) i$.next();
  682. rowSet = DbUtil.executeQuery(ctx, s);
  683. while (rowSet.next()) {
  684. taxDeclareExcelRow = new TaxDeclarExcelRowDTO();
  685. taxDeclareExcelRow.setPersonNum(rowSet.getString("FNUMBER"));
  686. taxDeclareExcelRow.setPersonName(rowSet.getString("PERSONNAME"));
  687. taxDeclareExcelRow.setTaxName(rowSet.getString("TAXNAME"));
  688. taxDeclareExcelRow.setDeclarType(typeEnum.getAlias());
  689. taxDeclareExcelRow.setReason((String) noCalDataOper.get("preDataReason"));
  690. taxDeclareExcelRow.setOperation((String) noCalDataOper.get("preDataOpera"));
  691. taxDeclarExcelRowDTOS.add(taxDeclareExcelRow);
  692. }
  693. }
  694. }
  695. return taxDeclarExcelRowDTOS;
  696. }
  697. private String getPreCheckSql(IncomeTaxDeclarInfo incomeTaxDeclarInfo) {
  698. StringBuilder sqlBuf = new StringBuilder();
  699. String yearMonth = incomeTaxDeclarInfo.getYearMonth();
  700. String taxUnitId = incomeTaxDeclarInfo.getTaxUnit().getId().toString();
  701. String sql = "select FPersonID from T_HR_STaxCalConfigDetail where FTaxUnitId='" + taxUnitId + "' and FPeriodBegin = " + CmpDateUtil.toKSqlDate(incomeTaxDeclarInfo.getYearMonthDate());
  702. sqlBuf.append(" SELECT distinct ent.FTAXUNITID, t.Fname_l2 as TAXNAME, p.FNUMBER, p.Fname_l2 as PERSONNAME ");
  703. sqlBuf.append(" FROM T_HR_STaxPersonRecordEntry ent ");
  704. sqlBuf.append(" left join T_HR_TAXUNIT as t on t.fid = ent.FTaxUnitID ");
  705. sqlBuf.append(" left join T_BD_PERSON as p on p.fid = ent.FPersonId ");
  706. sqlBuf.append(" where ent.FSubmitStatus='2' and ent.FPersonStatus='1' ");
  707. sqlBuf.append(" and ent.FTaxUnitID='").append(taxUnitId).append("'");
  708. sqlBuf.append(" and ent.FENDDATE <=").append(this.getSqlDateFilterLqDate(yearMonth));
  709. sqlBuf.append(" and ent.FPersonID not in ( ").append(sql).append(" )");
  710. return sqlBuf.toString();
  711. }
  712. private Map<String, Object> checkIncomeTaxIssue(Context ctx, List<IncomeTaxDeclarInfo> waitToDeclareList) throws BOSException {
  713. StringBuilder taxUnitIds = new StringBuilder();
  714. IncomeTaxDeclarInfo declareInfo;
  715. for (Iterator i$ = waitToDeclareList.iterator(); i$.hasNext(); taxUnitIds.append(declareInfo.getTaxUnit().getId().toString())) {
  716. declareInfo = (IncomeTaxDeclarInfo) i$.next();
  717. if (taxUnitIds.length() > 0) {
  718. taxUnitIds.append(",");
  719. }
  720. }
  721. String oql = "select person.person.name where taxUnit.id in " + CmpStrUtil.buildInSql(taxUnitIds.toString()) + " and result = " + 1 + " and status = " + 2 + " and inviteStatus = " + 0;
  722. IncomeTaxIssueCollection collection = IncomeTaxIssueFactory.getLocalInstance(ctx).getIncomeTaxIssueCollection(oql);
  723. if (collection != null && !collection.isEmpty()) {
  724. StringBuilder errMsg = new StringBuilder();
  725. for (int i = 0; i < collection.size() && i != 5; ++i) {
  726. if (errMsg.length() > 0) {
  727. errMsg.append(",");
  728. }
  729. errMsg.append("[").append(collection.get(i).getPerson().getPerson().getName()).append("]");
  730. }
  731. Map<String, Object> map = new HashMap();
  732. map.put("errMsg", "以下员工存在申诉属实争议,且未进行邀请确认,需要进行发送邀请确认后才可进行个税申报或者进行非正常人员报送(更新人员报税信息中的人员状态为非正常,并进行人员报送成功),员工姓名:" + errMsg.toString() + ",选择[是]则跳转到[申诉争议-申诉属实人员]列表,选择[否]则跳转到[人员报税信息]列表。");
  733. map.put("issueError", true);
  734. return map;
  735. } else {
  736. return null;
  737. }
  738. }
  739. private String checkTaxCalStatus(Context ctx, List<IncomeTaxDeclarInfo> waitToDeclareList) throws SHRWebException {
  740. String sql = "select t.fState, u.fName_l2 taxUnitName, d.fIncomeItemId from t_hr_sTaxCalConfigDetail d left join t_hr_sTaxCalInitDetail t on d.fCmpCalTableId = t.fCmpCalTableId and d.fIncomeItemId = t.fIncomeItemId left join t_hr_taxUnit u on d.fTaxUnitId = u.fid where d.fTaxUnitId = ? and d.fPeriodBegin = ?";
  741. try {
  742. Iterator i$ = waitToDeclareList.iterator();
  743. boolean isTaxCalFinished;
  744. String taxUnitName;
  745. do {
  746. if (!i$.hasNext()) {
  747. return null;
  748. }
  749. IncomeTaxDeclarInfo declareInfo = (IncomeTaxDeclarInfo) i$.next();
  750. String taxUnitId = declareInfo.getTaxUnit().getId().toString();
  751. Date periodDate = declareInfo.getYearMonthDate();
  752. Object[] param = new Object[]{taxUnitId, CmpDateUtil.toSqlDate(periodDate)};
  753. IRowSet rs = DbUtil.executeQuery(ctx, sql, param);
  754. boolean havingSalaryIncome = false;
  755. isTaxCalFinished = true;
  756. taxUnitName = "";
  757. while (rs.next()) {
  758. int state = rs.getInt("fState");
  759. taxUnitName = rs.getString("taxUnitName");
  760. String incomeItemId = rs.getString("fIncomeItemId");
  761. if (state != 40) {
  762. isTaxCalFinished = false;
  763. }
  764. if ("8r0AAABCg2PDiOoP".equals(incomeItemId)) {
  765. havingSalaryIncome = true;
  766. }
  767. }
  768. TbTypeEnum typeEnum = declareInfo.getTbType();
  769. if (!havingSalaryIncome && typeEnum == TbTypeEnum.SB0701) {
  770. return "纳税单位[" + taxUnitName + "]当期预扣预缴申报表未包含所得项目为正常工资薪金所得的员工,不允许申报,请确认";
  771. }
  772. } while (isTaxCalFinished);
  773. return "纳税单位【" + taxUnitName + "】存在接口算税未完成的数据,请确认";
  774. } catch (Exception var15) {
  775. LOG.error("checkTaxCalStatus error: ", var15);
  776. throw new SHRWebException(var15.getMessage());
  777. }
  778. }
  779. /**
  780. * 异常提醒
  781. *
  782. * @param advanceDeclareInfo
  783. * @return
  784. */
  785. private String combineError(List<String> advanceDeclareInfo) {
  786. StringBuilder error = new StringBuilder();
  787. error.append("以下纳税单位尚未到申报时间,请不要提前申报:");
  788. Iterator i$ = advanceDeclareInfo.iterator();
  789. while (i$.hasNext()) {
  790. String taxUnitInfo = (String) i$.next();
  791. if (advanceDeclareInfo.indexOf(taxUnitInfo) == 5) {
  792. error.append("...");
  793. break;
  794. }
  795. if (advanceDeclareInfo.indexOf(taxUnitInfo) > 0) {
  796. error.append(",");
  797. }
  798. String[] arr = taxUnitInfo.split("_");
  799. error.append(arr[0]).append("【").append(arr[1]).append("】");
  800. }
  801. return error.toString();
  802. }
  803. /**
  804. * 获取个税申报审批通过数据
  805. *
  806. * @param ctx
  807. * @param selectedId
  808. * @return
  809. * @throws BOSException
  810. */
  811. private Map<String, Object> getDeclareData(Context ctx, String selectedId) throws BOSException, JsonProcessingException {
  812. Map<String, Object> resultMap = new HashMap();
  813. List<TaxDeclareDTO> declaredList = new ArrayList();
  814. List<IncomeTaxDeclarInfo> waitToDeclareList = new ArrayList();
  815. String sqlInString = CmpUtils.spiltToSqlString(selectedId);
  816. if (StringUtils.isEmpty(sqlInString)) {
  817. sqlInString = "''";
  818. }
  819. String currentYearMonth = CmpDateUtil.getDateStr(new Date(), "yyyy-MM");
  820. String oqlBuffer = "select id,yearMonth,totalPerson,totalMoney,taxRebate,declareStatus,versionCode,yearMonthDate,tbType,taxUnit.id,taxUnit.name,taxUnit.taxNumber,taxUnit.regNumber,taxUnit.areaCode,taxUnit.declPassword, batchNo where id in ( " + sqlInString + " )";
  821. LOG.error("getDeclareData----------oqlBuffer------" + oqlBuffer);
  822. IncomeTaxDeclarCollection declareCollection = IncomeTaxDeclarFactory.getLocalInstance(ctx).getIncomeTaxDeclarCollection(oqlBuffer);
  823. LOG.error("getDeclareData----------declareCollection------" + declareCollection.size());
  824. String ms1 = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label137", ctx.getLocale());
  825. String ms2 = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label138", ctx.getLocale());
  826. String ms3 = EASResource.getString("com.kingdee.shr.compensation.resource.CommonResource", "label139", ctx.getLocale());
  827. List<String> taxUnitInfo = new ArrayList();
  828. if (declareCollection != null && declareCollection.size() > 0) {
  829. for (int i = 0; i < declareCollection.size(); ++i) {
  830. IncomeTaxDeclarInfo declareInfo = declareCollection.get(i);
  831. String declareStatus = declareInfo.getDeclareStatus().getValue();
  832. LOG.error("getDeclareData----------declareStatus------" + declareStatus);
  833. String taxUnitName = declareInfo.getTaxUnit().getName();
  834. String tbTypeAlia = declareInfo.getTbType().getAlias();
  835. if (currentYearMonth.compareTo(declareInfo.getYearMonth()) <= 0) {
  836. taxUnitInfo.add(declareInfo.getTaxUnit().getName() + "_" + declareInfo.getYearMonth());
  837. }
  838. if (!"1".equals(declareStatus) && !"2".equals(declareStatus)) {
  839. waitToDeclareList.add(declareInfo);
  840. LOG.error("getDeclareData----------waitToDeclareList------" + waitToDeclareList);
  841. } else {
  842. TaxDeclareDTO dto = new TaxDeclareDTO(taxUnitName, tbTypeAlia);
  843. declaredList.add(dto);
  844. }
  845. }
  846. if (declaredList.size() == declareCollection.size()) {
  847. resultMap.put("info", ms1);
  848. } else if (declaredList.size() == 0) {
  849. resultMap.put("info", ms2);
  850. } else {
  851. resultMap.put("info", ms3);
  852. }
  853. }
  854. LOG.error("getDeclareData----------resultMap------" + resultMap);
  855. resultMap.put("DECLARED", declaredList);
  856. resultMap.put("advanceDeclareInfo", taxUnitInfo);
  857. resultMap.put("WATI_TO_DECLARE", waitToDeclareList);
  858. return resultMap;
  859. }
  860. private void updateOrCancel(HttpServletRequest request, HttpServletResponse response, TaskCatalogEnum catalog)
  861. throws SHRWebException {
  862. Context ctx = SHRContext.getInstance().getContext();
  863. String selectedId = request.getParameter("selectedId");
  864. String oql = "select id, tbType, yearMonth, yearMonthDate, taxUnit.id, taxUnit.name, taxUnit.areaCode, taxUnit.taxNumber, taxUnit.regNumber, taxUnit.declPassword, taxUnit.realPassword, acceptId where id = '"
  865. + selectedId + "'";
  866. try {
  867. IncomeTaxDeclarCollection collection = IncomeTaxDeclarFactory.getLocalInstance(ctx)
  868. .getIncomeTaxDeclarCollection(oql);
  869. if (null != collection && collection.size() != 0) {
  870. IncomeTaxDeclarInfo incomeTaxDeclare = collection.get(0);
  871. if (TaskCatalogEnum.TaxDeclareUpdate == catalog) {
  872. //更新
  873. updateDeclare(ctx,incomeTaxDeclare);
  874. } else {
  875. //更新以外的
  876. if (TaskCatalogEnum.CancelTaxDeclare != catalog) {
  877. //撤销更正
  878. cancelUpdate( ctx ,incomeTaxDeclare);
  879. return;
  880. }
  881. //撤销申报
  882. cancelDeclare(ctx,incomeTaxDeclare);
  883. }
  884. String templateId = "4i4AAAAS76+Vh943";
  885. String columnSQL = "select t.fieldsn, f.FPROPNAME,f.fname_l2,f.fcustomfield from T_BS_SHRFileTemplateFields f left join t_HR_sTaxItem t on f.FPROPNAME = t.FNUMBER where f.fcmpimporttempid = '"
  886. + templateId + "' order by f.fsortsn ";
  887. IRowSet columnSet = DbUtil.executeQuery(ctx, columnSQL);
  888. StringBuilder tmpSQL = new StringBuilder();
  889. tmpSQL.append("select ");
  890. String dynamicFieldPrefix = "t";
  891. String local = SHRContext.getInstance().getContext().getLocale().getDisplayLanguage();
  892. int columnSize = columnSet.size();
  893. while (columnSet.next()) {
  894. int index = columnSet.getInt(1);
  895. String propName = columnSet.getString(2);
  896. int isCustom = columnSet.getInt(4);
  897. if (isCustom == 1 && index > 0) {
  898. tmpSQL.append(dynamicFieldPrefix).append(index).append(",");
  899. } else if (propName.endsWith("_")) {
  900. tmpSQL.append(propName).append(local).append(",");
  901. } else {
  902. tmpSQL.append(propName).append(",");
  903. }
  904. }
  905. String sql = tmpSQL.substring(0, tmpSQL.length() - 1);
  906. Date date = incomeTaxDeclare.getYearMonthDate();
  907. String taxUnitId = incomeTaxDeclare.getTaxUnit().getId().toString();
  908. TbTypeEnum tbType = incomeTaxDeclare.getTbType();
  909. String personType = CmpConstants.getPayerTypeByTbType(tbType.getValue());
  910. String dataSQL = sql
  911. + " from t_hr_sTaxCalConfigDetail t left join T_BD_Person person on t.fPersonId = person.fid left join T_HR_STaxPersonRecord taxPersonRec on t.fPersonId = taxPersonRec.fPersonId left join T_HR_TaxUnit taxUnit on t.fTaxUnitId = taxUnit.fid left join T_HR_STaxIncomeItem item on t.fIncomeItemId = item.fid left join T_HR_STaxPersonRecordEntry pEntry on taxPersonRec.fid = pEntry.fBillId where t.fPeriodBegin = "
  912. + CmpDateUtil.toKSqlDate(date) + " and t.fTaxUnitId = '" + taxUnitId
  913. + "' and pEntry.fTaxUnitId = '" + taxUnitId + "' and pEntry.fPayerType = '" + personType
  914. + "'";
  915. IRowSet dataSet = DbUtil.executeQuery(ctx, dataSQL);
  916. List<List<Object>> dataList = new ArrayList();
  917. IRowSetMetaData metaData = dataSet.getRowSetMetaData();
  918. for (int rowIndex = 1; dataSet.next(); ++rowIndex) {
  919. List<Object> row = new ArrayList();
  920. row.add(rowIndex);
  921. for (int i = 1; i <= columnSize; ++i) {
  922. int dataType = metaData.getColumnType(i);
  923. row.add(ImplUtils.getDataFromDr(dataType, dataSet, i));
  924. }
  925. dataList.add(row);
  926. }
  927. String template = request.getSession().getServletContext().getRealPath("/")
  928. + "addon/compensation/web/resource/incomeTaxSbbExportTemplate.xlsx";
  929. String taxUnitName = incomeTaxDeclare.getTaxUnit().getName();
  930. String tbTypeName = incomeTaxDeclare.getTbType().getAlias();
  931. String period = TaxCalcFileUtils.getCnPeriod1(incomeTaxDeclare.getYearMonthDate());
  932. String timestamp = TaxCalcFileUtils.getTimestamp(new Date());
  933. String userTempDirAbsolutePath = UserUtil.getUserTempDirAbsolutePath(request.getSession());
  934. userTempDirAbsolutePath = userTempDirAbsolutePath + "/exportExcel";
  935. File dir = new File(userTempDirAbsolutePath);
  936. if (!dir.exists()) {
  937. dir.mkdirs();
  938. }
  939. String fileName = "个税申报表_" + taxUnitName + "_" + tbTypeName + "_" + period + "_" + timestamp
  940. + ".xlsx";
  941. String path = dir.getAbsolutePath() + File.separator + fileName;
  942. Map<String, String> params = new HashMap();
  943. params.put("startAndEnd", TaxCalcFileUtils.getCnPeriod2(incomeTaxDeclare.getYearMonthDate()));
  944. params.put("taxUnitName", taxUnitName);
  945. params.put("taxUnitNumber", incomeTaxDeclare.getTaxUnit().getTaxNumber());
  946. CmpExcelUtil.writeData2Template(dataList, template, 8, path, params);
  947. String headerStr = "attachment;filename=" + URLEncoder.encode(fileName, "utf-8");
  948. response.setHeader("Content-disposition", headerStr);
  949. response.getOutputStream().write(TaxCalcFileUtils.file2ByteArray(new File(path)));
  950. response.getOutputStream().flush();
  951. return;
  952. } else {
  953. throw new SHRWebException("没有找到申报记录");
  954. }
  955. } catch (Exception var37) {
  956. LOG.error("updateDeclareAction error: ", var37);
  957. throw new SHRWebException(var37.getMessage());
  958. }
  959. }
  960. protected Map cancelUpdate(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
  961. try {
  962. String sql = "select t.fAccept_id as acceptId from t_hr_sIncomeTaxDeclar d left join t_hr_sTaskIncomeTaxRelation r on d.fid = r.fBizId left join t_hr_sTaxCalTask t on r.fTaskId = t.fid where d.fid = '"
  963. + taxDeclare.getId().toString() + "' and t.fCatalog = " + 120;
  964. IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
  965. if (rowSet.size() == 0) {
  966. throw new BOSException("找不到更正申报任务受理id");
  967. } else {
  968. while (rowSet.next()) {
  969. taxDeclare.setAcceptId(rowSet.getString("acceptId"));
  970. }
  971. return updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.CancelTaxUpdate);
  972. }
  973. } catch (SQLException var5) {
  974. LOG.error("_cancelUpdate error: ", var5);
  975. throw new BOSException(var5.getMessage());
  976. }
  977. }
  978. private Map updateOrCancel(Context ctx, IncomeTaxDeclarInfo taxDeclare, TaskCatalogEnum catalog)
  979. throws BOSException {
  980. JSONObject param = new JSONObject();
  981. param.put("taxDeclarId", taxDeclare.getId());
  982. param.put("taxDeclarBatchNo", taxDeclare.getBatchNo());
  983. Map<String, Object> paramMap = new HashMap();
  984. DeclareCancelRequest requestObj = new DeclareCancelRequest();
  985. TaxUnitInfo taxUnit = taxDeclare.getTaxUnit();
  986. /// bizNo 外部业务编号 String(64) 是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID
  987. String bizNo = UUID.randomUUID().toString();
  988. paramMap.put("bizNo" , bizNo);
  989. requestObj.setBizNo(bizNo);
  990. //qymc 企业名称 String(64) 是 代报企业全称
  991. paramMap.put("qymc" , taxUnit.getName() );
  992. requestObj.setName(taxUnit.getName());
  993. //djxhid 登记序号 String(64) 条件必填 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
  994. paramMap.put("djxhid" , taxUnit.getRegNumber());
  995. requestObj.setRegistrationNumber(taxUnit.getRegNumber());
  996. //nsrsbh 税号 String(64) 是 扣缴单位纳税人识别号
  997. paramMap.put("nsrsbh" , taxUnit.getTaxNumber());
  998. requestObj.setTaxNo(taxUnit.getTaxNumber());
  999. //areaid 地区编号 String(64) 是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
  1000. paramMap.put("areaid" , taxUnit.getAreaCode());
  1001. requestObj.setArea(taxUnit.getAreaCode());
  1002. //bmbh 部门编号 String(64) 条件必填 分部门代报时必传
  1003. //bmmc 部门名称 String(64) 否
  1004. //skssq 所属期 String(64) 是 格式YYYYMM。为空时, 根据任职受雇日期判断:
  1005. String period = taxDeclare.getYearMonth();
  1006. period = period.contains("-") ? period.replace("-", "") : period;
  1007. period = period.substring(0, 6);
  1008. requestObj.setMonth(taxUnit.getAreaCode());
  1009. //sblx 申报类型 String(64) 必填 1:综合所得;2:分类所得;3:非居民所得;4:限售股所得
  1010. paramMap.put("sblx" , "1");
  1011. requestObj.setDeclarationType("1");
  1012. //sfqksd 是否清空所得数据 String(64) 否 0:不清空 1 清空, 默认为0, 作废申报的同时清空数据
  1013. requestObj.setCancelImportDataOption("0");
  1014. //jmsmmm 加密实名密码 String(64) 否 默认不传则设置为0,0表示不加密;1表示加密
  1015. paramMap.put("jmsbmm" , "0");
  1016. requestObj.setEncryptedRealNamePassword("0");
  1017. if (!StringUtils.isEmpty(taxUnit.getRealPassword())) {
  1018. //mmlx 密码类型 String(64) 否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
  1019. paramMap.put("mmlx" , "2");
  1020. requestObj.setPasswordType("2");
  1021. //smzh 实名账号 String(64) 条件必填 当mmlx=2时,必填。
  1022. paramMap.put("smzh", false);
  1023. requestObj.setRealNameAccount("");
  1024. //smmm 实名密码 String(64) 条件必填 当mmlx=2时,必填
  1025. paramMap.put("smmm", Base64Utils.decode(taxUnit.getRealPassword()));
  1026. requestObj.setRealNamePassword(Base64Utils.decode(taxUnit.getRealPassword()));
  1027. }
  1028. if (!StringUtils.isEmpty(taxUnit.getDeclPassword())) {
  1029. //sbmm 申报密码 String(64) 条件必填 当mmlx=0时,必填
  1030. paramMap.put("sbmm", Base64Utils.decode(taxUnit.getDeclPassword()));
  1031. requestObj.setDeclarePassword(Base64Utils.decode(taxUnit.getDeclPassword()));
  1032. //mmlx 密码类型 String(64) 否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
  1033. paramMap.put("mmlx" , "0");
  1034. requestObj.setPasswordType("0");
  1035. }
  1036. //客户端代理工厂
  1037. try {
  1038. ClientProxyFactory clientProxyFactory = ClientProxyFactoryUtils.getClientProxyFactory();
  1039. //算税请求接口
  1040. DeclarationRequest declarationRequest = clientProxyFactory.getDeclarationRequest();
  1041. //获取请求参数
  1042. if( catalog.equals(TaskCatalogEnum.CancelTaxDeclare) ) {
  1043. System.out.print("撤销申报执行");
  1044. Gson gson = new Gson();
  1045. Type personType = new TypeToken<DeclareCancelRequest>(){}.getType();
  1046. DeclareCancelRequest newObj = gson.fromJson(gson.toJson(paramMap), personType);
  1047. //CancelTaxDeclare 作废申报 140
  1048. ApiResponse<AsyncResult> apiResponse = declarationRequest.cancel (newObj);
  1049. if (apiResponse.getHead().getCode().equals("00000000")) {
  1050. AsyncResult body = apiResponse.getBody();
  1051. String requestId = body.getRequestId();
  1052. LOG.error("requestId-----" + requestId);
  1053. ISYUtilsFacade isyUtilsFacade = SYUtilsFacadeFactory.getLocalInstance(ctx);
  1054. //backTask(url,requestId,回调osf服务,自定义参数,任务类型)
  1055. JSONObject json = new JSONObject();
  1056. json.put("requestId", requestId);
  1057. json.put("param", param.toString());
  1058. isyUtilsFacade.addTask("CancelDeclareService", json.toJSONString(), TaskCatalogEnum.CancelTaxDeclare, "");
  1059. }
  1060. }else if(catalog.equals(TaskCatalogEnum.TaxDeclareUpdate)) {
  1061. System.out.print("更正申报执行");
  1062. //更正申报 120
  1063. Gson gson = new Gson();
  1064. Type personType = new TypeToken<DeclareCorrectRequest>(){}.getType();
  1065. DeclareCorrectRequest newObj = gson.fromJson(gson.toJson(paramMap), personType);
  1066. ApiResponse<AsyncResult> apiResponse = declarationRequest.correct (newObj);
  1067. if (apiResponse.getHead().getCode().equals("00000000")) {
  1068. //同步接口;
  1069. //个税申报批次号
  1070. String taxDeclarBatchNo = taxDeclare.getBatchNo();
  1071. IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);
  1072. IncomeTaxDeclarCollection incomeTaxDeclarCollection = iIncomeTaxDeclar.getIncomeTaxDeclarCollection("where batchNo = '" + taxDeclarBatchNo + "'");
  1073. SelectorItemCollection updateSic = new SelectorItemCollection();
  1074. updateSic.add("declareStatus");
  1075. if (incomeTaxDeclarCollection.size() > 0) {
  1076. IncomeTaxDeclarInfo incomeTaxDeclarInfo = incomeTaxDeclarCollection.get(0);
  1077. incomeTaxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_NO);
  1078. iIncomeTaxDeclar.updatePartial(incomeTaxDeclarInfo, updateSic);
  1079. }
  1080. }
  1081. }else if(catalog.equals(TaskCatalogEnum.CancelTaxUpdate )) {
  1082. System.out.print("撤销更正执行");
  1083. //撤销更正申报
  1084. Gson gson = new Gson();
  1085. Type personType = new TypeToken<DeclareCorrectRequest>(){}.getType();
  1086. DeclareCorrectRequest newObj = gson.fromJson(gson.toJson(paramMap), personType);
  1087. ApiResponse<AsyncResult> apiResponse = declarationRequest.cancelCorrect (newObj);
  1088. if (apiResponse.getHead().getCode().equals("00000000")) {
  1089. //同步接口;
  1090. //个税申报批次号
  1091. String taxDeclarBatchNo = taxDeclare.getBatchNo();
  1092. IIncomeTaxDeclar iIncomeTaxDeclar = IncomeTaxDeclarFactory.getLocalInstance(ctx);
  1093. IncomeTaxDeclarCollection incomeTaxDeclarCollection = iIncomeTaxDeclar.getIncomeTaxDeclarCollection("where batchNo = '" + taxDeclarBatchNo + "'");
  1094. SelectorItemCollection updateSic = new SelectorItemCollection();
  1095. updateSic.add("declareStatus");
  1096. if (incomeTaxDeclarCollection.size() > 0) {
  1097. IncomeTaxDeclarInfo incomeTaxDeclarInfo = incomeTaxDeclarCollection.get(0);
  1098. incomeTaxDeclarInfo.setDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS);
  1099. iIncomeTaxDeclar.updatePartial(incomeTaxDeclarInfo, updateSic);
  1100. }
  1101. }
  1102. }
  1103. } catch (IOException e) {
  1104. e.printStackTrace();
  1105. } catch (EASBizException e) {
  1106. e.printStackTrace();
  1107. }
  1108. return paramMap;
  1109. }
  1110. /**
  1111. * 撤销申请
  1112. * @param ctx
  1113. * @param taxDeclare
  1114. * @return
  1115. * @throws BOSException
  1116. */
  1117. protected Map cancelDeclare(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
  1118. System.out.print("申报作废进入自己的分支");
  1119. return this.updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.CancelTaxDeclare);
  1120. }
  1121. /**
  1122. * 更正
  1123. * @param ctx
  1124. * @param taxDeclare
  1125. * @return
  1126. * @throws BOSException
  1127. */
  1128. protected Map updateDeclare(Context ctx, IncomeTaxDeclarInfo taxDeclare) throws BOSException {
  1129. return updateOrCancel(ctx, taxDeclare, TaskCatalogEnum.TaxDeclareUpdate);
  1130. }
  1131. /**
  1132. * 撤销申报
  1133. *
  1134. */
  1135. public void cancelDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
  1136. throws SHRWebException {
  1137. System.out.print("申报作废开始1");
  1138. this.updateOrCancel(request, response, TaskCatalogEnum.CancelTaxDeclare);
  1139. request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "cancelDeclare");
  1140. System.out.print("申报作废开始over");
  1141. }
  1142. /**
  1143. * 更正申请
  1144. */
  1145. public void updateDeclareAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
  1146. throws SHRWebException {
  1147. this.updateOrCancel(request, response, TaskCatalogEnum.TaxDeclareUpdate);
  1148. request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "updateDeclare");
  1149. }
  1150. /**
  1151. * 撤销更正
  1152. *
  1153. */
  1154. public void cancelUpdateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
  1155. throws SHRWebException {
  1156. this.updateOrCancel(request, response, TaskCatalogEnum.CancelTaxUpdate);
  1157. request.setAttribute(CmpConstants.CMP_LOG_OPERATE, "cancelUpdate");
  1158. }
  1159. }