修改宣教库接口。
This commit is contained in:
parent
a4cc23f66e
commit
3a207c2d7b
@ -21,7 +21,7 @@ public interface IPropagandaInfoService {
|
|||||||
* @param id 宣教库管理主键
|
* @param id 宣教库管理主键
|
||||||
* @return 宣教库管理
|
* @return 宣教库管理
|
||||||
*/
|
*/
|
||||||
public PropagandaMaterialsVo selectPropagandaInfoById(Long id);
|
PropagandaMaterialsVo selectPropagandaInfoById(Long id);
|
||||||
|
|
||||||
PropagandaInfo getById(Long id);
|
PropagandaInfo getById(Long id);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xinelu.manage.service.propagandainfo.impl;
|
package com.xinelu.manage.service.propagandainfo.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
import com.xinelu.common.utils.bean.BeanUtils;
|
import com.xinelu.common.utils.bean.BeanUtils;
|
||||||
import com.xinelu.manage.domain.materialsinfo.MaterialsInfo;
|
import com.xinelu.manage.domain.materialsinfo.MaterialsInfo;
|
||||||
@ -8,15 +9,18 @@ import com.xinelu.manage.domain.propagandamaterials.PropagandaMaterials;
|
|||||||
import com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto;
|
import com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto;
|
||||||
import com.xinelu.manage.dto.propagandainfo.PropagandaInfoSaveDto;
|
import com.xinelu.manage.dto.propagandainfo.PropagandaInfoSaveDto;
|
||||||
import com.xinelu.manage.dto.propagandainfo.PropagandaUpdateDto;
|
import com.xinelu.manage.dto.propagandainfo.PropagandaUpdateDto;
|
||||||
|
import com.xinelu.manage.mapper.materialsinfo.MaterialsInfoMapper;
|
||||||
import com.xinelu.manage.mapper.propagandainfo.PropagandaInfoMapper;
|
import com.xinelu.manage.mapper.propagandainfo.PropagandaInfoMapper;
|
||||||
import com.xinelu.manage.mapper.propagandamaterials.PropagandaMaterialsMapper;
|
import com.xinelu.manage.mapper.propagandamaterials.PropagandaMaterialsMapper;
|
||||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||||
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
|
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -32,6 +36,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
|
|||||||
private PropagandaInfoMapper propagandaInfoMapper;
|
private PropagandaInfoMapper propagandaInfoMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private PropagandaMaterialsMapper propagandaMaterialsMapper;
|
private PropagandaMaterialsMapper propagandaMaterialsMapper;
|
||||||
|
@Resource
|
||||||
|
private MaterialsInfoMapper materialsInfoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询宣教库管理
|
* 查询宣教库管理
|
||||||
@ -41,7 +47,25 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PropagandaMaterialsVo selectPropagandaInfoById(Long id) {
|
public PropagandaMaterialsVo selectPropagandaInfoById(Long id) {
|
||||||
return propagandaInfoMapper.selectPropagandaInfo(id);
|
PropagandaMaterialsVo retObj = new PropagandaMaterialsVo();
|
||||||
|
PropagandaInfo propagandaInfo = propagandaInfoMapper.selectPropagandaInfoById(id);
|
||||||
|
if (ObjectUtils.isEmpty(propagandaInfo)) {
|
||||||
|
throw new ServiceException("数据异常");
|
||||||
|
}
|
||||||
|
BeanUtils.copyBeanProp(retObj, propagandaInfo);
|
||||||
|
// 查询宣教素材管理关系表
|
||||||
|
PropagandaMaterials pmQuery = new PropagandaMaterials();
|
||||||
|
pmQuery.setPropagandaId(id);
|
||||||
|
List<PropagandaMaterials> pmList = propagandaMaterialsMapper.selectPropagandaMaterialsList(pmQuery);
|
||||||
|
List<MaterialsInfo> materialsInfoList = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(pmList)) {
|
||||||
|
// 查询素材列表
|
||||||
|
for (PropagandaMaterials pm : pmList) {
|
||||||
|
materialsInfoList.add(materialsInfoMapper.selectMaterialsInfoById(pm.getMaterialsId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retObj.setMaterialsInfoList(materialsInfoList);
|
||||||
|
return retObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public PropagandaInfo getById(Long id) {
|
@Override public PropagandaInfo getById(Long id) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user