分包
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.project.domain.dto.projectteammember;
|
package org.dromara.project.domain.dto.projectteammember;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -45,4 +46,9 @@ public class BusProjectTeamMemberCreateReq implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包公司id
|
||||||
|
*/
|
||||||
|
private Long contractorId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,11 +176,13 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
||||||
.eq(SubConstructionUser::getId, constructionUser.getId())
|
.eq(SubConstructionUser::getId, constructionUser.getId())
|
||||||
.set(SubConstructionUser::getProjectId, req.getProjectId())
|
.set(SubConstructionUser::getProjectId, req.getProjectId())
|
||||||
|
.set(req.getContractorId()!=null,SubConstructionUser::getContractorId, req.getContractorId())
|
||||||
.set(SubConstructionUser::getTeamId, projectTeamMember.getTeamId())
|
.set(SubConstructionUser::getTeamId, projectTeamMember.getTeamId())
|
||||||
.set(SubConstructionUser::getTeamName, projectTeam.getTeamName())
|
.set(SubConstructionUser::getTeamName, projectTeam.getTeamName())
|
||||||
.set(SubConstructionUser::getEntryDate, new Date())
|
.set(SubConstructionUser::getEntryDate, new Date())
|
||||||
.set(SubConstructionUser::getLeaveDate, null)
|
.set(SubConstructionUser::getLeaveDate, null)
|
||||||
.set(SubConstructionUser::getExitStatus, "0")
|
.set(SubConstructionUser::getExitStatus, "0")
|
||||||
|
.set(SubConstructionUser::getUserRole, "0")
|
||||||
.set(StrUtil.isNotBlank(req.getTypeOfWork()),SubConstructionUser::getTypeOfWork,req.getTypeOfWork())
|
.set(StrUtil.isNotBlank(req.getTypeOfWork()),SubConstructionUser::getTypeOfWork,req.getTypeOfWork())
|
||||||
.set(constructionUser.getFirstDate() == null, SubConstructionUser::getFirstDate, LocalDate.now());
|
.set(constructionUser.getFirstDate() == null, SubConstructionUser::getFirstDate, LocalDate.now());
|
||||||
constructionUserService.update(constructionUserLuw);
|
constructionUserService.update(constructionUserLuw);
|
||||||
@ -212,6 +214,10 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
|
|
||||||
roleService.cleanOnlineUser(Collections.singletonList(constructionUser.getSysUserId()));
|
roleService.cleanOnlineUser(Collections.singletonList(constructionUser.getSysUserId()));
|
||||||
|
|
||||||
|
if(req.getContractorId()!=null){
|
||||||
|
userService.updateFb(constructionUser.getSysUserId(),req.getContractorId(),false);
|
||||||
|
}
|
||||||
|
|
||||||
return projectTeamMember.getId();
|
return projectTeamMember.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -404,7 +404,7 @@ public class SysUserController extends BaseController {
|
|||||||
@PutMapping("/fb/{userId}/{contractorId}")
|
@PutMapping("/fb/{userId}/{contractorId}")
|
||||||
public R<Boolean> updateFb(@PathVariable("userId") Long userId,
|
public R<Boolean> updateFb(@PathVariable("userId") Long userId,
|
||||||
@PathVariable("contractorId") Long contractorId) {
|
@PathVariable("contractorId") Long contractorId) {
|
||||||
return R.ok(userService.updateFb(userId, contractorId));
|
return R.ok(userService.updateFb(userId, contractorId,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -275,11 +275,13 @@ public interface ISysUserService {
|
|||||||
|
|
||||||
List<SysUserVo> selectUserListByAppUserType(String appUserType,Long projectId,Long contractorId);
|
List<SysUserVo> selectUserListByAppUserType(String appUserType,Long projectId,Long contractorId);
|
||||||
|
|
||||||
Boolean updateFb(Long userId,Long contractorId);
|
Boolean updateFb(Long userId,Long contractorId,Boolean isSub);
|
||||||
|
|
||||||
List<SysUser> selectUserByRoleIdAndProjectId(Long roleId,Long projectId);
|
List<SysUser> selectUserByRoleIdAndProjectId(Long roleId,Long projectId);
|
||||||
|
|
||||||
List<SysUser> selectUserByRoleIdsAndProjectId(List<Long> roleIds,Long projectId);
|
List<SysUser> selectUserByRoleIdsAndProjectId(List<Long> roleIds,Long projectId);
|
||||||
|
|
||||||
String queryNameById(Long id);
|
String queryNameById(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1223,17 +1223,20 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateFb(Long userId,Long contractorId) {
|
public Boolean updateFb(Long userId,Long contractorId,Boolean isSub) {
|
||||||
SysUser sysUser = baseMapper.selectById(userId);
|
SysUser sysUser = baseMapper.selectById(userId);
|
||||||
sysUser.setContractorId(contractorId);
|
sysUser.setContractorId(contractorId);
|
||||||
|
|
||||||
SubConstructionUser constructionUser = constructionUserService.lambdaQuery()
|
if(isSub){
|
||||||
.eq(SubConstructionUser::getSysUserId, userId)
|
SubConstructionUser constructionUser = constructionUserService.lambdaQuery()
|
||||||
.one();
|
.eq(SubConstructionUser::getSysUserId, userId)
|
||||||
if(constructionUser != null){
|
.one();
|
||||||
constructionUser.setContractorId(contractorId);
|
if(constructionUser != null){
|
||||||
constructionUserService.updateById(constructionUser);
|
constructionUser.setContractorId(contractorId);
|
||||||
|
constructionUserService.updateById(constructionUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseMapper.updateById(sysUser)>0;
|
return baseMapper.updateById(sysUser)>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user