소스 검색

供应商

dongke 2 년 전
부모
커밋
f1b8d837f6

+ 1 - 3
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml

@@ -200,9 +200,7 @@
         ,tmgs.sku_spec  as "skuSpec"
         ,tmgb.brand_name  as "brandName"
         ,tmgb.short_name  as "shortName"
-        ,tmw.wh_id as "whId"
-        ,tmw.wh_code as "whCode"
-        ,tmw.wh_name as "whName"
+i
         ,tpp.pur_id as "purId"
         ,tpp.pur_no as "purNo"
         ,tppi.item_qty as "purItemQty"

+ 7 - 2
src/main/java/com/dk/mdm/mapper/pur/PurchaseItemMapper.xml

@@ -314,6 +314,7 @@
         i.inv_id,
         i.inv_qty,
         i.usable_qty
+        ,tpp.pur_no as "purNo"
         FROM dkic_b.t_psi_purchase_item tppi
         left join(SELECT T.*
         FROM (select tpi.inv_id,
@@ -333,7 +334,7 @@
         left join dkic_b.t_mst_goods_sku tmgs on tppi.sku_id = tmgs.sku_id
         left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
         left join sys.t_data_kind tdk1 on tdk1.kind_code = tppi.into_status
-
+        left join dkic_b.t_psi_purchase tpp  on tpp.pur_id = tppi.pur_id
 
 
         <include refid="Condition_1"/>
@@ -357,9 +358,13 @@
         ,tppi.from_id  as "fromId"
         ,tppi.from_item_id  as "fromItemId"
         ,tpo.order_no  as "orderNo"
+        ,tpp.pur_no as "purNo"
         FROM dkic_b.t_psi_purchase_item tppi
         left join dkic_b.t_psi_order tpo on tpo.order_id = tppi.from_id
-        WHERE tppi.item_id = #{itemId}::uuid
+        left join dkic_b.t_psi_purchase tpp  on tpp.pur_id = tppi.pur_id
+        left join  dkic_b.t_mst_goods_sku  tmgs on tmgs.sku_id = tppi.sku_id
+        left join  dkic_b.t_mst_goods_brand  tmgb on tmgb.brand_id = tmgs.brand_id
+
     </select>
 
     <!-- 根据主键锁定表dkic_b.t_psi_purchase_item的一行数据 -->

+ 8 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -441,6 +441,9 @@
             <if test="pickupDateEnd != null">
                 AND tpp.pickup_date &lt; #{pickupDateEnd}::timestamp with time zone + interval '1 day'
             </if>
+            <if test="searchText !=null and searchText!='' " >
+                AND   tpp.pur_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+            </if>
         </where>
     </sql>
 
@@ -534,6 +537,8 @@
         ,tms1.staff_name as "makeStaffName"
         ,tmp.sup_name as "supplierName"
         ,tmw.wh_name as "whName"
+        ,tmw.wh_name as "whName"
+        ,tmw.wh_name as "whName"
         FROM dkic_b.t_psi_purchase tpp
         left join dkic_b.t_psi_purchase_item tppi  on tppi.pur_id = tpp.pur_id
         left join  dkic_b.t_mst_goods_sku  tmgs on tmgs.sku_id = tppi.sku_id
@@ -544,7 +549,10 @@
         Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
         Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
         Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
+
+
         <include refid="Condition_1"/>
+        ORDER BY  tpp.make_time
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>

+ 5 - 1
src/main/java/com/dk/mdm/model/query/pur/PurchaseQuery.java

@@ -52,7 +52,11 @@ public class PurchaseQuery extends PageInfo<PurchaseQuery> implements Serializab
     @TableField(typeHandler = UuidTypeHandler.class)
     private String purId;
 
-
+    /**
+     * 小程序的查询条件
+     */
+    @ApiModelProperty(value = "小程序的查询条件")
+    private String searchText;
     /**
      * 采购订单号
      */

+ 8 - 0
src/main/java/com/dk/mdm/model/response/pur/PurchaseItemResponse.java

@@ -109,6 +109,7 @@ public class PurchaseItemResponse extends PageInfo<PurchaseItemResponse> impleme
     private Integer itemIndex;
 
 
+
     /**
      * 商品ID
      */
@@ -372,6 +373,13 @@ public class PurchaseItemResponse extends PageInfo<PurchaseItemResponse> impleme
 
     private BigDecimal usableQty;
 
+    /**
+     * 商品图片 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @Excel(name = "商品图片 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @ApiModelProperty(value = "商品图片 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject skuImages;
 
 
 

+ 13 - 1
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -95,7 +95,19 @@ public class PurchaseService extends BaseService<Purchase> {
      */
     @Pagination
     public ResponseResultVO<PageList<PurchaseResponse>> selectByCondItem(PurchaseQuery purchaseQuery) {
-        return super.mergeListWithCount(purchaseQuery, purchaseMapper.selectByCondItem(purchaseQuery), purchaseMapper.countByCond(purchaseQuery));
+         List<PurchaseResponse> purchaseOrders = purchaseMapper.selectByCond(purchaseQuery); // 总单数据
+        for (PurchaseResponse order : purchaseOrders) {
+            PurchaseItemQuery purchaseItemQuery = new PurchaseItemQuery ();
+            purchaseItemQuery.setPageSize(1000);
+            purchaseItemQuery.setCurrentPage(1);
+            purchaseItemQuery.setPurId(order.getPurId());
+            purchaseItemQuery.setCpId(order.getCpId());
+            List<PurchaseItemResponse> items =  purchaseItemMapper.selectByCond(purchaseItemQuery);// 明细数据
+
+            order.setPurchaseItemResponseList(items);
+        }
+
+        return super.mergeListWithCount(purchaseQuery, purchaseOrders, purchaseMapper.countByCond(purchaseQuery));
     }
     /**
      * @desc : 采购订单 待入库查询