|
|
@ -57,19 +57,19 @@ public class BmsRegionServiceImpl extends ServiceImpl<BmsRegionMapper,BmsRegion> |
|
|
|
@Override |
|
|
|
public boolean updateBmsRegionById(BmsRegion param){ |
|
|
|
BmsRegion ori = this.getById(param.getId()); |
|
|
|
String[] paths = ori.getPathIds().split("_"); |
|
|
|
for (String path : paths) { |
|
|
|
if(path.equals(ori.getPid())){ |
|
|
|
Assert.throwEx("不能选子节点为父级节点"); |
|
|
|
} |
|
|
|
} |
|
|
|
param = this.flushSetLevel(param); |
|
|
|
boolean changePid = !ori.getPid().equals(param.getPid()); |
|
|
|
// if(changePid){
|
|
|
|
// Assert.throwEx("当前版本限制上下级变更");
|
|
|
|
// }
|
|
|
|
boolean b = this.updateById(param); |
|
|
|
if(!ori.getName().equals(param.getName())||changePid) { |
|
|
|
BmsRegion parentRegion = this.updatePathByPid(param.getId()); |
|
|
|
//更新相关表(网点)
|
|
|
|
this.updatePathByPid(param.getId()); |
|
|
|
if(changePid){ |
|
|
|
//hisUserSupplierService.cleanTable();
|
|
|
|
/*停用的逻辑 |
|
|
|
hisUserChannelPointService.removeRegion(2,ori.getPathIds()); |
|
|
|
hisUserChannelPointService.flushRegion(2,parentRegion.getPathIds());*/ |
|
|
|
//更新客户
|
|
|
|
BmsRegion currentRegion = this.getById(param.getId()); |
|
|
|
List<BmsSupplier> regionSupplierList = bmsSupplierApplicationService.listByRegionIds(Arrays.asList(ori.getId()),ori.getLevel()); |
|
|
@ -271,6 +271,11 @@ public class BmsRegionServiceImpl extends ServiceImpl<BmsRegionMapper,BmsRegion> |
|
|
|
this.updateById(param); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新含路径相关的表,如网点 |
|
|
|
* @param pid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private BmsRegion updatePathByPid(String pid){ |
|
|
|
BmsRegion parRegion = this.getById(pid); |
|
|
|
List<BmsRegion> regionList = this.listChild(pid); |
|
|
|