|
@@ -58,7 +58,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public PageUtils queryList(Integer current, Integer pageSize, String name, Integer hospId) {
|
|
|
+ public PageUtils queryList(Integer current, Integer pageSize, String name, Long hospId) {
|
|
|
Page<CostAccountShare> costAccountSharePage = new Page<>(current, pageSize);
|
|
|
Page<CostAccountShare> pages = this.page(costAccountSharePage, new QueryWrapper<CostAccountShare>().lambda()
|
|
|
.eq(!StringUtils.isEmpty(hospId), CostAccountShare::getHospId, hospId)
|
|
@@ -74,12 +74,12 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
return pageUtils;
|
|
|
}
|
|
|
|
|
|
- private void getMessage(Integer hospId, List<CostAccountShareVO> costAccountShareList) {
|
|
|
+ private void getMessage(Long hospId, List<CostAccountShareVO> costAccountShareList) {
|
|
|
// 设置责任中心的数据 与 会计科目的数据从对应的id里面获取
|
|
|
List<Responsibility> list = responsibilityService.list(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId, hospId));
|
|
|
List<Accounting> accountingList = accountingService.list(new QueryWrapper<Accounting>().lambda().eq(Accounting::getHospId, hospId));
|
|
|
- Map<Integer, List<Responsibility>> resMap = list.stream().collect(Collectors.groupingBy(Responsibility::getId));
|
|
|
- Map<Integer, List<Accounting>> accountMap = accountingList.stream().collect(Collectors.groupingBy(Accounting::getId));
|
|
|
+ Map<Long, List<Responsibility>> resMap = list.stream().collect(Collectors.groupingBy(Responsibility::getId));
|
|
|
+ Map<Long, List<Accounting>> accountMap = accountingList.stream().collect(Collectors.groupingBy(Accounting::getId));
|
|
|
costAccountShareList.forEach(i->{
|
|
|
Integer id = i.getResponsibilityId();
|
|
|
List<Responsibility> responsibilities = resMap.get(id);
|
|
@@ -111,7 +111,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
|
|
|
public void addCostAccountShare(CostAccountShareSaveDto costAccountShareSaveDto) {
|
|
|
User user = (User) SecurityUtils.getSubject().getPrincipal();
|
|
|
- Integer hospId = user.getHospId();
|
|
|
+ Long hospId = user.getHospId();
|
|
|
// 检验输入的数据的合理性
|
|
|
checkAccountShare(costAccountShareSaveDto, hospId);
|
|
|
// 检验输入的责任中心是否存在
|
|
@@ -132,8 +132,8 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
* @param costAccountShareSaveDto
|
|
|
* @param hospId
|
|
|
*/
|
|
|
- private void checkAccountShare(CostAccountShareSaveDto costAccountShareSaveDto, Integer hospId) {
|
|
|
- Integer responsibilityId = costAccountShareSaveDto.getResponsibilityId();
|
|
|
+ private void checkAccountShare(CostAccountShareSaveDto costAccountShareSaveDto, Long hospId) {
|
|
|
+ Long responsibilityId = costAccountShareSaveDto.getResponsibilityId();
|
|
|
Responsibility responsibility = responsibilityService.getOne(new QueryWrapper<Responsibility>().lambda().eq(Responsibility::getHospId,hospId).eq(Responsibility::getId, responsibilityId));
|
|
|
if (Objects.isNull(responsibility)){
|
|
|
throw new CostException(500,"输入的责任不存在");
|
|
@@ -188,8 +188,8 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
|
|
|
public void updateByCostAccountShare(CostAccountShareEditDto costAccountShareEditDto) {
|
|
|
User user = (User) SecurityUtils.getSubject().getPrincipal();
|
|
|
- Integer hospId = user.getHospId();
|
|
|
- Integer id = costAccountShareEditDto.getId();
|
|
|
+ Long hospId = user.getHospId();
|
|
|
+ Long id = costAccountShareEditDto.getId();
|
|
|
CostAccountShare costAccountShare = baseMapper.selectById(id);
|
|
|
if (Objects.isNull(costAccountShare)){
|
|
|
throw new CostException(500,"责任中心成本数据不存在");
|
|
@@ -219,8 +219,8 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
public void updateShareParam(ShareParamEditDto shareParamEditDto) {
|
|
|
List<ShareParamProportionVO> shareParamProportionVOList1 = shareParamEditDto.getShareParamProportionVOList();
|
|
|
User user = (User) SecurityUtils.getSubject().getPrincipal();
|
|
|
- Integer hospId = user.getHospId();
|
|
|
- Integer id = shareParamEditDto.getId();
|
|
|
+ Long hospId = user.getHospId();
|
|
|
+ Long id = shareParamEditDto.getId();
|
|
|
CostAccountShare costAccountShare = baseMapper.selectOne(new QueryWrapper<CostAccountShare>().lambda()
|
|
|
.eq(CostAccountShare::getHospId, hospId)
|
|
|
.eq(CostAccountShare::getId, id));
|
|
@@ -231,7 +231,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
List<ShareParamProportionVO> shareParamProportionVOList = shareParamEditDto.getShareParamProportionVOList();
|
|
|
// 检验输入的成本分摊参数是否存在
|
|
|
List<CostShareParamVO> costShareParamServiceAll = costShareParamService.getAll(hospId);
|
|
|
- Map<Integer, List<CostShareParamVO>> listMap = costShareParamServiceAll.stream().collect(Collectors.groupingBy(CostShareParamVO::getId));
|
|
|
+ Map<Long, List<CostShareParamVO>> listMap = costShareParamServiceAll.stream().collect(Collectors.groupingBy(CostShareParamVO::getId));
|
|
|
shareParamProportionVOList.forEach(i->{
|
|
|
if (CollectionUtils.isEmpty(listMap.get(i.getId()))){
|
|
|
throw new CostException(500,"分摊名称:"+i.getShareParamName()+"未找到");
|
|
@@ -248,9 +248,9 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
}
|
|
|
|
|
|
// 判断添加的分摊是否存在一样的
|
|
|
- HashMap<Integer, ShareParamProportionVO> hashMap = new HashMap<>();
|
|
|
+ HashMap<Long, ShareParamProportionVO> hashMap = new HashMap<>();
|
|
|
shareParamProportionVOList.forEach(i->{
|
|
|
- Integer paramId = i.getId();
|
|
|
+ Long paramId = i.getId();
|
|
|
if (hashMap.containsKey(paramId)){
|
|
|
throw new CostException(500,"不可以添加相同的分摊参数");
|
|
|
}
|
|
@@ -274,7 +274,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<ShareParamProportionVO> selectShareParamById(Integer id, Integer hospId) {
|
|
|
+ public List<ShareParamProportionVO> selectShareParamById(Integer id, Long hospId) {
|
|
|
CostAccountShare costAccountShare = baseMapper.selectOne(new QueryWrapper<CostAccountShare>().lambda()
|
|
|
.eq(CostAccountShare::getHospId, hospId).eq(CostAccountShare::getId, id));
|
|
|
if (Objects.isNull(costAccountShare)){
|
|
@@ -292,7 +292,7 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<CostShareParamStatusVO> getAllShareParamStatusById(Integer id, Integer hospId) {
|
|
|
+ public List<CostShareParamStatusVO> getAllShareParamStatusById(Integer id, Long hospId) {
|
|
|
List<CostShareParamVO> costShareParamServiceAll = costShareParamService.getAll(hospId);
|
|
|
CostAccountShare costAccountShare = baseMapper.selectById(id);
|
|
|
if (Objects.isNull(costAccountShare)){
|
|
@@ -302,9 +302,9 @@ public class CostAccountShareServiceImpl extends ServiceImpl<CostAccountShareMap
|
|
|
List<CostShareParamStatusVO> costShareParamStatusVOList = BeanUtil.convertList(costShareParamServiceAll, CostShareParamStatusVO.class);
|
|
|
if (!StringUtils.isEmpty(paramList)) {
|
|
|
List<ShareParamProportionVO> shareParamProportionVOList = JsonUtil.toList(paramList, ShareParamProportionVO.class);
|
|
|
- Map<Integer, List<ShareParamProportionVO>> map = shareParamProportionVOList.stream().collect(Collectors.groupingBy(ShareParamProportionVO::getId));
|
|
|
+ Map<Long, List<ShareParamProportionVO>> map = shareParamProportionVOList.stream().collect(Collectors.groupingBy(ShareParamProportionVO::getId));
|
|
|
costShareParamStatusVOList.forEach(i -> {
|
|
|
- Integer paramId = i.getId();
|
|
|
+ Long paramId = i.getId();
|
|
|
if (!CollectionUtils.isEmpty(map.get(paramId))) {
|
|
|
i.setShareParamStatus(NumberConstant.ONE);
|
|
|
}
|