| | |
| | | if (NX2023Constant.NX_2023_API_CODE_1114_1501.equals(inteId) |
| | | || NX2023Constant.NX_2023_API_CODE_1114_1502.equals(inteId) |
| | | || NX2023Constant.NX_2023_API_CODE_1114_1503.equals(inteId)) { |
| | | Object object = getJsonFinanceData(inteId, data); |
| | | Object object = getJsonFinanceData(inteId, data, conf); |
| | | return JSON.toJSONString(object); |
| | | } else { |
| | | List<Object> list = new ArrayList<>(); |
| | |
| | | if (NX2023Constant.NX_2023_API_CODE_1102.equals(inteId)) { |
| | | Nx2023Api1102 api1102 = new Nx2023Api1102(); |
| | | BeanUtils.copyProperties(data, api1102); |
| | | api1102.setLkxz("1"); |
| | | api1102.setLkxz(null); |
| | | //若统一编码不上传,则统一编码设为空值; |
| | | if(StringUtils.isEmpty(conf.getGbCodingTag()) || "N".equals(conf.getGbCodingTag())){ |
| | | api1102.setTykqbm(null); |
| | | api1102.setLkxz("1"); |
| | | } |
| | | return api1102; |
| | | } |
| | |
| | | if(StringUtils.isNotEmpty(conf.getGbCodingTag()) && "Y".equals(conf.getGbCodingTag())){ |
| | | String tyhwbm = apiCommonService.getTyhwbm(api1205.getHwdm()); |
| | | api1205.setTyhwbm(tyhwbm); |
| | | api1205.setSzlx(null); |
| | | } |
| | | return api1205; |
| | | } |
| | |
| | | api1307.setCntxwjl(JSON.toJSONString(map)); |
| | | //校验统一编码是否为空,为空则查询库区信息进行赋值 |
| | | if(StringUtils.isNotEmpty(conf.getGbCodingTag()) && "Y".equals(conf.getGbCodingTag())){ |
| | | api1307.setTxwjhzm(null); |
| | | String tykqbm = apiCommonService.getTykqbm(api1307.getKqdm()); |
| | | api1307.setTykqbm(tykqbm); |
| | | String tycfbm = apiCommonService.getTycfbm(api1307.getCfdm()); |
| | |
| | | * @param data |
| | | * @return |
| | | */ |
| | | private Object getJsonFinanceData(String inteId, Object data) { |
| | | private Object getJsonFinanceData(String inteId, Object data, ApiConfs conf) { |
| | | //财务报表数据封装 |
| | | if (NX2023Constant.NX_2023_API_CODE_1114_1501.equals(inteId)) { |
| | | return copyApi1501((Api1501) data); |
| | | return copyApi1501((Api1501) data, conf); |
| | | } else if (NX2023Constant.NX_2023_API_CODE_1114_1502.equals(inteId)) { |
| | | return copyApi1502((Api1502) data); |
| | | return copyApi1502((Api1502) data, conf); |
| | | } else { |
| | | return copyApi1503((Api1503) data); |
| | | return copyApi1503((Api1503) data, conf); |
| | | } |
| | | } |
| | | |
| | | private List<NxFinanceDto> copyApi1503(Api1503 api1503) { |
| | | private List<NxFinanceDto> copyApi1503(Api1503 api1503, ApiConfs conf) { |
| | | List<NxFinanceDto> list = new ArrayList<>(); |
| | | NxFinanceDto nxFinanceDto = new NxFinanceDto(); |
| | | nxFinanceDto.setDwdm(api1503.getDwdm()); |
| | | nxFinanceDto.setKqdm(api1503.getKqdm()); |
| | | //校验统一编码是否为空,为空则查询库区信息进行赋值 |
| | | if(StringUtils.isNotEmpty(conf.getGbCodingTag()) && "Y".equals(conf.getGbCodingTag())){ |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTydwbm())){ |
| | | String tydwbm = apiCommonService.getTydwbm(nxFinanceDto.getDwdm()); |
| | | nxFinanceDto.setTydwbm(tydwbm); |
| | | } |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTykqbm())){ |
| | | String tykqbm = apiCommonService.getTykqbm(nxFinanceDto.getKqdm()); |
| | | nxFinanceDto.setTykqbm(tykqbm); |
| | | } |
| | | } |
| | | |
| | | nxFinanceDto.setBbsj(DateFormatUtils.format(api1503.getBbsj(), "yyyyMMdd")); |
| | | nxFinanceDto.setBbm("03"); |
| | | nxFinanceDto.setCzbz(api1503.getCzbz()); |
| | |
| | | return list; |
| | | } |
| | | |
| | | private List<NxFinanceDto> copyApi1502(Api1502 api1502) { |
| | | private List<NxFinanceDto> copyApi1502(Api1502 api1502, ApiConfs conf) { |
| | | List<NxFinanceDto> list = new ArrayList<>(); |
| | | NxFinanceDto nxFinanceDto = new NxFinanceDto(); |
| | | nxFinanceDto.setDwdm(api1502.getDwdm()); |
| | | nxFinanceDto.setKqdm(api1502.getKqdm()); |
| | | //校验统一编码是否为空,为空则查询库区信息进行赋值 |
| | | if(StringUtils.isNotEmpty(conf.getGbCodingTag()) && "Y".equals(conf.getGbCodingTag())){ |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTydwbm())){ |
| | | String tydwbm = apiCommonService.getTydwbm(nxFinanceDto.getDwdm()); |
| | | nxFinanceDto.setTydwbm(tydwbm); |
| | | } |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTykqbm())){ |
| | | String tykqbm = apiCommonService.getTykqbm(nxFinanceDto.getKqdm()); |
| | | nxFinanceDto.setTykqbm(tykqbm); |
| | | } |
| | | } |
| | | nxFinanceDto.setBbsj(DateFormatUtils.format(api1502.getBbsj(), "yyyyMMdd")); |
| | | nxFinanceDto.setBbm("02"); |
| | | nxFinanceDto.setCzbz(api1502.getCzbz()); |
| | |
| | | return list; |
| | | } |
| | | |
| | | private List<NxFinanceDto> copyApi1501(Api1501 api1501) { |
| | | private List<NxFinanceDto> copyApi1501(Api1501 api1501, ApiConfs conf) { |
| | | List<NxFinanceDto> list = new ArrayList<>(); |
| | | NxFinanceDto nxFinanceDto = new NxFinanceDto(); |
| | | nxFinanceDto.setDwdm(api1501.getDwdm()); |
| | | nxFinanceDto.setKqdm(api1501.getKqdm()); |
| | | //校验统一编码是否为空,为空则查询库区信息进行赋值 |
| | | if(StringUtils.isNotEmpty(conf.getGbCodingTag()) && "Y".equals(conf.getGbCodingTag())){ |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTydwbm())){ |
| | | String tydwbm = apiCommonService.getTydwbm(nxFinanceDto.getDwdm()); |
| | | nxFinanceDto.setTydwbm(tydwbm); |
| | | } |
| | | if(StringUtils.isEmpty(nxFinanceDto.getTykqbm())){ |
| | | String tykqbm = apiCommonService.getTykqbm(nxFinanceDto.getKqdm()); |
| | | nxFinanceDto.setTykqbm(tykqbm); |
| | | } |
| | | } |
| | | nxFinanceDto.setBbsj(DateFormatUtils.format(api1501.getBbsj(), "yyyyMMdd")); |
| | | nxFinanceDto.setBbm("01"); |
| | | nxFinanceDto.setCzbz(api1501.getCzbz()); |