|
|
@ -6,6 +6,9 @@ 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.wms.biz.func.basegoodsspu.BaseGoodsSpuQuery; |
|
|
|
import com.yxt.wms.biz.func.commonmethod.CommonMethod; |
|
|
|
import com.yxt.wms.biz.func.commonmethod.DataRule; |
|
|
|
import com.yxt.wms.biz.func.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.wms.feign.base.basegoodstype.BaseGoodsTypeFeign; |
|
|
|
import com.yxt.wms.feign.portal.privilege.PrivilegeQuery; |
|
|
@ -28,48 +31,14 @@ public class BaseGoodsTypeService extends MybatisBaseService<BaseGoodsTypeMapper |
|
|
|
BaseGoodsTypeFeign baseGoodsTypeFeign; |
|
|
|
@Autowired |
|
|
|
SysOrganizationFeign sysOrganizationFeign; |
|
|
|
@Autowired |
|
|
|
CommonMethod commonMethod; |
|
|
|
|
|
|
|
public ResultBean<PagerVo<BaseGoodsTypeVo>> listPage(PagerQuery<BaseGoodsTypeQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
QueryWrapper<BaseGoodsType> qw = new QueryWrapper<>(); |
|
|
|
// if (StringUtils.isNotBlank(query.getMenuUrl())) {
|
|
|
|
// PrivilegeQuery privilegeQuery = new PrivilegeQuery();
|
|
|
|
// privilegeQuery.setOrgPath(query.getOrgPath());
|
|
|
|
// privilegeQuery.setMenuUrl(query.getMenuUrl());
|
|
|
|
// privilegeQuery.setUserSid(query.getUserSid());
|
|
|
|
// ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery);
|
|
|
|
// if (StringUtils.isNotBlank(defaultIdReltBean.getData())) {
|
|
|
|
// //数据权限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 = defaultIdReltBean.getData();
|
|
|
|
// if ("1".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i1);
|
|
|
|
// qw.like("u.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("2".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i2);
|
|
|
|
// qw.like("u.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("3".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i3);
|
|
|
|
// qw.like("u.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("4".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, i4);
|
|
|
|
// qw.like("u.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("5".equals(orgLevelKey)) {
|
|
|
|
// qw.eq("p.createBySid", query.getUserSid());
|
|
|
|
// } else {
|
|
|
|
// PagerVo<BaseGoodsTypeVo> p = new PagerVo<>();
|
|
|
|
// return rb.success().setData(p);
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// PagerVo<BaseGoodsTypeVo> p = new PagerVo<>();
|
|
|
|
// return rb.success().setData(p);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
BaseGoodsTypeQuery query=pq.getParams(); |
|
|
|
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|
|
|
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|
|
|
pq.getParams().setIndex(dataRule.getIndex()); |
|
|
|
return baseGoodsTypeFeign.listPage(pq); |
|
|
|
} |
|
|
|
public ResultBean<List<BaseGoodsType>> listAll(OrgPathQuery query) { |
|
|
|