|
|
|
@ -679,7 +679,56 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String confirmFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo) {
|
|
|
|
|
return null;
|
|
|
|
|
String result1="出库成功";
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_" + wmsSellOutEmbryo.getFactoryCode());
|
|
|
|
|
List<WmsProductPutTrayCode> wmsProductPutTrayCodeList= wmsSellOutEmbryo.getWmsProductPutTrayCodeList();
|
|
|
|
|
//成品销售出库--确认接口---修改出库单,--出库库存
|
|
|
|
|
WmsSellOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(wmsSellOutEmbryo.getId());
|
|
|
|
|
Integer tem= wmsProductPutTrayCodeList.size();
|
|
|
|
|
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));
|
|
|
|
|
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(wmsSellOutEmbryo);
|
|
|
|
|
//订单修改完成
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|