Merge remote-tracking branch 'origin/master'
4 files modified
2 files added
| | |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.excel.PaperExcel; |
| | | import org.springblade.modules.securitypaper.excel.PaperImporter; |
| | | import org.springblade.modules.securitypaper.excel.SecurityPaperExcel; |
| | | import org.springblade.modules.securitypaper.excel.SecurityPaperImporter; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | |
| | | |
| | | |
| | | /** |
| | | * 导入保安员证数据 |
| | | * 导入保安员证数据(需用户编号,无效保安员身份证号码) |
| | | */ |
| | | @PostMapping("import-security-paper") |
| | | public R importSecurityPaper(MultipartFile file, Integer isCovered, String deptId) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导入保安员证数据(需身份证号码,无需用户编号) |
| | | */ |
| | | @PostMapping("import-paper") |
| | | public R importPaper(MultipartFile file, Integer isCovered) { |
| | | PaperImporter paperImporter = new PaperImporter(securityPaperService, false); |
| | | ExcelUtil.save(file, paperImporter, PaperExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("export-template-security-paper") |
| New file |
| | |
| | | |
| | | package org.springblade.modules.securitypaper.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 PaperExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("姓名*") |
| | | private String realName; |
| | | |
| | | |
| | | @ExcelProperty("身份证号*") |
| | | @ColumnWidth(20) |
| | | private String cardid; |
| | | |
| | | |
| | | @ExcelProperty("保安员证编号*") |
| | | @ColumnWidth(15) |
| | | private String number; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.securitypaper.excel; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 保安员证数据数据导入类 |
| | | * |
| | | * @author zhongrj |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class PaperImporter implements ExcelImporter<PaperExcel> { |
| | | |
| | | private final SecurityPaperService service; |
| | | private final Boolean isCovered; |
| | | |
| | | @Override |
| | | public void save(List<PaperExcel> data) { |
| | | service.importPaper(data, isCovered); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.excel.PaperExcel; |
| | | import org.springblade.modules.securitypaper.excel.SecurityPaperExcel; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param deptId |
| | | */ |
| | | void importSecurityPaper(List<SecurityPaperExcel> data, Boolean isCovered, String deptId); |
| | | |
| | | /** |
| | | * 批量导入证件数据 |
| | | * @param data |
| | | * @param isCovered |
| | | */ |
| | | void importPaper(List<PaperExcel> data, Boolean isCovered); |
| | | } |
| | |
| | | import org.springblade.modules.FTP.Result; |
| | | import org.springblade.modules.exam.entity.ExamScore; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.excel.PaperExcel; |
| | | import org.springblade.modules.securitypaper.excel.SecurityPaperExcel; |
| | | import org.springblade.modules.securitypaper.mapper.SecurityPaperMapper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量导入证件数据 |
| | | * @param data |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | public void importPaper(List<PaperExcel> data, Boolean isCovered) { |
| | | if (data.size()>0){ |
| | | for (PaperExcel paperExcel : data) { |
| | | //设置信息 |
| | | String sql = "insert into sys_security_paper(number,create_time,people_name,id_card_no,source) " + |
| | | "values(" + "'" + paperExcel.getNumber() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," + |
| | | "'" + paperExcel.getRealName() + "'" + "," + |
| | | "'" + paperExcel.getCardid() + "'" + ",3)"; |
| | | System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "保安员证编号导入sql = " + sql); |
| | | //数据推送 |
| | | myAsyncService.FTP(sql); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | "values(" + "'" + experience.getId() + "'" + "," + |
| | | "'" + experience.getName() + "'" + "," + |
| | | "'" + experience.getPost() + "'" + "," + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" + |
| | | "," + "'" + experience.getCardid() + "'" + |
| | | "," + "'" + experience.getCompanyname() + "'" + |
| | | "," + "'" + experience.getSecurityid() + "'" |
| | |
| | | |
| | | //内网同步 |
| | | String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " + |
| | | "values(" + "'" + experience.getId() + "'" + "," + |
| | | "'" + experience.getName() + "'" + "," + |
| | | "values(" + "'" + experience.getId() + "'" + |
| | | "," + "'" + experience.getName() + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" + |
| | | "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getDeparturetime()) + "'" + |
| | | "," + "'" + experience.getLeaving() + "'" + |