Pārlūkot izejas kodu

Merge branch 'dev' of http://git.echepei.com/lazhaoqian/bladex into dev

1021934019@qq.com 4 gadi atpakaļ
vecāks
revīzija
d4cacc2a4c

+ 1 - 1
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/OrderFees.java

@@ -172,7 +172,7 @@ public class OrderFees implements Serializable {
 	 * 支付方名称
 	 */
 	@ApiModelProperty(value = "支付方名称")
-	@TableField(exist = false)
+	//@TableField(exist = false)
 	private String corpName;
 
 

+ 6 - 6
blade-service/blade-client/src/main/java/org/springblade/client/fees/mapper/FeesDescMapper.xml

@@ -33,22 +33,22 @@
             and id = #{FeesDesc.id}
         </if>
         <if test="FeesDesc.code!=null and FeesDesc.code != ''">
-            and code = #{FeesDesc.code}
+            and code like CONCAT(CONCAT('%', #{FeesDesc.code}), '%')
         </if>
         <if test="FeesDesc.cname!=null and FeesDesc.cname != ''">
-            and cname = #{FeesDesc.cname}
+            and cname like CONCAT(CONCAT('%', #{FeesDesc.cname}), '%')
         </if>
         <if test="FeesDesc.fcyno!=null and FeesDesc.fcyno != ''">
-            and fcyno = #{FeesDesc.fcyno}
+            and fcyno like CONCAT(CONCAT('%', #{FeesDesc.fcyno}), '%')
         </if>
         <if test="FeesDesc.unitno!=null and FeesDesc.unitno != ''">
-            and unitno = #{FeesDesc.unitno}
+            and unitno like CONCAT(CONCAT('%', #{FeesDesc.unitno}), '%')
         </if>
         <if test="FeesDesc.dc!=null and FeesDesc.dc != ''">
-            and dc = #{FeesDesc.dc}
+            and dc like CONCAT(CONCAT('%', #{FeesDesc.dc}), '%')
         </if>
         <if test="FeesDesc.remarks!=null and FeesDesc.remarks != ''">
-            and remarks = #{FeesDesc.remarks}
+            and remarks like CONCAT(CONCAT('%', #{FeesDesc.remarks}), '%')
         </if>
         <if test="FeesDesc.version!=null and FeesDesc.version != ''">
             and version = #{FeesDesc.version}

+ 4 - 29
blade-service/blade-client/src/main/java/org/springblade/client/goods/mapper/GoodsDescMapper.xml

@@ -7,7 +7,7 @@
         <id column="id" property="id"/>
         <result column="code" property="code"/>
         <result column="cname" property="cname"/>
-        <result column="cname" property="cname"/>
+        <result column="ename" property="ename"/>
         <result column="name_description" property="nameDescription"/>
         <result column="cname_description" property="cnameDescription"/>
         <result column="typeno" property="typeno"/>
@@ -18,7 +18,7 @@
         <result column="custom_rate" property="customRate"/>
         <result column="unit" property="unit"/>
         <result column="brand" property="brand"/>
-        <result column="branditem" property="branditem"/>
+        <result column="brand_item" property="brandItem"/>
         <result column="specs" property="specs"/>
         <result column="category" property="category"/>
         <result column="categoryitem" property="categoryitem"/>
@@ -139,20 +139,7 @@
     </select>
     <select id="selectGoods" resultType="org.springblade.client.vo.GoodsDescVO">
         select
-        bg.id,
-        bg.code,
-        bg.cname,
-        bg.typeno,
-        bg.brand,
-        bg.brand_item,
-        bg.specs,
-        bg.category,
-        bg.providers,
-        bg.unit,
-        bg.packgeunit,
-        bg.url,
-        CONCAT_WS(" ",bg.cname,bg.brand,bg.specs,bg.brand_item," ") AS specificationAndModel,
-        bg.goods_type_id AS goodsTypeId,
+        bg.*
         ba.cname AS goodsTypeName
         from basic_goods_desc bg
         LEFT JOIN basic_goods_type ba ON ba.id = bg.goods_type_id AND ba.status = 0 AND ba.is_deleted = 0
@@ -205,19 +192,7 @@
     </select>
     <select id="selectGoodsMessage" resultType="org.springblade.client.vo.GoodsDescVO">
         select
-        id,
-        code,
-        cname,
-        typeno,
-        brand,
-        brand_item,
-        specs,
-        category,
-        providers,
-        unit,
-        packgeunit,
-        url,
-        CONCAT_WS(" ",cname,brand,specs,brand_item," ") AS specificationAndModel
+        *
         from basic_goods_desc
         where is_deleted = 0
         <if test="Id!=null">

+ 1 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderFeesMapper.xml

@@ -26,6 +26,7 @@
         <result column="update_time" property="updateTime"/>
         <result column="status" property="status"/>
         <result column="is_deleted" property="isDeleted"/>
+        <result column="corp_name" property="corpName"/>
     </resultMap>
 
 

+ 6 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderItemsMapper.xml

@@ -52,6 +52,12 @@
         <result column="insurance" property="insurance"/>
         <result column="freight" property="freight"/>
         <result column="discount" property="discount"/>
+        <result column="price_category_names" property="priceCategoryNames"/>
+        <result column="cntr_no" property="cntrNo"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="priority_referrer" property="priorityReferrer"/>
+        <result column="referrer_reason" property="referrerReason"/>
+        <result column="corp_name" property="corpName"/>
     </resultMap>
 
 

+ 23 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -19,6 +19,7 @@ package org.springblade.purchase.sales.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.google.protobuf.ServiceException;
+import com.trade.purchase.order.enums.OrderTypeEnum;
 import com.trade.purchase.order.vo.OrderDTO;
 import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
@@ -101,6 +102,18 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 				return R.fail(500,"生成系统编号失败");
 			}
 			order.setSysNo((String) billNo.getData());
+			R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(order.getCorpId());
+			if (corpMessage.isSuccess()){
+				R clientBillNo = serialClient.getBillNo(corpMessage.getData().getCode());
+				if (!clientBillNo.isSuccess()){
+					TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+					return R.fail(500,"生成订单编号失败");
+				}
+				order.setOrderNo((String) clientBillNo.getData());
+				if (!order.getBillType().equals(OrderTypeEnum.IMPORT.getType())){   //进口的orgOrderNo 存的是采购订单号  出口国内存的是本身的订单号码
+					order.setOrgOrderNo((String) clientBillNo.getData());
+				}
+			}
 			order.setTenantId(SecureUtil.getTenantId());
 			order.setCreateTime(date);
 			order.setCreateUser(SecureUtil.getUserId());
@@ -283,6 +296,16 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 			throw  new RuntimeException("生成系统编号失败");
 		}
+		selectById.setOrgOrderNo(selectById.getOrderNo());
+		R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(selectById.getCorpId());
+		if (corpMessage.isSuccess()){
+			R clientBillNo = serialClient.getBillNo(corpMessage.getData().getCode());
+			if (!clientBillNo.isSuccess()){
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				return R.fail(500,"生成订单编号失败");
+			}
+			selectById.setOrderNo((String) clientBillNo.getData());
+		}
 		selectById.setSrcId(order.getId());
 		selectById.setSrcOrderNo(selectById.getSysNo());
 		selectById.setId(null);