package com.cf.imes.module.executor.service.order;

import cn.smallbun.screw.core.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.cf.imes.framework.common.pojo.PageParam;
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
import com.cf.imes.framework.datapermission.core.util.DataPermissionUtils;
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.executor.dal.mysql.process.OrderProcessMapper;
import com.cf.imes.module.executor.dal.mysql.processStep.ProcessStepMapper;
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
import com.cf.imes.module.executor.enums.OrderStatusEnum;
import com.cf.imes.module.executor.util.ExcelWriterUtil;
import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
import com.cf.imes.module.system.api.dict.DictDataApi;
import com.cf.imes.module.system.api.user.AdminUserApi;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;

import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.object.BeanUtils;

import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;

import java.io.*;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;

import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
import org.springframework.web.multipart.MultipartFile;

/**
 * 生产单表 order_{N} Service 实现类
 *
 * @author 晨丰科技
 */
@Service
@Validated
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @Resource
    private RawGoodsMapper rawGoodsMapper;

    @Resource
    private GoodsMapper goodsMapper;

    @Resource
    private OrderPartsMapper orderPartsMapper;

    @Resource
    private PlateMapper plateMapper;

    @Resource
    private PlateGoodMapper plateGoodMapper;

    @Resource
    private OrderBodyMapper orderBodyMapper;

    @Resource
    private OrderGroupMapper orderGroupMapper;

    @Resource
    private OrderItemMapper orderItemMapper;

    @Resource
    private AdminUserApi adminUserApi;

    @Resource
    private OrderInputProcessor orderInputProcessor;

    @Resource
    private DictDataApi dictDataApi;

    @Resource
    private IdentifierGenerator identifierGenerator;

    @Resource
    private SnowFlakeGenerator snowFlakeGenerator;

    @Resource
    private ExcelTypeRealize excelTypeRealize;

    @Resource
    private OrderProcessMapper orderProcessMapper;

    @Resource
    private ProcessStepMapper processStepMapper;

    private static final int DEFAULT_DAYS_TO_ADD = 30;

    private static final int RANDOM_NUMBER_MAX = 10;

    @Override
    public Long createOrder(OrderSaveReqVO createReqVO) {
        //校验手机号是否合法
        validatePhoneNumber(createReqVO.getPhoneNumber());

        //验证自定义单号是否存在，业务员、拆单员是否存在
        validateCustomOrderNoExists(createReqVO.getCustomOrderNo());
        LocalDateTime time = getAfterDate(createReqVO.getDeliveryDate());
        createReqVO.setDeliveryDate(time);
        // 插入
        OrderDO order = BeanUtils.toBean(createReqVO, OrderDO.class);
        orderMapper.insert(order);
        // 返回
        return order.getId();
    }

    @Override
    public void updateOrder(OrderSaveReqVO updateReqVO) {
        // 校验存在
        validateOrderExists(updateReqVO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId());

        //校验手机号是否合法
        validatePhoneNumber(updateReqVO.getPhoneNumber());

        //验证自定义单号是否存在，业务员、拆单员是否存在
        validateCustomOrderNoExists(updateReqVO.getCustomOrderNo(), updateReqVO.getId());
        // 更新
        OrderDO updateObj = BeanUtils.toBean(updateReqVO, OrderDO.class);
        orderMapper.updateById(updateObj);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteOrder(Long orderId) {
        // 校验存在
        OrderDO orderDO = orderMapper.selectOrderOne(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), OrderDeletedEnum.NOT_DELETED.getStatus());
        if (orderDO == null)
            throw exception(ORDER_NOT_EXISTS);
        // 状态排除
        if (orderDO.getStatus() != OrderStatusEnum.EMPTY.getStatus() &&
                orderDO.getStatus() != OrderStatusEnum.NEW_ORDER.getStatus() &&
                orderDO.getStatus() != OrderStatusEnum.NO_SORT.getStatus())
            throw exception(ORDER_NOT_CANCEL);

        // 作废 生产单表，body，group，goods，parts，plate，raw_goods，order_process，order_process_step
        orderMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderBodyMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderGroupMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        goodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderPartsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        plateMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        rawGoodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderProcessMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        processStepMapper.updateOrderDeleted(orderId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void restoreOrder(Long orderId) {
        // 校验存在
        OrderDO orderDO = orderMapper.selectOrderOne(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId(), OrderDeletedEnum.DELETED.getStatus());
        if (orderDO == null)
            throw exception(ORDER_NOT_EXISTS);

        // 作废 生产单表，body，group，goods，parts，plate，raw_goods
        orderMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderBodyMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderGroupMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        goodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderPartsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        plateMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderPartsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        rawGoodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        orderProcessMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        processStepMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
        ;
    }

    private void validateOrderExists(Long id, Long organId) {
        if (orderMapper.selectOrderOne(id, organId) == null) {
            throw exception(ORDER_NOT_EXISTS);
        }
    }

    @Override
    public OrderDO getOrder(Long id) {
        return orderMapper.selectOrderOne(id, SecurityFrameworkUtils.getLoginUser().getOrganId());
    }

    @Override
    public PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO) {
        return orderMapper.selectPage(pageReqVO.setOrganId(SecurityFrameworkUtils.getLoginUser().getOrganId()));
    }

    private Integer getOrderDeleted(Long orderId) { // (包含判断存在）
        OrderDO orderDO = orderMapper.selectOrderOne(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId());
        // 校验存在
        if (orderDO == null) {
            throw exception(ORDER_NOT_EXISTS);
        }
        // 判断生产单是否删除
        return getOrderStatus(orderDO.getDeleted());
    }

    private Integer getOrderStatus(Boolean deleted) {
        // 判断生产单是否删除
        Integer index;
        if (OrderDeletedEnum.NOT_DELETED.equals(deleted == false ? 0 : 1))
            index = OrderDeletedEnum.NOT_DELETED.getStatus();
        else
            index = OrderDeletedEnum.DELETED.getStatus();
        System.out.println(" deleted  " + deleted);
        return index;
    }
    @Override
    public List<OrderBodyRespVO> getOrderBody(Long orderId) {
        // 判断生产单是否删除
        Integer deleted = getOrderDeleted(orderId);


        List<OrderBodyRespVO> orderBodyRespVOList = BeanUtils.toBean(
                orderBodyMapper.selectList(orderId, deleted, SecurityFrameworkUtils.getLoginUser().getOrganId()), OrderBodyRespVO.class);
        return orderBodyRespVOList;
    }

    @Override
    public Map<String, List<?>> getModule(Long orderId) {
        // 判断生产单是否删除 (包含判断存在）
        Integer deleted = getOrderDeleted(orderId);
        // 模块信息
        List<OrderModuleRespVO> orderModuleRespVOList = orderBodyMapper.selectModuleByOrderId(orderId,
                SecurityFrameworkUtils.getLoginUser().getOrganId(),deleted); // 模块信息
        // 配件
        List<OrderPlatesDetailRespVO> orderItemDOS = orderItemMapper.selectPartsByOrderId(orderId,
                SecurityFrameworkUtils.getLoginUser().getOrganId(),deleted);

        Map<String, List<?>> map = new HashMap<>();
        map.put("module", orderModuleRespVOList);
        map.put("parts", orderItemDOS);
        return map;
    }

    @Override
    public List<OrderPlatesDetailReqVO> getPlatesDetail(Long orderId, Long roomId, Long bodyId, Long groupId, String groupName) {
        // 判断生产单是否删除 (包含判断存在）
        Integer deleted = getOrderDeleted(orderId);
        List<PlateRespVO> orderDetail = orderItemMapper.selectPlatesDetailByOrderId(orderId, roomId, bodyId, groupId,
                groupName, SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted);
        List<OrderPlatesDetailReqVO> platesDetailReqVOS = new ArrayList<>();
        orderDetail.forEach(orderPlatesDetailRespVO -> {
            OrderPlatesDetailReqVO orderPlatesDetailReqVO = BeanUtils.toBean(orderPlatesDetailRespVO, OrderPlatesDetailReqVO.class)
                    .setIsHole(false);
            if (orderPlatesDetailRespVO.getUnregularPointCount() > 0 || orderPlatesDetailRespVO.getFrontHoleCount() > 0
                    || orderPlatesDetailRespVO.getBackHoleCount() > 0 || orderPlatesDetailRespVO.getSideHoleCount() > 0)
                orderPlatesDetailReqVO.setIsHole(true);
            platesDetailReqVOS.add(orderPlatesDetailReqVO);
        });
        return platesDetailReqVOS;
    }

    @Override
    public List<OrderPartsRespVO> getPartsDetail(Long orderId, Long roomId, Long bodyId, String name) {
        // 判断生产单是否删除 (包含判断存在）
        Integer deleted = getOrderDeleted(orderId);
        List<OrderPartsRespVO> orderDetail = orderItemMapper.selectPartsDetailByOrderId(orderId, roomId, bodyId, name,
                SecurityFrameworkUtils.getLoginUser().getOrganId(),deleted);
        return orderDetail;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteBodyByOrder(Long orderId, Collection<Long> bodyIds) {
        validateOrderExists(orderId, OrganContextHolder.getOrganId());
//        校验生产单的状态 1 为新单状态，才可以修改
        if (orderMapper.selectOrderOne(orderId, SecurityFrameworkUtils.getLoginUser().getOrganId()).getStatus() !=
                OrderStatusEnum.NEW_ORDER.getStatus()) {
            throw exception(ORDER_STATUS_ERROR);
        }
        if (CollectionUtils.isNotEmpty(bodyIds)) {
            bodyIds.forEach(bodyId -> {
                // 校验存在
                validateOrderBodyExists(orderId, bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
                // 删除
                // orderBodyMapper.deleteAllByOrderId(orderId, bodyId);
                orderBodyMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
                orderGroupMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
                plateMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
                orderPartsMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
            });
        }
    }

    @Override
    public List<OrderBodyDO> getBody(Long orderId) {
        return orderBodyMapper.selectList(new LambdaQueryWrapper<OrderBodyDO>()
                .eq(OrderBodyDO::getOrderId, orderId)
                .eq(OrderBodyDO::getDeleted, false)
                .eq(OrderBodyDO::getOrganId, SecurityFrameworkUtils.getLoginUser().getOrganId()));
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Long importApiData(Map<String, List<?>> listMap) {

        List<OrderDO> order = (List<OrderDO>) listMap.get("orderDO");
        List<GoodsDO> goodsDO = (List<GoodsDO>) listMap.get("goodsDO");
        List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDO");
        List<OrderBodyDO> bodyDO = (List<OrderBodyDO>) listMap.get("bodyDO");
        List<OrderGroupDO> groupDO = (List<OrderGroupDO>) listMap.get("groupDO");
        List<OrderPartsDO> partsDO = (List<OrderPartsDO>) listMap.get("partsDO");
        List<PlateDO> plateDO = (List<PlateDO>) listMap.get("platesDO");
        List<PlateDetail> plateDetail = (List<PlateDetail>) listMap.get("plateDetail");
        List<OrderItemDO> itemDO = (List<OrderItemDO>) listMap.get("itemDO");

        Map<String, List<?>> map = getPlateGoods(goodsDO);// 检验商品板材信息是否存在
        goodsDO = (List<GoodsDO>) map.get("goodsDO");
        List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");
        validateCustomOrderNoExists(order.get(0).getCustomOrderNo());

        orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0), goodsDO, plateGoodDOS);
        List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
        orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(order.get(0).getId()));
        orderInputProcessor.batchSaveModel(orderModelDOs);
        return order.get(0).getId();
    }

    @Override
    public List<GoodsDO> getGoodsList(Long orderId) {
        return goodsMapper.selectList(new LambdaQueryWrapper<GoodsDO>()
                .eq(GoodsDO::getOrderId, orderId)
                .eq(GoodsDO::getDeleted, false)
                .eq(GoodsDO::getOrganId, SecurityFrameworkUtils.getLoginUser().getOrganId()));
    }

    private Map<String, List<?>> getPlateGoods(List<GoodsDO> goodsLists) {
        Map<String, List<?>> map = new HashMap<>();
        List<PlateGoodDO> plateGoodLists = new ArrayList<>();

        for (GoodsDO goodsDO : goodsLists) {
            PlateGoodDO plateGoodDO;
            if (goodsDO.getGoodsId() != null) { // 有goodsId
                plateGoodDO = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), SecurityFrameworkUtils.getLoginUser().getOrganId());
            }else { // 没有goodsId 其他信息匹配
                plateGoodDO = plateGoodMapper.selectGood(goodsDO.getGoodsName(), goodsDO.getMaterial(), goodsDO.getColor(),
                        goodsDO.getTexture(), goodsDO.getWidth(), goodsDO.getWidth(), goodsDO.getHeight(), goodsDO.getSpec(),
                        goodsDO.getBrand(), SecurityFrameworkUtils.getLoginUser().getOrganId());
            }

            if (plateGoodDO != null) {//存在板材
                goodsDO.setGoodsId(plateGoodDO.getGoodsId());
                break;
            }else { // 不存在板材
                Long plateGoods = (Long) identifierGenerator.nextId(null);
                Long goodsId = (Long) identifierGenerator.nextId(null);
                plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class)
                        .setId(plateGoods)
                        .setGoodsId(String.valueOf(goodsId));
                // 判断是否存在raw_goods_id
                System.out.println("goodsDO.getGoodsId() " + goodsDO.getGoodsId());
                if (goodsDO.getGoodsId() != null) {
                    plateGoodDO.setGoodsId(goodsDO.getGoodsId());
                }else {
                    goodsDO.setGoodsId(plateGoodDO.getGoodsId());
                }
                plateGoodLists.add(plateGoodDO);
            }

        }
        map.put("goodsDO", goodsLists);
        map.put("plateGoodDOLists", plateGoodLists);
        System.err.println(" map " + map);
        return map;
    }

    private void validateOrderBodyExists(Long orderId, Long bodyId, Long organId) {
        if (orderBodyMapper.selectCount(new LambdaQueryWrapper<OrderBodyDO>()
                .eq(OrderBodyDO::getOrderId, orderId)
                .eq(OrderBodyDO::getId, bodyId)
                .eq(OrderBodyDO::getOrganId, organId)) == 0) {
            throw exception(ORDER_BODY_NOT_EXISTS);
        }
    }

    private LocalDateTime getAfterDate(LocalDateTime date) {
        ZonedDateTime now = ZonedDateTime.now(ZoneId.of("UTC"));
        LocalDateTime localDateTime = now.toLocalDateTime();

        if (localDateTime.isAfter(date)) {
            // 添加30天
            LocalDateTime futureDate = localDateTime.plusDays(DEFAULT_DAYS_TO_ADD);
            try {
                return futureDate;
            } catch (DateTimeParseException e) {
                // 在实际应用中应该有更详细的错误处理逻辑
                System.err.println("Error parsing future date: " + e.getMessage());
            }
        }
        return date;
    }

    //    验证自定义单号是否存在
    private void validateCustomOrderNoExists(String customOrderNo, Long orderId) {
        if (customOrderNo != null) {
            if (!customOrderNo.isEmpty()) {
                if (orderMapper.selectCount(new LambdaQueryWrapper<OrderDO>()
                        .ne(OrderDO::getId, orderId)
                        .eq(OrderDO::getCustomOrderNo, customOrderNo)
                        .eq(OrderDO::getDeleted, false)
                        .eq(OrderDO::getOrganId, OrganContextHolder.getOrganId())) > 0) {
                    throw exception(CUSTOM_ORDER_EXISTS);
                }
            }
        }
    }

    private void validateCustomOrderNoExists(String customOrderNo) {
        if (customOrderNo != null) {
            if (!customOrderNo.isEmpty()) {
                if (orderMapper.selectCount(new LambdaQueryWrapper<OrderDO>()
                        .eq(OrderDO::getCustomOrderNo, customOrderNo)
                        .eq(OrderDO::getDeleted, false)
                        .eq(OrderDO::getOrganId, OrganContextHolder.getOrganId())) > 0) {
                    throw exception(CUSTOM_ORDER_EXISTS);
                }
            }
        }
    }

    //    业务员是否存在
    private void validateSalesmanOrderNoExists(String salesman, Long organId) {
        if (adminUserApi.validateUser(salesman, organId).getData() == null) {
            throw exception(SALESMAN_ORDER_NOT_EXISTS);
        }
    }

    //    拆单员是否存在
    private void validateSplitterOrderNoExists(String splitter, Long organId) {
        if (adminUserApi.validateUser(splitter, organId).getData() == null) {
            throw exception(SPLITTER_ORDER_NOT_EXISTS);
        }
    }

    //    校验手机号是否合法
    private void validatePhoneNumber(String phoneNumber) {
        // 定义手机号正则表达式
        String regex = "^1[3-9]\\d{9}$";

        // 编译正则表达式
        Pattern pattern = Pattern.compile(regex);

        // 创建 Matcher 对象
        Matcher matcher = pattern.matcher(phoneNumber);

        // 判断手机号是否匹配正则表达式
        if (matcher.matches()) {
            System.out.println("手机号合法");
        } else {
            throw exception(PHONE_NOT_LAWFUL);
        }
    }

    private void validateOrderImportForCreateOrUpdate(String customOrderNo, String salesman, String splitter, Long orderId) {
        // 关闭数据权限，避免因为没有数据权限，查询不到数据，进而导致唯一校验不正确
        Long organId = SecurityFrameworkUtils.getLoginUser().getOrganId();
        DataPermissionUtils.executeIgnore(() -> {
            validateCustomOrderNoExists(customOrderNo, orderId);
            validateSalesmanOrderNoExists(salesman, organId);
            validateSplitterOrderNoExists(splitter, organId);
        });
    }

    @Override
    public void importExcelData(OrderDO orderDO, List<?> list) {
        orderDO.setId((Long) snowFlakeGenerator.nextId(null));
        System.out.println(excelTypeRealize.changeDate(list, orderDO.getId()));

        Map<String, List<?>> listMap = excelTypeRealize.changeDate(list, orderDO.getId());
        List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDOS");
        List<GoodsDO> goodsDO = (List<GoodsDO>) listMap.get("goodsDOS");
//        List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) listMap.get("plateGoodDOS");
        List<OrderBodyDO> bodyDO = (List<OrderBodyDO>) listMap.get("orderBodyDOS");
        List<OrderGroupDO> groupDO = (List<OrderGroupDO>) listMap.get("orderGroupDOS");
        List<PlateDO> plateDO = (List<PlateDO>) listMap.get("plateDOS");
        List<OrderPartsDO> partsDO = (List<OrderPartsDO>) listMap.get("orderPartsDOS");
        List<OrderItemDO> itemDO = (List<OrderItemDO>) listMap.get("orderItemDOS");
        List<OrderModelDO> orderModelDOS = (List<OrderModelDO>) listMap.get("orderModelDOS");
        // 板材库匹配
        Map<String, List<?>> map = getPlateGoods(goodsDO);// 检验商品板材信息是否存在
        goodsDO = (List<GoodsDO>) map.get("goodsDO");
        List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");

        validateCustomOrderNoExists(orderDO.getCustomOrderNo());
        orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, orderDO, goodsDO, plateGoodDOS);
        orderInputProcessor.batchSaveModel(orderModelDOS);

    }

    @Override
    public String importTemplate(MultipartFile file, Boolean type) {
        // 接收文件
        if (file.isEmpty()) {
            throw exception(FILE_UPLOAD_ERR);
        }
        // 获取文件名称信息
        String fileName = file.getOriginalFilename();
        String value = fileName;
        String label = fileName;
        // 判断存放文件路径中是否有相同名称的文件
        if (!type) {
            Path path = Paths.get(getSavePath(), fileName);
            if (Files.exists(path))
                throw exception(FILE_ADD_ERR);
        } else {
            // 获取文件名称信息
            value = fileName.substring(0, fileName.lastIndexOf(".")) +
                    getRandomNumber(RANDOM_NUMBER_MAX) +
                    fileName.substring(fileName.lastIndexOf("."));
            fileName = value;
        }

        try {
            // 新增字典查询
            dictDataApi.addDictData("upload_file_type", label, value);
            // 保存文件
            File saveFile = new File(getSavePath() + "\\" + fileName);
            file.transferTo(saveFile);
            return value;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void exportTemplate(HttpServletResponse response, String value) {
        // 根据type获取文件名称
        try {
            // path是指想要下载的文件的路径
            File file = new File(getSavePath() + "\\" + value);
            // 获取文件名
            String filename = file.getName();
            // 获取文件后缀名
            String ext = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();

            // 将文件写入输入流
            FileInputStream fileInputStream = new FileInputStream(file);
            InputStream fis = new BufferedInputStream(fileInputStream);
            byte[] buffer = new byte[fis.available()];
            fis.read(buffer);
            fis.close();

            response.reset();
            response.setCharacterEncoding("UTF-8");
            response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
            response.addHeader("Content-Length", "" + file.length());
            OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
            response.setContentType("application/octet-stream");
            outputStream.write(buffer);
            outputStream.flush();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public Map<String, Object> getPrintDataMap(Long orderId, String type, HttpServletResponse response) {
        // 查询生产单
        OrderDO orderDO = orderMapper.selectOrderOne(orderId, OrganContextHolder.getOrganId());
        if (orderDO == null) {
            throw exception(ORDER_NOT_EXISTS);
        }
        return getDataByOrderIdAndType(orderDO, type, getOrderDeleted(orderId));
    }

    // 根据ype 与 orderId获取相关信息
    public Map<String, Object> getDataByOrderIdAndType(OrderDO orderDO, String type,Integer deleted) {
        Map<String, Object> map = new HashMap<>();
        map.put("orderDO", orderDO);
        switch (type) {
            case "配件明细1-模板.xlsx":// 配件明细
                map.put("partsListDetail", orderPartsMapper.selectPartDetail(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"8\" data-t=\"s\" data-v=\"配件明细单\" id=\"sjs-A1\">配件明细单</td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td></tr><tr><td colspan=\"3\" data-t=\"s\" data-v=\"房间名数据源\" id=\"sjs-A6\">房间名数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"柜体名表数据源\" id=\"sjs-D6\">柜体名表数据源</td><td colspan=\"2\" id=\"sjs-G6\"></td></tr><tr><td data-t=\"s\" data-v=\"名称\" id=\"sjs-A7\">名称</td><td data-t=\"s\" data-v=\"品牌\" id=\"sjs-B7\">品牌</td><td data-t=\"s\" data-v=\"厂家\" id=\"sjs-C7\">厂家</td><td data-t=\"s\" data-v=\"型号\" id=\"sjs-D7\">型号</td><td data-t=\"s\" data-v=\"规格\" id=\"sjs-E7\">规格</td><td data-t=\"s\" data-v=\"数量\" id=\"sjs-F7\">数量</td><td data-t=\"s\" data-v=\"单位\" id=\"sjs-G7\">单位</td><td data-t=\"s\" data-v=\"备注\" id=\"sjs-H7\">备注</td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td></tr><tr><td colspan=\"5\" data-t=\"s\" data-v=\"小计：\" id=\"sjs-A9\">小计：</td><td id=\"sjs-F9\"></td><td id=\"sjs-G9\"></td><td id=\"sjs-H9\"></td></tr><tr><td colspan=\"5\" data-t=\"s\" data-v=\"合计：\" id=\"sjs-A10\">合计：</td><td id=\"sjs-F10\"></td><td id=\"sjs-G10\"></td><td id=\"sjs-H10\"></td></tr><tr><td id=\"sjs-A11\"></td><td id=\"sjs-B11\"></td><td id=\"sjs-C11\"></td><td id=\"sjs-D11\"></td><td id=\"sjs-E11\"></td><td id=\"sjs-F11\"></td><td id=\"sjs-G11\"></td><td id=\"sjs-H11\"></td></tr><tr><td colspan=\"3\" id=\"sjs-A12\"></td><td colspan=\"3\" id=\"sjs-D12\"></td><td colspan=\"2\" id=\"sjs-G12\"></td></tr><tr><td id=\"sjs-A13\"></td><td id=\"sjs-B13\"></td><td id=\"sjs-C13\"></td><td id=\"sjs-D13\"></td><td id=\"sjs-E13\"></td><td id=\"sjs-F13\"></td><td id=\"sjs-G13\"></td><td id=\"sjs-H13\"></td></tr><tr><td id=\"sjs-A14\"></td><td id=\"sjs-B14\"></td><td id=\"sjs-C14\"></td><td id=\"sjs-D14\"></td><td id=\"sjs-E14\"></td><td id=\"sjs-F14\"></td><td id=\"sjs-G14\"></td><td id=\"sjs-H14\"></td></tr><tr><td colspan=\"7\" id=\"sjs-A15\"></td><td id=\"sjs-H15\"></td></tr><tr><td colspan=\"3\" id=\"sjs-A16\"></td><td colspan=\"3\" id=\"sjs-D16\"></td><td colspan=\"2\" id=\"sjs-G16\"></td></tr><tr><td id=\"sjs-A17\"></td><td id=\"sjs-B17\"></td><td id=\"sjs-C17\"></td><td id=\"sjs-D17\"></td><td id=\"sjs-E17\"></td><td id=\"sjs-F17\"></td><td id=\"sjs-G17\"></td><td id=\"sjs-H17\"></td></tr><tr><td id=\"sjs-A18\"></td><td id=\"sjs-B18\"></td><td id=\"sjs-C18\"></td><td id=\"sjs-D18\"></td><td id=\"sjs-E18\"></td><td id=\"sjs-F18\"></td><td id=\"sjs-G18\"></td><td id=\"sjs-H18\"></td></tr><tr><td colspan=\"7\" id=\"sjs-A19\"></td><td id=\"sjs-H19\"></td></tr><tr><td colspan=\"3\" id=\"sjs-A20\"></td><td colspan=\"3\" id=\"sjs-D20\"></td><td colspan=\"2\" id=\"sjs-G20\"></td></tr><tr><td id=\"sjs-A21\"></td><td id=\"sjs-B21\"></td><td id=\"sjs-C21\"></td><td id=\"sjs-D21\"></td><td id=\"sjs-E21\"></td><td id=\"sjs-F21\"></td><td id=\"sjs-G21\"></td><td id=\"sjs-H21\"></td></tr><tr><td id=\"sjs-A22\"></td><td id=\"sjs-B22\"></td><td id=\"sjs-C22\"></td><td id=\"sjs-D22\"></td><td id=\"sjs-E22\"></td><td id=\"sjs-F22\"></td><td id=\"sjs-G22\"></td><td id=\"sjs-H22\"></td></tr><tr><td id=\"sjs-A23\"></td><td id=\"sjs-B23\"></td><td id=\"sjs-C23\"></td><td id=\"sjs-D23\"></td><td id=\"sjs-E23\"></td><td id=\"sjs-F23\"></td><td id=\"sjs-G23\"></td><td id=\"sjs-H23\"></td></tr><tr><td id=\"sjs-A24\"></td><td id=\"sjs-B24\"></td><td id=\"sjs-C24\"></td><td id=\"sjs-D24\"></td><td id=\"sjs-E24\"></td><td id=\"sjs-F24\"></td><td id=\"sjs-G24\"></td><td id=\"sjs-H24\"></td></tr><tr><td id=\"sjs-A25\"></td><td id=\"sjs-B25\"></td><td id=\"sjs-C25\"></td><td id=\"sjs-D25\"></td><td id=\"sjs-E25\"></td><td id=\"sjs-F25\"></td><td id=\"sjs-G25\"></td><td id=\"sjs-H25\"></td></tr><tr><td colspan=\"7\" id=\"sjs-A26\"></td><td id=\"sjs-H26\"></td></tr><tr><td colspan=\"7\" id=\"sjs-A27\"></td><td id=\"sjs-H27\"></td></tr></table></body></html>");
                break;
            case "配件汇总1-模板.xlsx":// 配件汇总
                map.put("partsSummary", orderPartsMapper.selectPartAll(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"7\" data-t=\"s\" data-v=\"配件汇总单\" id=\"sjs-A1\">配件汇总单</td><td id=\"sjs-H1\"></td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td></tr><tr><td data-t=\"s\" data-v=\"名称\" id=\"sjs-A6\">名称</td><td data-t=\"s\" data-v=\"型号\" id=\"sjs-B6\">型号</td><td data-t=\"s\" data-v=\"规格\" id=\"sjs-C6\">规格</td><td data-t=\"s\" data-v=\"数量\" id=\"sjs-D6\">数量</td><td data-t=\"s\" data-v=\"单位\" id=\"sjs-E6\">单位</td><td data-t=\"s\" data-v=\"品牌\" id=\"sjs-F6\">品牌</td><td data-t=\"s\" data-v=\"备注\" id=\"sjs-G6\">备注</td><td id=\"sjs-H6\"></td></tr><tr><td id=\"sjs-A7\"></td><td id=\"sjs-B7\"></td><td id=\"sjs-C7\"></td><td id=\"sjs-D7\"></td><td id=\"sjs-E7\"></td><td id=\"sjs-F7\"></td><td id=\"sjs-G7\"></td><td id=\"sjs-H7\"></td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td></tr><tr><td id=\"sjs-A9\"></td><td id=\"sjs-B9\"></td><td id=\"sjs-C9\"></td><td id=\"sjs-D9\"></td><td id=\"sjs-E9\"></td><td id=\"sjs-F9\"></td><td id=\"sjs-G9\"></td><td id=\"sjs-H9\"></td></tr><tr><td id=\"sjs-A10\"></td><td id=\"sjs-B10\"></td><td id=\"sjs-C10\"></td><td id=\"sjs-D10\"></td><td id=\"sjs-E10\"></td><td id=\"sjs-F10\"></td><td id=\"sjs-G10\"></td><td id=\"sjs-H10\"></td></tr></table></body></html>");
                break;
            case "板材明细-按房间-模板.xlsx":
                map.put("plateListDetail", plateMapper.selectPlateGoodsList(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"13\" data-t=\"s\" data-v=\"板材明细单\" id=\"sjs-A1\">板材明细单</td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td><td id=\"sjs-I2\"></td><td id=\"sjs-J2\"></td><td id=\"sjs-K2\"></td><td id=\"sjs-L2\"></td><td id=\"sjs-M2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td><td id=\"sjs-I3\"></td><td id=\"sjs-J3\"></td><td id=\"sjs-K3\"></td><td id=\"sjs-L3\"></td><td id=\"sjs-M3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td><td id=\"sjs-I4\"></td><td id=\"sjs-J4\"></td><td id=\"sjs-K4\"></td><td id=\"sjs-L4\"></td><td id=\"sjs-M4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td><td id=\"sjs-I5\"></td><td id=\"sjs-J5\"></td><td id=\"sjs-K5\"></td><td id=\"sjs-L5\"></td><td id=\"sjs-M5\"></td></tr><tr><td data-t=\"s\" data-v=\"房间名数据源\" id=\"sjs-A6\">房间名数据源</td><td colspan=\"2\" data-t=\"s\" data-v=\"柜体数据源\" id=\"sjs-B6\">柜体数据源</td><td colspan=\"3\" id=\"sjs-D6\"></td><td colspan=\"3\" data-t=\"s\" data-v=\"列表条数表达式\" id=\"sjs-G6\">列表条数表达式</td><td id=\"sjs-J6\"></td><td id=\"sjs-K6\"></td><td id=\"sjs-L6\"></td><td id=\"sjs-M6\"></td></tr><tr><td data-t=\"s\" data-v=\"板编号\" id=\"sjs-A7\">板编号</td><td data-t=\"s\" data-v=\"板名称\" id=\"sjs-B7\">板名称</td><td data-t=\"s\" data-v=\"材料\" id=\"sjs-C7\">材料</td><td data-t=\"s\" data-v=\"颜色\" id=\"sjs-D7\">颜色</td><td data-t=\"s\" data-v=\"长\" id=\"sjs-E7\">长</td><td data-t=\"s\" data-v=\"宽\" id=\"sjs-F7\">宽</td><td data-t=\"s\" data-v=\"厚度\" id=\"sjs-G7\">厚度</td><td data-t=\"s\" data-v=\"面积\" id=\"sjs-H7\">面积</td><td data-t=\"s\" data-v=\"异形\" id=\"sjs-I7\">异形</td><td data-t=\"s\" data-v=\"造型\" id=\"sjs-J7\">造型</td><td data-t=\"s\" data-v=\"左/右/上/下\" id=\"sjs-K7\">左/右/上/下</td><td data-t=\"s\" data-v=\"开门类型\" id=\"sjs-L7\">开门类型</td><td data-t=\"s\" data-v=\"备注\" id=\"sjs-M7\">备注</td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td><td id=\"sjs-I8\"></td><td id=\"sjs-J8\"></td><td id=\"sjs-K8\"></td><td id=\"sjs-L8\"></td><td id=\"sjs-M8\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"小计：\" id=\"sjs-A9\">小计：</td><td colspan=\"2\" data-t=\"s\" data-v=\"小计面积表达式\" id=\"sjs-G9\">小计面积表达式</td><td id=\"sjs-I9\"></td><td id=\"sjs-J9\"></td><td id=\"sjs-K9\"></td><td id=\"sjs-L9\"></td><td id=\"sjs-M9\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"合计：\" id=\"sjs-A10\">合计：</td><td colspan=\"2\" data-t=\"s\" data-v=\"合计面积表达式\" id=\"sjs-G10\">合计面积表达式</td><td id=\"sjs-I10\"></td><td id=\"sjs-J10\"></td><td id=\"sjs-K10\"></td><td id=\"sjs-L10\"></td><td id=\"sjs-M10\"></td></tr><tr><td id=\"sjs-A11\"></td><td id=\"sjs-B11\"></td><td id=\"sjs-C11\"></td><td id=\"sjs-D11\"></td><td id=\"sjs-E11\"></td><td id=\"sjs-F11\"></td><td id=\"sjs-G11\"></td><td id=\"sjs-H11\"></td><td id=\"sjs-I11\"></td><td id=\"sjs-J11\"></td><td id=\"sjs-K11\"></td><td id=\"sjs-L11\"></td><td id=\"sjs-M11\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A12\"></td><td colspan=\"2\" id=\"sjs-G12\"></td><td colspan=\"5\" id=\"sjs-I12\"></td></tr><tr><td id=\"sjs-A13\"></td><td colspan=\"2\" id=\"sjs-B13\"></td><td colspan=\"3\" id=\"sjs-D13\"></td><td colspan=\"3\" id=\"sjs-G13\"></td><td id=\"sjs-J13\"></td><td id=\"sjs-K13\"></td><td id=\"sjs-L13\"></td><td id=\"sjs-M13\"></td></tr><tr><td id=\"sjs-A14\"></td><td id=\"sjs-B14\"></td><td id=\"sjs-C14\"></td><td id=\"sjs-D14\"></td><td id=\"sjs-E14\"></td><td id=\"sjs-F14\"></td><td id=\"sjs-G14\"></td><td id=\"sjs-H14\"></td><td id=\"sjs-I14\"></td><td id=\"sjs-J14\"></td><td id=\"sjs-K14\"></td><td id=\"sjs-L14\"></td><td id=\"sjs-M14\"></td></tr><tr><td id=\"sjs-A15\"></td><td id=\"sjs-B15\"></td><td id=\"sjs-C15\"></td><td id=\"sjs-D15\"></td><td id=\"sjs-E15\"></td><td id=\"sjs-F15\"></td><td id=\"sjs-G15\"></td><td id=\"sjs-H15\"></td><td id=\"sjs-I15\"></td><td id=\"sjs-J15\"></td><td id=\"sjs-K15\"></td><td id=\"sjs-L15\"></td><td id=\"sjs-M15\"></td></tr><tr><td id=\"sjs-A16\"></td><td id=\"sjs-B16\"></td><td id=\"sjs-C16\"></td><td id=\"sjs-D16\"></td><td id=\"sjs-E16\"></td><td id=\"sjs-F16\"></td><td id=\"sjs-G16\"></td><td id=\"sjs-H16\"></td><td id=\"sjs-I16\"></td><td id=\"sjs-J16\"></td><td id=\"sjs-K16\"></td><td id=\"sjs-L16\"></td><td id=\"sjs-M16\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A17\"></td><td colspan=\"2\" id=\"sjs-G17\"></td><td colspan=\"5\" id=\"sjs-I17\"></td></tr><tr><td id=\"sjs-A18\"></td><td colspan=\"2\" id=\"sjs-B18\"></td><td colspan=\"3\" id=\"sjs-D18\"></td><td colspan=\"3\" id=\"sjs-G18\"></td><td id=\"sjs-J18\"></td><td id=\"sjs-K18\"></td><td id=\"sjs-L18\"></td><td id=\"sjs-M18\"></td></tr><tr><td id=\"sjs-A19\"></td><td id=\"sjs-B19\"></td><td id=\"sjs-C19\"></td><td id=\"sjs-D19\"></td><td id=\"sjs-E19\"></td><td id=\"sjs-F19\"></td><td id=\"sjs-G19\"></td><td id=\"sjs-H19\"></td><td id=\"sjs-I19\"></td><td id=\"sjs-J19\"></td><td id=\"sjs-K19\"></td><td id=\"sjs-L19\"></td><td id=\"sjs-M19\"></td></tr><tr><td id=\"sjs-A20\"></td><td id=\"sjs-B20\"></td><td id=\"sjs-C20\"></td><td id=\"sjs-D20\"></td><td id=\"sjs-E20\"></td><td id=\"sjs-F20\"></td><td id=\"sjs-G20\"></td><td id=\"sjs-H20\"></td><td id=\"sjs-I20\"></td><td id=\"sjs-J20\"></td><td id=\"sjs-K20\"></td><td id=\"sjs-L20\"></td><td id=\"sjs-M20\"></td></tr><tr><td id=\"sjs-A21\"></td><td id=\"sjs-B21\"></td><td id=\"sjs-C21\"></td><td id=\"sjs-D21\"></td><td id=\"sjs-E21\"></td><td id=\"sjs-F21\"></td><td id=\"sjs-G21\"></td><td id=\"sjs-H21\"></td><td id=\"sjs-I21\"></td><td id=\"sjs-J21\"></td><td id=\"sjs-K21\"></td><td id=\"sjs-L21\"></td><td id=\"sjs-M21\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A22\"></td><td colspan=\"2\" id=\"sjs-G22\"></td><td colspan=\"5\" id=\"sjs-I22\"></td></tr><tr><td id=\"sjs-A23\"></td><td colspan=\"2\" id=\"sjs-B23\"></td><td colspan=\"3\" id=\"sjs-D23\"></td><td colspan=\"3\" id=\"sjs-G23\"></td><td id=\"sjs-J23\"></td><td id=\"sjs-K23\"></td><td id=\"sjs-L23\"></td><td id=\"sjs-M23\"></td></tr><tr><td id=\"sjs-A24\"></td><td id=\"sjs-B24\"></td><td id=\"sjs-C24\"></td><td id=\"sjs-D24\"></td><td id=\"sjs-E24\"></td><td id=\"sjs-F24\"></td><td id=\"sjs-G24\"></td><td id=\"sjs-H24\"></td><td id=\"sjs-I24\"></td><td id=\"sjs-J24\"></td><td id=\"sjs-K24\"></td><td id=\"sjs-L24\"></td><td id=\"sjs-M24\"></td></tr><tr><td id=\"sjs-A25\"></td><td id=\"sjs-B25\"></td><td id=\"sjs-C25\"></td><td id=\"sjs-D25\"></td><td id=\"sjs-E25\"></td><td id=\"sjs-F25\"></td><td id=\"sjs-G25\"></td><td id=\"sjs-H25\"></td><td id=\"sjs-I25\"></td><td id=\"sjs-J25\"></td><td id=\"sjs-K25\"></td><td id=\"sjs-L25\"></td><td id=\"sjs-M25\"></td></tr><tr><td id=\"sjs-A26\"></td><td id=\"sjs-B26\"></td><td id=\"sjs-C26\"></td><td id=\"sjs-D26\"></td><td id=\"sjs-E26\"></td><td id=\"sjs-F26\"></td><td id=\"sjs-G26\"></td><td id=\"sjs-H26\"></td><td id=\"sjs-I26\"></td><td id=\"sjs-J26\"></td><td id=\"sjs-K26\"></td><td id=\"sjs-L26\"></td><td id=\"sjs-M26\"></td></tr><tr><td id=\"sjs-A27\"></td><td id=\"sjs-B27\"></td><td id=\"sjs-C27\"></td><td id=\"sjs-D27\"></td><td id=\"sjs-E27\"></td><td id=\"sjs-F27\"></td><td id=\"sjs-G27\"></td><td id=\"sjs-H27\"></td><td id=\"sjs-I27\"></td><td id=\"sjs-J27\"></td><td id=\"sjs-K27\"></td><td id=\"sjs-L27\"></td><td id=\"sjs-M27\"></td></tr><tr><td id=\"sjs-A28\"></td><td id=\"sjs-B28\"></td><td id=\"sjs-C28\"></td><td id=\"sjs-D28\"></td><td id=\"sjs-E28\"></td><td id=\"sjs-F28\"></td><td id=\"sjs-G28\"></td><td id=\"sjs-H28\"></td><td id=\"sjs-I28\"></td><td id=\"sjs-J28\"></td><td id=\"sjs-K28\"></td><td id=\"sjs-L28\"></td><td id=\"sjs-M28\"></td></tr><tr><td id=\"sjs-A29\"></td><td id=\"sjs-B29\"></td><td id=\"sjs-C29\"></td><td id=\"sjs-D29\"></td><td id=\"sjs-E29\"></td><td id=\"sjs-F29\"></td><td id=\"sjs-G29\"></td><td id=\"sjs-H29\"></td><td id=\"sjs-I29\"></td><td id=\"sjs-J29\"></td><td id=\"sjs-K29\"></td><td id=\"sjs-L29\"></td><td id=\"sjs-M29\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A30\"></td><td colspan=\"2\" id=\"sjs-G30\"></td><td colspan=\"5\" id=\"sjs-I30\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A31\"></td><td colspan=\"2\" id=\"sjs-G31\"></td><td colspan=\"5\" id=\"sjs-I31\"></td></tr></table></body></html>");
                map.put("plateCount", plateMapper.countPlateByOrderId(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                break;
            case "板材明细-按板材-模板.xlsx":
                map.put("plateListDetail", plateMapper.selectPlateGoodsList(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"13\" data-t=\"s\" data-v=\"板材明细单\" id=\"sjs-A1\">板材明细单</td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td><td id=\"sjs-I2\"></td><td id=\"sjs-J2\"></td><td id=\"sjs-K2\"></td><td id=\"sjs-L2\"></td><td id=\"sjs-M2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td><td id=\"sjs-I3\"></td><td id=\"sjs-J3\"></td><td id=\"sjs-K3\"></td><td id=\"sjs-L3\"></td><td id=\"sjs-M3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td><td id=\"sjs-I4\"></td><td id=\"sjs-J4\"></td><td id=\"sjs-K4\"></td><td id=\"sjs-L4\"></td><td id=\"sjs-M4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td><td id=\"sjs-I5\"></td><td id=\"sjs-J5\"></td><td id=\"sjs-K5\"></td><td id=\"sjs-L5\"></td><td id=\"sjs-M5\"></td></tr><tr><td colspan=\"2\" data-t=\"s\" data-v=\"板材名称数据源\" id=\"sjs-A6\">板材名称数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"板材颜色数据源\" id=\"sjs-C6\">板材颜色数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"板材厚度数据源\" id=\"sjs-F6\">板材厚度数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"列表条数表达式\" id=\"sjs-I6\">列表条数表达式</td><td id=\"sjs-L6\"></td><td id=\"sjs-M6\"></td></tr><tr><td data-t=\"s\" data-v=\"房名\" id=\"sjs-A7\">房名</td><td data-t=\"s\" data-v=\"柜名\" id=\"sjs-B7\">柜名</td><td data-t=\"s\" data-v=\"板编号\" id=\"sjs-C7\">板编号</td><td data-t=\"s\" data-v=\"板名称\" id=\"sjs-D7\">板名称</td><td data-t=\"s\" data-v=\"长\" id=\"sjs-E7\">长</td><td data-t=\"s\" data-v=\"宽\" id=\"sjs-F7\">宽</td><td data-t=\"s\" data-v=\"厚度\" id=\"sjs-G7\">厚度</td><td data-t=\"s\" data-v=\"面积\" id=\"sjs-H7\">面积</td><td data-t=\"s\" data-v=\"异形\" id=\"sjs-I7\">异形</td><td data-t=\"s\" data-v=\"造型\" id=\"sjs-J7\">造型</td><td data-t=\"s\" data-v=\"左/右/上/下\" id=\"sjs-K7\">左/右/上/下</td><td data-t=\"s\" data-v=\"开门类型\" id=\"sjs-L7\">开门类型</td><td data-t=\"s\" data-v=\"备注\" id=\"sjs-M7\">备注</td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td><td id=\"sjs-I8\"></td><td id=\"sjs-J8\"></td><td id=\"sjs-K8\"></td><td id=\"sjs-L8\"></td><td id=\"sjs-M8\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"小计：\" id=\"sjs-A9\">小计：</td><td colspan=\"2\" data-t=\"s\" data-v=\"小计面积表达式\" id=\"sjs-G9\">小计面积表达式</td><td id=\"sjs-I9\"></td><td id=\"sjs-J9\"></td><td id=\"sjs-K9\"></td><td id=\"sjs-L9\"></td><td id=\"sjs-M9\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"合计：\" id=\"sjs-A10\">合计：</td><td colspan=\"2\" data-t=\"s\" data-v=\"合计面积表达式\" id=\"sjs-G10\">合计面积表达式</td><td id=\"sjs-I10\"></td><td id=\"sjs-J10\"></td><td id=\"sjs-K10\"></td><td id=\"sjs-L10\"></td><td id=\"sjs-M10\"></td></tr><tr><td id=\"sjs-A11\"></td><td id=\"sjs-B11\"></td><td id=\"sjs-C11\"></td><td id=\"sjs-D11\"></td><td id=\"sjs-E11\"></td><td id=\"sjs-F11\"></td><td id=\"sjs-G11\"></td><td id=\"sjs-H11\"></td><td id=\"sjs-I11\"></td><td id=\"sjs-J11\"></td><td id=\"sjs-K11\"></td><td id=\"sjs-L11\"></td><td id=\"sjs-M11\"></td></tr><tr><td id=\"sjs-A12\"></td><td id=\"sjs-B12\"></td><td id=\"sjs-C12\"></td><td id=\"sjs-D12\"></td><td id=\"sjs-E12\"></td><td id=\"sjs-F12\"></td><td id=\"sjs-G12\"></td><td id=\"sjs-H12\"></td><td id=\"sjs-I12\"></td><td id=\"sjs-J12\"></td><td id=\"sjs-K12\"></td><td id=\"sjs-L12\"></td><td id=\"sjs-M12\"></td></tr><tr><td id=\"sjs-A13\"></td><td id=\"sjs-B13\"></td><td id=\"sjs-C13\"></td><td id=\"sjs-D13\"></td><td id=\"sjs-E13\"></td><td id=\"sjs-F13\"></td><td id=\"sjs-G13\"></td><td id=\"sjs-H13\"></td><td id=\"sjs-I13\"></td><td id=\"sjs-J13\"></td><td id=\"sjs-K13\"></td><td id=\"sjs-L13\"></td><td id=\"sjs-M13\"></td></tr><tr><td id=\"sjs-A14\"></td><td id=\"sjs-B14\"></td><td id=\"sjs-C14\"></td><td id=\"sjs-D14\"></td><td id=\"sjs-E14\"></td><td id=\"sjs-F14\"></td><td id=\"sjs-G14\"></td><td id=\"sjs-H14\"></td><td id=\"sjs-I14\"></td><td id=\"sjs-J14\"></td><td id=\"sjs-K14\"></td><td id=\"sjs-L14\"></td><td id=\"sjs-M14\"></td></tr><tr><td id=\"sjs-A15\"></td><td id=\"sjs-B15\"></td><td id=\"sjs-C15\"></td><td id=\"sjs-D15\"></td><td id=\"sjs-E15\"></td><td id=\"sjs-F15\"></td><td id=\"sjs-G15\"></td><td id=\"sjs-H15\"></td><td id=\"sjs-I15\"></td><td id=\"sjs-J15\"></td><td id=\"sjs-K15\"></td><td id=\"sjs-L15\"></td><td id=\"sjs-M15\"></td></tr><tr><td id=\"sjs-A16\"></td><td id=\"sjs-B16\"></td><td id=\"sjs-C16\"></td><td id=\"sjs-D16\"></td><td id=\"sjs-E16\"></td><td id=\"sjs-F16\"></td><td id=\"sjs-G16\"></td><td id=\"sjs-H16\"></td><td id=\"sjs-I16\"></td><td id=\"sjs-J16\"></td><td id=\"sjs-K16\"></td><td id=\"sjs-L16\"></td><td id=\"sjs-M16\"></td></tr><tr><td id=\"sjs-A17\"></td><td id=\"sjs-B17\"></td><td id=\"sjs-C17\"></td><td id=\"sjs-D17\"></td><td id=\"sjs-E17\"></td><td id=\"sjs-F17\"></td><td id=\"sjs-G17\"></td><td id=\"sjs-H17\"></td><td id=\"sjs-I17\"></td><td id=\"sjs-J17\"></td><td id=\"sjs-K17\"></td><td id=\"sjs-L17\"></td><td id=\"sjs-M17\"></td></tr><tr><td id=\"sjs-A18\"></td><td id=\"sjs-B18\"></td><td id=\"sjs-C18\"></td><td id=\"sjs-D18\"></td><td id=\"sjs-E18\"></td><td id=\"sjs-F18\"></td><td id=\"sjs-G18\"></td><td id=\"sjs-H18\"></td><td id=\"sjs-I18\"></td><td id=\"sjs-J18\"></td><td id=\"sjs-K18\"></td><td id=\"sjs-L18\"></td><td id=\"sjs-M18\"></td></tr><tr><td id=\"sjs-A19\"></td><td id=\"sjs-B19\"></td><td id=\"sjs-C19\"></td><td id=\"sjs-D19\"></td><td id=\"sjs-E19\"></td><td id=\"sjs-F19\"></td><td id=\"sjs-G19\"></td><td id=\"sjs-H19\"></td><td id=\"sjs-I19\"></td><td id=\"sjs-J19\"></td><td id=\"sjs-K19\"></td><td id=\"sjs-L19\"></td><td id=\"sjs-M19\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A20\"></td><td colspan=\"2\" id=\"sjs-G20\"></td><td colspan=\"5\" id=\"sjs-I20\"></td></tr><tr><td colspan=\"2\" id=\"sjs-A21\"></td><td colspan=\"3\" id=\"sjs-C21\"></td><td colspan=\"3\" id=\"sjs-F21\"></td><td colspan=\"3\" id=\"sjs-I21\"></td><td id=\"sjs-L21\"></td><td id=\"sjs-M21\"></td></tr><tr><td id=\"sjs-A22\"></td><td id=\"sjs-B22\"></td><td id=\"sjs-C22\"></td><td id=\"sjs-D22\"></td><td id=\"sjs-E22\"></td><td id=\"sjs-F22\"></td><td id=\"sjs-G22\"></td><td id=\"sjs-H22\"></td><td id=\"sjs-I22\"></td><td id=\"sjs-J22\"></td><td id=\"sjs-K22\"></td><td id=\"sjs-L22\"></td><td id=\"sjs-M22\"></td></tr><tr><td id=\"sjs-A23\"></td><td id=\"sjs-B23\"></td><td id=\"sjs-C23\"></td><td id=\"sjs-D23\"></td><td id=\"sjs-E23\"></td><td id=\"sjs-F23\"></td><td id=\"sjs-G23\"></td><td id=\"sjs-H23\"></td><td id=\"sjs-I23\"></td><td id=\"sjs-J23\"></td><td id=\"sjs-K23\"></td><td id=\"sjs-L23\"></td><td id=\"sjs-M23\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A24\"></td><td colspan=\"2\" id=\"sjs-G24\"></td><td colspan=\"5\" id=\"sjs-I24\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A25\"></td><td colspan=\"2\" id=\"sjs-G25\"></td><td colspan=\"5\" id=\"sjs-I25\"></td></tr></table></body></html>");
                map.put("plateCount", plateMapper.countPlateByOrderId(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                break;
            case "板材汇总-按房间-模板.xlsx":
                map.put("plateSummary", plateMapper.selectPlateGoodsListSummary(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"9\" data-t=\"s\" data-v=\"板材汇总单\" id=\"sjs-A1\">板材汇总单</td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td><td id=\"sjs-I2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td><td id=\"sjs-I3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td><td id=\"sjs-I4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td><td id=\"sjs-I5\"></td></tr><tr><td data-t=\"s\" data-v=\"房间名称数据源\" id=\"sjs-A6\">房间名称数据源</td><td colspan=\"2\" data-t=\"s\" data-v=\"柜体数据源\" id=\"sjs-B6\">柜体数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"列表条数表达式\" id=\"sjs-D6\">列表条数表达式</td><td id=\"sjs-G6\"></td><td id=\"sjs-H6\"></td><td id=\"sjs-I6\"></td></tr><tr><td data-t=\"s\" data-v=\"板名称\" id=\"sjs-A7\">板名称</td><td data-t=\"s\" data-v=\"材料\" id=\"sjs-B7\">材料</td><td data-t=\"s\" data-v=\"颜色\" id=\"sjs-C7\">颜色</td><td data-t=\"s\" data-v=\"长\" id=\"sjs-D7\">长</td><td data-t=\"s\" data-v=\"宽\" id=\"sjs-E7\">宽</td><td data-t=\"s\" data-v=\"厚度\" id=\"sjs-F7\">厚度</td><td data-t=\"s\" data-v=\"数量\" id=\"sjs-G7\">数量</td><td data-t=\"s\" data-v=\"面积\" id=\"sjs-H7\">面积</td><td data-t=\"s\" data-v=\"开门类型\" id=\"sjs-I7\">开门类型</td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td><td id=\"sjs-I8\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"小计：\" id=\"sjs-A9\">小计：</td><td data-t=\"s\" data-v=\"数量表达式\" id=\"sjs-G9\">数量表达式</td><td data-t=\"s\" data-v=\"面积表达式\" id=\"sjs-H9\">面积表达式</td><td id=\"sjs-I9\"></td></tr><tr><td colspan=\"6\" data-t=\"s\" data-v=\"合计：\" id=\"sjs-A10\">合计：</td><td data-t=\"s\" data-v=\"数量表达式\" id=\"sjs-G10\">数量表达式</td><td data-t=\"s\" data-v=\"面积表达式\" id=\"sjs-H10\">面积表达式</td><td id=\"sjs-I10\"></td></tr><tr><td id=\"sjs-A11\"></td><td id=\"sjs-B11\"></td><td id=\"sjs-C11\"></td><td id=\"sjs-D11\"></td><td id=\"sjs-E11\"></td><td id=\"sjs-F11\"></td><td id=\"sjs-G11\"></td><td id=\"sjs-H11\"></td><td id=\"sjs-I11\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A12\"></td><td id=\"sjs-G12\"></td><td id=\"sjs-H12\"></td><td id=\"sjs-I12\"></td></tr><tr><td id=\"sjs-A13\"></td><td colspan=\"2\" id=\"sjs-B13\"></td><td colspan=\"3\" id=\"sjs-D13\"></td><td id=\"sjs-G13\"></td><td id=\"sjs-H13\"></td><td id=\"sjs-I13\"></td></tr><tr><td id=\"sjs-A14\"></td><td id=\"sjs-B14\"></td><td id=\"sjs-C14\"></td><td id=\"sjs-D14\"></td><td id=\"sjs-E14\"></td><td id=\"sjs-F14\"></td><td id=\"sjs-G14\"></td><td id=\"sjs-H14\"></td><td id=\"sjs-I14\"></td></tr><tr><td id=\"sjs-A15\"></td><td id=\"sjs-B15\"></td><td id=\"sjs-C15\"></td><td id=\"sjs-D15\"></td><td id=\"sjs-E15\"></td><td id=\"sjs-F15\"></td><td id=\"sjs-G15\"></td><td id=\"sjs-H15\"></td><td id=\"sjs-I15\"></td></tr><tr><td id=\"sjs-A16\"></td><td id=\"sjs-B16\"></td><td id=\"sjs-C16\"></td><td id=\"sjs-D16\"></td><td id=\"sjs-E16\"></td><td id=\"sjs-F16\"></td><td id=\"sjs-G16\"></td><td id=\"sjs-H16\"></td><td id=\"sjs-I16\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A17\"></td><td id=\"sjs-G17\"></td><td colspan=\"2\" id=\"sjs-H17\"></td></tr><tr><td id=\"sjs-A18\"></td><td colspan=\"2\" id=\"sjs-B18\"></td><td colspan=\"3\" id=\"sjs-D18\"></td><td id=\"sjs-G18\"></td><td id=\"sjs-H18\"></td><td id=\"sjs-I18\"></td></tr><tr><td id=\"sjs-A19\"></td><td id=\"sjs-B19\"></td><td id=\"sjs-C19\"></td><td id=\"sjs-D19\"></td><td id=\"sjs-E19\"></td><td id=\"sjs-F19\"></td><td id=\"sjs-G19\"></td><td id=\"sjs-H19\"></td><td id=\"sjs-I19\"></td></tr><tr><td id=\"sjs-A20\"></td><td id=\"sjs-B20\"></td><td id=\"sjs-C20\"></td><td id=\"sjs-D20\"></td><td id=\"sjs-E20\"></td><td id=\"sjs-F20\"></td><td id=\"sjs-G20\"></td><td id=\"sjs-H20\"></td><td id=\"sjs-I20\"></td></tr><tr><td id=\"sjs-A21\"></td><td id=\"sjs-B21\"></td><td id=\"sjs-C21\"></td><td id=\"sjs-D21\"></td><td id=\"sjs-E21\"></td><td id=\"sjs-F21\"></td><td id=\"sjs-G21\"></td><td id=\"sjs-H21\"></td><td id=\"sjs-I21\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A22\"></td><td id=\"sjs-G22\"></td><td colspan=\"2\" id=\"sjs-H22\"></td></tr><tr><td id=\"sjs-A23\"></td><td colspan=\"2\" id=\"sjs-B23\"></td><td colspan=\"3\" id=\"sjs-D23\"></td><td id=\"sjs-G23\"></td><td id=\"sjs-H23\"></td><td id=\"sjs-I23\"></td></tr><tr><td id=\"sjs-A24\"></td><td id=\"sjs-B24\"></td><td id=\"sjs-C24\"></td><td id=\"sjs-D24\"></td><td id=\"sjs-E24\"></td><td id=\"sjs-F24\"></td><td id=\"sjs-G24\"></td><td id=\"sjs-H24\"></td><td id=\"sjs-I24\"></td></tr><tr><td id=\"sjs-A25\"></td><td id=\"sjs-B25\"></td><td id=\"sjs-C25\"></td><td id=\"sjs-D25\"></td><td id=\"sjs-E25\"></td><td id=\"sjs-F25\"></td><td id=\"sjs-G25\"></td><td id=\"sjs-H25\"></td><td id=\"sjs-I25\"></td></tr><tr><td id=\"sjs-A26\"></td><td id=\"sjs-B26\"></td><td id=\"sjs-C26\"></td><td id=\"sjs-D26\"></td><td id=\"sjs-E26\"></td><td id=\"sjs-F26\"></td><td id=\"sjs-G26\"></td><td id=\"sjs-H26\"></td><td id=\"sjs-I26\"></td></tr><tr><td id=\"sjs-A27\"></td><td id=\"sjs-B27\"></td><td id=\"sjs-C27\"></td><td id=\"sjs-D27\"></td><td id=\"sjs-E27\"></td><td id=\"sjs-F27\"></td><td id=\"sjs-G27\"></td><td id=\"sjs-H27\"></td><td id=\"sjs-I27\"></td></tr><tr><td id=\"sjs-A28\"></td><td id=\"sjs-B28\"></td><td id=\"sjs-C28\"></td><td id=\"sjs-D28\"></td><td id=\"sjs-E28\"></td><td id=\"sjs-F28\"></td><td id=\"sjs-G28\"></td><td id=\"sjs-H28\"></td><td id=\"sjs-I28\"></td></tr><tr><td id=\"sjs-A29\"></td><td id=\"sjs-B29\"></td><td id=\"sjs-C29\"></td><td id=\"sjs-D29\"></td><td id=\"sjs-E29\"></td><td id=\"sjs-F29\"></td><td id=\"sjs-G29\"></td><td id=\"sjs-H29\"></td><td id=\"sjs-I29\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A30\"></td><td id=\"sjs-G30\"></td><td colspan=\"2\" id=\"sjs-H30\"></td></tr><tr><td colspan=\"6\" id=\"sjs-A31\"></td><td id=\"sjs-G31\"></td><td colspan=\"2\" id=\"sjs-H31\"></td></tr></table></body></html>");
                map.put("plateCount", plateMapper.countPlateByOrderId(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                break;
            case "板材汇总-按板材-模板.xlsx":
                map.put("plateSummary", plateMapper.selectPlateGoodsListSummary(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                map.put("table", "<html><head><meta charset=\"utf-8\"/><title>SheetJS Table Export</title></head><body><table><tr><td colspan=\"9\" data-t=\"s\" data-v=\"板材汇总单\" id=\"sjs-A1\">板材汇总单</td></tr><tr><td data-t=\"s\" data-v=\"生产单号:\" id=\"sjs-A2\"><span style=\"font-size:10pt;\"><b>生产单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B2\"></td><td data-t=\"s\" data-v=\"自定单号:\" id=\"sjs-C2\"><span style=\"font-size:10pt;\"><b>自定单号</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D2\"></td><td data-t=\"s\" data-v=\"经销商:\" id=\"sjs-E2\">经销商:</td><td id=\"sjs-F2\"></td><td data-t=\"s\" data-v=\"订单日期：\" id=\"sjs-G2\"><span style=\"font-size:10pt;\"><b>订单日期</b></span><span style=\"font-size:10pt;\"><b>：</b></span></td><td id=\"sjs-H2\"></td><td id=\"sjs-I2\"></td></tr><tr><td data-t=\"s\" data-v=\"客户:\" id=\"sjs-A3\"><span style=\"font-size:10pt;\"><b>客户</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-B3\"></td><td data-t=\"s\" data-v=\"收货电话:\" id=\"sjs-C3\"><span style=\"font-size:10pt;\"><b>收货电话</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-D3\"></td><td data-t=\"s\" data-v=\"收货地址:\" id=\"sjs-E3\"><span style=\"font-size:10pt;\"><b>收货地址</b></span><span style=\"font-size:10pt;\"><b>:</b></span></td><td id=\"sjs-F3\"></td><td data-t=\"s\" data-v=\"收货日期：\" id=\"sjs-G3\"><span style=\"font-size:10pt;\"><b>收货日期：</b></span></td><td id=\"sjs-H3\"></td><td id=\"sjs-I3\"></td></tr><tr><td data-t=\"s\" data-v=\"备注:\" id=\"sjs-A4\">备注:</td><td id=\"sjs-B4\"></td><td id=\"sjs-C4\"></td><td id=\"sjs-D4\"></td><td id=\"sjs-E4\"></td><td id=\"sjs-F4\"></td><td id=\"sjs-G4\"></td><td id=\"sjs-H4\"></td><td id=\"sjs-I4\"></td></tr><tr><td id=\"sjs-A5\"></td><td id=\"sjs-B5\"></td><td id=\"sjs-C5\"></td><td id=\"sjs-D5\"></td><td id=\"sjs-E5\"></td><td id=\"sjs-F5\"></td><td id=\"sjs-G5\"></td><td id=\"sjs-H5\"></td><td id=\"sjs-I5\"></td></tr><tr><td colspan=\"2\" data-t=\"s\" data-v=\"板材名称数据源\" id=\"sjs-A6\">板材名称数据源</td><td colspan=\"3\" data-t=\"s\" data-v=\"板材颜色数据源\" id=\"sjs-C6\">板材颜色数据源</td><td colspan=\"2\" data-t=\"s\" data-v=\"板材厚度数据源\" id=\"sjs-F6\">板材厚度数据源</td><td colspan=\"2\" id=\"sjs-H6\"></td></tr><tr><td data-t=\"s\" data-v=\"房名\" id=\"sjs-A7\">房名</td><td data-t=\"s\" data-v=\"柜名\" id=\"sjs-B7\">柜名</td><td data-t=\"s\" data-v=\"板名称\" id=\"sjs-C7\">板名称</td><td data-t=\"s\" data-v=\"长\" id=\"sjs-D7\">长</td><td data-t=\"s\" data-v=\"宽\" id=\"sjs-E7\">宽</td><td data-t=\"s\" data-v=\"数量\" id=\"sjs-F7\">数量</td><td data-t=\"s\" data-v=\"面积\" id=\"sjs-G7\">面积</td><td data-t=\"s\" data-v=\"开门类型\" id=\"sjs-H7\">开门类型</td><td data-t=\"s\" data-v=\"备注\" id=\"sjs-I7\">备注</td></tr><tr><td id=\"sjs-A8\"></td><td id=\"sjs-B8\"></td><td id=\"sjs-C8\"></td><td id=\"sjs-D8\"></td><td id=\"sjs-E8\"></td><td id=\"sjs-F8\"></td><td id=\"sjs-G8\"></td><td id=\"sjs-H8\"></td><td id=\"sjs-I8\"></td></tr><tr><td colspan=\"5\" data-t=\"s\" data-v=\"小计：\" id=\"sjs-A9\">小计：</td><td data-t=\"s\" data-v=\"数量表达式\" id=\"sjs-F9\">数量表达式</td><td data-t=\"s\" data-v=\"面积表达式\" id=\"sjs-G9\">面积表达式</td><td id=\"sjs-H9\"></td><td id=\"sjs-I9\"></td></tr><tr><td colspan=\"5\" data-t=\"s\" data-v=\"合计：\" id=\"sjs-A10\">合计：</td><td data-t=\"s\" data-v=\"数量表达式\" id=\"sjs-F10\">数量表达式</td><td data-t=\"s\" data-v=\"面积表达式\" id=\"sjs-G10\">面积表达式</td><td id=\"sjs-H10\"></td><td id=\"sjs-I10\"></td></tr><tr><td id=\"sjs-A11\"></td><td id=\"sjs-B11\"></td><td id=\"sjs-C11\"></td><td id=\"sjs-D11\"></td><td id=\"sjs-E11\"></td><td id=\"sjs-F11\"></td><td id=\"sjs-G11\"></td><td id=\"sjs-H11\"></td><td id=\"sjs-I11\"></td></tr><tr><td id=\"sjs-A12\"></td><td id=\"sjs-B12\"></td><td id=\"sjs-C12\"></td><td id=\"sjs-D12\"></td><td id=\"sjs-E12\"></td><td id=\"sjs-F12\"></td><td id=\"sjs-G12\"></td><td id=\"sjs-H12\"></td><td id=\"sjs-I12\"></td></tr><tr><td id=\"sjs-A13\"></td><td id=\"sjs-B13\"></td><td id=\"sjs-C13\"></td><td id=\"sjs-D13\"></td><td id=\"sjs-E13\"></td><td id=\"sjs-F13\"></td><td id=\"sjs-G13\"></td><td id=\"sjs-H13\"></td><td id=\"sjs-I13\"></td></tr><tr><td id=\"sjs-A14\"></td><td id=\"sjs-B14\"></td><td id=\"sjs-C14\"></td><td id=\"sjs-D14\"></td><td id=\"sjs-E14\"></td><td id=\"sjs-F14\"></td><td id=\"sjs-G14\"></td><td id=\"sjs-H14\"></td><td id=\"sjs-I14\"></td></tr><tr><td id=\"sjs-A15\"></td><td id=\"sjs-B15\"></td><td id=\"sjs-C15\"></td><td id=\"sjs-D15\"></td><td id=\"sjs-E15\"></td><td id=\"sjs-F15\"></td><td id=\"sjs-G15\"></td><td id=\"sjs-H15\"></td><td id=\"sjs-I15\"></td></tr><tr><td id=\"sjs-A16\"></td><td id=\"sjs-B16\"></td><td id=\"sjs-C16\"></td><td id=\"sjs-D16\"></td><td id=\"sjs-E16\"></td><td id=\"sjs-F16\"></td><td id=\"sjs-G16\"></td><td id=\"sjs-H16\"></td><td id=\"sjs-I16\"></td></tr><tr><td id=\"sjs-A17\"></td><td id=\"sjs-B17\"></td><td id=\"sjs-C17\"></td><td id=\"sjs-D17\"></td><td id=\"sjs-E17\"></td><td id=\"sjs-F17\"></td><td id=\"sjs-G17\"></td><td id=\"sjs-H17\"></td><td id=\"sjs-I17\"></td></tr><tr><td id=\"sjs-A18\"></td><td id=\"sjs-B18\"></td><td id=\"sjs-C18\"></td><td id=\"sjs-D18\"></td><td id=\"sjs-E18\"></td><td id=\"sjs-F18\"></td><td id=\"sjs-G18\"></td><td id=\"sjs-H18\"></td><td id=\"sjs-I18\"></td></tr><tr><td id=\"sjs-A19\"></td><td id=\"sjs-B19\"></td><td id=\"sjs-C19\"></td><td id=\"sjs-D19\"></td><td id=\"sjs-E19\"></td><td id=\"sjs-F19\"></td><td id=\"sjs-G19\"></td><td id=\"sjs-H19\"></td><td id=\"sjs-I19\"></td></tr><tr><td colspan=\"5\" id=\"sjs-A20\"></td><td id=\"sjs-F20\"></td><td id=\"sjs-G20\"></td><td id=\"sjs-H20\"></td><td id=\"sjs-I20\"></td></tr><tr><td colspan=\"2\" id=\"sjs-A21\"></td><td colspan=\"2\" id=\"sjs-C21\"></td><td colspan=\"3\" id=\"sjs-E21\"></td><td colspan=\"2\" id=\"sjs-H21\"></td></tr><tr><td id=\"sjs-A22\"></td><td id=\"sjs-B22\"></td><td id=\"sjs-C22\"></td><td id=\"sjs-D22\"></td><td id=\"sjs-E22\"></td><td id=\"sjs-F22\"></td><td id=\"sjs-G22\"></td><td id=\"sjs-H22\"></td><td id=\"sjs-I22\"></td></tr><tr><td id=\"sjs-A23\"></td><td id=\"sjs-B23\"></td><td id=\"sjs-C23\"></td><td id=\"sjs-D23\"></td><td id=\"sjs-E23\"></td><td id=\"sjs-F23\"></td><td id=\"sjs-G23\"></td><td id=\"sjs-H23\"></td><td id=\"sjs-I23\"></td></tr><tr><td id=\"sjs-A24\"></td><td id=\"sjs-B24\"></td><td id=\"sjs-C24\"></td><td id=\"sjs-D24\"></td><td id=\"sjs-E24\"></td><td id=\"sjs-F24\"></td><td id=\"sjs-G24\"></td><td id=\"sjs-H24\"></td><td id=\"sjs-I24\"></td></tr><tr><td id=\"sjs-A25\"></td><td id=\"sjs-B25\"></td><td id=\"sjs-C25\"></td><td id=\"sjs-D25\"></td><td id=\"sjs-E25\"></td><td id=\"sjs-F25\"></td><td id=\"sjs-G25\"></td><td id=\"sjs-H25\"></td><td id=\"sjs-I25\"></td></tr></table></body></html>");
                map.put("plateCount", plateMapper.countPlateByOrderId(orderDO.getId(), SecurityFrameworkUtils.getLoginUser().getOrganId(), deleted));
                break;
            default:
                // 处理默认情况，可以选择忽略或者做其他处理
                break;
        }
        return map;
    }

    public String getRandomNumber(int length) {
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(random.nextInt(10));
        }
        return sb.toString();
    }
}