InvLotLocIdMapper.java 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. package com.ruoyi.ams.inv.mapper;
  2. import java.math.BigDecimal;
  3. import java.util.List;
  4. import com.ruoyi.ams.asn.vo.StockingListVO;
  5. import com.ruoyi.ams.config.domain.dto.LotattDTO;
  6. import com.ruoyi.ams.inv.domain.InvLotAtt;
  7. import com.ruoyi.ams.inv.domain.InvLotLocId;
  8. import com.ruoyi.ams.inv.domain.form.InvLocIdSearchFrom;
  9. import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
  10. import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
  11. import com.ruoyi.common.core.domain.AjaxResult;
  12. import org.apache.ibatis.annotations.Param;
  13. /**
  14. * 库位库存信息Mapper接口
  15. *
  16. * @author andy
  17. * @date 2022-03-03
  18. */
  19. public interface InvLotLocIdMapper {
  20. /**
  21. * 查询库位库存信息
  22. *
  23. * @param lotnum 库位库存信息主键
  24. * @return 库位库存信息
  25. */
  26. List<InvLotLocId> selectInvLotLocIdByLotnum(String lotnum);
  27. /**
  28. * 查询库存根据lotnum和库位id
  29. *
  30. * @param lotnum
  31. * @param locationId
  32. * @return
  33. */
  34. InvLotLocId selectInvLotLocIdByKey(@Param("lotnum") String lotnum, @Param("locationId") String locationId, @Param("customerId") String customerId, @Param("sku") String sku);
  35. /**
  36. * 查询库存(根据主键)
  37. *
  38. * @param lotnum
  39. * @param sku
  40. * @param location
  41. * @param customerId
  42. * @return
  43. */
  44. InvLotLocId queryById(@Param("lotnum") String lotnum, @Param("sku") String sku, @Param("location") String location, @Param("customerId") String customerId);
  45. /**
  46. * 查询库位库存信息列表
  47. *
  48. * @param invLotLocId 库位库存信息
  49. * @return 库位库存信息集合
  50. */
  51. List<InvLotLocId> selectInvLotLocIdList(InvLotLocId invLotLocId);
  52. /**
  53. * 新增库位库存信息
  54. *
  55. * @param invLotLocId 库位库存信息
  56. * @return 结果
  57. */
  58. int insertInvLotLocId(InvLotLocId invLotLocId);
  59. /**
  60. * 修改库位库存信息
  61. *
  62. * @param invLotLocId 库位库存信息
  63. * @return 结果
  64. */
  65. int updateInvLotLocId(InvLotLocId invLotLocId);
  66. /**
  67. * 删除库位库存信息
  68. *
  69. * @param lotnum 库位库存信息主键
  70. * @return 结果
  71. */
  72. int deleteInvLotLocIdByLotnum(String lotnum);
  73. /**
  74. * 删除库位库存信息
  75. *
  76. * @param lotnum 库位库存信息主键
  77. * @return 结果
  78. */
  79. int deleteInvLotLocIdBy(@Param("lotnum") String lotnum, @Param("sku") String sku, @Param("locationId") String locationId, @Param("customerId") String customerId);
  80. /**
  81. * 批量删除库位库存信息
  82. *
  83. * @param lotnums 需要删除的数据主键集合
  84. * @return 结果
  85. */
  86. int deleteInvLotLocIdByLotnums(String[] lotnums);
  87. /**
  88. * 查询库位库存
  89. *
  90. * @param zoneId
  91. * @param sku
  92. * @param skuType
  93. * @param weight
  94. * @param supplier
  95. * @param lotattDTO
  96. * @return
  97. */
  98. List<BaseLocationLotattVO> selectInvLocationList(@Param("zoneId") Long zoneId, @Param("sku") String sku, @Param("skuType") String skuType, @Param("weight") Double weight, @Param("supplier") String supplier, @Param("lotattDTO") LotattDTO lotattDTO);
  99. /**
  100. * 根据sku和批次属性获取
  101. *
  102. * @param sku
  103. * @param skuType
  104. * @return
  105. */
  106. List<BaseLocationLotattVO> selectInvZoneBySkuLotatt(@Param("sku") String sku, @Param("skuType") String skuType, @Param("lotattDTO") LotattDTO lotattDTO);
  107. /**
  108. * 查询物料批次信息列表
  109. *
  110. * @param invLocIdSearchFrom
  111. * @return
  112. */
  113. List<InvLotLocIdLotattVO> selectInvLocIdLotattList(InvLocIdSearchFrom invLocIdSearchFrom);
  114. /**
  115. * @param locationId
  116. * @return
  117. */
  118. List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId);
  119. /**
  120. * 删除库位库存信息
  121. *
  122. * @param locationId 库位id
  123. * @return 结果
  124. */
  125. int deleteInvLotLocIdByLocationId(Long locationId);
  126. /**
  127. * 删除库位库存信息
  128. *
  129. * @param locationId
  130. * @param customerId
  131. * @param sku
  132. * @param lotnum
  133. * @return
  134. */
  135. int deleteInvLotLocIdByPrimaryKey(String locationId, String customerId, String sku, String lotnum);
  136. /**
  137. * 更新起始库位库存至目标库位
  138. *
  139. * @param locationFrom
  140. * @param locationTo
  141. * @return
  142. */
  143. int updateInvLotLocIdLocationId(@Param("locationFrom") Long locationFrom, @Param("locationTo") Long locationTo);
  144. /**
  145. * 根据库位移动库存
  146. * @param locationFrom
  147. * @param locationTo
  148. * @param traceid
  149. * @return
  150. */
  151. int moveInvByLocationId(@Param("locationFrom") Long locationFrom, @Param("locationTo") Long locationTo,@Param("traceid")String traceid);
  152. /**
  153. * 根据库位和traceid移动库存
  154. * @param locationFrom
  155. * @param locationTo
  156. * @param traceid
  157. * @return
  158. */
  159. int moveInvByTraceId(@Param("locationFrom") Long locationFrom, @Param("locationTo") Long locationTo,@Param("traceid")String traceid);
  160. /**
  161. * 更新起始库位库存至目标库位并区分托盘
  162. *
  163. * @param locationFrom
  164. * @param locationTo
  165. * @return
  166. */
  167. int updateInvLotLocIdLotnum(@Param("locationFrom") Long locationFrom, @Param("lotnum") String lotnum, @Param("locationTo") Long locationTo);
  168. /**
  169. * 根据托盘号将库存更新到目标库位
  170. *
  171. * @param lotnum
  172. * @param locationTo
  173. * @return
  174. */
  175. int updateInvLotLocIdToByLotnum(@Param("lotnum") String lotnum, @Param("locationTo") Long locationTo);
  176. /**
  177. * 清除库位库存信息
  178. *
  179. * @param locationId
  180. * @return
  181. */
  182. int clearInvByLocationId(@Param("locationId") Long locationId);
  183. /**
  184. * 根据物料查询库位库存信息
  185. *
  186. * @param sku
  187. * @param lotattDTO
  188. * @return
  189. */
  190. Double queryInvBySku(@Param("sku") String sku, @Param("lotattDTO") LotattDTO lotattDTO, @Param("zoneIdList") List<String> zoneIdList);
  191. /**
  192. * 根据物料库位查询库存
  193. *
  194. * @param sku
  195. * @param locationId
  196. * @param lotattDTO
  197. * @return
  198. */
  199. Double queryInvBySkuLocationId(@Param("sku") String sku, @Param("locationId") Long locationId, @Param("lotattDTO") LotattDTO lotattDTO);
  200. /**
  201. * 查询库存
  202. *
  203. * @param lotnum
  204. * @param sku
  205. * @param location
  206. * @param customerId
  207. * @return
  208. */
  209. List<InvLotLocId> queryInvOrderBy(@Param("lotnum") String lotnum, @Param("sku") String sku, @Param("location") String location, @Param("customerId") String customerId, @Param("lotattDTO") LotattDTO lotattDTO);
  210. /**
  211. * 根据托盘查询库存
  212. *
  213. * @param invLotAtt
  214. * @return
  215. */
  216. List<InvLotLocId> queryInvByInvLotatt(@Param("lotattDTO") InvLotAtt invLotAtt);
  217. /**
  218. * 根据托盘查询库存(带出批次)
  219. *
  220. * @param invLotAtt
  221. * @return
  222. */
  223. List<InvLotLocIdLotattVO> queryInvLotattByInvLotatt(@Param("lotattDTO") InvLotAtt invLotAtt);
  224. /**
  225. * 查询
  226. *
  227. * @return
  228. */
  229. List<InvLotLocId> queryInvByFull(@Param("orderNo") String orderNo, @Param("sku") String sku);
  230. /**
  231. * 解绑库存
  232. *
  233. * @param locationId
  234. * @param sku
  235. * @param customerId
  236. * @return
  237. */
  238. AjaxResult unlockInv(@Param("locationId") Long locationId, @Param("sku") String sku, @Param("customerId") String customerId);
  239. /**
  240. * 获取质检列表
  241. *
  242. * @return
  243. */
  244. List<InvLotLocIdLotattVO> getQualityInspectionList();
  245. /**
  246. * 获取质检库位列表根据批号
  247. *
  248. * @param lotNumber 批号
  249. * @return
  250. */
  251. List<InvLotLocIdLotattVO> getQualityLocationListByLotNumber(String lotNumber);
  252. /**
  253. * 修改质量状态根据批号
  254. *
  255. * @param lotNumber
  256. * @return
  257. */
  258. int updateQualityStatusByLotNumber(String lotNumber, String qualityStatus);
  259. /**
  260. * 根据托盘号和物料分类查询是否有相同的库存
  261. *
  262. * @param skuType
  263. * @param palletNo
  264. * @return
  265. */
  266. List<InvLotLocId> querySameTypeByPalletNo(@Param("skuType") String skuType, @Param("palletNo") String palletNo);
  267. /**
  268. * 根据sku和locationid查询库存(根据sku进行排序)
  269. *
  270. * @param sku
  271. * @param locationId
  272. * @return
  273. */
  274. List<InvLotLocId> selectInvLotLocIdBySkuLocationSort(@Param("sku") String sku, @Param("locationId") Long locationId);
  275. /**
  276. * 根据条件更新已分配数
  277. *
  278. * @param lotnum
  279. * @param locationId
  280. * @param qty
  281. * @return
  282. */
  283. int updateAllocationBy(@Param("lotnum") String lotnum, @Param("locationId") Long locationId, @Param("qty") BigDecimal qty);
  284. /**
  285. * 根据条件更新已分配数
  286. */
  287. int updateLocation(@Param("fromLocationId") Long fromLocationId, @Param("toLocationId") Long toLocationId);
  288. }