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

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

View File

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

View File

@@ -111,6 +111,13 @@
//loadFilter: pagerFilter,
columns: [[
{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: 'enabled', width: 100, formatter: function (value, rec) {
@@ -123,14 +130,7 @@
}
},
{title: '排序', field: 'sort', 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;
}
}
{title: '别名', field: 'anotherName', width: 100}
]],
onLoadError: function () {
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');

View File

@@ -293,12 +293,16 @@
data: ({
currentPage: pageNo,
pageSize: pageSize,
projectId : $.trim($("#searchProjectId").val())
projectId : $.trim($("#searchProjectId").val()),
mpList: mPropertyList
}),
success: function (res) {
if(res && res.code === 200 && res.data) {
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 {
//获取排序后的产品ID

View File

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

View File

@@ -11,10 +11,18 @@ public class DepotItemStockWarningCount {
private String MaterialStandard;
private String MMfrs;
private String categoryName;
private String MaterialOther;
private String MOtherField1;
private String MOtherField2;
private String MOtherField3;
private String MaterialUnit;
private BigDecimal safetystock;//安全库存量
@@ -52,6 +60,14 @@ public class DepotItemStockWarningCount {
MaterialStandard = materialStandard;
}
public String getMMfrs() {
return MMfrs;
}
public void setMMfrs(String MMfrs) {
this.MMfrs = MMfrs;
}
public String getCategoryName() {
return categoryName;
}
@@ -68,6 +84,30 @@ public class DepotItemStockWarningCount {
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() {
return MaterialUnit;
}

View File

@@ -41,6 +41,9 @@
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
<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="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
@@ -50,9 +53,12 @@
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
<result column="MaterialStandard" jdbcType="VARCHAR" property="MaterialStandard" />
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="MaterialOther" jdbcType="VARCHAR" property="MaterialOther" />
<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="BasicInNumber" jdbcType="DECIMAL" property="BasicInNumber" />
<result column="BasicOutNumber" jdbcType="DECIMAL" property="BasicOutNumber" />
@@ -158,6 +164,7 @@
<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,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
m.unit MaterialUnit, m.color MColor, u.name unit_name,
(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)
@@ -369,15 +376,9 @@
m.name MaterialName,
m.model MaterialModel,
m.standard MaterialStandard,
m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
mc.`Name` categoryName,
CONCAT(
'(',
m.standard,
')',
'(',
m.color,
')'
) AS MaterialOther,
m.unit MaterialUnit,
ifnull(m.safety_stock,0) safetystock,
IFNULL(intype.BasicInNumber ,0) BasicInNumber,