Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 10 months ago
commit 9395573da3

@ -339,6 +339,14 @@ public class WmsToWCSmissionController {
}
/**
* --
*
*/
@PostMapping("/confirmFinishedProductTransferAndOutbound")
public AjaxResult confirmFinishedProductTransferAndOutbound(@RequestBody WmsAllocationOutEmbryo wmsRuturnPutEmbryo) {
return AjaxResult.success(wmsProductPutService.confirmFinishedProductTransferAndOutbound(wmsRuturnPutEmbryo));
}
/**

@ -79,4 +79,8 @@ public interface WmsSellOutEmbryoMapper {
public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder, @Param("productCode") String productCode);
List<WmsAllocationOutEmbryo> selectWmsAllocationOutEmbryoList(WmsAllocationOutEmbryo wmsAllocationOutEmbryo);
WmsAllocationOutEmbryo selectWmsAllocationOutEmbryoById(String id);
void updateWmsAllocationOutEmbryo(WmsAllocationOutEmbryo wmsAllocationOutEmbryo);
}

@ -120,4 +120,6 @@ public interface IWmsProductPutService {
List<WmsAllocationOutEmbryo> selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo);
String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo);
}

@ -830,7 +830,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutRecords.setProductName(wmsRuturnPutEmbryo.getProductName());
wmsProductPutRecords.setProductCode(wmsRuturnPutEmbryo.getProductCode());
wmsProductPutRecords.setWhCode(wmsRuturnPutEmbryo.getWhCode());//仓库编码
wmsProductPutRecords.setFactoryCode(wmsRuturnPutEmbryo.getFactoryCode());
wmsProductPutRecords.setWlCode(wmsProductPut1.getWlCode());//库位编码
wmsProductPutRecords.setAttr1(wmsProductPut1.getSn());////托盘号编码
wmsProductPutRecords.setAttr2(wmsProductPut1.getNumber());//箱数
@ -890,4 +890,59 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
List<WmsAllocationOutEmbryo> wmsAllocationOutEmbryoList= wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoList(wmsAllocationOutEmbryo);
return wmsAllocationOutEmbryoList;
}
@Override
public String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo) {
String result1="出库成功";
DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode());
List<WmsProductPutTrayCode> wmsProductPutTrayCodeList= wmsRuturnPutEmbryo.getWmsProductPutTrayCodeList();
//成品销售出库--确认接口---修改出库单,--出库库存
WmsAllocationOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoById(wmsRuturnPutEmbryo.getId());
Integer tem= wmsProductPutTrayCodeList.size();
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));//2
int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity);
WmsAllocationOutEmbryo wmsAllocationOutEmbryo=new WmsAllocationOutEmbryo();
if (result == 0){//出库完
wmsAllocationOutEmbryo.setStatus("1");
}else {
wmsAllocationOutEmbryo.setStatus("0");
}
wmsAllocationOutEmbryo.setId(wmsRuturnPutEmbryo.getId());
wmsAllocationOutEmbryo.setOutQuantity(OutQuantity);
wmsSellOutEmbryoMapper.updateWmsAllocationOutEmbryo(wmsAllocationOutEmbryo);
//订单修改完成
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);
}
}
//改主表
WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews();
wmsFpStorageNews.setActiveFlag("1");
wmsFpStorageNews.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNews.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsMapper.updateWmsFpStorageNewsOut(wmsFpStorageNews);
}
return result1;
}
}

@ -160,14 +160,14 @@
<if test="productName != null">product_name,</if>
<if test="productCode != null">product_code,</if>
<if test="productSort != null">product_sort,</if>
<if test="specification != null">specification,</if>
<if test="speciFication != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="planQuantity != null">plan_quantity,</if>
<if test="putQuantity != null">put_quantity,</if>
<if test="status != null">status,</if>
<if test="SAPStatus != null">SAP_status,</if>
<if test="SAPProof != null">SAP_proof,</if>
<if test="SAPMessage != null">SAP_message,</if>
<if test="sapStatus != null">SAP_status,</if>
<if test="sapProof != null">SAP_proof,</if>
<if test="sapMessage != null">SAP_message,</if>
<if test="putDate != null">put_date,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
@ -195,14 +195,14 @@
<if test="productName != null">#{productName},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productSort != null">#{productSort},</if>
<if test="specification != null">#{specification},</if>
<if test="speciFication != null">#{speciFication},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="planQuantity != null">#{planQuantity},</if>
<if test="putQuantity != null">#{putQuantity},</if>
<if test="status != null">#{status},</if>
<if test="SAPStatus != null">#{SAPStatus},</if>
<if test="SAPProof != null">#{SAPProof},</if>
<if test="SAPMessage != null">#{SAPMessage},</if>
<if test="sapStatus != null">#{sapStatus},</if>
<if test="sapProof != null">#{sapProof},</if>
<if test="sapMessage != null">#{sapMessage},</if>
<if test="putDate != null">#{putDate},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>

@ -281,7 +281,7 @@
#{id}
</foreach>
</delete>
<select id="selectWmsAllocationOutEmbryoList" resultMap="WmsSellOutEmbryoResult">
<select id="selectWmsAllocationOutEmbryoList" resultMap="WmsAllocationOutEmbryoResult">
SELECT
id,
delivery_order,
@ -358,4 +358,91 @@
<if test="attr10 != null and attr10 != ''">and attr10 = #{attr10}</if>
</where>
</select>
<select id="selectWmsAllocationOutEmbryoById" parameterType="String" resultMap="WmsAllocationOutEmbryoResult">
SELECT
id,
delivery_order,
Item_number,
active_flag,
factory_code,
wh_code,
wa_code,
wl_code,
delivery_place,
product_name,
product_code,
product_sort,
specification,
unit_of_measure,
lot_number,
plan_quantity,
out_quantity,
status,
SAP_status,
SAP_proof,
SAP_message,
out_date,
attr1,
attr2,
attr3,
attr4,
attr5,
attr6,
attr7,
attr8,
attr9,
attr10,
create_by,
create_time,
update_by,
update_time,
remark
FROM
wms_allocation_out_embryo
where id = #{id}
</select>
<update id="updateWmsAllocationOutEmbryo" >
update wms_allocation_out_embryo
<trim prefix="SET" suffixOverrides=",">
<if test="deliveryOrder != null">delivery_order = #{deliveryOrder},</if>
<if test="itemNumber != null">Item_number = #{itemNumber},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="whCode != null">wh_code = #{whCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="deliveryPlace != null">delivery_place = #{deliveryPlace},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSort != null">product_sort = #{productSort},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="lotNumber != null">lot_number = #{lotNumber},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="status != null">status = #{status},</if>
<if test="sapStatus != null">SAP_status = #{sapStatus},</if>
<if test="sapProof != null">SAP_proof = #{sapProof},</if>
<if test="sapMessage != null">SAP_message = #{sapMessage},</if>
<if test="outDate != null">out_date = #{outDate},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="attr5 != null">attr5 = #{attr5},</if>
<if test="attr6 != null">attr6 = #{attr6},</if>
<if test="attr7 != null">attr7 = #{attr7},</if>
<if test="attr8 != null">attr8 = #{attr8},</if>
<if test="attr9 != null">attr9 = #{attr9},</if>
<if test="attr10 != null">attr10 = #{attr10},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
</mapper>

Loading…
Cancel
Save