diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java index e62ed12..d47ba0a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java @@ -13,18 +13,21 @@ import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.domain.Annex; + import com.ruoyi.common.domain.dto.AnnexDTO; import com.ruoyi.common.service.IAnnexService; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.wgz.bo.res.*; import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperThree; import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperTwo; + import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo; import com.ruoyi.wgz.bo.rests.WgzAutonymAnnex; import com.ruoyi.wgz.bo.req.*; import com.ruoyi.wgz.domain.WgzPayCalculation; import com.ruoyi.wgz.domain.WgzQuestionsConfiguration; import com.ruoyi.wgz.service.*; import io.swagger.annotations.Api; + import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -567,9 +570,9 @@ if (req.getType()==1){ BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId); recruitId = by.getRecruitId(); - if (!appUserId.equals(recruitId)){ - throw new RuntimeException("当前用户不是该招工的申请人"); - } +// if (!appUserId.equals(recruitId)){ +// throw new RuntimeException("当前用户不是该招工的申请人"); +// } } else { recruitId = 0L; } @@ -609,6 +612,39 @@ return AjaxResult.success(wgzAppAttachmentAcquisitionRes.setWgzAutonymAnnex(resData)); } + /** + * 【通用】删除附件 + */ + @ApiOperation("【通用】新增附件") + //@PreAuthorize("@ss.hasPermi('wgzApp:user:userDeleteAttachmentAdd')") + @PostMapping("/WgzUserDeleteAttachmentAdd") + public AjaxResult userDeleteAttachmentAdd(@Validated @RequestBody WgzAppUserDeleteAttachmentAdd req) { + //获取当前用户 + Long appUserId = SecurityUtils.getAppUserId(); + List annex = req.getAnnex(); + List annexDTOS = new ArrayList<>(); + for (Annex data : annex) { + AnnexDTO dto = new AnnexDTO(); + BeanUtils.copyProperties(data, dto); + dto.setUserId(appUserId).setUserType(WGZ); + annexDTOS.add(dto); + } + return AjaxResult.success(iAnnexService.insertBatchLc(annexDTOS)); + } + + /** + * 【通用】删除附件 + */ + @ApiOperation("【通用】删除附件") + //@PreAuthorize("@ss.hasPermi('wgzApp:user:userDeleteAttachment')") + @DeleteMapping("/WgzUserDeleteAttachment/{attachmentId}") + public AjaxResult userDeleteAttachment(@NotEmpty(message = "主键不能为空") @PathVariable Long attachmentId) { + return AjaxResult.success(iAnnexService.deleteByIds(attachmentId)); + } + + + + /** * 【我的】【请假】 获取上下班时间 * 【考勤打卡】【打卡】 获取上下班时间 @@ -659,6 +695,18 @@ ); } + /** + * 【获取当前用户的所有招工】-有退场且进行中的项目|招工 + */ + @ApiOperation("【通用】获取当前用户的所有招工") + //@PreAuthorize("@ss.hasPermi('wgzApp:user:userAllRecruitment')") + @GetMapping("/WgzAppUserAllRecruitment") + public AjaxResult userAllRecruitment() { + WgzAppUserAllRecruitmentRes res = new WgzAppUserAllRecruitmentRes(); + res.setList(iBgtProjectRecruitApplyService.userAllRecruitment()); + return AjaxResult.success(res); + } + /** @@ -684,15 +732,7 @@ return section; } - // /** - // * 【我的】【实名认证】实名认证·删除附件 - // */ - // @ApiOperation("APP务工者-实名认证·删除附件") - // //@PreAuthorize("@ss.hasPermi('wgzApp:user:userDeleteAttachment')") - // @DeleteMapping("/WgzUserDeleteAttachment/{attachmentId}") - // public AjaxResult userDeleteAttachment(@NotEmpty(message = "主键不能为空") @PathVariable Long attachmentId) { - // return AjaxResult.success(iAnnexService.deleteByIds(attachmentId)); - // } + // /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitApplyMapper.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitApplyMapper.java index 8de9ae7..ad7b934 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitApplyMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitApplyMapper.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes; +import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo; import org.apache.ibatis.annotations.CacheNamespace; import org.apache.ibatis.annotations.Param; @@ -43,4 +44,7 @@ public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus taskUserList(@Param("page")Page queryDTOPage, @Param("dto") BgtProjectTaskUserDTO dto); + + //获取指定用户的所有招工 + List userAllRecruitment(@Param("userId") Long userId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java index ab48e09..600e463 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java @@ -9,6 +9,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq; import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes; +import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; @@ -88,6 +89,11 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus userAllRecruitment(); + /** * 根据用户唯一标识去查询当前进场的工地信息 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java index 946444f..6137373 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java @@ -34,6 +34,7 @@ import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq; import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes; +import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo; import com.ruoyi.wgz.domain.WgzMessage; import com.ruoyi.wgz.domain.WgzScoreRecord; import com.ruoyi.wgz.domain.WgzUser; @@ -204,6 +205,30 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl userAllRecruitment() { + //1、获取到所有项目 + Long appUserId = SecurityUtils.getAppUserId(); + List res = baseMapper.userAllRecruitment(appUserId); + //2、获取到当前人员所在的工地 + for (WgzAppUserAllRecruitmentTwo re : res) { + LambdaQueryWrapper last = new LambdaQueryWrapper() + .eq(BgtProjectRecruitApply::getRecruitId, re.getRecruitId()) + .eq(BgtProjectRecruitApply::getUserId, appUserId) + .orderByDesc(BgtProjectRecruitApply::getId) + .last("limit 1"); + BgtProjectRecruitApply bgtProjectRecruitApply = baseMapper.selectOne(last); + if (bgtProjectRecruitApply != null && bgtProjectRecruitApply.getStatus().equals("5")) { + re.setType("1"); + }else{ + re.setType("2"); + } + } + //3、res按照type升序,然后按照id降低 + res.sort(Comparator.comparing(WgzAppUserAllRecruitmentTwo::getType).thenComparing(WgzAppUserAllRecruitmentTwo::getRecruitId)); + return res; + } + @Override @Transactional(rollbackFor = Exception.class) public Boolean consent(BgtProjectRecruitApplyConsentDTO dto) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/common/service/IAnnexService.java b/ruoyi-system/src/main/java/com/ruoyi/common/service/IAnnexService.java index a48f362..1932f03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/common/service/IAnnexService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/common/service/IAnnexService.java @@ -68,6 +68,7 @@ public interface IAnnexService extends IServicePlus { * @return */ void insertBatch(List annexList); + Boolean insertBatchLc(List annexList); /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/common/service/impl/AnnexServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/common/service/impl/AnnexServiceImpl.java index 3b28767..c5a3794 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/common/service/impl/AnnexServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/common/service/impl/AnnexServiceImpl.java @@ -116,6 +116,21 @@ public class AnnexServiceImpl extends ServicePlusImpl implem } } + @Override + public Boolean insertBatchLc(List annexList) { + List annexes = annexList.stream() + .map(dto -> { + Annex annex = new Annex(); + BeanUtil.copyProperties(dto, annex); + return annex; + }) + .collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(annexes)){ + return super.saveAll(annexes); + } + return false; + } + @Override @Transactional public Boolean deleteByIds(Long id) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppLeaveHistoryListPageReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppLeaveHistoryListPageReq.java index 6fc61a8..d426930 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppLeaveHistoryListPageReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppLeaveHistoryListPageReq.java @@ -12,4 +12,5 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @ApiModel("请假·历史请假记录请求对象") public class WgzAppLeaveHistoryListPageReq extends PageReq { + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppRealNameAuthenticationReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppRealNameAuthenticationReq.java index 8753985..f877614 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppRealNameAuthenticationReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppRealNameAuthenticationReq.java @@ -70,8 +70,8 @@ public class WgzAppRealNameAuthenticationReq implements Serializable { @NotBlank(message = "银行卡号不能为空") private String cardNo; - @ApiModelProperty("附件实体数据") - private List annex; +// @ApiModelProperty("附件实体数据") +// private List annex; @ApiModelProperty("工种,多个逗号分隔") private String typeOfWork; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppUserDeleteAttachmentAdd.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppUserDeleteAttachmentAdd.java new file mode 100644 index 0000000..0544c5f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppUserDeleteAttachmentAdd.java @@ -0,0 +1,20 @@ +package com.ruoyi.wgz.bo.req; + +import com.ruoyi.common.domain.Annex; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("附件新增请求对象") +public class WgzAppUserDeleteAttachmentAdd implements Serializable { + @ApiModelProperty("附件实体数据") + private List annex; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserAllRecruitmentRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserAllRecruitmentRes.java new file mode 100644 index 0000000..24b5cac --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserAllRecruitmentRes.java @@ -0,0 +1,20 @@ +package com.ruoyi.wgz.bo.res; + +import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("项目进行中返回对象") +public class WgzAppUserAllRecruitmentRes implements Serializable { + @ApiModelProperty("列表") + private List list; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/rests/WgzAppUserAllRecruitmentTwo.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/rests/WgzAppUserAllRecruitmentTwo.java new file mode 100644 index 0000000..a78d5fc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/rests/WgzAppUserAllRecruitmentTwo.java @@ -0,0 +1,24 @@ +package com.ruoyi.wgz.bo.rests; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("获取当前用户的所有招工信息返回") +public class WgzAppUserAllRecruitmentTwo implements Serializable { + @ApiModelProperty("主键ID") + private Long recruitId; + + @ApiModelProperty("招工名称") + private String recruitName; + + @ApiModelProperty("1当前招工 2历史招工") + private String type; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java index 145c858..d526ea6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.common.domain.Annex; import com.ruoyi.common.domain.dto.AnnexDTO; import com.ruoyi.common.service.IAnnexService; import com.ruoyi.common.util.DataUtil; +import com.ruoyi.common.util.ValidUtil; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.system.service.ISysDictTypeService; @@ -199,6 +200,13 @@ public class WgzUserServiceImpl extends ServicePlusImpl @Override @Transactional() public Boolean userRealNameAuthentication(WgzAppRealNameAuthenticationReq req) { + if (!ValidUtil.isValidIdentityCard(req.getIdentityCard())){ + throw new RuntimeException("请检查身份证!"); + } + if(!ValidUtil.isValidBankCard(req.getCardNo())){ + throw new RuntimeException("请检查银行卡!"); + } + //1、对指定用户进行实名认证 WgzUser user = new WgzUser(); BeanUtils.copyProperties(req, user); @@ -206,20 +214,16 @@ public class WgzUserServiceImpl extends ServicePlusImpl if (update == 0){ throw new RuntimeException("当前用户不存在!"); } - - //2、新增附件 - List annex = req.getAnnex(); - List annexDTOS = new ArrayList<>(); - for (Annex data : annex) { - AnnexDTO dto = new AnnexDTO(); - BeanUtils.copyProperties(data, dto); - dto.setUserId(req.getUserId()).setUserType(WGZ); -// setAnnexType(data.getAnnexType()). -// setAnnexName(data.getAnnexName()). -// setAnnexUrl(data.getAnnexUrl()); - annexDTOS.add(dto); - } - iAnnexService.insertBatch(annexDTOS); +// //2、新增附件 +// List annex = req.getAnnex(); +// List annexDTOS = new ArrayList<>(); +// for (Annex data : annex) { +// AnnexDTO dto = new AnnexDTO(); +// BeanUtils.copyProperties(data, dto); +// dto.setUserId(req.getUserId()).setUserType(WGZ); +// annexDTOS.add(dto); +// } +// iAnnexService.insertBatch(annexDTOS); return true; } diff --git a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml index 2489a13..8a69b64 100644 --- a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitApplyMapper.xml @@ -249,4 +249,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by bpra.create_time desc + + +