|
|
|
@ -16,6 +16,7 @@ import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.wms.domain.*;
|
|
|
|
|
import com.op.wms.mapper.WmsFpStorageNewsSnMapper;
|
|
|
|
|
import okhttp3.*;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
@ -226,24 +227,28 @@ public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService {
|
|
|
|
|
BigDecimal tem= wmsFpStorageNewsSn.getAmount();//数量
|
|
|
|
|
//planQuantity看成总数量
|
|
|
|
|
if(planQuantity.compareTo(tem)<=0){
|
|
|
|
|
//生成一个
|
|
|
|
|
wmsSellOutEmbryoMapper.updateWmsSellOutEmbryoAddOut(wmsSellOutEmbryo2,planQuantity);//对订单进行修改--添加出库数量
|
|
|
|
|
wmsSellOutEmbryo2.setStockOrder("BH"+stock);
|
|
|
|
|
wmsSellOutEmbryo2.setOutQuantity(new BigDecimal("0"));
|
|
|
|
|
wmsSellOutEmbryo2.setWaCode(wmsFpStorageNewsSn.getWaCode());
|
|
|
|
|
wmsSellOutEmbryo2.setPlanQuantity(planQuantity);
|
|
|
|
|
wmsSellOutEmbryo2.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo2);
|
|
|
|
|
//生成一个
|
|
|
|
|
WmsSellOutEmbryo wmsSellOutEmbryo3=new WmsSellOutEmbryo();
|
|
|
|
|
BeanUtils.copyProperties(wmsSellOutEmbryo2, wmsSellOutEmbryo3);
|
|
|
|
|
wmsSellOutEmbryo3.setStockOrder("BH"+stock);
|
|
|
|
|
wmsSellOutEmbryo3.setOutQuantity(new BigDecimal("0"));
|
|
|
|
|
wmsSellOutEmbryo3.setWaCode(wmsFpStorageNewsSn.getWaCode());
|
|
|
|
|
wmsSellOutEmbryo3.setPlanQuantity(planQuantity);
|
|
|
|
|
wmsSellOutEmbryo3.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo3);
|
|
|
|
|
break ;
|
|
|
|
|
}else {
|
|
|
|
|
wmsSellOutEmbryoMapper.updateWmsSellOutEmbryoAddOut(wmsSellOutEmbryo2,tem);
|
|
|
|
|
wmsSellOutEmbryo2.setStockOrder("BH"+stock);
|
|
|
|
|
wmsSellOutEmbryo2.setOutQuantity(new BigDecimal("0"));
|
|
|
|
|
WmsSellOutEmbryo wmsSellOutEmbryo3=new WmsSellOutEmbryo();
|
|
|
|
|
BeanUtils.copyProperties(wmsSellOutEmbryo2, wmsSellOutEmbryo3);
|
|
|
|
|
wmsSellOutEmbryo3.setStockOrder("BH"+stock);
|
|
|
|
|
wmsSellOutEmbryo3.setOutQuantity(new BigDecimal("0"));
|
|
|
|
|
planQuantity = planQuantity.subtract(tem); // 用总数量减去tem,更新planQuantity的值
|
|
|
|
|
wmsSellOutEmbryo2.setWaCode(wmsFpStorageNewsSn.getWaCode()); // 设置wmsSellOutEmbryo2的waCode为当前wmsFpStorageNewsSn的waCode
|
|
|
|
|
wmsSellOutEmbryo2.setPlanQuantity(tem); // 将tem的值赋给wmsSellOutEmbryo2的planQuantity
|
|
|
|
|
wmsSellOutEmbryo2.setId(IdUtils.fastSimpleUUID()); // 生成一个唯一ID并设置到wmsSellOutEmbryo2的ID字段
|
|
|
|
|
wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo2); // 将wmsSellOutEmbryo2插入到数据库
|
|
|
|
|
wmsSellOutEmbryo3.setWaCode(wmsFpStorageNewsSn.getWaCode()); // 设置wmsSellOutEmbryo2的waCode为当前wmsFpStorageNewsSn的waCode
|
|
|
|
|
wmsSellOutEmbryo3.setPlanQuantity(tem); // 将tem的值赋给wmsSellOutEmbryo2的planQuantity
|
|
|
|
|
wmsSellOutEmbryo3.setId(IdUtils.fastSimpleUUID()); // 生成一个唯一ID并设置到wmsSellOutEmbryo2的ID字段
|
|
|
|
|
wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo3); // 将wmsSellOutEmbryo2插入到数据库
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|