移除掉拆分的接口

This commit is contained in:
jishenghua 2024-02-04 00:16:32 +08:00
parent 847acce9a4
commit 8f2ea06175
5 changed files with 12 additions and 268 deletions

View File

@ -463,12 +463,12 @@ public class DepotHeadController {
}
/**
* 统计今日采购额昨日采购额本月采购额今年采购额|销售额|零售额后续将废弃
* 统计今日采购额昨日采购额本月采购额今年采购额|销售额|零售额
* @param request
* @return
*/
@GetMapping(value = "/getBuyAndSaleStatistics")
@ApiOperation(value = "统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额——后续将废弃")
@ApiOperation(value = "统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额")
public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
@ -490,34 +490,6 @@ public class DepotHeadController {
return res;
}
/**
* 分别统计今日(today)采购额昨日(yesterday)采购额本月(month)采购额今年(year)采购额|销售额|零售额
* @param request
* @return
*/
@GetMapping(value = "/getBuyAndSaleStatisticsByType")
@ApiOperation(value = "统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额")
public BaseResponseInfo getBuyAndSaleStatisticsByType(@RequestParam("type") String type, HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
String today = Tools.getNow() + BusinessConstants.DAY_FIRST_TIME;
String monthFirstDay = Tools.firstDayOfMonth(Tools.getCurrentMonth()) + BusinessConstants.DAY_FIRST_TIME;
String yesterdayBegin = Tools.getYesterday() + BusinessConstants.DAY_FIRST_TIME;
String yesterdayEnd = Tools.getYesterday() + BusinessConstants.DAY_LAST_TIME;
String yearBegin = Tools.getYearBegin() + BusinessConstants.DAY_FIRST_TIME;
String yearEnd = Tools.getYearEnd() + BusinessConstants.DAY_LAST_TIME;
Map<String, Object> map = depotHeadService.getBuyAndSaleStatisticsByType(type, today, monthFirstDay,
yesterdayBegin, yesterdayEnd, yearBegin, yearEnd, request);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据当前用户获取操作员数组用于控制当前用户的数据权限限制可以看到的单据范围
* 注意该接口提供给部分插件使用勿删

View File

@ -792,14 +792,14 @@ public class DepotItemController {
}
/**
* 统计采购销售零售的总金额后续将废弃
* 统计采购销售零售的总金额
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/buyOrSalePrice")
@ApiOperation(value = "统计采购、销售、零售的总金额——后续将废弃")
@ApiOperation(value = "统计采购、销售、零售的总金额")
public BaseResponseInfo buyOrSalePrice(HttpServletRequest request,
HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
@ -848,117 +848,6 @@ public class DepotItemController {
return res;
}
/**
* 统计采购的总金额
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/getBuyPrice")
@ApiOperation(value = "统计采购的总金额")
public BaseResponseInfo getBuyPrice(HttpServletRequest request,
HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<>();
try {
Long userId = userService.getUserId(request);
String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit();
List<String> list = Tools.getLastMonths(6);
JSONArray buyPriceList = new JSONArray();
for(String month: list) {
JSONObject obj = new JSONObject();
BigDecimal outPrice = depotItemService.inOrOutPrice("入库", "采购", month);
BigDecimal inPrice = depotItemService.inOrOutPrice("出库", "采购退货", month);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "buy", priceLimit, "***", request));
buyPriceList.add(obj);
}
map.put("buyPriceList", buyPriceList);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "统计失败";
}
return res;
}
/**
* 统计销售的总金额
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/getSalePrice")
@ApiOperation(value = "统计销售的总金额")
public BaseResponseInfo getSalePrice(HttpServletRequest request,
HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<>();
try {
Long userId = userService.getUserId(request);
String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit();
List<String> list = Tools.getLastMonths(6);
JSONArray salePriceList = new JSONArray();
for(String month: list) {
JSONObject obj = new JSONObject();
BigDecimal outPrice = depotItemService.inOrOutPrice("出库", "销售", month);
BigDecimal inPrice = depotItemService.inOrOutPrice("入库", "销售退货", month);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "sale", priceLimit, "***", request));
salePriceList.add(obj);
}
map.put("salePriceList", salePriceList);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "统计失败";
}
return res;
}
/**
* 统计零售的总金额
* @param request
* @param response
* @return
* @throws Exception
*/
@GetMapping(value = "/getRetailPrice")
@ApiOperation(value = "统计零售的总金额")
public BaseResponseInfo getRetailPrice(HttpServletRequest request,
HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<>();
try {
Long userId = userService.getUserId(request);
String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit();
List<String> list = Tools.getLastMonths(6);
JSONArray retailPriceList = new JSONArray();
for(String month: list) {
JSONObject obj = new JSONObject();
BigDecimal outPrice = depotItemService.inOrOutRetailPrice("出库", "零售", month);
BigDecimal inPrice = depotItemService.inOrOutRetailPrice("入库", "零售退货", month);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "retail", priceLimit, "***", request));
retailPriceList.add(obj);
}
map.put("retailPriceList", retailPriceList);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "统计失败";
}
return res;
}
/**
* 获取批次商品列表信息
* @param request

View File

@ -1200,87 +1200,6 @@ public class DepotHeadService {
return map;
}
public Map<String, Object> getBuyAndSaleStatisticsByType(String type, String today, String monthFirstDay, String yesterdayBegin, String yesterdayEnd,
String yearBegin, String yearEnd, HttpServletRequest request) throws Exception {
Long userId = userService.getUserId(request);
String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit();
String [] creatorArray = getCreatorArray();
Map<String, Object> map = new HashMap<>();
//今日
if("today".equals(type)) {
BigDecimal todayBuy = getBuyAndSaleBasicStatistics("入库", "采购",
1, today, getNow3(), creatorArray); //今日采购入库
BigDecimal todayBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货",
1, today, getNow3(), creatorArray); //今日采购退货
BigDecimal todaySale = getBuyAndSaleBasicStatistics("出库", "销售",
1, today, getNow3(), creatorArray); //今日销售出库
BigDecimal todaySaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货",
1, today, getNow3(), creatorArray); //今日销售退货
BigDecimal todayRetailSale = getBuyAndSaleRetailStatistics("出库", "零售",
today, getNow3(), creatorArray); //今日零售出库
BigDecimal todayRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货",
today, getNow3(), creatorArray); //今日零售退货
map.put("todayBuy", roleService.parseHomePriceByLimit(todayBuy.subtract(todayBuyBack), "buy", priceLimit, "***", request));
map.put("todaySale", roleService.parseHomePriceByLimit(todaySale.subtract(todaySaleBack), "sale", priceLimit, "***", request));
map.put("todayRetailSale", roleService.parseHomePriceByLimit(todayRetailSale.subtract(todayRetailSaleBack), "retail", priceLimit, "***", request));
}
//本月
if("month".equals(type)) {
BigDecimal monthBuy = getBuyAndSaleBasicStatistics("入库", "采购",
1, monthFirstDay, getNow3(), creatorArray); //本月采购入库
BigDecimal monthBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货",
1, monthFirstDay, getNow3(), creatorArray); //本月采购退货
BigDecimal monthSale = getBuyAndSaleBasicStatistics("出库", "销售",
1, monthFirstDay, getNow3(), creatorArray); //本月销售出库
BigDecimal monthSaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货",
1, monthFirstDay, getNow3(), creatorArray); //本月销售退货
BigDecimal monthRetailSale = getBuyAndSaleRetailStatistics("出库", "零售",
monthFirstDay, getNow3(), creatorArray); //本月零售出库
BigDecimal monthRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货",
monthFirstDay, getNow3(), creatorArray); //本月零售退货
map.put("monthBuy", roleService.parseHomePriceByLimit(monthBuy.subtract(monthBuyBack), "buy", priceLimit, "***", request));
map.put("monthSale", roleService.parseHomePriceByLimit(monthSale.subtract(monthSaleBack), "sale", priceLimit, "***", request));
map.put("monthRetailSale", roleService.parseHomePriceByLimit(monthRetailSale.subtract(monthRetailSaleBack), "retail", priceLimit, "***", request));
}
//昨日
if("yesterday".equals(type)) {
BigDecimal yesterdayBuy = getBuyAndSaleBasicStatistics("入库", "采购",
1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日采购入库
BigDecimal yesterdayBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货",
1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日采购退货
BigDecimal yesterdaySale = getBuyAndSaleBasicStatistics("出库", "销售",
1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日销售出库
BigDecimal yesterdaySaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货",
1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日销售退货
BigDecimal yesterdayRetailSale = getBuyAndSaleRetailStatistics("出库", "零售",
yesterdayBegin, yesterdayEnd, creatorArray); //昨日零售出库
BigDecimal yesterdayRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货",
yesterdayBegin, yesterdayEnd, creatorArray); //昨日零售退货
map.put("yesterdayBuy", roleService.parseHomePriceByLimit(yesterdayBuy.subtract(yesterdayBuyBack), "buy", priceLimit, "***", request));
map.put("yesterdaySale", roleService.parseHomePriceByLimit(yesterdaySale.subtract(yesterdaySaleBack), "sale", priceLimit, "***", request));
map.put("yesterdayRetailSale", roleService.parseHomePriceByLimit(yesterdayRetailSale.subtract(yesterdayRetailSaleBack), "retail", priceLimit, "***", request));
}
//今年
if("year".equals(type)) {
BigDecimal yearBuy = getBuyAndSaleBasicStatistics("入库", "采购",
1, yearBegin, yearEnd, creatorArray); //今年采购入库
BigDecimal yearBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货",
1, yearBegin, yearEnd, creatorArray); //今年采购退货
BigDecimal yearSale = getBuyAndSaleBasicStatistics("出库", "销售",
1, yearBegin, yearEnd, creatorArray); //今年销售出库
BigDecimal yearSaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货",
1, yearBegin, yearEnd, creatorArray); //今年销售退货
BigDecimal yearRetailSale = getBuyAndSaleRetailStatistics("出库", "零售",
yearBegin, yearEnd, creatorArray); //今年零售出库
BigDecimal yearRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货",
yearBegin, yearEnd, creatorArray); //今年零售退货
map.put("yearBuy", roleService.parseHomePriceByLimit(yearBuy.subtract(yearBuyBack), "buy", priceLimit, "***", request));
map.put("yearSale", roleService.parseHomePriceByLimit(yearSale.subtract(yearSaleBack), "sale", priceLimit, "***", request));
map.put("yearRetailSale", roleService.parseHomePriceByLimit(yearRetailSale.subtract(yearRetailSaleBack), "retail", priceLimit, "***", request));
}
return map;
}
public BigDecimal getBuyAndSaleBasicStatistics(String type, String subType, Integer hasSupplier,
String beginTime, String endTime, String[] creatorArray) throws Exception {
Boolean forceFlag = systemConfigService.getForceApprovalFlag();

View File

@ -1,10 +1,8 @@
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
//首页统计
const getBuyAndSaleStatisticsByType = (params)=>getAction("/depotHead/getBuyAndSaleStatisticsByType",params);
const getBuyPrice = (params)=>getAction("/depotItem/getBuyPrice",params);
const getSalePrice = (params)=>getAction("/depotItem/getSalePrice",params);
const getRetailPrice = (params)=>getAction("/depotItem/getRetailPrice",params);
const getBuyAndSaleStatistics = (params)=>getAction("/depotHead/getBuyAndSaleStatistics",params);
const buyOrSalePrice = (params)=>getAction("/depotItem/buyOrSalePrice",params);
//租户管理
const checkTenant = (params)=>getAction("/tenant/checkIsNameExist",params);
const editTenant = (params)=>putAction("/tenant/update",params);
@ -115,10 +113,8 @@ const getBatchNumberList = (params)=>getAction("/depotItem/getBatchNumberList",p
const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params);
export {
getBuyAndSaleStatisticsByType,
getBuyPrice,
getSalePrice,
getRetailPrice,
getBuyAndSaleStatistics,
buyOrSalePrice,
checkTenant,
editTenant,
addRole,

View File

@ -156,10 +156,9 @@
import LineChartMultid from '@/components/chart/LineChartMultid'
import HeadInfo from '@/components/tools/HeadInfo.vue'
import Trend from '@/components/Trend'
import { getBuyAndSaleStatisticsByType, getBuyPrice, getSalePrice, getRetailPrice, getPlatformConfigByKey } from '@/api/api'
import { getBuyAndSaleStatistics, buyOrSalePrice, getPlatformConfigByKey } from '@/api/api'
import { handleIntroJs } from "@/utils/util"
import { getAction,postAction } from '../../api/manage'
import Vue from 'vue'
export default {
name: "IndexChart",
@ -213,46 +212,15 @@
},
methods: {
initInfo () {
getBuyAndSaleStatisticsByType({"type": "today"}).then((res)=>{
getBuyAndSaleStatistics().then((res)=>{
if(res.code === 200){
this.statistics.todayBuy = res.data.todayBuy;
this.statistics.todaySale = res.data.todaySale;
this.statistics.todayRetailSale = res.data.todayRetailSale;
this.statistics = res.data;
}
})
getBuyAndSaleStatisticsByType({"type": "month"}).then((res)=>{
if(res.code === 200){
this.statistics.monthBuy = res.data.monthBuy;
this.statistics.monthSale = res.data.monthSale;
this.statistics.monthRetailSale = res.data.monthRetailSale;
}
})
getBuyAndSaleStatisticsByType({"type": "yesterday"}).then((res)=>{
if(res.code === 200){
this.statistics.yesterdayBuy = res.data.yesterdayBuy;
this.statistics.yesterdaySale = res.data.yesterdaySale;
this.statistics.yesterdayRetailSale = res.data.yesterdayRetailSale;
}
})
getBuyAndSaleStatisticsByType({"type": "year"}).then((res)=>{
if(res.code === 200){
this.statistics.yearBuy = res.data.yearBuy;
this.statistics.yearSale = res.data.yearSale;
this.statistics.yearRetailSale = res.data.yearRetailSale;
}
})
getBuyPrice().then(res=>{
buyOrSalePrice().then(res=>{
if(res.code === 200){
this.buyPriceData = res.data.buyPriceList;
}
})
getSalePrice().then(res=>{
if(res.code === 200){
this.salePriceData = res.data.salePriceList;
}
})
getRetailPrice().then(res=>{
if(res.code === 200){
this.retailPriceData = res.data.retailPriceList;
}
})