优化库存状态报表
This commit is contained in:
@@ -204,16 +204,16 @@
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '名称', field: 'MaterialName', width: 160},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 120},
|
||||
{title: '单位', field: 'unitName', width: 80},
|
||||
{title: '单价', field: 'UnitPrice', width: 60},
|
||||
{title: '上月结存数量', field: 'prevSum', width: 80},
|
||||
{title: '入库数量', field: 'InSum', width: 60},
|
||||
{title: '出库数量', field: 'OutSum', width: 60},
|
||||
{title: '本月结存数量', field: 'thisSum', width: 80},
|
||||
{title: '结存金额', field: 'thisAllPrice', width: 60}
|
||||
{title: '上月结存数量', field: 'prevSum', width: 120},
|
||||
{title: '入库数量', field: 'InSum', width: 80},
|
||||
{title: '出库数量', field: 'OutSum', width: 80},
|
||||
{title: '本月结存数量', field: 'thisSum', width: 120},
|
||||
{title: '结存金额', field: 'thisAllPrice', width: 80}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.*;
|
||||
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.MaterialExtend.MaterialExtendService;
|
||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.utils.*;
|
||||
@@ -40,6 +41,9 @@ public class DepotItemController {
|
||||
@Resource
|
||||
private MaterialService materialService;
|
||||
|
||||
@Resource
|
||||
private MaterialExtendService materialExtendService;
|
||||
|
||||
/**
|
||||
* 只根据商品id查询单据列表
|
||||
* @param mId
|
||||
@@ -269,6 +273,11 @@ public class DepotItemController {
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
List<Long> idList = new ArrayList<Long>();
|
||||
for (DepotItemVo4WithInfoEx m : dataList) {
|
||||
idList.add(m.getMId());
|
||||
}
|
||||
List<MaterialExtend> meList = materialExtendService.getListByMIds(idList);
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
Long mId = diEx.getMId();
|
||||
@@ -281,13 +290,18 @@ public class DepotItemController {
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", diEx.getMColor());
|
||||
item.put("unitName", getUName(diEx.getMaterialUnit(), diEx.getUName()));
|
||||
item.put("UnitPrice", getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy()));
|
||||
|
||||
item.put("prevSum", depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId));
|
||||
item.put("InSum", depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId));
|
||||
item.put("OutSum", depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId));
|
||||
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
|
||||
item.put("thisSum", thisSum);
|
||||
item.put("thisAllPrice", thisSum.multiply(getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy())));
|
||||
for(MaterialExtend me:meList) {
|
||||
if(me.getMaterialId().longValue() == diEx.getMId().longValue()) {
|
||||
item.put("UnitPrice", me.getPurchaseDecimal());
|
||||
item.put("thisAllPrice", thisSum.multiply(me.getPurchaseDecimal()));
|
||||
}
|
||||
}
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user