|
|
@ -15,6 +15,7 @@ import com.qs.serve.modules.bms.entity.BmsRegion2; |
|
|
|
import com.qs.serve.modules.bms.entity.BmsRegionUser; |
|
|
|
import com.qs.serve.modules.bms.entity.BmsSupplier; |
|
|
|
import com.qs.serve.modules.bms.entity.bo.BmsRegionBatchBo; |
|
|
|
import com.qs.serve.modules.bms.entity.so.BmsBizRegionTreeSo; |
|
|
|
import com.qs.serve.modules.bms.entity.vo.BmsRegionTreeVo; |
|
|
|
import com.qs.serve.modules.bms.service.*; |
|
|
|
import com.qs.serve.modules.tbs.common.TbsCenterType; |
|
|
@ -182,17 +183,19 @@ public class BmsRegion2Controller { |
|
|
|
|
|
|
|
/** |
|
|
|
* 树查询 |
|
|
|
* @param loadByCurrent |
|
|
|
* @param so |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/tree") |
|
|
|
@PreAuthorize("hasRole('bms:region:query')") |
|
|
|
public R<List<BmsRegionTreeVo>> getTree(Integer listUserFlag,Integer loadByCurrent,String supplierId,Integer onlySupplierFlag,Integer type, String targetId){ |
|
|
|
if(loadByCurrent!=null&&loadByCurrent.equals(2)) { |
|
|
|
public R<List<BmsRegionTreeVo>> getTree(BmsBizRegionTreeSo so){ |
|
|
|
if(so.getLoadByCurrent()!=null&&so.getLoadByCurrent().equals(2)) { |
|
|
|
BirBudgetTargetSo query = new BirBudgetTargetSo(); |
|
|
|
query.setLoadType(type); |
|
|
|
query.setLoadType(so.getType()); |
|
|
|
query.setSelectCenterFlag(3); |
|
|
|
query.setTargetId(targetId); |
|
|
|
query.setTargetId(so.getTargetId()); |
|
|
|
query.setYearMonthStart(so.getYearMonthStart()); |
|
|
|
query.setYearMonthEnd(so.getYearMonthEnd()); |
|
|
|
List<String> regionIds = birBudgetTargetService.getCenterByTargetId(query); |
|
|
|
if(regionIds.size()==0){ |
|
|
|
return R.ok(new ArrayList<BmsRegionTreeVo>()); |
|
|
@ -207,9 +210,9 @@ public class BmsRegion2Controller { |
|
|
|
} |
|
|
|
return R.ok(treeVoList); |
|
|
|
} |
|
|
|
if(loadByCurrent!=null&&loadByCurrent.equals(1)){ |
|
|
|
if(onlySupplierFlag!=null&&onlySupplierFlag.equals(1)){ |
|
|
|
BmsSupplier supplier = bmsSupplierService.getById(supplierId); |
|
|
|
if(so.getLoadByCurrent()!=null&&so.getLoadByCurrent().equals(1)){ |
|
|
|
if(so.getOnlySupplierFlag()!=null&&so.getOnlySupplierFlag().equals(1)){ |
|
|
|
BmsSupplier supplier = bmsSupplierService.getById(so.getSupplierId()); |
|
|
|
List<BmsRegion2> rlist = bmsRegion2Service.listByIds(supplier.listBizRegionIds()); |
|
|
|
List<BmsRegionTreeVo> treeVoList = new ArrayList<>(); |
|
|
|
for (BmsRegion2 region2 : rlist) { |
|
|
@ -221,10 +224,10 @@ public class BmsRegion2Controller { |
|
|
|
} |
|
|
|
return R.ok(treeVoList); |
|
|
|
}else { |
|
|
|
return R.ok(treeByCurrentUser(supplierId)); |
|
|
|
return R.ok(treeByCurrentUser(so.getSupplierId())); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.ok(bmsRegion2Service.getTree(listUserFlag!=null&&listUserFlag.equals(1))); |
|
|
|
return R.ok(bmsRegion2Service.getTree(so.getListUserFlag()!=null&&so.getListUserFlag().equals(1))); |
|
|
|
} |
|
|
|
|
|
|
|
private List<BmsRegionTreeVo> toTreeNodeList2(List<BmsRegion2> list){ |
|
|
|