优化报表,使其显示扩展信息

This commit is contained in:
季圣华
2020-12-27 15:10:43 +08:00
parent 76fd851ea1
commit e83ca1c5a7
7 changed files with 91 additions and 24 deletions

View File

@@ -186,7 +186,7 @@ function bindSupplierEvent() {
success: function(res) { success: function(res) {
if (res) { if (res) {
$('#supplierDlg').dialog('close'); $('#supplierDlg').dialog('close');
initSupplier(); //刷新供应商 inOutService.initSupplier(); //刷新供应商
} }
} }
}); });
@@ -319,7 +319,7 @@ function bindAccountEvent() {
success: function(res) { success: function(res) {
if(res && res.code === 200) { if(res && res.code === 200) {
$('#accountDlg').dialog('close'); $('#accountDlg').dialog('close');
initSystemData_account(); //刷新账户 inOutService.initSystemData_account(); //刷新账户
} }
}, },
//此处添加错误处理 //此处添加错误处理

View File

@@ -52,7 +52,7 @@
var thisRows = res.data.page.rows; var thisRows = res.data.page.rows;
for (var i = 0; i < thisRows.length; i++) { for (var i = 0; i < thisRows.length; i++) {
if (thisRows[i].enabled) { if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativename + ","; mPropertyList += thisRows[i].nativeName + ",";
} }
} }
if (mPropertyList) { if (mPropertyList) {

View File

@@ -111,6 +111,13 @@
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
columns: [[ columns: [[
{field: 'id', width: 10, align: "center", hidden: true}, {field: 'id', width: 10, align: "center", hidden: true},
{
title: '操作', field: 'op', align: "center", width: 80, formatter: function (value, rec, index) {
var str = '';
str += '<img src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialProperty(\'' + index + '\');"/>';
return str;
}
},
{title: '名称', field: 'nativeName', width: 100}, {title: '名称', field: 'nativeName', width: 100},
{ {
title: '是否启用', field: 'enabled', width: 100, formatter: function (value, rec) { title: '是否启用', field: 'enabled', width: 100, formatter: function (value, rec) {
@@ -123,14 +130,7 @@
} }
}, },
{title: '排序', field: 'sort', width: 100}, {title: '排序', field: 'sort', width: 100},
{title: '别名', field: 'anotherName', width: 100}, {title: '别名', field: 'anotherName', width: 100}
{
title: '操作', field: 'op', align: "center", width: 80, formatter: function (value, rec, index) {
var str = '';
str += '<img src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialProperty(\'' + index + '\');"/>&nbsp;<a onclick="editMaterialProperty(\'' + index + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
return str;
}
}
]], ]],
onLoadError: function () { onLoadError: function () {
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');

View File

@@ -293,12 +293,16 @@
data: ({ data: ({
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
projectId : $.trim($("#searchProjectId").val()) projectId : $.trim($("#searchProjectId").val()),
mpList: mPropertyList
}), }),
success: function (res) { success: function (res) {
if(res && res.code === 200 && res.data) { if(res && res.code === 200 && res.data) {
if (pageSize === 3000) { if (pageSize === 3000) {
window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs() + "&currentPage=" + pageNo + "&pageSize=" + pageSize + "&projectId=" + $.trim($("#searchProjectId").val()) ; window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs()
+ "&currentPage=" + pageNo + "&pageSize=" + pageSize
+ "&projectId=" + $.trim($("#searchProjectId").val())
+ "&mpList=" + mPropertyList;
} }
else { else {
//获取排序后的产品ID //获取排序后的产品ID

View File

@@ -574,11 +574,25 @@ public class DepotItemController {
*/ */
@GetMapping(value = "/findStockWarningCount") @GetMapping(value = "/findStockWarningCount")
public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("projectId") Integer pid )throws Exception { @RequestParam("pageSize") Integer pageSize,
@RequestParam("projectId") Integer pid,
@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>();
try { try {
String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,pid); List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,pid);
//存放数据json数组
if (null != list) {
for (DepotItemStockWarningCount disw : list) {
DepotItemVo4WithInfoEx diEx = new DepotItemVo4WithInfoEx();
diEx.setMMfrs(disw.getMMfrs());
diEx.setMOtherField1(disw.getMOtherField1());
diEx.setMOtherField2(disw.getMOtherField2());
diEx.setMOtherField3(disw.getMOtherField3());
disw.setMaterialOther(getOtherInfo(mpArr, diEx));
}
}
int total = depotItemService.findStockWarningCountTotal(pid); int total = depotItemService.findStockWarningCountTotal(pid);
map.put("total", total); map.put("total", total);
map.put("rows", list); map.put("rows", list);
@@ -604,11 +618,13 @@ public class DepotItemController {
public BaseResponseInfo exportWarningExcel(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo exportWarningExcel(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("projectId") Integer projectId, @RequestParam("projectId") Integer projectId,
@RequestParam("mpList") String mpList,
HttpServletRequest request, HttpServletResponse response)throws Exception { HttpServletRequest request, HttpServletResponse response)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>();
String message = "成功"; String message = "成功";
try { try {
String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, projectId); List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, projectId);
//存放数据json数组 //存放数据json数组
Integer pid = projectId; Integer pid = projectId;
@@ -617,11 +633,17 @@ public class DepotItemController {
List<String[]> objects = new ArrayList<String[]>(); List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) { if (null != dataList) {
for (DepotItemStockWarningCount diEx : dataList) { for (DepotItemStockWarningCount diEx : dataList) {
DepotItemVo4WithInfoEx diVI = new DepotItemVo4WithInfoEx();
diVI.setMMfrs(diEx.getMMfrs());
diVI.setMOtherField1(diEx.getMOtherField1());
diVI.setMOtherField2(diEx.getMOtherField2());
diVI.setMOtherField3(diEx.getMOtherField3());
String materialOther = getOtherInfo(mpArr, diVI);
String[] objs = new String[10]; String[] objs = new String[10];
objs[0] = diEx.getMaterialName(); objs[0] = diEx.getMaterialName();
objs[1] = diEx.getMaterialStandard(); objs[1] = diEx.getMaterialStandard();
objs[2] = diEx.getMaterialModel(); objs[2] = diEx.getMaterialModel();
objs[3] = diEx.getMaterialOther(); objs[3] = materialOther;
objs[4] = diEx.getMaterialUnit(); objs[4] = diEx.getMaterialUnit();
objs[5] = diEx.getBasicInNumber().toString(); objs[5] = diEx.getBasicInNumber().toString();
objs[6] = diEx.getBasicOutNumber() == null ? "0" : diEx.getBasicOutNumber().toString(); objs[6] = diEx.getBasicOutNumber() == null ? "0" : diEx.getBasicOutNumber().toString();

View File

@@ -11,10 +11,18 @@ public class DepotItemStockWarningCount {
private String MaterialStandard; private String MaterialStandard;
private String MMfrs;
private String categoryName; private String categoryName;
private String MaterialOther; private String MaterialOther;
private String MOtherField1;
private String MOtherField2;
private String MOtherField3;
private String MaterialUnit; private String MaterialUnit;
private BigDecimal safetystock;//安全库存量 private BigDecimal safetystock;//安全库存量
@@ -52,6 +60,14 @@ public class DepotItemStockWarningCount {
MaterialStandard = materialStandard; MaterialStandard = materialStandard;
} }
public String getMMfrs() {
return MMfrs;
}
public void setMMfrs(String MMfrs) {
this.MMfrs = MMfrs;
}
public String getCategoryName() { public String getCategoryName() {
return categoryName; return categoryName;
} }
@@ -68,6 +84,30 @@ public class DepotItemStockWarningCount {
MaterialOther = materialOther; MaterialOther = materialOther;
} }
public String getMOtherField1() {
return MOtherField1;
}
public void setMOtherField1(String MOtherField1) {
this.MOtherField1 = MOtherField1;
}
public String getMOtherField2() {
return MOtherField2;
}
public void setMOtherField2(String MOtherField2) {
this.MOtherField2 = MOtherField2;
}
public String getMOtherField3() {
return MOtherField3;
}
public void setMOtherField3(String MOtherField3) {
this.MOtherField3 = MOtherField3;
}
public String getMaterialUnit() { public String getMaterialUnit() {
return MaterialUnit; return MaterialUnit;
} }

View File

@@ -41,6 +41,9 @@
<result column="MModel" jdbcType="VARCHAR" property="MModel" /> <result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" /> <result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" /> <result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
<result column="MOtherField3" jdbcType="VARCHAR" property="MOtherField3" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" /> <result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" /> <result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
@@ -50,9 +53,12 @@
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" /> <result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" /> <result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
<result column="MaterialStandard" jdbcType="VARCHAR" property="MaterialStandard" /> <result column="MaterialStandard" jdbcType="VARCHAR" property="MaterialStandard" />
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" /> <result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="MaterialOther" jdbcType="VARCHAR" property="MaterialOther" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" /> <result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
<result column="MOtherField3" jdbcType="VARCHAR" property="MOtherField3" />
<result column="safetystock" jdbcType="DECIMAL" property="safetystock" /> <result column="safetystock" jdbcType="DECIMAL" property="safetystock" />
<result column="BasicInNumber" jdbcType="DECIMAL" property="BasicInNumber" /> <result column="BasicInNumber" jdbcType="DECIMAL" property="BasicInNumber" />
<result column="BasicOutNumber" jdbcType="DECIMAL" property="BasicOutNumber" /> <result column="BasicOutNumber" jdbcType="DECIMAL" property="BasicOutNumber" />
@@ -158,6 +164,7 @@
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial"> <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard, select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
m.unit MaterialUnit, m.color MColor, u.name unit_name, m.unit MaterialUnit, m.color MColor, u.name unit_name,
(select purchase_decimal from jsh_material_extend me (select purchase_decimal from jsh_material_extend me
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1) where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
@@ -369,15 +376,9 @@
m.name MaterialName, m.name MaterialName,
m.model MaterialModel, m.model MaterialModel,
m.standard MaterialStandard, m.standard MaterialStandard,
m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
mc.`Name` categoryName, mc.`Name` categoryName,
CONCAT(
'(',
m.standard,
')',
'(',
m.color,
')'
) AS MaterialOther,
m.unit MaterialUnit, m.unit MaterialUnit,
ifnull(m.safety_stock,0) safetystock, ifnull(m.safety_stock,0) safetystock,
IFNULL(intype.BasicInNumber ,0) BasicInNumber, IFNULL(intype.BasicInNumber ,0) BasicInNumber,