Explorar o código

入库成本核对

changhaoning hai 1 ano
pai
achega
caa0763878

+ 16 - 0
src/main/java/com/dk/mdm/controller/ivt/inbound/InboundItemController.java

@@ -54,4 +54,20 @@ public class InboundItemController{
         return inboundItemService.insert(inboundItemVO);
     }
 
+
+
+    /**
+     * @desc   : 条件查询(入库成本核对用)
+     * @author : 常皓宁
+     * @date   : 2024/3/13 14:35
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"select_cost_check"})
+    public ResponseResultVO<PageList<InboundItemResponse>> selectCostCheck(@RequestBody InboundItemQuery inboundItemQuery) {
+        return inboundItemService.selectCostCheck(inboundItemQuery);
+    }
+
 }

+ 7 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.java

@@ -33,6 +33,13 @@ public interface InboundItemMapper extends BaseMapper<InboundItem>{
      */
     Long countByCond(InboundItemQuery inboundItemQuery);
 
+    /**
+     * @desc   : 条件查询 (入库成本核对用)
+     * @author : 常皓宁
+     * @date   : 2024/4/17 10:15
+     */
+    List<InboundItemResponse> selectCostCheck(InboundItemQuery inboundItemQuery);
+
 
     /**
      * @desc   : 根据id查询

+ 51 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml

@@ -498,4 +498,55 @@
             limit #{end} offset #{start}
         </if>
     </select>
+
+
+
+    <!-- 条件查询 (入库成本核对用) -->
+    <select id="selectCostCheck" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        ,tpid.into_no as "intoNo"
+        ,tmgs.sku_code  as "skuCode"
+        ,tmgs.sku_model as "skuModel"
+        ,tmgs.sku_name  as "skuName"
+        ,tmgs.sku_spec  as "skuSpec"
+        ,tmgb.brand_name  as "brandName"
+        ,tmgb.short_name  as "shortName"
+        ,tpp.pur_id as "purId"
+        ,tpp.pur_no as "purNo"
+        ,tppi.item_qty as "purItemQty"
+        ,tppi.intoing_qty as "purItemIntoingQty"
+        ,tppi.into_qty as "purItemIntoQty"
+        ,tpiv.inv_qty
+        FROM dkic_b.t_psi_inbound_item tpii
+        left join dkic_b.t_psi_inbound tpid on tpii.into_id = tpid.into_id
+        left join dkic_b.t_psi_inventory tpiv on tpiv.inv_id = tpii.inv_id
+        left join dkic_b.t_psi_purchase_item tppi on tppi.item_id = tpii.from_item_id
+        left join dkic_b.t_psi_purchase tpp on tpp.pur_id = tpii.from_id
+        left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
+        left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
+        left join dkic_b.t_psi_inventory tpi on tpi.inv_id = tpii.inv_id
+        left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpii.wh_id
+        <where>
+            tpii.flg_valid
+            <if test="intoId != null and intoId != ''">
+                AND tpii.into_id = #{intoId}::uuid
+            </if>
+            <if test="intoNo != null and intoNo != ''">
+                AND tpid.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
+            </if>
+            <if test="intoDataStart != null">
+                AND tpid.into_date &gt;= #{intoDataStart}::timestamp with time zone
+            </if>
+            <if test="intoDateEnd != null">
+                AND tpid.into_date &lt; #{intoDateEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="cpId != null">
+                AND tpii.cp_id = #{cpId}
+            </if>
+        </where>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
 </mapper>

+ 6 - 0
src/main/java/com/dk/mdm/model/response/ivt/InboundItemResponse.java

@@ -389,6 +389,12 @@ public class InboundItemResponse  {
     @ApiModelProperty(value = "可售量")
     private BigDecimal usableQty;
 
+    /**
+     * 入库单号
+     */
+    @Excel(name = "入库单号")
+    @ApiModelProperty(value = "入库单号")
+    private String intoNo;
 
 
 

+ 9 - 1
src/main/java/com/dk/mdm/service/ivt/inbound/InboundItemService.java

@@ -71,7 +71,15 @@ public class InboundItemService extends BaseService<InboundItem> {
 		return ResponseResultUtil.success();
 	}
 
-
+	/**
+	 * @desc   : 条件查询 (入库成本核对用)
+	 * @author : 常皓宁
+	 * @date   : 2024/3/13 14:36
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<InboundItemResponse>> selectCostCheck(InboundItemQuery inboundItemQuery) {
+		return super.mergeListWithCount(inboundItemQuery, inboundItemMapper.selectCostCheck(inboundItemQuery), inboundItemMapper.countByCond(inboundItemQuery));
+	}
 
 
 }