| | |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | | }else { |
| | | Product product = productList.get(0); |
| | | product.setProductType(addDTO.getErpName()); |
| | | baseMapper.updateById(product); |
| | | } |
| | | } |
| | | return R.ok(); |
| | |
| | | } |
| | | baseMapper.insert(productNew); |
| | | log.info("产品:{}新增成功",product.getString("itemNo")); |
| | | return; |
| | | }else { |
| | | productNew.setProductType(product.getString("grade")); |
| | | productNew.setUnitName(product.getString("unitName")); |
| | | if(StrUtil.equals(finalTan,"tenant1")){ |
| | | productNew.setCompId(2089995177814495234L); |
| | | } |
| | | if(StrUtil.equals(finalTan,"tenant2")){ |
| | | productNew.setCompId(2089996921978040321L); |
| | | } |
| | | if(StrUtil.equals(finalTan,"tenant3")){ |
| | | productNew.setCompId(2089997578009128962L); |
| | | } |
| | | productNew.setParentId(productClass.getId()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,product.getString("tfTaxClass")).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | productNew.setTaxClass(taxCode.getSphwjc()); |
| | | productNew.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.updateById(productNew); |
| | | log.info("产品:{}更新成功",productNew.getErpCode()); |
| | | } |
| | | log.info("产品:{}存在",product.getString("itemNo")); |
| | | }); |
| | | } |
| | | |