|
@@ -7,6 +7,7 @@ import com.ankaibei.workFlow.webadmin.ankaibei.enums.CostEnum;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.mapper.*;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.service.CostInfoService;
|
|
|
import com.ankaibei.workFlow.webadmin.ankaibei.vo.*;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
@@ -97,8 +98,10 @@ public class CostInfoServiceImpl implements CostInfoService {
|
|
|
|
|
|
@Override
|
|
|
public ResMsg findCostInfoDetails(CostInfoEntity costInfoEntity) {
|
|
|
- Optional<CostInfoEntity> byId = costInfoMapper.findById(costInfoEntity.getCostId());
|
|
|
- CostInfoEntity costInfo = byId.orElse(null);
|
|
|
+ CostInfoEntity costInfo = costInfoMapper.findByApplyCostIdAndCostType(costInfoEntity.getCostId(), costInfoEntity.getCostType());
|
|
|
+ if (ObjectUtils.isEmpty(costInfo)) {
|
|
|
+ return new ResMsg(CodeEnum.NO_DATA);
|
|
|
+ }
|
|
|
switch (CostEnum.getEnumByCode(costInfoEntity.getCostType())) {
|
|
|
case COMMUNICATION:
|
|
|
CommunicationInfoEntity communicationInfoEntity = communicationMapper.findById(costInfo.getApplyCostId()).orElse(null);
|