1-pbom-升级判断是否有工厂权限
This commit is contained in:
parent
04a36e33cb
commit
19bb6ffa39
|
|
@ -164,8 +164,10 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
}
|
}
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
} else {
|
} else {
|
||||||
|
String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode();
|
||||||
|
|
||||||
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage()
|
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage()
|
||||||
, query.getPageSize()), query, userRoleService.getUserFactory(), SessionUtil.getDepartRowId(), SessionUtil.getUserCode());
|
, query.getPageSize()), query, queryFac, SessionUtil.getDepartRowId(), SessionUtil.getUserCode());
|
||||||
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -1197,7 +1199,12 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void upgrade(Long bomRowId) throws ExecutionException, InterruptedException {
|
public void upgrade(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||||
BomNewPbomParentEntity parent = this.getById(bomRowId);
|
BomNewPbomParentEntity parent = this.getById(bomRowId);
|
||||||
|
VUtils.isTure(Objects.isNull(parent)).throwMessage("该BOM版本不存在");
|
||||||
VUtils.isTure(parent.getStatus() < PBomStatusEnum.PUBLISH.getValue()).throwMessage("只有已发布的BOM,才能发起变更");
|
VUtils.isTure(parent.getStatus() < PBomStatusEnum.PUBLISH.getValue()).throwMessage("只有已发布的BOM,才能发起变更");
|
||||||
|
//检查当前用户是否有该工厂权限
|
||||||
|
if(!userRoleService.getUserOfFactory().contains(parent.getFacCode())){
|
||||||
|
VUtils.isTure(true).throwMessage("您没有该工厂的权限,无法升级");
|
||||||
|
}
|
||||||
LogRecordContext.putVariable("bom",parent);
|
LogRecordContext.putVariable("bom",parent);
|
||||||
PBomUpgrade upgrade = new PBomUpgrade(parent, getAllBom(bomRowId, 0));
|
PBomUpgrade upgrade = new PBomUpgrade(parent, getAllBom(bomRowId, 0));
|
||||||
upgrade.upgrade();
|
upgrade.upgrade();
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,11 @@ public class UserRoleService {
|
||||||
if(userMultiplantFacRoleCount>0){
|
if(userMultiplantFacRoleCount>0){
|
||||||
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010,EBomConstant.XIAN_TAO_FACTORY_CODE_1020);
|
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010,EBomConstant.XIAN_TAO_FACTORY_CODE_1020);
|
||||||
}else {
|
}else {
|
||||||
return SessionUtil.getFullDeptName().contains("仙桃公司")? ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) : ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ;
|
String dptCde=materialMainService.getBaseMapper().getUserDepartmentDptCode(SessionUtil.getDepartRowId());
|
||||||
|
if(StrUtil.isNotBlank(dptCde) && dptCde.contains("仙桃公司")){
|
||||||
|
return ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) ;
|
||||||
|
}
|
||||||
|
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue