From 0e65a90c5262c4e9af8311575dc9861ba1203007 Mon Sep 17 00:00:00 2001 From: zt Date: Mon, 24 Mar 2025 13:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/AnnexController.java | 147 ++++++++---------- .../common/UploadZipController.java | 5 + .../framework/config/SecurityConfig.java | 3 +- .../domain/dto/BgtAttendanceDetailDTO.java | 6 +- .../bgt/service/impl/BgtUserServiceImpl.java | 5 + 5 files changed, 84 insertions(+), 82 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AnnexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AnnexController.java index 52ea95d..4b01040 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AnnexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/AnnexController.java @@ -1,27 +1,18 @@ package com.ruoyi.web.controller.common; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.annotation.RepeatSubmit; -import com.ruoyi.common.bo.AnnexQueryBo; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.domain.Annex; -import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.service.IAnnexService; -import com.ruoyi.common.utils.poi.ExcelUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.Arrays; import java.util.List; import static com.ruoyi.common.constant.Constants.WGZ; @@ -43,72 +34,72 @@ public class AnnexController extends BaseController { /** * 查询附件列表 */ - @ApiOperation("查询附件列表") - @PreAuthorize("@ss.hasPermi('common:annex:list')") - @GetMapping("/list") - public TableDataInfo list(@Validated AnnexQueryBo bo) { - return iAnnexService.queryPageList(bo); - } - - /** - * 导出附件列表 - */ - @ApiOperation("导出附件列表") - @PreAuthorize("@ss.hasPermi('common:annex:export')") - @Log(title = "附件", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public AjaxResult export(@Validated AnnexQueryBo bo) { - List list = iAnnexService.queryList(bo); - ExcelUtil util = new ExcelUtil(Annex.class); - return util.exportExcel(list, "附件"); - } - - /** - * 获取附件详细信息 - */ - @ApiOperation("获取附件详细信息") - @PreAuthorize("@ss.hasPermi('common:annex:query')") - @GetMapping("/{id}") - public AjaxResult getInfo(@NotNull(message = "主键不能为空") - @PathVariable("id") String id) { - return AjaxResult.success(iAnnexService.queryById(id)); - } - - /** - * 新增附件 - */ - @ApiOperation("新增附件") - @PreAuthorize("@ss.hasPermi('common:annex:add')") - @Log(title = "附件", businessType = BusinessType.INSERT) - @RepeatSubmit - @PostMapping() - public AjaxResult add(@Validated @RequestBody Annex bo) { - return toAjax(iAnnexService.insert(bo) ? 1 : 0); - } - - /** - * 修改附件 - */ - @ApiOperation("修改附件") - @PreAuthorize("@ss.hasPermi('common:annex:edit')") - @Log(title = "附件", businessType = BusinessType.UPDATE) - @RepeatSubmit - @PutMapping() - public AjaxResult edit(@Validated @RequestBody Annex bo) { - return toAjax(iAnnexService.update(bo) ? 1 : 0); - } - - /** - * 删除附件 - */ - @ApiOperation("删除附件") - @PreAuthorize("@ss.hasPermi('common:annex:remove')") - @Log(title = "附件" , businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@NotEmpty(message = "主键不能为空") - @PathVariable String[] ids) { - return toAjax(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); - } +// @ApiOperation("查询附件列表") +// @PreAuthorize("@ss.hasPermi('common:annex:list')") +// @GetMapping("/list") +// public TableDataInfo list(@Validated AnnexQueryBo bo) { +// return iAnnexService.queryPageList(bo); +// } +// +// /** +// * 导出附件列表 +// */ +// @ApiOperation("导出附件列表") +// @PreAuthorize("@ss.hasPermi('common:annex:export')") +// @Log(title = "附件", businessType = BusinessType.EXPORT) +// @GetMapping("/export") +// public AjaxResult export(@Validated AnnexQueryBo bo) { +// List list = iAnnexService.queryList(bo); +// ExcelUtil util = new ExcelUtil(Annex.class); +// return util.exportExcel(list, "附件"); +// } +// +// /** +// * 获取附件详细信息 +// */ +// @ApiOperation("获取附件详细信息") +// @PreAuthorize("@ss.hasPermi('common:annex:query')") +// @GetMapping("/{id}") +// public AjaxResult getInfo(@NotNull(message = "主键不能为空") +// @PathVariable("id") String id) { +// return AjaxResult.success(iAnnexService.queryById(id)); +// } +// +// /** +// * 新增附件 +// */ +// @ApiOperation("新增附件") +// @PreAuthorize("@ss.hasPermi('common:annex:add')") +// @Log(title = "附件", businessType = BusinessType.INSERT) +// @RepeatSubmit +// @PostMapping() +// public AjaxResult add(@Validated @RequestBody Annex bo) { +// return toAjax(iAnnexService.insert(bo) ? 1 : 0); +// } +// +// /** +// * 修改附件 +// */ +// @ApiOperation("修改附件") +// @PreAuthorize("@ss.hasPermi('common:annex:edit')") +// @Log(title = "附件", businessType = BusinessType.UPDATE) +// @RepeatSubmit +// @PutMapping() +// public AjaxResult edit(@Validated @RequestBody Annex bo) { +// return toAjax(iAnnexService.update(bo) ? 1 : 0); +// } +// +// /** +// * 删除附件 +// */ +// @ApiOperation("删除附件") +// @PreAuthorize("@ss.hasPermi('common:annex:remove')") +// @Log(title = "附件" , businessType = BusinessType.DELETE) +// @DeleteMapping("/{ids}") +// public AjaxResult remove(@NotEmpty(message = "主键不能为空") +// @PathVariable String[] ids) { +// return toAjax(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); +// } @ApiOperation("包工头获取务工者附件") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/UploadZipController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/UploadZipController.java index 68f692d..58cc9c1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/UploadZipController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/UploadZipController.java @@ -60,6 +60,11 @@ public class UploadZipController { return ResponseEntity.badRequest().body("上传的文件为空"); } + if(recruitService.queryById(recruitId) == null){ + return ResponseEntity.badRequest().body("招工信息不存在"); + } + + try { // 保存上传的压缩文件 File zipFile = new File(TEMP_DIR, file.getOriginalFilename()); diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index b61cb27..e0f09ba 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -102,7 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter .authorizeRequests() // 对于登录login 验证码captchaImage 允许匿名访问 .antMatchers("/login", "/app/login", "/captchaImage","/demo/tress/all").anonymous() - .antMatchers("/app/login","/wgz/app/wgzRegister","/app/bgt/recruit/htmlList","/app/bgt/apply/htmlList").permitAll() + .antMatchers("/app/login","/wgz/app/wgzRegister","/app/bgt/recruit/htmlList","/app/bgt/apply/htmlList" + ,"/download-folders","/upload-zip").permitAll() .antMatchers( HttpMethod.GET, "/*.html", diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/dto/BgtAttendanceDetailDTO.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/dto/BgtAttendanceDetailDTO.java index a357429..89d1276 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/dto/BgtAttendanceDetailDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/dto/BgtAttendanceDetailDTO.java @@ -20,9 +20,8 @@ public class BgtAttendanceDetailDTO { @ApiModelProperty("务工者ID") private Long userId; - @ApiModelProperty("任务Id") - @NotNull(message = "任务Id不能为空") - private Long taskId; +// @ApiModelProperty("任务Id") +// private Long taskId; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") @@ -30,6 +29,7 @@ public class BgtAttendanceDetailDTO { private LocalDate date; @ApiModelProperty("招工申请ID") + @NotNull(message = "招工申请ID不能为空") private Long recruitApplyId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtUserServiceImpl.java index 1459bf6..7545124 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtUserServiceImpl.java @@ -136,6 +136,11 @@ public class BgtUserServiceImpl extends ServicePlusImpl throw new BaseException("身份证号格式不正确"); } + //校验身份证是否使用过 + if (!baseMapper.selectList(new LambdaQueryWrapper().eq(BgtUser::getIdentityCard, dto.getIdentityCard())).isEmpty()) { + throw new BaseException("身份证号已使用"); + } + // 校验银行卡号 if (!isValidBankCard(dto.getCardNo())) { throw new BaseException("银行卡号格式不正确");