|
@@ -136,7 +136,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
costAccountShareSaveDto.setResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
costAccountShareSaveDto.setResponsibilityName(responsibility.getResponsibilityName());
|
|
|
costAccountShareSaveDto.setShareLevel(responsibility.getShareLevel());
|
|
|
- if (costAccountShareSaveDto.getAccountingId() > 0){
|
|
|
+ if (!StringUtils.isEmpty(costAccountShareSaveDto.getAccountingId()) && costAccountShareSaveDto.getAccountingId() > 0){
|
|
|
// 如果输入成本科目的情况下
|
|
|
Accounting accounting = accountingService.getOne(new QueryWrapper<Accounting>().lambda().eq(Accounting::getHospId, hospId).eq(Accounting::getId, costAccountShareSaveDto.getAccountingId()));
|
|
|
if (Objects.isNull(accounting)){
|
|
@@ -162,10 +162,10 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
CostShareLevel costShareLevel = costShareLevelService.getOne(new QueryWrapper<CostShareLevel>().lambda()
|
|
|
.eq(CostShareLevel::getHospId, hospId).eq(CostShareLevel::getId, shareLevel));
|
|
|
if (Objects.nonNull(costShareLevel)){
|
|
|
- if (costAccountShareSaveDto.getAccountingId()>0 && NumberConstant.ZERO.equals(costShareLevel.getCalcType())){
|
|
|
+ if ((!StringUtils.isEmpty(costAccountShareSaveDto.getAccountingId()) && costAccountShareSaveDto.getAccountingId() > 0) && NumberConstant.ZERO.equals(costShareLevel.getCalcType())){
|
|
|
throw new CostException(500,"合并计算不允许选择成本科目");
|
|
|
}
|
|
|
- if (costAccountShareSaveDto.getAccountingId()<= 0 && NumberConstant.ONE.equals(costShareLevel.getCalcType())){
|
|
|
+ if ((!StringUtils.isEmpty(costAccountShareSaveDto.getAccountingId()) && costAccountShareSaveDto.getAccountingId() <= 0) && NumberConstant.ONE.equals(costShareLevel.getCalcType())){
|
|
|
throw new CostException(500,"分开计算的责任中心需要选择成本科目");
|
|
|
}
|
|
|
}else {
|
|
@@ -193,8 +193,8 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
CostAccountShareSaveDto costAccountShareSaveDto = BeanUtil.convertObj(costAccountShareEditDto, CostAccountShareSaveDto.class);
|
|
|
// 检验输入的数据是否符合规则
|
|
|
checkAccountShare(costAccountShareSaveDto,hospId);
|
|
|
-
|
|
|
- CostAccountShare costAccountShareRequest = BeanUtil.convertObj(costAccountShareEditDto, CostAccountShare.class);
|
|
|
+ CostAccountShareEditDto accountShareEditDto = BeanUtil.convertObj(costAccountShareSaveDto, CostAccountShareEditDto.class);
|
|
|
+ CostAccountShare costAccountShareRequest = BeanUtil.convertObj(accountShareEditDto, CostAccountShare.class);
|
|
|
costAccountShareRequest.setId(null);
|
|
|
costAccountShareRequest.setHospId(hospId);
|
|
|
costAccountShareRequest.setParamList(costAccountShare.getParamList());
|