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.dto.MaterialQueryDTO; 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.MaterialAndExtendVo; 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.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 materialOther, String weight, String expiryNum, String enableSerialNumber, String enabled, String remark, String categoryId, String mpList, String reminder); /** * 新增商品 * @param materialDTO */ boolean insertMaterial(MaterialDTO materialDTO, HttpServletRequest request); /** * 修改商品 * @param materialDTO */ boolean updateMaterial(MaterialDTO materialDTO, HttpServletRequest request); /** * 删除商品 * @param id 商品id */ int deleteMaterial(Long id, HttpServletRequest request)throws Exception; @Transactional(value = "transactionManager", rollbackFor = Exception.class) int batchDeleteMaterial(String ids, HttpServletRequest request)throws Exception; /** * 根据id集合批量删除商品 * @param ids */ 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; /** * 批量设置状态-启用或者禁用 */ 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); /** * 商品选择-查找商品信息 * @param categoryId * @param q * @param standardOrModel * @param color * @param brand * @param mfrs * @param enableSerialNumber * @param enableBatchNumber * @param offset * @param rows * @param depotId * @return * @throws Exception */ 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; /** * 商品选择-查找商品信息 按sku分类 * @param offset * @param rows * @return * @throws Exception */ List findBySelectWithSku(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; /** * 商品选择-查找商品数量 按sku分类 */ int findBySelectWithSkuCount(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); /** * 根据sku查询商品信息 * @param sku 商品sku */ List getMaterialBySku(String sku); 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; /** * 批量编辑 * @param jsonObject */ int batchUpdate(JSONObject jsonObject); MaterialExtend getMaterialExtendBySerialNumber(String serialNumber); /** * 根据商品id查询主表及子表信息 */ 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); /** * 根据库位查询商品id集合 * @param position * @return */ List selectMaterialIdByPosition(String position); /** * 根据类型id查询子类型集合 * @param id 类型id * @return */ List selectCategoryIds(Long id); /** * 查询库位树 */ List selectPosition(Long depotId); /** * 获取仓库id、商品id获取商品库位信息 * @param did 仓库id * @param mid 商品id * @return 库位 */ String getPositionByDidAndMid(Long did, Long mid); /** * 根据商品id查询商品库存 * @param mid 商品id * @return 商品库存 */ BigDecimal getMaterialStockByMid(Long mid); /** * 根据商品id和仓库id查询商品当前库存 * @param mid 商品id * @param did 仓库id * @return 商品库存 */ BigDecimal getMaterialStockByMidAndDid(Long mid,Long did); }