feature:导入物料规格型号40个字符长度处理

release
gaorl 2 years ago
parent baf36758bb
commit 48880dc213
  1. 13
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/utils/BaseServiceBeanTransitionUtils.java
  2. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java
  3. 26
      order-management-consumer/src/main/java/com/dxhy/order/consumer/utils/BeanTransitionUtils.java

@ -12,8 +12,11 @@ import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.baseservice.openapi.model.SksbxxtbReqBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbReqBO;
import com.dxhy.order.utils.GbkUtil;
import com.dxhy.order.utils.StringUtil;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.Date;
/**
@ -230,4 +233,14 @@ public class BaseServiceBeanTransitionUtils {
return taxEquipmentInfo;
}
public static String ggxhTransition(String ggxh){
if(GbkUtil.getGbkLength(ggxh) > ConfigureConstant.INT_40){
try {
ggxh = StringUtil.subStringByByte(ggxh, ConfigureConstant.INT_40);
} catch (IOException e) {
}
}
return ggxh;
}
}

@ -114,9 +114,6 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
@Resource
private OrderInfoQdMapper orderInfoQdMapper;
@Resource
private OrderInfoQdFjysMapper orderInfoQdFjysMapper;
@Resource
private OrderProcessService orderProcessService;

@ -14,6 +14,7 @@ import com.dxhy.order.baseservice.openapi.model.SksbxxtbReqBO;
import com.dxhy.order.baseservice.openapi.protocol.qd.PageXfxx;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxBO;
import com.dxhy.order.baseservice.openapi.protocol.spxx.SpxxtbReqBO;
import com.dxhy.order.baseservice.utils.BaseServiceBeanTransitionUtils;
import com.dxhy.order.constant.*;
import com.dxhy.order.consumer.openapi.protocol.Response;
import com.dxhy.order.consumer.openapi.protocol.cpy.*;
@ -50,10 +51,7 @@ import com.dxhy.order.model.sk.hp.*;
import com.dxhy.order.model.sk.kp.*;
import com.dxhy.order.model.sk.query.ResponseCommonInvoice;
import com.dxhy.order.model.sk.sld.SearchSld;
import com.dxhy.order.utils.CommonUtils;
import com.dxhy.order.utils.DecimalCalculateUtil;
import com.dxhy.order.utils.JsonUtils;
import com.dxhy.order.utils.StringUtil;
import com.dxhy.order.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -2154,6 +2152,9 @@ public class BeanTransitionUtils {
commonOrderInfo.getOrderInfo().setGhfZh(buyerEntity.getBankNumber());
}
if (StringUtils.isBlank(commonOrderInfo.getOrderInfo().getGhfEmail())) {
commonOrderInfo.getOrderInfo().setGhfEmail(buyerEntity.getEmail());
}
}
@ -3549,19 +3550,8 @@ public class BeanTransitionUtils {
ddmxxxBO.setDJ(detail.getZZDJ());
}
if(StringUtils.isNotBlank(ddmxxxBO.getGGXH())){
String ggxh = ddmxxxBO.getGGXH();
try {
if (ggxh.getBytes(ConfigureConstant.STRING_CHARSET_GBK).length > ConfigureConstant.INT_40) {
log.debug("对明细行规格型号进行截取,截取前数据为:{}", ggxh);
ggxh = StringUtil.subStringByByte(ggxh, ConfigureConstant.INT_40);
log.debug("对明细行规格型号进行截取,截取后数据为:{}", ggxh);
ddmxxxBO.setGGXH(ggxh);
}
} catch (IOException e) {
//编码格式错误
log.error("处理商品名称异常:{}", e);
throw new RuntimeException(e);
}
String ggxh = BaseServiceBeanTransitionUtils.ggxhTransition(ddmxxxBO.getGGXH());
ddmxxxBO.setGGXH(ggxh);
}
ddmxxxBO.setSL(new BigDecimal(detail.getZTAX()).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP).toString());
@ -3825,6 +3815,4 @@ public class BeanTransitionUtils {
return orderItemInfos;
}
}

Loading…
Cancel
Save