|
@@ -417,10 +417,15 @@
|
|
pi.sale_order_no as saleNo,
|
|
pi.sale_order_no as saleNo,
|
|
p.product_no as productNo,
|
|
p.product_no as productNo,
|
|
por.levels as productLevel,
|
|
por.levels as productLevel,
|
|
|
|
+ por.colours as scolours,
|
|
IF(batch.batch_number IS NULL, '0', batch.batch_number) as batchNumber,
|
|
IF(batch.batch_number IS NULL, '0', batch.batch_number) as batchNumber,
|
|
batch.batch_State as batchState,
|
|
batch.batch_State as batchState,
|
|
batch.id as batchId
|
|
batch.id as batchId
|
|
- from `huaxian`.product_outbound_record por -- 成品出库记录表
|
|
|
|
|
|
+ from (
|
|
|
|
+ SELECT p.*,c.sale_product_id,s.colours FROM `huaxian`.product_outbound_record p
|
|
|
|
+ LEFT JOIN `huaxian`.product_code_list c ON p.qr_code = c.qr_code
|
|
|
|
+ LEFT JOIN `huaxian`.sale_products s ON c.sale_product_id = s.id GROUP BY p.id
|
|
|
|
+ ) por -- 成品出库记录表
|
|
left join `huaxian`.production p on p.id = por.product_id -- 产品表
|
|
left join `huaxian`.production p on p.id = por.product_id -- 产品表
|
|
left join `huaxian`.product_invoice pi on por.notice_number = pi.notice_number -- 产品发货单表
|
|
left join `huaxian`.product_invoice pi on por.notice_number = pi.notice_number -- 产品发货单表
|
|
left join `huaxian`.product_outbound_record_batch as batch
|
|
left join `huaxian`.product_outbound_record_batch as batch
|
|
@@ -431,7 +436,8 @@
|
|
left join (select sp.product_no as productNo, -- 产品编号
|
|
left join (select sp.product_no as productNo, -- 产品编号
|
|
sp.product_unit_price as productUnitPrice, -- 产品单价
|
|
sp.product_unit_price as productUnitPrice, -- 产品单价
|
|
CONCAT(m.materie_encoding, m.materie_color_number) as productColour, -- 产品转码+色泽
|
|
CONCAT(m.materie_encoding, m.materie_color_number) as productColour, -- 产品转码+色泽
|
|
- sp.`level` as `level`
|
|
|
|
|
|
+ sp.`level` as `level`,
|
|
|
|
+ sp.colours as bcolours
|
|
from `huaxian`.sale_order so -- 订单表
|
|
from `huaxian`.sale_order so -- 订单表
|
|
left join `huaxian`.sale_products sp
|
|
left join `huaxian`.sale_products sp
|
|
on so.sale_no = sp.sale_order_no and sp.del_flag = '0' -- 销售产品表
|
|
on so.sale_no = sp.sale_order_no and sp.del_flag = '0' -- 销售产品表
|
|
@@ -441,7 +447,7 @@
|
|
on m.materiel_code = sp.colour_number and m.del_flag = '0' -- 物料信息表
|
|
on m.materiel_code = sp.colour_number and m.del_flag = '0' -- 物料信息表
|
|
where so.del_flag = '0'
|
|
where so.del_flag = '0'
|
|
and so.sale_no = #{saleNo}) as b -- 根据销售单编号得到当前订单包含的所有产品
|
|
and so.sale_no = #{saleNo}) as b -- 根据销售单编号得到当前订单包含的所有产品
|
|
- on a.productNo = b.productNo AND a.productLevel = b.`level` and a.productColour = b.productColour;
|
|
|
|
|
|
+ on a.productNo = b.productNo AND a.productLevel = b.`level` AND a.scolours = b.bcolours;
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="printOutsourceOrderListNowEnd" resultType="com.zkqy.business.domain.vo.SaleProductsVo">
|
|
<select id="printOutsourceOrderListNowEnd" resultType="com.zkqy.business.domain.vo.SaleProductsVo">
|