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

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

View File

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

View File

@@ -71,6 +71,7 @@ public interface DepotHeadMapperEx {
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organArray") String[] organArray, @Param("organArray") String[] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -90,6 +91,7 @@ public interface DepotHeadMapperEx {
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organArray") String[] organArray, @Param("organArray") String[] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -105,6 +107,7 @@ public interface DepotHeadMapperEx {
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organArray") String[] organArray, @Param("organArray") String[] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -118,6 +121,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -134,6 +138,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -146,6 +151,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("inOutManageFlag") Boolean inOutManageFlag, @Param("inOutManageFlag") Boolean inOutManageFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@@ -160,6 +166,7 @@ public interface DepotHeadMapperEx {
@Param("subType") String subType, @Param("subType") String subType,
@Param("number") String number, @Param("number") String number,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@@ -176,6 +183,7 @@ public interface DepotHeadMapperEx {
@Param("subType") String subType, @Param("subType") String subType,
@Param("number") String number, @Param("number") String number,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@@ -188,6 +196,7 @@ public interface DepotHeadMapperEx {
@Param("subType") String subType, @Param("subType") String subType,
@Param("number") String number, @Param("number") String number,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("categoryList") List<Long> categoryList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,

View File

@@ -79,7 +79,8 @@ public interface DepotItemMapperEx {
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organId") Long organId, @Param("organId") Long organId,
@Param("organArray") String [] organArray, @Param("organArray") String[] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("forceFlag") Boolean forceFlag, @Param("forceFlag") Boolean forceFlag,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@@ -92,7 +93,8 @@ public interface DepotItemMapperEx {
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organId") Long organId, @Param("organId") Long organId,
@Param("organArray") String [] organArray, @Param("organArray") String[] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("forceFlag") Boolean forceFlag); @Param("forceFlag") Boolean forceFlag);
@@ -131,6 +133,7 @@ public interface DepotItemMapperEx {
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organId") Long organId, @Param("organId") Long organId,
@Param("organArray") String [] organArray, @Param("organArray") String [] organArray,
@Param("categoryList") List<Long> categoryList,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("forceFlag") Boolean forceFlag); @Param("forceFlag") Boolean forceFlag);
@@ -193,11 +196,13 @@ public interface DepotItemMapperEx {
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows, @Param("rows") Integer rows,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList); @Param("depotList") List<Long> depotList,
@Param("categoryList") List<Long> categoryList);
int findStockWarningCountTotal( int findStockWarningCountTotal(
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList); @Param("depotList") List<Long> depotList,
@Param("categoryList") List<Long> categoryList);
BigDecimal getFinishNumber( BigDecimal getFinishNumber(
@Param("meId") Long meId, @Param("meId") Long meId,

View File

@@ -706,13 +706,13 @@ public class DepotHeadService {
return materialCountListMap; return materialCountListMap;
} }
public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray, public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String[] creatorArray,
String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, String[] organArray, List<Long> categoryList, Boolean forceFlag, Boolean inOutManageFlag,
String materialParam, List<Long> depotList, Integer oId, String number, String materialParam, List<Long> depotList, Integer oId, String number,
Long creator, String remark, String column, String order, Integer offset, Integer rows) throws Exception{ Long creator, String remark, String column, String order, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
materialParam, depotList, oId, number, creator, remark, column, order, offset, rows); materialParam, depotList, oId, number, creator, remark, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -720,12 +720,12 @@ public class DepotHeadService {
return list; return list;
} }
public int findInOutDetailCount(String beginTime, String endTime, String type, String [] creatorArray, public int findInOutDetailCount(String beginTime, String endTime, String type, String[] creatorArray,
String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List<Long> depotList, Integer oId, String number, String[] organArray, List<Long> categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List<Long> depotList, Integer oId, String number,
Long creator, String remark) throws Exception{ Long creator, String remark) throws Exception{
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, result =depotHeadMapperEx.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
materialParam, depotList, oId, number, creator, remark); materialParam, depotList, oId, number, creator, remark);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -734,12 +734,12 @@ public class DepotHeadService {
} }
public DepotHeadVo4InDetail findInOutDetailStatistic(String beginTime, String endTime, String type, String [] creatorArray, public DepotHeadVo4InDetail findInOutDetailStatistic(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, String [] organArray, List<Long> categoryList, Boolean forceFlag, Boolean inOutManageFlag,
String materialParam, List<Long> depotList, Integer oId, String number, String materialParam, List<Long> depotList, Integer oId, String number,
Long creator, String remark) throws Exception{ Long creator, String remark) throws Exception{
DepotHeadVo4InDetail item = new DepotHeadVo4InDetail(); DepotHeadVo4InDetail item = new DepotHeadVo4InDetail();
try{ try{
List<DepotHeadVo4InDetail> list =depotHeadMapperEx.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, List<DepotHeadVo4InDetail> list =depotHeadMapperEx.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag,
materialParam, depotList, oId, number, creator, remark); materialParam, depotList, oId, number, creator, remark);
if(list.size()>0) { if(list.size()>0) {
item.setOperNumber(list.get(0).getOperNumber()); item.setOperNumber(list.get(0).getOperNumber());
@@ -751,7 +751,7 @@ public class DepotHeadService {
return item; return item;
} }
public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, List<Long> categoryList,
Boolean forceFlag, Boolean inOutManageFlag, String materialParam, Boolean forceFlag, Boolean inOutManageFlag, String materialParam,
List<Long> depotList, Long organizationId, Integer oId, String column, String order, List<Long> depotList, Long organizationId, Integer oId, String column, String order,
Integer offset, Integer rows)throws Exception { Integer offset, Integer rows)throws Exception {
@@ -763,7 +763,7 @@ public class DepotHeadService {
} }
String subType = "出库".equals(type)? "销售" : ""; String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, ""); String [] organArray = getOrganArray(subType, "");
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag, materialParam, depotList, oId, list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag, materialParam, depotList, oId,
creatorArray, organArray, column, order, offset, rows); creatorArray, organArray, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -771,7 +771,7 @@ public class DepotHeadService {
return list; return list;
} }
public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, List<Long> categoryList,
Boolean forceFlag, Boolean inOutManageFlag, String materialParam, Boolean forceFlag, Boolean inOutManageFlag, String materialParam,
List<Long> depotList, Long organizationId, Integer oId)throws Exception { List<Long> depotList, Long organizationId, Integer oId)throws Exception {
int result = 0; int result = 0;
@@ -782,7 +782,7 @@ public class DepotHeadService {
} }
String subType = "出库".equals(type)? "销售" : ""; String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, ""); String [] organArray = getOrganArray(subType, "");
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, inOutManageFlag, materialParam, depotList, oId, result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag, materialParam, depotList, oId,
creatorArray, organArray); creatorArray, organArray);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -790,7 +790,7 @@ public class DepotHeadService {
return result; return result;
} }
public DepotHeadVo4InOutMCount findInOutMaterialCountStatistic(String beginTime, String endTime, String type, public DepotHeadVo4InOutMCount findInOutMaterialCountStatistic(String beginTime, String endTime, String type, List<Long> categoryList,
Boolean forceFlag, Boolean inOutManageFlag, String materialParam, Boolean forceFlag, Boolean inOutManageFlag, String materialParam,
List<Long> depotList, Long organizationId, Integer oId) throws Exception { List<Long> depotList, Long organizationId, Integer oId) throws Exception {
DepotHeadVo4InOutMCount item = new DepotHeadVo4InOutMCount(); DepotHeadVo4InOutMCount item = new DepotHeadVo4InOutMCount();
@@ -801,7 +801,7 @@ public class DepotHeadService {
} }
String subType = "出库".equals(type)? "销售" : ""; String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, ""); String [] organArray = getOrganArray(subType, "");
List<DepotHeadVo4InOutMCount> list = depotHeadMapperEx.findInOutMaterialCountStatistic(beginTime, endTime, type, List<DepotHeadVo4InOutMCount> list = depotHeadMapperEx.findInOutMaterialCountStatistic(beginTime, endTime, type, categoryList,
forceFlag, inOutManageFlag, materialParam, depotList, oId, creatorArray, organArray); forceFlag, inOutManageFlag, materialParam, depotList, oId, creatorArray, organArray);
if(list.size()>0) { if(list.size()>0) {
item.setNumSum(list.get(0).getNumSum()); item.setNumSum(list.get(0).getNumSum());
@@ -814,11 +814,11 @@ public class DepotHeadService {
} }
public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number, public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList, String [] creatorArray, List<Long> categoryList, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark, String column, String order, Integer offset, Integer rows) throws Exception{ String remark, String column, String order, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, forceFlag, list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, categoryList, forceFlag,
materialParam, depotList, depotFList, remark, column, order, offset, rows); materialParam, depotList, depotFList, remark, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -827,11 +827,11 @@ public class DepotHeadService {
} }
public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList, String [] creatorArray, List<Long> categoryList, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark) throws Exception{ String remark) throws Exception{
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, forceFlag, result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, categoryList, forceFlag,
materialParam, depotList, depotFList, remark); materialParam, depotList, depotFList, remark);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
@@ -840,11 +840,11 @@ public class DepotHeadService {
} }
public DepotHeadVo4InDetail findAllocationStatistic(String beginTime, String endTime, String subType, String number, public DepotHeadVo4InDetail findAllocationStatistic(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList, String [] creatorArray, List<Long> categoryList, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark) throws Exception{ String remark) throws Exception{
DepotHeadVo4InDetail item = new DepotHeadVo4InDetail(); DepotHeadVo4InDetail item = new DepotHeadVo4InDetail();
try{ try{
List<DepotHeadVo4InDetail> list =depotHeadMapperEx.findAllocationStatistic(beginTime, endTime, subType, number, creatorArray, forceFlag, List<DepotHeadVo4InDetail> list =depotHeadMapperEx.findAllocationStatistic(beginTime, endTime, subType, number, creatorArray, categoryList, forceFlag,
materialParam, depotList, depotFList, remark); materialParam, depotList, depotFList, remark);
if(list.size()>0) { if(list.size()>0) {
item.setOperNumber(list.get(0).getOperNumber()); item.setOperNumber(list.get(0).getOperNumber());

View File

@@ -322,10 +322,10 @@ public class DepotItemService {
} }
public List<DepotItemVo4WithInfoEx> getListWithBuyOrSale(String materialParam, String billType, public List<DepotItemVo4WithInfoEx> getListWithBuyOrSale(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception { String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception {
List<DepotItemVo4WithInfoEx> list =null; List<DepotItemVo4WithInfoEx> list =null;
try{ try{
list = depotItemMapperEx.getListWithBuyOrSale(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, offset, rows); list = depotItemMapperEx.getListWithBuyOrSale(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -333,10 +333,10 @@ public class DepotItemService {
} }
public int getListWithBuyOrSaleCount(String materialParam, String billType, public int getListWithBuyOrSaleCount(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag)throws Exception { String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag)throws Exception {
int result=0; int result=0;
try{ try{
result = depotItemMapperEx.getListWithBuyOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); result = depotItemMapperEx.getListWithBuyOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -359,10 +359,10 @@ public class DepotItemService {
} }
public BigDecimal buyOrSalePriceTotal(String type, String subType, String materialParam, String beginTime, String endTime, public BigDecimal buyOrSalePriceTotal(String type, String subType, String materialParam, String beginTime, String endTime,
String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag) throws Exception{ String[] creatorArray, Long organId, String [] organArray, List<Long> categoryList, List<Long> depotList, Boolean forceFlag) throws Exception{
BigDecimal result= BigDecimal.ZERO; BigDecimal result= BigDecimal.ZERO;
try{ try{
result= depotItemMapperEx.buyOrSalePriceTotal(type, subType, materialParam, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); result= depotItemMapperEx.buyOrSalePriceTotal(type, subType, materialParam, beginTime, endTime, creatorArray, organId, organArray, categoryList, depotList, forceFlag);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -915,20 +915,21 @@ public class DepotItemService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public List<DepotItemStockWarningCount> findStockWarningCount(Integer offset, Integer rows, String materialParam, List<Long> depotList) { public List<DepotItemStockWarningCount> findStockWarningCount(Integer offset, Integer rows, String materialParam, List<Long> depotList, List<Long> categoryList) {
List<DepotItemStockWarningCount> list = null; List<DepotItemStockWarningCount> list = null;
try{ try{
list =depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList); list =depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList, categoryList);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int findStockWarningCountTotal(String materialParam, List<Long> depotList) { public int findStockWarningCountTotal(String materialParam, List<Long> depotList, List<Long> categoryList) {
int result = 0; int result = 0;
try{ try{
result =depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList); result =depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList, categoryList);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }

View File

@@ -339,6 +339,12 @@
</foreach> </foreach>
) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它')
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>
@@ -410,6 +416,12 @@
</foreach> </foreach>
) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它')
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>
@@ -472,6 +484,12 @@
</foreach> </foreach>
) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它')
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>
@@ -553,6 +571,12 @@
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey} or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and (dh.status = '1' or dh.status = '2' or dh.status = '3') and (dh.status = '1' or dh.status = '2' or dh.status = '3')
</if> </if>
@@ -624,6 +648,12 @@
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey} or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and (dh.status = '1' or dh.status = '2' or dh.status = '3') and (dh.status = '1' or dh.status = '2' or dh.status = '3')
</if> </if>
@@ -688,6 +718,12 @@
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey} or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and (dh.status = '1' or dh.status = '2' or dh.status = '3') and (dh.status = '1' or dh.status = '2' or dh.status = '3')
</if> </if>
@@ -735,6 +771,12 @@
</foreach> </foreach>
) )
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>
@@ -794,6 +836,12 @@
</foreach> </foreach>
) )
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>
@@ -846,6 +894,12 @@
</foreach> </foreach>
) )
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and dh.status = '1'
</if> </if>

View File

@@ -419,6 +419,12 @@
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1' left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="materialParam != null and materialParam !=''"> <if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/> <bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}
@@ -481,6 +487,12 @@
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1' left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
where 1=1 where 1=1
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="materialParam != null and materialParam !=''"> <if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/> <bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}
@@ -618,6 +630,12 @@
and dh.type=#{type} and dh.sub_type=#{subType} and dh.type=#{type} and dh.sub_type=#{subType}
and dh.oper_time &gt;= #{beginTime} and dh.oper_time &gt;= #{beginTime}
and dh.oper_time &lt;= #{endTime} and dh.oper_time &lt;= #{endTime}
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="materialParam != null and materialParam !=''"> <if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/> <bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}) and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
@@ -895,6 +913,12 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
order by depotName asc order by depotName asc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
@@ -928,6 +952,12 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="categoryList.size()>0">
and m.category_id in
<foreach collection="categoryList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
) tb ) tb
</select> </select>