| | |
| | | @Value("${dept.smjsc}") |
| | | private String smjsc; |
| | | |
| | | @Value("${dept.smjhw}") |
| | | private String smjhw; |
| | | |
| | | @Value("${dept.tfgs}") |
| | | private String tfgs; |
| | | |
| | |
| | | } |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj)||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | |
| | | ContractOutBound contractOutBound = contractOutBoundMapper.selectById(contractOutBoundInvoiceVo.getContractOutBoundId()); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | |
| | | ContractOutBound contractOutBound = contractOutBoundMapper.selectById(contractOutBoundInvoiceVo.getContractOutBoundId()); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) ||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | |
| | | Product product = new Product(); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | } else { |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | GenInvoiceInfoVo vo = new GenInvoiceInfoVo(); |
| | | BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId()); |
| | | vo.setContractId(contract.getId()); |
| | | vo.setPartyA(a.getCompanyName()); |
| | | vo.setPartyAOrgCode(a.getCreditCode()); |
| | | vo.setPartyA(genInvoiceInfoDTO.getPartyA()); |
| | | vo.setPartyAOrgCode(genInvoiceInfoDTO.getPartyAOrgCode()); |
| | | vo.setPartyAOpenBank(a.getBankName()); |
| | | vo.setPartyABankAccount(a.getBankAccount()); |
| | | vo.setPartyB(b.getOrgName()); |
| | |
| | | Product product = new Product(); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | } else { |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | Product product = new Product(); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | smjList.add(smjhw); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) ||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | } else { |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | mergeVo.setMaterialInternalName(schedule.getSubjectMatterName()); |
| | | mergeVo.setPriceAndTax(schedule.getPlannedAmount()); |
| | | mergeVo.setQuantity(schedule.getInvoiceNum()); |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, schedule.getSubjectMatterCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjhw); |
| | | Product product = null; |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) ||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, schedule.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | } else { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, schedule.getSubjectMatterCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | } |
| | | if (ObjUtil.isNotNull(product)) { |
| | | mergeVo.setTaxClass(product.getTaxClass()); |
| | | mergeVo.setSpecification(product.getProductType()); |
| | | mergeVo.setTaxRate(new BigDecimal(product.getTaxRate())); |
| | | mergeVo.setTaxCode(product.getTaxCode()); |
| | | } |
| | | |
| | | ContractSubjectMatter subjectMatter = subjectMatterMapper.selectOne(Wrappers.<ContractSubjectMatter>lambdaQuery() |
| | | .eq(ContractSubjectMatter::getMaterialCode, schedule.getSubjectMatterCode()) |
| | | .eq(ContractSubjectMatter::getContractId, contract.getId()).last("limit 1")); |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getPriceAndTax(); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | |
| | |
| | | BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId()); |
| | | vo.setContractId(contract.getId()); |
| | | vo.setAdvanceInvoice("111"); |
| | | vo.setPartyA(a.getCompanyName()); |
| | | vo.setPartyAOrgCode(a.getCreditCode()); |
| | | vo.setPartyA(genInvoiceInfoDTO.getPartyA()); |
| | | vo.setPartyAOrgCode(genInvoiceInfoDTO.getPartyAOrgCode()); |
| | | vo.setPartyAOpenBank(a.getBankName()); |
| | | vo.setPartyABankAccount(a.getBankAccount()); |
| | | vo.setPartyB(b.getOrgName()); |
| | |
| | | mergeVo.setMaterialCode(subjectMatter.getMaterialCode()); |
| | | mergeVo.setMaterialInternalName(subjectMatter.getMaterialName()); |
| | | mergeVo.setQuantity(contractOutBoundInvoiceVo.getInvoiceNum()); |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjhw); |
| | | Product product = null; |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) ||("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | } else { |
| | | product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | } |
| | | if (ObjUtil.isNotNull(product)) { |
| | | mergeVo.setTaxClass(product.getTaxClass()); |
| | | mergeVo.setSpecification(product.getProductType()); |
| | |
| | | invoiceItemVoList.stream().filter(invoiceItem -> invoiceItem.getUnitPrice().compareTo(new BigDecimal("0")) > 0).forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | jsonObject.put("redInvoiceLabel", "01"); |
| | | jsonObject.put("invoiceSource", "2"); |
| | | jsonObject.put("originalInvoiceNo", blueInvoice.getInvoiceNo()); |
| | | jsonObject.put("autoIssueSwitch", "Y"); |
| | | GenInvoiceInfoVo vo = BeanUtil.copyProperties(JSONObject.parseObject(redInvoice.getInvoicePreview()), GenInvoiceInfoVo.class); |
| | | JSONArray invoiceDetailsList = new JSONArray(); |
| | | Integer lineNo = 1; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R selectZbByKey(String dictKey) { |
| | | List<BipDict> bipDictList = bipDictMapper.selectList(Wrappers.<BipDict>lambdaQuery().eq(BipDict::getDictKey, dictKey) |
| | | .eq(BipDict::getCompId,SecurityUtils.getUser().getCompId())); |
| | | if (CollUtil.isNotEmpty(bipDictList)) { |
| | | // 权限内部门 |
| | | List<TreeNode<Long>> collect = bipDictList.stream() |
| | | .map(dict -> { |
| | | TreeNode<Long> treeNode = new TreeNode<>(); |
| | | treeNode.setId(dict.getId()); |
| | | treeNode.setParentId(dict.getParentId()); |
| | | treeNode.setName(dict.getDictName()); |
| | | treeNode.setWeight(dict.getDictCode()); |
| | | return treeNode; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return R.ok(TreeUtil.build(collect, 0L)); |
| | | } |
| | | return R.failed("字典获取失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R saveAndPush(ContractInvoiceUpateDTO upateDTO) { |
| | | ContractInvoice invoice = baseMapper.selectById(upateDTO.getId()); |
| | | invoice.setInvoicePreview(upateDTO.getInvoicePreview()); |