diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java index 24dc8273..00bedf74 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java @@ -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 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 list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, + List 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 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 list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag, + List 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 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 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; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java index 4e5a2d53..21f60d6a 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -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 categoryList = new ArrayList<>(); + if(categoryId != null){ + categoryList = materialService.getListByParentId(categoryId); + } List depotList = depotService.parseDepotList(depotId); Boolean forceFlag = systemConfigService.getForceApprovalFlag(); List 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 categoryList = new ArrayList<>(); + if(categoryId != null){ + categoryList = materialService.getListByParentId(categoryId); + } List depotList = depotService.parseDepotList(depotId); Boolean forceFlag = systemConfigService.getForceApprovalFlag(); List 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 categoryList = new ArrayList<>(); + if(categoryId != null){ + categoryList = materialService.getListByParentId(categoryId); + } List depotList = depotService.parseDepotList(depotId); Boolean forceFlag = systemConfigService.getForceApprovalFlag(); List 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 map = new HashMap(); @@ -941,8 +963,12 @@ public class DepotItemController { depotList.add(object.getLong("id")); } } + List categoryList = new ArrayList<>(); + if(categoryId != null){ + categoryList = materialService.getListByParentId(categoryId); + } String[] mpArr = mpList.split(","); - List list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList); + List 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; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java index 9302049a..8e2e4f86 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java @@ -71,6 +71,7 @@ public interface DepotHeadMapperEx { @Param("type") String type, @Param("creatorArray") String[] creatorArray, @Param("organArray") String[] organArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -90,6 +91,7 @@ public interface DepotHeadMapperEx { @Param("type") String type, @Param("creatorArray") String[] creatorArray, @Param("organArray") String[] organArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -105,6 +107,7 @@ public interface DepotHeadMapperEx { @Param("type") String type, @Param("creatorArray") String[] creatorArray, @Param("organArray") String[] organArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -118,6 +121,7 @@ public interface DepotHeadMapperEx { @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("type") String type, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -134,6 +138,7 @@ public interface DepotHeadMapperEx { @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("type") String type, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -146,6 +151,7 @@ public interface DepotHeadMapperEx { @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("type") String type, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("inOutManageFlag") Boolean inOutManageFlag, @Param("materialParam") String materialParam, @@ -160,6 +166,7 @@ public interface DepotHeadMapperEx { @Param("subType") String subType, @Param("number") String number, @Param("creatorArray") String[] creatorArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("materialParam") String materialParam, @Param("depotList") List depotList, @@ -176,6 +183,7 @@ public interface DepotHeadMapperEx { @Param("subType") String subType, @Param("number") String number, @Param("creatorArray") String[] creatorArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("materialParam") String materialParam, @Param("depotList") List depotList, @@ -188,6 +196,7 @@ public interface DepotHeadMapperEx { @Param("subType") String subType, @Param("number") String number, @Param("creatorArray") String[] creatorArray, + @Param("categoryList") List categoryList, @Param("forceFlag") Boolean forceFlag, @Param("materialParam") String materialParam, @Param("depotList") List depotList, diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java index 499d8e78..a8e79ac3 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java @@ -79,7 +79,8 @@ public interface DepotItemMapperEx { @Param("endTime") String endTime, @Param("creatorArray") String[] creatorArray, @Param("organId") Long organId, - @Param("organArray") String [] organArray, + @Param("organArray") String[] organArray, + @Param("categoryList") List categoryList, @Param("depotList") List depotList, @Param("forceFlag") Boolean forceFlag, @Param("offset") Integer offset, @@ -92,7 +93,8 @@ public interface DepotItemMapperEx { @Param("endTime") String endTime, @Param("creatorArray") String[] creatorArray, @Param("organId") Long organId, - @Param("organArray") String [] organArray, + @Param("organArray") String[] organArray, + @Param("categoryList") List categoryList, @Param("depotList") List depotList, @Param("forceFlag") Boolean forceFlag); @@ -131,6 +133,7 @@ public interface DepotItemMapperEx { @Param("creatorArray") String[] creatorArray, @Param("organId") Long organId, @Param("organArray") String [] organArray, + @Param("categoryList") List categoryList, @Param("depotList") List depotList, @Param("forceFlag") Boolean forceFlag); @@ -193,11 +196,13 @@ public interface DepotItemMapperEx { @Param("offset") Integer offset, @Param("rows") Integer rows, @Param("materialParam") String materialParam, - @Param("depotList") List depotList); + @Param("depotList") List depotList, + @Param("categoryList") List categoryList); int findStockWarningCountTotal( @Param("materialParam") String materialParam, - @Param("depotList") List depotList); + @Param("depotList") List depotList, + @Param("categoryList") List categoryList); BigDecimal getFinishNumber( @Param("meId") Long meId, diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index d8a2cab3..ac222ed6 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -706,13 +706,13 @@ public class DepotHeadService { return materialCountListMap; } - public List findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray, - String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, + public List findInOutDetail(String beginTime, String endTime, String type, String[] creatorArray, + String[] organArray, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Integer oId, String number, Long creator, String remark, String column, String order, Integer offset, Integer rows) throws Exception{ List list = null; 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); }catch(Exception e){ JshException.readFail(logger, e); @@ -720,12 +720,12 @@ public class DepotHeadService { return list; } - public int findInOutDetailCount(String beginTime, String endTime, String type, String [] creatorArray, - String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Integer oId, String number, - Long creator, String remark) throws Exception{ + public int findInOutDetailCount(String beginTime, String endTime, String type, String[] creatorArray, + String[] organArray, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Integer oId, String number, + Long creator, String remark) throws Exception{ int result = 0; 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); }catch(Exception e){ JshException.readFail(logger, e); @@ -734,12 +734,12 @@ public class DepotHeadService { } public DepotHeadVo4InDetail findInOutDetailStatistic(String beginTime, String endTime, String type, String [] creatorArray, - String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, + String [] organArray, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Integer oId, String number, Long creator, String remark) throws Exception{ DepotHeadVo4InDetail item = new DepotHeadVo4InDetail(); try{ - List list =depotHeadMapperEx.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, + List list =depotHeadMapperEx.findInOutDetailStatistic(beginTime, endTime, type, creatorArray, organArray, categoryList, forceFlag, inOutManageFlag, materialParam, depotList, oId, number, creator, remark); if(list.size()>0) { item.setOperNumber(list.get(0).getOperNumber()); @@ -751,7 +751,7 @@ public class DepotHeadService { return item; } - public List findInOutMaterialCount(String beginTime, String endTime, String type, + public List findInOutMaterialCount(String beginTime, String endTime, String type, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Long organizationId, Integer oId, String column, String order, Integer offset, Integer rows)throws Exception { @@ -763,7 +763,7 @@ public class DepotHeadService { } String subType = "出库".equals(type)? "销售" : ""; 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); }catch(Exception e){ JshException.readFail(logger, e); @@ -771,7 +771,7 @@ public class DepotHeadService { return list; } - public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, + public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Long organizationId, Integer oId)throws Exception { int result = 0; @@ -782,7 +782,7 @@ public class DepotHeadService { } String subType = "出库".equals(type)? "销售" : ""; 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); }catch(Exception e){ JshException.readFail(logger, e); @@ -790,7 +790,7 @@ public class DepotHeadService { return result; } - public DepotHeadVo4InOutMCount findInOutMaterialCountStatistic(String beginTime, String endTime, String type, + public DepotHeadVo4InOutMCount findInOutMaterialCountStatistic(String beginTime, String endTime, String type, List categoryList, Boolean forceFlag, Boolean inOutManageFlag, String materialParam, List depotList, Long organizationId, Integer oId) throws Exception { DepotHeadVo4InOutMCount item = new DepotHeadVo4InOutMCount(); @@ -801,7 +801,7 @@ public class DepotHeadService { } String subType = "出库".equals(type)? "销售" : ""; String [] organArray = getOrganArray(subType, ""); - List list = depotHeadMapperEx.findInOutMaterialCountStatistic(beginTime, endTime, type, + List list = depotHeadMapperEx.findInOutMaterialCountStatistic(beginTime, endTime, type, categoryList, forceFlag, inOutManageFlag, materialParam, depotList, oId, creatorArray, organArray); if(list.size()>0) { item.setNumSum(list.get(0).getNumSum()); @@ -814,11 +814,11 @@ public class DepotHeadService { } public List findAllocationDetail(String beginTime, String endTime, String subType, String number, - String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String [] creatorArray, List categoryList, Boolean forceFlag, String materialParam, List depotList, List depotFList, String remark, String column, String order, Integer offset, Integer rows) throws Exception{ List list = null; 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); }catch(Exception e){ JshException.readFail(logger, e); @@ -827,11 +827,11 @@ public class DepotHeadService { } public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, - String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String [] creatorArray, List categoryList, Boolean forceFlag, String materialParam, List depotList, List depotFList, String remark) throws Exception{ int result = 0; try{ - result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, forceFlag, + result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, categoryList, forceFlag, materialParam, depotList, depotFList, remark); }catch(Exception e){ JshException.readFail(logger, e); @@ -840,11 +840,11 @@ public class DepotHeadService { } public DepotHeadVo4InDetail findAllocationStatistic(String beginTime, String endTime, String subType, String number, - String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String [] creatorArray, List categoryList, Boolean forceFlag, String materialParam, List depotList, List depotFList, String remark) throws Exception{ DepotHeadVo4InDetail item = new DepotHeadVo4InDetail(); try{ - List list =depotHeadMapperEx.findAllocationStatistic(beginTime, endTime, subType, number, creatorArray, forceFlag, + List list =depotHeadMapperEx.findAllocationStatistic(beginTime, endTime, subType, number, creatorArray, categoryList, forceFlag, materialParam, depotList, depotFList, remark); if(list.size()>0) { item.setOperNumber(list.get(0).getOperNumber()); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index aba13757..7f8b9234 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -322,10 +322,10 @@ public class DepotItemService { } public List getListWithBuyOrSale(String materialParam, String billType, - String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception { + String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List categoryList, List depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception { List list =null; 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){ JshException.readFail(logger, e); } @@ -333,10 +333,10 @@ public class DepotItemService { } public int getListWithBuyOrSaleCount(String materialParam, String billType, - String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag)throws Exception { + String beginTime, String endTime, String[] creatorArray, Long organId, String[] organArray, List categoryList, List depotList, Boolean forceFlag)throws Exception { int result=0; 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){ JshException.readFail(logger, e); } @@ -359,10 +359,10 @@ public class DepotItemService { } public BigDecimal buyOrSalePriceTotal(String type, String subType, String materialParam, String beginTime, String endTime, - String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag) throws Exception{ + String[] creatorArray, Long organId, String [] organArray, List categoryList, List depotList, Boolean forceFlag) throws Exception{ BigDecimal result= BigDecimal.ZERO; 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){ JshException.readFail(logger, e); } @@ -915,20 +915,21 @@ public class DepotItemService { } @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public List findStockWarningCount(Integer offset, Integer rows, String materialParam, List depotList) { + public List findStockWarningCount(Integer offset, Integer rows, String materialParam, List depotList, List categoryList) { List list = null; try{ - list =depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList); + list =depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList, categoryList); }catch(Exception e){ JshException.readFail(logger, e); } return list; } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public int findStockWarningCountTotal(String materialParam, List depotList) { + public int findStockWarningCountTotal(String materialParam, List depotList, List categoryList) { int result = 0; try{ - result =depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList); + result =depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList, categoryList); }catch(Exception e){ JshException.readFail(logger, e); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index 21aa1dca..ef066826 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -339,6 +339,12 @@ ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') + + and m.category_id in + + #{item} + + and dh.status = '1' @@ -410,6 +416,12 @@ ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') + + and m.category_id in + + #{item} + + and dh.status = '1' @@ -472,6 +484,12 @@ ) or dh.sub_type='采购退货' or dh.sub_type='零售' or dh.sub_type='其它') + + and m.category_id in + + #{item} + + and dh.status = '1' @@ -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.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) + + and m.category_id in + + #{item} + + and (dh.status = '1' or dh.status = '2' or dh.status = '3') @@ -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.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) + + and m.category_id in + + #{item} + + and (dh.status = '1' or dh.status = '2' or dh.status = '3') @@ -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.other_field2 like #{bindKey} or m.other_field3 like #{bindKey}) + + and m.category_id in + + #{item} + + and (dh.status = '1' or dh.status = '2' or dh.status = '3') @@ -735,6 +771,12 @@ ) + + and m.category_id in + + #{item} + + and dh.status = '1' @@ -794,6 +836,12 @@ ) + + and m.category_id in + + #{item} + + and dh.status = '1' @@ -846,6 +894,12 @@ ) + + and m.category_id in + + #{item} + + and dh.status = '1' diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml index 3325e907..e9fc5504 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' where 1=1 + + and m.category_id in + + #{item} + + 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_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1' where 1=1 + + and m.category_id in + + #{item} + + 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.oper_time >= #{beginTime} and dh.oper_time <= #{endTime} + + and m.category_id in + + #{item} + + 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} + + and m.category_id in + + #{item} + + order by depotName asc limit #{offset},#{rows} @@ -928,6 +952,12 @@ #{item} + + and m.category_id in + + #{item} + + ) tb