|
@@ -1,10 +1,17 @@
|
|
package com.zkqy.business.controller;
|
|
package com.zkqy.business.controller;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Set;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
+import com.zkqy.business.domain.Customer;
|
|
import com.zkqy.business.domain.ProductInvoice;
|
|
import com.zkqy.business.domain.ProductInvoice;
|
|
|
|
+import com.zkqy.business.domain.Production;
|
|
import com.zkqy.business.domain.vo.ProductCodeListVO;
|
|
import com.zkqy.business.domain.vo.ProductCodeListVO;
|
|
|
|
+import com.zkqy.business.mapper.ProductionMapper;
|
|
|
|
+import com.zkqy.common.utils.DateUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -25,6 +32,7 @@ import com.zkqy.business.domain.ProductInventory;
|
|
import com.zkqy.business.service.IProductInventoryService;
|
|
import com.zkqy.business.service.IProductInventoryService;
|
|
import com.zkqy.common.utils.poi.ExcelUtil;
|
|
import com.zkqy.common.utils.poi.ExcelUtil;
|
|
import com.zkqy.common.core.page.TableDataInfo;
|
|
import com.zkqy.common.core.page.TableDataInfo;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 产品库存Controller
|
|
* 产品库存Controller
|
|
@@ -39,6 +47,9 @@ public class ProductInventoryController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private IProductInventoryService productInventoryService;
|
|
private IProductInventoryService productInventoryService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProductionMapper productionMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询产品库存列表
|
|
* 查询产品库存列表
|
|
*/
|
|
*/
|
|
@@ -154,6 +165,65 @@ public class ProductInventoryController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 综合库存列表
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/comprehensiveInventoryList")
|
|
|
|
+ public TableDataInfo comprehensiveInventoryList(ProductCodeListVO productCodeListVO) {
|
|
|
|
+ startPage();
|
|
|
|
+ List<ProductCodeListVO> list = productInventoryService.comprehensiveInventoryList(productCodeListVO);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// @Log(title = "库存管理", businessType = BusinessType.IMPORT)
|
|
|
|
+// //@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
|
|
+// @PostMapping("/importData")
|
|
|
|
+// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
|
|
|
+// ExcelUtil<ProductInventory> util = new ExcelUtil<ProductInventory>(ProductInventory.class);
|
|
|
|
+// //成品库存数据
|
|
|
|
+// List<ProductInventory> productInventoryList = util.importExcel(file.getInputStream());
|
|
|
|
+//
|
|
|
|
+// //未成功导入库存
|
|
|
|
+// List<ProductInventory> errorList = new ArrayList<>();
|
|
|
|
+// // 产品类型
|
|
|
|
+// Set<String> productTypeList = new HashSet<>();
|
|
|
|
+//
|
|
|
|
+// //处理excel数据,将产品名称设置为类型+品名+规格
|
|
|
|
+// for (ProductInventory productInventory : productInventoryList){
|
|
|
|
+// String productName = productInventory.getProductType() + productInventory.getProductName()
|
|
|
|
+// + productInventory.getSpecifications();
|
|
|
|
+// Long productId = productionMapper.aaaa(productName);
|
|
|
|
+//
|
|
|
|
+// if(productId == null){
|
|
|
|
+// errorList.add(productInventory);
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// //根据类型判断所属仓库
|
|
|
|
+// if(productInventory.getProductType().trim().equals("POY")){
|
|
|
|
+// productInventory.setWarehouseId(7L);
|
|
|
|
+// }else if(productInventory.getProductType().trim().equals("BTS")){
|
|
|
|
+// productInventory.setWarehouseId(6L);
|
|
|
|
+// }else {
|
|
|
|
+// productInventory.setWarehouseId(1L);
|
|
|
|
+// }
|
|
|
|
+// productInventory.setProductId(productId);
|
|
|
|
+//// productTypeList.add(productInventory.getProductType());
|
|
|
|
+// productInventory.setCreateBy(getUsername());
|
|
|
|
+// productInventory.setCreateById(getUserId());
|
|
|
|
+// productInventory.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// return success(productInventoryService.batchInsertProductInventory(productInventoryList));
|
|
|
|
+//// return success(customerService.batchInsertCustomer(userList));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @PostMapping("/importTemplate")
|
|
|
|
+// public void importTemplate(HttpServletResponse response) {
|
|
|
|
+// ExcelUtil<ProductInventory> util = new ExcelUtil<ProductInventory>(ProductInventory.class);
|
|
|
|
+// util.importTemplateExcel(response, "库存数据");
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|