TaxUnitListHandlerEx.java 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. package com.kingdee.eas.custom.shuiyou;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.kingdee.bos.BOSException;
  5. import com.kingdee.bos.Context;
  6. import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
  7. import com.kingdee.bos.util.BOSUuid;
  8. import com.kingdee.eas.basedata.hraux.BirthplaceFactory;
  9. import com.kingdee.eas.basedata.hraux.NationalityFactory;
  10. import com.kingdee.eas.basedata.person.PersonFactory;
  11. import com.kingdee.eas.common.EASBizException;
  12. import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoCollection;
  13. import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoFactory;
  14. import com.kingdee.eas.custom.shuiyou.registration.RegistrationInfoInfo;
  15. import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
  16. import com.kingdee.eas.custom.shuiyou.uitls.ISYUtilsFacade;
  17. import com.kingdee.eas.custom.shuiyou.uitls.SYUtilsFacadeFactory;
  18. import com.kingdee.eas.fi.arap.util.DBUtil;
  19. import com.kingdee.shr.base.syssetting.context.SHRContext;
  20. import com.kingdee.shr.base.syssetting.exception.SHRWebException;
  21. import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
  22. import com.kingdee.shr.compensation.PersonStatusEnum;
  23. import com.kingdee.shr.compensation.app.incomeTax.*;
  24. import com.kingdee.shr.compensation.app.tax.TaxUnitCollection;
  25. import com.kingdee.shr.compensation.app.tax.TaxUnitFactory;
  26. import com.kingdee.shr.compensation.app.tax.TaxUnitInfo;
  27. import com.kingdee.shr.compensation.util.Base64Utils;
  28. import com.kingdee.shr.compensation.web.handler.tax.taxUnit.TaxUnitListHandler;
  29. import okhttp3.*;
  30. import org.apache.log4j.Logger;
  31. import org.springframework.ui.ModelMap;
  32. import javax.servlet.http.HttpServletRequest;
  33. import javax.servlet.http.HttpServletResponse;
  34. import java.io.FileInputStream;
  35. import java.io.FileNotFoundException;
  36. import java.io.IOException;
  37. import java.math.BigDecimal;
  38. import java.text.SimpleDateFormat;
  39. import java.util.*;
  40. public class TaxUnitListHandlerEx extends TaxUnitListHandler {
  41. private Properties propt = new Properties();
  42. private static Logger logger = Logger.getLogger("com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx");
  43. /**
  44. * 企业注册
  45. *
  46. * @param request
  47. * @param response
  48. * @param modelMap
  49. * @throws SHRWebException
  50. */
  51. public void businessAegistrationAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
  52. String entrance = "com.kingdee.eas.custom.jiuzhoutong.shuiyou.TaxUnitListHandlerEx.businessAegistrationAction";
  53. Map<String, Object> returnMap = new HashMap<String, Object>();
  54. logger.error("=========进入:" + entrance + "==========");
  55. String id = request.getParameter("id");
  56. Context context = SHRContext.getInstance().getContext();
  57. Map<String, String> commonParameter = null;
  58. String postBody = "";
  59. String post = "";
  60. try {
  61. logger.error("=====获取基本信息=====");
  62. this.propt.load(new FileInputStream(System.getProperty("EAS_HOME") + "/server/properties/sy/syConfig.properties"));
  63. logger.error("=======获取报税企业信息=====");
  64. TaxUnitInfo taxUnitInfo = TaxUnitFactory.getLocalInstance(context).getTaxUnitInfo(new ObjectUuidPK(id));
  65. String name = taxUnitInfo.getName();//企业名称
  66. String taxNumber = taxUnitInfo.getTaxNumber();//税号
  67. String areaCode = taxUnitInfo.getAreaCode();//行政区代码
  68. logger.error("企业名称:" + name);
  69. logger.error("税号:" + taxNumber);
  70. logger.error("行政区代码:" + areaCode);
  71. logger.error("==========================");
  72. logger.error("==========发送请求 post================");
  73. OkHttpClient client = new OkHttpClient();
  74. String ip = propt.getProperty("ip");
  75. String url = ip + "/gateway/iit/declare/getCompanyRegisterInfo";
  76. logger.error("地址:" + url);
  77. postBody = "{\"qymc\":\"" + name + "\",\"nsrsbh\":\"" + taxNumber + "\",\"areaid\":\"" + areaCode + "\"}";
  78. logger.error("参数:" + postBody);
  79. logger.error("公共参数:" + JSONObject.toJSONString(commonParameter));
  80. post = SYUtilsFacadeFactory.getLocalInstance(context).post(url, postBody);
  81. //gateway/iit/declare/getCompanyRegisterInfo
  82. // RequestBody body = RequestBody.create(MediaType.parse("application/json"), postBody);
  83. // Request sYRequest = new Request.Builder()
  84. // .url(url)
  85. // .post(body).headers(Headers.of(commonParameter))
  86. // .build();
  87. // sYResponse = client.newCall(sYRequest).execute();
  88. logger.error("返回参数:" + post);
  89. //返回值需要改 不是JSONArray 类型 需要更具 正常返回值来判断
  90. //JSONArray jsonArray = JSONArray.parseArray(post);
  91. JSONObject returnDate = JSONObject.parseObject(post);
  92. JSONObject head = returnDate.getJSONObject("head");
  93. String description = head.getString("description");
  94. RegistrationInfoInfo registrationInfo;
  95. if (!"成功".equals(description)) {
  96. returnMap.put("code", 500);
  97. returnMap.put("error", "接口调用失败,请看日志");
  98. JSONUtils.SUCCESS(returnMap);
  99. return;
  100. }
  101. JSONArray body = returnDate.getJSONArray("body");
  102. // if (body.size() > 0) {
  103. // logger.error("写入数据:"+body.toJSONString());
  104. // logger.error("删除原有的数据以便以写入行的数据");
  105. // String sql = "delete from CT_REG_RegistrationInfo";
  106. // DBUtil.execute(context, sql);
  107. // }
  108. logger.error("写入数据:");
  109. for (int i = 0; i < body.size(); i++) {
  110. JSONObject jsonObject = body.getJSONObject(i);
  111. String djxhid = jsonObject.getString("djxhid");// 登记序号
  112. RegistrationInfoCollection registrationInfoCollection = RegistrationInfoFactory.getLocalInstance(context).getRegistrationInfoCollection("where djxhid = '" + djxhid + "'");
  113. if (registrationInfoCollection.size() == 0) {
  114. registrationInfo = new RegistrationInfoInfo();
  115. } else {
  116. registrationInfo = registrationInfoCollection.get(0);
  117. }
  118. registrationInfo.setDjxhid(djxhid);
  119. String qymc = jsonObject.getString("qymc");// 企业名称
  120. registrationInfo.setQymc(qymc);
  121. String frxm = jsonObject.getString("frxm");// 法人姓名
  122. registrationInfo.setFrxm(frxm);
  123. String lxdh = jsonObject.getString("lxdh");// 联系电话
  124. registrationInfo.setLxdh(lxdh);
  125. String scjydz = jsonObject.getString("scjydz");// 生产经营地址
  126. registrationInfo.setScjydz(scjydz);
  127. String hymc = jsonObject.getString("hymc");// 行业名称
  128. registrationInfo.setHymc(hymc);
  129. String zgswjgmc = jsonObject.getString("zgswjgmc");// 主管税务机关名称
  130. registrationInfo.setZgswjgmc(zgswjgmc);
  131. String zgswjg = jsonObject.getString("zgswjg");// 主管税务机关代码
  132. registrationInfo.setZgswjg(zgswjg);
  133. String zgswjgskdm = jsonObject.getString("zgswjgskdm");// 主管税务分局所科代码
  134. registrationInfo.setZgswjgskdm(zgswjgskdm);
  135. String zgswjgskmc = jsonObject.getString("zgswjgskmc");// 主管税务分局所科名称
  136. registrationInfo.setZgswjgskmc(zgswjgskmc);
  137. String fbmba = jsonObject.getString("fbmba");// 是否分部门备案
  138. registrationInfo.setFbmba(fbmba);
  139. String smzh = jsonObject.getString("smzh");// 实名账号
  140. registrationInfo.setSmzh(smzh);
  141. String shxydm = jsonObject.getString("shxydm");// 社会信用代码
  142. registrationInfo.setShxydm(shxydm);
  143. String nsrsbm = jsonObject.getString("nsrsbm");// 纳税人识别码
  144. registrationInfo.setNsrsbm(nsrsbm);
  145. String yzbm = jsonObject.getString("yzbm");// 邮政编码
  146. registrationInfo.setYzbm(yzbm);
  147. String cwxm = jsonObject.getString("cwxm");// 财务负责人
  148. registrationInfo.setCwxm(cwxm);
  149. String hydm = jsonObject.getString("hydm");// 行业代码
  150. registrationInfo.setHydm(hydm);
  151. String jjlxdm = jsonObject.getString("jjlxdm");// 经济类型名称代码
  152. registrationInfo.setJjlxdm(jjlxdm);
  153. String jjlxmc = jsonObject.getString("jjlxmc");// 经济类型名称
  154. registrationInfo.setJjlxmc(jjlxmc);
  155. String ssglydm = jsonObject.getString("ssglydm");// 税收管理员代码
  156. registrationInfo.setSsglydm(ssglydm);
  157. String bsrxm = jsonObject.getString("bsrxm");// 报税人姓名
  158. registrationInfo.setBsrxm(bsrxm);
  159. String jdxzdm = jsonObject.getString("jdxzdm");// 街道乡镇代码
  160. registrationInfo.setJdxzdm(jdxzdm);
  161. String kjywrdm = jsonObject.getString("kjywrdm");// 扣缴义务人代码
  162. registrationInfo.setKjywrdm(kjywrdm);
  163. String djrq = jsonObject.getString("djrq");// 登记日期
  164. registrationInfo.setDjrq(djrq);
  165. String swjgdm = jsonObject.getString("swjgdm");// 税务机关代码
  166. registrationInfo.setSwjgdm(swjgdm);
  167. String swjgmc = jsonObject.getString("swjgmc");// 税务机关名称
  168. registrationInfo.setSwjgmc(swjgmc);
  169. String sfscjyqy = jsonObject.getString("sfscjyqy");// 是否是生产经营企业
  170. registrationInfo.setSfscjyqy(sfscjyqy);
  171. String nsrztdm = jsonObject.getString("nsrztdm");// 纳税人状态代码
  172. registrationInfo.setNsrztdm(nsrztdm);
  173. String nsrztmc = jsonObject.getString("nsrztmc");// 纳税人状态名称
  174. registrationInfo.setNsrztmc(nsrztmc);
  175. if (registrationInfoCollection.size() == 0) {
  176. RegistrationInfoFactory.getLocalInstance(context).save(registrationInfo);
  177. } else {
  178. RegistrationInfoFactory.getLocalInstance(context).update(new ObjectUuidPK(registrationInfo.getId()), registrationInfo);
  179. }
  180. }
  181. logger.error("记录成功接口日志");
  182. returnMap.put("code", 200);
  183. returnMap.put("error", "");
  184. returnMap.put("info", "注册成功");
  185. } catch (BOSException e) {
  186. logger.error("记录BOSException报错接口日志");
  187. returnMap.put("code", 500);
  188. returnMap.put("error", e);
  189. } catch (EASBizException e) {
  190. logger.error("记录 EASBizException 报错接口日志");
  191. returnMap.put("code", 500);
  192. returnMap.put("error", e);
  193. } catch (FileNotFoundException e) {
  194. logger.error("记录 FileNotFoundException 报错接口日志");
  195. returnMap.put("code", 500);
  196. returnMap.put("error", e);
  197. } catch (IOException e) {
  198. logger.error("记录 IOException 报错接口日志");
  199. returnMap.put("code", 500);
  200. returnMap.put("error", e);
  201. }
  202. JSONUtils.SUCCESS(returnMap);
  203. logger.error("======================退出==================================");
  204. }
  205. /**
  206. * @param request
  207. * @param response
  208. * @param modelMap
  209. * @throws SHRWebException
  210. */
  211. public void personnelReportAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
  212. logger.error("==进入到==com.kingdee.eas.custom.shuiyou.TaxUnitListHandlerEx.personnelReportAction=====================");
  213. Context context = SHRContext.getInstance().getContext();
  214. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
  215. try {
  216. this.propt.load(new FileInputStream(System.getProperty("EAS_HOME") + "/server/properties/sy/syConfig.properties"));
  217. TaxUnitCollection taxUnitCollection = TaxUnitFactory.getLocalInstance(context).getTaxUnitCollection();
  218. for (int i = 0; i < taxUnitCollection.size(); i++) {
  219. TaxUnitInfo taxUnitInfo = taxUnitCollection.get(i);
  220. String bizNo = UUID.randomUUID().toString().replace("-", "");
  221. String qymc = taxUnitInfo.getName();//企业名称
  222. String mmlx = "0";//密码类型 0表示申报密码;2表示实名账号实名密码
  223. String smzh = "";//实名账号
  224. String smmm = "";//实名密码
  225. String jmsmmm = "";//加密实名密码
  226. byte[] decode = Base64.getDecoder().decode(taxUnitInfo.getDeclPassword());
  227. String sbmm = new String(decode);//;//申报密码
  228. String jmsbmm = "";//申报密码加密
  229. String djxhid = taxUnitInfo.getRegNumber();//登记序号
  230. String nsrsbh = taxUnitInfo.getTaxNumber();//税号
  231. String areaid = taxUnitInfo.getAreaCode();//地区编码
  232. String bmbh = "";//部门编号
  233. String bmmc = "";//部门编码
  234. String skssq = "";//所属期 ----还不知道怎么定这个东西
  235. String lzrqcl = "";
  236. JSONObject postBody = new JSONObject();
  237. postBody.put("bizNo",bizNo);
  238. postBody.put("qymc", qymc);
  239. postBody.put("mmlx", mmlx);
  240. postBody.put("smzh", smzh);
  241. postBody.put("smmm", smmm);
  242. postBody.put("jmsmmm", jmsmmm);
  243. postBody.put("sbmm", sbmm);
  244. postBody.put("jmsbmm", jmsbmm);
  245. postBody.put("djxhid", djxhid);
  246. postBody.put("nsrsbh", nsrsbh);
  247. postBody.put("areaid", areaid);
  248. postBody.put("bmbh", bmbh);
  249. postBody.put("bmmc", bmmc);
  250. postBody.put("skssq", skssq);
  251. postBody.put("lzrqcl", lzrqcl);
  252. BOSUuid id = taxUnitInfo.getId();
  253. //STaxPersonRecordEntry
  254. TaxPersonRecordEntryCollection taxPersonRecordEntrys =
  255. TaxPersonRecordEntryFactory.getLocalInstance(context).
  256. getTaxPersonRecordEntryCollection("select * , bill.* where taxUnit = '" + id.toString() + "'");
  257. JSONArray rylb = new JSONArray();
  258. JSONObject personInfo = null;
  259. int size = taxPersonRecordEntrys.size();
  260. if (size==0){
  261. break;
  262. }
  263. for (int j = 0; j < size; j++) {
  264. personInfo = new JSONObject();
  265. TaxPersonRecordEntryInfo taxPersonRecordEntryInfo = taxPersonRecordEntrys.get(j);
  266. TaxPersonRecordInfo bill = taxPersonRecordEntryInfo.getBill();
  267. String xm = PersonFactory.getLocalInstance(context).getPersonInfo(new ObjectUuidPK(bill.getPerson().getId())).getName();//姓名
  268. String zzlx = bill.getCardType().getAlias();//证件类型
  269. String zzhm = bill.getCardNumber();//证件号码
  270. String s = cardTypeReflection(zzlx);//证件类型
  271. Boolean cardType = isCardType(s);
  272. String qtzzlx = "";//其他证件类型
  273. String qtzzhm = "";//其他证件号码
  274. if (cardType) {
  275. qtzzlx = cardTypeReflection(bill.getOtherCardType().getAlias());//其他证件类型
  276. qtzzhm = bill.getOtherCardNumber();//其他证件号码
  277. }
  278. String bmbh1 = "";//部门编码
  279. String rybscl = "";//人员报送策略
  280. String gh = "";//工号
  281. String skssq1 = "";//所属期
  282. String lxdh = bill.getPhoneNumber(); //电话
  283. String nsrzt = taxPersonRecordEntryInfo.getPersonStatus().getValue();//人员状态
  284. String sfgy = taxPersonRecordEntryInfo.getEmployedType().getAlias();//任职受雇类型
  285. String rzndjyqk = "";//入职年度就业情形
  286. String rzsgrq = "";//受雇日期
  287. if ("雇员、保险营销员、证券经纪人".indexOf(sfgy) >= 0) {
  288. Date employedDate = taxPersonRecordEntryInfo.getEmployedDate();
  289. rzsgrq = simpleDateFormat.format(employedDate);
  290. }
  291. String xb = bill.getGender().getAlias();//性别
  292. String csny = simpleDateFormat.format(bill.getBirthday());//出生日期
  293. String gj = NationalityFactory.getLocalInstance(context).getNationalityInfo(new ObjectUuidPK(bill.getNationality().getId())).getName();//国际
  294. String rydq = bill.getIsOversea().getAlias();//是否境内
  295. if (rydq.equals("否")) {
  296. rydq = "境内";
  297. } else {
  298. rydq = "境外";
  299. }
  300. String lzrq = "";//离职日期
  301. if (nsrzt.equals("0")) {
  302. lzrq = simpleDateFormat.format(taxPersonRecordEntryInfo.getDepartureDate());
  303. }
  304. BigDecimal grgbbl = bill.getInvestmentRate();//个人投资总额
  305. BigDecimal grgbze = bill.getInvestmentTotal();//个人投资比例
  306. String sfcj = bill.isIsDisability() ? "是" : "否";
  307. String cjzjlx = "";//残疾证件类型
  308. String cjzh = "";//残疾证号
  309. if ("是".equals(sfcj)) {
  310. cjzjlx = "";// 系统没有需要加
  311. cjzh = bill.getDisCardNumber();
  312. }
  313. String sfls = bill.isIsHero() ? "是" : "否";
  314. String lszh = "";
  315. if ("是".equals(sfls)) {
  316. lszh = bill.getHeroCardNumber();
  317. }
  318. String sfgl = ""; //是否孤老
  319. String sfzdw = "";//是否扣除减除费用
  320. String dzyx = "";//邮箱
  321. String xl = "";
  322. String zw = "";// 职务
  323. String khyh = "";// 开户银行
  324. String khyhsfmz = "";// 开户银行省份
  325. String yhzh = "";// 银行账号
  326. String lxdz_sheng = "";// 居住省份
  327. String lxdz_shi = "";// 居住城市
  328. String lxdz_qx = "";// 居住区县
  329. String lxdz_jd = "";// 居住街道
  330. String lxdz = "";// 居住详细地址
  331. String hjszd_sheng = "";// 户籍省份
  332. String hjszd_shi = "";// 户籍城市
  333. String hjszd_qx = "";// 户籍区县
  334. String hjszd_jd = "";// 户籍街道
  335. String hjszd_xxdz = "";// 户籍详细地址
  336. String bz = "";// 备注
  337. String csd = "";
  338. String sssx = "";
  339. if (gj.indexOf("中国") < 0) {
  340. logger.error(JSONObject.toJSONString(bill.getBirthPlace()));
  341. logger.error(bill.getBirthPlace().getId());
  342. csd = BirthplaceFactory.getLocalInstance(context).
  343. getBirthplaceInfo(new ObjectUuidPK(bill.getBirthPlace().getId())).getName();
  344. sssx = bill.getTaxReason().getAlias();
  345. }
  346. String ss = "港澳居民来往内地通行证、港澳居民居住证、台湾居民来往大陆通行证、台湾居民居住证、外国护照、外国人永久居留身份证、外国人来华工作许可证A、外国人来华工作许可证B、外国人来华工作许可证C时";
  347. String scrjsj = "";
  348. String yjljsj = "";
  349. if (ss.indexOf(s) >= 0) {
  350. scrjsj = simpleDateFormat.format(bill.getEntryDate());
  351. yjljsj = simpleDateFormat.format(bill.getLeaveDate());
  352. }
  353. String wjrlxdz_sheng = "";// 联系地省份
  354. String wjrlxdz_shi = "";// 联系地城市
  355. String wjrlxdz_qx = "";// 联系地区县
  356. String wjrlxdz_jd = "";// 联系地街道
  357. String wjrlxdz_xxdz = "";// 联系地详细地址
  358. String xmzw = "";// 中文名
  359. ss = "外国护照、外国人永久居留身份证、外国人工作许可证(A类)、外国人工作许可证(B类)、外国人工作许可证(C类)";
  360. if (ss.indexOf(s) < 0) {
  361. xmzw = bill.getChineseName();
  362. }
  363. personInfo.put("xm", xm);
  364. personInfo.put("zzlx", s);
  365. personInfo.put("zzhm", zzhm);
  366. personInfo.put("qtzzlx", qtzzlx);
  367. personInfo.put("qtzzhm", qtzzhm);
  368. personInfo.put("bmbh", bmbh1);
  369. personInfo.put("rybscl", rybscl);
  370. personInfo.put("gh", gh);
  371. personInfo.put("skssq", skssq1);
  372. personInfo.put("lxdh", lxdh);
  373. if (nsrzt.equals("1")){
  374. nsrzt="正常";
  375. }else{
  376. nsrzt = "非正常";
  377. }
  378. personInfo.put("nsrzt", nsrzt);
  379. personInfo.put("sfgy", sfgy);
  380. personInfo.put("rzndjyqk", rzndjyqk);
  381. personInfo.put("rzsgrq", rzsgrq);
  382. personInfo.put("xb", xb);
  383. personInfo.put("csny", csny);
  384. personInfo.put("gj", gj);
  385. personInfo.put("rydq", rydq);
  386. personInfo.put("lzrq", lzrq);
  387. personInfo.put("grgbbl", grgbbl);
  388. personInfo.put("grgbze", grgbze);
  389. personInfo.put("sfcj", sfcj);
  390. personInfo.put("cjzjlx", cjzjlx);
  391. personInfo.put("cjzh", cjzh);
  392. personInfo.put("sfls", sfls);
  393. personInfo.put("lszh", lszh);
  394. personInfo.put("sfgl", sfgl);
  395. personInfo.put("sfzdw", sfzdw);
  396. personInfo.put("dzyx", dzyx);
  397. personInfo.put("xl", xl);
  398. personInfo.put("zw", zw);
  399. personInfo.put("khyh", khyh);
  400. personInfo.put("khyhsfmz", khyhsfmz);
  401. personInfo.put("yhzh", yhzh);
  402. personInfo.put("lxdz_sheng", lxdz_sheng);
  403. personInfo.put("lxdz_shi", lxdz_shi);
  404. personInfo.put("lxdz_qx", lxdz_qx);
  405. personInfo.put("lxdz_jd", lxdz_jd);
  406. personInfo.put("lxdz", lxdz);
  407. personInfo.put("hjszd_sheng", hjszd_sheng);
  408. personInfo.put("hjszd_shi", hjszd_shi);
  409. personInfo.put("hjszd_qx", hjszd_qx);
  410. personInfo.put("hjszd_jd", hjszd_jd);
  411. personInfo.put("hjszd_xxdz", hjszd_xxdz);
  412. personInfo.put("bz", bz);
  413. personInfo.put("csd", csd);
  414. personInfo.put("sssx", sssx);
  415. personInfo.put("scrjsj", scrjsj);
  416. personInfo.put("yjljsj", yjljsj);
  417. personInfo.put("wjrlxdz_sheng", wjrlxdz_sheng);
  418. personInfo.put("wjrlxdz_shi", wjrlxdz_shi);
  419. personInfo.put("wjrlxdz_qx", wjrlxdz_qx);
  420. personInfo.put("wjrlxdz_jd", wjrlxdz_jd);
  421. personInfo.put("wjrlxdz_xxdz", wjrlxdz_xxdz);
  422. personInfo.put("xmzw", xmzw);
  423. rylb.add(personInfo);
  424. }
  425. postBody.put("rylb", rylb);
  426. String ip = propt.getProperty("ip");
  427. String url = ip + "/gateway/iit/declare/declareEmployeeInfo";
  428. logger.error("===请求参数=="+postBody+"========");
  429. ISYUtilsFacade localInstance = SYUtilsFacadeFactory.getLocalInstance(context);
  430. String post = localInstance.post(url, postBody.toJSONString());
  431. //校验 请求是否成功
  432. JSONObject jsonObject = JSONObject.parseObject(post);
  433. JSONObject jsonObject1 = jsonObject.getJSONObject("body");
  434. String string = jsonObject1.getString("requestId");
  435. localInstance.backTask(url,string,"service",null, TaskCatalogEnum.PERSON);
  436. logger.error("返回参数:"+post);
  437. }
  438. } catch (BOSException e) {
  439. throw new RuntimeException(e);
  440. } catch (FileNotFoundException e) {
  441. throw new RuntimeException(e);
  442. } catch (IOException e) {
  443. throw new RuntimeException(e);
  444. } catch (EASBizException e) {
  445. throw new RuntimeException(e);
  446. }
  447. }
  448. public static void main(String[] args) {
  449. String encode = Base64Utils.encode("asdasd");
  450. System.out.println(encode);
  451. }
  452. public String cardTypeReflection(String cardTypeName) {
  453. switch (cardTypeName) {
  454. case "居民身份证":
  455. return "居民身份证";
  456. case "中国护照":
  457. return "中国护照";
  458. case "港澳居民来往内地通行证":
  459. return "港澳居民来往内地通行证";
  460. case "中华人民共和国港澳居民居住证":
  461. return "港澳居民来往内地通行证";
  462. case "台湾居民来往大陆通行证":
  463. return "台湾居民来往大陆通行证";
  464. case "中华人民共和国台湾居民居住证":
  465. return "台湾居民居住证";
  466. case "外国护照":
  467. return "外国护照";
  468. case "外国人永久居留身份证":
  469. return "外国人永久居留身份证";
  470. case "中华人民共和国外国人工作许可证(A类)":
  471. return "外国人工作许可证(A类)";
  472. case "中华人民共和国外国人工作许可证(B类)":
  473. return "外国人工作许可证(B类)";
  474. case "中华人民共和国外国人工作许可证(C类)":
  475. return "外国人工作许可证(C类)";
  476. }
  477. return "";
  478. }
  479. public Boolean isCardType(String cardType) {
  480. String cardTypes = "港澳居民居住证,台湾居民居住证,外国人永久居留身份证,外国人工作许可证(A类),外国人工作许可证(B类),外国人工作许可证(C类)";
  481. if (cardTypes.indexOf(cardType) >= 0) {
  482. return true;
  483. } else {
  484. return false;
  485. }
  486. }
  487. }