package com.jsh.erp.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.datasource.entities.*; import com.jsh.erp.utils.BaseResponseInfo; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.util.List; import java.util.Map; public interface MaterialService { Material getMaterial(long id)throws Exception; List getMaterialListByIds(String ids)throws Exception; List getMaterial() throws Exception; List select(String materialParam, String standard, String model, String color, String brand, String mfrs, String materialOther, String weight, String expiryNum, String enableSerialNumber, String enableBatchNumber, String position, String enabled, String remark, String categoryId, String mpList) throws Exception; /** * 新增商品 * @param obj */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) int insertMaterial(JSONObject obj, HttpServletRequest request)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int updateMaterial(JSONObject obj, HttpServletRequest request) throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int deleteMaterial(Long id, HttpServletRequest request)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchDeleteMaterialByIds(String ids) throws Exception; int checkIsNameExist(Long id, String name)throws Exception; int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs, String otherField1, String otherField2, String otherField3, String unit, Long unitId)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchSetStatus(Boolean status, String ids)throws Exception; Unit findUnit(Long mId)throws Exception; List findById(Long id)throws Exception; List findByIdWithBarCode(Long meId)throws Exception; List getListByParentId(Long parentId); List getIdListByParentId(List idList, Long parentId); JSONArray getMaterialByParam(String materialParam); List findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color, String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Integer offset, Integer rows, Long depotId) throws Exception; int findBySelectWithBarCodeCount(Long categoryId, String q, String standardOrModel, String color, String brand, String mfrs, String enableSerialNumber, String enableBatchNumber, Long depotId) throws Exception; void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight, String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber, String remark, HttpServletResponse response)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) throws Exception; void batchCheckExistMaterialListByParam(List mList, String name, String standard, String model, String color, String unit, String sku); void batchCheckExistBarCodeByParam(List mList, String barCode, String manyBarCode) throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) void insertOrUpdateMaterialExtend(JSONObject materialExObj, String type, String defaultFlag, Long mId, User user) throws Exception; String getBasicBarCode(MaterialWithInitStock m); List getMaterialListByParam(String name, String standard, String model, String color, String unit, Long unitId, String basicBarCode) throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) void insertInitialStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock, BigDecimal lowSafeStock, BigDecimal highSafeStock); @Transactional(value = "transactionManager", rollbackFor = Exception.class) void insertCurrentStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock); @Transactional(value = "transactionManager", rollbackFor = Exception.class) void batchDeleteInitialStockByMaterialList(List mIdList); @Transactional(value = "transactionManager", rollbackFor = Exception.class) void batchDeleteCurrentStockByMaterialList(List mIdList); List getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows)throws Exception; Long getMaterialEnableSerialNumberCount(String q)throws Exception; BigDecimal parseBigDecimalEx(String str) throws Exception; BigDecimal parsePrice(String price, String ratio) throws Exception; BigDecimal getInitStockByMidAndDepotList(List depotList, Long materialId); BigDecimal getInitStock(Long materialId, Long depotId); BigDecimal getCurrentStockByMaterialIdAndDepotId(Long materialId, Long depotId); Map getInitialStockMapByMaterialList(List list); Map getCurrentStockMapByMaterialList(List list); MaterialInitialStock getSafeStock(Long materialId, Long depotId); List getMaterialByMeId(Long meId); String getMaxBarCode(); List getMaterialNameList(); List getMaterialByBarCode(String barCode); List getMaterialByBarCodeAndWithOutMId(String barCode, Long mId); List getInitialStockWithMaterial(List depotList); List getListWithStock(List depotList, List idList, String position, String materialParam, Boolean moveAvgPriceFlag, Integer zeroStock, String column, String order, Integer offset, Integer rows) throws Exception; int getListWithStockCount(List depotList, List idList, String position, String materialParam, Integer zeroStock); MaterialVo4Unit getTotalStockAndPrice(List depotList, List idList, String position, String materialParam); String getBigUnitStock(BigDecimal stock, Long unitId) throws Exception; String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m); @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchSetMaterialCurrentStock(String ids) throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchSetMaterialCurrentUnitPrice(String ids) throws Exception; int batchUpdate(JSONObject jsonObject); MaterialExtend getMaterialExtendBySerialNumber(String serialNumber); List getMaterialByBatchNumber(String batchNumber); Material getMaterialById(Long id); }