|
|
@ -13,6 +13,7 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.warehouse.biz.inventoryadjustment.InventoryAdjustmentAllVo; |
|
|
|
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo; |
|
|
|
import com.yxt.warehouse.utils.OrgPathQuery; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
@ -27,36 +28,35 @@ import java.util.stream.Collectors; |
|
|
|
@Service |
|
|
|
public class InventoryAdjustmentDetailService extends MybatisBaseService<InventoryAdjustmentDetailMapper, InventoryAdjustmentDetail> { |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<PagerVo<InventoryAdjustmentDetailVo>> listPage(PagerQuery<InventoryAdjustmentDetailQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
InventoryAdjustmentDetailQuery query = pq.getParams(); |
|
|
|
QueryWrapper<InventoryAdjustmentDetail> 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<WarehouseInfoVo> p = new PagerVo<>(); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<WarehouseInfoVo> p = new PagerVo<>(); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
//
|
|
|
|
// 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<WarehouseInfoVo> p = new PagerVo<>();
|
|
|
|
// return rb.success().setData(p);
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
|
|
|
// return rb.success().setData(p);
|
|
|
|
// }
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getStart()), "count >= " + query.getStart() ) . |
|
|
|
apply(StringUtils.isNotBlank(query.getEnd()), "count<= " + query.getEnd() |
|
|
|
); |
|
|
@ -73,6 +73,7 @@ public class InventoryAdjustmentDetailService extends MybatisBaseService<Invento |
|
|
|
qw.eq("c.sid", query.getTypeSid()); |
|
|
|
} |
|
|
|
qw.ne("a.isDelete", "1"); |
|
|
|
qw.ne("state","3"); |
|
|
|
IPage<InventoryAdjustmentDetail> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<InventoryAdjustmentDetailVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
|
|
|
|