运维模块重命名提交
This commit is contained in:
		| @ -17,9 +17,9 @@ import org.dromara.common.core.validate.AddGroup; | ||||
| import org.dromara.common.core.validate.EditGroup; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.excel.utils.ExcelUtil; | ||||
| import org.dromara.ops.personnel.domain.vo.SubConstructionUserVo; | ||||
| import org.dromara.ops.personnel.domain.bo.SubConstructionUserBo; | ||||
| import org.dromara.ops.personnel.service.ISubConstructionUserService; | ||||
| import org.dromara.ops.personnel.domain.vo.OpsUserVo; | ||||
| import org.dromara.ops.personnel.domain.bo.OpsUserBo; | ||||
| import org.dromara.ops.personnel.service.IOpsUserService; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| 
 | ||||
| /** | ||||
| @ -33,16 +33,16 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @RequiredArgsConstructor | ||||
| @RestController | ||||
| @RequestMapping("/constructionUser") | ||||
| public class SubConstructionUserController extends BaseController { | ||||
| public class OpsUserController extends BaseController { | ||||
| 
 | ||||
|     private final ISubConstructionUserService subConstructionUserService; | ||||
|     private final IOpsUserService subConstructionUserService; | ||||
| 
 | ||||
|     /** | ||||
|      * 查询运维人员列表 | ||||
|      */ | ||||
|     @SaCheckPermission("personnel:constructionUser:list") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<SubConstructionUserVo> list(SubConstructionUserBo bo, PageQuery pageQuery) { | ||||
|     public TableDataInfo<OpsUserVo> list(OpsUserBo bo, PageQuery pageQuery) { | ||||
|         return subConstructionUserService.queryPageList(bo, pageQuery); | ||||
|     } | ||||
| 
 | ||||
| @ -52,9 +52,9 @@ public class SubConstructionUserController extends BaseController { | ||||
|     @SaCheckPermission("personnel:constructionUser:export") | ||||
|     @Log(title = "运维人员", businessType = BusinessType.EXPORT) | ||||
|     @PostMapping("/export") | ||||
|     public void export(SubConstructionUserBo bo, HttpServletResponse response) { | ||||
|         List<SubConstructionUserVo> list = subConstructionUserService.queryList(bo); | ||||
|         ExcelUtil.exportExcel(list, "运维人员", SubConstructionUserVo.class, response); | ||||
|     public void export(OpsUserBo bo, HttpServletResponse response) { | ||||
|         List<OpsUserVo> list = subConstructionUserService.queryList(bo); | ||||
|         ExcelUtil.exportExcel(list, "运维人员", OpsUserVo.class, response); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
| @ -64,7 +64,7 @@ public class SubConstructionUserController extends BaseController { | ||||
|      */ | ||||
|     @SaCheckPermission("personnel:constructionUser:query") | ||||
|     @GetMapping("/{id}") | ||||
|     public R<SubConstructionUserVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|     public R<OpsUserVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                      @PathVariable("id") Long id) { | ||||
|         return R.ok(subConstructionUserService.queryById(id)); | ||||
|     } | ||||
| @ -76,7 +76,7 @@ public class SubConstructionUserController extends BaseController { | ||||
|     @Log(title = "运维人员", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated(AddGroup.class) @RequestBody SubConstructionUserBo bo) { | ||||
|     public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsUserBo bo) { | ||||
|         return toAjax(subConstructionUserService.insertByBo(bo)); | ||||
|     } | ||||
| 
 | ||||
| @ -87,7 +87,7 @@ public class SubConstructionUserController extends BaseController { | ||||
|     @Log(title = "运维人员", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated(EditGroup.class) @RequestBody SubConstructionUserBo bo) { | ||||
|     public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsUserBo bo) { | ||||
|         return toAjax(subConstructionUserService.updateByBo(bo)); | ||||
|     } | ||||
| 
 | ||||
| @ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.*; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import java.util.Date; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| 
 | ||||
| import java.io.Serial; | ||||
| 
 | ||||
| @ -17,8 +16,8 @@ import java.io.Serial; | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @TableName("sub_construction_user") | ||||
| public class SubConstructionUser extends BaseEntity { | ||||
| @TableName("ops_user") | ||||
| public class OpsUser extends BaseEntity { | ||||
| 
 | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
| @ -1,6 +1,6 @@ | ||||
| package org.dromara.ops.personnel.domain.bo; | ||||
| 
 | ||||
| import org.dromara.ops.personnel.domain.SubConstructionUser; | ||||
| import org.dromara.ops.personnel.domain.OpsUser; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
| import org.dromara.common.core.validate.AddGroup; | ||||
| import org.dromara.common.core.validate.EditGroup; | ||||
| @ -9,7 +9,6 @@ import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import jakarta.validation.constraints.*; | ||||
| import java.util.Date; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| 
 | ||||
| /** | ||||
|  * 运维人员业务对象 sub_construction_user | ||||
| @ -19,8 +18,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @AutoMapper(target = SubConstructionUser.class, reverseConvertGenerate = false) | ||||
| public class SubConstructionUserBo extends BaseEntity { | ||||
| @AutoMapper(target = OpsUser.class, reverseConvertGenerate = false) | ||||
| public class OpsUserBo extends BaseEntity { | ||||
| 
 | ||||
|     /** | ||||
|      * | ||||
| @ -1,7 +1,6 @@ | ||||
| package org.dromara.ops.personnel.domain.vo; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| 
 | ||||
| import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import cn.idev.excel.annotation.ExcelProperty; | ||||
| @ -9,12 +8,10 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.ops.personnel.domain.SubConstructionUser; | ||||
| import org.dromara.ops.personnel.domain.OpsUser; | ||||
| 
 | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
| @ -25,8 +22,8 @@ import java.util.Date; | ||||
|  */ | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| @AutoMapper(target = SubConstructionUser.class) | ||||
| public class SubConstructionUserVo implements Serializable { | ||||
| @AutoMapper(target = OpsUser.class) | ||||
| public class OpsUserVo implements Serializable { | ||||
| 
 | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
| @ -0,0 +1,15 @@ | ||||
| package org.dromara.ops.personnel.mapper; | ||||
|  | ||||
| import org.dromara.ops.personnel.domain.OpsUser; | ||||
| import org.dromara.ops.personnel.domain.vo.OpsUserVo; | ||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||
|  | ||||
| /** | ||||
|  * 运维人员Mapper接口 | ||||
|  * | ||||
|  * @author LionLi | ||||
|  * @date 2025-09-16 | ||||
|  */ | ||||
| public interface OpsUserMapper extends BaseMapperPlus<OpsUser, OpsUserVo> { | ||||
|  | ||||
| } | ||||
| @ -1,15 +0,0 @@ | ||||
| package org.dromara.ops.personnel.mapper; | ||||
|  | ||||
| import org.dromara.ops.personnel.domain.SubConstructionUser; | ||||
| import org.dromara.ops.personnel.domain.vo.SubConstructionUserVo; | ||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||
|  | ||||
| /** | ||||
|  * 运维人员Mapper接口 | ||||
|  * | ||||
|  * @author LionLi | ||||
|  * @date 2025-09-16 | ||||
|  */ | ||||
| public interface SubConstructionUserMapper extends BaseMapperPlus<SubConstructionUser, SubConstructionUserVo> { | ||||
|  | ||||
| } | ||||
| @ -1,8 +1,7 @@ | ||||
| package org.dromara.ops.personnel.service; | ||||
| 
 | ||||
| import org.dromara.ops.personnel.domain.SubConstructionUser; | ||||
| import org.dromara.ops.personnel.domain.vo.SubConstructionUserVo; | ||||
| import org.dromara.ops.personnel.domain.bo.SubConstructionUserBo; | ||||
| import org.dromara.ops.personnel.domain.vo.OpsUserVo; | ||||
| import org.dromara.ops.personnel.domain.bo.OpsUserBo; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| 
 | ||||
| @ -15,7 +14,7 @@ import java.util.List; | ||||
|  * @author LionLi | ||||
|  * @date 2025-09-16 | ||||
|  */ | ||||
| public interface ISubConstructionUserService { | ||||
| public interface IOpsUserService { | ||||
| 
 | ||||
|     /** | ||||
|      * 查询运维人员 | ||||
| @ -23,7 +22,7 @@ public interface ISubConstructionUserService { | ||||
|      * @param id 主键 | ||||
|      * @return 运维人员 | ||||
|      */ | ||||
|     SubConstructionUserVo queryById(Long id); | ||||
|     OpsUserVo queryById(Long id); | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询运维人员列表 | ||||
| @ -32,7 +31,7 @@ public interface ISubConstructionUserService { | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 运维人员分页列表 | ||||
|      */ | ||||
|     TableDataInfo<SubConstructionUserVo> queryPageList(SubConstructionUserBo bo, PageQuery pageQuery); | ||||
|     TableDataInfo<OpsUserVo> queryPageList(OpsUserBo bo, PageQuery pageQuery); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询符合条件的运维人员列表 | ||||
| @ -40,7 +39,7 @@ public interface ISubConstructionUserService { | ||||
|      * @param bo 查询条件 | ||||
|      * @return 运维人员列表 | ||||
|      */ | ||||
|     List<SubConstructionUserVo> queryList(SubConstructionUserBo bo); | ||||
|     List<OpsUserVo> queryList(OpsUserBo bo); | ||||
| 
 | ||||
|     /** | ||||
|      * 新增运维人员 | ||||
| @ -48,7 +47,7 @@ public interface ISubConstructionUserService { | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     Boolean insertByBo(SubConstructionUserBo bo); | ||||
|     Boolean insertByBo(OpsUserBo bo); | ||||
| 
 | ||||
|     /** | ||||
|      * 修改运维人员 | ||||
| @ -56,7 +55,7 @@ public interface ISubConstructionUserService { | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean updateByBo(SubConstructionUserBo bo); | ||||
|     Boolean updateByBo(OpsUserBo bo); | ||||
| 
 | ||||
|     /** | ||||
|      * 校验并批量删除运维人员信息 | ||||
| @ -0,0 +1,164 @@ | ||||
| package org.dromara.ops.personnel.service.impl; | ||||
|  | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.ops.personnel.domain.bo.OpsUserBo; | ||||
| import org.dromara.ops.personnel.domain.vo.OpsUserVo; | ||||
| import org.dromara.ops.personnel.domain.OpsUser; | ||||
| import org.dromara.ops.personnel.mapper.OpsUserMapper; | ||||
| import org.dromara.ops.personnel.service.IOpsUserService; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Collection; | ||||
|  | ||||
| /** | ||||
|  * 运维人员Service业务层处理 | ||||
|  * | ||||
|  * @author LionLi | ||||
|  * @date 2025-09-16 | ||||
|  */ | ||||
| @Slf4j | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| public class OpsUserServiceImpl implements IOpsUserService { | ||||
|  | ||||
|     private final OpsUserMapper baseMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询运维人员 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 运维人员 | ||||
|      */ | ||||
|     @Override | ||||
|     public OpsUserVo queryById(Long id){ | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页查询运维人员列表 | ||||
|      * | ||||
|      * @param bo        查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 运维人员分页列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public TableDataInfo<OpsUserVo> queryPageList(OpsUserBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<OpsUser> lqw = buildQueryWrapper(bo); | ||||
|         Page<OpsUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的运维人员列表 | ||||
|      * | ||||
|      * @param bo 查询条件 | ||||
|      * @return 运维人员列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<OpsUserVo> queryList(OpsUserBo bo) { | ||||
|         LambdaQueryWrapper<OpsUser> lqw = buildQueryWrapper(bo); | ||||
|         return baseMapper.selectVoList(lqw); | ||||
|     } | ||||
|  | ||||
|     private LambdaQueryWrapper<OpsUser> buildQueryWrapper(OpsUserBo bo) { | ||||
|         Map<String, Object> params = bo.getParams(); | ||||
|         LambdaQueryWrapper<OpsUser> lqw = Wrappers.lambdaQuery(); | ||||
|         lqw.orderByAsc(OpsUser::getId); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getFacePic()), OpsUser::getFacePic, bo.getFacePic()); | ||||
|         lqw.eq(bo.getSysUserId() != null, OpsUser::getSysUserId, bo.getSysUserId()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getUserName()), OpsUser::getUserName, bo.getUserName()); | ||||
|         lqw.eq(bo.getProjectId() != null, OpsUser::getProjectId, bo.getProjectId()); | ||||
|         lqw.eq(bo.getContractorId() != null, OpsUser::getContractorId, bo.getContractorId()); | ||||
|         lqw.eq(bo.getTeamId() != null, OpsUser::getTeamId, bo.getTeamId()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getTeamName()), OpsUser::getTeamName, bo.getTeamName()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OpsUser::getStatus, bo.getStatus()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getPhone()), OpsUser::getPhone, bo.getPhone()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSex()), OpsUser::getSex, bo.getSex()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getNation()), OpsUser::getNation, bo.getNation()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzFrontPic()), OpsUser::getSfzFrontPic, bo.getSfzFrontPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzBackPic()), OpsUser::getSfzBackPic, bo.getSfzBackPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzNumber()), OpsUser::getSfzNumber, bo.getSfzNumber()); | ||||
|         lqw.eq(bo.getSfzStart() != null, OpsUser::getSfzStart, bo.getSfzStart()); | ||||
|         lqw.eq(bo.getSfzEnd() != null, OpsUser::getSfzEnd, bo.getSfzEnd()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzSite()), OpsUser::getSfzSite, bo.getSfzSite()); | ||||
|         lqw.eq(bo.getSfzBirth() != null, OpsUser::getSfzBirth, bo.getSfzBirth()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getNativePlace()), OpsUser::getNativePlace, bo.getNativePlace()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkPic()), OpsUser::getYhkPic, bo.getYhkPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkNumber()), OpsUser::getYhkNumber, bo.getYhkNumber()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkOpeningBank()), OpsUser::getYhkOpeningBank, bo.getYhkOpeningBank()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkCardholder()), OpsUser::getYhkCardholder, bo.getYhkCardholder()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getTypeOfWork()), OpsUser::getTypeOfWork, bo.getTypeOfWork()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getWageMeasureUnit()), OpsUser::getWageMeasureUnit, bo.getWageMeasureUnit()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSpecialWorkPic()), OpsUser::getSpecialWorkPic, bo.getSpecialWorkPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getClock()), OpsUser::getClock, bo.getClock()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getEntryDate()), OpsUser::getEntryDate, bo.getEntryDate()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getLeaveDate()), OpsUser::getLeaveDate, bo.getLeaveDate()); | ||||
|         lqw.eq(bo.getSalary() != null, OpsUser::getSalary, bo.getSalary()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getUserRole()), OpsUser::getUserRole, bo.getUserRole()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getExitStatus()), OpsUser::getExitStatus, bo.getExitStatus()); | ||||
|         lqw.eq(bo.getFirstDate() != null, OpsUser::getFirstDate, bo.getFirstDate()); | ||||
|         return lqw; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增运维人员 | ||||
|      * | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean insertByBo(OpsUserBo bo) { | ||||
|         OpsUser add = MapstructUtils.convert(bo, OpsUser.class); | ||||
|         validEntityBeforeSave(add); | ||||
|         boolean flag = baseMapper.insert(add) > 0; | ||||
|         if (flag) { | ||||
|             bo.setId(add.getId()); | ||||
|         } | ||||
|         return flag; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改运维人员 | ||||
|      * | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean updateByBo(OpsUserBo bo) { | ||||
|         OpsUser update = MapstructUtils.convert(bo, OpsUser.class); | ||||
|         validEntityBeforeSave(update); | ||||
|         return baseMapper.updateById(update) > 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(OpsUser entity){ | ||||
|         //TODO 做一些数据校验,如唯一约束 | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除运维人员信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         if(isValid){ | ||||
|             //TODO 做一些业务上的校验,判断是否需要校验 | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
| } | ||||
| @ -1,164 +0,0 @@ | ||||
| package org.dromara.ops.personnel.service.impl; | ||||
|  | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.ops.personnel.domain.bo.SubConstructionUserBo; | ||||
| import org.dromara.ops.personnel.domain.vo.SubConstructionUserVo; | ||||
| import org.dromara.ops.personnel.domain.SubConstructionUser; | ||||
| import org.dromara.ops.personnel.mapper.SubConstructionUserMapper; | ||||
| import org.dromara.ops.personnel.service.ISubConstructionUserService; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Collection; | ||||
|  | ||||
| /** | ||||
|  * 运维人员Service业务层处理 | ||||
|  * | ||||
|  * @author LionLi | ||||
|  * @date 2025-09-16 | ||||
|  */ | ||||
| @Slf4j | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| public class SubConstructionUserServiceImpl implements ISubConstructionUserService { | ||||
|  | ||||
|     private final SubConstructionUserMapper baseMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询运维人员 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 运维人员 | ||||
|      */ | ||||
|     @Override | ||||
|     public SubConstructionUserVo queryById(Long id){ | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页查询运维人员列表 | ||||
|      * | ||||
|      * @param bo        查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 运维人员分页列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public TableDataInfo<SubConstructionUserVo> queryPageList(SubConstructionUserBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<SubConstructionUser> lqw = buildQueryWrapper(bo); | ||||
|         Page<SubConstructionUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的运维人员列表 | ||||
|      * | ||||
|      * @param bo 查询条件 | ||||
|      * @return 运维人员列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SubConstructionUserVo> queryList(SubConstructionUserBo bo) { | ||||
|         LambdaQueryWrapper<SubConstructionUser> lqw = buildQueryWrapper(bo); | ||||
|         return baseMapper.selectVoList(lqw); | ||||
|     } | ||||
|  | ||||
|     private LambdaQueryWrapper<SubConstructionUser> buildQueryWrapper(SubConstructionUserBo bo) { | ||||
|         Map<String, Object> params = bo.getParams(); | ||||
|         LambdaQueryWrapper<SubConstructionUser> lqw = Wrappers.lambdaQuery(); | ||||
|         lqw.orderByAsc(SubConstructionUser::getId); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getFacePic()), SubConstructionUser::getFacePic, bo.getFacePic()); | ||||
|         lqw.eq(bo.getSysUserId() != null, SubConstructionUser::getSysUserId, bo.getSysUserId()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getUserName()), SubConstructionUser::getUserName, bo.getUserName()); | ||||
|         lqw.eq(bo.getProjectId() != null, SubConstructionUser::getProjectId, bo.getProjectId()); | ||||
|         lqw.eq(bo.getContractorId() != null, SubConstructionUser::getContractorId, bo.getContractorId()); | ||||
|         lqw.eq(bo.getTeamId() != null, SubConstructionUser::getTeamId, bo.getTeamId()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getTeamName()), SubConstructionUser::getTeamName, bo.getTeamName()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SubConstructionUser::getStatus, bo.getStatus()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getPhone()), SubConstructionUser::getPhone, bo.getPhone()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSex()), SubConstructionUser::getSex, bo.getSex()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getNation()), SubConstructionUser::getNation, bo.getNation()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzFrontPic()), SubConstructionUser::getSfzFrontPic, bo.getSfzFrontPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzBackPic()), SubConstructionUser::getSfzBackPic, bo.getSfzBackPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzNumber()), SubConstructionUser::getSfzNumber, bo.getSfzNumber()); | ||||
|         lqw.eq(bo.getSfzStart() != null, SubConstructionUser::getSfzStart, bo.getSfzStart()); | ||||
|         lqw.eq(bo.getSfzEnd() != null, SubConstructionUser::getSfzEnd, bo.getSfzEnd()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSfzSite()), SubConstructionUser::getSfzSite, bo.getSfzSite()); | ||||
|         lqw.eq(bo.getSfzBirth() != null, SubConstructionUser::getSfzBirth, bo.getSfzBirth()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getNativePlace()), SubConstructionUser::getNativePlace, bo.getNativePlace()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkPic()), SubConstructionUser::getYhkPic, bo.getYhkPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkNumber()), SubConstructionUser::getYhkNumber, bo.getYhkNumber()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkOpeningBank()), SubConstructionUser::getYhkOpeningBank, bo.getYhkOpeningBank()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getYhkCardholder()), SubConstructionUser::getYhkCardholder, bo.getYhkCardholder()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getTypeOfWork()), SubConstructionUser::getTypeOfWork, bo.getTypeOfWork()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getWageMeasureUnit()), SubConstructionUser::getWageMeasureUnit, bo.getWageMeasureUnit()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getSpecialWorkPic()), SubConstructionUser::getSpecialWorkPic, bo.getSpecialWorkPic()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getClock()), SubConstructionUser::getClock, bo.getClock()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getEntryDate()), SubConstructionUser::getEntryDate, bo.getEntryDate()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getLeaveDate()), SubConstructionUser::getLeaveDate, bo.getLeaveDate()); | ||||
|         lqw.eq(bo.getSalary() != null, SubConstructionUser::getSalary, bo.getSalary()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getUserRole()), SubConstructionUser::getUserRole, bo.getUserRole()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getExitStatus()), SubConstructionUser::getExitStatus, bo.getExitStatus()); | ||||
|         lqw.eq(bo.getFirstDate() != null, SubConstructionUser::getFirstDate, bo.getFirstDate()); | ||||
|         return lqw; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增运维人员 | ||||
|      * | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean insertByBo(SubConstructionUserBo bo) { | ||||
|         SubConstructionUser add = MapstructUtils.convert(bo, SubConstructionUser.class); | ||||
|         validEntityBeforeSave(add); | ||||
|         boolean flag = baseMapper.insert(add) > 0; | ||||
|         if (flag) { | ||||
|             bo.setId(add.getId()); | ||||
|         } | ||||
|         return flag; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改运维人员 | ||||
|      * | ||||
|      * @param bo 运维人员 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean updateByBo(SubConstructionUserBo bo) { | ||||
|         SubConstructionUser update = MapstructUtils.convert(bo, SubConstructionUser.class); | ||||
|         validEntityBeforeSave(update); | ||||
|         return baseMapper.updateById(update) > 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(SubConstructionUser entity){ | ||||
|         //TODO 做一些数据校验,如唯一约束 | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除运维人员信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         if(isValid){ | ||||
|             //TODO 做一些业务上的校验,判断是否需要校验 | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
| } | ||||
| @ -2,6 +2,6 @@ | ||||
| <!DOCTYPE mapper | ||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="org.dromara.ops.personnel.mapper.SubConstructionUserMapper"> | ||||
| <mapper namespace="org.dromara.ops.personnel.mapper.OpsUserMapper"> | ||||
| 
 | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user