| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.excel.SecurityPaperExcel; |
| | | import org.springblade.modules.securitypaper.mapper.SecurityPaperMapper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 保安员证管理服务实现类 |
| | |
| | | @AllArgsConstructor |
| | | public class SecurityPaperServiceImpl extends ServiceImpl<SecurityPaperMapper, SecurityPaper> implements SecurityPaperService { |
| | | |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 导入保安员证数据 |
| | | * @param data |
| | | * @param isCovered |
| | | * @param deptId |
| | | */ |
| | | @Override |
| | | public void importSecurityPaper(List<SecurityPaperExcel> data, Boolean isCovered, String deptId) { |
| | | data.forEach(securityPaperExcel -> { |
| | | String sql = "insert into sys_security_paper(number,create_time,people_name,id_card_no,source) " + |
| | | "values(" + "'" + securityPaperExcel.getSecuritynumber() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + |
| | | "," + "'" + securityPaperExcel.getRealName() + "'" + |
| | | "," + "'" + securityPaperExcel.getCardid() + "'" + |
| | | "," + "'" + 3 + "'" |
| | | + ")"; |
| | | myAsyncService.FTP(sql); |
| | | }); |
| | | } |
| | | } |