diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java index 612537aa..b148535f 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java @@ -67,6 +67,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; @@ -178,6 +179,8 @@ public class OrderInfoServiceImpl implements OrderInfoService { @Resource private CommodityMapper commodityMapper; + DecimalFormat format = new DecimalFormat("#.###"); + @Override public PageUtils selectOrderInfo(Map map, List shList, List entList) { return orderProcessService.selectOrderInfo(map, shList, entList); @@ -1930,9 +1933,11 @@ public class OrderInfoServiceImpl implements OrderInfoService { if(items.size() > 0){ orderItemInfoMapper.updateOrderItemId(items); } + if(sb.length() == 0){ + return R.ok(); + } String substring = sb.substring(0, sb.length() - 1) + "税编有误请检查"; - - return sb.length() == 0 ? R.ok() :R.error(substring); + return R.error(substring); } private CommodityCodeEntity buildCommodity(OrderItemInfo itemInfo,OrderInfoVo orderInfoVo,Map spbm ) throws Exception{ @@ -1950,7 +1955,8 @@ public class OrderInfoServiceImpl implements OrderInfoService { comm.setZxbm(StringUtils.isNotBlank(itemInfo.getZxbm())?itemInfo.getZxbm():comm.getId()); comm.setSpsm(taxClassCodeEntity.getSm()); comm.setSpjm(""); - comm.setSl(itemInfo.getSl());//不需要转换% + String sl = itemInfo.getSl().replace("%", ""); + comm.setSl(format.format(new BigDecimal("1.3").divide(new BigDecimal("100"), 3, RoundingMode.HALF_UP)));//不需要转换% comm.setGgxh(StringUtils.isNotBlank(itemInfo.getGgxh())?BaseServiceBeanTransitionUtils.ggxhTransition(itemInfo.getGgxh()):"");//切除40 comm.setXmdw(itemInfo.getXmdw()); comm.setXmdj(StringUtils.isNotBlank(itemInfo.getXmdj())?itemInfo.getXmdj():""); diff --git a/order-management-invoice/src/main/resources/mybatis/mapper/OrderItemInfoMapper.xml b/order-management-invoice/src/main/resources/mybatis/mapper/OrderItemInfoMapper.xml index 39907ad4..5b18ea24 100644 --- a/order-management-invoice/src/main/resources/mybatis/mapper/OrderItemInfoMapper.xml +++ b/order-management-invoice/src/main/resources/mybatis/mapper/OrderItemInfoMapper.xml @@ -320,9 +320,6 @@ tswl = #{item.tswl,jdbcType=VARCHAR}, - - znfm = #{item.znfm,jdbcType=VARCHAR}, - id = #{item.id,jdbcType=VARCHAR}