代码提交

This commit is contained in:
liang.chao 2026-02-06 09:48:59 +08:00
parent 4e7158c2a4
commit 400efc5505
2 changed files with 36 additions and 0 deletions

View File

@ -272,6 +272,9 @@
<if test="maType != null and maType != ''">
and mat2.`NAME` like concat ('%',#{maType},'%')
</if>
<if test="isCount != null and isCount != ''">
and rs.isCount = #{isCount}
</if>
</where>
GROUP BY rs.typeId
) a WHERE

View File

@ -80,6 +80,39 @@ public class IndexHomeDetailsController extends BaseController<IndexHomeDetailsB
}
return ar;
}
@RequestMapping(value = "getMaTypeDetail", method = RequestMethod.POST)
@ResponseBody
public AjaxRes getMaTypeDetail(IndexHomeDetailsBean o) {
AjaxRes ar = getAjaxRes();
try {
List<IndexHomeDetailsBean> list = service.getMaTypeDetails(o);
if (o != null) {
// 过滤数量
if (o.getQuantityFilter() != null && o.getQuantityFilter() > 0) {
switch (o.getQuantityFilter()) {
case 1:
list.removeIf(item -> item.getMaTotal() == null || item.getMaTotal() < 1);
break;
case 2:
list.removeIf(item -> item.getStorageNum() == null || item.getStorageNum() < 1);
break;
case 3:
list.removeIf(item -> item.getInuseNum() == null || item.getInuseNum() < 1);
break;
case 4:
list.removeIf(item -> item.getScrapNum() == null || item.getScrapNum() < 1);
break;
}
}
}
ar.setSucceed("code", "0");
ar.setSucceed(list);
} catch (Exception e) {
logger.error(e.toString(), e);
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
@RequestMapping(value = "getMaChangeInfo", method = RequestMethod.POST)
@ResponseBody