DepotItemService.java 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. package com.jsh.erp.service;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.baomidou.mybatisplus.extension.service.IService;
  5. import com.jsh.erp.datasource.entities.*;
  6. import com.jsh.erp.datasource.pda.vo.PDADepotItemVO;
  7. import com.jsh.erp.datasource.vo.DepotHeadXsddRequestVO;
  8. import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
  9. import com.jsh.erp.datasource.vo.DepotItemVoBatchNumberList;
  10. import com.jsh.erp.datasource.vo.DepotItemXsddRequestVO;
  11. import com.jsh.erp.datasource.vo.InOutPriceVo;
  12. import org.springframework.transaction.annotation.Transactional;
  13. import javax.servlet.http.HttpServletRequest;
  14. import java.math.BigDecimal;
  15. import java.util.List;
  16. import java.util.Map;
  17. public interface DepotItemService extends IService<DepotItem> {
  18. /**
  19. * pda根据订单信息查询商品列表
  20. * @return
  21. */
  22. List<PDADepotItemVO> pdaList(Long id);
  23. /**
  24. * pda根据商品订单ID查询商品详情
  25. * @param id 商品订单ID
  26. * @return
  27. */
  28. PDADepotItemVO pdaDetail(Long id);
  29. /**
  30. * 商品库存详情列表
  31. * @param materialId 商品ID
  32. * @return
  33. */
  34. List<PDADepotItemVO> materialDepotDetail(String type, Long materialId);
  35. DepotItem getDepotItem(long id)throws Exception;
  36. List<DepotItem> getDepotItem()throws Exception;
  37. List<DepotItem> select(String name, Integer type, String remark, int offset, int rows)throws Exception;
  38. Long countDepotItem(String name, Integer type, String remark) throws Exception;
  39. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  40. int insertDepotItem(JSONObject obj, HttpServletRequest request)throws Exception;
  41. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  42. int updateDepotItem(JSONObject obj, HttpServletRequest request)throws Exception;
  43. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  44. int deleteDepotItem(Long id, HttpServletRequest request)throws Exception;
  45. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  46. int batchDeleteDepotItem(String ids, HttpServletRequest request)throws Exception;
  47. int checkIsNameExist(Long id, String name)throws Exception;
  48. List<DepotItemVo4DetailByTypeAndMId> findDetailByDepotIdsAndMaterialIdList(String depotIds, Boolean forceFlag, Boolean inOutManageFlag, String sku, String batchNumber,
  49. String number, String beginTime, String endTime, Long mId, Integer offset, Integer rows)throws Exception;
  50. Long findDetailByDepotIdsAndMaterialIdCount(String depotIds, Boolean forceFlag, Boolean inOutManageFlag, String sku, String batchNumber,
  51. String number, String beginTime, String endTime, Long mId)throws Exception;
  52. /**
  53. * 插入单据子表
  54. * @param depotItem 单据子表
  55. */
  56. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  57. int insertDepotItemWithObj(DepotItem depotItem)throws Exception;
  58. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  59. int updateDepotItemWithObj(DepotItem depotItem)throws Exception;
  60. List<DepotItem> getListByHeaderId(Long headerId)throws Exception;
  61. DepotItem getItemByHeaderIdAndMaterial(Long headerId, Long meId)throws Exception;
  62. DepotItem getPreItemByHeaderIdAndMaterial(String linkStr, Long meId, Long linkId)throws Exception;
  63. List<DepotItemVo4WithInfoEx> getDetailList(Long headerId)throws Exception;
  64. List<DepotItemVo4WithInfoEx> getInOutStock(String materialParam, List<Long> categoryIdList, String endTime, Integer offset, Integer rows)throws Exception;
  65. int getInOutStockCount(String materialParam, List<Long> categoryIdList, String endTime)throws Exception;
  66. List<DepotItemVo4WithInfoEx> getListWithBuyOrSale(String materialParam, String billType,
  67. String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception;
  68. int getListWithBuyOrSaleCount(String materialParam, String billType,
  69. String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag)throws Exception;
  70. BigDecimal buyOrSale(String type, String subType, Long MId, String beginTime, String endTime,
  71. String[] creatorArray, Long organId, String[] organArray, List<Long> depotList, Boolean forceFlag, String sumType) throws Exception;
  72. BigDecimal buyOrSalePriceTotal(String type, String subType, String materialParam, String beginTime, String endTime,
  73. String[] creatorArray, Long organId, String[] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag) throws Exception;
  74. List<InOutPriceVo> inOrOutPriceList(String beginTime, String endTime) throws Exception;
  75. /**
  76. * 保存单据子表信息
  77. * @param rows 子表信息
  78. * @param headerId 主表id
  79. * @param actionType 操作类型
  80. */
  81. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  82. void saveDetials(String rows, Long headerId, String actionType, HttpServletRequest request) throws Exception;
  83. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  84. void saveOrderItem(DepotHeadXsddRequestVO order, List<DepotItemXsddRequestVO> itemList) throws Exception;
  85. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  86. String getBillStatusByParam(DepotHead depotHead, String linkStr, String linkType);
  87. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  88. void changeBillStatus(String linkStr, String billStatus);
  89. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  90. void changeBillPurchaseStatus(String linkStr, String billStatus);
  91. DepotItem getDepotItemByBatchNumber(Long materialExtendId, String batchNumber);
  92. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  93. void deleteDepotItemHeadId(Long headerId)throws Exception;
  94. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  95. void deleteOrCancelSerialNumber(String actionType, DepotHead depotHead, Long headerId) throws Exception;
  96. void checkAssembleWithMaterialType(JSONArray rowArr, String subType);
  97. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  98. void updateMaterialExtendPrice(Long meId, String subType, String billType, JSONObject rowObj) throws Exception;
  99. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  100. List<DepotItemStockWarningCount> findStockWarningCount(Integer offset, Integer rows, String materialParam, List<Long> depotList, List<Long> categoryList);
  101. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  102. int findStockWarningCountTotal(String materialParam, List<Long> depotList, List<Long> categoryList);
  103. BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime) throws Exception;
  104. BigDecimal getStockByParam(Long depotId, Long mId, String beginTime, String endTime) throws Exception;
  105. BigDecimal getStockByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception;
  106. Map<String, BigDecimal> getIntervalMapByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception;
  107. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  108. void updateCurrentStock(DepotItem depotItem) throws Exception;
  109. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  110. void updateCurrentUnitPrice(DepotItem depotItem) throws Exception;
  111. /**
  112. * 根据商品id、仓库id更新当前库存
  113. * @param mId 商品id
  114. * @param dId 仓库id
  115. */
  116. void updateCurrentStockFun(Long mId, Long dId) throws Exception;
  117. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  118. BigDecimal getFinishNumber(Long meId, Long id, Long headerId, Unit unitInfo, String materialUnit, String linkType);
  119. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  120. BigDecimal getRealFinishNumber(String currentSubType, Long meId, Long linkId, Long preHeaderId, Long currentHeaderId, Unit unitInfo, String materialUnit);
  121. List<DepotItemVoBatchNumberList> getBatchNumberList(String number, String name, Long depotId, String barCode,
  122. String batchNumber, Boolean forceFlag, Boolean inOutManageFlag) throws Exception;
  123. BigDecimal getOneBatchNumberStock(Long depotId, String barCode, String batchNumber) throws Exception;
  124. Long getCountByMaterialAndDepot(Long mId, Long depotId);
  125. /**
  126. * 解析excel表格数据
  127. * @param batchNumbers 批次号
  128. * @param detailList 数据明细
  129. * @param prefixNo 单据类型
  130. */
  131. JSONObject parseMapByExcelData(String batchNumbers, List<Map<String, String>> detailList, String prefixNo) throws Exception;
  132. BigDecimal getLastUnitPriceByParam(Long organId, Long meId, String prefixNo);
  133. BigDecimal getCurrentStockByParam(Long depotId, Long mId);
  134. String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx)throws Exception;
  135. }