|
|
@ -10,6 +10,7 @@ import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
|
|
|
@ -31,36 +32,29 @@ public class WarehouseRackService extends MybatisBaseService<WarehouseRackMapper |
|
|
|
WarehouseRackQuery query = pq.getParams(); |
|
|
|
QueryWrapper<WarehouseRack> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人) -
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = query.getOrgLevelKey(); |
|
|
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
|
|
|
String orgLevelKey=query.getOrgLevelKey(); |
|
|
|
String orgSidPath=query.getOrgPath(); |
|
|
|
int index=query.getIndex(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("orgSidPath", orgSidPath); |
|
|
|
orgSidPath = orgSidPath.substring(0, index); |
|
|
|
qw.like("a.useOrgSid", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("orgSidPath", orgSidPath); |
|
|
|
orgSidPath = orgSidPath.substring(0, index); |
|
|
|
qw.like("a.useOrgSid", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("orgSidPath", orgSidPath); |
|
|
|
orgSidPath = orgSidPath.substring(0, index); |
|
|
|
qw.apply("a.useOrgSid like('"+orgSidPath+"%')"); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("createBySid", query.getUserSid()); |
|
|
|
qw.eq("a.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<WarehouseRackVo> p = new PagerVo<>(); |
|
|
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>(); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
}/* else { |
|
|
|
PagerVo<WarehouseRackVo> p = new PagerVo<>(); |
|
|
|
} else { |
|
|
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>(); |
|
|
|
return rb.success().setData(p); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.like("rackName", query.getName()); |
|
|
|
} |
|
|
@ -68,15 +62,12 @@ public class WarehouseRackService extends MybatisBaseService<WarehouseRackMapper |
|
|
|
qw.like("rackCode", query.getCode()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getAreaTypeSid())) { |
|
|
|
qw.eq("sid", query.getAreaTypeSid()); |
|
|
|
qw.eq("a.sid", query.getAreaTypeSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getWarehouseSid())) { |
|
|
|
qw.eq("sid", query.getWarehouseSid()); |
|
|
|
qw.eq("c.sid", query.getWarehouseSid()); |
|
|
|
} |
|
|
|
qw.ne("a.isDelete", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
qw.like("useOrgSid", query.getOrgPath()); |
|
|
|
} |
|
|
|
IPage<WarehouseRack> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WarehouseRackVo> pagging = baseMapper.listPage(page,qw); |
|
|
|
PagerVo<WarehouseRackVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|