仓库管理根据数据权限组装sql
This commit is contained in:
@@ -17,6 +17,7 @@ public class WarehouseAreaQuery implements Query {
|
|||||||
private String warehouseSid;//仓库
|
private String warehouseSid;//仓库
|
||||||
private String areaTypeSid;//库区类型
|
private String areaTypeSid;//库区类型
|
||||||
private String orgLevelKey;//
|
private String orgLevelKey;//
|
||||||
|
private int index;//下标
|
||||||
|
|
||||||
@ApiModelProperty("菜单路由")
|
@ApiModelProperty("菜单路由")
|
||||||
private String menuUrl;
|
private String menuUrl;
|
||||||
@@ -24,4 +25,5 @@ public class WarehouseAreaQuery implements Query {
|
|||||||
private String orgPath;
|
private String orgPath;
|
||||||
@ApiModelProperty("用户sid")
|
@ApiModelProperty("用户sid")
|
||||||
private String userSid;
|
private String userSid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -31,37 +32,29 @@ public class WarehouseAreaService extends MybatisBaseService<WarehouseAreaMapper
|
|||||||
QueryWrapper<WarehouseArea> qw = new QueryWrapper<>();
|
QueryWrapper<WarehouseArea> qw = new QueryWrapper<>();
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||||
String orgSidPath = query.getOrgPath();
|
String orgLevelKey=query.getOrgLevelKey();
|
||||||
orgSidPath = orgSidPath + "/";
|
String orgSidPath=query.getOrgPath();
|
||||||
int i1 = orgSidPath.indexOf("/");
|
int index=query.getIndex();
|
||||||
int i2 = orgSidPath.indexOf("/", i1 + 1);
|
|
||||||
int i3 = orgSidPath.indexOf("/", i2 + 1);
|
|
||||||
int i4 = orgSidPath.indexOf("/", i3 + 1);
|
|
||||||
String orgLevelKey = query.getOrgLevelKey();
|
|
||||||
if ("1".equals(orgLevelKey)) {
|
if ("1".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i1);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("2".equals(orgLevelKey)) {
|
} else if ("2".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i2);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("3".equals(orgLevelKey)) {
|
} else if ("3".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i3);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.apply("a.useOrgSid like('"+orgSidPath+"%')");
|
||||||
} else if ("4".equals(orgLevelKey)) {
|
} else if ("4".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i4);
|
qw.eq("a.createBySid", query.getUserSid());
|
||||||
qw.like("orgSidPath", orgSidPath);
|
} else {
|
||||||
} else if ("5".equals(orgLevelKey)) {
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
qw.eq("createBySid", query.getUserSid());
|
return rb.success().setData(p);
|
||||||
} /*else {
|
}
|
||||||
PagerVo<WarehouseAreaVo> p = new PagerVo<>();
|
} else {
|
||||||
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// PagerVo<WarehouseAreaVo> p = new PagerVo<>();
|
|
||||||
// return rb.success().setData(p);
|
|
||||||
// }
|
|
||||||
if (StringUtils.isNotBlank(query.getName())) {
|
if (StringUtils.isNotBlank(query.getName())) {
|
||||||
qw.like("areaName", query.getName());
|
qw.like("areaName", query.getName());
|
||||||
}
|
}
|
||||||
@@ -74,10 +67,7 @@ public class WarehouseAreaService extends MybatisBaseService<WarehouseAreaMapper
|
|||||||
if (StringUtils.isNotBlank(query.getAreaTypeSid())) {
|
if (StringUtils.isNotBlank(query.getAreaTypeSid())) {
|
||||||
qw.eq("sid", query.getAreaTypeSid());
|
qw.eq("sid", query.getAreaTypeSid());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getOrgPath())) {
|
qw.ne("isDelete", "1");
|
||||||
qw.like("a.useOrgSid", query.getOrgPath());
|
|
||||||
}
|
|
||||||
qw.ne("a.isDelete", "1");
|
|
||||||
IPage<WarehouseArea> page = PagerUtil.queryToPage(pq);
|
IPage<WarehouseArea> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<WarehouseAreaVo> pagging = baseMapper.listPage(page, qw);
|
IPage<WarehouseAreaVo> pagging = baseMapper.listPage(page, qw);
|
||||||
PagerVo<WarehouseAreaVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseAreaVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import lombok.Data;
|
|||||||
public class WarehouseAreaTypeQuery implements Query {
|
public class WarehouseAreaTypeQuery implements Query {
|
||||||
private String name;
|
private String name;
|
||||||
private String orgLevelKey;//
|
private String orgLevelKey;//
|
||||||
|
private int index;
|
||||||
@ApiModelProperty("菜单路由")
|
@ApiModelProperty("菜单路由")
|
||||||
private String menuUrl;
|
private String menuUrl;
|
||||||
@ApiModelProperty("组织全路径sid")
|
@ApiModelProperty("组织全路径sid")
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
@@ -31,44 +32,33 @@ public class WarehouseAreaTypeService extends MybatisBaseService<WarehouseAreaTy
|
|||||||
WarehouseAreaTypeQuery query = pq.getParams();
|
WarehouseAreaTypeQuery query = pq.getParams();
|
||||||
QueryWrapper<WarehouseAreaType> qw = new QueryWrapper<>();
|
QueryWrapper<WarehouseAreaType> qw = new QueryWrapper<>();
|
||||||
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||||
String orgSidPath = query.getOrgPath();
|
String orgLevelKey=query.getOrgLevelKey();
|
||||||
orgSidPath = orgSidPath + "/";
|
String orgSidPath=query.getOrgPath();
|
||||||
int i1 = orgSidPath.indexOf("/");
|
int index=query.getIndex();
|
||||||
int i2 = orgSidPath.indexOf("/", i1 + 1);
|
|
||||||
int i3 = orgSidPath.indexOf("/", i2 + 1);
|
|
||||||
int i4 = orgSidPath.indexOf("/", i3 + 1);
|
|
||||||
String orgLevelKey = query.getOrgLevelKey();
|
|
||||||
if ("1".equals(orgLevelKey)) {
|
if ("1".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i1);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("2".equals(orgLevelKey)) {
|
} else if ("2".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i2);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("3".equals(orgLevelKey)) {
|
} else if ("3".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i3);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.apply("a.useOrgSid like('"+orgSidPath+"%')");
|
||||||
} else if ("4".equals(orgLevelKey)) {
|
} else if ("4".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i4);
|
qw.eq("a.createBySid", query.getUserSid());
|
||||||
qw.like("orgSidPath", orgSidPath);
|
|
||||||
} else if ("5".equals(orgLevelKey)) {
|
|
||||||
qw.eq("createBySid", query.getUserSid());
|
|
||||||
} else {
|
} else {
|
||||||
PagerVo<WarehouseAreaTypeVo> p = new PagerVo<>();
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// PagerVo<WarehouseAreaTypeVo> p = new PagerVo<>();
|
|
||||||
// return rb.success().setData(p);
|
|
||||||
// }
|
|
||||||
if(StringUtils.isNotBlank(query.getName())){
|
if(StringUtils.isNotBlank(query.getName())){
|
||||||
qw.like("warehouseAreaTypeName",query.getName());
|
qw.like("a.warehouseAreaTypeName",query.getName());
|
||||||
}
|
|
||||||
qw.ne("isDelete","1");
|
|
||||||
if (StringUtils.isNotBlank(query.getOrgPath())) {
|
|
||||||
qw.like("useOrgSid", query.getOrgPath());
|
|
||||||
}
|
}
|
||||||
|
qw.ne("a.isDelete","1");
|
||||||
IPage<WarehouseAreaType> page = PagerUtil.queryToPage(pq);
|
IPage<WarehouseAreaType> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<WarehouseAreaTypeVo> pagging = baseMapper.listPage(page, qw);
|
IPage<WarehouseAreaTypeVo> pagging = baseMapper.listPage(page, qw);
|
||||||
PagerVo<WarehouseAreaTypeVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseAreaTypeVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import lombok.Data;
|
|||||||
public class WarehouseExtend extends BaseEntity {
|
public class WarehouseExtend extends BaseEntity {
|
||||||
|
|
||||||
private String warehouseSid;//仓库sid
|
private String warehouseSid;//仓库sid
|
||||||
private String markupRate1;//加价率1
|
private Integer markupRate1;//加价率1
|
||||||
private String markupRate2;//加价率2
|
private Integer markupRate2;//加价率2
|
||||||
private String markupRate3;//加价率3
|
private Integer markupRate3;//加价率3
|
||||||
private String markupRate4;//加价率4
|
private Integer markupRate4;//加价率4
|
||||||
private String markupRate5;//加价率5
|
private Integer markupRate5;//加价率5
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ public class WarehouseExtendDto implements Dto {
|
|||||||
private String remarks;
|
private String remarks;
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
private String warehouseSid;//仓库sid
|
private String warehouseSid;//仓库sid
|
||||||
private String markupRate1;//加价率1
|
private Integer markupRate1;//加价率1
|
||||||
private String markupRate2;//加价率2
|
private Integer markupRate2;//加价率2
|
||||||
private String markupRate3;//加价率3
|
private Integer markupRate3;//加价率3
|
||||||
private String markupRate4;//加价率4
|
private Integer markupRate4;//加价率4
|
||||||
private String markupRate5;//加价率5
|
private Integer markupRate5;//加价率5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ public class WarehouseExtendVo implements Vo {
|
|||||||
private String isDelete;
|
private String isDelete;
|
||||||
private String warehouseSid;//仓库sid
|
private String warehouseSid;//仓库sid
|
||||||
private String warehouseName;//仓库名称
|
private String warehouseName;//仓库名称
|
||||||
private String markupRate1;//加价率1
|
private Integer markupRate1;//加价率1
|
||||||
private String markupRate2;//加价率2
|
private Integer markupRate2;//加价率2
|
||||||
private String markupRate3;//加价率3
|
private Integer markupRate3;//加价率3
|
||||||
private String markupRate4;//加价率4
|
private Integer markupRate4;//加价率4
|
||||||
private String markupRate5;//加价率5
|
private Integer markupRate5;//加价率5
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public class WarehouseInfo extends BaseEntity {
|
|||||||
private String latitude;//纬度
|
private String latitude;//纬度
|
||||||
private String warehouseTypeKey;//仓库类型Key
|
private String warehouseTypeKey;//仓库类型Key
|
||||||
private String warehouseTypeValue;//仓库类型value
|
private String warehouseTypeValue;//仓库类型value
|
||||||
private String usageStatus;//使用状态,0停用 1正常
|
private Integer usageStatus;//使用状态,0停用 1正常
|
||||||
private String squareMeter;//平方米
|
private String squareMeter;//平方米
|
||||||
private String sortNo;//排序
|
private Integer sortNo;//排序
|
||||||
private String useOrgSid;//创建组织sid
|
private String useOrgSid;//创建组织sid
|
||||||
private String createOrgSid;//创建组织sid
|
private String createOrgSid;//创建组织sid
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,15 @@ import java.util.Date;
|
|||||||
public class WarehouseInfoDto implements Dto {
|
public class WarehouseInfoDto implements Dto {
|
||||||
private String id;
|
private String id;
|
||||||
private String sid;
|
private String sid;
|
||||||
|
private String lockVersion;
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date modifyTime;
|
||||||
private String remarks;
|
private String remarks;
|
||||||
private String isEnable;
|
private Integer isEnable;
|
||||||
|
private Integer state;
|
||||||
|
private Integer isDelete;
|
||||||
private String warehouseName;//仓库名称
|
private String warehouseName;//仓库名称
|
||||||
private String warehouseCode;//仓库编码
|
private String warehouseCode;//仓库编码
|
||||||
private String contacts;//联系人
|
private String contacts;//联系人
|
||||||
@@ -31,9 +36,9 @@ public class WarehouseInfoDto implements Dto {
|
|||||||
private String latitude;//纬度
|
private String latitude;//纬度
|
||||||
private String warehouseTypeKey;//仓库类型Key
|
private String warehouseTypeKey;//仓库类型Key
|
||||||
private String warehouseTypeValue;//仓库类型value
|
private String warehouseTypeValue;//仓库类型value
|
||||||
private String usageStatus;//使用状态,0停用 1正常
|
private Integer usageStatus;//使用状态,0停用 1正常
|
||||||
private String squareMeter;//平方米
|
private String squareMeter;//平方米
|
||||||
private String sortNo;//创建组织sid
|
private Integer sortNo;//排序
|
||||||
private String useOrgSid;//创建组织sid
|
private String useOrgSid;//创建组织sid
|
||||||
private String createOrgSid;//创建组织sid
|
private String createOrgSid;//创建组织sid
|
||||||
// private List<WmsWarehouseExtendDto> wmsWarehouseExtendDtos;
|
// private List<WmsWarehouseExtendDto> wmsWarehouseExtendDtos;
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ public class WarehouseInfoQuery implements Query {
|
|||||||
@ApiModelProperty("用户sid")
|
@ApiModelProperty("用户sid")
|
||||||
private String userSid;
|
private String userSid;
|
||||||
private String orgLevelKey;//
|
private String orgLevelKey;//
|
||||||
|
private int index;//下标
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,37 +41,29 @@ public class WarehouseInfoService extends MybatisBaseService<WarehouseInfoMapper
|
|||||||
WarehouseInfoQuery query = pq.getParams();
|
WarehouseInfoQuery query = pq.getParams();
|
||||||
QueryWrapper<WarehouseInfo> qw = new QueryWrapper<>();
|
QueryWrapper<WarehouseInfo> qw = new QueryWrapper<>();
|
||||||
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||||
String orgSidPath = query.getOrgPath();
|
String orgLevelKey=query.getOrgLevelKey();
|
||||||
orgSidPath = orgSidPath + "/";
|
String orgSidPath=query.getOrgPath();
|
||||||
int i1 = orgSidPath.indexOf("/");
|
int index=query.getIndex();
|
||||||
int i2 = orgSidPath.indexOf("/", i1 + 1);
|
|
||||||
int i3 = orgSidPath.indexOf("/", i2 + 1);
|
|
||||||
int i4 = orgSidPath.indexOf("/", i3 + 1);
|
|
||||||
String orgLevelKey = query.getOrgLevelKey();
|
|
||||||
if ("1".equals(orgLevelKey)) {
|
if ("1".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i1);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("useOrgSid", orgSidPath);
|
||||||
} else if ("2".equals(orgLevelKey)) {
|
} else if ("2".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i2);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("useOrgSid", orgSidPath);
|
||||||
} else if ("3".equals(orgLevelKey)) {
|
} else if ("3".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i3);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.apply("useOrgSid like('"+orgSidPath+"')");
|
||||||
} else if ("4".equals(orgLevelKey)) {
|
} 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("createBySid", query.getUserSid());
|
||||||
} else {
|
} else {
|
||||||
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
|
||||||
// return rb.success().setData(p);
|
|
||||||
// }
|
|
||||||
if (StringUtils.isNotBlank(query.getName())) {
|
if (StringUtils.isNotBlank(query.getName())) {
|
||||||
qw.like("warehouseName", query.getName());
|
qw.like("warehouseName", query.getName());
|
||||||
}
|
}
|
||||||
@@ -81,9 +73,6 @@ public class WarehouseInfoService extends MybatisBaseService<WarehouseInfoMapper
|
|||||||
if (StringUtils.isNotBlank(query.getAddress())) {
|
if (StringUtils.isNotBlank(query.getAddress())) {
|
||||||
qw.like("address", query.getAddress());
|
qw.like("address", query.getAddress());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getOrgPath())) {
|
|
||||||
qw.like("useOrgSid", query.getOrgPath());
|
|
||||||
}
|
|
||||||
qw.ne("isDelete",1);
|
qw.ne("isDelete",1);
|
||||||
qw.orderByDesc("sortNo");
|
qw.orderByDesc("sortNo");
|
||||||
IPage<WarehouseInfo> page = PagerUtil.queryToPage(pq);
|
IPage<WarehouseInfo> page = PagerUtil.queryToPage(pq);
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public class WarehouseInfoVo implements Vo {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
private String remarks;
|
private String remarks;
|
||||||
private String isEnable;
|
private Integer isEnable;
|
||||||
private String state;
|
private Integer state;
|
||||||
private String isDelete;
|
private Integer isDelete;
|
||||||
private String warehouseName;//仓库名称
|
private String warehouseName;//仓库名称
|
||||||
private String warehouseCode;//仓库编码
|
private String warehouseCode;//仓库编码
|
||||||
private String contacts;//联系人
|
private String contacts;//联系人
|
||||||
@@ -37,9 +37,9 @@ public class WarehouseInfoVo implements Vo {
|
|||||||
private String latitude;//纬度
|
private String latitude;//纬度
|
||||||
private String warehouseTypeKey;//仓库类型Key
|
private String warehouseTypeKey;//仓库类型Key
|
||||||
private String warehouseTypeValue;//仓库类型value
|
private String warehouseTypeValue;//仓库类型value
|
||||||
private String usageStatus;//使用状态,0停用 1正常
|
private Integer usageStatus;//使用状态,0停用 1正常
|
||||||
private String squareMeter;//平方米
|
private String squareMeter;//平方米
|
||||||
private String sortNo;//创建组织sid
|
private Integer sortNo;//排序
|
||||||
private String useOrgSid;//创建组织sid
|
private String useOrgSid;//创建组织sid
|
||||||
private String createOrgSid;//创建组织sid
|
private String createOrgSid;//创建组织sid
|
||||||
private List<WarehouseExtendVo> wmsWarehouseExtendVos;
|
private List<WarehouseExtendVo> wmsWarehouseExtendVos;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import lombok.Data;
|
|||||||
public class WarehouseRackQuery implements Query {
|
public class WarehouseRackQuery implements Query {
|
||||||
private String name;//名字
|
private String name;//名字
|
||||||
private String orgLevelKey;//
|
private String orgLevelKey;//
|
||||||
|
private int index;
|
||||||
|
|
||||||
private String code;//编码
|
private String code;//编码
|
||||||
private String warehouseSid;//仓库
|
private String warehouseSid;//仓库
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
@@ -31,36 +32,29 @@ public class WarehouseRackService extends MybatisBaseService<WarehouseRackMapper
|
|||||||
WarehouseRackQuery query = pq.getParams();
|
WarehouseRackQuery query = pq.getParams();
|
||||||
QueryWrapper<WarehouseRack> qw = new QueryWrapper<>();
|
QueryWrapper<WarehouseRack> qw = new QueryWrapper<>();
|
||||||
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人) -
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||||
String orgSidPath = query.getOrgPath();
|
String orgLevelKey=query.getOrgLevelKey();
|
||||||
orgSidPath = orgSidPath + "/";
|
String orgSidPath=query.getOrgPath();
|
||||||
int i1 = orgSidPath.indexOf("/");
|
int index=query.getIndex();
|
||||||
int i2 = orgSidPath.indexOf("/", i1 + 1);
|
|
||||||
int i3 = orgSidPath.indexOf("/", i2 + 1);
|
|
||||||
int i4 = orgSidPath.indexOf("/", i3 + 1);
|
|
||||||
String orgLevelKey = query.getOrgLevelKey();
|
|
||||||
if ("1".equals(orgLevelKey)) {
|
if ("1".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i1);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("2".equals(orgLevelKey)) {
|
} else if ("2".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i2);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.like("a.useOrgSid", orgSidPath);
|
||||||
} else if ("3".equals(orgLevelKey)) {
|
} else if ("3".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i3);
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
qw.like("orgSidPath", orgSidPath);
|
qw.apply("a.useOrgSid like('"+orgSidPath+"%')");
|
||||||
} else if ("4".equals(orgLevelKey)) {
|
} else if ("4".equals(orgLevelKey)) {
|
||||||
orgSidPath = orgSidPath.substring(0, i4);
|
qw.eq("a.createBySid", query.getUserSid());
|
||||||
qw.like("orgSidPath", orgSidPath);
|
|
||||||
} else if ("5".equals(orgLevelKey)) {
|
|
||||||
qw.eq("createBySid", query.getUserSid());
|
|
||||||
} else {
|
} else {
|
||||||
PagerVo<WarehouseRackVo> p = new PagerVo<>();
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
}/* else {
|
} else {
|
||||||
PagerVo<WarehouseRackVo> p = new PagerVo<>();
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}*/
|
}
|
||||||
if (StringUtils.isNotBlank(query.getName())) {
|
if (StringUtils.isNotBlank(query.getName())) {
|
||||||
qw.like("rackName", query.getName());
|
qw.like("rackName", query.getName());
|
||||||
}
|
}
|
||||||
@@ -68,15 +62,12 @@ public class WarehouseRackService extends MybatisBaseService<WarehouseRackMapper
|
|||||||
qw.like("rackCode", query.getCode());
|
qw.like("rackCode", query.getCode());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getAreaTypeSid())) {
|
if (StringUtils.isNotBlank(query.getAreaTypeSid())) {
|
||||||
qw.eq("sid", query.getAreaTypeSid());
|
qw.eq("a.sid", query.getAreaTypeSid());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getWarehouseSid())) {
|
if (StringUtils.isNotBlank(query.getWarehouseSid())) {
|
||||||
qw.eq("sid", query.getWarehouseSid());
|
qw.eq("c.sid", query.getWarehouseSid());
|
||||||
}
|
}
|
||||||
qw.ne("a.isDelete", "1");
|
qw.ne("a.isDelete", "1");
|
||||||
if (StringUtils.isNotBlank(query.getOrgPath())) {
|
|
||||||
qw.like("useOrgSid", query.getOrgPath());
|
|
||||||
}
|
|
||||||
IPage<WarehouseRack> page = PagerUtil.queryToPage(pq);
|
IPage<WarehouseRack> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<WarehouseRackVo> pagging = baseMapper.listPage(page,qw);
|
IPage<WarehouseRackVo> pagging = baseMapper.listPage(page,qw);
|
||||||
PagerVo<WarehouseRackVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseRackVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user