From 3824eacc19ece8ea55f37500e23f8c90320c1dfc Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Sun, 23 Mar 2025 23:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BA=9F=E5=BC=83=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/DepotItemController.java | 153 ------------------ .../jsh/erp/controller/UserController.java | 26 --- 2 files changed, 179 deletions(-) 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 d05d812f..5d2b548f 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 @@ -309,159 +309,6 @@ public class DepotItemController { return res; } - /** - * 进销存统计-即将废弃 - * @param currentPage - * @param pageSize - * @param depotIds - * @param monthTime - * @param materialParam - * @param mpList - * @param request - * @return - * @throws Exception - */ - @GetMapping(value = "/findByAll") - @ApiOperation(value = "查找所有的明细") - public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage, - @RequestParam("pageSize") Integer pageSize, - @RequestParam(value = "depotIds",required = false) String depotIds, - @RequestParam(value = "categoryId", required = false) Long categoryId, - @RequestParam("monthTime") String monthTime, - @RequestParam("materialParam") String materialParam, - @RequestParam("mpList") String mpList, - HttpServletRequest request)throws Exception { - BaseResponseInfo res = new BaseResponseInfo(); - Map map = new HashMap<>(); - try { - Boolean moveAvgPriceFlag = systemConfigService.getMoveAvgPriceFlag(); - List categoryIdList = new ArrayList<>(); - if(categoryId != null){ - categoryIdList = materialService.getListByParentId(categoryId); - } - String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; - String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; - List depotList = parseListByDepotIds(depotIds); - List dataList = depotItemService.getInOutStock(StringUtil.toNull(materialParam), - categoryIdList, timeB,(currentPage-1)*pageSize, pageSize); - String[] mpArr = mpList.split(","); - int total = depotItemService.getInOutStockCount(StringUtil.toNull(materialParam), categoryIdList, timeB); - map.put("total", total); - //存放数据json数组 - JSONArray dataArray = new JSONArray(); - if (null != dataList) { - for (DepotItemVo4WithInfoEx diEx : dataList) { - JSONObject item = new JSONObject(); - Long mId = diEx.getMId(); - item.put("barCode", diEx.getBarCode()); - item.put("materialName", diEx.getMName()); - item.put("materialModel", diEx.getMModel()); - item.put("materialStandard", diEx.getMStandard()); - //扩展信息 - String materialOther = depotItemService.getOtherInfo(mpArr, diEx); - item.put("materialOther", materialOther); - item.put("materialColor", diEx.getMColor()); - item.put("unitId", diEx.getUnitId()); - item.put("unitName", null!=diEx.getUnitId() ? diEx.getMaterialUnit()+"[多单位]" : diEx.getMaterialUnit()); - BigDecimal prevSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,timeA); - Map intervalMap = depotItemService.getIntervalMapByParamWithDepotList(depotList,mId,timeA,timeB); - BigDecimal inSum = intervalMap.get("inSum"); - BigDecimal outSum = intervalMap.get("outSum"); - BigDecimal thisSum = prevSum.add(inSum).subtract(outSum); - item.put("prevSum", prevSum); - item.put("inSum", inSum); - item.put("outSum", outSum); - item.put("thisSum", thisSum); - //将小单位的库存换算为大单位的库存 - item.put("bigUnitStock", materialService.getBigUnitStock(thisSum, diEx.getUnitId())); - if(moveAvgPriceFlag) { - item.put("unitPrice", diEx.getCurrentUnitPrice()); - } else { - item.put("unitPrice", diEx.getPurchaseDecimal()); - } - if(moveAvgPriceFlag) { - item.put("thisAllPrice", thisSum.multiply(diEx.getCurrentUnitPrice())); - } else { - item.put("thisAllPrice", thisSum.multiply(diEx.getPurchaseDecimal())); - } - dataArray.add(item); - } - } - map.put("rows", dataArray); - res.code = 200; - res.data = map; - } catch (BusinessRunTimeException e) { - res.code = e.getCode(); - res.data = e.getData().get("message"); - } catch(Exception e){ - logger.error(e.getMessage(), e); - res.code = 500; - res.data = "获取数据失败"; - } - return res; - } - - /** - * 进销存统计总计金额-即将废弃 - * @param depotIds - * @param monthTime - * @param materialParam - * @param request - * @return - */ - @GetMapping(value = "/totalCountMoney") - @ApiOperation(value = "统计总计金额") - public BaseResponseInfo totalCountMoney(@RequestParam(value = "depotIds",required = false) String depotIds, - @RequestParam(value = "categoryId", required = false) Long categoryId, - @RequestParam("monthTime") String monthTime, - @RequestParam("materialParam") String materialParam, - HttpServletRequest request) throws Exception{ - BaseResponseInfo res = new BaseResponseInfo(); - Map map = new HashMap<>(); - try { - Boolean moveAvgPriceFlag = systemConfigService.getMoveAvgPriceFlag(); - List categoryIdList = new ArrayList<>(); - if(categoryId != null){ - categoryIdList = materialService.getListByParentId(categoryId); - } - String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; - List depotList = parseListByDepotIds(depotIds); - List dataList = depotItemService.getInOutStock(StringUtil.toNull(materialParam), - categoryIdList, endTime, null, null); - BigDecimal thisAllStock = BigDecimal.ZERO; - BigDecimal thisAllPrice = BigDecimal.ZERO; - if (null != dataList) { - for (DepotItemVo4WithInfoEx diEx : dataList) { - Long mId = diEx.getMId(); - BigDecimal thisSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,endTime); - thisAllStock = thisAllStock.add(thisSum); - BigDecimal unitPrice = null; - if(moveAvgPriceFlag) { - unitPrice = diEx.getCurrentUnitPrice(); - } else { - unitPrice = diEx.getPurchaseDecimal(); - } - if(unitPrice == null) { - unitPrice = BigDecimal.ZERO; - } - thisAllPrice = thisAllPrice.add(thisSum.multiply(unitPrice)); - } - } - map.put("totalStock", thisAllStock); - map.put("totalCount", thisAllPrice); - res.code = 200; - res.data = map; - } catch (BusinessRunTimeException e) { - res.code = e.getCode(); - res.data = e.getData().get("message"); - } catch(Exception e){ - logger.error(e.getMessage(), e); - res.code = 500; - res.data = "获取数据失败"; - } - return res; - } - /** * 进销存统计查询 * @param currentPage diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java index fd2070c9..a2f24833 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java @@ -454,32 +454,6 @@ public class UserController extends BaseController { return res; } - /** - * 获取随机校验码【后续会废弃】 - * @param response - * @param key - * @return - */ - @GetMapping(value = "/randomImage/{key}") - @ApiOperation(value = "获取随机校验码【后续会废弃】") - public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable String key){ - BaseResponseInfo res = new BaseResponseInfo(); - try { - Map data = new HashMap<>(); - String codeNum = Tools.getCharAndNum(4); - String base64 = RandImageUtil.generate(codeNum); - data.put("codeNum", codeNum); - data.put("base64", base64); - res.code = 200; - res.data = data; - } catch (Exception e) { - logger.error(e.getMessage(), e); - res.code = 500; - res.data = "获取失败"; - } - return res; - } - /** * 获取随机校验码 * @param response