Commit c22b231a by zhangtw

申领审核显示库存按照当前区域筛选

parent 987884a1
......@@ -305,6 +305,12 @@ public class KeyDmBorrowServiceImpl {
@ApiOperation(value = "根据ID查询申请及明细/日志", desc = "详情")
public Map<String, Object> getById(Map<String, Object> map) {
if (map == null || map.get("id") == null) throw new CustomException("参数缺失");
Map<String, Object> user = (Map<String, Object>) map.get("_user");
if (user != null) {
Map<String, String> pos = DataScopeUtil.getPosition(user);
areaId = pos.get("area_id");
user.put("areaId", areaId);
}
Map<String, Object> ret = new HashMap<>();
Map<String, Object> app = commonService.getObject(namespace + "getById", map);
ret.putAll(app == null ? new HashMap<>() : app);
......
......@@ -17,7 +17,13 @@
on m.id = bd.material_id
left join jl_key_dm_inventory as i
on bd.material_id = i.material_id
WHERE bd.application_id = #{id} AND bd.is_used = 1 ORDER BY bd.create_time ASC
<where>
bd.application_id = #{id} AND bd.is_used = 1
<if test="_user.areaId != null">
and i.apply_dep_code = #{_user.areaId}
</if>
</where>
ORDER BY bd.create_time ASC
</select>
</mapper>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论