3.19优化
This commit is contained in:
@ -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<Boolean> userDeleteAttachmentAdd(@Validated @RequestBody WgzAppUserDeleteAttachmentAdd req) {
|
||||
//获取当前用户
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
List<Annex> annex = req.getAnnex();
|
||||
List<AnnexDTO> 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<Boolean> 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<WgzAppUserAllRecruitmentRes> 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<Boolean> userDeleteAttachment(@NotEmpty(message = "主键不能为空") @PathVariable Long attachmentId) {
|
||||
// return AjaxResult.success(iAnnexService.deleteByIds(attachmentId));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
|
@ -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<BgtProjectR
|
||||
|
||||
// 我的任务详情-务工者人员列表分页
|
||||
Page<BgtProjectRecruitApplyVO> taskUserList(@Param("page")Page<BgtProjectTaskUserDTO> queryDTOPage, @Param("dto") BgtProjectTaskUserDTO dto);
|
||||
|
||||
//获取指定用户的所有招工
|
||||
List<WgzAppUserAllRecruitmentTwo> userAllRecruitment(@Param("userId") Long userId);
|
||||
}
|
||||
|
@ -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<BgtProjectR
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取当前用户的所有招工
|
||||
*/
|
||||
List<WgzAppUserAllRecruitmentTwo> userAllRecruitment();
|
||||
|
||||
/**
|
||||
* 根据用户唯一标识去查询当前进场的工地信息
|
||||
*/
|
||||
|
@ -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<BgtProjec
|
||||
return baseMapper.appQueryList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzAppUserAllRecruitmentTwo> userAllRecruitment() {
|
||||
//1、获取到所有项目
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
List<WgzAppUserAllRecruitmentTwo> res = baseMapper.userAllRecruitment(appUserId);
|
||||
//2、获取到当前人员所在的工地
|
||||
for (WgzAppUserAllRecruitmentTwo re : res) {
|
||||
LambdaQueryWrapper<BgtProjectRecruitApply> last = new LambdaQueryWrapper<BgtProjectRecruitApply>()
|
||||
.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) {
|
||||
|
@ -68,6 +68,7 @@ public interface IAnnexService extends IServicePlus<Annex> {
|
||||
* @return
|
||||
*/
|
||||
void insertBatch(List<AnnexDTO> annexList);
|
||||
Boolean insertBatchLc(List<AnnexDTO> annexList);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -116,6 +116,21 @@ public class AnnexServiceImpl extends ServicePlusImpl<AnnexMapper, Annex> implem
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertBatchLc(List<AnnexDTO> annexList) {
|
||||
List<Annex> 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) {
|
||||
|
@ -12,4 +12,5 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("请假·历史请假记录请求对象")
|
||||
public class WgzAppLeaveHistoryListPageReq extends PageReq {
|
||||
|
||||
}
|
||||
|
@ -70,8 +70,8 @@ public class WgzAppRealNameAuthenticationReq implements Serializable {
|
||||
@NotBlank(message = "银行卡号不能为空")
|
||||
private String cardNo;
|
||||
|
||||
@ApiModelProperty("附件实体数据")
|
||||
private List<Annex> annex;
|
||||
// @ApiModelProperty("附件实体数据")
|
||||
// private List<Annex> annex;
|
||||
|
||||
@ApiModelProperty("工种,多个逗号分隔")
|
||||
private String typeOfWork;
|
||||
|
@ -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> annex;
|
||||
}
|
@ -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<WgzAppUserAllRecruitmentTwo> list;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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<WgzUserMapper, WgzUser>
|
||||
@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<WgzUserMapper, WgzUser>
|
||||
if (update == 0){
|
||||
throw new RuntimeException("当前用户不存在!");
|
||||
}
|
||||
|
||||
//2、新增附件
|
||||
List<Annex> annex = req.getAnnex();
|
||||
List<AnnexDTO> 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> annex = req.getAnnex();
|
||||
// List<AnnexDTO> 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;
|
||||
}
|
||||
|
||||
|
@ -249,4 +249,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by bpra.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="userAllRecruitment" resultType="com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo">
|
||||
SELECT
|
||||
b.id as recruitId,
|
||||
b.recruit_name
|
||||
FROM
|
||||
bgt_project_recruit_apply as a
|
||||
LEFT JOIN bgt_project_recruit as b on(b.id = a.recruit_id)
|
||||
WHERE
|
||||
a.user_id = #{userId}
|
||||
and (a.status = "5" or a.status = "6")
|
||||
and a.del_flag = "0"
|
||||
GROUP BY a.recruit_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user