feat(erp): 销售订单保存时「是否需生产」默认按需生产处理
背景:客户反馈销售下单时看不到库存量,无法判断是否需要生产,
经确认该判断改由生产车间负责,销售端不再参与。
改动:validateSaleOrderItems 中,产品明细的 needProduction 为 null 时
统一置为 1(需生产)。该方法是新增/修改/导入三条保存路径的统一转换点,
在此兜底可保证接口直调也不会漏。
注意:needProduction 同时决定能否生成发货通知单(需生产需等 MPS 完成),
默认全为「需生产」后,现货直发场景需在生产环节另行处理。
| | |
| | | // 转化为 ErpSaleOrderItemDO 列表(产品验证已移除) |
| | | return convertList(list, o -> BeanUtils.toBean(o, ErpSaleOrderItemDO.class, item -> { |
| | | item.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount())); |
| | | // 是否需要生产:销售端已不再让业务员判断,未传时统一按“需要生产”处理, |
| | | // 由生产车间在生产环节根据实际库存自行判断/调整 |
| | | if (item.getNeedProduction() == null) { |
| | | item.setNeedProduction(1); |
| | | } |
| | | if (item.getTotalPrice() == null) { |
| | | return; |
| | | } |