wms成品销售出库bug3修改

master
mengjiao 5 months ago
parent 0688080bb8
commit e6b60d7dbe

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

Loading…
Cancel
Save