| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.enums.FieldInputTypeEnum; |
| | |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.CollUtils; |
| | | import com.finance.common.utils.DateUtils; |
| | | import com.finance.common.utils.EasyExcelUtil; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | |
| | | import com.finance.system.vo.BasicDataFieldVO; |
| | | import com.finance.system.vo.FieldVO; |
| | | import com.finance.system.vo.FieldsTreeVO; |
| | | import com.google.common.collect.Lists; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | |
| | | @Override |
| | | public void add(FieldDTO dto) { |
| | | //参数校验 |
| | | // 参数校验 |
| | | FieldTypeEnum fieldType = dto.getFieldType(); |
| | | //1:数字 2:文本 3:百分比 |
| | | // 1:数字 2:文本 3:百分比 |
| | | if (FieldTypeEnum.TEXT.equals(fieldType)) { |
| | | if (StringUtils.isNull(dto.getTextInputType())) { |
| | | throw new ServiceException("输入类型不能为空"); |
| | |
| | | if (StringUtils.isNull(field)) { |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | //隐藏字段 |
| | | // 隐藏字段 |
| | | this.lambdaUpdate().set(TbField::getStatus, dto.getStatus()).eq(TbField::getId, dto.getId()) |
| | | .update(); |
| | | //异步隐藏基础数据配置 |
| | | // 异步隐藏基础数据配置 |
| | | CompletableFuture.runAsync(() -> handleDataConfig(dto, field)); |
| | | } |
| | | |
| | |
| | | List<Long> ids = list.stream().map(config -> { |
| | | String fieldIdStr = config.getFieldIdStr(); |
| | | String[] split = fieldIdStr.split(","); |
| | | //字符串数组转为List |
| | | // 字符串数组转为List |
| | | List<String> idList = new ArrayList<>(Arrays.asList(split)); |
| | | if (idList.contains(field.getId().toString())) { |
| | | return config.getId(); |
| | |
| | | String collect = list.stream().map(config -> { |
| | | String fieldIdStr = config.getFieldIdStr(); |
| | | String[] split = fieldIdStr.split(","); |
| | | //字符串数组转为List |
| | | // 字符串数组转为List |
| | | List<String> idList = Arrays.asList(split); |
| | | if (idList.contains(id.toString())) { |
| | | return config.getTypeName(); |
| | |
| | | .collect(Collectors.toList()); |
| | | Map<Integer, String[]> selectedMap = new HashMap<>(); |
| | | if (CollUtils.isNotEmpty(collect)) { |
| | | selectedMap = new HashMap<>(); |
| | | for (TbField tbField : collect) { |
| | | int outerListIndex = getOuterListIndex(head, tbField.getFieldName()); |
| | | String[] selectStr = tbField.getTextContent().split(","); |
| | |
| | | } |
| | | } |
| | | boolean isPlatform = UserTypeEnum.PLATFORM.equals(user.getUserType()); |
| | | //默认生成下拉框的行数为1 |
| | | // 默认生成下拉框的行数为1 |
| | | int rows = 1; |
| | | if (isPlatform) { |
| | | //查询所有的地区 |
| | | // 查询所有的地区 |
| | | List<SysUser> userList = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getUserType, UserTypeEnum.DEPARTMENT).list(); |
| | | String[] userNameArr = userList.stream().map(SysUser::getAreaName) |
| | | .toArray(String[]::new); |
| | | selectedMap.put(0, userNameArr); |
| | | //生成下拉框的行数为部门的数量 |
| | | // 生成下拉框的行数为部门的数量 |
| | | rows = userList.size(); |
| | | } |
| | | // 这里需要设置不关闭流 |
| | |
| | | columnNo.add(String.valueOf(i)); |
| | | } |
| | | excellist.add(columnNo); |
| | | excellist.add(Lists.newArrayList(areaName, isDept ? DateUtils.getNowQuarter() : "")); |
| | | excellist.add(Lists.newArrayList(areaName, isDept ? "2024年一季度" : "")); |
| | | // excellist.add(Lists.newArrayList(areaName, isDept ? DateUtils.getPreviousQuarter() : "")); |
| | | return excellist; |
| | | } |
| | | |