package com.jsh.erp.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.IService; import com.jsh.erp.datasource.dto.MaterialDto; import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.pda.dto.PDAInventoryDTO; import com.jsh.erp.datasource.pda.vo.PDADepotItemVO; import com.jsh.erp.datasource.vo.MaterialCurrentStock4SystemSku; import com.jsh.erp.datasource.pda.vo.PDATypeTree; import com.jsh.erp.datasource.vo.MaterialWarnListVo; import com.jsh.erp.datasource.vo.TaskStocktakingItemVO; 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 extends IService { 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(MaterialDto obj, HttpServletRequest request)throws Exception; /** * 修改商品 * @param obj */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) int updateMaterial(MaterialDto 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 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); /** * 根据商品和仓库获取安全库存信息 * @param materialId 商品id * @param depotId 仓库id * @return */ MaterialInitialStock getSafeStock(Long materialId, Long depotId); List getMaterialByMeId(Long meId); String getMaxBarCode(); List getMaterialNameList(); List getMaterialByBarCode(String barCode); List getMaterialByBarCode(List barCodeList); 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); List getMaterialBySystemSku(List systemSkuList); List getMaterialCurrentPriceByIdList(List idList); /** * 获取商品提醒 * @return */ MaterialWarnListVo getMaterialWarn(); /** * 导入商品信息 * @param file excel表格 * @return */ BaseResponseInfo importExcelTwo(MultipartFile file, HttpServletRequest request) throws Exception; /** * PDA库存查询 * pdaInventoryDTO * @return */ List inventoryInquiry(PDAInventoryDTO pdaInventoryDTO) throws Exception; /** * 查询库位树 */ List selectPosition(); /** * 获取仓库id、商品id获取商品库位信息 * @param did 仓库id * @param mid 商品id * @return 库位 */ String getPositionByDidAndMid(Long did, Long mid); /** * 根据商品id查询商品库存 * @param mid 商品id * @return 商品库存 */ BigDecimal getMaterialStockByMid(Long mid); }