|
@@ -16,7 +16,7 @@ import com.imed.costaccount.model.dto.CostIncomeGroupSetEditDto;
|
|
import com.imed.costaccount.model.dto.CostIncomeGroupSetSaveDto;
|
|
import com.imed.costaccount.model.dto.CostIncomeGroupSetSaveDto;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupSetVO;
|
|
import com.imed.costaccount.model.vo.CostIncomeGroupSetVO;
|
|
import com.imed.costaccount.service.CostIncomeGroupSetService;
|
|
import com.imed.costaccount.service.CostIncomeGroupSetService;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
+import com.imed.costaccount.service.ResponsibilityService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -30,8 +30,11 @@ import java.util.stream.Collectors;
|
|
@Service("costIncomeGroupSetService")
|
|
@Service("costIncomeGroupSetService")
|
|
public class CostIncomeGroupSetServiceImpl extends ServiceImpl<CostIncomeGroupSetMapper, CostIncomeGroupSet> implements CostIncomeGroupSetService {
|
|
public class CostIncomeGroupSetServiceImpl extends ServiceImpl<CostIncomeGroupSetMapper, CostIncomeGroupSet> implements CostIncomeGroupSetService {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private ResponsibilityServiceImpl responsibilityService;
|
|
|
|
|
|
+ private final ResponsibilityService responsibilityService;
|
|
|
|
+
|
|
|
|
+ public CostIncomeGroupSetServiceImpl(ResponsibilityService responsibilityService) {
|
|
|
|
+ this.responsibilityService = responsibilityService;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分页查询
|
|
* 分页查询
|
|
@@ -131,6 +134,12 @@ public class CostIncomeGroupSetServiceImpl extends ServiceImpl<CostIncomeGroupSe
|
|
costIncomeGroupSetSaveDto.setStartDepartmentProportion(NumberConstant.ZERO);
|
|
costIncomeGroupSetSaveDto.setStartDepartmentProportion(NumberConstant.ZERO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (!StringUtils.isEmpty(costIncomeGroupSetSaveDto.getResponsibilityCode())){
|
|
|
|
+ if (NumberConstant.ONE.equals(costIncomeGroupSetSaveDto.getOpenDepartmentStatus()) ||
|
|
|
|
+ NumberConstant.ONE.equals(costIncomeGroupSetSaveDto.getStartDepartmentStatus())){
|
|
|
|
+ throw new CostException(500,"存在收益中心 不允许设置责任中心");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 检验原始数据里面是否存在
|
|
// 检验原始数据里面是否存在
|
|
List<CostIncomeGroupSet> costIncomeGroupSets = baseMapper.selectList(new QueryWrapper<CostIncomeGroupSet>().lambda()
|
|
List<CostIncomeGroupSet> costIncomeGroupSets = baseMapper.selectList(new QueryWrapper<CostIncomeGroupSet>().lambda()
|
|
.eq(CostIncomeGroupSet::getHospId, hospId));
|
|
.eq(CostIncomeGroupSet::getHospId, hospId));
|
|
@@ -171,10 +180,10 @@ public class CostIncomeGroupSetServiceImpl extends ServiceImpl<CostIncomeGroupSe
|
|
CostIncomeGroupSetSaveDto costIncomeGroupSetSaveDto = BeanUtil.convertObj(costIncomeGroupSetEditDto, CostIncomeGroupSetSaveDto.class);
|
|
CostIncomeGroupSetSaveDto costIncomeGroupSetSaveDto = BeanUtil.convertObj(costIncomeGroupSetEditDto, CostIncomeGroupSetSaveDto.class);
|
|
// 检验输入的数据是否存在
|
|
// 检验输入的数据是否存在
|
|
checkIncomeGroupSet(costIncomeGroupSetSaveDto,hospId);
|
|
checkIncomeGroupSet(costIncomeGroupSetSaveDto,hospId);
|
|
- CostIncomeGroupSet incomeGroupSet = BeanUtil.convertObj(costIncomeGroupSetEditDto, CostIncomeGroupSet.class);
|
|
|
|
|
|
+ CostIncomeGroupSet incomeGroupSet = BeanUtil.convertObj(costIncomeGroupSetSaveDto, CostIncomeGroupSet.class);
|
|
incomeGroupSet.setHospId(hospId);
|
|
incomeGroupSet.setHospId(hospId);
|
|
incomeGroupSet.setCreateTime(System.currentTimeMillis());
|
|
incomeGroupSet.setCreateTime(System.currentTimeMillis());
|
|
- incomeGroupSet.setResponsibilityCode(costIncomeGroupSet.getResponsibilityCode());
|
|
|
|
|
|
+ incomeGroupSet.setResponsibilityCode(costIncomeGroupSetSaveDto.getResponsibilityCode());
|
|
incomeGroupSet.setAccountCode(costIncomeGroupSet.getAccountCode());
|
|
incomeGroupSet.setAccountCode(costIncomeGroupSet.getAccountCode());
|
|
baseMapper.insert(incomeGroupSet);
|
|
baseMapper.insert(incomeGroupSet);
|
|
}
|
|
}
|
|
@@ -206,6 +215,7 @@ public class CostIncomeGroupSetServiceImpl extends ServiceImpl<CostIncomeGroupSe
|
|
* @param accountList 对应科目的Code集合
|
|
* @param accountList 对应科目的Code集合
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
|
|
public void updateAccountCode(Integer id,List<String> accountList) {
|
|
public void updateAccountCode(Integer id,List<String> accountList) {
|
|
CostIncomeGroupSet incomeGroupSet = this.getById(id);
|
|
CostIncomeGroupSet incomeGroupSet = this.getById(id);
|
|
if (Objects.isNull(incomeGroupSet)){
|
|
if (Objects.isNull(incomeGroupSet)){
|