MaterialService.java 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. package com.jsh.erp.service;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.jsh.erp.datasource.entities.*;
  5. import com.jsh.erp.utils.BaseResponseInfo;
  6. import org.springframework.transaction.annotation.Transactional;
  7. import org.springframework.web.multipart.MultipartFile;
  8. import javax.servlet.http.HttpServletRequest;
  9. import javax.servlet.http.HttpServletResponse;
  10. import java.math.BigDecimal;
  11. import java.util.List;
  12. import java.util.Map;
  13. public interface MaterialService {
  14. Material getMaterial(long id)throws Exception;
  15. List<Material> getMaterialListByIds(String ids)throws Exception;
  16. List<Material> getMaterial() throws Exception;
  17. List<MaterialVo4Unit> select(String materialParam, String standard, String model, String color, String brand, String mfrs,
  18. String materialOther, String weight, String expiryNum, String enableSerialNumber,
  19. String enableBatchNumber, String position, String enabled, String remark, String categoryId,
  20. String mpList)
  21. throws Exception;
  22. /**
  23. * 新增商品
  24. * @param obj
  25. */
  26. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  27. int insertMaterial(JSONObject obj, HttpServletRequest request)throws Exception;
  28. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  29. int updateMaterial(JSONObject obj, HttpServletRequest request) throws Exception;
  30. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  31. int deleteMaterial(Long id, HttpServletRequest request)throws Exception;
  32. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  33. int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception;
  34. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  35. int batchDeleteMaterialByIds(String ids) throws Exception;
  36. int checkIsNameExist(Long id, String name)throws Exception;
  37. int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs,
  38. String otherField1, String otherField2, String otherField3, String unit, Long unitId)throws Exception;
  39. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  40. int batchSetStatus(Boolean status, String ids)throws Exception;
  41. Unit findUnit(Long mId)throws Exception;
  42. List<MaterialVo4Unit> findById(Long id)throws Exception;
  43. List<MaterialVo4Unit> findByIdWithBarCode(Long meId)throws Exception;
  44. List<Long> getListByParentId(Long parentId);
  45. List<Long> getIdListByParentId(List<Long> idList, Long parentId);
  46. JSONArray getMaterialByParam(String materialParam);
  47. List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color,
  48. String brand, String mfrs, String enableSerialNumber, String enableBatchNumber,
  49. Integer offset, Integer rows, Long depotId) throws Exception;
  50. int findBySelectWithBarCodeCount(Long categoryId, String q, String standardOrModel, String color,
  51. String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Long depotId) throws Exception;
  52. void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight,
  53. String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber,
  54. String remark, HttpServletResponse response)throws Exception;
  55. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  56. BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) throws Exception;
  57. void batchCheckExistMaterialListByParam(List<MaterialWithInitStock> mList, String name, String standard,
  58. String model, String color, String unit, String sku);
  59. void batchCheckExistBarCodeByParam(List<MaterialWithInitStock> mList,
  60. String barCode, String manyBarCode) throws Exception;
  61. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  62. void insertOrUpdateMaterialExtend(JSONObject materialExObj, String type, String defaultFlag, Long mId, User user) throws Exception;
  63. String getBasicBarCode(MaterialWithInitStock m);
  64. List<Material> getMaterialListByParam(String name, String standard, String model, String color, String unit, Long unitId, String basicBarCode) throws Exception;
  65. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  66. void insertInitialStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock, BigDecimal lowSafeStock, BigDecimal highSafeStock);
  67. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  68. void insertCurrentStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock);
  69. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  70. void batchDeleteInitialStockByMaterialList(List<Long> mIdList);
  71. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  72. void batchDeleteCurrentStockByMaterialList(List<Long> mIdList);
  73. List<MaterialVo4Unit> getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows)throws Exception;
  74. Long getMaterialEnableSerialNumberCount(String q)throws Exception;
  75. BigDecimal parseBigDecimalEx(String str) throws Exception;
  76. BigDecimal parsePrice(String price, String ratio) throws Exception;
  77. BigDecimal getInitStockByMidAndDepotList(List<Long> depotList, Long materialId);
  78. BigDecimal getInitStock(Long materialId, Long depotId);
  79. BigDecimal getCurrentStockByMaterialIdAndDepotId(Long materialId, Long depotId);
  80. Map<Long,BigDecimal> getInitialStockMapByMaterialList(List<MaterialVo4Unit> list);
  81. Map<Long,BigDecimal> getCurrentStockMapByMaterialList(List<MaterialVo4Unit> list);
  82. MaterialInitialStock getSafeStock(Long materialId, Long depotId);
  83. List<MaterialVo4Unit> getMaterialByMeId(Long meId);
  84. String getMaxBarCode();
  85. List<String> getMaterialNameList();
  86. List<MaterialVo4Unit> getMaterialByBarCode(String barCode);
  87. List<MaterialVo4Unit> getMaterialByBarCodeAndWithOutMId(String barCode, Long mId);
  88. List<MaterialInitialStockWithMaterial> getInitialStockWithMaterial(List<Long> depotList);
  89. List<MaterialVo4Unit> getListWithStock(List<Long> depotList, List<Long> idList, String position, String materialParam,
  90. Boolean moveAvgPriceFlag, Integer zeroStock, String column, String order,
  91. Integer offset, Integer rows) throws Exception;
  92. int getListWithStockCount(List<Long> depotList, List<Long> idList, String position, String materialParam, Integer zeroStock);
  93. MaterialVo4Unit getTotalStockAndPrice(List<Long> depotList, List<Long> idList, String position, String materialParam);
  94. String getBigUnitStock(BigDecimal stock, Long unitId) throws Exception;
  95. String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m);
  96. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  97. int batchSetMaterialCurrentStock(String ids) throws Exception;
  98. @Transactional(value = "transactionManager", rollbackFor = Exception.class)
  99. int batchSetMaterialCurrentUnitPrice(String ids) throws Exception;
  100. int batchUpdate(JSONObject jsonObject);
  101. MaterialExtend getMaterialExtendBySerialNumber(String serialNumber);
  102. List<MaterialVo4Unit> getMaterialByBatchNumber(String batchNumber);
  103. Material getMaterialById(Long id);
  104. }