| | |
| | | import org.springblade.modules.shareholder.vo.ShareholderVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | public void importshare(List<shareExcel> data, Boolean isCovered) { |
| | | data.forEach(shareExcel -> { |
| | | Shareholder shareholder = Objects.requireNonNull(BeanUtil.copy(shareExcel, Shareholder.class)); |
| | | try { |
| | | shareholder.setCapitaltime(new SimpleDateFormat("yyyy/MM/dd").parse(shareExcel.getCapitaltime())); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (null!=shareExcel.getCapital() && shareExcel.getCapital()!=""){ |
| | | shareholder.setCapital(shareExcel.getCapital()); |
| | | } |
| | | if (null!=shareExcel.getShareholdingratio() && shareExcel.getShareholdingratio()!=""){ |
| | | shareholder.setShareholdingratio(shareExcel.getShareholdingratio()); |
| | | } |
| | | this.save(shareholder); |
| | | }); |
| | | } |