MES:
原材料条码:
1、在新增上增加loading,防止二次点击
2、在生成条码时规格优先读取采购订单的规格参数,规格参数为空再读取物料的物料规格
3、无采购订单新增条码判断是否有库存
4、在采购新增条码时根据采购订单绑定的数量和已经生成条码的数量做判断
物料信息:
物料信息增加安全库存数量的维护和功能完善
master
xs 3 months ago
parent 3317eeb0ea
commit baa366a81a

@ -17,6 +17,7 @@
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="bindBarcode" column="bind_barcode"/>
<result property="materialId" column="material_id"/>
<result property="barcodeSpec" column="barcode_spec"/>
<result property="manufacturerId" column="manufacturer_id"/>
<result property="amount" column="amount"/>
<result property="productBarcode" column="product_barcode"/>
@ -62,6 +63,7 @@
bbi.pallet_info_code,
bbi.bind_barcode,
bbi.material_id,
bbi.barcode_spec,
bmi.material_code,
bmi.material_name,
bmi.material_spec,
@ -116,6 +118,8 @@
'%')</if>
<if test="materialSpec != null and materialSpec != '' ">and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="barcodeSpec != null and barcodeSpec != '' ">and replace(bbi.barcode_spec,' ','') like concat('%', #{barcodeSpec},
'%')</if>
<if test="manufacturerId != null ">and bbi.manufacturer_id = #{manufacturerId}</if>
<if test="amount != null ">and bbi.amount = #{amount}</if>
@ -123,14 +127,16 @@
'%')
</if>
<if test="printNumber != null ">and bbi.print_number = #{printNumber}</if>
<if test="poNo != null and poNo != ''">and bbi.po_no = #{poNo}</if>
<if test="poNo != null and poNo != ''">and bbi.po_no like concat('%', #{poNo},
'%')</if>
<if test="productionDate != null ">and bbi.production_date = #{productionDate}</if>
<if test="acceptedDate != null ">and bbi.accepted_date = #{acceptedDate}</if>
<if test="lastOutstockDate != null ">and bbi.last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''">and bbi.plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''">and bbi.plan_detail_code = #{planDetailCode}</if>
<if test="saleOrderId != null ">and bbi.sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code = #{saleorderCode}</if>
<if test="saleorderCode != null and saleorderCode != ''">and bbi.saleorder_code like concat('%', #{saleorderCode},
'%')</if>
<if test="projectNo != null and projectNo != ''">and bbi.project_no = #{projectNo}</if>
<if test="serialNumber != null and serialNumber != ''">and bbi.serial_number = #{serialNumber}</if>
<if test="bindStatus != null and bindStatus != ''">and bbi.bind_status = #{bindStatus}</if>
@ -145,8 +151,6 @@
(select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode}
and bbi.bind_barcode=mbbi.barcode_info)</if>
</where>
order by bbi.barcode_id desc
</select>
@ -171,6 +175,7 @@
<if test="palletInfoCode != null">pallet_info_code,</if>
<if test="bindBarcode != null">bind_barcode,</if>
<if test="materialId != null">material_id,</if>
<if test="barcodeSpec != null and barcodeSpec != ''">barcode_spec,</if>
<if test="manufacturerId != null">manufacturer_id,</if>
<if test="amount != null">amount,</if>
<if test="productBarcode != null">product_barcode,</if>
@ -208,6 +213,7 @@
<if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="bindBarcode != null">#{bindBarcode},</if>
<if test="materialId != null">#{materialId},</if>
<if test="barcodeSpec != null and barcodeSpec != ''">#{barcodeSpec},</if>
<if test="manufacturerId != null">#{manufacturerId},</if>
<if test="amount != null">#{amount},</if>
<if test="productBarcode != null">#{productBarcode},</if>
@ -357,6 +363,7 @@
bbi.pallet_info_code,
bbi.bind_barcode,
bbi.material_id,
bbi.barcode_spec,
bbi.manufacturer_id,
bbi.product_barcode,
bbi.amount,
@ -390,9 +397,9 @@
<insert id="batchMesBaseBarcodeInfo">
INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
INSERT INTO mes_base_barcode_info (batch_flag,barcode_type,barcode_info,batch_code,material_id,barcode_spec,manufacturer_id,amount,purchase_order_id,po_no,production_date,accepted_date,last_outstock_date,plan_code,plan_detail_code,safe_flag,sale_order_id,saleorder_code,project_no,serial_number,remark,bind_status,update_by,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=",">
( #{item.batchFlag}, #{item.barcodeType}, #{item.barcodeInfo}, #{item.batchCode}, #{item.materialId}, #{item.manufacturerId}, #{item.amount}, #{item.purchaseOrderId}, #{item.poNo}, #{item.productionDate}, #{item.acceptedDate}, #{item.lastOutstockDate}, #{item.planCode},#{item.planDetailCode}, #{item.safeFlag},#{item.saleOrderId}, #{item.saleorderCode},#{item.projectNo}, #{item.serialNumber},#{item.remark}, #{item.bindStatus},#{item.updateBy}, #{item.updateTime})
( #{item.batchFlag}, #{item.barcodeType}, #{item.barcodeInfo}, #{item.batchCode}, #{item.materialId}, #{item.barcodeSpec}, #{item.manufacturerId}, #{item.amount}, #{item.purchaseOrderId}, #{item.poNo}, #{item.productionDate}, #{item.acceptedDate}, #{item.lastOutstockDate}, #{item.planCode},#{item.planDetailCode}, #{item.safeFlag},#{item.saleOrderId}, #{item.saleorderCode},#{item.projectNo}, #{item.serialNumber},#{item.remark}, #{item.bindStatus},#{item.updateBy}, #{item.updateTime})
</foreach>
</insert>

@ -36,6 +36,7 @@
<result property="updateTime" column="update_time"/>
<result property="approveDate" column="approve_date"/>
<result property="erpModifyDate" column="erp_modify_date"/>
<result property="safeStockAmount" column="safe_stock_amount"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="purchasePriceUnitId" column="purchase_price_unit_id"/>
</resultMap>
@ -72,7 +73,8 @@
bmi.update_by,
bmi.update_time,
bmi.approve_date,
bmi.erp_modify_date
bmi.erp_modify_date,
bmi.safe_stock_amount
from mes_base_material_info bmi
left join mes_base_material_type bmt on bmt.matrial_type_id = bmi.material_type_id
</sql>
@ -216,6 +218,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="approveDate != null">approve_date = #{approveDate},</if>
<if test="safeStockAmount != null">safe_stock_amount = #{safeStockAmount},</if>
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
<if test="alwaysFlag != null">always_flag = #{alwaysFlag},</if>
<if test="batchAmount != null">batch_amount = #{batchAmount},</if>

@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="bindAmount" column="bind_amount" />
<result property="barcodeAmount" column="barcode_amount" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesOrderBindVo">
select order_bind_id, safe_flag, sale_order_id, sale_order_code, product_id, product_code, product_name, purchase_order_id, po_no, material_id, material_code, material_name, bind_amount, remark, create_by, create_time, update_by, update_time from mes_order_bind
select order_bind_id, safe_flag, sale_order_id, sale_order_code, product_id, product_code, product_name, purchase_order_id, po_no, material_id, material_code, material_name, bind_amount, barcode_amount,remark, create_by, create_time, update_by, update_time from mes_order_bind
</sql>
<select id="selectMesOrderBindList" parameterType="MesOrderBind" resultMap="MesOrderBindResult">
@ -109,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="bindAmount != null">bind_amount = #{bindAmount},</if>
<if test="barcodeAmount != null">barcode_amount = #{barcodeAmount},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>

@ -43,6 +43,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="saleBindAmount" column="sale_bind_amount" />
<result property="safeAmount" column="safe_amount" />
<result property="barcodeAmount" column="barcode_amount" />
<result property="batchFlag" column="batch_flag" />
<result property="batchAmount" column="batch_amount" />
<result property="mesMaterialId" column="mes_material_id" />
<result property="orderBindBarcodeAmount" column="order_bind_barcode_amount" />
<result property="safeBindBarcodeAmount" column="safe_bind_barcode_amount" />
</resultMap>
<resultMap id="MesPurchaseOrderMesOrderBindResult" type="MesPurchaseOrder" extends="MesPurchaseOrderResult">
@ -230,8 +237,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.po_no,
mpo.document_status,
mpo.material_id,
mpo.material_code,
mpo.material_name,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
mpo.aux_prop_id,
mpo.specification_parameter,
@ -254,15 +261,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mob.purchase_order_id = mpo.purchase_order_id
and mob.safe_flag = '1') barcode_amount
from mes_purchase_order mpo
left join mes_base_material_info mbmi on mbmi.material_id = mpo.material_id
left join mes_base_material_info mbmi on mbmi.erp_id = mpo.material_id
<where>
<if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mpo.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mpo.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where>
order by mpo.po_no ,mpo.material_code
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select>
<select id="saleBindPurchaseOrderList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">
@ -272,8 +279,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mpo.po_no,
mpo.document_status,
mpo.material_id,
mpo.material_code,
mpo.material_name,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
mpo.specification_parameter,
mpo.order_amount,
@ -284,9 +291,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="saleOrderId != null "> and mob.sale_order_id = #{saleOrderId}</if>
<if test="poNo != null and poNo != ''"> and mpo.po_no = #{poNo}</if>
<if test="materialCode != null and materialCode != ''"> and mpo.material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and mpo.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
</where>
</select>
<select id="selectPurchaseOrderBindList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">
select mpo.purchase_order_id,
mpo.erp_id,
mpo.fentry_id,
mpo.po_no,
mpo.document_status,
mpo.material_id,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
mbmi.batch_flag,
mbmi.batch_amount,
mbmi.material_id as mes_material_id,
mpo.aux_prop_id,
mpo.specification_parameter,
mpo.order_amount,
(select concat(ifnull(sum(bind_amount),0),'-',ifnull(sum(barcode_amount),0))
from mes_order_bind mob where mob.purchase_order_id=mpo.purchase_order_id and mob.safe_flag='0') order_bind_barcode_amount,
(select concat(ifnull(sum(bind_amount),0),'-',ifnull(sum(barcode_amount),0))
from mes_order_bind mob where mob.purchase_order_id=mpo.purchase_order_id and mob.safe_flag='1') safe_bind_barcode_amount
from mes_purchase_order mpo
left join mes_base_material_info mbmi on mbmi.erp_id = mpo.material_id
<where>
<if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="specificationParameter != null and specificationParameter != ''"> and mpo.specification_parameter like concat('%', #{specificationParameter}, '%')</if>
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
</where>
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select>
</mapper>

Loading…
Cancel
Save