wms部分修改

master
mengjiao 6 months ago
parent 7a80d9dc30
commit 707130bbae

@ -89,4 +89,6 @@ public interface WmsFpStorageNewsSnMapper {
public void addBatchPallet(@Param("list")List<ProOrderWorkorder> dtos);
public List<WmsFpStorageNewsSn> selectBSKList(WmsFpStorageNewsSn proOrderWorkorder);
List<WmsFpStorageNewsSn> selectWmsFpStorageNewsSnSTList(WmsFpStorageNewsSn wmsFpStorageNewsSn);
}

@ -856,58 +856,18 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsFpStorageNewsSn1.setActiveFlag("1");
wmsFpStorageNewsSn1.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSnOut(wmsFpStorageNewsSn1);
}
//成品销售出库--确认接口---修改出库单,--出库库存
WmsSellOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(wmsSellOutEmbryo.getId());
Integer tem= wmsProductPutTrayCodeList.size();
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));//2
int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity);
WmsSellOutEmbryo wmsSellOutEmbryoUpdate=new WmsSellOutEmbryo();
if (result == 0){//出库完
wmsSellOutEmbryoUpdate.setStatus("1");
}else {
wmsSellOutEmbryoUpdate.setStatus("0");
}
wmsSellOutEmbryoUpdate.setId(wmsSellOutEmbryo.getId());
wmsSellOutEmbryoUpdate.setOutQuantity(OutQuantity);
wmsSellOutEmbryoMapper.updateWmsSellOutEmbryo(wmsSellOutEmbryoUpdate);
//订单修改完成
for(WmsProductPutTrayCode wmsProductPutTrayCode: wmsProductPutTrayCodeList){//库存修改
//解除绑定
wmsProductPutTrayCode.setRelatStatus("0");
wmsProductPutTrayCodeMapper.updateWmsProductPutTrayCode(wmsProductPutTrayCode);
//改明细
WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn();
wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn());
wmsFpStorageNewsSn.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNewsSn.setActiveFlag("1");
wmsFpStorageNewsSn.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSnOut(wmsFpStorageNewsSn);
//判断如果托盘数据被出完,就关闭这个明细
// List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
if (wmsFpStorageNewsSns.size()>0){
WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSns.get(0);
BigDecimal ken= new BigDecimal(wmsFpStorageNewsSn1.getUserDefined2());
int comparisonResult = ken.compareTo(wmsFpStorageNewsSn1.getAmount());
if (comparisonResult == 0) {
// ken和amount相等
wmsFpStorageNewsSn1.setActiveFlag("0");
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn1);
}
}
//改主表
WmsFpStorageNewsSn wmsFpStorageNewsSn2= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnByStorageId(wmsFpStorageNewsSn.getStorageId());
WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews();
wmsFpStorageNews.setActiveFlag("1");
wmsFpStorageNews.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNews.setWlCode(wmsFpStorageNewsSn2.getWlCode());
wmsFpStorageNews.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNews.setProductBatch(wmsFpStorageNewsSn2.getBatchNumber());
wmsFpStorageNews.setAmount(wmsFpStorageNewsSn.getAmount());
wmsFpStorageNews.setWhCode(wmsFpStorageNewsSn2.getWhCode());
wmsFpStorageNews.setWaCode(wmsFpStorageNewsSn2.getWaCode());
wmsFpStorageNewsMapper.updateWmsFpStorageNewsOut(wmsFpStorageNews);
}
return result1;
}
@ -919,7 +879,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn();
wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn());
wmsFpStorageNewsSn.setActiveFlag("1");
List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnSTList(wmsFpStorageNewsSn);
return wmsFpStorageNewsSns;
}

@ -621,7 +621,8 @@
product_date Plan_Date,
prod_type User_Defined1
FROM mes_prepare
WHERE workorder_name LIKE CONCAT('%', #{produceCode}, '%');
WHERE workorder_name LIKE CONCAT('%', #{produceCode}, '%')
and del_flag='0'
</select>
<select id="selectOdsProcureOutOrderListZUfc" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT

@ -420,7 +420,7 @@
</delete>
<update id="updateWmsFpStorageNewsOut">
update wms_fp_storage_news
set amount = COALESCE(amount, 0) - 1
where product_code = #{productCode} and wl_code = #{wlCode} and active_flag='1'
set amount = COALESCE(amount, 0) - #{amount}
where product_code = #{productCode} and wl_code = #{wlCode} and wh_code = #{whCode} and wa_code = #{waCode} and active_flag='1' and product_batch=#{productBatch}
</update>
</mapper>

@ -16,6 +16,7 @@
<result property="barCode" column="bar_code"/>
<result property="amount" column="amount"/>
<result property="batchNumber" column="batch_number"/>
<result property="userDefined1" column="user_defined1"/>
<result property="userDefined2" column="user_defined2"/>
<result property="userDefined3" column="user_defined3"/>
<result property="userDefined4" column="user_defined4"/>
@ -313,7 +314,7 @@
</delete>
<update id="updateWmsFpStorageNewsSnOut">
update wms_fp_storage_news_sn
set user_defined2 = #{userDefined2} + 1
set user_defined2 =user_defined2+ #{userDefined2}
where storage_id=#{storageId} and active_flag='1'
</update>
<select id="selectwmsFpStorageNews" resultType="java.lang.String">
@ -437,5 +438,67 @@
</trim>
</foreach>
</insert>
<select id="selectWmsFpStorageNewsSnSTList">
SELECT
storage_id,
wh_code,
wa_code,
wl_code,
order_no,
product_name,
product_code,
sn,
bar_code,
amount,
batch_number,
COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0
COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0
user_defined3,
user_defined4,
user_defined5,
user_defined6,
user_defined7,
user_defined8,
user_defined9,
user_defined10,
create_by,
gmt_create,
last_modified_by,
gmt_modified,
active_flag,
factory_code,
sap_factory_code
FROM
wms_fp_storage_news_sn
<where>
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</if>
<if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
<if test="productName != null and productName != ''">and product_name like concat('%', #{productName},
'%')
</if>
<if test="productCode != null and productCode != ''">and product_code like concat('%',#{productCode} ,
'%')</if>
<if test="sn != null and sn != ''">and sn = #{sn}</if>
<if test="barCode != null and barCode != ''">and bar_code = #{barCode}</if>
<if test="amount != null ">and amount = #{amount}</if>
<if test="batchNumber != null and batchNumber != ''">and batch_number = #{batchNumber}</if>
<if test="userDefined2 != null and userDefined2 != ''">and user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''">and user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''">and user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''">and user_defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''">and user_defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''">and user_defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''">and user_defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''">and user_defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''">and user_defined10 = #{userDefined10}</if>
<if test="gmtCreate != null ">and gmt_create = #{gmtCreate}</if>
<if test="lastModifiedBy != null and lastModifiedBy != ''">and last_modified_by = #{lastModifiedBy}</if>
<if test="gmtModified != null ">and gmt_modified = #{gmtModified}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="sapFactoryCode != null and sapFactoryCode != ''">and sap_factory_code = #{sapFactoryCode}</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save