|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
@ -14,6 +15,7 @@ import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
|
import com.epmet.dao.IcExportTemplateDao; |
|
|
@ -25,6 +27,7 @@ import com.epmet.dto.form.IcExportTemplateSaveFormDTO; |
|
|
|
import com.epmet.dto.result.ConditionResultDTO; |
|
|
|
import com.epmet.dto.result.IcCustomExportResultDTO; |
|
|
|
import com.epmet.dto.result.IcExportTemplateForExportResultDTO; |
|
|
|
import com.epmet.dto.result.TemplateDetailResultDTO; |
|
|
|
import com.epmet.entity.IcExportTemplateConfigEntity; |
|
|
|
import com.epmet.entity.IcExportTemplateEntity; |
|
|
|
import com.epmet.service.IcExportTemplateConfigService; |
|
|
@ -213,6 +216,43 @@ public class IcExportTemplateServiceImpl extends BaseServiceImpl<IcExportTemplat |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取模板列表 |
|
|
|
* |
|
|
|
* @param tokenDto |
|
|
|
* @Param tokenDto |
|
|
|
* @Return {@link List< IcExportTemplateDTO>} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2022/4/25 14:29 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<IcExportTemplateDTO> getTemplateList(TokenDto tokenDto, IcExportTemplateDTO formDTO) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
if (null == staffInfo) { |
|
|
|
throw new EpmetException("获取工作人员信息失败"); |
|
|
|
} |
|
|
|
LambdaQueryWrapper<IcExportTemplateEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcExportTemplateEntity::getAgencyId, staffInfo.getAgencyId()); |
|
|
|
wrapper.eq(IcExportTemplateEntity::getFormCode, formDTO.getFormCode()); |
|
|
|
wrapper.orderByAsc(IcExportTemplateEntity::getSort); |
|
|
|
List<IcExportTemplateEntity> list = baseDao.selectList(wrapper); |
|
|
|
return ConvertUtils.sourceToTarget(list, IcExportTemplateDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取模板详情 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @Param formDTO |
|
|
|
* @Return {@link List< TemplateDetailResultDTO >} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2022/4/25 16:29 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<TemplateDetailResultDTO> getTemplateDetail(IcExportTemplateDTO formDTO) { |
|
|
|
return baseDao.getTemplateDetail(formDTO.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
private void digui(Map<String, List<IcExportTemplateForExportResultDTO>> resultTemp, IcExportTemplateForExportResultDTO root, List<List<String>> headerList, List<IcCustomExportResultDTO.SqlColumn> showSqlColumns, List<IcCustomExportResultDTO.SqlColumn> hiddenSqlColumns, Set<String> hasExistColumnSet) { |
|
|
|
if (StringUtils.isNotBlank(root.getColumnName())) { |
|
|
|
showSqlColumns.add(new IcCustomExportResultDTO.SqlColumn(root.getItemId(),root.getTableName(), root.getColumnName(),root.getOptionSourceType(),root.getOptionSourceValue())); |
|
|
|