Просмотр исходного кода

删除原先的出入库的逻辑

yujia 7 лет назад
Родитель
Сommit
2e995467b5
31 измененных файлов с 30 добавлено и 4503 удалено
  1. 0 6
      src/main/java/com/uas/platform/b2c/common/search/controller/SearcherController.java
  2. 0 12
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java
  3. 0 172
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductImportHistController.java
  4. 0 125
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductStandardPutOnInfoController.java
  5. 0 60
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/StockInOutHistController.java
  6. 0 70
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductImportHistDao.java
  7. 0 54
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductStandardPutOnInfoDao.java
  8. 0 16
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductStandardPutOnInfoHistoryDao.java
  9. 0 39
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/StockInOutHistDao.java
  10. 0 31
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/ProductImportHistFacade.java
  11. 0 29
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/ProductStandardPutOnInfoFacade.java
  12. 0 22
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/StockInOutHistFacade.java
  13. 0 231
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductImportHistFacadeImpl.java
  14. 0 285
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductStandardPutOnInfoFacadeImpl.java
  15. 0 143
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/StockInOutHistFacadeImpl.java
  16. 0 35
      src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java
  17. 0 401
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductImportHist.java
  18. 0 181
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductImportHistItem.java
  19. 0 751
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductStandardPutOnInfo.java
  20. 0 515
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductStandardPutOnInfoHistory.java
  21. 0 273
      src/main/java/com/uas/platform/b2c/prod/commodity/model/StockInOutHist.java
  22. 1 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java
  23. 0 53
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductImportHistService.java
  24. 0 26
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  25. 0 115
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java
  26. 0 36
      src/main/java/com/uas/platform/b2c/prod/commodity/service/StockInOutHistService.java
  27. 29 87
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  28. 0 122
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductImportHistServiceImpl.java
  29. 0 169
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  30. 0 391
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductStandardPutOnInfoServiceImpl.java
  31. 0 52
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/StockInOutHistServiceImpl.java

+ 0 - 6
src/main/java/com/uas/platform/b2c/common/search/controller/SearcherController.java

@@ -3,11 +3,9 @@ package com.uas.platform.b2c.common.search.controller;
 import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.common.search.dao.SearchHistoryDao;
 import com.uas.platform.b2c.common.search.model.SearchHistory;
-import com.uas.platform.b2c.common.search.rpc.service.SearchService;
 import com.uas.platform.b2c.common.search.service.SearcherService;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.StockInOutHistService;
 import com.uas.platform.b2c.prod.product.component.modal.ComponentInfo;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
@@ -68,9 +66,6 @@ public class SearcherController {
 	@Autowired
 	private GoodsService goodsService;
 
-	@Autowired
-	private StockInOutHistService stockInOutHistService;
-
 	@Autowired
 	private SearchHistoryDao searchHistoryDao;
 
@@ -466,7 +461,6 @@ public class SearcherController {
 			//暂时只显示有图片的产品信息
 			pageInfoCache.expression(PredicateUtils.isNotNull("img"));
 			flag2.add(goodsService.pageCommoditiesByEnInfos(storeIn.getUuid(),null,null,pageInfoCache));
-			flag3.add(stockInOutHistService.getCountByenuuAndIoSellerType(storeIn.getEnUU(),1668));
 		}
 		return result;
 	}

+ 0 - 12
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java

@@ -244,18 +244,6 @@ public class ProductController {
 		return productService.matchall(type);
 	}
 
-    /**
-     * 更新物料信息(品牌、物料名称(类目),型号、规格、规格书)
-     *
-     * @param product the product 修改的产品
-     * @return the string
-     * @Param product
-     */
-    @RequestMapping(value = "/update", method = RequestMethod.POST)
-	public String updateProduct(@RequestBody Product product){
-		return productService.updateProduct(product);
-	}
-
 	/**
 	 * 一键匹配物料信息
 	 *

+ 0 - 172
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductImportHistController.java

@@ -1,172 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.controller;
-
-import com.alibaba.fastjson.JSONArray;
-import com.uas.platform.b2c.prod.commodity.facade.ProductImportHistFacade;
-import com.uas.platform.b2c.prod.commodity.service.ProductImportHistService;
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHist;
-import com.uas.platform.b2c.common.base.model.FileUpload;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.support.view.JxlsExcelView;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.PageParams;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 产品导入控制器
- * @author  yuj
- * @version 2017年8月3日11:37:06 yuj 增加注释
- */
-@RestController
-@RequestMapping("/trade/productImport")
-public class ProductImportHistController {
-
-    private final ProductImportHistFacade productImportHistFacade;
-
-    private final ProductImportHistService productImportHistService;
-
-    /**
-     * Instantiates a new Product import hist controller.
-     *
-     * @param productImportHistFacade  the product import hist facade
-     * @param productImportHistService the product import hist service
-     */
-    @Autowired
-    public ProductImportHistController(ProductImportHistFacade productImportHistFacade, ProductImportHistService productImportHistService) {
-        this.productImportHistFacade = productImportHistFacade;
-        this.productImportHistService = productImportHistService;
-    }
-
-
-    /**
-     * 产品导入的模板
-     *
-     * @return model and view
-     */
-    @RequestMapping(value = "/import/template", method = RequestMethod.GET)
-    public ModelAndView productImport() {
-        ModelAndView modelAndView = new ModelAndView();
-        modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/product/product-import", "优软商城产品导入"));
-        return modelAndView;
-    }
-
-    /**
-     * 通过Excel导入产品
-     *
-     * @param uploadItem the upload item 上传的文件
-     * @return result map
-     */
-    @RequestMapping(value = "/import/upload", method = RequestMethod.POST)
-    public ResultMap productImportByExcel(FileUpload uploadItem) {
-        ResultMap resultMap = null;
-        String fileName = uploadItem.getFile().getOriginalFilename();
-        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
-        InputStream is = null;
-        Workbook workbook = null;
-        try {
-            is = uploadItem.getFile().getInputStream();
-            switch (suffix) {
-                case "xls":
-                    workbook = new HSSFWorkbook(is);
-                    break;
-                case "xlsx":
-                    workbook = new XSSFWorkbook(is);
-                    break;
-                default:
-                    resultMap = new ResultMap(CodeType.NOT_PERMIT, "文件格不正确,请上传.xls或.xlsx的文件");
-            }
-            if(workbook != null) {
-                resultMap = productImportHistFacade.productImportByExcel(workbook);
-            }
-        } catch (IOException e) {
-            resultMap = new ResultMap(CodeType.SYSTEM_ERROR, e.getMessage());
-            e.printStackTrace();
-        }
-        return resultMap;
-    }
-
-
-    /**
-     * 分页获取 ProductImportHist
-     *
-     * @param params    分页的参数信息
-     * @param status    状态的信息
-     * @param uploadNum the upload num
-     * @return 一页的数据 product import info by page and status
-     */
-    @RequestMapping(value = "/page", method = RequestMethod.GET)
-    public Page<ProductImportHist> getProductImportInfoByPageAndStatus(PageParams params, String status, String uploadNum) {
-        return productImportHistService.getProductImportInfoByPageAndStatus(params, status, uploadNum);
-    }
-
-    /**
-     * 匹配失败的器件更新匹配结果。
-     *
-     * @param json the json 更新的信息
-     * @return result map
-     */
-    @RequestMapping(value = "/failure/update", method = RequestMethod.PUT)
-    public ResultMap updateFailureMatch(@RequestBody String json) {
-        JSONArray array = FastjsonUtils.fromJson(json, JSONArray.class);
-        return productImportHistFacade.updateFailureMatchResolveJsonArray(array);
-    }
-
-    /**
-     * 将产品导入到标准或者非标仓库
-     *
-     * @param uploadNum the upload num 上传编号
-     * @return ResultMap result map
-     */
-    @RequestMapping(value = "/import/repository", method = RequestMethod.POST)
-    public ResultMap importToProRepository(String uploadNum) {
-        return productImportHistService.importToProRepository(uploadNum);
-    }
-
-    /**
-     * 导出导入失败的数据
-     *
-     * @param uploadNum the upload num  上传号
-     * @param request   the request 请求对象
-     * @param isAjax    the is ajax 是否是ajax请求
-     * @return model and view
-     */
-    @RequestMapping(value = "/failure/xls", method = RequestMethod.GET)
-    public ModelAndView exportProductImportError(String uploadNum, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax) {
-        ModelAndView modelAndView = new ModelAndView();
-        HttpSession session = request.getSession();
-        Object loading = session.getAttribute("load-error-ing");
-        if(isAjax) {
-            MappingJackson2JsonView view = new MappingJackson2JsonView();
-            Map attributes = new HashMap();
-            if(loading == null || !Boolean.valueOf(loading.toString())) {
-                attributes.put("load", false);
-            }else if(Boolean.valueOf(loading.toString())){
-                attributes.put("load", true);
-            }
-            view.setAttributesMap(attributes);
-            modelAndView.setView(view);
-            return modelAndView;
-        }
-        if(loading == null || !Boolean.valueOf(loading.toString())) {
-            session.setAttribute("load-error-ing", true);
-        }
-        modelAndView.addObject("data", productImportHistService.exportProductImportError(uploadNum));
-        modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/product/product-import-error", "优软商城导入失败产品"));
-        session.setAttribute("load-error-ing", false);
-        return modelAndView;
-    }
-}

+ 0 - 125
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductStandardPutOnInfoController.java

@@ -1,125 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.controller;
-
-import com.uas.platform.b2c.prod.commodity.facade.ProductStandardPutOnInfoFacade;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.core.support.view.JxlsExcelView;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.PageParams;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 标准上架信息控制器
- * @author yuj
- * @version 2017年8月3日11:38:45 yuj  增加注释
- */
-@RestController
-@RequestMapping(value = "/trade/prodStandPutOnInfo")
-public class ProductStandardPutOnInfoController {
-
-    private final ProductStandardPutOnInfoService productStandardPutOnInfoService;
-
-    private final ProductStandardPutOnInfoFacade standardPutOnInfoFacade;
-
-    /**
-     * Instantiates a new Product standard put on info controller.
-     *
-     * @param productStandardPutOnInfoService the product standard put on info service
-     * @param standardPutOnInfoFacade         the standard put on info facade
-     */
-    @Autowired
-    public ProductStandardPutOnInfoController(ProductStandardPutOnInfoService productStandardPutOnInfoService, ProductStandardPutOnInfoFacade standardPutOnInfoFacade) {
-        this.productStandardPutOnInfoService = productStandardPutOnInfoService;
-        this.standardPutOnInfoFacade = standardPutOnInfoFacade;
-    }
-
-
-    /**
-     * 获取信息
-     *
-     * @param params  the params 一页数据
-     * @param keyword the keyword 搜索关键字
-     * @return the product standard put on info by page
-     */
-    @RequestMapping(value = "/page", method = RequestMethod.GET)
-    public Page<ProductStandardPutOnInfo> getProductStandardPutOnInfoByPage(PageParams params, String keyword) {
-        return productStandardPutOnInfoService.getProductStandardPutOnInfoByPage(params, keyword);
-    }
-
-    /**
-     * 一键更新标准上架信息,将可上架数变为在售数量
-     *
-     * @return result map
-     */
-    @RequestMapping(value = "/update/availableToSale/batch", method = RequestMethod.PUT)
-    public ResultMap updateProductStandardPutOnInfoByBatch() {
-        return productStandardPutOnInfoService.updateProductStandardPutOnInfoByBatch();
-    }
-
-    /**
-     * 更新标准产品上架的信息
-     *
-     * @param productStandardPutOnInfo 标准的上架产品信息
-     * @return result map
-     */
-    @RequestMapping(value = "/update", method = RequestMethod.PUT)
-    public ResultMap updateProductStandardPutOnInfo(@RequestBody ProductStandardPutOnInfo productStandardPutOnInfo) {
-        return standardPutOnInfoFacade.updateProductStandardPutOnInfo(productStandardPutOnInfo);
-    }
-
-    /**
-     * 上架的动作
-     *
-     * @param productStandardPutOnInfo 标准的上架产品信息
-     * @return result map
-     */
-    @RequestMapping(value = "/puton", method = RequestMethod.POST)
-    public ResultMap productStandardPutOnInfoPutOn(@RequestBody ProductStandardPutOnInfo productStandardPutOnInfo)  {
-        return standardPutOnInfoFacade.productStandardPutOnInfoPutOn(productStandardPutOnInfo);
-    }
-
-
-    /**
-     * 导出信息
-     *
-     * @param isAjax  the is ajax 是否是ajax 请求
-     * @param request the request 请求对象
-     * @param keyword the keyword 搜索关键字
-     * @return the model and view
-     * @throws UnsupportedEncodingException the unsupported encoding exception
-     */
-    @RequestMapping(value = "/download/standardPutOn", method = RequestMethod.POST)
-    public ModelAndView exportProductsStandard(@RequestParam(required = false, value = "isAjax", defaultValue = "false")Boolean isAjax, HttpServletRequest request, @RequestParam("keyword") String keyword) throws UnsupportedEncodingException {
-        HttpSession session = request.getSession();
-        ModelAndView modelAndView = new ModelAndView();
-        Object loading = session.getAttribute("loading");
-        if(isAjax) {
-            MappingJackson2JsonView view = new MappingJackson2JsonView();
-            Map attributes = new HashMap();
-            Boolean isLoading= loading == Boolean.TRUE ? true : false;
-            attributes.put("loading", isLoading);
-            view.setAttributesMap(attributes);
-            modelAndView.setView(view);
-            return modelAndView;
-        }
-        session.setAttribute("loading", true);
-        List<ProductStandardPutOnInfo> standards = new ArrayList<ProductStandardPutOnInfo>();
-        standards = productStandardPutOnInfoService.getProductStandardPutOnInfo(keyword);
-        modelAndView.addObject("standards", standards);
-        modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/product/productStandarPutOn", "优软商城-标准上架信息"));
-        session.setAttribute("loading", false);
-        return modelAndView;
-    }
-}

+ 0 - 60
src/main/java/com/uas/platform/b2c/prod/commodity/controller/StockInOutHistController.java

@@ -1,60 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.controller;
-
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-import com.uas.platform.b2c.prod.commodity.facade.StockInOutHistFacade;
-import com.uas.platform.b2c.prod.commodity.service.StockInOutHistService;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- *
- * 出入库的历史记录 控制器
- * @author yuj
- * @version 2017年8月3日11:43:29 yuj 增加注释
- */
-@RestController
-@RequestMapping(value = "/trade/stockInOut")
-public class StockInOutHistController {
-
-    private final StockInOutHistService stockInOutHistService;
-
-    private final StockInOutHistFacade stockInOutHistFacade;
-
-    /**
-     * Instantiates a new Stock in out hist controller.
-     *
-     * @param stockInOutHistService the stock in out hist service
-     * @param stockInOutHistFacade  the stock in out hist facade
-     */
-    @Autowired
-    public StockInOutHistController(StockInOutHistService stockInOutHistService, StockInOutHistFacade stockInOutHistFacade) {
-        this.stockInOutHistService = stockInOutHistService;
-        this.stockInOutHistFacade = stockInOutHistFacade;
-    }
-
-    /**
-     * 保存出入库的历史记录
-     *
-     * @param isStockIn 是否是入库
-     * @param inOutHist 出入库信息
-     * @return result map
-     */
-    @RequestMapping(value = "/save", method = RequestMethod.POST)
-    public ResultMap saveStockInOut(@RequestParam("isStockIn") Boolean isStockIn, @RequestBody StockInOutHist inOutHist) {
-        return stockInOutHistFacade.save(inOutHist, isStockIn);
-    }
-
-    /**
-     * 根据产品编号获取历史的库存信息
-     *
-     * @param productId the product id 产品id
-     * @return stock
-     */
-    @RequestMapping(value = "/get/proId", method = RequestMethod.GET)
-    public List<StockInOutHist> getStockInOutHistById(@RequestParam(value = "productId") Long productId) {
-        return stockInOutHistService.getStockInOutHistByProdId(Long.valueOf(productId));
-    }
-}

+ 0 - 70
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductImportHistDao.java

@@ -1,70 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.dao;
-
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHist;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * 产品导入dao层
- *
- * @author yuj
- * @version 2017年8月3日13:47:42 yuj 增加注释
- */
-@Repository
-public interface ProductImportHistDao extends JpaRepository<ProductImportHist, Long>, JpaSpecificationExecutor<ProductImportHist> {
-
-    /**
-     * 产品导入之后的匹配方法
-     *
-     * @param uploadNum 本次上传的编号
-     * @param enuu      企业的uu
-     */
-//    @Procedure(procedureName = "PRODUCT$IMPORT$VALIDATE")
-//    void validProductImportInfo(String uploadNum, Long enuu);
-
-
-    /**
-     * 返回条数
-     *
-     * @param uploadNum 批次号
-     * @param status    状态list
-     * @return 本批次号 ,这几个状态的条数。
-     */
-    @Query("select count(p) from ProductImportHist p where p.uploadNum = :uploadNum and p.status in (:statuses)")
-    Integer getCountProductImport(@Param("uploadNum") String uploadNum, @Param("statuses") List<Integer> status);
-
-
-    /**
-     * 将产品导入到标准或者非标仓库
-     *
-     * @param uploadNum 本次导入的标准库
-     * @return Integer 导入的条数
-     */
-//    @Procedure(procedureName = "PRODUCT$IMPORT$REPOSITORY")
-//    Integer importToProRepository(String uploadNum);
-
-    /**
-     * 导出批次下的 指定状态的信息
-     *
-     * @param uploadNum the upload num
-     * @param status    the status
-     * @return product import hist by status
-     */
-    @Query("select p from ProductImportHist p where p.uploadNum =:uploadNum and p.status =:status")
-    List<ProductImportHist> getProductImportHistByStatus(@Param("uploadNum") String uploadNum, @Param("status") Integer status);
-
-    /**
-     * 导出批次下的 指定状态的信息
-     *
-     * @param uploadNum the upload num
-     * @param statuses  the statuses
-     * @return product import hist by statuses
-     */
-    @Query("select p from ProductImportHist p where p.uploadNum =:uploadNum and p.status in (:statuses)")
-    List<ProductImportHist> getProductImportHistByStatuses(@Param("uploadNum") String uploadNum, @Param("statuses") List<Integer> statuses);
-}

+ 0 - 54
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductStandardPutOnInfoDao.java

@@ -1,54 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.dao;
-
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * 标准上架信息dao层
- *
- * @author yuj
- * @version 2017年8月3日13:47:42 yuj 增加注释
- */
-@Repository
-public interface ProductStandardPutOnInfoDao extends JpaRepository<ProductStandardPutOnInfo, Long>, JpaSpecificationExecutor<ProductStandardPutOnInfo> {
-
-    /**
-     * 根据产品库的id获取信息
-     *
-     * @param productid the productid 器件的id
-     * @return the product standard put on info
-     */
-    public ProductStandardPutOnInfo findByProductid(Long productid);
-
-
-    /**
-     * Gets product standard put on info by enuu.
-     *
-     * @param enuu the enuu 企业enuu
-     * @return the product standard put on info by enuu
-     */
-    List<ProductStandardPutOnInfo> getProductStandardPutOnInfoByEnuu(Long enuu);
-
-    /**
-     * 根据批次号获取 ProductStandardPutOnInfo
-     *
-     * @param goBatch the go batch 批次号
-     * @return List<ProductStandardPutOnInfo> list
-     */
-    List<ProductStandardPutOnInfo> findProductStandardPutOnInfoByGoBatch(@Param("goBatch") String goBatch);
-
-    /**
-     * 根据器件型号、品牌、和企业的enuu查找标准产品信息
-     *
-     * @param cmpCode the cmp code 器件型号
-     * @param brandEn the brand en 品牌的名称
-     * @param enuu    the enuu 企业enuu
-     * @return list
-     */
-    List<ProductStandardPutOnInfo> findProductStandardPutOnInfoByCmpCodeAndBrandEnAndEnuu(String cmpCode, String brandEn, Long enuu);
-}

+ 0 - 16
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductStandardPutOnInfoHistoryDao.java

@@ -1,16 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.dao;
-
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfoHistory;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * 标准上架历史dao层
- *
- * @author yuj
- * @version 2017年8月3日13:47:42 yuj 增加注释
- */
-@Repository
-public interface ProductStandardPutOnInfoHistoryDao extends JpaSpecificationExecutor<ProductStandardPutOnInfoHistory>, JpaRepository<ProductStandardPutOnInfoHistory,Long> {
-}

+ 0 - 39
src/main/java/com/uas/platform/b2c/prod/commodity/dao/StockInOutHistDao.java

@@ -1,39 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.dao;
-
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * 出入库历史记录
- *
- * @author  yuj
- * @version 2017年8月3日13:47:42 yuj 增加注释
- */
-@Repository
-public interface StockInOutHistDao extends JpaRepository<StockInOutHist, Long>, JpaSpecificationExecutor<StockInOutHist> {
-
-    /**
-     * 根据 prodid找出入库历史记录
-     *
-     * @param prodid the prodid 产品的id
-     * @return list
-     */
-    List<StockInOutHist> findStockInOutHistByProdidOrderByOperateDateDesc(Long prodid);
-
-    /**
-     * 根据企业和类型统计该类型下的总量
-     * @param sellerenuu
-     * @param status
-     * @param storeid
-     * @return
-     */
-    @Query(nativeQuery = true , value = "select count(stock_qty) from trade$stock_in_out where stock_enuu = :enuu and stock_ioseller_type = :type")
-    int getCountByenuuAndIoSellerType(@Param("enuu") Long enuu, @Param("type") Integer type);
-
-}

+ 0 - 31
src/main/java/com/uas/platform/b2c/prod/commodity/facade/ProductImportHistFacade.java

@@ -1,31 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade;
-
-import com.alibaba.fastjson.JSONArray;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import org.apache.poi.ss.usermodel.Workbook;
-
-/**
- * ProductImportHist 的facade
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface ProductImportHistFacade {
-
-
-    /**
-     * 产品导入
-     *
-     * @param workbook 导入的文本
-     * @return ResultMap result map
-     */
-    ResultMap productImportByExcel(Workbook workbook);
-
-    /**
-     * 更新匹配失败的数据,解析数据
-     *
-     * @param array json 数组
-     * @return result map
-     */
-    ResultMap updateFailureMatchResolveJsonArray(JSONArray array);
-}

+ 0 - 29
src/main/java/com/uas/platform/b2c/prod/commodity/facade/ProductStandardPutOnInfoFacade.java

@@ -1,29 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade;
-
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.trade.support.ResultMap;
-
-/**
- * 标准上架的 facade
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface ProductStandardPutOnInfoFacade {
-
-    /**
-     * 用户更新标准上架的信息
-     *
-     * @param productStandardPutOnInfo 更新的信息
-     * @return result map
-     */
-    ResultMap updateProductStandardPutOnInfo(ProductStandardPutOnInfo productStandardPutOnInfo);
-
-    /**
-     * 标准产品上架的动作
-     *
-     * @param productStandardPutOnInfo 上架标准信息
-     * @return result map
-     */
-    ResultMap productStandardPutOnInfoPutOn(ProductStandardPutOnInfo productStandardPutOnInfo);
-}

+ 0 - 22
src/main/java/com/uas/platform/b2c/prod/commodity/facade/StockInOutHistFacade.java

@@ -1,22 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade;
-
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-import com.uas.platform.b2c.trade.support.ResultMap;
-
-/**
- * 出入库的facade
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface StockInOutHistFacade {
-
-    /**
-     * 保存出入库的记录
-     *
-     * @param inOutHist the in out hist 出入库信息
-     * @param isStockIn the is stock in 是否是入库
-     * @return the result map
-     */
-    ResultMap save(StockInOutHist inOutHist, Boolean isStockIn);
-}

+ 0 - 231
src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductImportHistFacadeImpl.java

@@ -1,231 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade.impl;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2c.prod.commodity.dao.ProductImportHistDao;
-import com.uas.platform.b2c.prod.commodity.facade.ProductImportHistFacade;
-import com.uas.platform.b2c.prod.commodity.service.ProductImportHistService;
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHist;
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHistItem;
-import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Created by yujia on 2017/7/7.
- */
-@Service
-public class ProductImportHistFacadeImpl implements ProductImportHistFacade {
-
-    private final CreateNumberService createNumberService;
-
-    private final ProductImportHistService productImportHistService;
-
-    private final ProductImportHistDao productImportHistDao;
-
-
-    @Autowired
-    public ProductImportHistFacadeImpl(CreateNumberService createNumberService, ProductImportHistService productImportHistService, ProductImportHistDao productImportHistDao) {
-        this.createNumberService = createNumberService;
-        this.productImportHistService = productImportHistService;
-        this.productImportHistDao = productImportHistDao;
-    }
-
-    /**
-     * 产品导入
-     *
-     * @param workbook 导入的文本
-     * @return ModelMap
-     */
-    @Override
-    public ResultMap productImportByExcel(Workbook workbook) {
-        Sheet sheet = workbook.getSheetAt(0);
-        int rowNum = sheet.getLastRowNum();
-        if(rowNum > 2000) {
-            throw new IllegalOperatorException
-                    ("您上传的信息超过了我们的设置2000条上限,请您控制上传的文件在2000条以内");
-        }
-        Row headerRow = sheet.getRow(0);
-        if(!validProductImportHeaderInfo(headerRow)) {
-            return new ResultMap(CodeType.PARAMETER_ERROR, "表头与模板中的表头不一致,请在模板中填写相应的数据");
-        }
-        SimpleDateFormat sdf = new SimpleDateFormat("HHmmss");
-        List<ProductImportHist> productImportHists = new ArrayList<>();
-        Long useruu = SystemSession.getUser().getUserUU();
-        Long enuu = SystemSession.getUser().getEnterprise().getUu();
-        String uploadNum = createNumberService.generateOrderNumber(EncodingRulesConstant.PRODUCT_IMPORT, "trade$product_import_hist", 8);
-        ProductImportHist hist = null;
-        for (int r = 1; r <= rowNum; r++) {
-            hist = new ProductImportHist();
-            Row row = sheet.getRow(r);
-            for (int i = 0; i < 4; i++) {
-                String value = null;
-                Cell cell = row.getCell(i);
-                if(cell != null) {
-                    cell.setCellType(Cell.CELL_TYPE_STRING);
-                    value = StringUtilB2C.trimString(cell.getStringCellValue().trim());
-                }
-                switch (i) {
-                    case 0:
-                        if(StringUtils.isEmpty(value)) {
-                            hist.setStatus(ProductImportHist.ProductImportStatus.INFO_PARTIAL.getCode());
-                            hist.addErrorMessage("1:缺少产品名称");
-                        }else {
-                            hist.setProdName(value);
-                        }
-                        break;
-                    case 1:
-                        if(StringUtils.isEmpty(value)) {
-                            hist.setStatus(ProductImportHist.ProductImportStatus.INFO_PARTIAL.getCode());
-                            hist.addErrorMessage("2:缺少器件名称");
-                        }else {
-                            hist.setProdCode(value);
-                        }
-                        break;
-                    case 2:
-                        if(StringUtils.isEmpty(value)) {
-                            hist.setStatus(ProductImportHist.ProductImportStatus.INFO_PARTIAL.getCode());
-                            hist.addErrorMessage("3:缺少品牌名称");
-                        }else {
-                            hist.setProdBrand(value);
-                        }
-                        break;
-                    case 3:
-                        hist.setProdEncapsulation(value);
-                        break;
-                }
-            }
-            if(hist.getStatus() == null) {
-                hist.setStatus(ProductImportHist.ProductImportStatus.INFO_COMPLETE.getCode());
-            }
-            hist.setUseruu(useruu);
-            hist.setEnuu(enuu);
-            hist.setUploadTime(new Date());
-            hist.setUpdateTime(new Date());
-            hist.setUploadNum(uploadNum);
-
-            String prodNum = createNumberService.generateOrderNumber(EncodingRulesConstant.PRODUCT_NUM, "trade$product_import_num", 8);
-            hist.setProdNum(prodNum);
-            productImportHists.add(hist);
-        }
-        if(CollectionUtils.isEmpty(productImportHists)) {
-            Map<String, Integer> map = new HashMap<>();
-            map.put("success", 0);
-            map.put("importError", 0);
-            map.put("all", rowNum);
-            return ResultMap.success(map);
-        }else {
-            Map<String, Object> map = productImportHistService.productImport(productImportHists);
-            map.put("all", rowNum);
-            return ResultMap.success(map);
-        }
-    }
-
-    /**
-     * 验证产品导入的表头
-     * @param headerRow
-     * @return true 表示与模板一致,false 表示与模板不一致
-     */
-    private boolean validProductImportHeaderInfo(Row headerRow) {
-        boolean result = true;
-        if(headerRow == null) {
-            result = false;
-        }else {
-            for (int i = 0 ; i < 4; i++) {
-                Cell cell = headerRow.getCell(i);
-                String value = cell.getStringCellValue();
-                switch (i) {
-                    case 0:
-                        result = "产品名称".equals(value) ? true : false;
-                        break;
-                    case 1:
-                        result = "产品型号".equals(value) ? true : false;
-                        break;
-                    case 2:
-                        result = "品牌英文名称".equals(value) ? true : false;
-                        break;
-                    case 3:
-                        result = "封装".equals(value) ? true : false;
-                        break;
-                }
-                if(!result) {
-                    return result;
-                }
-            }
-        }
-        return result;
-    }
-
-    /**
-     * 更新匹配失败的数据,解析数据
-     *
-     * @param array json 数组
-     * @return
-     */
-    @Override
-    public ResultMap updateFailureMatchResolveJsonArray(JSONArray array) {
-        List<ProductImportHist> list = new ArrayList<>();
-        Integer success = 0, failure = 0;
-        Map<String, Integer> map = new HashMap<>();
-        if(array.size() < 1) {
-            return ResultMap.success(map);
-        }
-        for (Object obj : array) {
-            JSONObject object = (JSONObject) obj;
-            Long masterid = object.getLong("masterid");
-            Long detailid = object.getLong("detailid");
-            //1:查看是否有值
-            if(masterid == null || detailid == null) {
-                continue;
-            }
-            ProductImportHist importHist = productImportHistDao.findOne(masterid);
-            //2:产看当前的状态是否是可操作的状态的
-            if(importHist.getStatus().intValue() != ProductImportHist.ProductImportStatus.INFO_BRAND_ISSUE.getCode()) {
-                failure++;
-                continue;
-            }
-            if(importHist != null) {
-                Set<ProductImportHistItem> histItems = importHist.getImportHistItems();
-                for (ProductImportHistItem item : histItems) {
-                    if(item.getId().longValue() == detailid.longValue()) {
-                        if(StringUtils.isEmpty(importHist.getProdEncapsulation())) {
-                            importHist.setProdEncapsulation(item.getEncapsulation());
-                        }
-                        importHist.setCmpuuid(item.getCmpUuid());
-                        importHist.setB2cCmpCode(item.getCmpCode());
-                        importHist.setB2cBrandCn(item.getBrandCn());
-                        importHist.setB2cBrandEn(item.getBrandEn());
-                        importHist.setB2cBrandId(item.getBrandId());
-                        importHist.setB2cKindName(item.getKindName());
-                        importHist.setB2cKindId(item.getKindId());
-                        importHist.setStatus(ProductImportHist.ProductImportStatus.INFO_SUCCESS.getCode());
-                        importHist.setUpdateTime(new Date());
-                        list.add(importHist);
-                        success++;
-                    }
-                }
-            }else {
-                continue;
-            }
-        }
-        map.put("success", success);
-        map.put("failure", failure);
-        productImportHistDao.save(list);
-        return ResultMap.success(map);
-    }
-}

+ 0 - 285
src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductStandardPutOnInfoFacadeImpl.java

@@ -1,285 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade.impl;
-
-import com.uas.platform.b2c.advertise.ad.service.RecommendProductService;
-import com.uas.platform.b2c.common.account.model.User;
-import com.uas.platform.b2c.core.config.SysConf;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductStandardPutOnInfoDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductStandardPutOnInfoHistoryDao;
-import com.uas.platform.b2c.prod.commodity.facade.ProductStandardPutOnInfoFacade;
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfoHistory;
-import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
-import com.uas.platform.b2c.prod.commodity.service.impl.GoodsServiceImpl;
-import com.uas.platform.b2c.prod.store.dao.StoreInDao;
-import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.b2c.trade.order.service.OrderDetailService;
-import com.uas.platform.b2c.trade.order.service.OrderService;
-import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
-import com.uas.platform.b2c.trade.presale.service.CartService;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * Created by yujia on 2017/7/14.
- */
-@Service
-public class ProductStandardPutOnInfoFacadeImpl implements ProductStandardPutOnInfoFacade {
-
-    private final ProductStandardPutOnInfoService standardPutOnInfoService;
-
-    private final ProductStandardPutOnInfoDao standardPutOnInfoDao;
-
-    private final GoodsDao goodsDao;
-
-    private final ProductDao productDao;
-
-    private final GoodsService goodsService;
-
-    private final GoodsHistoryService goodsHistoryService;
-
-    private final GoodsHistoryDao goodsHistoryDao;
-
-    private final StoreInDao storeInDao;
-
-    private final CartService cartService;
-
-    private final SysConf sysConf;
-
-    private final BrowsingHistoryService browsingHistoryService;
-
-    private final ProductStandardPutOnInfoHistoryDao standardPutOnInfoHistoryDao;
-
-    private final RecommendProductService recommendProductService;
-
-    private final OrderDetailService detailService;
-
-    private final OrderService orderService;
-
-    @Autowired
-    public ProductStandardPutOnInfoFacadeImpl(ProductStandardPutOnInfoService standardPutOnInfoService, ProductStandardPutOnInfoDao standardPutOnInfoDao, GoodsDao goodsDao, ProductDao productDao, GoodsService goodsService, GoodsHistoryService goodsHistoryService, GoodsHistoryDao goodsHistoryDao, StoreInDao storeInDao, CartService cartService, SysConf sysConf, BrowsingHistoryService browsingHistoryService, ProductStandardPutOnInfoHistoryDao standardPutOnInfoHistoryDao, RecommendProductService recommendProductService, OrderDetailService detailService, OrderService orderService) {
-        this.standardPutOnInfoService = standardPutOnInfoService;
-        this.standardPutOnInfoDao = standardPutOnInfoDao;
-        this.goodsDao = goodsDao;
-        this.productDao = productDao;
-        this.goodsService = goodsService;
-        this.goodsHistoryService = goodsHistoryService;
-        this.goodsHistoryDao = goodsHistoryDao;
-        this.storeInDao = storeInDao;
-        this.cartService = cartService;
-        this.sysConf = sysConf;
-        this.browsingHistoryService = browsingHistoryService;
-        this.standardPutOnInfoHistoryDao = standardPutOnInfoHistoryDao;
-        this.recommendProductService = recommendProductService;
-        this.detailService = detailService;
-        this.orderService = orderService;
-    }
-
-
-    /**
-     * 用户更新标准上架的信息
-     * @param productStandardPutOnInfo
-     * @return
-     */
-    @Transactional
-    @Override
-    public ResultMap updateProductStandardPutOnInfo(ProductStandardPutOnInfo productStandardPutOnInfo) {
-        if(productStandardPutOnInfo == null) {
-            return new ResultMap(CodeType.NO_INFO, "传入的信息丢失,请重新操作");
-        }
-        ProductStandardPutOnInfo standardPutOnInfo = standardPutOnInfoDao.findOne(productStandardPutOnInfo.getId());
-        if(!standardPutOnInfo.validProductStandardPutOnInfoDataIsUpdate(productStandardPutOnInfo)) {
-            return new ResultMap(CodeType.INFO_UPDATE, "数据已经被更新,请刷新之后重新操作");
-        }
-        Goods goods = null;
-        if(productStandardPutOnInfo.getStatus().intValue() == Status.AVAILABLE.value()) {
-           goods = goodsDao.findByBatchCode(productStandardPutOnInfo.getGoBatch());
-            if(goods != null) {
-                if(goods.validProductStandardPutOnInfoAndGoodsSameData(productStandardPutOnInfo)) {
-                    return new ResultMap(CodeType.INFO_UPDATE, "数据已经被更新,请刷新之后重新操作");
-                }
-            }
-        }
-        Product product = productDao.findOne(standardPutOnInfo.getProductid());
-        if((NumberUtil.compare(product.getRepositoryQty(), standardPutOnInfo.getRepositoryQty()) != 0) ||
-                (NumberUtil.compare((product.getMinPackQty() == null ? 1 : product.getMinPackQty()), (standardPutOnInfo.getMinPackQty() == null ? 1 : standardPutOnInfo.getMinPackQty())) != 0)) {
-            return new ResultMap(CodeType.INFO_UPDATE, "库存信息已经被更新,请刷新之后重新操作");
-        }
-
-        //顺便更新店铺的数据
-        ResultMap resultMap1 = validProductStandardPutOnInfoData(productStandardPutOnInfo);
-        if(resultMap1.getCode() != CodeType.OK.code()) {
-            return resultMap1;
-        }
-
-        updateFrontDataToPersist(productStandardPutOnInfo, standardPutOnInfo);
-
-        product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
-        product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-        product.setLockQty(standardPutOnInfo.getLockQty());
-        productDao.save(product);
-
-        // 保存商品的原始店铺UUID
-        String storeUuid = null;
-        if (goods != null) {
-            storeUuid = goods.getStoreid();
-        }
-
-        //保存库存信息
-        goods.updateGoodsByProductStandardPutOnInfo(standardPutOnInfo);
-        ResultMap resultMap = goodsService.updateGoodsByProductStandardPutOn(goods);
-        if(resultMap.getCode() != CodeType.OK.code()) {
-            return resultMap;
-        }
-        goodsDao.save(goods);
-        List<Order> orders = detailService.updateOrderDetailsByGoods(goods);
-        orderService.save(orders);
-
-        // 标准上架管理更新商品信息时,同步产品推荐的信息
-        if (!Objects.equals(storeUuid, goods.getStoreid()) || Status.UNAVAILABLE.value() == goods.getStatus()) {
-			Set<String> batchCodes = new HashSet<>();
-			batchCodes.add(goods.getBatchCode());
-			recommendProductService.deleteProductsWhenSellerUpdateReserve(storeUuid, batchCodes);
-		}
-
-        //保存库存的历史
-        GoodsHistory history = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.STANDARD_MODIFY.getPhrase(),false);
-        goodsHistoryService.save(history);
-
-
-        //更新购物车信息
-        cartService.updateCartByGoods(goods);
-
-        //更新浏览历史
-        browsingHistoryService.updateGoodsBrowsingHistoryByGoods(goods);
-
-        ProductStandardPutOnInfo putOnInfo = standardPutOnInfoDao.save(standardPutOnInfo);
-
-        ProductStandardPutOnInfoHistory infoHistory = new ProductStandardPutOnInfoHistory();
-        ProductStandardPutOnInfoHistory infoHistory1 = infoHistory.convert2History(putOnInfo, "用户更新上架标准信息");
-        standardPutOnInfoHistoryDao.save(infoHistory1);
-
-        return ResultMap.success(putOnInfo);
-    }
-
-    /**
-     * 验证数据的合理性,
-     * 顺便更新店铺的数据
-     * @param putOnInfo
-     * @return
-     */
-    private ResultMap validProductStandardPutOnInfoData(ProductStandardPutOnInfo putOnInfo) {
-        ResultMap resultMap1 = GoodsServiceImpl.validFragmentPrice(putOnInfo.getEditQtyPrices(), putOnInfo.getCurrency());
-        if(resultMap1.getCode() != CodeType.OK.code()) {
-            return resultMap1;
-        }
-        if(putOnInfo.getMinPackQty() == null) {
-            putOnInfo.setMinPackQty((double) 1);
-        }
-        if(putOnInfo.getMinBuyQty() % putOnInfo.getMinPackQty() != 0) {
-            return new ResultMap(CodeType.PARAMETER_ERROR, "最小起订量与最小包装量不是倍数关系");
-        }
-
-        if(putOnInfo.getEditIsSelfSale()) {
-            List<StoreIn> storeIns = storeInDao.findByEnUU(putOnInfo.getEnuu());
-            if(CollectionUtils.isEmpty(storeIns)) {
-                return new ResultMap(CodeType.NOT_PERMIT, "本公司还未开店,不能选择自营销售方式");
-            }
-            putOnInfo.setStoreuuid(storeIns.get(0).getUuid());
-            putOnInfo.setStoreName(storeIns.get(0).getStoreName());
-        }else {
-            putOnInfo.setStoreuuid(sysConf.getStoreid());
-            putOnInfo.setStoreName(sysConf.getEnName());
-        }
-        return ResultMap.success(null);
-    }
-
-
-    private void updateFrontDataToPersist(ProductStandardPutOnInfo frontData, ProductStandardPutOnInfo persitData) {
-        persitData.setSelfSale(frontData.getEditIsSelfSale());
-        persitData.setMaxDelivery(frontData.getEditMaxDelivery());
-        persitData.setMinDelivery(frontData.getEditMinDelivery());
-        persitData.setMinBuyQty(frontData.getEditMinBuyQty());
-        persitData.setQtyPrice(FlexJsonUtils.toJson(frontData.getEditQtyPrices()));
-        persitData.setImg(frontData.getEditImg());
-        persitData.setStoreuuid(frontData.getStoreuuid());
-        persitData.setStoreName(frontData.getStoreName());
-
-        Double minusQty = NumberUtil.sub(frontData.getLockQty(), frontData.getEditLockQty());
-        Double result = NumberUtil.add(minusQty, frontData.getAvailableOnSale(), frontData.getOnSaleQty());
-        if(result.doubleValue() < 0) {
-            persitData.setAvailableOnSale(result);
-            persitData.setOnSaleQty(0.0);
-        }else {
-            persitData.setAvailableOnSale(0.0d);
-            persitData.setOnSaleQty(result);
-        }
-        persitData.setLockQty(frontData.getEditLockQty());
-        if(persitData.getMinPackQty() == null) {
-            persitData.setMinPackQty((double) 1);
-        }
-    }
-
-    /**
-     * 标准产品上架的动作
-     *
-     * @param productStandardPutOnInfo
-     * @return
-     */
-    @Override
-    public ResultMap productStandardPutOnInfoPutOn(ProductStandardPutOnInfo productStandardPutOnInfo) {
-        User user = SystemSession.getUser();
-        if(user.getEnterprise().getUu().longValue() != productStandardPutOnInfo.getEnuu().doubleValue()) {
-            return new ResultMap(CodeType.NOT_PERMIT, "当前企业不能操作当前信息");
-        }
-        if(productStandardPutOnInfo.getStatus().intValue() == Status.AVAILABLE.value()) {
-            return new ResultMap(CodeType.NOT_PERMIT, "当前的标准上架管理不再可上架状态");
-        }
-        if(productStandardPutOnInfo == null) {
-            return new ResultMap(CodeType.NO_INFO, "传入的信息丢失,请重新操作");
-        }
-
-        ProductStandardPutOnInfo standardPutOnInfo = standardPutOnInfoDao.findOne(productStandardPutOnInfo.getId());
-        if(NumberUtil.compare(standardPutOnInfo.getRepositoryQty(), productStandardPutOnInfo.getRepositoryQty()) != 0 ||
-                NumberUtil.compare((standardPutOnInfo.getMinPackQty() == null ? 1 : standardPutOnInfo.getMinPackQty()), (productStandardPutOnInfo.getMinPackQty() == null ? 1 :productStandardPutOnInfo.getMinPackQty() )) != 0 ) {
-            return new ResultMap(CodeType.INFO_UPDATE, "数据已经被更新,请刷新之后重新操作");
-        }
-        Product product = productDao.findOne(standardPutOnInfo.getProductid());
-        System.err.println(standardPutOnInfo.getProductid());
-        if(NumberUtil.compare(product.getRepositoryQty().doubleValue(), standardPutOnInfo.getRepositoryQty().doubleValue()) != 0 ||
-                NumberUtil.compare((product.getMinPackQty() == null ? 1 : product.getMinPackQty()),
-                        (standardPutOnInfo.getMinPackQty() == null ? 1 : standardPutOnInfo.getMinPackQty()))!= 0) {
-            return new ResultMap(CodeType.INFO_UPDATE, "库存已经被更新,请刷新之后重新操作");
-        }
-        ResultMap onInfoData = validProductStandardPutOnInfoData(productStandardPutOnInfo);
-        if(onInfoData.getCode() != CodeType.OK.code()) {
-            return onInfoData;
-        }
-        updateFrontDataToPersist(productStandardPutOnInfo, standardPutOnInfo);
-        ResultMap resultMap = standardPutOnInfoService.productStandardPutOnInfoPutOn(standardPutOnInfo);
-
-        goodsService.updateComponentTradeInfos(standardPutOnInfo.getCodeUuid());
-        return resultMap;
-    }
-}

+ 0 - 143
src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/StockInOutHistFacadeImpl.java

@@ -1,143 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.facade.impl;
-
-
-import com.uas.platform.b2c.advertise.ad.service.RecommendProductService;
-import com.uas.platform.b2c.common.account.model.User;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductStandardPutOnInfoDao;
-import com.uas.platform.b2c.prod.commodity.facade.StockInOutHistFacade;
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-import com.uas.platform.b2c.prod.commodity.service.StockInOutHistService;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Created by yujia on 2017/7/10.
- */
-@Service
-public class StockInOutHistFacadeImpl implements StockInOutHistFacade {
-
-    private final StockInOutHistService stockInOutHistService;
-
-    private final ProductDao productDao;
-    @Autowired
-    private ProductStandardPutOnInfoDao productStandardPutOnInfoDao;
-    @Autowired
-    private GoodsDao goodsDao;
-
-    @Autowired
-    private RecommendProductService recommendProductService;
-
-    @Autowired
-    public StockInOutHistFacadeImpl(StockInOutHistService stockInOutHistService, ProductDao productDao) {
-        this.stockInOutHistService = stockInOutHistService;
-        this.productDao = productDao;
-    }
-
-    @Override
-    public ResultMap save(StockInOutHist inOutHist, Boolean isStockIn) {
-        if(inOutHist == null) {
-            return new ResultMap(CodeType.NO_INFO, "出入库的记录丢失");
-        }
-        if(isStockIn) {
-            if(inOutHist.getStockQty() == null) {
-                return new ResultMap(CodeType.NO_INFO, "入库的数量为空");
-            }else if(inOutHist.getStockQty().doubleValue() <= 0){
-                return new ResultMap(CodeType.NOT_COMPLETE_INFO, "入库的数量必须大于0");
-            }
-            inOutHist.setIoSellerType(Type.STOCK_IN.value());
-        }else {
-            if(inOutHist.getStockQty() == null) {
-                return new ResultMap(CodeType.NO_INFO, "出库的数量为空");
-            }else if(inOutHist.getStockQty().doubleValue() <= 0){
-                return new ResultMap(CodeType.NOT_COMPLETE_INFO, "出库的数量必须大于0");
-            }
-            inOutHist.setIoSellerType(Type.STOCK_OUT.value());
-        }
-        if(inOutHist.getProdid() == null) {
-            return new ResultMap(CodeType.NO_INFO, "产品信息没有传入");
-        }
-        User user = SystemSession.getUser();
-        Long uu = user.getEnterprise().getUu();
-        Product product = productDao.findOne(inOutHist.getProdid());
-        if(product == null) {
-            return new ResultMap(CodeType.NOT_EXiST, "产品信息有误,找不到对应的企业的产品信息");
-        }
-        Integer standard = product.getStandard();
-        product.setCurrency(inOutHist.getCurrency());
-        ProductStandardPutOnInfo productStandardPutOnInfo= productStandardPutOnInfoDao.findByProductid(product.getId());
-        Double changeStockQty = inOutHist.getStockQty();
-        Double availableOnSale = product.getAvailableOnSale();
-        Double repositoryQty = product.getRepositoryQty();
-        Double onSaleQty = product.getOnSaleQty();
-        if(isStockIn){
-            product.setAvailableOnSale(NumberUtil.add(availableOnSale, changeStockQty));
-            product.setRepositoryQty(NumberUtil.add(repositoryQty, changeStockQty));
-            if(standard == 1){
-                productStandardPutOnInfo.setAvailableOnSale(product.getAvailableOnSale());
-                productStandardPutOnInfo.setRepositoryQty(product.getRepositoryQty());
-                productStandardPutOnInfoDao.save(productStandardPutOnInfo);
-            }
-        }else{
-            if(NumberUtil.compare(changeStockQty, availableOnSale) < 1){
-                product.setAvailableOnSale(availableOnSale - changeStockQty);
-                product.setRepositoryQty(repositoryQty - changeStockQty);
-                if(standard == 1){
-                    productStandardPutOnInfo.setAvailableOnSale(availableOnSale - changeStockQty);
-                    productStandardPutOnInfo.setRepositoryQty(repositoryQty - changeStockQty);
-                    productStandardPutOnInfoDao.save(productStandardPutOnInfo);
-                }
-            }else if(NumberUtil.compare(changeStockQty , NumberUtil.add(availableOnSale, onSaleQty)) < 1){
-                product.setOnSaleQty(NumberUtil.sub(NumberUtil.add(availableOnSale, onSaleQty), changeStockQty));
-                product.setAvailableOnSale(0d);
-                product.setRepositoryQty(NumberUtil.sub(repositoryQty, changeStockQty));
-                if(standard == 1){
-                    productStandardPutOnInfo.setOnSaleQty(product.getOnSaleQty());
-                    productStandardPutOnInfo.setAvailableOnSale(product.getAvailableOnSale());
-                    productStandardPutOnInfo.setRepositoryQty(product.getRepositoryQty());
-                    if(productStandardPutOnInfo.getStatus() == Status.AVAILABLE.value() || productStandardPutOnInfo.getStatus() == Status.UNAVAILABLE.value()){
-                        Goods goods =goodsDao.findByBatchCode(productStandardPutOnInfo.getGoBatch());
-                        goods.setReserve(product.getOnSaleQty());
-                        if(goods.getMinBuyQty() > product.getOnSaleQty()){
-                            goods.setStatus(Status.UNAVAILABLE.value());
-                        }
-                        goodsDao.save(goods);
-
-                        // 仓库管理出库时,同步产品推荐的信息
-                        if (Status.UNAVAILABLE.value() == goods.getStatus()) {
-                            Set<String> batchCodes = new HashSet<>();
-                            batchCodes.add(goods.getBatchCode());
-                            recommendProductService.deleteProductsWhenSellerUpdateReserve(goods.getStoreid(), batchCodes);
-                        }
-                    }
-                    productStandardPutOnInfoDao.save(productStandardPutOnInfo);
-                }
-            }else{
-                return new ResultMap(CodeType.NOT_PERMIT, "可用库存不足,请核实是否设置了锁库或存在待发货的订单");
-            }
-        }
-        inOutHist.setEnuu(uu);
-        inOutHist.setProdid(product.getId());
-        inOutHist.setProdNum(product.getProdNum());
-        inOutHist.setOperateDate(new Date());
-        inOutHist.setUseruu(user.getUserUU());
-        inOutHist.setUserName(user.getUserName());
-        StockInOutHist inOutHist2 = stockInOutHistService.save(inOutHist);
-        productDao.save(product);
-        return ResultMap.success(inOutHist2);
-    }
-}

+ 0 - 35
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -1449,10 +1449,6 @@ public class Goods implements Serializable {
 		this.minDelivery = history.getMinDelivery();
 	}
 
-	public Goods(ProductStandardPutOnInfo onInfo) {
-//		this.code = onin
-	}
-
 	public String getAttach() {
 		return attach;
 	}
@@ -1565,37 +1561,6 @@ public class Goods implements Serializable {
 		return delivery;
 	}
 
-	/**
-	 * 验证 ProductStandardPutOnInfo 和goods 的一致性
-	 * @param productStandardPutOnInfo
-	 * @return true 一致 false  不一致
-	 */
-	public boolean validProductStandardPutOnInfoAndGoodsSameData (ProductStandardPutOnInfo productStandardPutOnInfo) {
-		if(this.minBuyQty.doubleValue() != productStandardPutOnInfo.getMinBuyQty().doubleValue() ||
-				this.qtyPrice != productStandardPutOnInfo.getQtyPrice() ||
-				this.getMaxDeliveryMethod().shortValue() != productStandardPutOnInfo.getMaxDelivery().shortValue() ||
-				this.getMinDeliveryMethod().shortValue() != productStandardPutOnInfo.getMinDelivery().shortValue() ||
-				this.getReserve().doubleValue() != productStandardPutOnInfo.getOnSaleQty().doubleValue()) {
-			return false;
-		}
-		return true;
-	}
-
-	public void updateGoodsByProductStandardPutOnInfo(ProductStandardPutOnInfo productStandardPutOnInfo) {
-		this.img = productStandardPutOnInfo.getImg();
-		this.storeid = productStandardPutOnInfo.getStoreuuid();
-		this.maxDelivery = productStandardPutOnInfo.getMaxDelivery();
-		this.minDelivery = productStandardPutOnInfo.getMinDelivery();
-		this.prices = productStandardPutOnInfo.getQtyPrices();
-		this.minBuyQty = productStandardPutOnInfo.getMinBuyQty();
-		//如果库存信息有变化,则将上次的库存信息修改为最新的信息
-		if(NumberUtil.compare(this.reserve, productStandardPutOnInfo.getOnSaleQty()) != 0) {
-			this.lastReserve = productStandardPutOnInfo.getOnSaleQty();
-		}
-		this.reserve = productStandardPutOnInfo.getOnSaleQty();
-		this.storeName = productStandardPutOnInfo.getStoreName();
-	}
-
 	public boolean validGoodsIsChange(Goods goods) {
 		if(!NumberUtil.objectCompare(this.minBuyQty, goods.getMinBuyQty()) ||
 				!NumberUtil.objectCompare(this.qtyPrice, goods.qtyPrice) ||

+ 0 - 401
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductImportHist.java

@@ -1,401 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.model;
-
-import org.springframework.util.StringUtils;
-
-import javax.persistence.*;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * 产品的历史
- *
- * @author yuj
- * @version 2017年8月3日14:16:28 yuj 增加注释
- */
-@Entity
-@Table(name = "trade$product_import_hist")
-public class ProductImportHist {
-
-    @Id
-    @GeneratedValue
-    @Column(name = "id")
-    private Long id;
-
-    /**
-     * 产品编号
-     */
-    @Column(name = "prod_num")
-    private String prodNum;
-
-    /**
-     * 产品名称
-     */
-    @Column(name = "prod_name")
-    private String prodName;
-
-    /**
-     * 产品型号
-     */
-    @Column(name = "prod_code")
-    private String prodCode;
-
-    /**
-     * 产品品牌
-     */
-    @Column(name = "prod_brand")
-    private String prodBrand;
-
-    /**
-     * 产品封装
-     */
-    @Column(name = "prod_encapsulation")
-    private String prodEncapsulation;
-
-    /**
-     * 公司的ENUU
-     */
-    @Column(name = "prod_enuu")
-    private Long enuu;
-
-    /**
-     * 个人的useruu
-     */
-    @Column(name = "prod_useruu")
-    private Long useruu;
-
-    /**
-     * 本次上传的编号
-     */
-    @Column(name = "upload_num")
-    private String uploadNum;
-
-    /**
-     * 上传时间
-     */
-    @Column(name = "upload_time")
-    private Date uploadTime;
-
-    /**
-     * 更新时间
-     */
-    @Column(name = "update_time")
-    private Date updateTime;
-
-    /**
-     * 产品的状态
-     */
-    @Column(name = "prod_status")
-    private Integer status;
-
-    /**
-     * 器件的UUID
-     */
-    @Column(name = "prod_uuid")
-    private String cmpuuid;
-
-    /**
-     * 品牌的英文
-     */
-    @Column(name = "b2c_brand_en")
-    private String b2cBrandEn;
-
-    /**
-     * 品牌的id
-     */
-    @Column(name = "b2c_brand_id")
-    private Long b2cBrandId;
-
-    /**
-     * 品牌的中文
-     */
-    @Column(name = "b2c_brand_cn")
-    private String b2cBrandCn;
-
-    /**
-     * 类目的名称
-     */
-    @Column(name = "b2c_kind_name")
-    private String b2cKindName;
-
-    /**
-     * 类目的id
-     */
-    @Column(name = "b2c_kind_id")
-    private Long b2cKindId;
-
-    /**
-     * 商城器件的型号
-     */
-    @Column(name = "b2c_cmpcode")
-    private String b2cCmpCode;
-
-    /**
-     * 错误的描述
-     */
-    @Column(name = "eror_message")
-    private String errorMessage;
-
-    /**
-     * 关联的明细
-     */
-    @OneToMany(mappedBy = "importHist", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
-    @OrderBy("id ASC")
-    private Set<ProductImportHistItem> importHistItems;
-
-    public Long getId() {
-        return id;
-    }
-
-    public ProductImportHist setId(Long id) {
-        this.id = id;
-        return this;
-    }
-
-    public String getProdNum() {
-        return prodNum;
-    }
-
-    public ProductImportHist setProdNum(String prodNum) {
-        this.prodNum = prodNum;
-        return this;
-    }
-
-    public String getProdName() {
-        return prodName;
-    }
-
-    public ProductImportHist setProdName(String prodName) {
-        this.prodName = prodName;
-        return this;
-    }
-
-    public String getProdCode() {
-        return prodCode;
-    }
-
-    public ProductImportHist setProdCode(String prodCode) {
-        this.prodCode = prodCode;
-        return this;
-    }
-
-    public String getProdBrand() {
-        return prodBrand;
-    }
-
-    public ProductImportHist setProdBrand(String prodBrand) {
-        this.prodBrand = prodBrand;
-        return this;
-    }
-
-    public String getProdEncapsulation() {
-        return prodEncapsulation;
-    }
-
-    public ProductImportHist setProdEncapsulation(String prodEncapsulation) {
-        this.prodEncapsulation = prodEncapsulation;
-        return this;
-    }
-
-    public Set<ProductImportHistItem> getImportHistItems() {
-        return importHistItems;
-    }
-
-    public ProductImportHist setImportHistItems(Set<ProductImportHistItem> importHistItems) {
-        this.importHistItems = importHistItems;
-        return this;
-    }
-
-    public Long getEnuu() {
-        return enuu;
-    }
-
-    public ProductImportHist setEnuu(Long enuu) {
-        this.enuu = enuu;
-        return this;
-    }
-
-    public Long getUseruu() {
-        return useruu;
-    }
-
-    public ProductImportHist setUseruu(Long useruu) {
-        this.useruu = useruu;
-        return this;
-    }
-
-    public String getUploadNum() {
-        return uploadNum;
-    }
-
-    public ProductImportHist setUploadNum(String uploadNum) {
-        this.uploadNum = uploadNum;
-        return this;
-    }
-
-    public Date getUploadTime() {
-        return uploadTime;
-    }
-
-    public ProductImportHist setUploadTime(Date uploadTime) {
-        this.uploadTime = uploadTime;
-        return this;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public ProductImportHist setStatus(Integer status) {
-        this.status = status;
-        return this;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public ProductImportHist setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-        return this;
-    }
-
-    public String getCmpuuid() {
-        return cmpuuid;
-    }
-
-    public ProductImportHist setCmpuuid(String cmpuuid) {
-        this.cmpuuid = cmpuuid;
-        return this;
-    }
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-    public ProductImportHist setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-        return this;
-    }
-
-    public ProductImportHist addErrorMessage(String errorMessage) {
-        if(StringUtils.isEmpty(this.errorMessage)) {
-            this.errorMessage = errorMessage;
-        }else {
-            this.errorMessage = this.errorMessage + ',' + errorMessage;
-        }
-
-        return this;
-    }
-
-    public String getB2cBrandEn() {
-        return b2cBrandEn;
-    }
-
-    public ProductImportHist setB2cBrandEn(String b2cBrandEn) {
-        this.b2cBrandEn = b2cBrandEn;
-        return this;
-    }
-
-    public Long getB2cBrandId() {
-        return b2cBrandId;
-    }
-
-    public ProductImportHist setB2cBrandId(Long b2cBrandId) {
-        this.b2cBrandId = b2cBrandId;
-        return this;
-    }
-
-    public String getB2cBrandCn() {
-        return b2cBrandCn;
-    }
-
-    public ProductImportHist setB2cBrandCn(String b2cBrandCn) {
-        this.b2cBrandCn = b2cBrandCn;
-        return this;
-    }
-
-    public String getB2cKindName() {
-        return b2cKindName;
-    }
-
-    public ProductImportHist setB2cKindName(String b2cKindName) {
-        this.b2cKindName = b2cKindName;
-        return this;
-    }
-
-    public Long getB2cKindId() {
-        return b2cKindId;
-    }
-
-    public ProductImportHist setB2cKindId(Long b2cKindId) {
-        this.b2cKindId = b2cKindId;
-        return this;
-    }
-
-    public String getB2cCmpCode() {
-        return b2cCmpCode;
-    }
-
-    public ProductImportHist setB2cCmpCode(String b2cCmpCode) {
-        this.b2cCmpCode = b2cCmpCode;
-        return this;
-    }
-
-    /**
-     * 产品导入的状态
-     */
-    public enum ProductImportStatus {
-        /**
-         * {@code 101, 信息不全}
-         */
-        INFO_PARTIAL(101, "信息不全"),
-
-        /**
-         * {@code 102, 信息完全}
-         */
-        INFO_COMPLETE(102, "信息完全"),
-
-        /**
-         * {@code 103, 品牌不一致}
-         */
-        INFO_BRAND_ISSUE(103, "品牌不一致"),
-
-
-        /**
-         * {@code 104, 找不到器件}
-         */
-        INFO_COMPONENT_ISSUE(104, "找不到器件"),
-
-        /**
-         * {@code 105, 匹配成功}
-         */
-        INFO_SUCCESS(105, "匹配成功"),
-
-        /**
-         * {@code 106, 与记录重复}
-         */
-        INFO_DUPLICATE(106, "与记录重复"),
-
-        /**
-         * {@code 107, 已导入产品库}
-         */
-        INFO_IMPORT_DOWN(107, "已导入产品库");
-
-        private final int code;
-
-        private final String phrase;
-
-        ProductImportStatus(int code, String phrase) {
-            this.code = code;
-            this.phrase = phrase;
-        }
-
-        public int getCode() {
-            return code;
-        }
-
-        public String getPhrase() {
-            return phrase;
-        }
-    }
-}

+ 0 - 181
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductImportHistItem.java

@@ -1,181 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.*;
-
-/**
- * 产品导入的历史
- *
- * @author yuj
- * @version 2017年8月3日14:16:28 yuj 增加注释
- */
-@Entity
-@Table(name = "trade$product_import_hist_itme")
-public class ProductImportHistItem {
-
-    @Id
-    @GeneratedValue
-    @Column(name = "id")
-    private Long id;
-
-    @ManyToOne(optional = true, cascade = CascadeType.ALL)
-    @JoinColumn(name = "hist_id", nullable = false)
-    private ProductImportHist importHist;
-
-    /**
-     * 品牌id
-     */
-    @Column(name = "brand_id")
-    private Long brandId;
-
-    /**
-     * 品牌UUID
-     */
-    @Column(name = "brand_uuid")
-    private String brandUUID;
-
-    /**
-     * 英文品牌
-     */
-    @Column(name = "brand_en")
-    private String brandEn;
-
-    /**
-     * 中文品牌
-     */
-    @Column(name = "brand_cn")
-    private String brandCn;
-
-    /**
-     * 类目的id
-     */
-    @Column(name = "kind_id")
-    private Long kindId;
-
-    /**
-     * 类目名称
-     */
-    @Column(name = "kind_name")
-    private String kindName;
-
-    /**
-     * 器件的UUID
-     */
-    @Column(name = "cmp_uuid")
-    private String cmpUuid;
-
-    /**
-     * 产品封装
-     */
-    @Column(name = "cmp_encapsulation")
-    private String encapsulation;
-
-    /**
-     * 器件型号
-     */
-    @Column(name = "cmp_code")
-    private String cmpCode;
-
-    public Long getId() {
-        return id;
-    }
-
-    public ProductImportHistItem setId(Long id) {
-        this.id = id;
-        return this;
-    }
-
-    public Long getBrandId() {
-        return brandId;
-    }
-
-    public ProductImportHistItem setBrandId(Long brandId) {
-        this.brandId = brandId;
-        return this;
-    }
-
-    public String getBrandUUID() {
-        return brandUUID;
-    }
-
-    public ProductImportHistItem setBrandUUID(String brandUUID) {
-        this.brandUUID = brandUUID;
-        return this;
-    }
-
-    public String getBrandEn() {
-        return brandEn;
-    }
-
-    public ProductImportHistItem setBrandEn(String brandEn) {
-        this.brandEn = brandEn;
-        return this;
-    }
-
-    public String getBrandCn() {
-        return brandCn;
-    }
-
-    public ProductImportHistItem setBrandCn(String brandCn) {
-        this.brandCn = brandCn;
-        return this;
-    }
-
-    public Long getKindId() {
-        return kindId;
-    }
-
-    public ProductImportHistItem setKindId(Long kindId) {
-        this.kindId = kindId;
-        return this;
-    }
-
-    public String getKindName() {
-        return kindName;
-    }
-
-    public ProductImportHistItem setKindName(String kindName) {
-        this.kindName = kindName;
-        return this;
-    }
-
-    public String getCmpUuid() {
-        return cmpUuid;
-    }
-
-    public ProductImportHistItem setCmpUuid(String cmpUuid) {
-        this.cmpUuid = cmpUuid;
-        return this;
-    }
-
-    @JsonIgnore
-    @JSONField(serialize = false)
-    public ProductImportHist getImportHist() {
-        return importHist;
-    }
-
-    public ProductImportHistItem setImportHist(ProductImportHist importHist) {
-        this.importHist = importHist;
-        return this;
-    }
-
-    public String getEncapsulation() {
-        return encapsulation;
-    }
-
-    public ProductImportHistItem setEncapsulation(String encapsulation) {
-        this.encapsulation = encapsulation;
-        return this;
-    }
-
-    public String getCmpCode() {
-        return cmpCode;
-    }
-
-    public ProductImportHistItem setCmpCode(String cmpCode) {
-        this.cmpCode = cmpCode;
-        return this;
-    }
-}

+ 0 - 751
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductStandardPutOnInfo.java

@@ -1,751 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.model;
-
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.core.model.Type;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Created by yujia on 2017/7/12.
- * 标准库上架信息model
- */
-@Entity
-@Table(name = "trade$prodstanputon")
-public class ProductStandardPutOnInfo {
-
-
-    @GeneratedValue
-    @Id
-    @Column(name ="id")
-    private Long id;
-
-    /**
-     * 产品型号
-     */
-    @Column(name = "pro_code")
-    private String cmpCode;
-
-    /**
-     * 器件的uuid
-     */
-    @Column(name = "pro_codeuuid")
-    private String codeUuid;
-
-    /**
-     * 英文品牌名
-     */
-    @Column(name = "pro_branden")
-    private String brandEn;
-
-    /**
-     * 中文品牌名
-     */
-    @Column(name = "pro_brandcn")
-    private String brandCn;
-
-    /**
-     * 品牌 id
-     */
-    @Column(name = "pro_brandid")
-    private Long brandid;
-
-    /**
-     * 品牌 uuid
-     */
-    @Column(name = "pro_branduuid")
-    private String branduuid;
-    /**
-     * 类目名称
-     */
-    @Column(name = "pro_kindcn")
-    private String kindCn;
-
-    /**
-     * 英文名
-     */
-    @Column(name = "pro_kinden")
-    private String kindEn;
-
-    /**
-     * 类目id
-     */
-    @Column(name = "pro_kindid")
-    private Long kindid;
-
-    /**
-     * 封装规格
-     */
-    @Column(name = "pro_encapsulation")
-    private String encapsulation;
-
-    /**
-     * 标准单位
-     */
-    @Column(name = "pro_unit")
-    private String unit;
-
-    /**
-     * 包装:托盘、管装、卷带
-     */
-    @Column(name = "pro_packaging")
-    private String packaging;
-
-    /**
-     * 包装数量
-     */
-    @Column(name = "pro_minpackqty")
-    private Double minPackQty;
-
-    /**
-     * true 自营
-     * 是否自营
-     */
-    @Column(name = "pro_selfSale", columnDefinition = "TINYINT(1)")
-    private Boolean selfSale;
-
-    /**
-     * 生产日期
-     */
-    @Column(name = "pro_producedate")
-    private String produceDate;
-
-    /**
-     * 最大交期
-     */
-    @Column(name = "pro_maxdelivery")
-    private Short maxDelivery;
-
-    /**
-     * 最小交期
-     */
-    @Column(name = "pro_mindelivery")
-    private Short minDelivery;
-
-    /**
-     * 起订量
-     */
-    @Column(name = "pro_minbuyqty")
-    private Double minBuyQty;
-
-    /**
-     * 分段报价(List)
-     */
-    @Transient
-    private List<GoodsQtyPrice> qtyPrices;
-
-    /**
-     * 分段报价(JSON串) eg:[{"start":0,"end":1000,"price":2.3,"taxPrice":2.5},...]
-     */
-    @Column(name = "go_qtyprice", length = 4000)
-    private String qtyPrice;
-
-    /**
-     * 在售数量
-     */
-    @Column(name = "pro_onsale")
-    private Double onSaleQty;
-
-    /**
-     * 锁库数
-     */
-    @Column(name = "pro_lockqty")
-    private Double lockQty;
-
-    /**
-     * 可上架数量
-     */
-    @Column(name = "pro_availableonsale")
-    private Double availableOnSale;
-
-    /**
-     * 仓库数量
-     */
-    @Column(name = "pro_repositoryqty")
-    private Double repositoryQty;
-
-    /**
-     * 在售状态
-     */
-    @Column(name = "pro_onsalestatus")
-    private Integer onSaleStatus;
-
-    /**
-     * 可上架数量是否变化
-     */
-    @Column(name = "pro_availableonsalestatus", columnDefinition = "TINYINT(1)")
-    private Boolean availableOnSaleStatus;
-
-    /**
-     * 币别
-     */
-    @Column(name = "pro_currency")
-    private String currency;
-
-    /**
-     * 产品库的id
-     */
-    @Column(name = "pro_productid")
-    private Long productid;
-
-    /**
-     * 卖家的企业uu
-     */
-    @Column(name = "pro_enuu")
-    private Long enuu;
-
-    /**
-     * 批次的信息
-     */
-    @Column(name = "pro_batch")
-    private String goBatch;
-
-    /**
-     * 类型(1669 待入库, 1670 未上架, 601 在售(602 失效状态暂时也归这一类), 612 已下架)
-     */
-    @Column(name = "pro_status")
-    private Integer status;
-
-    /**
-     * 图片的信息
-     */
-    @Column(name = "pro_img")
-    private String img;
-
-    /**
-     * 创建日期
-     */
-    @Column(name = "pro_createtime")
-    private Date createTime;
-
-    @Transient
-    private Double editMinBuyQty;
-
-    @Transient
-    private Short editMinDelivery;
-
-    @Transient
-    private Short editMaxDelivery;
-
-    @Transient
-    private List<GoodsQtyPrice> editQtyPrices;
-
-    @Transient
-    private Boolean editIsSelfSale;
-
-    @Transient
-    private Double editLockQty;
-
-    @Transient
-    private String editImg;
-
-    @Transient
-    private String storeuuid;
-
-    @Transient
-    private String storeName;
-
-    public ProductStandardPutOnInfo() {
-    }
-
-    public ProductStandardPutOnInfo(String cmpCode, String codeUuid, String brandEn, String brandCn, Long brandid, String branduuid, String kindCn, String kindEn, Long kindid, String encapsulation, String unit) {
-        this.cmpCode = cmpCode;
-        this.codeUuid = codeUuid;
-        this.brandEn = brandEn;
-        this.brandCn = brandCn;
-        this.brandid = brandid;
-        this.branduuid = branduuid;
-        this.kindCn = kindCn;
-        this.kindEn = kindEn;
-        this.kindid = kindid;
-        this.encapsulation = encapsulation;
-        this.unit = unit;
-    }
-
-    public ProductStandardPutOnInfo(Product product) {
-        this.cmpCode = product.getCmpCode();
-        this.codeUuid = product.getCmpUuId();
-        this.brandEn = product.getPbranden();
-        this.brandCn = product.getPbrand();
-        this.branduuid = product.getPbranduuid();
-        this.kindCn = product.getKind();
-        this.kindEn = product.getKinden();
-        this.kindid = product.getKindid();
-        this.encapsulation = product.getEncapsulation();
-        this.unit = product.getUnit();
-        this.productid = product.getId();
-        this.enuu = product.getEnUU();
-        this.minPackQty = product.getMinPackQty();
-        this.packaging = product.getPackaging();
-        this.produceDate = product.getProduceDate();
-        this.createTime = new Date();
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public ProductStandardPutOnInfo setId(Long id) {
-        this.id = id;
-        return this;
-    }
-
-    public String getCmpCode() {
-        return cmpCode;
-    }
-
-    public ProductStandardPutOnInfo setCmpCode(String cmpCode) {
-        this.cmpCode = cmpCode;
-        return this;
-    }
-
-    public String getCodeUuid() {
-        return codeUuid;
-    }
-
-    public ProductStandardPutOnInfo setCodeUuid(String codeUuid) {
-        this.codeUuid = codeUuid;
-        return this;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public ProductStandardPutOnInfo setStatus(Integer status) {
-        this.status = status;
-        return this;
-    }
-
-    public String getBrandEn() {
-        return brandEn;
-    }
-
-    public ProductStandardPutOnInfo setBrandEn(String brandEn) {
-        this.brandEn = brandEn;
-        return this;
-    }
-
-    public String getBrandCn() {
-        return brandCn;
-    }
-
-    public ProductStandardPutOnInfo setBrandCn(String brandCn) {
-        this.brandCn = brandCn;
-        return this;
-    }
-
-    public Long getBrandid() {
-        return brandid;
-    }
-
-    public ProductStandardPutOnInfo setBrandid(Long brandid) {
-        this.brandid = brandid;
-        return this;
-    }
-
-    public String getBranduuid() {
-        return branduuid;
-    }
-
-    public ProductStandardPutOnInfo setBranduuid(String branduuid) {
-        this.branduuid = branduuid;
-        return this;
-    }
-
-    public String getKindCn() {
-        return kindCn;
-    }
-
-    public ProductStandardPutOnInfo setKindCn(String kindCn) {
-        this.kindCn = kindCn;
-        return this;
-    }
-
-    public String getKindEn() {
-        return kindEn;
-    }
-
-    public ProductStandardPutOnInfo setKindEn(String kindEn) {
-        this.kindEn = kindEn;
-        return this;
-    }
-
-    public Long getKindid() {
-        return kindid;
-    }
-
-    public ProductStandardPutOnInfo setKindid(Long kindid) {
-        this.kindid = kindid;
-        return this;
-    }
-
-    public String getEncapsulation() {
-        return encapsulation;
-    }
-
-    public ProductStandardPutOnInfo setEncapsulation(String encapsulation) {
-        this.encapsulation = encapsulation;
-        return this;
-    }
-
-    public String getUnit() {
-        return unit;
-    }
-
-    public ProductStandardPutOnInfo setUnit(String unit) {
-        this.unit = unit;
-        return this;
-    }
-
-    public String getPackaging() {
-        return packaging;
-    }
-
-    public void setPackaging(String packaging) {
-        this.packaging = packaging;
-    }
-
-    public Double getMinPackQty() {
-        return minPackQty;
-    }
-
-    public ProductStandardPutOnInfo setMinPackQty(Double minPackQty) {
-        this.minPackQty = minPackQty;
-        return this;
-    }
-
-    public Boolean getSelfSale() {
-        return selfSale;
-    }
-
-    public ProductStandardPutOnInfo setSelfSale(Boolean selfSale) {
-        this.selfSale = selfSale;
-        return this;
-    }
-
-    public String getProduceDate() {
-        return produceDate;
-    }
-
-    public ProductStandardPutOnInfo setProduceDate(String produceDate) {
-        this.produceDate = produceDate;
-        return this;
-    }
-
-    public Short getMaxDelivery() {
-        return maxDelivery;
-    }
-
-    public ProductStandardPutOnInfo setMaxDelivery(Short maxDelivery) {
-        this.maxDelivery = maxDelivery;
-        return this;
-    }
-
-    public Short getMinDelivery() {
-        return minDelivery;
-    }
-
-    public ProductStandardPutOnInfo setMinDelivery(Short minDelivery) {
-        this.minDelivery = minDelivery;
-        return this;
-    }
-
-    public Double getMinBuyQty() {
-        return minBuyQty;
-    }
-
-    public ProductStandardPutOnInfo setMinBuyQty(Double minBuyQty) {
-        this.minBuyQty = minBuyQty;
-        return this;
-    }
-
-    public List<GoodsQtyPrice> getQtyPrices() {
-        if(!StringUtils.isEmpty(qtyPrice) && CollectionUtils.isEmpty(qtyPrices)) {
-            qtyPrices = FastjsonUtils.fromJsonArray(qtyPrice, GoodsQtyPrice.class);
-        }
-        return qtyPrices;
-    }
-
-    public ProductStandardPutOnInfo setQtyPrices(List<GoodsQtyPrice> qtyPrices) {
-        this.qtyPrices = qtyPrices;
-        return this;
-    }
-
-    public String getQtyPrice() {
-        return qtyPrice;
-    }
-
-    public ProductStandardPutOnInfo setQtyPrice(String qtyPrice) {
-        this.qtyPrice = qtyPrice;
-        return this;
-    }
-
-    public Double getOnSaleQty() {
-        return onSaleQty;
-    }
-
-    public ProductStandardPutOnInfo setOnSaleQty(Double onSaleQty) {
-        this.onSaleQty = onSaleQty;
-        return this;
-    }
-
-    public Double getLockQty() {
-        return lockQty;
-    }
-
-    public ProductStandardPutOnInfo setLockQty(Double lockQty) {
-        this.lockQty = lockQty;
-        return this;
-    }
-
-    public Double getAvailableOnSale() {
-        return availableOnSale;
-    }
-
-    public ProductStandardPutOnInfo setAvailableOnSale(Double availableOnSale) {
-        this.availableOnSale = availableOnSale;
-        return this;
-    }
-
-    public Double getRepositoryQty() {
-        return repositoryQty;
-    }
-
-    public ProductStandardPutOnInfo setRepositoryQty(Double repositoryQty) {
-        this.repositoryQty = repositoryQty;
-        return this;
-    }
-
-    public Integer getOnSaleStatus() {
-        return onSaleStatus;
-    }
-
-    public ProductStandardPutOnInfo setOnSaleStatus(Integer onSaleStatus) {
-        this.onSaleStatus = onSaleStatus;
-        return this;
-    }
-
-    public Boolean getAvailableOnSaleStatus() {
-        return availableOnSaleStatus;
-    }
-
-    public ProductStandardPutOnInfo setAvailableOnSaleStatus(Boolean availableOnSaleStatus) {
-        this.availableOnSaleStatus = availableOnSaleStatus;
-        return this;
-    }
-
-    public String getCurrency() {
-        return currency;
-    }
-
-    public ProductStandardPutOnInfo setCurrency(String currency) {
-        this.currency = currency;
-        return this;
-    }
-
-    public Long getProductid() {
-        return productid;
-    }
-
-    public ProductStandardPutOnInfo setProductid(Long productid) {
-        this.productid = productid;
-        return this;
-    }
-
-    public Long getEnuu() {
-        return enuu;
-    }
-
-    public ProductStandardPutOnInfo setEnuu(Long enuu) {
-        this.enuu = enuu;
-        return this;
-    }
-
-    public String getGoBatch() {
-        return goBatch;
-    }
-
-    public ProductStandardPutOnInfo setGoBatch(String goBatch) {
-        this.goBatch = goBatch;
-        return this;
-    }
-
-    public Double getEditMinBuyQty() {
-        return editMinBuyQty;
-    }
-
-    public ProductStandardPutOnInfo setEditMinBuyQty(Double editMinBuyQty) {
-        this.editMinBuyQty = editMinBuyQty;
-        return this;
-    }
-
-    public Short getEditMinDelivery() {
-        return editMinDelivery;
-    }
-
-    public ProductStandardPutOnInfo setEditMinDelivery(Short editMinDelivery) {
-        this.editMinDelivery = editMinDelivery;
-        return this;
-    }
-
-    public Short getEditMaxDelivery() {
-        return editMaxDelivery;
-    }
-
-    public ProductStandardPutOnInfo setEditMaxDelivery(Short editMaxDelivery) {
-        this.editMaxDelivery = editMaxDelivery;
-        return this;
-    }
-
-    public List<GoodsQtyPrice> getEditQtyPrices() {
-        return editQtyPrices;
-    }
-
-    public ProductStandardPutOnInfo setEditQtyPrices(List<GoodsQtyPrice> editQtyPrices) {
-        this.editQtyPrices = editQtyPrices;
-        return this;
-    }
-
-    public Boolean getEditIsSelfSale() {
-        return editIsSelfSale;
-    }
-
-    public ProductStandardPutOnInfo setEditIsSelfSale(Boolean editIsSelfSale) {
-        this.editIsSelfSale = editIsSelfSale;
-        return this;
-    }
-
-    public Double getEditLockQty() {
-        return editLockQty;
-    }
-
-    public ProductStandardPutOnInfo setEditLockQty(Double editLockQty) {
-        this.editLockQty = editLockQty;
-        return this;
-    }
-
-    public String getImg() {
-        return img;
-    }
-
-    public ProductStandardPutOnInfo setImg(String img) {
-        this.img = img;
-        return this;
-    }
-
-    public String getEditImg() {
-        return editImg;
-    }
-
-    public ProductStandardPutOnInfo setEditImg(String editImg) {
-        this.editImg = editImg;
-        return this;
-    }
-
-    public String getStoreName() {
-        return storeName;
-    }
-
-    public ProductStandardPutOnInfo setStoreName(String storeName) {
-        this.storeName = storeName;
-        return this;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public ProductStandardPutOnInfo setCreateTime(Date createTime) {
-        this.createTime = createTime;
-        return this;
-    }
-
-    /**
-     * 验证数据是否已经被修改
-     * @param data 需要比较的数据
-     * @return false 不一致, true 一致
-     */
-    public Boolean validProductStandardPutOnInfoDataIsUpdate (ProductStandardPutOnInfo data) {
-        if(!NumberUtil.objectCompare(this.selfSale, data.getSelfSale())  ||
-                !NumberUtil.objectCompare(this.maxDelivery, data.getMaxDelivery()) ||
-                !NumberUtil.objectCompare(this.minDelivery, data.getMinDelivery()) ||
-                !NumberUtil.objectCompare(this.minBuyQty, data.getMinBuyQty()) ||
-                !NumberUtil.objectCompare(this.qtyPrice, data.getQtyPrice()) ||
-                NumberUtil.compare(this.lockQty, data.getLockQty()) != 0 ||
-                NumberUtil.compare(this.onSaleQty, data.getOnSaleQty()) != 0 ||
-                NumberUtil.compare(this.availableOnSale, data.getAvailableOnSale()) != 0 ||
-                NumberUtil.compare(this.repositoryQty, data.getRepositoryQty()) != 0 ||
-                !NumberUtil.objectCompare(this.img, data.getImg())) {
-            return false;
-        }
-        return true;
-    }
-
-    public String getStoreuuid() {
-        return storeuuid;
-    }
-
-    public ProductStandardPutOnInfo setStoreuuid(String storeuuid) {
-        this.storeuuid = storeuuid;
-        return this;
-    }
-
-    public void convertToGoods(Goods goods) {
-        goods.setImg(this.img);
-        goods.setKindUuid(this.kindid);
-        goods.setKindNameCn(this.kindCn);
-        goods.setCode(this.cmpCode);
-        goods.setUuid(this.codeUuid);
-        goods.setBrandid(this.brandid);
-        goods.setBrandNameEn(this.brandEn);
-        goods.setBrandNameCn(this.brandCn);
-        goods.setEncapsulation(this.encapsulation);
-        goods.setPackaging(this.packaging);
-        goods.setStoreid(this.storeuuid);
-        goods.setMaxDelivery(this.maxDelivery);
-        goods.setMinDelivery(this.minDelivery);
-        goods.setMinBuyQty(this.minBuyQty);
-        goods.setMinPackQty(this.getMinPackQty());
-        goods.setQtyPrice(this.qtyPrice);
-        goods.setReserve(this.getOnSaleQty());
-        goods.setEnUU(this.getEnuu());
-        goods.setCreatedDate(new Date());
-        goods.setCurrencyName(this.currency);
-        goods.setOriginal(Type.Goods_Original_Code.value());
-        goods.setProduceDate(this.produceDate);
-        goods.setProductid(this.productid);
-        goods.setStandprodid(this.id);
-    }
-
-    public Double getFragmentStart(int i) {
-        List<GoodsQtyPrice> qtyPrices = getQtyPrices();
-        if(CollectionUtils.isNotEmpty(qtyPrices) && (i < qtyPrices.size())) {
-            return this.qtyPrices.get(i).getStart();
-        }else {
-            return null;
-        }
-    }
-
-    public Double getFragmentPrice(int i) {
-        List<GoodsQtyPrice> qtyPrices = getQtyPrices();
-        if(CollectionUtils.isNotEmpty(qtyPrices) &&  (i < qtyPrices.size())) {
-            if("RMB".equals(currency)) {
-                return qtyPrices.get(i).getRMBPrice();
-            }else {
-                return qtyPrices.get(i).getUSDPrice();
-            }
-        }else {
-            return null;
-        }
-    }
-}

+ 0 - 515
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductStandardPutOnInfoHistory.java

@@ -1,515 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.model;
-
-/**
- * Created by yujia on 2017/7/12.
- * 标准库上架信息历史
- */
-import com.uas.platform.b2c.core.support.SystemSession;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import java.util.Date;
-import java.util.List;
-
-@Entity
-@Table(name = "trade$prostandputoninfohist")
-public class ProductStandardPutOnInfoHistory {
-
-    @Id
-    @Column(name ="id")
-    @GeneratedValue
-    private Long id;
-
-    /**
-     * 产品型号
-     */
-    @Column(name = "pro_code")
-    private String cmpCode;
-
-    /**
-     * 器件的uuid
-     */
-    @Column(name = "pro_codeuuid")
-    private String codeUuid;
-
-    /**
-     * 英文品牌名
-     */
-    @Column(name = "pro_branden")
-    private String brandEn;
-
-    /**
-     * 中文品牌名
-     */
-    @Column(name = "pro_brandcn")
-    private String brandCn;
-
-    /**
-     * 品牌 id
-     */
-    @Column(name = "pro_brandid")
-    private Long brandid;
-
-    /**
-     * 品牌 uuid
-     */
-    @Column(name = "pro_branduuid")
-    private String branduuid;
-    /**
-     * 类目名称
-     */
-    @Column(name = "pro_kindcn")
-    private String kindCn;
-
-    /**
-     * 英文名
-     */
-    @Column(name = "pro_kinden")
-    private String kindEn;
-
-    /**
-     * 类目id
-     */
-    @Column(name = "pro_kindid")
-    private Long kindid;
-
-    /**
-     * 封装规格
-     */
-    @Column(name = "pro_encapsulation")
-    private String encapsulation;
-
-    /**
-     * 标准单位
-     */
-    @Column(name = "pro_unit")
-    private String unit;
-
-    /**
-     * 包装数量
-     */
-    @Column(name = "pro_minpackqty")
-    private Double minPackQty;
-
-    /**
-     * true 自营
-     * 是否自营
-     */
-    @Column(name = "pro_selfSale", columnDefinition = "TINYINT(1)")
-    private Boolean isSelfSale;
-
-    /**
-     * 生产日期
-     */
-    @Column(name = "pro_producedate")
-    private String produceDate;
-
-    /**
-     * 最大交期
-     */
-    @Column(name = "pro_maxdelivery")
-    private Short maxDelivery;
-
-    /**
-     * 最小交期
-     */
-    @Column(name = "pro_mindelivery")
-    private Short minDelivery;
-
-    /**
-     * 起订量
-     */
-    @Column(name = "pro_minbuyqty")
-    private Double minBuyQty;
-
-    /**
-     * 分段报价(List)
-     */
-    @Transient
-    private List<GoodsQtyPrice> qtyPrices;
-
-    /**
-     * 分段报价(JSON串) eg:[{"start":0,"end":1000,"price":2.3,"taxPrice":2.5},...]
-     */
-    @Column(name = "go_qtyprice", length = 4000)
-    private String qtyPrice;
-
-    /**
-     * 在售数量
-     */
-    @Column(name = "pro_onsale")
-    private Double onSaleQty;
-
-    /**
-     * 锁库数
-     */
-    @Column(name = "pro_lockqty")
-    private Double lockQty;
-
-    /**
-     * 可上架数量
-     */
-    @Column(name = "pro_availableonsale")
-    private Double availableOnSale;
-
-    /**
-     * 仓库数量
-     */
-    @Column(name = "pro_repositoryqty")
-    private Double repositoryQty;
-
-    /**
-     * 在售状态
-     */
-    @Column(name = "pro_onsalestatus")
-    private Integer onSaleStatus;
-
-    /**
-     * 可上架数量是否变化
-     */
-    @Column(name = "pro_availableonsalestatus", columnDefinition = "TINYINT(1)")
-    private Boolean availableOnSaleStatus;
-
-    /**
-     * 币别
-     */
-    @Column(name = "pro_currency")
-    private String currency;
-
-    /**
-     * 变化时间
-     */
-    @Column(name = "pro_updatedate")
-    private Date updateDate;
-
-    /**
-     * 操作人
-     */
-    @Column(name = "pro_useruu")
-    private Long useruu;
-
-    /**
-     * 记录变化
-     */
-    @Column(name = "pro_logmessage")
-    private String logmessage;
-
-    /**
-     * 操作类型
-     */
-    @Column(name = "pro_operatetype")
-    private String operateType;
-
-    public Long getId() {
-        return id;
-    }
-
-    public ProductStandardPutOnInfoHistory setId(Long id) {
-        this.id = id;
-        return this;
-    }
-
-    public String getCmpCode() {
-        return cmpCode;
-    }
-
-    public ProductStandardPutOnInfoHistory setCmpCode(String cmpCode) {
-        this.cmpCode = cmpCode;
-        return this;
-    }
-
-    public String getCodeUuid() {
-        return codeUuid;
-    }
-
-    public ProductStandardPutOnInfoHistory setCodeUuid(String codeUuid) {
-        this.codeUuid = codeUuid;
-        return this;
-    }
-
-    public String getBrandEn() {
-        return brandEn;
-    }
-
-    public ProductStandardPutOnInfoHistory setBrandEn(String brandEn) {
-        this.brandEn = brandEn;
-        return this;
-    }
-
-    public String getBrandCn() {
-        return brandCn;
-    }
-
-    public ProductStandardPutOnInfoHistory setBrandCn(String brandCn) {
-        this.brandCn = brandCn;
-        return this;
-    }
-
-    public Long getBrandid() {
-        return brandid;
-    }
-
-    public ProductStandardPutOnInfoHistory setBrandid(Long brandid) {
-        this.brandid = brandid;
-        return this;
-    }
-
-    public String getBranduuid() {
-        return branduuid;
-    }
-
-    public ProductStandardPutOnInfoHistory setBranduuid(String branduuid) {
-        this.branduuid = branduuid;
-        return this;
-    }
-
-    public String getKindCn() {
-        return kindCn;
-    }
-
-    public ProductStandardPutOnInfoHistory setKindCn(String kindCn) {
-        this.kindCn = kindCn;
-        return this;
-    }
-
-    public String getKindEn() {
-        return kindEn;
-    }
-
-    public ProductStandardPutOnInfoHistory setKindEn(String kindEn) {
-        this.kindEn = kindEn;
-        return this;
-    }
-
-    public Long getKindid() {
-        return kindid;
-    }
-
-    public ProductStandardPutOnInfoHistory setKindid(Long kindid) {
-        this.kindid = kindid;
-        return this;
-    }
-
-    public String getEncapsulation() {
-        return encapsulation;
-    }
-
-    public ProductStandardPutOnInfoHistory setEncapsulation(String encapsulation) {
-        this.encapsulation = encapsulation;
-        return this;
-    }
-
-    public String getUnit() {
-        return unit;
-    }
-
-    public ProductStandardPutOnInfoHistory setUnit(String unit) {
-        this.unit = unit;
-        return this;
-    }
-
-    public Double getMinPackQty() {
-        return minPackQty;
-    }
-
-    public ProductStandardPutOnInfoHistory setMinPackQty(Double minPackQty) {
-        this.minPackQty = minPackQty;
-        return this;
-    }
-
-    public Boolean getSelfSale() {
-        return isSelfSale;
-    }
-
-    public ProductStandardPutOnInfoHistory setSelfSale(Boolean selfSale) {
-        isSelfSale = selfSale;
-        return this;
-    }
-
-    public String getProduceDate() {
-        return produceDate;
-    }
-
-    public ProductStandardPutOnInfoHistory setProduceDate(String produceDate) {
-        this.produceDate = produceDate;
-        return this;
-    }
-
-    public Short getMaxDelivery() {
-        return maxDelivery;
-    }
-
-    public ProductStandardPutOnInfoHistory setMaxDelivery(Short maxDelivery) {
-        this.maxDelivery = maxDelivery;
-        return this;
-    }
-
-    public Short getMinDelivery() {
-        return minDelivery;
-    }
-
-    public ProductStandardPutOnInfoHistory setMinDelivery(Short minDelivery) {
-        this.minDelivery = minDelivery;
-        return this;
-    }
-
-    public Double getMinBuyQty() {
-        return minBuyQty;
-    }
-
-    public ProductStandardPutOnInfoHistory setMinBuyQty(Double minBuyQty) {
-        this.minBuyQty = minBuyQty;
-        return this;
-    }
-
-    public List<GoodsQtyPrice> getQtyPrices() {
-        return qtyPrices;
-    }
-
-    public ProductStandardPutOnInfoHistory setQtyPrices(List<GoodsQtyPrice> qtyPrices) {
-        this.qtyPrices = qtyPrices;
-        return this;
-    }
-
-    public String getQtyPrice() {
-        return qtyPrice;
-    }
-
-    public ProductStandardPutOnInfoHistory setQtyPrice(String qtyPrice) {
-        this.qtyPrice = qtyPrice;
-        return this;
-    }
-
-    public Double getOnSaleQty() {
-        return onSaleQty;
-    }
-
-    public ProductStandardPutOnInfoHistory setOnSaleQty(Double onSaleQty) {
-        this.onSaleQty = onSaleQty;
-        return this;
-    }
-
-    public Double getLockQty() {
-        return lockQty;
-    }
-
-    public ProductStandardPutOnInfoHistory setLockQty(Double lockQty) {
-        this.lockQty = lockQty;
-        return this;
-    }
-
-    public Double getAvailableOnSale() {
-        return availableOnSale;
-    }
-
-    public ProductStandardPutOnInfoHistory setAvailableOnSale(Double availableOnSale) {
-        this.availableOnSale = availableOnSale;
-        return this;
-    }
-
-    public Double getRepositoryQty() {
-        return repositoryQty;
-    }
-
-    public ProductStandardPutOnInfoHistory setRepositoryQty(Double repositoryQty) {
-        this.repositoryQty = repositoryQty;
-        return this;
-    }
-
-    public Integer getOnSaleStatus() {
-        return onSaleStatus;
-    }
-
-    public ProductStandardPutOnInfoHistory setOnSaleStatus(Integer onSaleStatus) {
-        this.onSaleStatus = onSaleStatus;
-        return this;
-    }
-
-    public Boolean getAvailableOnSaleStatus() {
-        return availableOnSaleStatus;
-    }
-
-    public ProductStandardPutOnInfoHistory setAvailableOnSaleStatus(Boolean availableOnSaleStatus) {
-        this.availableOnSaleStatus = availableOnSaleStatus;
-        return this;
-    }
-
-    public String getCurrency() {
-        return currency;
-    }
-
-    public ProductStandardPutOnInfoHistory setCurrency(String currency) {
-        this.currency = currency;
-        return this;
-    }
-
-    public Date getUpdateDate() {
-        return updateDate;
-    }
-
-    public ProductStandardPutOnInfoHistory setUpdateDate(Date updateDate) {
-        this.updateDate = updateDate;
-        return this;
-    }
-
-    public Long getUseruu() {
-        return useruu;
-    }
-
-    public ProductStandardPutOnInfoHistory setUseruu(Long useruu) {
-        this.useruu = useruu;
-        return this;
-    }
-
-    public String getLogmessage() {
-        return logmessage;
-    }
-
-    public ProductStandardPutOnInfoHistory setLogmessage(String logmessage) {
-        this.logmessage = logmessage;
-        return this;
-    }
-
-    public String getOperateType() {
-        return operateType;
-    }
-
-    public ProductStandardPutOnInfoHistory setOperateType(String operateType) {
-        this.operateType = operateType;
-        return this;
-    }
-
-    public ProductStandardPutOnInfoHistory convert2History(ProductStandardPutOnInfo onInfo, String operateType) {
-        this.cmpCode = onInfo.getCmpCode();
-        this.codeUuid = onInfo.getCodeUuid();
-        this.brandEn = onInfo.getBrandEn();
-        this.brandCn = onInfo.getBrandCn();
-        this.brandid = onInfo.getBrandid();
-        this.branduuid = onInfo.getBranduuid();
-        this.kindCn = onInfo.getKindCn();
-        this.kindEn = onInfo.getKindEn();
-        this.kindid = onInfo.getKindid();
-        this.encapsulation = onInfo.getEncapsulation();
-        this.minPackQty = onInfo.getMinPackQty();
-        this.isSelfSale = onInfo.getEditIsSelfSale();
-        this.produceDate = onInfo.getProduceDate();
-        this.maxDelivery = onInfo.getMaxDelivery();
-        this.minDelivery = onInfo.getMinDelivery();
-        this.minBuyQty = onInfo.getMinBuyQty();
-        this.qtyPrice = onInfo.getQtyPrice();
-        this.onSaleQty = onInfo.getOnSaleQty();
-        this.lockQty = onInfo.getLockQty();
-        this.availableOnSale = onInfo.getAvailableOnSale();
-        this.repositoryQty = onInfo.getRepositoryQty();
-        this.onSaleStatus = onInfo.getOnSaleStatus();
-        this.currency = onInfo.getCurrency();
-        this.updateDate = new Date();
-        this.useruu = SystemSession.getUser().getUserUU();
-        this.operateType = operateType;
-        return this;
-    }
-}

+ 0 - 273
src/main/java/com/uas/platform/b2c/prod/commodity/model/StockInOutHist.java

@@ -1,273 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.model;
-
-import com.uas.platform.b2c.core.support.SystemSession;
-
-import javax.persistence.*;
-import java.util.Date;
-
-/**
- * Created by yujia on 2017/7/10.
- * 卖家操作出入库的历史记录
- */
-@Entity
-@Table(name = "trade$stock_in_out")
-public class StockInOutHist {
-
-    @Id
-    @GeneratedValue
-    @Column(name = "id")
-    private Long id;
-
-    /**
-     * 生产日期
-     */
-    @Column(name = "stock_produce_date")
-    private String produceDate;
-
-    /**
-     * 包装方式
-     */
-    @Column(name = "stock_pack")
-    private String pack;
-
-    /**
-     * 最小包数量
-     */
-    @Column(name = "stock_minpackqty")
-    private Double minPackQty;
-
-
-    /**
-     * 单位
-     */
-    @Column(name = "stock_unit")
-    private String unit;
-
-    /**
-     * 数量
-     */
-    @Column(name = "stock_qty")
-    private Double stockQty;
-
-    /**
-     * in,out,seller  (入库,出库,销售的类型)
-     */
-    @Column(name = "stock_ioseller_type")
-    private Integer ioSellerType;
-
-    /**
-     * 成本
-     */
-    @Column(name = "stock_cost")
-    private Double cost;
-
-    /**
-     * 仓库
-     */
-    @Column(name = "stock_repository")
-    private String repository;
-
-    /**
-     * 企业enuu
-     */
-    @Column(name = "stock_enuu")
-    private Long enuu;
-
-
-    /**
-     * useruu,操作人个人uu
-     */
-    @Column(name = "stock_useruu")
-    private Long useruu;
-
-
-    /**
-     * 操作人姓名
-     */
-    @Column(name = "stock_user_name")
-    private String userName;
-
-    /**
-     * 操作时间
-     */
-    @Column(name = "stock_date")
-    private Date operateDate;
-
-    /**
-     * 本金的币别
-     */
-    @Column(name = "stock_currency")
-    private String currency;
-
-    /**
-     * 产品的编号
-     */
-    @Column(name = "stock_prodNum", nullable = false)
-    private String prodNum;
-
-    /**
-     * 产品编号对应的id
-     */
-    @Column(name = "stock_prod_id", nullable = false)
-    private Long prodid;
-
-    public Long getId() {
-        return id;
-    }
-
-    public StockInOutHist setId(Long id) {
-        this.id = id;
-        return this;
-    }
-
-    public String getProduceDate() {
-        return produceDate;
-    }
-
-    public StockInOutHist setProduceDate(String produceDate) {
-        this.produceDate = produceDate;
-        return this;
-    }
-
-    public String getPack() {
-        return pack;
-    }
-
-    public StockInOutHist setPack(String pack) {
-        this.pack = pack;
-        return this;
-    }
-
-    public Double getMinPackQty() {
-        return minPackQty;
-    }
-
-    public StockInOutHist setMinPackQty(Double minPackQty) {
-        this.minPackQty = minPackQty;
-        return this;
-    }
-
-    public String getUnit() {
-        return unit;
-    }
-
-    public StockInOutHist setUnit(String unit) {
-        this.unit = unit;
-        return this;
-    }
-
-    public Double getCost() {
-        return cost;
-    }
-
-    public StockInOutHist setCost(Double cost) {
-        this.cost = cost;
-        return this;
-    }
-
-    public String getRepository() {
-        return repository;
-    }
-
-    public StockInOutHist setRepository(String repository) {
-        this.repository = repository;
-        return this;
-    }
-
-    public Long getEnuu() {
-        return enuu;
-    }
-
-    public StockInOutHist setEnuu(Long enuu) {
-        this.enuu = enuu;
-        return this;
-    }
-
-    public Long getUseruu() {
-        return useruu;
-    }
-
-    public StockInOutHist setUseruu(Long useruu) {
-        this.useruu = useruu;
-        return this;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public StockInOutHist setUserName(String userName) {
-        this.userName = userName;
-        return this;
-    }
-
-    public Date getOperateDate() {
-        return operateDate;
-    }
-
-    public StockInOutHist setOperateDate(Date operateDate) {
-        this.operateDate = operateDate;
-        return this;
-    }
-
-    public String getCurrency() {
-        return currency;
-    }
-
-    public StockInOutHist setCurrency(String currency) {
-        this.currency = currency;
-        return this;
-    }
-
-    public String getProdNum() {
-        return prodNum;
-    }
-
-    public StockInOutHist setProdNum(String prodNum) {
-        this.prodNum = prodNum;
-        return this;
-    }
-
-    public Long getProdid() {
-        return prodid;
-    }
-
-    public StockInOutHist setProdid(Long prodid) {
-        this.prodid = prodid;
-        return this;
-    }
-
-    public Double getStockQty() {
-        return stockQty;
-    }
-
-    public StockInOutHist setStockQty(Double stockQty) {
-        this.stockQty = stockQty;
-        return this;
-    }
-
-    public Integer getIoSellerType() {
-        return ioSellerType;
-    }
-
-    public StockInOutHist setIoSellerType(Integer ioSellerType) {
-        this.ioSellerType = ioSellerType;
-        return this;
-    }
-
-    public StockInOutHist convert2StockInOutHist(Product product, Integer type) {
-        this.produceDate = product.getProduceDate();
-        this.pack = product.getPackaging();
-        this.minPackQty = product.getMinPackQty();
-        this.unit = product.getUnit();
-        this.ioSellerType = type;
-        this.enuu = product.getEnUU();
-        this.useruu = SystemSession.getUser().getUserUU();
-        this.userName = SystemSession.getUser().getUserName();
-        this.operateDate = new Date();
-        this.currency = product.getCurrency();
-        this.prodNum = product.getProdNum();
-        this.prodid = product.getId();
-        return this;
-    }
-}

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java

@@ -627,7 +627,7 @@ public interface GoodsService {
      * 更新库存的相关信息
      * @return
      */
-    ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods);
+    ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, GoodsHistory goodsHistory, Goods goods);
 
     /**
      * 获取库存的前面多少值

+ 0 - 53
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductImportHistService.java

@@ -1,53 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service;
-
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHist;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.PageParams;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 产品导入历史的 service
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface ProductImportHistService {
-
-    /**
-     * 保存产品导入的  ProductImportHist
-     *
-     * @param importHists 需要保存的数据
-     * @return Map<String Object> 保存之后匹配产品导入的结果
-     */
-    Map<String, Object> productImport(List<ProductImportHist> importHists);
-
-    /**
-     * Gets product import info by page and status.
-     *
-     * @param params    分页的信息
-     * @param status    状态信息
-     * @param uploadNum the upload num
-     * @return 一页数据 product import info by page and status
-     */
-    Page<ProductImportHist> getProductImportInfoByPageAndStatus(PageParams params, String status, String uploadNum);
-
-
-    /**
-     * 将产品导入到标准或者非标仓库
-     *
-     * @param uploadNum 本次导入的标准库
-     * @return 结果ResultMap 里面包含了导入的结果集
-     */
-    ResultMap importToProRepository(String uploadNum);
-
-    /**
-     * 下载导入时导入失败的信息
-     *
-     * @param uploadNum 上传时的批次
-     * @return list
-     */
-    List<ProductImportHist> exportProductImportError(String uploadNum);
-}

+ 0 - 26
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -8,8 +8,6 @@ import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
 import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 
 import java.util.List;
 import java.util.Map;
@@ -130,14 +128,6 @@ public interface ProductService {
      */
     Map<String, Integer> getProductCount(Integer isPerson);
 
-    /**
-     * 保存对产品包装,包装数量,生产日期的修改
-     *
-     * @param product the product
-     * @return the string
-     */
-    public String updateProduct(Product product);
-
 
     /**
      * 修改物料的品牌、物料名称、型号、规格、规格书等信息
@@ -148,22 +138,6 @@ public interface ProductService {
      */
     ResultMap updateProduct(String json, String attachUrl);
 
-    /**
-     * 根据库存信息 保存对产品包装,包装数量,生产日期的修改
-     *
-     * @param putOnInfo the putOnInfo
-     * @return the string
-     */
-    Product updateProduct(ProductStandardPutOnInfo putOnInfo);
-
-    /**
-     * 扣减库存
-     *
-     * @param purchase the purchase
-     * @return result map
-     */
-    ResultMap deductRepositoryQty(Purchase purchase);
-
     /**
      * 保存产品库信息
      * @param product

+ 0 - 115
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java

@@ -1,115 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service;
-
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfoHistory;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.PageParams;
-import org.springframework.data.domain.Page;
-
-import java.util.List;
-
-/**
- * 标准上架产品
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface ProductStandardPutOnInfoService {
-
-    /**
-     * Gets product standard put on info by page.
-     *
-     * @param params  the params 页参数
-     * @param keyword the keyword
-     * @return the product standard put on info by page
-     */
-    Page<ProductStandardPutOnInfo> getProductStandardPutOnInfoByPage(PageParams params, String keyword);
-
-    /**
-     * 一键更新标准上架信息,将可上架数变为在售数量
-     *
-     * @return result map
-     */
-    ResultMap updateProductStandardPutOnInfoByBatch();
-
-    /**
-     * 根据库存信息更新标准上架信息
-     * @param goods 库存
-     * @return
-     */
-    ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods);
-
-    /**
-     * 一键更新标准上架信息,将可上架数变为在售数量
-     *
-     * @param list                 the list 库存list
-     * @param listHist             the list hist  历史库存list
-     * @param listPro              the list pro 产品list
-     * @param putOnInfos           the put on infos 标准上架list
-     * @param putOnInfoHistoryList the put on info history list 标准上架历史list
-     * @return
-     */
-    void updateAssociateByBatch(List<Goods> list, List<GoodsHistory> listHist, List<Product> listPro, List<ProductStandardPutOnInfo> putOnInfos, List<ProductStandardPutOnInfoHistory> putOnInfoHistoryList);
-
-    /**
-     * 更新标准上架的信息
-     *
-     * @param productStandardPutOnInfo the product standard put on info 标准上架
-     * @return product standard put on info
-     */
-    ProductStandardPutOnInfo updateProductStandardPutOnInfo(ProductStandardPutOnInfo productStandardPutOnInfo);
-
-
-    /**
-     * 用户上架
-     *
-     * @param productStandardPutOnInfo the product standard put on info
-     * @return result map
-     */
-    ResultMap productStandardPutOnInfoPutOn(ProductStandardPutOnInfo productStandardPutOnInfo);
-
-    /**
-     * 根据关键字获取当前企业的信息
-     *
-     * @param keyword the keyword
-     * @return product standard put on info
-     */
-    List<ProductStandardPutOnInfo> getProductStandardPutOnInfo(String keyword);
-
-
-    /**
-     * 更新产品的在售数量
-     *
-     * @param goods   the goods
-     * @param reserve the reserve
-     * @return result map
-     */
-    ResultMap updateOnSaleQty(Goods goods, Double reserve);
-
-
-    /**
-     * 更新可上架数量的个数,业务模型(当前此商品已经下架(此时不管标准上架信息的状态是不是已上架),但是客户有库存返回,此时需要将数量增加到可上架数量上)
-     *
-     * @param id  the id
-     * @param qty the qty
-     * @return result map
-     */
-    public ResultMap updateAvailableQty(Long id, Double qty);
-
-    /**
-     * 单个保存标准上架信息
-     * @param putOnInfo 上架信息
-     * @return
-     */
-    ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo);
-
-    /**
-     * 批量保存标准上架信息
-     * @param putOnInfos 标准上架信息
-     * @return
-     */
-    List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos);
-}

+ 0 - 36
src/main/java/com/uas/platform/b2c/prod/commodity/service/StockInOutHistService.java

@@ -1,36 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service;
-
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-
-import java.util.List;
-
-/**
- * 出入库service 接口
- *
- * @author yuj
- * @version 2017年8月3日13:44:42 yuj 增加注释
- */
-public interface StockInOutHistService {
-
-    /**
-     * 保存出入库的历史记录
-     *
-     * @param inOutHist the in out hist
-     * @return ResultMap stock in out hist
-     */
-    StockInOutHist save(StockInOutHist inOutHist);
-
-    /**
-     * Gets stock in out hist by prod id.
-     *
-     * @param prodId 根据产品的id  prodId获取出入库的记录
-     * @return List<StockInOutHist> stock in out hist by prod id
-     */
-    List<StockInOutHist> getStockInOutHistByProdId(Long prodId);
-
-    /**
-     * 根据企业和类型统计该类型下的总量
-     * @return
-     */
-    int getCountByenuuAndIoSellerType(long enuu,int type);
-}

+ 29 - 87
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -1,7 +1,5 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
-import static com.uas.platform.core.persistence.criteria.PredicateUtils.like;
-
 import com.alibaba.fastjson.JSONObject;
 import com.uas.api.b2c_erp.core.model.OperateErrorStatus;
 import com.uas.api.b2c_erp.seller.model.GoodsFUas;
@@ -20,49 +18,16 @@ import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.core.utils.RegexConstant;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.core.utils.*;
 import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsModifyInfoDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsSimpleDao;
-import com.uas.platform.b2c.prod.commodity.dao.PCBDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDetailDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductStandardPutOnInfoDao;
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.GoodsFilter;
-import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
+import com.uas.platform.b2c.prod.commodity.dao.*;
+import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory.OperateType;
-import com.uas.platform.b2c.prod.commodity.model.GoodsInfo;
-import com.uas.platform.b2c.prod.commodity.model.GoodsModifyInfo;
-import com.uas.platform.b2c.prod.commodity.model.GoodsPriceInfo;
-import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
-import com.uas.platform.b2c.prod.commodity.model.GoodsSimple;
-import com.uas.platform.b2c.prod.commodity.model.ModifyInfo;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
-import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
-import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
-import com.uas.platform.b2c.prod.commodity.model.V_ProductPrivate;
-import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsPriceInfoService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.ProductAttachService;
-import com.uas.platform.b2c.prod.commodity.service.ProductPrivateService;
-import com.uas.platform.b2c.prod.commodity.service.ProductService;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
-import com.uas.platform.b2c.prod.commodity.service.V_ProductPrivateService;
+import com.uas.platform.b2c.prod.commodity.service.*;
 import com.uas.platform.b2c.prod.commodity.status.ModifyInfoStatus;
 import com.uas.platform.b2c.prod.commodity.type.ModifyConstant;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
@@ -100,11 +65,7 @@ import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.b2c.trade.util.BoundedExecutor;
 import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.Constant;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Type;
+import com.uas.platform.core.model.*;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
 import com.uas.platform.core.persistence.criteria.CriterionExpression.Operator;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
@@ -112,33 +73,6 @@ import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import com.uas.platform.core.util.StringUtil;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import java.math.BigInteger;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import javax.servlet.http.HttpServletRequest;
 import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
@@ -163,6 +97,26 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigInteger;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static com.uas.platform.core.persistence.criteria.PredicateUtils.like;
+
 
 /**
  * @author ChenHao
@@ -240,8 +194,6 @@ public class GoodsServiceImpl implements GoodsService {
     @Autowired
     private JdbcTemplate jdbcTemplate;
 
-    private final ProductStandardPutOnInfoDao productStandardPutOnInfoDao;
-
     private final ProductDao productDao;
 
     @Autowired
@@ -249,9 +201,6 @@ public class GoodsServiceImpl implements GoodsService {
 
     private final BrowsingHistoryService browsingHistoryService;
 
-    @Autowired
-    private ProductStandardPutOnInfoService productStandardPutOnInfoService;
-
     @Autowired
     private CartService cartService;
 
@@ -294,11 +243,10 @@ public class GoodsServiceImpl implements GoodsService {
     private final Logger logger = Logger.getLogger(getClass());
 
     @Autowired
-    public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService, BrandDao brandDao, KindInfoDao kindInfoDao) {
+    public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService, BrandDao brandDao, KindInfoDao kindInfoDao) {
         this.kindService = kindService;
         this.storeInDao = storeInDao;
         this.storeInService = storeInService;
-        this.productStandardPutOnInfoDao = productStandardPutOnInfoDao;
         this.productDao = productDao;
         this.browsingHistoryService = browsingHistoryService;
         this.recommendProductService = recommendProductService;
@@ -1683,7 +1631,7 @@ public class GoodsServiceImpl implements GoodsService {
         List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
         //更新浏览历史
         List<GoodsBrowsingHistory> browsingHistories = browsingHistoryService.updateGoodsBrowsingHistoryByGoods(nowGoods);
-        updateGoodsRelateInfo(orders, cartList, browsingHistories, null, null, history, nowGoods);
+        updateGoodsRelateInfo(orders, cartList, browsingHistories, null, history, nowGoods);
 
 		//更新店铺推荐的信息
 		if(isChangeSaleType) { // 如果切换了销售方式
@@ -1791,9 +1739,7 @@ public class GoodsServiceImpl implements GoodsService {
         List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
         //更新浏览历史
         List<GoodsBrowsingHistory> browsingHistories = browsingHistoryService.updateGoodsBrowsingHistoryByGoods(nowGoods);
-//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoService.updateProductStandardPutOnInfoByGoods(nowGoods);
-//		Product product = productService.updateProduct(putOnInfo);
-        updateGoodsRelateInfo(orders, cartList, browsingHistories, null, null, history, nowGoods);
+        updateGoodsRelateInfo(orders, cartList, browsingHistories, null, history, nowGoods);
         //更新店铺推荐的信息
         if(isChangeSaleType) { // 如果切换了销售方式
             Set<String> uuids = new HashSet<>();
@@ -3178,7 +3124,6 @@ public class GoodsServiceImpl implements GoodsService {
         List<Goods> goodsUpdate = new ArrayList<Goods>();
         List<GoodsHistory> histories = new ArrayList<GoodsHistory>();
         List<Product> products = new ArrayList<>();
-        List<ProductStandardPutOnInfo> productStandardPutOnInfoList = new ArrayList<>();
         List<String> uuids = new ArrayList<>();
         for (Goods goods : goodses) {
             if (goods.getSourceId() != null) {
@@ -3248,19 +3193,16 @@ public class GoodsServiceImpl implements GoodsService {
 	 * @param carts 购物车信息
 	 * @param browsingHistoryList 浏览历史
 	 * @param product 产品
-	 * @param putOnInfo 标准信息
 	 * @return
 	 */
 	@Transactional
 	@Override
-	public ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods) {
+	public ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, GoodsHistory goodsHistory, Goods goods) {
 		goodsDao.save(goods);
 		orderDao.save(orders);
 		orderService.save(orders);
 		cartService.saveCart(carts);
 		browsingHistoryService.saveGoodsBrowsingHistoryList(browsingHistoryList);
-//		productStandardPutOnInfoService.save(putOnInfo);
-//		productService.save(product);
 		goodsHistoryService.save(goodsHistory);
 		return ResultMap.success(null);
 	}

+ 0 - 122
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductImportHistServiceImpl.java

@@ -1,122 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service.impl;
-
-import com.uas.platform.b2c.core.constant.SplitChar;
-import com.uas.platform.b2c.prod.commodity.dao.ProductImportHistDao;
-import com.uas.platform.b2c.prod.commodity.model.ProductImportHist;
-import com.uas.platform.b2c.prod.commodity.service.ProductImportHistService;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.util.*;
-
-/**
- * Created by yujia on 2017/7/8.
- */
-@Service
-public class ProductImportHistServiceImpl implements ProductImportHistService {
-
-    private final ProductImportHistDao productImportHistDao;
-
-    @Autowired
-    public ProductImportHistServiceImpl(ProductImportHistDao productImportHistDao) {
-        this.productImportHistDao = productImportHistDao;
-    }
-
-    /**
-     * 保存产品导入的  ProductImportHist
-     *
-     * @param importHists 需要保存的数据
-     * @return Map<String, Integer> 保存之后匹配产品导入的结果
-     */
-    @Override
-    public Map<String, Object> productImport(List<ProductImportHist> importHists) {
-        Map<String, Object> map = new HashMap<>();
-        if(CollectionUtils.isEmpty(importHists)) {
-            map.put("success", 0);
-            map.put("importError", 0);
-        }else {
-            ProductImportHist hist = importHists.get(0);
-            String uploadNum = hist.getUploadNum();
-            productImportHistDao.save(importHists);
-//            productImportHistDao.validProductImportInfo(uploadNum, SystemSession.getUser().getEnterprise().getUu());
-//            Integer integer = productImportHistDao.importToProRepository(uploadNum);
-            //导入失败的条数(重复记录,信息缺失)
-            List<Integer> importFailure = new ArrayList<>();
-            Collections.addAll(importFailure, ProductImportHist.ProductImportStatus.INFO_PARTIAL.getCode(), ProductImportHist.ProductImportStatus.INFO_DUPLICATE.getCode());
-            Integer failureC = productImportHistDao.getCountProductImport(uploadNum, importFailure);
-            map.put("importError", failureC);
-            //匹配成功的条数
-//            map.put("success", integer);
-            map.put("uploadNum", uploadNum);
-        }
-        return map;
-    }
-
-    /**
-     * @param params 分页的信息
-     * @param status 状态信息
-     * @return 一页数据
-     */
-    @Override
-    public Page<ProductImportHist> getProductImportInfoByPageAndStatus(PageParams params, String status, String uploadNum) {
-        final PageInfo info = new PageInfo(params);
-        if(!StringUtils.isEmpty(status)) {
-            String[] split = status.split(SplitChar.COMMA);
-            for (String st : split) {
-                info.orExpression(PredicateUtils.eq("status", Integer.valueOf(st), true));
-            }
-        }
-        info.filter("uploadNum", uploadNum);
-        Page<ProductImportHist> hists = productImportHistDao.findAll(new Specification<ProductImportHist>() {
-            @Override
-            public Predicate toPredicate(Root<ProductImportHist> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
-                query.where(info.getPredicates(root, query, cb));
-                return null;
-            }
-        }, info);
-
-        return hists;
-    }
-
-    /**
-     * 将产品导入到标准或者非标仓库
-     *
-     * @param uploadNum 本次导入的标准库
-     * @return 结果ResultMap 里面包含了导入的结果集
-     */
-    @Override
-    public ResultMap importToProRepository(String uploadNum) {
-        if(StringUtils.isEmpty(uploadNum)) {
-            return  ResultMap.success(0);
-        }
-        // 该功能被弃用
-//        Integer integer = productImportHistDao.importToProRepository(uploadNum);
-        return ResultMap.success(0);
-    }
-
-    /**
-     * 下载导入时导入失败的信息
-     *
-     * @param uploadNum 上传时的批次
-     * @return
-     */
-    @Override
-    public List<ProductImportHist> exportProductImportError(String uploadNum) {
-        List<Integer> statuses = new ArrayList<>();
-        statuses.add(ProductImportHist.ProductImportStatus.INFO_PARTIAL.getCode());
-        statuses.add(ProductImportHist.ProductImportStatus.INFO_DUPLICATE.getCode());
-        return productImportHistDao.getProductImportHistByStatuses(uploadNum, statuses);
-    }
-}

+ 0 - 169
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -42,8 +42,6 @@ import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
 import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
 import com.uas.platform.b2c.trade.order.service.OrderDetailService;
 import com.uas.platform.b2c.trade.order.service.OrderService;
 import com.uas.platform.b2c.trade.order.status.OrderStatus;
@@ -58,7 +56,6 @@ import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Type;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
@@ -121,9 +118,6 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private ProductStoreStatusDao productStoreStatusDao;
 
-    @Autowired
-    private ProductStandardPutOnInfoDao productStandardPutOnInfoDao;
-
     @Autowired
     private GoodsDao goodsDao;
 
@@ -145,9 +139,6 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private GoodsHistoryDao goodsHistoryDao;
 
-    @Autowired
-    private StockInOutHistDao stockInOutHistDao;
-
     @Autowired
     private RecommendProductService recommendProductService;
 
@@ -805,101 +796,6 @@ public class ProductServiceImpl implements ProductService {
         return ResultMap.success(map);
     }
 
-    @Transactional
-    public String updateProduct(Product product){
-        if (product.getId() == null){
-            throw new IllegalOperatorException("所选产品不存在");
-        }
-        Product persistProduct = productDao.findOne(product.getId());
-        ProductModifyHistory productModifyHistory = new ProductModifyHistory();
-        if((persistProduct.getStandard() == 1)&&(persistProduct.getB2cEnabled() == 1)){
-            ProductStandardPutOnInfo productStandardPutOnInfo= productStandardPutOnInfoDao.findByProductid(product.getId());
-            if (product.getPackaging() != null){
-                productStandardPutOnInfo.setPackaging(product.getPackaging());
-                productModifyHistory.setPackaging(product.getPackaging());
-                persistProduct.setPackaging(product.getPackaging());
-            }
-            if (product.getProduceDate() != null){
-                productStandardPutOnInfo.setProduceDate(product.getProduceDate());
-                productModifyHistory.setProduceDate(product.getProduceDate());
-                persistProduct.setProduceDate(product.getProduceDate());
-            }
-            if(productStandardPutOnInfo.getMinBuyQty() != null && productStandardPutOnInfo.getMinBuyQty() != 0  && product.getMinPackQty() != null ){
-                Double multiple = NumberUtil.div(productStandardPutOnInfo.getMinBuyQty(), productStandardPutOnInfo.getMinPackQty());
-                if(multiple == 0){
-                    productStandardPutOnInfo.setMinBuyQty(product.getMinPackQty());
-                }else {
-                    productStandardPutOnInfo.setMinBuyQty(NumberUtil.mul(product.getMinPackQty(), Math.ceil(multiple)));
-                }
-                productStandardPutOnInfo.setMinPackQty(product.getMinPackQty());
-                productModifyHistory.setMinPackQty(product.getMinPackQty());
-                persistProduct.setMinPackQty(product.getMinPackQty());
-            }else if(product.getMinPackQty() != null){
-                productStandardPutOnInfo.setMinPackQty(product.getMinPackQty());
-                productStandardPutOnInfo.setMinBuyQty(product.getMinPackQty());
-                productModifyHistory.setMinPackQty(product.getMinPackQty());
-                persistProduct.setMinPackQty(product.getMinPackQty());
-            }
-            if(productStandardPutOnInfo.getStatus() == Status.AVAILABLE.value()){
-                Goods goods = goodsDao.findByBatchCode(productStandardPutOnInfo.getGoBatch());
-                if(productStandardPutOnInfo.getMinBuyQty() != null && productStandardPutOnInfo.getMinPackQty() != null){
-                    goods.setMinBuyQty(productStandardPutOnInfo.getMinBuyQty());
-                    goods.setMinPackQty(productStandardPutOnInfo.getMinPackQty());
-                }
-                if(NumberUtil.compare(goods.getMinBuyQty(), goods.getReserve()) > 0) {
-                    goods.setStatus(Status.UNAVAILABLE.value());
-                }else {
-                    goods.setStatus(Status.AVAILABLE.value());
-                }
-                if (product.getPackaging() != null){
-                    goods.setPackaging(product.getPackaging());
-                }
-                if (product.getProduceDate() != null){
-                    goods.setProduceDate(product.getProduceDate());
-                }
-                if(NumberUtil.compare(goods.getMinBuyQty(), goods.getReserve()) > 0) {
-                    goods.setStatus(Status.UNAVAILABLE.value());
-                }else {
-                    goods.setStatus(Status.AVAILABLE.value());
-                }
-                GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Modifying.getPhrase(),false);
-                goodsHistoryDao.save(goodsHistory);
-                goodsDao.save(goods);
-
-                //根据库存信息 更新状态为501的订单信息。
-                List<Order> orders1 = orderDetailService.updateOrderDetailsByGoods(goods);
-                orderService.save(orders1);
-                //更新购物车信息
-                cartService.updateCartByGoods(goods);
-
-                // 仓库管理更新包装数量时,同步产品推荐的信息
-                if (goods.getMinPackQty() != null && goods.getReserve() < goods.getMinPackQty()) {
-                    Set<String> batchCodes = new HashSet<>();
-                    batchCodes.add(goods.getBatchCode());
-                    recommendProductService.deleteProductsWhenSellerUpdateReserve(goods.getStoreid(), batchCodes);
-                }
-            }
-            productStandardPutOnInfoDao.save(productStandardPutOnInfo);
-        }else{
-            if (product.getPackaging() != null){
-                persistProduct.setPackaging(product.getPackaging());
-            }
-            if (product.getProduceDate() != null){
-                persistProduct.setProduceDate(product.getProduceDate());
-            }
-            if(product.getMinPackQty() != null){
-                persistProduct.setMinPackQty(product.getMinPackQty());
-            }
-        }
-        productModifyHistory.setEnUU(SystemSession.getUser().getEnterprise().getUu());
-        productModifyHistory.setUserUU(SystemSession.getUser().getUserUU());
-        productModifyHistory.setModifyTime(new Date());
-        productModifyHistory.setProductId(product.getId());
-        productDao.save(persistProduct);
-        productModifyHistoryDao.save(productModifyHistory);
-        return "success";
-    }
-
     private ResultMap validateProductStatus(Long enUU) {
         ProductStoreStatus status = productStoreStatusDao.findByEnuu(enUU);
         if (status != null) {
@@ -1047,29 +943,6 @@ public class ProductServiceImpl implements ProductService {
         return Collections.emptyList();
     }
 
-    /**
-     * 根据标准上架信息 保存对产品包装,包装数量,生产日期的修改
-     *
-     * @param putOnInfo the Goods
-     * @return the string
-     */
-    @Override
-    public Product updateProduct(ProductStandardPutOnInfo putOnInfo) {
-        if(putOnInfo == null) {
-            throw new IllegalOperatorException("传入的信息信息为空");
-        }
-        if(StringUtils.isEmpty(putOnInfo.getProductid())) {
-            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
-        }
-        Product product = productDao.findOne(putOnInfo.getProductid());
-        if(product == null) {
-            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
-        }
-        product.setAvailableOnSale(putOnInfo.getAvailableOnSale());
-        product.setOnSaleQty(putOnInfo.getOnSaleQty());
-        return product;
-    }
-
     /**
      * 保存匹配的信息
      * @param json
@@ -1361,8 +1234,6 @@ public class ProductServiceImpl implements ProductService {
         }
         JSONArray array = FastjsonUtils.fromJsonArray(json);
         List<Product> list = new ArrayList<>();
-        List<ProductStandardPutOnInfo> listPut = new ArrayList<ProductStandardPutOnInfo>();
-        ProductStandardPutOnInfo info = null;
         Integer i = 0;
             for (Object o : array) {
                 JSONObject obj = (JSONObject)o;
@@ -1404,15 +1275,11 @@ public class ProductServiceImpl implements ProductService {
                             product.setEncapsulation(matchResult.getEncapsulation());
                         }
                         product.setCmpImg(matchResult.getImg());
-                        info = new ProductStandardPutOnInfo(product);
-                        info.setStatus(Status.TOBE_ONSALE.value());
-                        listPut.add(info);
                         list.add(product);
                     }
                 }
             }
         List<Product> productList = productDao.save(list);
-        productStandardPutOnInfoDao.save(listPut);
         Map<String, Integer> map = new HashMap<>();
         map.put("success", productList.size());
         map.put("fail", array.size() - productList.size());
@@ -1420,42 +1287,6 @@ public class ProductServiceImpl implements ProductService {
         return ResultMap.success(map);
     }
 
-    /**
-     * 扣减库存
-     *
-     * @param purchase
-     * @return
-     */
-    @Override
-    public ResultMap deductRepositoryQty(Purchase purchase) {
-        List<Product> listPro = new ArrayList<>();
-        List<ProductStandardPutOnInfo> listStand = new ArrayList<>();
-        for (PurchaseDetail detail : purchase.getPurchaseDetails()) {
-            if(detail.getStatus().intValue() == Status.INBOUND.value()) {
-                GoodsHistory goodsHistory = goodsHistoryDao.findNewByBatchCode(detail.getBatchCode());
-               Product product = productDao.findOne(goodsHistory.getProductid());
-                if(product != null) {
-                    Long productId = product.getId();
-                    ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findByProductid(productId);
-                    if(NumberUtil.compare(putOnInfo.getRepositoryQty(), product.getRepositoryQty()) != 0) {
-                        return new ResultMap(CodeType.INFO_UPDATE, "数据已经别更新了,请重新操作");
-                    }
-                    product.setRepositoryQty(NumberUtil.sub(product.getRepositoryQty(), detail.getNumber()));
-                    putOnInfo.setRepositoryQty(product.getRepositoryQty());
-
-                    productDao.save(product);
-                    productStandardPutOnInfoDao.save(putOnInfo);
-
-                    StockInOutHist inOutHist = new StockInOutHist();
-                    inOutHist.convert2StockInOutHist(product, Type.STOCK_SELLER.value());
-                    inOutHist.setStockQty(detail.getNumber());
-                    stockInOutHistDao.save(inOutHist);
-                }
-            }
-        }
-        return ResultMap.success(null);
-    }
-
     /**
      * 保存产品库信息
      *

+ 0 - 391
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductStandardPutOnInfoServiceImpl.java

@@ -1,391 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service.impl;
-
-import com.uas.platform.b2c.common.account.service.EnterpriseService;
-import com.uas.platform.b2c.prod.commodity.dao.*;
-import com.uas.platform.b2c.prod.commodity.model.*;
-import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
-import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.persistence.criteria.CriterionExpression;
-import com.uas.platform.core.persistence.criteria.LogicalExpression;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import com.uas.platform.core.persistence.criteria.SimpleExpression;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * Created by yujia on 2017/7/13.
- */
-@Service
-public class ProductStandardPutOnInfoServiceImpl implements ProductStandardPutOnInfoService{
-
-    private final ProductStandardPutOnInfoDao productStandardPutOnInfoDao;
-
-    @Autowired
-    private GoodsDao goodsDao;
-
-    @Autowired
-    private GoodsHistoryService goodsHistoryService;
-
-    private final ProductDao productDao;
-
-    private final GoodsHistoryDao goodsHistoryDao;
-
-    @Autowired
-    private GoodsService goodsService;
-
-    private final EnterpriseService enterpriseService;
-
-    private final ProductStandardPutOnInfoHistoryDao standardPutOnInfoHistoryDao;
-
-    @Autowired
-    public ProductStandardPutOnInfoServiceImpl(ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, GoodsHistoryDao goodsHistoryDao, EnterpriseService enterpriseService, ProductStandardPutOnInfoHistoryDao standardPutOnInfoHistoryDao) {
-        this.productStandardPutOnInfoDao = productStandardPutOnInfoDao;
-        this.productDao = productDao;
-        this.goodsHistoryDao = goodsHistoryDao;
-        this.enterpriseService = enterpriseService;
-        this.standardPutOnInfoHistoryDao = standardPutOnInfoHistoryDao;
-    }
-
-    @Override
-    public Page<ProductStandardPutOnInfo> getProductStandardPutOnInfoByPage(PageParams params, String keyword) {
-        final PageInfo info = new PageInfo(params);
-        if(!StringUtils.isEmpty(keyword)) {
-            SimpleExpression[] simpArrs = new SimpleExpression[3];
-            simpArrs[0] = new SimpleExpression("kindCn", keyword, CriterionExpression.Operator.LIKE, true);
-            simpArrs[1] = new SimpleExpression("brandEn", keyword, CriterionExpression.Operator.LIKE, true);
-            simpArrs[2] = new SimpleExpression("cmpCode", keyword, CriterionExpression.Operator.LIKE, true);
-            LogicalExpression logical = new LogicalExpression(simpArrs, CriterionExpression.Operator.OR);
-            info.expression(logical);
-        }
-        info.filter("enuu", SystemSession.getUser().getEnterprise().getUu());
-        return productStandardPutOnInfoDao.findAll(new Specification<ProductStandardPutOnInfo>() {
-            @Override
-            public Predicate toPredicate(Root<ProductStandardPutOnInfo> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
-                query.where(info.getPredicates(root, query, cb));
-                return null;
-            }
-        }, info);
-    }
-
-    /**
-     * 一键更新标准上架信息,将可上架数变为在售数量
-     *
-     * @return
-     */
-    @Override
-    public ResultMap updateProductStandardPutOnInfoByBatch() {
-        List<ProductStandardPutOnInfo> onInfoByEnuu = productStandardPutOnInfoDao.getProductStandardPutOnInfoByEnuu(SystemSession.getUser().getEnterprise().getUu());
-        List<Goods> list = new ArrayList<>();
-        List<String> uuids = new ArrayList<>();
-        List<GoodsHistory> listHist = new ArrayList<GoodsHistory>();
-        List<Product> listPro = new ArrayList<>();
-        List<ProductStandardPutOnInfo> putOnInfos = new ArrayList<ProductStandardPutOnInfo>();
-        List<ProductStandardPutOnInfoHistory> putOnInfoHistorys = new ArrayList<>();
-        for (ProductStandardPutOnInfo standardPutOnInfo : onInfoByEnuu) {
-            if(standardPutOnInfo.getStatus().intValue() == Status.TOBE_LOAD.value() ||
-                    standardPutOnInfo.getStatus().intValue() == Status.REMOVED.value() ||
-                    standardPutOnInfo.getStatus().intValue() == Status.TOBE_ONSALE.value()) {
-                //待入库状态
-                continue;
-            }
-
-            Goods goods = goodsDao.findByBatchCode(standardPutOnInfo.getGoBatch());
-            if(goods != null){
-                if(NumberUtil.compare(standardPutOnInfo.getAvailableOnSale(), 0.0) > 0) {
-                    goods.setReserve(NumberUtil.add(goods.getReserve(), standardPutOnInfo.getAvailableOnSale()));
-                    //如果可上架数量不为0,则更新上次库存数量
-                    if(standardPutOnInfo.getAvailableOnSale() != null && (NumberUtil.compare(standardPutOnInfo.getAvailableOnSale(), 0.0D) != 0)) {
-                        goods.setLastReserve(goods.getReserve());
-                    }
-                    if(goods.getMinBuyQty().doubleValue() <= goods.getReserve().doubleValue()) {
-                        goods.setStatus(Status.AVAILABLE.value());
-                    }
-                    List<GoodsQtyPrice> goodsPrices = goods.getPrices();
-                    if(NumberUtil.compare(goodsPrices.get(goodsPrices.size() - 1).getEnd(), goods.getReserve()) < 0) {
-                        goodsPrices.get(goodsPrices.size() - 1).setEnd(goods.getReserve());
-                        goods.setQtyPrice(FastjsonUtils.toJson(goodsPrices));
-                    }
-                    GoodsHistory history = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.AddReserve.getPhrase(),false);
-                    listHist.add(history);
-                    list.add(goods);
-                    uuids.add(goods.getUuid());
-
-                    standardPutOnInfo.setOnSaleQty(goods.getReserve());
-                    standardPutOnInfo.setQtyPrice(goods.getQtyPrice());
-                    standardPutOnInfo.setAvailableOnSale((double)0);
-
-                    ProductStandardPutOnInfoHistory infoHistory = new ProductStandardPutOnInfoHistory();
-                    ProductStandardPutOnInfoHistory infoHistory1 = infoHistory.convert2History(standardPutOnInfo, "用户一键更新上架标准信信息");
-                    putOnInfoHistorys.add(infoHistory1);
-
-                    Product product = productDao.findOne(standardPutOnInfo.getProductid());
-                    if(product != null) {
-                        product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-                        product.setAvailableOnSale((double)0);
-                        listPro.add(product);
-                    }
-                    putOnInfos.add(standardPutOnInfo);
-                }
-            }
-        }
-        updateAssociateByBatch(list, listHist, listPro, putOnInfos, putOnInfoHistorys);
-
-        for (String uuid : uuids) {
-            goodsService.updateComponentTradeInfos(uuid);
-        }
-        return ResultMap.success(putOnInfos.size());
-    }
-
-
-    /**
-     * 根据库存信息更新标准上架信息
-     *
-     * @param goods 库存
-     * @return
-     */
-    @Override
-    public ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods) {
-        if(goods == null) {
-            throw new IllegalOperatorException("传入的信息丢失");
-        }
-        if(StringUtils.isEmpty(goods.getStandprodid())) {
-            throw new IllegalOperatorException("库存信息关联的标准上架信息为空");
-        }
-        ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-        if(putOnInfo == null) {
-            throw new IllegalOperatorException("商品关联的标准上架信息不存在");
-        }
-        putOnInfo.setMinBuyQty(goods.getMinBuyQty());
-        putOnInfo.setMaxDelivery(goods.getMaxDelivery());
-        putOnInfo.setMinDelivery(goods.getMinDelivery());
-        putOnInfo.setQtyPrice(goods.getQtyPrice());
-        putOnInfo.setImg(goods.getImg());
-        return putOnInfo;
-    }
-
-    /**
-     * 一键更新标准上架信息,将可上架数变为在售数量
-     *
-     * @return
-     */
-    @Transactional
-    @Override
-    public void updateAssociateByBatch(List<Goods> list, List<GoodsHistory> listHist, List<Product> listPro, List<ProductStandardPutOnInfo> putOnInfos, List<ProductStandardPutOnInfoHistory> putOnInfoHistoryList) {
-        productDao.save(listPro);
-        goodsDao.save(list);
-        goodsHistoryDao.save(listHist);
-        productStandardPutOnInfoDao.save(putOnInfos);
-        standardPutOnInfoHistoryDao.save(putOnInfoHistoryList);
-    }
-
-    /**
-     * 更新标准上架的信息
-     *
-     * @param productStandardPutOnInfo
-     * @return
-     */
-    @Override
-    public ProductStandardPutOnInfo updateProductStandardPutOnInfo(ProductStandardPutOnInfo productStandardPutOnInfo) {
-        return null;
-    }
-
-    /**
-     * 用户上架
-     *
-     * @param productStandardPutOnInfo
-     * @return
-     */
-    @Transactional
-    @Override
-    public ResultMap productStandardPutOnInfoPutOn(ProductStandardPutOnInfo productStandardPutOnInfo) {
-        if(productStandardPutOnInfo == null) {
-            return new ResultMap(CodeType.NO_INFO.code(), "信息被丢失");
-        }
-        Goods goods = new Goods();
-        ResultMap resultMap = enterpriseService.getCurrencyByRegisterAddress();
-        if(resultMap.getCode() == CodeType.OK.code()) {
-            if(productStandardPutOnInfo.getCurrency() == null) {
-                productStandardPutOnInfo.setCurrency((String) resultMap.getData());
-            }
-        }else {
-            return resultMap;
-        }
-        productStandardPutOnInfo.convertToGoods(goods);
-        Goods goods1 = goodsService.publish(goods, "NORMARL(B2C)");
-        if(goods1 == null) {
-            return new ResultMap(CodeType.NOT_COMPLETE_INFO.code(), "上架失败");
-        }
-        productStandardPutOnInfo.setStatus(Status.AVAILABLE.value());
-        productStandardPutOnInfo.setGoBatch(goods1.getBatchCode());
-
-        Product product = productDao.findOne(productStandardPutOnInfo.getProductid());
-        product.setAvailableOnSale(productStandardPutOnInfo.getAvailableOnSale());
-        product.setOnSaleQty(productStandardPutOnInfo.getOnSaleQty());
-        product.setLockQty(productStandardPutOnInfo.getLockQty());
-        productDao.save(product);
-
-        ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.save(productStandardPutOnInfo);
-
-        ProductStandardPutOnInfoHistory infoHistory = new ProductStandardPutOnInfoHistory();
-        ProductStandardPutOnInfoHistory infoHistory1 = infoHistory.convert2History(putOnInfo, "用户上架标准信息");
-        standardPutOnInfoHistoryDao.save(infoHistory1);
-
-        return ResultMap.success(putOnInfo);
-    }
-
-    @Override
-    public List<ProductStandardPutOnInfo> getProductStandardPutOnInfo(String keyword) {
-        final PageInfo page = new PageInfo();
-        page.setPageNumber(1);
-        page.setPageSize(10);
-
-        List<ProductStandardPutOnInfo> infos = new ArrayList<ProductStandardPutOnInfo>();
-        page.filter("enuu", SystemSession.getUser().getEnterprise().getUu());
-        if(StringUtils.hasText(keyword)) {
-            SimpleExpression kind = PredicateUtils.like("kindCn", keyword, true);
-            SimpleExpression brandEn = PredicateUtils.like("brandEn", keyword, true);
-            SimpleExpression cmpCode = PredicateUtils.like("cmpCode", keyword, true);
-            SimpleExpression[] expressions2 = new SimpleExpression[] {kind, brandEn, cmpCode};
-            LogicalExpression logicalExpression2 = PredicateUtils.or(expressions2);
-            page.expression(logicalExpression2);
-        }
-        infos = productStandardPutOnInfoDao.findAll(new Specification<ProductStandardPutOnInfo>() {
-            @Override
-            public Predicate toPredicate(Root<ProductStandardPutOnInfo> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
-                query.where(page.getPredicates(root, query, cb));
-                return null;
-            }
-        });
-
-        Collections.sort(infos, new Comparator<ProductStandardPutOnInfo>() {
-            @Override
-            public int compare(ProductStandardPutOnInfo o1, ProductStandardPutOnInfo o2) {
-                return o2.getId().compareTo(o1.getId());
-            }
-        });
-        return infos;
-    }
-
-    /**
-     * 更新产品的在售数量
-     *
-     * @param goods
-     * @param reserve
-     * @return
-     */
-    @Transactional
-    @Override
-    public ResultMap updateOnSaleQty(Goods goods, Double reserve) {
-        if(goods == null) {
-            throw new IllegalOperatorException("对应的商品信息丢失,请刷新界面之后重新操作");
-        }
-        if(NumberUtil.compare(reserve, 0.0) < 0) {
-            throw new IllegalOperatorException("修改之后的库存不能为负数");
-        }
-
-        ProductStandardPutOnInfo onInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-        if(onInfo == null) {
-            throw new IllegalOperatorException("商品信息找不到对应的标准上架信息");
-        }
-        if(NumberUtil.compare(onInfo.getOnSaleQty(), goods.getReserve()) != 0) {
-            throw new IllegalOperatorException("对应的标准上架信息已经被更新,请刷新之后重新操作");
-        }
-        Long productid = onInfo.getProductid();
-        Product product = productDao.findOne(productid);
-        if(product == null) {
-            throw new IllegalOperatorException("对应的标准产品信息缺失");
-        }
-        if(NumberUtil.compare(product.getOnSaleQty(), onInfo.getOnSaleQty()) != 0) {
-            throw new IllegalOperatorException("对应的标准产品信息已经被更新,请刷新之后重新操作");
-        }
-
-        onInfo.setOnSaleQty(reserve);
-        product.setOnSaleQty(reserve);
-
-        productDao.save(product);
-        productStandardPutOnInfoDao.save(onInfo);
-
-        ProductStandardPutOnInfoHistory infoHistory = new ProductStandardPutOnInfoHistory();
-        ProductStandardPutOnInfoHistory infoHistory1 = infoHistory.convert2History(onInfo, "买家下订单,扣减库存");
-        standardPutOnInfoHistoryDao.save(infoHistory1);
-
-        return ResultMap.success(onInfo);
-    }
-
-    /**
-     * 更新可上架数量的个数,业务模型(当前此商品已经下架,但是客户有库存返回,此时需要将数量增加到可上架数量上)
-     *
-     * @param id
-     * @return
-     */
-    @Override
-    public ResultMap updateAvailableQty(Long id, Double qty) {
-        if(NumberUtil.compare(qty, 0.0) < 0) {
-            return new ResultMap(CodeType.NOT_PERMIT.code(), "变动的可上架数量不能为负数");
-        }
-
-        ProductStandardPutOnInfo onInfo = productStandardPutOnInfoDao.findOne(id);
-        if(onInfo == null) {
-            throw new IllegalOperatorException("商品信息找不到对应的标准上架信息");
-        }
-        Long productid = onInfo.getProductid();
-        Product product = productDao.findOne(productid);
-        if(NumberUtil.compare(product.getAvailableOnSale(), onInfo.getAvailableOnSale()) != 0) {
-            throw new IllegalOperatorException("对应的标准产品信息已经被更新,请刷新之后重新操作");
-        }
-        onInfo.setAvailableOnSale(NumberUtil.add(onInfo.getAvailableOnSale(), qty));
-        product.setAvailableOnSale(NumberUtil.add(product.getAvailableOnSale(), qty));
-        ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.save(onInfo);
-        productDao.save(product);
-        ProductStandardPutOnInfoHistory infoHistory = new ProductStandardPutOnInfoHistory();
-        ProductStandardPutOnInfoHistory infoHistory1 = infoHistory.convert2History(putOnInfo, "批次下架,释放库存");
-        standardPutOnInfoHistoryDao.save(infoHistory1);
-
-        return ResultMap.success(product);
-    }
-
-    /**
-     * 单个保存标准上架信息
-     *
-     * @param putOnInfo 上架信息
-     * @return
-     */
-    @Override
-    public ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo) {
-        return productStandardPutOnInfoDao.save(putOnInfo);
-    }
-
-    /**
-     * 批量保存标准上架信息
-     *
-     * @param putOnInfos 标准上架信息
-     * @return
-     */
-    @Override
-    public List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos) {
-        return productStandardPutOnInfoDao.save(putOnInfos);
-    }
-}

+ 0 - 52
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/StockInOutHistServiceImpl.java

@@ -1,52 +0,0 @@
-package com.uas.platform.b2c.prod.commodity.service.impl;
-
-import com.uas.platform.b2c.prod.commodity.dao.StockInOutHistDao;
-import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
-import com.uas.platform.b2c.prod.commodity.service.StockInOutHistService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * Created by yujia on 2017/7/10.
- */
-@Service
-public class StockInOutHistServiceImpl implements StockInOutHistService{
-
-    private final StockInOutHistDao stockInOutHistDao;
-
-    @Autowired
-    public StockInOutHistServiceImpl(StockInOutHistDao stockInOutHistDao) {
-        this.stockInOutHistDao = stockInOutHistDao;
-    }
-
-    /**
-     * 保存出入库的历史记录
-     *
-     * @param inOutHist
-     * @return ResultMap
-     */
-    @Override
-    public StockInOutHist save(StockInOutHist inOutHist) {
-        return stockInOutHistDao.save(inOutHist);
-    }
-
-
-    /**
-     * @param prodId 根据产品的id  prodId获取出入库的记录
-     * @return List<StockInOutHist>
-     */
-    @Override
-    public List<StockInOutHist> getStockInOutHistByProdId(Long prodId) {
-        if(prodId == null) {
-            return null;
-        }
-        return stockInOutHistDao.findStockInOutHistByProdidOrderByOperateDateDesc(prodId);
-    }
-
-    @Override
-    public int getCountByenuuAndIoSellerType(long enuu, int type) {
-        return stockInOutHistDao.getCountByenuuAndIoSellerType(enuu,type);
-    }
-}