2,3,5楼仓储看板接口
parent
5755eb05d8
commit
6537852996
@ -0,0 +1,34 @@
|
||||
package com.hw.wms.board.controller;
|
||||
|
||||
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.wms.board.service.FifthWmsBorderService;
|
||||
import com.hw.wms.board.service.SecondWmsBorderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/FifthWmsBorder")
|
||||
public class FifthWmsBorderController {
|
||||
@Autowired
|
||||
private FifthWmsBorderService fifthWmsBorderService;
|
||||
|
||||
/**
|
||||
* 五楼库存数量
|
||||
*/
|
||||
@GetMapping("/locationCount")
|
||||
public AjaxResult locationCount(){
|
||||
return AjaxResult.success(fifthWmsBorderService.locationCount());
|
||||
}
|
||||
/**
|
||||
* 库存饼状图
|
||||
*/
|
||||
@GetMapping("fifthPanake")
|
||||
public AjaxResult fifthPanake(){
|
||||
return AjaxResult.success(fifthWmsBorderService.fifthPanake());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.hw.wms.board.controller;
|
||||
|
||||
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.wms.board.service.SecondWmsBorderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/SecondWmsBorder")
|
||||
public class SecondWmsBorderController {
|
||||
@Autowired
|
||||
private SecondWmsBorderService secondWmsBorderService;
|
||||
|
||||
/**
|
||||
* 库存总量统计
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/totalStock")
|
||||
public AjaxResult totalStock(){
|
||||
return AjaxResult.success(secondWmsBorderService.totalStock());
|
||||
}
|
||||
/**
|
||||
* 库位原理统计
|
||||
*/
|
||||
@GetMapping("/locationCount")
|
||||
public AjaxResult locationCount(){
|
||||
return AjaxResult.success(secondWmsBorderService.locationCount());
|
||||
}
|
||||
/**
|
||||
* 任务编号
|
||||
*/
|
||||
@GetMapping("/tableInfo")
|
||||
public AjaxResult tableInfo(){
|
||||
return AjaxResult.success(secondWmsBorderService.tableInfo());
|
||||
}
|
||||
/**
|
||||
* 库存变化折线图
|
||||
*/
|
||||
@GetMapping("/inAndOutStockInfo")
|
||||
public AjaxResult inAndOutStockInfo(){
|
||||
return AjaxResult.success(secondWmsBorderService.inAndOutStockInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库时段统计
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/instockTimeCount")
|
||||
public AjaxResult instockTimeCount(){
|
||||
return AjaxResult.success(secondWmsBorderService.instockTimeCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* 当日入库量
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/todayInstockAmount")
|
||||
public AjaxResult todayInstockAmount(){
|
||||
return AjaxResult.success(secondWmsBorderService.todayInstockAmount());
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.hw.wms.board.controller;
|
||||
|
||||
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.wms.board.service.SecondWmsBorderService;
|
||||
import com.hw.wms.board.service.ThirdWmsBorderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ThirdWmsBorder")
|
||||
public class ThirdWmsBorderController {
|
||||
|
||||
@Autowired
|
||||
private ThirdWmsBorderService thirdWmsBorderService;
|
||||
|
||||
/**
|
||||
* 单月原材料出入库统计
|
||||
*/
|
||||
@GetMapping("/monthRawAmount")
|
||||
public AjaxResult monthRawAmount(){
|
||||
return AjaxResult.success(thirdWmsBorderService.monthRawAmount());
|
||||
}
|
||||
/**
|
||||
* 三楼仓库库位状态
|
||||
*/
|
||||
@GetMapping("/locationStatus")
|
||||
public AjaxResult locationStatus(){
|
||||
return AjaxResult.success(thirdWmsBorderService.locationStatus());
|
||||
}
|
||||
/**
|
||||
* 生产计划
|
||||
*/
|
||||
@GetMapping("/productPlan")
|
||||
public AjaxResult productPlan(){
|
||||
return AjaxResult.success(thirdWmsBorderService.productPlan());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.hw.wms.board.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class RecordIotenvInstant {
|
||||
private Long objId;
|
||||
private String monitorId;
|
||||
private BigDecimal tempreture;
|
||||
private BigDecimal humidity;
|
||||
private BigDecimal illuminance;
|
||||
private BigDecimal noise;
|
||||
private BigDecimal concentration;
|
||||
private BigDecimal pm1;
|
||||
private BigDecimal pm2;
|
||||
private BigDecimal pm10;
|
||||
private BigDecimal standBy;
|
||||
private Date collectTime;
|
||||
private Date recodeTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.hw.wms.board.service;
|
||||
|
||||
|
||||
import com.hw.wms.domain.WmsProductInstock;
|
||||
import com.hw.wms.domain.WmsProductOutstockDetail;
|
||||
import com.hw.wms.domain.WmsProductStock;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FifthWmsBorderService {
|
||||
|
||||
|
||||
Map locationCount();
|
||||
|
||||
Map fifthPanake();
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.hw.wms.board.service;
|
||||
|
||||
|
||||
import com.hw.wms.domain.WmsProductInstock;
|
||||
import com.hw.wms.domain.WmsProductOutstock;
|
||||
import com.hw.wms.domain.WmsProductOutstockDetail;
|
||||
import com.hw.wms.domain.WmsProductStock;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SecondWmsBorderService {
|
||||
|
||||
List<WmsProductStock> totalStock();
|
||||
|
||||
Map<String, BigDecimal> locationCount();
|
||||
|
||||
List<WmsProductOutstockDetail> tableInfo();
|
||||
|
||||
List<WmsProductInstock> inAndOutStockInfo();
|
||||
|
||||
Map<String,Integer> instockTimeCount();
|
||||
|
||||
BigDecimal todayInstockAmount();
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.hw.wms.board.service;
|
||||
|
||||
import com.hw.wms.domain.WmsBaseLocation;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ThirdWmsBorderService {
|
||||
Map monthRawAmount();
|
||||
|
||||
List<WmsBaseLocation> locationStatus();
|
||||
|
||||
List<WmsRawOutstock> productPlan();
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.hw.wms.board.service.impl;
|
||||
|
||||
import com.hw.wms.board.service.FifthWmsBorderService;
|
||||
import com.hw.wms.board.service.SecondWmsBorderService;
|
||||
import com.hw.wms.domain.*;
|
||||
import com.hw.wms.mapper.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
|
||||
@Autowired
|
||||
private WmsProductStockMapper wmsProductStockMapper;
|
||||
@Autowired
|
||||
private WmsRawInstockMapper wmsRawInstockMapper;
|
||||
@Autowired
|
||||
private WmsRawOutstockMapper wmsRawOutstockMapper;
|
||||
@Autowired
|
||||
private WmsProductInstockMapper wmsProductInstockMapper;
|
||||
@Autowired
|
||||
private WmsProductOutstockMapper wmsProductOutstockMapper;
|
||||
@Autowired
|
||||
private WmsRawStockMapper wmsRawStockMapper;
|
||||
@Autowired
|
||||
private WmsBaseLocationMapper wmsBaseLocationMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Map locationCount() {
|
||||
HashMap map = new HashMap<>();
|
||||
List<WmsProductInstock> list = wmsRawInstockMapper.locationCount();
|
||||
List<WmsRawOutstock> list1 = wmsRawOutstockMapper.locationCount();
|
||||
List<WmsProductInstock> list2 = wmsProductInstockMapper.locationCount();
|
||||
List<WmsProductOutstock> list3 = wmsProductOutstockMapper.locationCount();
|
||||
for (WmsProductInstock wmsProductInstock : list) {
|
||||
if (wmsProductInstock.getWarehouseId()==511){
|
||||
map.put("rawInStock",wmsProductInstock.getInstockAmount());
|
||||
}
|
||||
if (wmsProductInstock.getWarehouseId()==512){
|
||||
map.put("furawInStock",wmsProductInstock.getInstockAmount());
|
||||
}
|
||||
}
|
||||
map.put("rawOutStock",list1.get(0).getOutstockAmount());
|
||||
map.put("productInStock",list2.get(0).getInstockAmount());
|
||||
map.put("productOutStock",list3.get(0).getOutstockQty());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map fifthPanake() {
|
||||
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectRawLocationPercentage();
|
||||
List<WmsProductStock> productStocks = wmsProductStockMapper.selectProductStockPercentage();
|
||||
Integer emptyLocationCount = wmsBaseLocationMapper.selectEmptyLocation();
|
||||
Integer allLocation = wmsBaseLocationMapper.selectAllLocation();
|
||||
BigDecimal emptyLocationPercentage = new BigDecimal(emptyLocationCount).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP);
|
||||
Integer oppylLocation = allLocation - emptyLocationCount;
|
||||
BigDecimal opplyLocationPercentage = new BigDecimal(oppylLocation).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("wmsRawStocks",wmsRawStocks);
|
||||
map.put("productStocks",productStocks);
|
||||
map.put("emptyLocationPercentage",emptyLocationPercentage);
|
||||
map.put("opplyLocationPercentage",opplyLocationPercentage);
|
||||
return map;
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.hw.wms.board.service.impl;
|
||||
|
||||
import com.hw.wms.board.service.SecondWmsBorderService;
|
||||
import com.hw.wms.domain.WmsProductInstock;
|
||||
import com.hw.wms.domain.WmsProductOutstock;
|
||||
import com.hw.wms.domain.WmsProductOutstockDetail;
|
||||
import com.hw.wms.domain.WmsProductStock;
|
||||
import com.hw.wms.mapper.WmsProductStockMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
|
||||
@Autowired
|
||||
private WmsProductStockMapper wmsProductStockMapper;
|
||||
|
||||
@Override
|
||||
public List<WmsProductStock> totalStock() {
|
||||
return wmsProductStockMapper.totalStock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal todayInstockAmount() {
|
||||
BigDecimal result = wmsProductStockMapper.todayInstockAmount();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> instockTimeCount() {
|
||||
HashMap<String, Integer> result = new HashMap<>();
|
||||
int oneWeekCount = wmsProductStockMapper.selectOneWeek();
|
||||
int twoWeekCount = wmsProductStockMapper.selectTwoWeek();
|
||||
int oneMonthCount = wmsProductStockMapper.selectOneMonth();
|
||||
int halfYearCount = wmsProductStockMapper.selectHalfYear();
|
||||
result.put("oneWeekCount",oneWeekCount);
|
||||
result.put("twoWeekCount",twoWeekCount);
|
||||
result.put("oneMonthCount",oneMonthCount);
|
||||
result.put("halfYearCount",halfYearCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsProductInstock> inAndOutStockInfo() {
|
||||
List<WmsProductInstock> instocks = wmsProductStockMapper.selectInStock();
|
||||
List<WmsProductOutstock> outstocks = wmsProductStockMapper.selectOutStock();
|
||||
Map<Long,List<WmsProductOutstock>> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getProductId));
|
||||
for (WmsProductInstock instock : instocks) {
|
||||
WmsProductOutstock wmsProductOutstock = map.get(instock.getProductId()).get(0);
|
||||
instock.setOutStockAmount(wmsProductOutstock.getOutstockQty());
|
||||
}
|
||||
return instocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsProductOutstockDetail> tableInfo() {
|
||||
return wmsProductStockMapper.tableInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, BigDecimal> locationCount() {
|
||||
int availibleLocation = wmsProductStockMapper.selectAvailibleLocation();
|
||||
int toatlLocation = wmsProductStockMapper.selectTotalLocation();
|
||||
int opplyLocation = wmsProductStockMapper.selectOpplyLocation();
|
||||
HashMap<String, BigDecimal> result = new HashMap<>();
|
||||
BigDecimal bigDecimal = new BigDecimal(toatlLocation);
|
||||
BigDecimal availibleRate = new BigDecimal(availibleLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal opplyRate = new BigDecimal(opplyLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
|
||||
result.put("availibleRate",availibleRate);
|
||||
result.put("opplyRate",opplyRate);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.hw.wms.board.service.impl;
|
||||
|
||||
import com.hw.wms.board.service.ThirdWmsBorderService;
|
||||
import com.hw.wms.domain.WmsBaseLocation;
|
||||
import com.hw.wms.domain.WmsRawOutstock;
|
||||
import com.hw.wms.mapper.WmsBaseLocationMapper;
|
||||
import com.hw.wms.mapper.WmsRawInstockMapper;
|
||||
import com.hw.wms.mapper.WmsRawOutstockMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ThirdWmsBorderServiceImpl implements ThirdWmsBorderService {
|
||||
@Autowired
|
||||
private WmsRawInstockMapper wmsRawInstockMapper;
|
||||
@Autowired
|
||||
private WmsRawOutstockMapper wmsRawOutstockMapper;
|
||||
@Autowired
|
||||
private WmsBaseLocationMapper wmsBaseLocationMapper;
|
||||
|
||||
@Override
|
||||
public Map monthRawAmount() {
|
||||
BigDecimal monthRawInAmount = wmsRawInstockMapper.monthRawInAmount();
|
||||
BigDecimal monthRawOutAmount = wmsRawOutstockMapper.monthRawOutAmount();
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("monthRawInAmount",monthRawInAmount);
|
||||
hashMap.put("monthRawOutAmount",monthRawOutAmount);
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsRawOutstock> productPlan() {
|
||||
return wmsRawOutstockMapper.productPlan();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsBaseLocation> locationStatus() {
|
||||
List<WmsBaseLocation> list = wmsBaseLocationMapper.locationStatus();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue