7/12
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
<select id="listPage" resultType="com.yxt.goods.biz.goodsbrandinfo.GoodsBrandInfoVo">
|
||||
select
|
||||
*
|
||||
from goods_brand_info
|
||||
from goods_brand_info a
|
||||
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.goods.biz.goodsbrandinfo;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -12,4 +13,12 @@ public class GoodsBrandInfoQuery implements Query {
|
||||
private String name;
|
||||
private String userOrgSid;
|
||||
private String createOrgSid;//创建组织sid
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -36,26 +36,39 @@ public class GoodsBrandInfoService extends MybatisBaseService<GoodsBrandInfoMapp
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsBrandInfoQuery query = pq.getParams();
|
||||
QueryWrapper<GoodsBrandInfo> qw = new QueryWrapper<>();
|
||||
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("brandName",query.getName());
|
||||
if (StringUtils.isNotBlank(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, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("a.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<GoodsBrandInfoVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<GoodsBrandInfoVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
// if(StringUtils.isNotBlank(query.getUserOrgSid())){
|
||||
// qw.eq("userOrgSid",query.getUserOrgSid());
|
||||
// }
|
||||
qw.ne("isDelete","1");
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("a.brandName",query.getName());
|
||||
}
|
||||
qw.ne("a.isDelete","1");
|
||||
IPage<GoodsBrandInfo> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsBrandInfoVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsBrandInfoVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
List<GoodsBrandInfoVo> records = pagging.getRecords();
|
||||
records.removeAll(Collections.singleton(null));
|
||||
// if (!records.isEmpty()) {
|
||||
// for (BaseBrandInfoVo record : records) {
|
||||
// if (StringUtils.isNotBlank(record.getBigPic())) {
|
||||
// record.setBigPic(fileUploadComponent.getUrlPrefix() + record.getBigPic());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean<List<GoodsBrandInfo>> listAll( OrgPathQuery query) {
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<select id="listPage" resultType="com.yxt.goods.biz.goodsmanufacturer.GoodsManufacturerVo">
|
||||
select
|
||||
*
|
||||
from goods_manufacturer
|
||||
from goods_manufacturer a
|
||||
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.goods.biz.goodsmanufacturer;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -12,4 +13,12 @@ public class GoodsManufacturerQuery implements Query {
|
||||
private String name;
|
||||
private String userOrgSid;
|
||||
private String createOrgSid;//创建组织sid
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -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.goods.biz.goodsbrandinfo.GoodsBrandInfoVo;
|
||||
import com.yxt.goods.utils.OrgPathQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -32,10 +33,34 @@ public class GoodsManufacturerService extends MybatisBaseService<GoodsManufactur
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsManufacturerQuery query = pq.getParams();
|
||||
QueryWrapper<GoodsManufacturer> qw = new QueryWrapper<>();
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("goodsTypeName",query.getName());
|
||||
if (StringUtils.isNotBlank(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, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("a.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
qw.ne("isDelete","1");
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("a.goodsTypeName",query.getName());
|
||||
}
|
||||
qw.ne("a.isDelete","1");
|
||||
qw.orderByDesc("sortNo");
|
||||
IPage<GoodsManufacturer> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsManufacturerVo> pagging = baseMapper.listPage(page, qw);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
left join goods_type a on a.sid=s.goodsTypeSid
|
||||
left join goods_brand_info b on b.sid=s.brandSid
|
||||
left join goods_manufacturer c on c.sid=s.manufacturerSid
|
||||
LEFT JOIN ss_user.sys_organization as d ON s.useOrgSid = d.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.goods.biz.goodsspu;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -12,4 +13,12 @@ public class GoodsSpuQuery implements Query {
|
||||
private String name;
|
||||
private String userOrgSid;
|
||||
private String createOrgSid;//创建组织sid
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.goods.apiadmin.GoodsBrandRest;
|
||||
import com.yxt.goods.biz.goodsbrandinfo.GoodsBrandInfo;
|
||||
import com.yxt.goods.biz.goodsbrandinfo.GoodsBrandInfoService;
|
||||
import com.yxt.goods.biz.goodsmanufacturer.GoodsManufacturerVo;
|
||||
import com.yxt.goods.biz.goodssku.GoodsSku;
|
||||
import com.yxt.goods.biz.goodssku.GoodsSkuDto;
|
||||
import com.yxt.goods.biz.goodssku.GoodsSkuService;
|
||||
@@ -73,25 +74,41 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsSpuQuery query = pq.getParams();
|
||||
QueryWrapper<GoodsSpu> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("goodsName", query.getName());
|
||||
if (StringUtils.isNotBlank(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, index);
|
||||
qw.like("d.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("d.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("d.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("s.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
// if(StringUtils.isNotBlank(query.getUserOrgSid())){
|
||||
// qw.eq("userOrgSid",query.getUserOrgSid());
|
||||
// }
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("s.goodsName", query.getName());
|
||||
}
|
||||
|
||||
qw.ne("s.isDelete","1");
|
||||
IPage<GoodsSpu> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsSpuVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsSpuVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
List<GoodsSpuVo> records = pagging.getRecords();
|
||||
records.removeAll(Collections.singleton(null));
|
||||
// if (!records.isEmpty()) {
|
||||
// for (BaseGoodsSpuVo record : records) {
|
||||
// if (StringUtils.isNotBlank(record.getPicUrl())) {
|
||||
// record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<select id="listPage" resultType="com.yxt.goods.biz.goodstype.GoodsTypeVo">
|
||||
select
|
||||
*
|
||||
from goods_type
|
||||
from goods_type a
|
||||
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.goods.biz.goodstype;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -15,5 +16,13 @@ public class GoodsTypeQuery implements Query {
|
||||
private String outStockRule;//出库规则(先进先出0、先进后出1、保质期优先2)
|
||||
private String userOrgSid;
|
||||
private String createOrgSid;//创建组织sid
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
|
||||
}
|
||||
|
||||
@@ -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.goods.biz.goodsmanufacturer.GoodsManufacturerVo;
|
||||
import com.yxt.goods.utils.OrgPathQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -31,23 +32,45 @@ public class GoodsTypeService extends MybatisBaseService<GoodsTypeMapper, GoodsT
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsTypeQuery query = pq.getParams();
|
||||
QueryWrapper<GoodsType> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(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, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("a.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("goodsTypeName",query.getName());
|
||||
qw.like("a.goodsTypeName",query.getName());
|
||||
}
|
||||
if(StringUtils.isNotBlank(query.getCode())){
|
||||
qw.like("goodsTypeCode",query.getCode());
|
||||
qw.like("a.goodsTypeCode",query.getCode());
|
||||
}
|
||||
if(StringUtils.isNotBlank(query.getIsGoodID())){
|
||||
qw.eq("isGoodsID",query.getIsGoodID());
|
||||
qw.eq("a.isGoodsID",query.getIsGoodID());
|
||||
}
|
||||
if(StringUtils.isNotBlank(query.getOutStockRule())){
|
||||
qw.eq("outStockRule",query.getOutStockRule());
|
||||
qw.eq("a.outStockRule",query.getOutStockRule());
|
||||
}
|
||||
// if(StringUtils.isNotBlank(query.getUserOrgSid())){
|
||||
// qw.eq("userOrgSid",query.getUserOrgSid());
|
||||
// }
|
||||
qw.ne("isDelete","1");
|
||||
qw.orderByDesc("sortNo");
|
||||
qw.ne("a.isDelete","1");
|
||||
qw.orderByDesc("a.sortNo");
|
||||
IPage<GoodsType> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsTypeVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsTypeVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<select id="listPage" resultType="com.yxt.goods.biz.goodsunit.GoodsUnitVo">
|
||||
select
|
||||
*
|
||||
from goods_unit
|
||||
from goods_unit a
|
||||
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.goods.biz.goodsunit;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -12,4 +13,12 @@ public class GoodsUnitQuery implements Query {
|
||||
private String name;
|
||||
private String userOrgSid;
|
||||
private String createOrgSid;//创建组织sid
|
||||
private String orgLevelKey;//权限等级
|
||||
@ApiModelProperty("菜单路由")
|
||||
private String menuUrl;
|
||||
@ApiModelProperty("组织全路径sid")
|
||||
private String orgPath;
|
||||
@ApiModelProperty("用户sid")
|
||||
private String userSid;
|
||||
private int index;
|
||||
}
|
||||
|
||||
@@ -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.goods.biz.goodsmanufacturer.GoodsManufacturerVo;
|
||||
import com.yxt.goods.utils.OrgPathQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -32,10 +33,34 @@ public class GoodsUnitService extends MybatisBaseService<GoodsUnitMapper, GoodsU
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsUnitQuery query = pq.getParams();
|
||||
QueryWrapper<GoodsUnit> qw = new QueryWrapper<>();
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("unitName",query.getName());
|
||||
if (StringUtils.isNotBlank(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, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("a.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<GoodsManufacturerVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
qw.ne("isDelete","1");
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("a.unitName",query.getName());
|
||||
}
|
||||
qw.ne("a.isDelete","1");
|
||||
IPage<GoodsUnit> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsUnitVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsUnitVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
||||
Reference in New Issue
Block a user