优化报表,使其显示扩展信息
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user