diff --git a/order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml b/order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml index bb9b19cb..231ea25b 100644 --- a/order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml +++ b/order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml @@ -406,8 +406,9 @@ wlflmc = #{commodityCode.wlflmc,jdbcType=VARCHAR}, - - + + specification_model = #{commodityCode.ggxh,jdbcType=VARCHAR}, + commodity_id = #{commodityCode.commodityId,jdbcType=VARCHAR}, diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java index a2973f0c..c6d7f70e 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/SDEnregyServiceImpl.java @@ -15,6 +15,7 @@ import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper; import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity; import com.dxhy.order.baseservice.module.thirdservice.user.dto.AddUserRequestDto; import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; +import com.dxhy.order.constant.ConfigureConstant; import com.dxhy.order.consumer.dao.GroupCommodityCodeMapper; import com.dxhy.order.consumer.modules.taxcodematch.dao.SdenergyTaxCodeMatchDao; import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch; @@ -22,7 +23,9 @@ import com.dxhy.order.consumer.openapi.protocol.AjaxResult; import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.*; import com.dxhy.order.model.R; import com.dxhy.order.utils.DistributedKeyMaker; +import com.dxhy.order.utils.GbkUtil; import com.dxhy.order.utils.JsonUtils; +import com.dxhy.order.utils.StringUtil; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -34,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; +import java.io.IOException; import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; @@ -213,12 +217,6 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { return AjaxResult.success("success", respStr); } - public static void main(String[] args) { - DecimalFormat g=new DecimalFormat("0000000000"); - - String code = String.format("%10s","60121A").replace(" ","0"); - System.out.println(); - } private static void structureBuyerEntity(BuyerEntity buyerEntity,MdmGmfxxtbReqBO tempMdmGmfxxtbReqBO){ buyerEntity.setTaxpayerCode(tempMdmGmfxxtbReqBO.getDESC14()); @@ -323,6 +321,13 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { reqBO.setCODE(code); List commodityCodeEntities = commodityMapper.queryByCommoditySpbmCompany(reqBO.getCODE()); List collect = commodityCodeEntities.stream().filter(t -> "-1".equals(t.getXhfNsrsbh())).collect(Collectors.toList()); + String ggxh = StringUtils.isNotBlank(reqBO.getDESCSHORT())&& reqBO.getDESCSHORT().contains("_")? reqBO.getDESCSHORT().substring(reqBO.getDESCSHORT().indexOf("_") + 1) : ""; + if(GbkUtil.getGbkLength(ggxh) > ConfigureConstant.INT_40){ + try { + ggxh = StringUtil.subStringByByte(ggxh, ConfigureConstant.INT_40); + } catch (IOException e) { + } + } if(collect != null && collect.size() > 0){ matchCommodityCode(commodityCodeEntity); commodityCodeEntity.setXmmc(reqBO.getDESC1()); @@ -330,6 +335,7 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { commodityCodeEntity.setXmdw(reqBO.getDESC5()); commodityCodeEntity.setCreateTime(new Date()); commodityCodeEntity.setBz(reqBO.getDESCSHORT()); + commodityCodeEntity.setGgxh(ggxh); commodityCodeEntity.setUUID(reqBO.getUUID()); commodityCodeEntity.setWlflbm(reqBO.getCATEGORYCODE()); if(StringUtils.isNotBlank(reqBO.getCATEGORYNAME())){ @@ -356,6 +362,7 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { commodityCodeEntity.setCreateTime(new Date()); commodityCodeEntity.setBz(reqBO.getDESCSHORT()); commodityCodeEntity.setUUID(reqBO.getUUID()); + commodityCodeEntity.setGgxh(ggxh); commodityCodeEntity.setWlflbm(reqBO.getCATEGORYCODE()); if(StringUtils.isNotBlank(reqBO.getCATEGORYNAME())){ commodityCodeEntity.setWlflmc(reqBO.getCATEGORYNAME()); @@ -387,7 +394,6 @@ public class SDEnregyServiceImpl extends SDEnregyServiceAbstract { } return list; } - /** * 根据规则进行物料匹配 *