DepotItemService.java 9.7 KB

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