diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtTeamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtTeamController.java new file mode 100644 index 0000000..8bb293c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtTeamController.java @@ -0,0 +1,144 @@ +package com.ruoyi.web.controller.ehs; + +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.ExcelExp; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.ExcelExportUtil; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtTeam.domain.FloodDroughtTeamImportTemplate; +import com.ruoyi.ehsFloodDroughtTeam.service.IEhsFloodDroughtTeamService; +import com.ruoyi.ehsFloodDroughtWorker.domain.EhsFloodDroughtWorker; +import com.ruoyi.ehsFloodDroughtWorker.service.IEhsFloodDroughtWorkerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 防汛抗旱队伍管理Controller + * + * @author ruoyi + * @date 2023-12-14 + */ +@Api(tags = "防汛抗旱队伍管理管理") +@RestController +@RequestMapping("/ehs/ehsFloodDroughtTeam") +public class EhsFloodDroughtTeamController extends BaseController { + @Autowired + private IEhsFloodDroughtTeamService ehsFloodDroughtTeamService; + @Autowired + private IEhsFloodDroughtWorkerService workerService; + + /** + * 查询防汛抗旱队伍管理列表 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:list')") + @GetMapping("/list") + public TableDataInfo list(EhsFloodDroughtTeam ehsFloodDroughtTeam) { + startPage(); + List list = ehsFloodDroughtTeamService.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam); + return getDataTable(list); + } + + /** + * 导出防汛抗旱队伍管理列表 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:export')") + @Log(title = "防汛抗旱队伍管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsFloodDroughtTeam ehsFloodDroughtTeam) { + List list = ehsFloodDroughtTeamService.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam); + ExcelUtil util = new ExcelUtil(EhsFloodDroughtTeam.class); + util.exportExcel(response, list, "防汛抗旱队伍管理数据"); + } + + /** + * 获取防汛抗旱队伍管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(ehsFloodDroughtTeamService.selectEhsFloodDroughtTeamById(id)); + } + + /** + * 新增防汛抗旱队伍管理 + */ + @ApiOperation("新增防汛抗旱队伍管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:add')") + @Log(title = "防汛抗旱队伍管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsFloodDroughtTeam ehsFloodDroughtTeam) { + return toAjax(ehsFloodDroughtTeamService.save(ehsFloodDroughtTeam)); + } + + /** + * 修改防汛抗旱队伍管理 + */ + @ApiOperation("修改防汛抗旱队伍管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:edit')") + @Transactional + @Log(title = "防汛抗旱队伍管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsFloodDroughtTeam ehsFloodDroughtTeam) { + // 更新防汛抗旱队伍信息 + ehsFloodDroughtTeamService.updateById(ehsFloodDroughtTeam); + // 更新防汛抗旱队伍中人员信息 + boolean result = workerService.updateWorkerByTeamId(ehsFloodDroughtTeam); + return toAjax(result); + } + + /** + * 删除防汛抗旱队伍管理 + */ + @ApiOperation("删除防汛抗旱队伍管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtTeam:remove')") + @Transactional + @Log(title = "防汛抗旱队伍管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + ehsFloodDroughtTeamService.removeByIds(Arrays.asList(ids)); + boolean result = workerService.removeWorkerByTeamIds(Arrays.asList(ids)); + return toAjax(result); + } + + /** + * 下载批量导入模板 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) throws IOException { + List ehsFloodDroughtTeams = new ArrayList<>(); + String[] header = + {"队伍名称#", + "队伍级别#", + "备注#"}; + ExcelExp e1 = new ExcelExp("防汛抗旱队伍信息", header, ehsFloodDroughtTeams, EhsFloodDroughtTeam.class); + List mysheet = new ArrayList<>(); + mysheet.add(e1); + ExcelExportUtil.exportManySheetExcel("防汛抗旱队伍信息批量导入模板", mysheet, response); + } + + //批量导入 + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, Boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil<>(FloodDroughtTeamImportTemplate.class); + List list = util.importExcel(file.getInputStream()); + String message = ehsFloodDroughtTeamService.importData(list, updateSupport); + + return AjaxResult.success(message); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtWorkerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtWorkerController.java new file mode 100644 index 0000000..c03a332 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsFloodDroughtWorkerController.java @@ -0,0 +1,147 @@ +package com.ruoyi.web.controller.ehs; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.ExcelExp; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.ExcelExportUtil; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.ehsFloodDroughtTeam.service.IEhsFloodDroughtTeamService; +import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; +import com.ruoyi.ehsFloodDroughtWorker.domain.EhsFloodDroughtWorker; +import com.ruoyi.ehsFloodDroughtWorker.domain.FloodDroughtWorkerImportTemplate; +import com.ruoyi.ehsFloodDroughtWorker.service.IEhsFloodDroughtWorkerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 防汛抗旱队伍人员信息Controller + * + * @author ruoyi + * @date 2023-12-14 + */ +@Api(tags = "防汛抗旱队伍人员信息管理") +@RestController +@RequestMapping("/ehs/ehsFloodDroughtWorker") +public class EhsFloodDroughtWorkerController extends BaseController { + @Autowired + private IEhsFloodDroughtWorkerService ehsFloodDroughtWorkerService; + @Autowired + private IEhsFloodDroughtTeamService ehsFloodDroughtTeamService; + + /** + * 查询防汛抗旱队伍人员信息列表 + */ + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:list')") + @GetMapping("/list") + public TableDataInfo list(EhsFloodDroughtWorker ehsFloodDroughtWorker) { + startPage(); + List list = ehsFloodDroughtWorkerService.selectEhsFloodDroughtWorkerList(ehsFloodDroughtWorker); + return getDataTable(list); + } + + /** + * 根据队伍id获取队伍信息 + */ + @GetMapping(value = "/getTeamInfo/{teamId}") + public AjaxResult getTeamInfo(@PathVariable("teamId") Long teamId) { + FloodDroughtTeamVo teamResponseVo = ehsFloodDroughtTeamService.getTeamInfoByTeamId(teamId); + return success(teamResponseVo); + } + + /** + * 导出防汛抗旱队伍人员信息列表 + */ + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:export')") + @Log(title = "防汛抗旱队伍人员信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsFloodDroughtWorker ehsFloodDroughtWorker) { + List list = ehsFloodDroughtWorkerService.selectEhsFloodDroughtWorkerList(ehsFloodDroughtWorker); + ExcelUtil util = new ExcelUtil(EhsFloodDroughtWorker.class); + util.exportExcel(response, list, "防汛抗旱队伍人员信息数据"); + } + + /** + * 获取防汛抗旱队伍人员信息详细信息 + */ + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(ehsFloodDroughtWorkerService.selectEhsFloodDroughtWorkerById(id)); + } + + /** + * 新增防汛抗旱队伍人员信息 + */ + @ApiOperation("新增防汛抗旱队伍人员信息") + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:add')") + @Log(title = "防汛抗旱队伍人员信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsFloodDroughtWorker ehsFloodDroughtWorker) { + return toAjax(ehsFloodDroughtWorkerService.save(ehsFloodDroughtWorker)); + } + + /** + * 修改防汛抗旱队伍人员信息 + */ + @ApiOperation("修改防汛抗旱队伍人员信息") + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:edit')") + @Log(title = "防汛抗旱队伍人员信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsFloodDroughtWorker ehsFloodDroughtWorker) { + return toAjax(ehsFloodDroughtWorkerService.updateById(ehsFloodDroughtWorker)); + } + + /** + * 删除防汛抗旱队伍人员信息 + */ + @ApiOperation("删除防汛抗旱队伍人员信息") + //@PreAuthorize("@ss.hasPermi('ehs:ehsFloodDroughtWorker:remove')") + @Log(title = "防汛抗旱队伍人员信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(ehsFloodDroughtWorkerService.removeByIds(Arrays.asList(ids))); + } + + /** + * 批量导入模板 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) throws IOException { + List workerList = new ArrayList<>(); + String[] header = + {"人员姓名#", + "性别(0-男,1-女)#", + "出生年月(格式为:2023-12-12)#", + "身份证号#", + "联系方式#", + "工作年限#", + "技能特长#", + "备注#"}; + ExcelExp e1 = new ExcelExp("防汛抗旱队伍人员信息", header, workerList, EhsFloodDroughtWorker.class); + List mysheet = new ArrayList<>(); + mysheet.add(e1); + ExcelExportUtil.exportManySheetExcel("防汛抗旱队伍人员信息导入模板", mysheet, response); + } + + //批量导入 params是防汛抗旱队伍id + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, Boolean updateSupport, Long params) throws Exception { + ExcelUtil util = new ExcelUtil<>(FloodDroughtWorkerImportTemplate.class); + List list = util.importExcel(file.getInputStream()); + String message = ehsFloodDroughtWorkerService.importData(list, updateSupport, params); + + return AjaxResult.success(message); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRescueTeamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRescueTeamController.java index 5518086..82707db 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRescueTeamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsRescueTeamController.java @@ -124,10 +124,15 @@ public class EhsRescueTeamController extends BaseController { */ @ApiOperation("修改应急救援队伍管理") @PreAuthorize("@ss.hasPermi('ehs:ehsRescueTeam:edit')") + @Transactional @Log(title = "应急救援队伍管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody EhsRescueTeam ehsRescueTeam) { - return toAjax(ehsRescueTeamService.updateById(ehsRescueTeam)); + // 更新应急救援队伍信息 + ehsRescueTeamService.updateById(ehsRescueTeam); + // 更新应急救援队伍人员信息 + boolean result = ehsRescueTeamWorkerService.updateWorkerByTeamId(ehsRescueTeam); + return toAjax(result); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java index 438b4ae..dba040a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java @@ -49,12 +49,10 @@ public class EhsDocumentServiceImpl extends ServiceImpl selectEhsDocumentList(EhsDocument ehsDocument) { - // 如果登录用户不是超级管理员,并且他的部门不是唐河县应急管理局(根节点),那么只能查询当前登录用户他的部门创建的公文 + // 如果登录用户不是县级部门(即不是根节点parent_id=0),那么只能查询本部门的;县级部门(根节点)则查询全部 SysUser currentUser = SecurityUtils.getLoginUser().getUser(); - List roleIds = currentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); Long deptParentId = currentUser.getDept().getParentId(); - if (!roleIds.contains(1L) && - deptParentId != null && + if (deptParentId != null && deptParentId.longValue() != 0) { ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/EhsFloodDroughtTeam.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/EhsFloodDroughtTeam.java new file mode 100644 index 0000000..7a342f6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/EhsFloodDroughtTeam.java @@ -0,0 +1,48 @@ +package com.ruoyi.ehsFloodDroughtTeam.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 防汛抗旱队伍管理对象 ehs_flood_drought_team + * + * @author ruoyi + * @date 2023-12-14 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_flood_drought_team") +public class EhsFloodDroughtTeam extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type= IdType.AUTO) + private Long id; + + /** 队伍名称 */ + @Excel(name = "队伍名称") + private String teamName; + + /** 队伍级别 */ + @Excel(name = "队伍级别") + private String teamLevel; + + /** + * 救援人员数量 + */ + @Excel(name = "救援人员数量") + @TableField(exist = false) + private Long rescueWorkerNum; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/FloodDroughtTeamImportTemplate.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/FloodDroughtTeamImportTemplate.java new file mode 100644 index 0000000..a0d8d70 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/domain/FloodDroughtTeamImportTemplate.java @@ -0,0 +1,19 @@ +package com.ruoyi.ehsFloodDroughtTeam.domain; + +import com.ruoyi.common.annotation.Excel; +import lombok.Data; + +@Data +public class FloodDroughtTeamImportTemplate { + /** 队伍名称 */ + @Excel(name = "队伍名称",type = Excel.Type.ALL) + private String teamName; + + /** 队伍级别 */ + @Excel(name = "队伍级别",type = Excel.Type.ALL) + private String teamLevel; + + /** 备注 */ + @Excel(name = "备注",type = Excel.Type.ALL) + private String remark; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/mapper/EhsFloodDroughtTeamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/mapper/EhsFloodDroughtTeamMapper.java new file mode 100644 index 0000000..fe52fb3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/mapper/EhsFloodDroughtTeamMapper.java @@ -0,0 +1,44 @@ +package com.ruoyi.ehsFloodDroughtTeam.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 防汛抗旱队伍管理Mapper接口 + * + * @author ruoyi + * @date 2023-12-14 + */ +public interface EhsFloodDroughtTeamMapper extends BaseMapper { + /** + * 查询防汛抗旱队伍管理 + * + * @param id 防汛抗旱队伍管理主键 + * @return 防汛抗旱队伍管理 + */ + public EhsFloodDroughtTeam selectEhsFloodDroughtTeamById(Long id); + + /** + * 查询防汛抗旱队伍管理列表 + * + * @param ehsFloodDroughtTeam 防汛抗旱队伍管理 + * @return 防汛抗旱队伍管理集合 + */ + public List selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam); + + /** + * 防汛抗旱:根据队伍id获取队伍信息 + */ + public FloodDroughtTeamVo getTeamInfoByTeamId(Long teamId); + + /** + * 根据防汛抗旱队伍id,查询该队伍人数 + * @param id + * @return + */ + public Long getWorkerNumByTeamId(@Param("id") Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/IEhsFloodDroughtTeamService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/IEhsFloodDroughtTeamService.java new file mode 100644 index 0000000..35a8ebc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/IEhsFloodDroughtTeamService.java @@ -0,0 +1,46 @@ +package com.ruoyi.ehsFloodDroughtTeam.service; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtTeam.domain.FloodDroughtTeamImportTemplate; +import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; + +/** + * 防汛抗旱队伍管理Service接口 + * + * @author ruoyi + * @date 2023-12-14 + */ +public interface IEhsFloodDroughtTeamService extends IService { + + /** + * 查询防汛抗旱队伍管理 + * + * @param id 防汛抗旱队伍管理主键 + * @return 防汛抗旱队伍管理 + */ + public EhsFloodDroughtTeam selectEhsFloodDroughtTeamById(Long id); + + /** + * 查询防汛抗旱队伍管理列表 + * + * @param ehsFloodDroughtTeam 防汛抗旱队伍管理 + * @return 防汛抗旱队伍管理集合 + */ + public List selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam); + + /** + * 批量导入模板数据 + * @param list + * @param updateSupport + * @return + */ + public String importData(List list, Boolean updateSupport) throws Exception; + + /** + * 防汛抗旱:根据队伍id获取队伍信息 + */ + public FloodDroughtTeamVo getTeamInfoByTeamId(Long teamId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/impl/EhsFloodDroughtTeamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/impl/EhsFloodDroughtTeamServiceImpl.java new file mode 100644 index 0000000..28db16b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/service/impl/EhsFloodDroughtTeamServiceImpl.java @@ -0,0 +1,114 @@ +package com.ruoyi.ehsFloodDroughtTeam.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.ehsFloodDroughtTeam.domain.FloodDroughtTeamImportTemplate; +import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; + +import java.util.List; +import java.util.Map; + +import com.ruoyi.ehsFloodDroughtTeam.mapper.EhsFloodDroughtTeamMapper; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtTeam.service.IEhsFloodDroughtTeamService; + +/** + * 防汛抗旱队伍管理Service业务层处理 + * + * @author ruoyi + * @date 2023-12-14 + */ +@Service +public class EhsFloodDroughtTeamServiceImpl extends ServiceImpl implements IEhsFloodDroughtTeamService { + + @Autowired + private EhsFloodDroughtTeamMapper ehsFloodDroughtTeamMapper; + + /** + * 查询防汛抗旱队伍管理 + * + * @param id 防汛抗旱队伍管理主键 + * @return 防汛抗旱队伍管理 + */ + @Override + public EhsFloodDroughtTeam selectEhsFloodDroughtTeamById(Long id) { + return ehsFloodDroughtTeamMapper.selectEhsFloodDroughtTeamById(id); + } + + /** + * 查询防汛抗旱队伍管理列表 + * + * @param ehsFloodDroughtTeam 防汛抗旱队伍管理 + * @return 防汛抗旱队伍管理 + */ + @Override + public List selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam) { + List teamList = ehsFloodDroughtTeamMapper.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam); + teamList.stream().forEach(item -> { + Long count = ehsFloodDroughtTeamMapper.getWorkerNumByTeamId(item.getId()); + if (count != null){ + item.setRescueWorkerNum(count); + } + }); + return teamList; + } + + /** + * 防汛抗旱:根据队伍id获取队伍信息 + */ + @Override + public FloodDroughtTeamVo getTeamInfoByTeamId(Long teamId) { + return ehsFloodDroughtTeamMapper.getTeamInfoByTeamId(teamId); + } + + @Override + public String importData(List list, Boolean updateSupport) throws Exception { + if (StringUtils.isNull(list) || list.size() == 0) { + throw new Exception("导入防汛抗旱队伍信息数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + for (FloodDroughtTeamImportTemplate floodDroughtTeamTemplate : list) { + + EhsFloodDroughtTeam temp = new EhsFloodDroughtTeam(); + + // temp.setId(IdUtils.fastSimpleUUID()); + temp.setTeamName(floodDroughtTeamTemplate.getTeamName()); //队伍名称 + temp.setTeamLevel(floodDroughtTeamTemplate.getTeamLevel()); //队伍级别 + temp.setRemark(floodDroughtTeamTemplate.getRemark()); // 备注 + + try { + //插入数据 + this.save(temp); + successNum++; + successMsg.append("
" + successNum + "、防汛抗旱队伍信息" + temp.getTeamName() + "导入成功"); + } catch (Exception e) { + e.printStackTrace(); + log.error(e.getLocalizedMessage()); + failureNum++; + successMsg.append("
" + failureNum + "、防汛抗旱队伍信息" + temp.getTeamName() + "导入异常,请联系管理员!"); + continue; + } + } + return successMsg.toString(); + } + + + private LambdaQueryWrapper buildQueryWrapper(EhsFloodDroughtTeam query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(query.getTeamName()), EhsFloodDroughtTeam::getTeamName, query.getTeamName()); + lqw.eq(StringUtils.isNotBlank(query.getTeamLevel()), EhsFloodDroughtTeam::getTeamLevel, query.getTeamLevel()); + lqw.orderByDesc(EhsFloodDroughtTeam::getCreateTime); + lqw.eq(query.getDeptId() != null, EhsFloodDroughtTeam::getDeptId, query.getDeptId()); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/vo/FloodDroughtTeamVo.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/vo/FloodDroughtTeamVo.java new file mode 100644 index 0000000..c506d18 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtTeam/vo/FloodDroughtTeamVo.java @@ -0,0 +1,9 @@ +package com.ruoyi.ehsFloodDroughtTeam.vo; + +import lombok.Data; + +@Data +public class FloodDroughtTeamVo { + private Long teamId; + private String teamName; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/EhsFloodDroughtWorker.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/EhsFloodDroughtWorker.java new file mode 100644 index 0000000..7c95d6c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/EhsFloodDroughtWorker.java @@ -0,0 +1,71 @@ +package com.ruoyi.ehsFloodDroughtWorker.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 防汛抗旱队伍人员信息对象 ehs_flood_drought_worker + * + * @author ruoyi + * @date 2023-12-14 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_flood_drought_worker") +public class EhsFloodDroughtWorker extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type= IdType.AUTO) + private Long id; + + /** 防汛抗旱队伍id */ + private Long teamId; + + /** 防汛抗旱队伍名称 */ + @Excel(name = "防汛抗旱队伍名称") + private String teamName; + + /** 人员姓名 */ + @Excel(name = "人员姓名") + private String workerName; + + /** 性别 */ + @Excel(name = "性别(0-男,1-女)") + private Integer gender; + + /** 出生年月日 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出生年月(格式为:2023-12-12)", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + + /** 身份证号 */ + @Excel(name = "身份证号") + private String idCard; + + /** 联系方式 */ + @Excel(name = "联系方式") + private String phone; + + /** 工作年限 */ + @Excel(name = "工作年限") + private String workYear; + + /** 技能特长 */ + @Excel(name = "技能特长") + private String speciality; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/FloodDroughtWorkerImportTemplate.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/FloodDroughtWorkerImportTemplate.java new file mode 100644 index 0000000..268b26e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/domain/FloodDroughtWorkerImportTemplate.java @@ -0,0 +1,28 @@ +package com.ruoyi.ehsFloodDroughtWorker.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +@Data +public class FloodDroughtWorkerImportTemplate { + @Excel(name = "人员姓名", type = Excel.Type.ALL) + private String workerName; + @Excel(name = "性别(0-男,1-女)", type = Excel.Type.ALL) + private Integer gender; + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出生年月(格式为:2023-12-12)", width = 30, dateFormat = "yyyy-MM-dd", type = Excel.Type.ALL) + private Date birthday; + @Excel(name = "身份证号", type = Excel.Type.ALL) + private String idCard; + @Excel(name = "联系方式", type = Excel.Type.ALL) + private String phone; + @Excel(name = "工作年限", type = Excel.Type.ALL) + private String workYear; + @Excel(name = "技能特长", type = Excel.Type.ALL) + private String speciality; + @Excel(name = "备注", type = Excel.Type.ALL) + private String remark; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/mapper/EhsFloodDroughtWorkerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/mapper/EhsFloodDroughtWorkerMapper.java new file mode 100644 index 0000000..9eddf6f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/mapper/EhsFloodDroughtWorkerMapper.java @@ -0,0 +1,41 @@ +package com.ruoyi.ehsFloodDroughtWorker.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtWorker.domain.EhsFloodDroughtWorker; + +import java.util.List; + +/** + * 防汛抗旱队伍人员信息Mapper接口 + * + * @author ruoyi + * @date 2023-12-14 + */ +public interface EhsFloodDroughtWorkerMapper extends BaseMapper { + /** + * 查询防汛抗旱队伍人员信息 + * + * @param id 防汛抗旱队伍人员信息主键 + * @return 防汛抗旱队伍人员信息 + */ + public EhsFloodDroughtWorker selectEhsFloodDroughtWorkerById(Long id); + + /** + * 查询防汛抗旱队伍人员信息列表 + * + * @param ehsFloodDroughtWorker 防汛抗旱队伍人员信息 + * @return 防汛抗旱队伍人员信息集合 + */ + public List selectEhsFloodDroughtWorkerList(EhsFloodDroughtWorker ehsFloodDroughtWorker); + + /** + * 根据防汛抗旱队伍ids删除队伍中的人员信息 + * @param teamIds 队伍ids + * @return + */ + public boolean removeWorkerByTeamIds(List teamIds); + + // 根据teamId更新防汛抗旱人员信息 + public boolean updateWorkerByTeamId(EhsFloodDroughtWorker ehsFloodDroughtWorker); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/IEhsFloodDroughtWorkerService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/IEhsFloodDroughtWorkerService.java new file mode 100644 index 0000000..b94ed0d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/IEhsFloodDroughtWorkerService.java @@ -0,0 +1,48 @@ +package com.ruoyi.ehsFloodDroughtWorker.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtWorker.domain.EhsFloodDroughtWorker; +import com.ruoyi.ehsFloodDroughtWorker.domain.FloodDroughtWorkerImportTemplate; + +import java.util.List; + +/** + * 防汛抗旱队伍人员信息Service接口 + * + * @author ruoyi + * @date 2023-12-14 + */ +public interface IEhsFloodDroughtWorkerService extends IService { + + /** + * 查询防汛抗旱队伍人员信息 + * + * @param id 防汛抗旱队伍人员信息主键 + * @return 防汛抗旱队伍人员信息 + */ + public EhsFloodDroughtWorker selectEhsFloodDroughtWorkerById(Long id); + + /** + * 查询防汛抗旱队伍人员信息列表 + * + * @param ehsFloodDroughtWorker 防汛抗旱队伍人员信息 + * @return 防汛抗旱队伍人员信息集合 + */ + public List selectEhsFloodDroughtWorkerList(EhsFloodDroughtWorker ehsFloodDroughtWorker); + + /** + * 根据防汛抗旱队伍ids删除队伍中的人员信息 + * + * @param teamIds 队伍ids + * @return + */ + public boolean removeWorkerByTeamIds(List teamIds); + + + // 根据teamId更新防汛抗旱人员信息 + public boolean updateWorkerByTeamId(EhsFloodDroughtTeam ehsFloodDroughtTeam); + + //批量导入 params是防汛抗旱队伍id + public String importData(List list, Boolean updateSupport, Long params) throws Exception; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/impl/EhsFloodDroughtWorkerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/impl/EhsFloodDroughtWorkerServiceImpl.java new file mode 100644 index 0000000..c917eec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsFloodDroughtWorker/service/impl/EhsFloodDroughtWorkerServiceImpl.java @@ -0,0 +1,138 @@ +package com.ruoyi.ehsFloodDroughtWorker.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.ehsFloodDroughtTeam.domain.EhsFloodDroughtTeam; +import com.ruoyi.ehsFloodDroughtTeam.mapper.EhsFloodDroughtTeamMapper; +import com.ruoyi.ehsFloodDroughtTeam.vo.FloodDroughtTeamVo; +import com.ruoyi.ehsFloodDroughtWorker.domain.FloodDroughtWorkerImportTemplate; +import com.ruoyi.ehsRescueTeamWorker.domain.EhsRescueTeamWorker; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; + +import java.util.List; +import java.util.Map; + +import com.ruoyi.ehsFloodDroughtWorker.mapper.EhsFloodDroughtWorkerMapper; +import com.ruoyi.ehsFloodDroughtWorker.domain.EhsFloodDroughtWorker; +import com.ruoyi.ehsFloodDroughtWorker.service.IEhsFloodDroughtWorkerService; + +/** + * 防汛抗旱队伍人员信息Service业务层处理 + * + * @author ruoyi + * @date 2023-12-14 + */ +@Service +public class EhsFloodDroughtWorkerServiceImpl extends ServiceImpl implements IEhsFloodDroughtWorkerService { + + @Autowired + private EhsFloodDroughtWorkerMapper ehsFloodDroughtWorkerMapper; + @Autowired + private EhsFloodDroughtTeamMapper floodDroughtTeamMapper; + + /** + * 查询防汛抗旱队伍人员信息 + * + * @param id 防汛抗旱队伍人员信息主键 + * @return 防汛抗旱队伍人员信息 + */ + @Override + public EhsFloodDroughtWorker selectEhsFloodDroughtWorkerById(Long id) { + return ehsFloodDroughtWorkerMapper.selectEhsFloodDroughtWorkerById(id); + } + + /** + * 查询防汛抗旱队伍人员信息列表 + * + * @param ehsFloodDroughtWorker 防汛抗旱队伍人员信息 + * @return 防汛抗旱队伍人员信息 + */ + @Override + public List selectEhsFloodDroughtWorkerList(EhsFloodDroughtWorker ehsFloodDroughtWorker) { + return ehsFloodDroughtWorkerMapper.selectEhsFloodDroughtWorkerList(ehsFloodDroughtWorker); + } + + /** + * 根据防汛抗旱队伍ids删除队伍中的人员信息 + * @param teamIds 队伍ids + * @return + */ + @Override + public boolean removeWorkerByTeamIds(List teamIds) { + return ehsFloodDroughtWorkerMapper.removeWorkerByTeamIds(teamIds); + } + + // 根据teamId更新防汛抗旱人员信息 + @Override + public boolean updateWorkerByTeamId(EhsFloodDroughtTeam ehsFloodDroughtTeam) { + EhsFloodDroughtWorker worker = new EhsFloodDroughtWorker(); + worker.setTeamId(ehsFloodDroughtTeam.getId()); + worker.setTeamName(ehsFloodDroughtTeam.getTeamName()); + return ehsFloodDroughtWorkerMapper.updateWorkerByTeamId(worker); + } + + //批量导入 params是防汛抗旱队伍id + @Override + public String importData(List list, Boolean updateSupport, Long params) throws Exception { + if (StringUtils.isNull(list) || list.size() == 0) { + throw new Exception("导入防汛抗旱队伍人员信息数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + for (FloodDroughtWorkerImportTemplate workerTemplate : list) { + + EhsFloodDroughtWorker temp = new EhsFloodDroughtWorker(); + + // temp.setId(IdUtils.fastSimpleUUID()); + temp.setTeamId(params);// 队伍id + FloodDroughtTeamVo floodDroughtTeamVo = floodDroughtTeamMapper.getTeamInfoByTeamId(params); + temp.setTeamName(floodDroughtTeamVo.getTeamName());// 队伍名称 + temp.setWorkerName(workerTemplate.getWorkerName());// 人员姓名 + temp.setGender(workerTemplate.getGender());// 性别 + temp.setBirthday(workerTemplate.getBirthday());// 出生年月 + temp.setIdCard(workerTemplate.getIdCard());// 身份证号 + temp.setPhone(workerTemplate.getPhone());// 联系方式 + temp.setWorkYear(workerTemplate.getWorkYear());// 工作年限 + temp.setSpeciality(workerTemplate.getSpeciality());// 特长 + temp.setRemark(workerTemplate.getRemark());// 备注 + try { + //插入数据 + this.save(temp); + successNum++; + successMsg.append("
" + successNum + "、防汛抗旱队伍信息" + temp.getTeamName() + "导入成功"); + } catch (Exception e) { + e.printStackTrace(); + log.error(e.getLocalizedMessage()); + failureNum++; + successMsg.append("
" + failureNum + "、防汛抗旱队伍信息" + temp.getTeamName() + "导入异常,请联系管理员!"); + continue; + } + } + return successMsg.toString(); + } + + + private LambdaQueryWrapper buildQueryWrapper(EhsFloodDroughtWorker query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(query.getTeamId() != null, EhsFloodDroughtWorker::getTeamId, query.getTeamId()); + lqw.like(StringUtils.isNotBlank(query.getTeamName()), EhsFloodDroughtWorker::getTeamName, query.getTeamName()); + lqw.like(StringUtils.isNotBlank(query.getWorkerName()), EhsFloodDroughtWorker::getWorkerName, query.getWorkerName()); + lqw.eq(query.getGender() != null, EhsFloodDroughtWorker::getGender, query.getGender()); + lqw.eq(query.getBirthday() != null, EhsFloodDroughtWorker::getBirthday, query.getBirthday()); + lqw.eq(StringUtils.isNotBlank(query.getIdCard()), EhsFloodDroughtWorker::getIdCard, query.getIdCard()); + lqw.eq(StringUtils.isNotBlank(query.getPhone()), EhsFloodDroughtWorker::getPhone, query.getPhone()); + lqw.eq(StringUtils.isNotBlank(query.getWorkYear()), EhsFloodDroughtWorker::getWorkYear, query.getWorkYear()); + lqw.eq(StringUtils.isNotBlank(query.getSpeciality()), EhsFloodDroughtWorker::getSpeciality, query.getSpeciality()); + lqw.orderByDesc(EhsFloodDroughtWorker::getCreateTime); + lqw.eq(query.getDeptId() != null, EhsFloodDroughtWorker::getDeptId, query.getDeptId()); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/mapper/EhsRescueTeamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/mapper/EhsRescueTeamMapper.java index cb465ed..812379d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/mapper/EhsRescueTeamMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/mapper/EhsRescueTeamMapper.java @@ -35,10 +35,10 @@ public interface EhsRescueTeamMapper extends BaseMapper { * @param id * @return */ - Long getWorkerNumByTeamId(@Param("id") Long id); + public Long getWorkerNumByTeamId(@Param("id") Long id); /** - * 根据队伍id获取队伍信息 + * 应急救援:根据队伍id获取队伍信息 */ - TeamResponseVo getTeamInfoByTeamId(Long rescueTeamId); + public TeamResponseVo getTeamInfoByTeamId(Long rescueTeamId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/IEhsRescueTeamService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/IEhsRescueTeamService.java index 3a61f63..02887e5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/IEhsRescueTeamService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/IEhsRescueTeamService.java @@ -40,7 +40,7 @@ public interface IEhsRescueTeamService extends IService { public String importRescueTeam(List list, Boolean updateSupport) throws Exception; /** - * 根据队伍id获取队伍信息 + * 应急救援:根据队伍id获取队伍信息 */ - TeamResponseVo getTeamInfoByTeamId(Long rescueTeamId); + public TeamResponseVo getTeamInfoByTeamId(Long rescueTeamId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java index 6aefcbb..ddfd584 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java @@ -59,7 +59,7 @@ public class EhsRescueTeamServiceImpl extends ServiceImpl teamIds); + + // 根据teamId更新应急救援人员信息 + public boolean updateWorkerByTeamId(EhsRescueTeamWorker worker); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/IEhsRescueTeamWorkerService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/IEhsRescueTeamWorkerService.java index b4a55c8..52e6f14 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/IEhsRescueTeamWorkerService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/IEhsRescueTeamWorkerService.java @@ -3,6 +3,7 @@ package com.ruoyi.ehsRescueTeamWorker.service; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsRescueTeam.domain.EhsRescueTeam; import com.ruoyi.ehsRescueTeamWorker.domain.EhsRescueTeamWorker; import com.ruoyi.ehsRescueTeamWorker.domain.RescueTeamWorkerImportTemplate; @@ -35,4 +36,7 @@ public interface IEhsRescueTeamWorkerService extends IService list, Boolean updateSupport, Long params) throws Exception; + + // 根据teamId更新应急救援人员信息 + public boolean updateWorkerByTeamId(EhsRescueTeam ehsRescueTeam); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/impl/EhsRescueTeamWorkerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/impl/EhsRescueTeamWorkerServiceImpl.java index 1ad8a4d..b51a4e7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/impl/EhsRescueTeamWorkerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/service/impl/EhsRescueTeamWorkerServiceImpl.java @@ -115,6 +115,15 @@ public class EhsRescueTeamWorkerServiceImpl extends ServiceImpl buildQueryWrapper(EhsRescueTeamWorker query) { Map params = query.getParams(); diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtTeamMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtTeamMapper.xml new file mode 100644 index 0000000..bd83ae1 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtTeamMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + select id, team_name, team_level, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_flood_drought_team + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtWorkerMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtWorkerMapper.xml new file mode 100644 index 0000000..416a400 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsFloodDroughtWorkerMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, team_id, team_name, worker_name, gender, birthday, id_card, phone, work_year, speciality, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_flood_drought_worker + + + + + + + update ehs_flood_drought_worker + + + team_name = #{teamName}, + + + where team_id = #{teamId} + + + + delete from ehs_flood_drought_worker + where team_id in + + #{items} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml index 2e3d9ac..17beece 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml @@ -28,6 +28,15 @@ select id, rescue_team_id, rescue_team_name, worker_name, gender, birthday, id_card, phone, work_year, speciality, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_rescue_team_worker + + update ehs_rescue_team_worker + + + rescue_team_name = #{rescueTeamName}, + + + where rescue_team_id = #{rescueTeamId} +