diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/ComprehensiveController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/ComprehensiveController.java new file mode 100644 index 0000000..a990df7 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/ComprehensiveController.java @@ -0,0 +1,86 @@ +package com.bonus.tool.controller.search; + +import com.bonus.common.core.controller.BaseController; +import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.core.page.TableDataInfo; +import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.tool.dto.TbCompanyPerfVo; +import com.bonus.tool.dto.TbPeopleVo; +import com.bonus.tool.service.ComprehensiveService; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * @author 马三炮 + * @date 2025/10/14 + * 综合查询 + */ +@RestController +@Slf4j +@RequestMapping("/comprehensive") +public class ComprehensiveController extends BaseController { + + @Resource + private ComprehensiveService comprehensiveService; + + /** + * 列表查询 + * @param + * @return + */ + @ApiOperation(value = "列表查询") + @GetMapping("/getPeopleAllList") + public TableDataInfo getPeopleAllList(TbPeopleVo tbPeopleVo) { + try { + startPage(); + List tbCompanyPerfList = comprehensiveService.getPeopleAllList(tbPeopleVo); + return getDataTable(tbCompanyPerfList); + }catch (Exception e){ + log.info("列表查询失败{}",e.getMessage()); + return getDataTableError(null); + } + } + + /** + * 详情查询 + * @param + * @return + */ + @ApiOperation(value = "详情查询") + @GetMapping("/getPeopleDetail") + public AjaxResult getPeopleDetail(TbPeopleVo tbPeopleVo) { + try { + TbPeopleVo TbPeopleVo = comprehensiveService.getPeopleDetail(tbPeopleVo); + return success(TbPeopleVo); + }catch (Exception e){ + log.info("详情查询失败{}",e.getMessage()); + return error("详情查询失败"); + } + } + + /** + * 列表查询导出 + * @param + * @return + */ + @ApiOperation(value = "列表查询导出") + @PostMapping("/peopleAllExport") + public void tbCompanyPerfExport(HttpServletResponse response, TbPeopleVo tbPeopleVo) { + try { + List tbCompanyPerfList = comprehensiveService.getPeopleAllList(tbPeopleVo); + ExcelUtil util = new ExcelUtil<>(TbPeopleVo.class); + util.exportExcel(response, tbCompanyPerfList, "综合查询"); + }catch (Exception e){ + log.info("导出失败{}",e.getMessage()); + } + } + +} diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbCompanyPerfController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbCompanyPerfController.java index 1ac32b7..b7f8d84 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbCompanyPerfController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbCompanyPerfController.java @@ -4,11 +4,14 @@ import com.bonus.common.core.controller.BaseController; import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.tool.dto.TbCertificationVo; import com.bonus.tool.dto.TbCompanyPerfVo; +import com.bonus.tool.dto.TbKeyPeopleVo; import com.bonus.tool.service.TbCompanyPerfService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -153,5 +156,37 @@ public class TbCompanyPerfController extends BaseController { } } - + /** + * 公司业绩导入 + * @param + * @return + */ + @ApiOperation(value = "公司业绩导入") +// @PreAuthorize("@ss.hasPermi('key:people:del')") + @PostMapping("/tbCompanyPerfImport") + public AjaxResult tbCompanyPerfImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("公司业绩")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbCompanyPerfVo.class); + List tbCompanyPerfList = util.importExcel(file.getInputStream()); + String message = tbCompanyPerfService.tbCompanyPerfImport(tbCompanyPerfList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbKeyPeopleController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbKeyPeopleController.java index 51c6225..e98821c 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbKeyPeopleController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbKeyPeopleController.java @@ -6,16 +6,19 @@ import com.bonus.common.core.controller.BaseController; import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.tool.dto.TbCertificationVo; import com.bonus.tool.dto.TbKeyPeopleVo; import com.bonus.tool.service.TbKeyPeopleServcie; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; /** @@ -158,4 +161,42 @@ public class TbKeyPeopleController extends BaseController { } } + /** + * 关键人员导入 + * @param + * @return + */ + @ApiOperation(value = "关键人员导入") +// @PreAuthorize("@ss.hasPermi('key:people:del')") + @PostMapping("/tbKeyPeopleImport") + public AjaxResult tbKeyPeopleImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("项目关键人员")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbKeyPeopleVo.class); + List tbKeyPeopleList = util.importExcel(file.getInputStream()); + //获取证书 + ExcelUtil tbCertificationUtil = new ExcelUtil<>(TbCertificationVo.class); + List tbCertificationList = tbCertificationUtil.importExcel("证书",file.getInputStream(),0); + + String message = tbKeyPeopleServcie.tbKeyPeopleImport(tbKeyPeopleList,tbCertificationList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } + } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbOtherPeopleController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbOtherPeopleController.java index 4181c49..88416a6 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbOtherPeopleController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbOtherPeopleController.java @@ -4,11 +4,14 @@ import com.bonus.common.core.controller.BaseController; import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.tool.dto.TbCertificationVo; +import com.bonus.tool.dto.TbKeyPeopleVo; import com.bonus.tool.dto.TbOtherPeopleVo; import com.bonus.tool.service.TbOtherPeopleService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -119,11 +122,11 @@ public class TbOtherPeopleController extends BaseController { } /** - * 关键人员导出 + * 其他人员导出 * @param * @return */ - @ApiOperation(value = "关键人员导出") + @ApiOperation(value = "其他人员导出") // @PreAuthorize("@ss.hasPermi('key:people:del')") @PostMapping("/tbOtherPeopleExport") public void tbOtherPeopleExport(HttpServletResponse response, TbOtherPeopleVo tbOtherPeopleVo) { @@ -135,4 +138,42 @@ public class TbOtherPeopleController extends BaseController { log.info("导出失败{}",e.getMessage()); } } + + /** + * 其他人员导入 + * @param + * @return + */ + @ApiOperation(value = "其他人员导入") +// @PreAuthorize("@ss.hasPermi('key:people:del')") + @PostMapping("/tbOtherPeopleImport") + public AjaxResult tbOtherPeopleImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("项目其他人员")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbOtherPeopleVo.class); + List tbOtherPeopleList = util.importExcel(file.getInputStream()); + //获取证书 + ExcelUtil tbCertificationUtil = new ExcelUtil<>(TbCertificationVo.class); + List tbCertificationList = tbCertificationUtil.importExcel("证书",file.getInputStream(),0); + + String message = tbOtherPeopleService.tbOtherPeopleImport(tbOtherPeopleList,tbCertificationList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubController.java index f969ee9..0b9553d 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubController.java @@ -4,11 +4,13 @@ import com.bonus.common.core.controller.BaseController; import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.tool.dto.TbCompanyPerfVo; import com.bonus.tool.dto.TbSubVo; import com.bonus.tool.service.TbSubService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -149,8 +151,42 @@ public class TbSubController extends BaseController { List tbSubVoList = tbSubService.getTbSubList(tbSubVo); return getDataTable(tbSubVoList); }catch (Exception e){ - log.info("分包商列表失败{}",e.getMessage()); + log.info("分包商列表所有失败{}",e.getMessage()); return getDataTableError(null); } } + + /** + * 分包商导入 + * @param + * @return + */ + @ApiOperation(value = "分包商导入") + // @PreAuthorize("@ss.hasPermi('key:people:list')") + @PostMapping("/tbSubImport") + public AjaxResult tbSubImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("分包商管理")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbSubVo.class); + List tbSubList = util.importExcel(file.getInputStream()); + String message = tbSubService.tbSubImport(tbSubList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPeopleController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPeopleController.java index cafa122..c5bbf1a 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPeopleController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPeopleController.java @@ -5,10 +5,12 @@ import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; import com.bonus.tool.dto.TbSubPeopleVo; +import com.bonus.tool.dto.TbSubVo; import com.bonus.tool.service.TbSubPeopleService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -154,4 +156,38 @@ public class TbSubPeopleController extends BaseController { log.info("导出失败{}",e.getMessage()); } } + + /** + * 分包商人员信息导入 + * @param + * @return + */ + @ApiOperation(value = "分包商人员信息导入") + // @PreAuthorize("@ss.hasPermi('key:people:list')") + @PostMapping("/tbSubPeopleImport") + public AjaxResult tbSubPeopleImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("分包人员管理")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbSubPeopleVo.class); + List tbSubPeopleList = util.importExcel(file.getInputStream()); + String message = tbSubPeopleService.tbSubPeopleImport(tbSubPeopleList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPerfController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPerfController.java index eb7a751..a1a5c0a 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPerfController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/TbSubPerfController.java @@ -5,11 +5,13 @@ import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.common.utils.poi.ExcelUtil; import com.bonus.tool.dto.TbCompanyPerfVo; +import com.bonus.tool.dto.TbSubPeopleVo; import com.bonus.tool.dto.TbSubPerfVo; import com.bonus.tool.service.TbSubPerfService; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -154,4 +156,38 @@ public class TbSubPerfController extends BaseController { } } + /** + * 分包业绩导入 + * @param + * @return + */ + @ApiOperation(value = "分包业绩导入") + // @PreAuthorize("@ss.hasPermi('key:people:list')") + @PostMapping("/tbSubPerfImport") + public AjaxResult tbSubPerfImport(MultipartFile file){ + try { + String fileName = file.getOriginalFilename(); + if (fileName != null) { + String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); + long fileSize = file.getSize(); + if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) { + // 文件后缀名不符合要求 + return error("文件后缀名不符合要求"); + } else if (fileSize > 10 * 1024 * 1024) { + // 文件大小超过10M + return error("文件大小超过10M"); + } else if(!fileName.contains("分包商业绩管理")){ + return error("请上传正确的模板"); + } + } + //获取人员信息 + ExcelUtil util = new ExcelUtil<>(TbSubPerfVo.class); + List tbSubPerfList = util.importExcel(file.getInputStream()); + String message = tbSubPerfService.tbSubPerfImport(tbSubPerfList); + return success(message); + }catch (Exception e){ + return error("导入失败"); + } + } + } diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java index 7447408..bb6bb43 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java @@ -1,5 +1,6 @@ package com.bonus.tool.dto; +import com.bonus.common.annotation.Excel; import lombok.Data; import java.util.List; @@ -27,20 +28,29 @@ public class TbCertificationVo { */ private Long tableId; + /** + * 姓名 + */ + @Excel(name = "姓名", sort = 1) + private String userName; + /** * 资格证书 */ + @Excel(name = "资格证书名称", sort = 2) private String diploma; /** * 证书编号 */ + @Excel(name = "编号", sort = 3) private String diplomaNum; /** * 级别 */ + @Excel(name = "级别", sort = 4) private String level; /*** diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbCompanyPerfVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbCompanyPerfVo.java index 25faa66..e02482c 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbCompanyPerfVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbCompanyPerfVo.java @@ -64,9 +64,9 @@ public class TbCompanyPerfVo { private String stopTime; /** - * 变电站座数 + * 变电站规模 */ - @Excel(name = "变电站座数", sort = 6) + @Excel(name = "变电站规模", sort = 6) private String stationNum; /** @@ -75,24 +75,50 @@ public class TbCompanyPerfVo { @Excel(name = "线路建设规模(折单公里)", sort = 7) private String lineScale; + /** + *合同金额(万元) + */ + @Excel(name = "合同金额(万元)", sort = 8) + private BigDecimal money; + /** * 承包范围 */ - @Excel(name = "承包范围", sort = 8) + @Excel(name = "承包范围", sort = 9) private String contractRang; + /** + * 项目所在地 + */ + @Excel(name = "项目所在地", sort = 10) + private String projectLocation; + + /** + *工程质量 + */ + @Excel(name = "工程质量", sort = 11) + private String engineeringQuality; + /** * 业主单位 */ - @Excel(name = "业主单位", sort = 9) + @Excel(name = "业主单位", sort = 12) private String ownerUnit; /** - * 业主联系方式 + * 业主单位联系方式 */ - @Excel(name = "业主联系方式", sort = 10) + @Excel(name = "业主单位联系方式", sort = 13) private String ownerPhone; + + /** + * 业主单位地址 + */ + @Excel(name = "业主单位地址", sort = 13) + private String ownerLocation; + + /** * 创建时间 */ @@ -133,20 +159,6 @@ public class TbCompanyPerfVo { private Long perfId; - /** - *合同金额(万元) - */ - private BigDecimal money; - - /** - * 项目所在地 - */ - private String projectLocation; - - /** - *工程质量 - */ - private String engineeringQuality; /** * 技术负责人 @@ -156,25 +168,29 @@ public class TbCompanyPerfVo { /** * 监理工程师 */ + @Excel(name = "总监理工程师及电话", sort = 14) private String supervisingEngineer; - /** - * 业主单位地址 - */ - private String ownerLocation; - /** * 备注 */ + @Excel(name = "备注", sort = 15) private String remark; /** * 项目概况 */ + @Excel(name = "项目概况", sort = 16) private String projectSituation; /** * 项目概况 */ private String workContent; + + + /** + * 职务 + */ + private String title; } diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java index e7a2066..dd57570 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java @@ -117,6 +117,11 @@ public class TbKeyPeopleVo { */ private String updateUser; + /** + * 是否在用0 在用 1不在用 + */ + private String used; + /** *资格证书集合 */ diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java index 592b6a7..cd1816a 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java @@ -105,6 +105,11 @@ public class TbOtherPeopleVo { */ private String updateUser; + /** + * 是否在用0 在用 1不在用 + */ + private String used; + /** *资格证书集合 */ diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbPeopleVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbPeopleVo.java new file mode 100644 index 0000000..4e775c0 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbPeopleVo.java @@ -0,0 +1,116 @@ +package com.bonus.tool.dto; + +import com.bonus.common.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +/** + * @author 马三炮 + * @date 2025/4/21 + */ +@Data +public class TbPeopleVo { + + /** + * 主键 + */ + private Long id; + + /** + * 姓名 + */ + @Excel(name = "姓名", sort = 1) + private String userName; + + /** + * 身份证 + */ + @Excel(name = "身份证", sort = 2) + private String idCard; + + /** + * 学历 + */ + @Excel(name = "学历", sort = 3) + private String education; + + + /** + * 职称 + */ + @Excel(name = "职称", sort = 4) + private String title; + + /** + * 职务 + */ + @Excel(name = "职务", sort = 5) + private String position; + + + /** + * 专业 + */ + @Excel(name = "专业", sort = 6) + private String major; + + /** + * 是否在用0 在用 1不在用 + */ + @Excel(name = "是否在用", sort = 7, readConverterExp = "0=在用,1=不在用") + private String used; + + /** + * 人员类型 + */ + @Excel(name = "人员类型", sort = 8) + private String peopleType; + + /** + * 工程名称 + */ + private String proName; + + /** + * 电压等级 + */ + private String voltage; + + /** + * 资格证书 + */ + private String diploma; + + /** + * 开始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private String startTime; + + /** + * 结束时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private String endTime; + + /** + *资格证书集合 + */ + private List certificateList; + + /** + * 业绩集合 + */ + private List tbCompanyPerfList; + + /*** + * 附件集合 + */ + private List tbFileSourceVoList; +} diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbSubPerfVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbSubPerfVo.java index 12a2bc0..80d85cc 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbSubPerfVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbSubPerfVo.java @@ -26,6 +26,12 @@ public class TbSubPerfVo { */ private Long subId; + /** + * 分包商名称 + */ + @Excel(name = "所属分包商", sort = 0) + private String subName; + /** * 项目名称 */ diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbSubVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbSubVo.java index eac48d0..25efab5 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbSubVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbSubVo.java @@ -32,9 +32,9 @@ public class TbSubVo { private String address; /** - * 负责人 + * 法定代表人 */ - @Excel(name = "负责人", sort = 2) + @Excel(name = "法定代表人", sort = 2) private String userName; /** diff --git a/search-tool/src/main/java/com/bonus/tool/mapper/ComprehensiveMapper.java b/search-tool/src/main/java/com/bonus/tool/mapper/ComprehensiveMapper.java new file mode 100644 index 0000000..e0b619b --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/mapper/ComprehensiveMapper.java @@ -0,0 +1,12 @@ +package com.bonus.tool.mapper; + +import com.bonus.tool.dto.TbCompanyPerfVo; +import com.bonus.tool.dto.TbPeopleVo; + +import java.util.List; + +public interface ComprehensiveMapper { + List getPeopleAllList(TbPeopleVo tbPeopleVo); + + List getPeopleDetail(TbPeopleVo tbPeopleVo); +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/ComprehensiveService.java b/search-tool/src/main/java/com/bonus/tool/service/ComprehensiveService.java new file mode 100644 index 0000000..fb22a08 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/service/ComprehensiveService.java @@ -0,0 +1,22 @@ +package com.bonus.tool.service; + +import com.bonus.tool.dto.TbPeopleVo; + +import java.util.List; + +public interface ComprehensiveService { + + /** + * 列表查询 + * @param + * @return + */ + List getPeopleAllList(TbPeopleVo tbPeopleVo); + + /** + * 详情查询 + * @param + * @return + */ + TbPeopleVo getPeopleDetail(TbPeopleVo tbPeopleVo); +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbCompanyPerfService.java b/search-tool/src/main/java/com/bonus/tool/service/TbCompanyPerfService.java index d27c974..b7817de 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbCompanyPerfService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbCompanyPerfService.java @@ -46,4 +46,11 @@ public interface TbCompanyPerfService { * @return */ List getTbCompanyPerfListByPersonId(TbCompanyPerfVo tbCompanyPerfVo); + + /** + * 公司业绩导入 + * @param tbCompanyPerfList + * @return + */ + String tbCompanyPerfImport(List tbCompanyPerfList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbKeyPeopleServcie.java b/search-tool/src/main/java/com/bonus/tool/service/TbKeyPeopleServcie.java index c3bd109..63e0e0f 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbKeyPeopleServcie.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbKeyPeopleServcie.java @@ -2,6 +2,7 @@ package com.bonus.tool.service; +import com.bonus.tool.dto.TbCertificationVo; import com.bonus.tool.dto.TbKeyPeopleVo; import java.util.List; @@ -40,4 +41,12 @@ public interface TbKeyPeopleServcie { * @param tbKeyPeopleVo */ void delTbKeyPeople(TbKeyPeopleVo tbKeyPeopleVo) throws Exception; + + /** + * 关键人员导入 + * @param tbKeyPeopleList + * @param tbCertificationList + * @return + */ + String tbKeyPeopleImport(List tbKeyPeopleList, List tbCertificationList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbOtherPeopleService.java b/search-tool/src/main/java/com/bonus/tool/service/TbOtherPeopleService.java index 5a726c9..f9de943 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbOtherPeopleService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbOtherPeopleService.java @@ -1,5 +1,6 @@ package com.bonus.tool.service; +import com.bonus.tool.dto.TbCertificationVo; import com.bonus.tool.dto.TbOtherPeopleVo; import java.util.List; @@ -38,4 +39,12 @@ public interface TbOtherPeopleService { * @return */ void delTbOtherPeople(TbOtherPeopleVo tbOtherPeopleVo) throws Exception; + + /** + * 其他人员导入 + * @param tbOtherPeopleList + * @param tbCertificationList + * @return + */ + String tbOtherPeopleImport(List tbOtherPeopleList, List tbCertificationList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbSubPeopleService.java b/search-tool/src/main/java/com/bonus/tool/service/TbSubPeopleService.java index c9ccd30..4d91089 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbSubPeopleService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbSubPeopleService.java @@ -39,4 +39,11 @@ public interface TbSubPeopleService { * @return */ void delTbSubPeople(TbSubPeopleVo tbSubPeopleVo) throws Exception; + + /** + * 分包商人员信息导入 + * @param tbSubPeopleList + * @return + */ + String tbSubPeopleImport(List tbSubPeopleList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbSubPerfService.java b/search-tool/src/main/java/com/bonus/tool/service/TbSubPerfService.java index fba776b..3aff618 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbSubPerfService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbSubPerfService.java @@ -41,4 +41,11 @@ public interface TbSubPerfService { void delTbSubPerf(TbSubPerfVo tbSubPerfVo) throws Exception; List getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo); + + /** + * 分包业绩导入 + * @param tbSubPerfList + * @return + */ + String tbSubPerfImport(List tbSubPerfList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbSubService.java b/search-tool/src/main/java/com/bonus/tool/service/TbSubService.java index d9b1f80..4972e84 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/TbSubService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/TbSubService.java @@ -39,4 +39,11 @@ public interface TbSubService { * @return */ void delTbSub(TbSubVo tbSubVo) throws Exception; + + /** + * 分包商导入 + * @param tbSubList + * @return + */ + String tbSubImport(List tbSubList); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/ComprehensiveServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/ComprehensiveServiceImpl.java new file mode 100644 index 0000000..18b501a --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/ComprehensiveServiceImpl.java @@ -0,0 +1,74 @@ +package com.bonus.tool.service.impl; + +import com.bonus.common.enums.TableType; +import com.bonus.tool.dto.TbCertificationVo; +import com.bonus.tool.dto.TbCompanyPerfVo; +import com.bonus.tool.dto.TbFileSourceVo; +import com.bonus.tool.dto.TbPeopleVo; +import com.bonus.tool.mapper.ComprehensiveMapper; +import com.bonus.tool.service.ComprehensiveService; +import com.bonus.tool.service.TbCertificationService; +import com.bonus.tool.service.TbFileSourceService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author 马三炮 + * @date 2025/10/14 + */ +@Service +@Slf4j +public class ComprehensiveServiceImpl implements ComprehensiveService { + + @Resource + private ComprehensiveMapper comprehensiveMapper; + + @Resource + private TbCertificationService tbCertificationService; + + @Resource + private TbFileSourceService tbFileSourceService; + + /** + * 列表查询 + * @param + * @return + */ + @Override + public List getPeopleAllList(TbPeopleVo tbPeopleVo) { + return comprehensiveMapper.getPeopleAllList(tbPeopleVo); + } + + /** + * 详情查询 + * @param + * @return + */ + @Override + public TbPeopleVo getPeopleDetail(TbPeopleVo tbPeopleVo) { + //判断是关键人员还是其他人员 + if("项目关键人员".equals(tbPeopleVo.getPeopleType())){ + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode()); + tbPeopleVo.setCertificateList(certificateList); + //获取业绩信息 + List tbCompanyPerfVoList = comprehensiveMapper.getPeopleDetail(tbPeopleVo); + if (tbCompanyPerfVoList.size()>0){ + for (TbCompanyPerfVo tbCompanyPerf:tbCompanyPerfVoList) { + //获取附件信息 + List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbCompanyPerf.getId(), TableType.TB_COMPANY_PERF.getCode()); + tbCompanyPerf.setTbFileSourceVoList(tbFileSourceVoList); + } + } + tbPeopleVo.setTbCompanyPerfList(tbCompanyPerfVoList); + } else if ("项目其他人员".equals(tbPeopleVo.getPeopleType())) { + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode()); + tbPeopleVo.setCertificateList(certificateList); + } + return tbPeopleVo; + } +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java index 98b28a8..c90d6fe 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java @@ -382,20 +382,21 @@ public class StateGridServiceImpl implements StateGridService { //项目关键人员 - if (tbData.getComCoreList() != null && !tbData.getComCoreList().isEmpty()) { + if (tbData.getComCoreList() != null && StringUtils.isNotEmpty(tbData.getComCoreList())) { for (ComCorePersonBean item : tbData.getComCoreList()) { if(!("项目经理".equals(item.getPostName()) || "项目负责人".equals(item.getPostName()))){ continue; } + // 【拟投入项目经理(项目负责人)一览表】 Map map = new HashMap<>(); map.put("bName", ""); // 标的名称 - map.put("bdName", !item.getPeoplePerfList().isEmpty() ? item.getPeoplePerfList().get(0).getProName() : ""); // 标段名称 + map.put("bdName", StringUtils.isNotEmpty(item.getPeoplePerfList()) ? item.getPeoplePerfList().get(0).getProName() : ""); // 标段名称 map.put("proManager", item.getUserName() != null ? item.getUserName() : ""); // 项目经理 - map.put("aqCode", !item.getCertList().isEmpty() && item.getCertList().size() > 1 ? item.getCertList().get(1).getDiploma()+item.getCertList().get(1).getDiplomaNum() : ""); // 安全生产考核合格证(B 类)编号 + map.put("aqCode", StringUtils.isNotEmpty(item.getCertList()) && item.getCertList().size() > 1 ? item.getCertList().get(1).getDiploma()+item.getCertList().get(1).getDiplomaNum() : ""); // 安全生产考核合格证(B 类)编号 //默认取第一个证书 - map.put("zcCode", !item.getCertList().isEmpty() ? item.getCertList().get(0).getDiploma()+item.getCertList().get(0).getDiplomaNum() : ""); // 注册证书及注册编号 + map.put("zcCode", StringUtils.isNotEmpty(item.getCertList()) ? item.getCertList().get(0).getDiploma()+item.getCertList().get(0).getDiplomaNum() : ""); // 注册证书及注册编号 map.put("zcMajor", item.getMajor() != null ? item.getMajor() : ""); // 注册专业 list6.add(map); diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbCompanyPerfServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbCompanyPerfServiceImpl.java index 9c5b65f..08e9dbd 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbCompanyPerfServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbCompanyPerfServiceImpl.java @@ -5,10 +5,7 @@ import com.bonus.common.exception.ServiceException; import com.bonus.common.utils.SecurityUtils; import com.bonus.common.utils.StringUtils; import com.bonus.system.service.ISysFileService; -import com.bonus.tool.dto.ComPerformanceBean; -import com.bonus.tool.dto.TbCompanyPerfRelVo; -import com.bonus.tool.dto.TbCompanyPerfVo; -import com.bonus.tool.dto.TbFileSourceVo; +import com.bonus.tool.dto.*; import com.bonus.tool.mapper.StateGridMapper; import com.bonus.tool.mapper.TbCompanyPerfMapper; import com.bonus.tool.service.TbCompanyPerfRelService; @@ -19,6 +16,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -189,6 +187,23 @@ public class TbCompanyPerfServiceImpl implements TbCompanyPerfService { return tbCompanyPerfMapper.getTbCompanyPerfListByPersonId(tbCompanyPerfVo); } + /** + * 公司业绩导入 + * @param tbCompanyPerfList + * @return + */ + @Override + @Transactional + public String tbCompanyPerfImport(List tbCompanyPerfList) { + //判断导入人员不为空 + if (!tbCompanyPerfList.isEmpty()){ + for (TbCompanyPerfVo tbCompanyPerfVo:tbCompanyPerfList) { + this.addTbCompanyPerf(tbCompanyPerfVo); + } + } + return "导入成功"; + } + /** * 删除关键人服务器图片 * @param tbCompanyPerfRelList diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java index 0238ba0..a597be2 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java @@ -69,7 +69,7 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { if (tbKeyPeopleVoList.size()>0){ for (TbKeyPeopleVo tbKeyPeople: tbKeyPeopleVoList) { //身份证脱敏 - tbKeyPeople.setIdCard(StringUtils.desensitizeIdCard(tbKeyPeople.getIdCard())); + //tbKeyPeople.setIdCard(StringUtils.desensitizeIdCard(tbKeyPeople.getIdCard())); //获取资格证书信息 List certificateList = tbCertificationService.getTbCertificateList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode()); tbKeyPeople.setCertificateList(certificateList); @@ -133,7 +133,7 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { @Transactional public void updateTbKeyPeople(TbKeyPeopleVo tbKeyPeopleVo) { TbKeyPeopleVo tbKeyPeopleOld = tbKeyPeopleMapper.getTbKeyPeopleByIdCard(tbKeyPeopleVo); - if (StringUtils.isNotNull(tbKeyPeopleOld) && tbKeyPeopleOld.getId()!=tbKeyPeopleVo.getId()){ + if (StringUtils.isNotNull(tbKeyPeopleOld) && !tbKeyPeopleOld.getId().equals(tbKeyPeopleVo.getId())){ throw new ServiceException("身份证已存在"); } tbKeyPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername()); @@ -194,4 +194,30 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { //删除附件信息表中信息 tbFileSourceService.delTbFileSource(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); } + + /** + * 关键人员导入 + * @param tbKeyPeopleList + * @param tbCertificationList + * @return + */ + @Override + @Transactional + public String tbKeyPeopleImport(List tbKeyPeopleList, List tbCertificationList) { + //判断导入人员不为空 + if (!tbKeyPeopleList.isEmpty()){ + for (TbKeyPeopleVo tbKeyPeopleVo:tbKeyPeopleList) { + List tbCertificationListNew = new ArrayList<>(); + for (TbCertificationVo tbCertificationVo:tbCertificationList) { + //判断导入的证件号和导入的关键人员是否匹配 + if (tbKeyPeopleVo.getUserName().equals(tbCertificationVo.getUserName())){ + tbCertificationListNew.add(tbCertificationVo); + } + } + tbKeyPeopleVo.setCertificateList(tbCertificationListNew); + this.addTbKeyPeople(tbKeyPeopleVo); + } + } + return "导入成功"; + } } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java index e6aa01e..1e95403 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java @@ -64,7 +64,7 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { List tbOtherPeopleVoList = tbOtherPeopleMapper.getTbOtherPeopleList(tbOtherPeopleVo); if (tbOtherPeopleVoList.size()>0){ for (TbOtherPeopleVo tbOtherPeople: tbOtherPeopleVoList) { - tbOtherPeople.setIdCard(StringUtils.desensitizeIdCard(tbOtherPeople.getIdCard())); + //tbOtherPeople.setIdCard(StringUtils.desensitizeIdCard(tbOtherPeople.getIdCard())); //获取资格证书信息 List certificateList = tbCertificationService.getTbCertificateList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode()); tbOtherPeople.setCertificateList(certificateList); @@ -124,7 +124,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { @Transactional public void updateTbOtherPeople(TbOtherPeopleVo tbOtherPeopleVo) { TbOtherPeopleVo tbOtherPeopleOld = tbOtherPeopleMapper.getTbOtherPeopleByIdCard(tbOtherPeopleVo); - if (StringUtils.isNotNull(tbOtherPeopleOld) && tbOtherPeopleVo.getId()!=tbOtherPeopleOld.getId()){ + log.info("查询对象为{}",tbOtherPeopleOld); + if (StringUtils.isNotNull(tbOtherPeopleOld) && !tbOtherPeopleVo.getId().equals(tbOtherPeopleOld.getId())){ throw new ServiceException("身份证已存在"); } tbOtherPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername()); @@ -180,4 +181,30 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { //删除附件信息表中信息 tbFileSourceService.delTbFileSource(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); } + + /** + * 其他人员导入 + * @param tbOtherPeopleList + * @param tbCertificationList + * @return + */ + @Override + @Transactional + public String tbOtherPeopleImport(List tbOtherPeopleList, List tbCertificationList) { + //判断导入人员不为空 + if (!tbOtherPeopleList.isEmpty()){ + for (TbOtherPeopleVo tbOtherPeopleVo:tbOtherPeopleList) { + List tbCertificationListNew = new ArrayList<>(); + for (TbCertificationVo tbCertificationVo:tbCertificationList) { + //判断导入的证件号和导入的关键人员是否匹配 + if (tbOtherPeopleVo.getUserName().equals(tbCertificationVo.getUserName())){ + tbCertificationListNew.add(tbCertificationVo); + } + } + tbOtherPeopleVo.setCertificateList(tbCertificationListNew); + this.addTbOtherPeople(tbOtherPeopleVo); + } + } + return "导入成功"; + } } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPeopleServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPeopleServiceImpl.java index bb149bf..6c4d7db 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPeopleServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPeopleServiceImpl.java @@ -6,16 +6,14 @@ import com.bonus.common.utils.SecurityUtils; import com.bonus.common.utils.StringUtils; import com.bonus.system.service.ISysFileService; import com.bonus.tool.dto.*; -import com.bonus.tool.mapper.EpcMapper; -import com.bonus.tool.mapper.SouthMapper; -import com.bonus.tool.mapper.StateGridMapper; -import com.bonus.tool.mapper.TbSubPeopleMapper; +import com.bonus.tool.mapper.*; import com.bonus.tool.service.TbCompanyPerfRelService; import com.bonus.tool.service.TbFileSourceService; import com.bonus.tool.service.TbSubPeopleService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.util.ArrayList; @@ -51,6 +49,9 @@ public class TbSubPeopleServiceImpl implements TbSubPeopleService { @Resource private TbCompanyPerfRelService tbCompanyPerfRelService; + @Resource + private TbSubMapper tbSubMapper; + /** * 分包商人员信息列表查询 @@ -173,4 +174,31 @@ public class TbSubPeopleServiceImpl implements TbSubPeopleService { //删除附件信息表中信息 tbFileSourceService.delTbFileSource(tbSubPeopleVo.getId(),TableType.TB_SUB_PEOPLE.getCode()); } + + /** + * 分包商人员信息导入 + * @param tbSubPeopleList + * @return + */ + @Override + @Transactional + public String tbSubPeopleImport(List tbSubPeopleList) { + //判断导入人员不为空 + if (!tbSubPeopleList.isEmpty()){ + for (TbSubPeopleVo tbSubPeopleVo:tbSubPeopleList) { + TbSubVo tbSubVo = new TbSubVo(); + tbSubVo.setSubName(tbSubPeopleVo.getSubName()); + //获取分包商信息 + TbSubVo tbSubVoNew = tbSubMapper.getTbSubBySubName(tbSubVo); + if (ObjectUtils.isEmpty(tbSubVoNew)){ + return "导入失败,"+tbSubPeopleVo.getSubName()+"不存在"; + } + tbSubPeopleVo.setSubId(tbSubVoNew.getId()); + this.addTbSubPeople(tbSubPeopleVo); + } + + + } + return "导入成功"; + } } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPerfServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPerfServiceImpl.java index 440d5e4..92a1f28 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPerfServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubPerfServiceImpl.java @@ -7,6 +7,7 @@ import com.bonus.common.utils.StringUtils; import com.bonus.system.service.ISysFileService; import com.bonus.tool.dto.*; import com.bonus.tool.mapper.StateGridMapper; +import com.bonus.tool.mapper.TbSubMapper; import com.bonus.tool.mapper.TbSubPerfMapper; import com.bonus.tool.service.TbCompanyPerfRelService; import com.bonus.tool.service.TbFileSourceService; @@ -14,6 +15,7 @@ import com.bonus.tool.service.TbSubPerfService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.util.Date; @@ -42,6 +44,9 @@ public class TbSubPerfServiceImpl implements TbSubPerfService { @Resource private StateGridMapper stateGridMapper; + @Resource + private TbSubMapper tbSubMapper; + /** *分包业绩管理列表查询 * @param @@ -120,7 +125,7 @@ public class TbSubPerfServiceImpl implements TbSubPerfService { public void updateTbSubPerf(TbSubPerfVo tbSubPerfVo) { try { TbSubPerfVo tbSubPerfOld = tbSubPerfMapper.getTbSubPerfByProName(tbSubPerfVo); - if (StringUtils.isNotNull(tbSubPerfOld) && !tbSubPerfOld.getId().equals(tbSubPerfOld.getId()) ){ + if (StringUtils.isNotNull(tbSubPerfOld) && !tbSubPerfVo.getId().equals(tbSubPerfOld.getId()) ){ throw new ServiceException("项目已存在"); } tbSubPerfVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername()); @@ -174,4 +179,25 @@ public class TbSubPerfServiceImpl implements TbSubPerfService { public List getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo) { return tbSubPerfMapper.getTbSubPerfListByPersonId(tbSubPerfVo); } + + @Override + @Transactional + public String tbSubPerfImport(List tbSubPerfList) { + //判断导入人员不为空 + if (!tbSubPerfList.isEmpty()){ + for (TbSubPerfVo bSubPerfVo:tbSubPerfList) { + TbSubVo tbSubVo = new TbSubVo(); + tbSubVo.setSubName(bSubPerfVo.getSubName()); + //获取分包商信息 + TbSubVo tbSubVoNew = tbSubMapper.getTbSubBySubName(tbSubVo); + if (ObjectUtils.isEmpty(tbSubVoNew)){ + return "导入失败,"+bSubPerfVo.getSubName()+"不存在"; + } + bSubPerfVo.setSubId(tbSubVoNew.getId()); + this.addTbSubPerf(bSubPerfVo); + + } + } + return "导入成功"; + } } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubServiceImpl.java index 1845b0f..af3ff0e 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbSubServiceImpl.java @@ -165,4 +165,21 @@ public class TbSubServiceImpl implements TbSubService { //删除附件信息表中信息 tbFileSourceService.delTbFileSource(tbSubVo.getId(),TableType.TB_SUB.getCode()); } + + /** + * 分包商导入 + * @param tbSubList + * @return + */ + @Override + @Transactional + public String tbSubImport(List tbSubList) { + //判断导入人员不为空 + if (!tbSubList.isEmpty()){ + for (TbSubVo tbSubVo:tbSubList) { + this.addTbSub(tbSubVo); + } + } + return "导入成功"; + } } diff --git a/search-tool/src/main/resources/mapper/ComprehensiveMapper.xml b/search-tool/src/main/resources/mapper/ComprehensiveMapper.xml new file mode 100644 index 0000000..af3bba3 --- /dev/null +++ b/search-tool/src/main/resources/mapper/ComprehensiveMapper.xml @@ -0,0 +1,91 @@ + + + + + + + diff --git a/search-tool/src/main/resources/mapper/TbKeyPeopleMapper.xml b/search-tool/src/main/resources/mapper/TbKeyPeopleMapper.xml index 710e66e..9e25a7d 100644 --- a/search-tool/src/main/resources/mapper/TbKeyPeopleMapper.xml +++ b/search-tool/src/main/resources/mapper/TbKeyPeopleMapper.xml @@ -62,6 +62,7 @@ is_normal = #{isNormal}, update_user = #{updateUser}, age = #{age}, + used = #{used}, update_time = now() where id = #{id} @@ -73,7 +74,7 @@ diff --git a/search-tool/src/main/resources/mapper/TbOtherPeopleMapper.xml b/search-tool/src/main/resources/mapper/TbOtherPeopleMapper.xml index cc45c13..55a2a68 100644 --- a/search-tool/src/main/resources/mapper/TbOtherPeopleMapper.xml +++ b/search-tool/src/main/resources/mapper/TbOtherPeopleMapper.xml @@ -56,6 +56,7 @@ level = #{level}, is_normal = #{isNormal}, update_user = #{updateUser}, + used = #{used}, update_time = now() where id = #{id} @@ -67,7 +68,7 @@ - select id,user_name,id_card,user_phone,qualification,work_type,title,major,diploma, - diploma_num,level,is_normal,create_time,create_user,update_time,update_user + diploma_num,level,is_normal,create_time,create_user,update_time,update_user,used from tb_other_people where id_card = #{idCard} and del_flag = 0