MaterialService.java 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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.dto.MaterialDto;
  6. import com.jsh.erp.datasource.entities.*;
  7. import com.jsh.erp.datasource.pda.dto.PDAInventoryDTO;
  8. import com.jsh.erp.datasource.pda.vo.PDADepotItemVO;
  9. import com.jsh.erp.datasource.vo.MaterialCurrentStock4SystemSku;
  10. import com.jsh.erp.datasource.pda.vo.PDATypeTree;
  11. import com.jsh.erp.datasource.vo.MaterialWarnListVo;
  12. import com.jsh.erp.datasource.vo.TaskStocktakingItemVO;
  13. import com.jsh.erp.utils.BaseResponseInfo;
  14. import org.springframework.transaction.annotation.Transactional;
  15. import org.springframework.web.multipart.MultipartFile;
  16. import javax.servlet.http.HttpServletRequest;
  17. import javax.servlet.http.HttpServletResponse;
  18. import java.math.BigDecimal;
  19. import java.util.List;
  20. import java.util.Map;
  21. public interface MaterialService extends IService<Material> {
  22. Material getMaterial(long id)throws Exception;
  23. List<Material> getMaterialListByIds(String ids)throws Exception;
  24. List<Material> getMaterial() throws Exception;
  25. /**
  26. * 查询商品管理-商品信息列表查询
  27. */
  28. List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
  29. String materialOther, String weight, String expiryNum, String enableSerialNumber,
  30. String enableBatchNumber, String position, String enabled, String remark, String categoryId,
  31. String mpList)
  32. throws Exception;
  33. /**
  34. * 新增商品
  35. * @param obj
  36. */
  37. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  38. int insertMaterial(MaterialDto obj, HttpServletRequest request)throws Exception;
  39. /**
  40. * 修改商品
  41. * @param obj
  42. */
  43. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  44. int updateMaterial(MaterialDto obj, HttpServletRequest request) throws Exception;
  45. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  46. int deleteMaterial(Long id, HttpServletRequest request)throws Exception;
  47. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  48. int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception;
  49. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  50. int batchDeleteMaterialByIds(String ids) throws Exception;
  51. int checkIsNameExist(Long id, String name)throws Exception;
  52. int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs,
  53. String otherField1, String otherField2, String otherField3, String unit, Long unitId)throws Exception;
  54. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  55. int batchSetStatus(Boolean status, String ids)throws Exception;
  56. Unit findUnit(Long mId)throws Exception;
  57. List<MaterialVo4Unit> findById(Long id)throws Exception;
  58. List<MaterialVo4Unit> findByIdWithBarCode(Long meId)throws Exception;
  59. List<Long> getListByParentId(Long parentId);
  60. List<Long> getIdListByParentId(List<Long> idList, Long parentId);
  61. JSONArray getMaterialByParam(String materialParam);
  62. List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color,
  63. String brand, String mfrs, String enableSerialNumber, String enableBatchNumber,
  64. Integer offset, Integer rows, Long depotId) throws Exception;
  65. int findBySelectWithBarCodeCount(Long categoryId, String q, String standardOrModel, String color,
  66. String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Long depotId) throws Exception;
  67. void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight,
  68. String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber,
  69. String remark, HttpServletResponse response)throws Exception;
  70. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  71. BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) throws Exception;
  72. void batchCheckExistMaterialListByParam(List<MaterialWithInitStock> mList, String name, String standard,
  73. String model, String color, String unit, String sku);
  74. void batchCheckExistBarCodeByParam(List<MaterialWithInitStock> mList,
  75. String barCode, String manyBarCode) throws Exception;
  76. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  77. void insertOrUpdateMaterialExtend(JSONObject materialExObj, String type, String defaultFlag, Long mId, User user) throws Exception;
  78. String getBasicBarCode(MaterialWithInitStock m);
  79. List<Material> getMaterialListByParam(String name, String standard, String model, String color, String unit, Long unitId, String basicBarCode) throws Exception;
  80. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  81. void insertCurrentStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock);
  82. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  83. void batchDeleteInitialStockByMaterialList(List<Long> mIdList);
  84. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  85. void batchDeleteCurrentStockByMaterialList(List<Long> mIdList);
  86. List<MaterialVo4Unit> getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows)throws Exception;
  87. Long getMaterialEnableSerialNumberCount(String q)throws Exception;
  88. BigDecimal parseBigDecimalEx(String str) throws Exception;
  89. BigDecimal parsePrice(String price, String ratio) throws Exception;
  90. BigDecimal getInitStockByMidAndDepotList(List<Long> depotList, Long materialId);
  91. BigDecimal getInitStock(Long materialId, Long depotId);
  92. BigDecimal getCurrentStockByMaterialIdAndDepotId(Long materialId, Long depotId);
  93. Map<Long,BigDecimal> getInitialStockMapByMaterialList(List<MaterialVo4Unit> list);
  94. Map<Long,BigDecimal> getCurrentStockMapByMaterialList(List<MaterialVo4Unit> list);
  95. /**
  96. * 根据商品和仓库获取安全库存信息
  97. * @param materialId 商品id
  98. * @param depotId 仓库id
  99. * @return
  100. */
  101. MaterialInitialStock getSafeStock(Long materialId, Long depotId);
  102. List<MaterialVo4Unit> getMaterialByMeId(Long meId);
  103. String getMaxBarCode();
  104. List<String> getMaterialNameList();
  105. List<MaterialVo4Unit> getMaterialByBarCode(String barCode);
  106. List<MaterialVo4Unit> getMaterialByBarCode(List<String> barCodeList);
  107. List<MaterialVo4Unit> getMaterialByBarCodeAndWithOutMId(String barCode, Long mId);
  108. List<MaterialInitialStockWithMaterial> getInitialStockWithMaterial(List<Long> depotList);
  109. List<MaterialVo4Unit> getListWithStock(List<Long> depotList, List<Long> idList, String position, String materialParam,
  110. Boolean moveAvgPriceFlag, Integer zeroStock, String column, String order,
  111. Integer offset, Integer rows) throws Exception;
  112. int getListWithStockCount(List<Long> depotList, List<Long> idList, String position, String materialParam, Integer zeroStock);
  113. MaterialVo4Unit getTotalStockAndPrice(List<Long> depotList, List<Long> idList, String position, String materialParam);
  114. String getBigUnitStock(BigDecimal stock, Long unitId) throws Exception;
  115. String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m);
  116. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  117. int batchSetMaterialCurrentStock(String ids) throws Exception;
  118. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  119. int batchSetMaterialCurrentUnitPrice(String ids) throws Exception;
  120. int batchUpdate(JSONObject jsonObject);
  121. MaterialExtend getMaterialExtendBySerialNumber(String serialNumber);
  122. List<TaskStocktakingItemVO> getMaterialByBatchNumber(String batchNumber);
  123. Material getMaterialById(Long id);
  124. List<MaterialVo4Unit> getMaterialBySystemSku(List<String> systemSkuList);
  125. List<MaterialCurrentStock4SystemSku> getMaterialCurrentPriceByIdList(List<Long> idList);
  126. /**
  127. * 获取商品提醒
  128. * @return
  129. */
  130. MaterialWarnListVo getMaterialWarn();
  131. /**
  132. * 导入商品信息
  133. * @param file excel表格
  134. * @return
  135. */
  136. BaseResponseInfo importExcelTwo(MultipartFile file, HttpServletRequest request) throws Exception;
  137. /**
  138. * PDA库存查询
  139. * pdaInventoryDTO
  140. * @return
  141. */
  142. List<PDADepotItemVO> inventoryInquiry(PDAInventoryDTO pdaInventoryDTO);
  143. /**
  144. * 根据库位查询商品id集合
  145. * @param position
  146. * @return
  147. */
  148. List<Long> selectMaterialIdByPosition(String position);
  149. /**
  150. * 根据类型id查询子类型集合
  151. * @param id 类型id
  152. * @return
  153. */
  154. List<Long> selectCategoryIds(Long id);
  155. /**
  156. * 查询库位树
  157. */
  158. List<PDATypeTree> selectPosition();
  159. /**
  160. * 获取仓库id、商品id获取商品库位信息
  161. * @param did 仓库id
  162. * @param mid 商品id
  163. * @return 库位
  164. */
  165. String getPositionByDidAndMid(Long did, Long mid);
  166. /**
  167. * 根据商品id查询商品库存
  168. * @param mid 商品id
  169. * @return 商品库存
  170. */
  171. BigDecimal getMaterialStockByMid(Long mid);
  172. }