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

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

parent f6b579a0
...@@ -30,7 +30,7 @@ public interface InvmlDao extends JpaRepository<Invml, InvmlId>, JpaSpecificatio ...@@ -30,7 +30,7 @@ public interface InvmlDao extends JpaRepository<Invml, InvmlId>, JpaSpecificatio
* @param ml003 库位 * @param ml003 库位
* @return * @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)" + @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) " and ('' = ISNULL(CONVERT(varchar(200), :gtStock),'') or il.ML005 > :gtStock)", nativeQuery = true)
......
...@@ -252,7 +252,7 @@ public class MoctcService { ...@@ -252,7 +252,7 @@ public class MoctcService {
// throw new TopsunitException(MessageUtils.getMessage("批管理品号{0}必须录入批号。", mocteCreateParams.getTb003())); // 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) .filter(i -> i.getMl005().compareTo(mocteCreateParams.getQuantity()) >= 0)
.orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("品号{0}库存不足。", mocteCreateParams.getTb003().trim()))); .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