tangzy
2021-08-09 33d0e27a7eb1ab9b8121f4af1a3681323f01a66d
1.单位导入
10 files modified
6 files added
510 ■■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationController.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/excel/InforExcel.java 98 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/excel/InforImporter.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/controller/MemberController.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/entity/Member.java 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/excel/memberExcel.java 62 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/excel/memberImporter.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/service/IMemberService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/service/impl/MemberServiceImpl.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/excel/shareExcel.java 65 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/excel/shareImporter.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/service/IShareholderService.java 22 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/service/impl/ShareholderServiceImpl.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -28,16 +28,22 @@
import org.springblade.common.utils.arg;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.excel.InforExcel;
import org.springblade.modules.information.excel.InforImporter;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.information.vo.InformationVO;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.excel.UserImporter;
import org.springblade.modules.system.service.IDeptService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.File;
@@ -154,7 +160,7 @@
            information.setDepartmentid(id);
        }
        String json=JSON.toJSONString(information);
        com.util.OutJson.createJsonFile(json,"d:/anbao/information/","informationSave");
        //com.util.OutJson.createJsonFile(json,"d:/anbao/information/","informationSave");
        //arg.test01(arg.url + "/information/save", information);
        return R.status(informationService.save(information));
    }
@@ -263,6 +269,18 @@
        return R.data(list);
    }
    /**
     * 导入单位信息
     */
    @PostMapping("import-informaton")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入单位", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered,String deptid,String jurisdiction) {
        InforImporter inforImporter = new InforImporter(informationService, false,deptid,jurisdiction);
        ExcelUtil.save(file, inforImporter, InforExcel.class);
        return R.success("操作成功");
    }
//    public static void main(String[] args) {
//        Information information = new Information();
//        information.setAddress("2");
src/main/java/org/springblade/modules/information/excel/InforExcel.java
New file
@@ -0,0 +1,98 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.information.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * UserExcel
 *
 * @author Chill
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class InforExcel implements Serializable {
    private static final long serialVersionUID = 1L;
    @ColumnWidth(15)
    @ExcelProperty("统一社会信用代码")
    private String creditcode;
    @ExcelProperty("企业名称")
    private String enterprisename;
    @ColumnWidth(20)
    @ExcelProperty("法定代表人")
    private String representative;
    @ColumnWidth(15)
    @ExcelProperty("成立日期")
    private String establishtime;
    @ColumnWidth(10)
    @ExcelProperty("注册资本")
    private String registeredcapital;
    @ColumnWidth(10)
    @ExcelProperty("实缴资本")
    private String capital;
    @ExcelProperty("组织机构代码")
    private String organizationcode;
    @ColumnWidth(15)
    @ExcelProperty("工商注册号")
    private String registrationnumber;
    @ExcelProperty("纳税人识别号")
    private String identificationnumber;
    @ExcelProperty("企业类型")
    private String enterprises;
    @ExcelProperty("注册地址")
    private String address;
    @ExcelProperty("经营范围")
    private String business;
    @ExcelProperty("所属地区")
    private String region;
    @ExcelProperty("登记机关")
    private String registration;
    @ColumnWidth(20)
    @ExcelProperty("所属行业")
    private String industry;
    @ColumnWidth(20)
    @ExcelProperty("类型")
    private String stats;
}
src/main/java/org/springblade/modules/information/excel/InforImporter.java
New file
@@ -0,0 +1,46 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.information.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.service.IUserService;
import java.util.List;
/**
 * 用户数据导入类
 *
 * @author Chill
 */
@RequiredArgsConstructor
public class InforImporter implements ExcelImporter<InforExcel> {
    private final IInformationService service;
    private final Boolean isCovered;
    private final String deptid;
    private final String jurisdiction;
    @Override
    public void save(List<InforExcel> data) {
        service.importInfor(data, isCovered,deptid,jurisdiction);
    }
}
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -19,7 +19,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.excel.InforExcel;
import org.springblade.modules.information.vo.InformationVO;
import org.springblade.modules.system.excel.UserExcel;
import java.util.List;
import java.util.Map;
@@ -59,4 +61,13 @@
     * @return
     */
    IPage<InformationVO> securityPage(IPage<InformationVO> page, InformationVO information);
    /**
     * 导入单位数据
     *
     * @param data
     * @param isCovered
     * @return
     */
    void importInfor(List<InforExcel> data, Boolean isCovered,String deptid,String jurisdiction);
}
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -18,14 +18,28 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.common.cache.DictCache;
import org.springblade.common.cache.ParamCache;
import org.springblade.common.cache.SysCache;
import org.springblade.common.cache.UserCache;
import org.springblade.common.enums.DictEnum;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.excel.InforExcel;
import org.springblade.modules.information.mapper.InformationMapper;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.information.vo.InformationVO;
import org.springblade.modules.system.entity.User;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD;
/**
 *  服务实现类
@@ -106,4 +120,14 @@
    public IPage<InformationVO> securityPage(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.securityPage(page, information));
    }
    @Override
    public void importInfor(List<InforExcel> data, Boolean isCovered,String deptid,String jurisdiction) {
        data.forEach(InforExcel -> {
            Information information = Objects.requireNonNull(BeanUtil.copy(InforExcel, Information.class));
            information.setDepartmentid(deptid);
            information.setJurisdiction(jurisdiction);
            this.save(information);
        });
    }
}
src/main/java/org/springblade/modules/member/controller/MemberController.java
@@ -24,14 +24,20 @@
import lombok.AllArgsConstructor;
import org.springblade.common.utils.arg;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.member.entity.Member;
import org.springblade.modules.member.excel.memberExcel;
import org.springblade.modules.member.excel.memberImporter;
import org.springblade.modules.member.service.IMemberService;
import org.springblade.modules.member.vo.MemberVO;
import org.springblade.modules.shareholder.excel.shareExcel;
import org.springblade.modules.shareholder.excel.shareImporter;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
@@ -136,4 +142,18 @@
        return R.data(pages);
    }
    /**
     * 导入管理人信息
     */
    @PostMapping("import-member")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入投资人", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered) {
        memberImporter memberImporter = new memberImporter(memberService, false);
        ExcelUtil.save(file, memberImporter, memberExcel.class);
        return R.success("操作成功");
    }
}
src/main/java/org/springblade/modules/member/entity/Member.java
@@ -65,17 +65,12 @@
        @ApiModelProperty(value = "联系电话")
        private String cell;
    /**
    * 持股比例
    */
        @ApiModelProperty(value = "持股比例")
    private String shareholdingratio;
    /**
     * 统一社会信用代码
     */
    @ApiModelProperty(value = "统一社会信用代码")
    @TableField("creditCode")
    private String creditcode;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date rtime;
src/main/java/org/springblade/modules/member/excel/memberExcel.java
New file
@@ -0,0 +1,62 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.member.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
 * UserExcel
 *
 * @author Chill
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class memberExcel implements Serializable {
    private static final long serialVersionUID = 1L;
    @ColumnWidth(15)
    @ExcelProperty("统一社会信用代码")
    private String creditcode;
    @ExcelProperty("姓名")
    private String name;
    @ColumnWidth(20)
    @ExcelProperty("职务")
    private String post;
    @ColumnWidth(15)
    @ExcelProperty("身份证")
    private String cardid;
    @ColumnWidth(10)
    @ExcelProperty("联系电话")
    private String cell;
    @ExcelProperty("入职时间")
    private String rtime;
}
src/main/java/org/springblade/modules/member/excel/memberImporter.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.member.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.member.service.IMemberService;
import org.springblade.modules.shareholder.service.IShareholderService;
import java.util.List;
/**
 * 用户数据导入类
 *
 * @author Chill
 */
@RequiredArgsConstructor
public class memberImporter implements ExcelImporter<memberExcel> {
    private final IMemberService service;
    private final Boolean isCovered;
    @Override
    public void save(List<memberExcel> data) {
        service.importmember(data, isCovered);
    }
}
src/main/java/org/springblade/modules/member/service/IMemberService.java
@@ -19,7 +19,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.member.entity.Member;
import org.springblade.modules.member.excel.memberExcel;
import org.springblade.modules.member.vo.MemberVO;
import org.springblade.modules.shareholder.excel.shareExcel;
import java.util.List;
/**
 *  服务类
@@ -38,4 +42,5 @@
     */
    IPage<MemberVO> selectMemberPage(IPage<MemberVO> page, MemberVO member);
    IPage<MemberVO> selectMemberInfo(IPage<MemberVO> page,String creditcode);
    void importmember(List<memberExcel> data, Boolean isCovered);
}
src/main/java/org/springblade/modules/member/service/impl/MemberServiceImpl.java
@@ -18,11 +18,17 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.member.entity.Member;
import org.springblade.modules.member.excel.memberExcel;
import org.springblade.modules.member.mapper.MemberMapper;
import org.springblade.modules.member.service.IMemberService;
import org.springblade.modules.member.vo.MemberVO;
import org.springblade.modules.shareholder.entity.Shareholder;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
 *  服务实现类
@@ -43,4 +49,12 @@
        return page.setRecords(baseMapper.selectMemberInfo(page,creditcode));
    }
    @Override
    public void importmember(List<memberExcel> data, Boolean isCovered, String deptid, String jurisdiction) {
        data.forEach(memberExcel -> {
            Member member = Objects.requireNonNull(BeanUtil.copy(memberExcel, Member.class));
            this.save(member);
        });
    }
}
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java
@@ -24,14 +24,20 @@
import lombok.AllArgsConstructor;
import org.springblade.common.utils.arg;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.information.excel.InforExcel;
import org.springblade.modules.information.excel.InforImporter;
import org.springblade.modules.shareholder.entity.Shareholder;
import org.springblade.modules.shareholder.excel.shareExcel;
import org.springblade.modules.shareholder.excel.shareImporter;
import org.springblade.modules.shareholder.service.IShareholderService;
import org.springblade.modules.shareholder.vo.ShareholderVO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
@@ -137,5 +143,16 @@
        return R.data(pages);
    }
    /**
     * 导入投资人信息
     */
    @PostMapping("import-share")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入投资人", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered) {
        shareImporter shareImporter = new shareImporter(shareholderService, false);
        ExcelUtil.save(file, shareImporter, shareExcel.class);
        return R.success("操作成功");
    }
}
src/main/java/org/springblade/modules/shareholder/excel/shareExcel.java
New file
@@ -0,0 +1,65 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.shareholder.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
 * UserExcel
 *
 * @author Chill
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class shareExcel implements Serializable {
    private static final long serialVersionUID = 1L;
    @ColumnWidth(15)
    @ExcelProperty("统一社会信用代码")
    private String creditcode;
    @ExcelProperty("股东")
    private String shareholder;
    @ColumnWidth(20)
    @ExcelProperty("持股比例")
    private String shareholdingratio;
    @ColumnWidth(15)
    @ExcelProperty("出资金额")
    private String capital;
    @ColumnWidth(10)
    @ExcelProperty("出资时间")
    private String capitaltime;
    @ColumnWidth(10)
    @ExcelProperty("身份证")
    private String cardid;
    @ExcelProperty("联系电话")
    private String cell;
}
src/main/java/org/springblade/modules/shareholder/excel/shareImporter.java
New file
@@ -0,0 +1,42 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.shareholder.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.modules.shareholder.service.IShareholderService;
import java.util.List;
/**
 * 用户数据导入类
 *
 * @author Chill
 */
@RequiredArgsConstructor
public class shareImporter implements ExcelImporter<shareExcel> {
    private final IShareholderService service;
    private final Boolean isCovered;
    @Override
    public void save(List<shareExcel> data) {
        service.importshare(data, isCovered);
    }
}
src/main/java/org/springblade/modules/shareholder/service/IShareholderService.java
@@ -1,25 +1,12 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.shareholder.service;
package org.springblade.modules.shareholder.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.shareholder.entity.Shareholder;
import org.springblade.modules.shareholder.excel.shareExcel;
import org.springblade.modules.shareholder.vo.ShareholderVO;
import java.util.List;
/**
 *  服务类
@@ -38,4 +25,5 @@
     */
    IPage<ShareholderVO> selectShareholderPage(IPage<ShareholderVO> page, ShareholderVO shareholder);
    IPage<ShareholderVO> selectShareholderInfo(IPage<ShareholderVO> page, String creditcode);
    void importshare(List<shareExcel> data, Boolean isCovered);
}
src/main/java/org/springblade/modules/shareholder/service/impl/ShareholderServiceImpl.java
@@ -18,11 +18,17 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.shareholder.entity.Shareholder;
import org.springblade.modules.shareholder.excel.shareExcel;
import org.springblade.modules.shareholder.mapper.ShareholderMapper;
import org.springblade.modules.shareholder.service.IShareholderService;
import org.springblade.modules.shareholder.vo.ShareholderVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
 *  服务实现类
@@ -43,5 +49,13 @@
        return page.setRecords(baseMapper.selectShareholderInfo(page,creditcode));
    }
    @Override
    public void importshare(List<shareExcel> data, Boolean isCovered) {
        data.forEach(shareExcel -> {
            Shareholder shareholder = Objects.requireNonNull(BeanUtil.copy(shareExcel, Shareholder.class));
            this.save(shareholder);
        });
    }
}