Commit f644a767 authored by 李驰骋's avatar 李驰骋

领料库存限制添加批号字段查询

parent f6b579a0
......@@ -30,7 +30,7 @@ public interface InvmlDao extends JpaRepository<Invml, InvmlId>, JpaSpecificatio
* @param ml003 库位
* @return
*/
Optional<Invml> findFirstByMl001AndMl002AndMl003(String ml001, String ml002, String ml003);
Optional<Invml> findFirstByMl001AndMl002AndMl003AndMl004(String ml001, String ml002, String ml003, String ml004);
@Query(value = "select il.*,ib.MB002 materialName from INVML il left join INVMB ib on il.ML001 = ib.MB001 where il.ML001 = :ml001 and ('' = ISNULL(CONVERT(varchar(200), :ml002),'') or il.ML002 = :ml002)" +
" and ('' = ISNULL(CONVERT(varchar(200), :gtStock),'') or il.ML005 > :gtStock)", nativeQuery = true)
......
......@@ -252,7 +252,7 @@ public class MoctcService {
// throw new TopsunitException(MessageUtils.getMessage("批管理品号{0}必须录入批号。", mocteCreateParams.getTb003()));
// }
// });
invmlDao.findFirstByMl001AndMl002AndMl003(mocteCreateParams.getTb003(), mocteCreateParams.getTe008(), mocteCreateParams.getTe025())
invmlDao.findFirstByMl001AndMl002AndMl003AndMl004(mocteCreateParams.getTb003(), mocteCreateParams.getTe008(), mocteCreateParams.getTe025(), "********************")
.filter(i -> i.getMl005().compareTo(mocteCreateParams.getQuantity()) >= 0)
.orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("品号{0}库存不足。", mocteCreateParams.getTb003().trim())));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment