删除废弃的接口
This commit is contained in:
@@ -309,159 +309,6 @@ public class DepotItemController {
|
|||||||
return res;
|
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<String, Object> map = new HashMap<>();
|
|
||||||
try {
|
|
||||||
Boolean moveAvgPriceFlag = systemConfigService.getMoveAvgPriceFlag();
|
|
||||||
List<Long> 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<Long> depotList = parseListByDepotIds(depotIds);
|
|
||||||
List<DepotItemVo4WithInfoEx> 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<String,BigDecimal> 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<String, Object> map = new HashMap<>();
|
|
||||||
try {
|
|
||||||
Boolean moveAvgPriceFlag = systemConfigService.getMoveAvgPriceFlag();
|
|
||||||
List<Long> categoryIdList = new ArrayList<>();
|
|
||||||
if(categoryId != null){
|
|
||||||
categoryIdList = materialService.getListByParentId(categoryId);
|
|
||||||
}
|
|
||||||
String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME;
|
|
||||||
List<Long> depotList = parseListByDepotIds(depotIds);
|
|
||||||
List<DepotItemVo4WithInfoEx> 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
|
* @param currentPage
|
||||||
|
|||||||
@@ -454,32 +454,6 @@ public class UserController extends BaseController {
|
|||||||
return res;
|
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<String, Object> 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
|
* @param response
|
||||||
|
|||||||
Reference in New Issue
Block a user