给报表的接口增加商品类别的查询参数

This commit is contained in:
jishenghua
2025-01-14 00:18:33 +08:00
parent 8f73287999
commit edcada7d16
8 changed files with 202 additions and 58 deletions

View File

@@ -12,6 +12,7 @@ import com.jsh.erp.datasource.vo.DepotHeadVo4List;
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
@@ -47,6 +48,9 @@ public class DepotHeadController {
@Resource
private DepotService depotService;
@Resource
private MaterialService materialService;
@Resource
private SystemConfigService systemConfigService;
@@ -100,6 +104,7 @@ public class DepotHeadController {
@RequestParam("endTime") String endTime,
@RequestParam("type") String type,
@RequestParam(value = "creator", required = false) Long creator,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("remark") String remark,
@RequestParam(value = "column", required = false, defaultValue = "createTime") String column,
@@ -126,14 +131,18 @@ public class DepotHeadController {
}
String subType = "出库".equals(type)? "销售" : "";
String [] organArray = depotHeadService.getOrganArray(subType, "");
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Boolean inOutManageFlag = systemConfigService.getInOutManageFlag();
List<DepotHeadVo4InDetail> list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
List<DepotHeadVo4InDetail> list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark,
StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
int total = depotHeadService.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark);
map.put("total", total);
//存放数据json数组
@@ -141,7 +150,7 @@ public class DepotHeadController {
resList.addAll(list);
}
map.put("rows", resList);
DepotHeadVo4InDetail statistic = depotHeadService.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
DepotHeadVo4InDetail statistic = depotHeadService.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark);
map.put("operNumberTotal", statistic.getOperNumber());
map.put("allPriceTotal", statistic.getAllPrice());
@@ -175,6 +184,7 @@ public class DepotHeadController {
@RequestParam(value = "organId", required = false) Integer oId,
@RequestParam("materialParam") String materialParam,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime,
@@ -196,18 +206,22 @@ public class DepotHeadController {
depotList.add(object.getLong("id"));
}
}
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Boolean inOutManageFlag = systemConfigService.getInOutManageFlag();
List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag,
List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, organizationId, oId, StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order),
(currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, inOutManageFlag,
int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, organizationId, oId);
map.put("total", total);
map.put("rows", list);
DepotHeadVo4InOutMCount statistic = depotHeadService.findInOutMaterialCountStatistic(beginTime, endTime, type, forceFlag, inOutManageFlag,
DepotHeadVo4InOutMCount statistic = depotHeadService.findInOutMaterialCountStatistic(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, organizationId, oId);
map.put("numSumTotal", statistic.getNumSum());
map.put("priceSumTotal", statistic.getPriceSum());
@@ -243,6 +257,7 @@ public class DepotHeadController {
@RequestParam("materialParam") String materialParam,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "depotIdF", required = false) Long depotIdF,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime,
@@ -280,18 +295,22 @@ public class DepotHeadController {
if(creatorArray == null && organizationId != null) {
creatorArray = depotHeadService.getCreatorArrayByOrg(organizationId);
}
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, StringUtil.toNull(number),
creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark,
creatorArray, categoryList, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark,
StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, StringUtil.toNull(number),
creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark);
creatorArray, categoryList, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark);
map.put("rows", list);
map.put("total", total);
DepotHeadVo4InDetail statistic = depotHeadService.findAllocationStatistic(beginTime, endTime, subType, StringUtil.toNull(number),
creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark);
creatorArray, categoryList, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark);
map.put("operNumberTotal", statistic.getOperNumber());
map.put("allPriceTotal", statistic.getAllPrice());
res.code = 200;

View File

@@ -658,6 +658,7 @@ public class DepotItemController {
@RequestParam("endTime") String endTime,
@RequestParam(value = "organId", required = false) Long organId,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("materialParam") String materialParam,
@RequestParam("mpList") String mpList,
@@ -672,13 +673,17 @@ public class DepotItemController {
creatorArray = depotHeadService.getCreatorArrayByOrg(organizationId);
}
String [] organArray = null;
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
"buy", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
"buy", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
@@ -710,8 +715,10 @@ public class DepotItemController {
dataArray.add(item);
}
}
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "采购", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "采购退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "采购", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "采购退货", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal realityPriceTotal = inSumPriceTotal.subtract(outSumPriceTotal);
map.put("rows", dataArray);
map.put("realityPriceTotal", realityPriceTotal);
@@ -744,6 +751,7 @@ public class DepotItemController {
@RequestParam("endTime") String endTime,
@RequestParam(value = "organId", required = false) Long organId,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("materialParam") String materialParam,
@RequestParam("mpList") String mpList,
@@ -758,13 +766,17 @@ public class DepotItemController {
creatorArray = depotHeadService.getCreatorArrayByOrg(organizationId);
}
String [] organArray = null;
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"retail", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
"retail", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"retail", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
"retail", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
@@ -796,8 +808,10 @@ public class DepotItemController {
dataArray.add(item);
}
}
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "零售", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "零售退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "零售", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "零售退货", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
map.put("rows", dataArray);
map.put("realityPriceTotal", realityPriceTotal);
@@ -831,6 +845,7 @@ public class DepotItemController {
@RequestParam("endTime") String endTime,
@RequestParam(value = "organId", required = false) Long organId,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam("materialParam") String materialParam,
@RequestParam("mpList") String mpList,
@@ -845,13 +860,17 @@ public class DepotItemController {
creatorArray = depotHeadService.getCreatorArrayByOrg(organizationId);
}
String [] organArray = depotHeadService.getOrganArray("销售", "");
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
List<Long> depotList = depotService.parseDepotList(depotId);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBuyOrSale(StringUtil.toNull(materialParam),
"sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
"sale", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = depotItemService.getListWithBuyOrSaleCount(StringUtil.toNull(materialParam),
"sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
"sale", beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
@@ -883,8 +902,10 @@ public class DepotItemController {
dataArray.add(item);
}
}
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "销售", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "销售退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "销售", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "销售退货", StringUtil.toNull(materialParam),
beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
map.put("rows", dataArray);
map.put("realityPriceTotal", realityPriceTotal);
@@ -926,6 +947,7 @@ public class DepotItemController {
@RequestParam("pageSize") Integer pageSize,
@RequestParam("materialParam") String materialParam,
@RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam("mpList") String mpList)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
@@ -941,8 +963,12 @@ public class DepotItemController {
depotList.add(object.getLong("id"));
}
}
List<Long> categoryList = new ArrayList<>();
if(categoryId != null){
categoryList = materialService.getListByParentId(categoryId);
}
String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList);
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList, categoryList);
//存放数据json数组
if (null != list) {
for (DepotItemStockWarningCount disw : list) {
@@ -960,7 +986,7 @@ public class DepotItemController {
}
}
}
int total = depotItemService.findStockWarningCountTotal(materialParam, depotList);
int total = depotItemService.findStockWarningCountTotal(materialParam, depotList, categoryList);
map.put("total", total);
map.put("rows", list);
res.code = 200;