更新检测员工相关功能
This commit is contained in:
parent
3ed7b6f752
commit
756ce20950
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.inspection.controller;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.inspection.enums.DriverLicenseType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description: 下拉框controller
|
||||
* @Author: 86187
|
||||
* @Date: 2025/01/22 16:47
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/common/down")
|
||||
public class CommonDownController {
|
||||
|
||||
/**
|
||||
* 驾驶证类型下拉框
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDriverLicenseType")
|
||||
public CommonResult getDriverLicenseType() {
|
||||
return CommonResult.success(DriverLicenseType.getAll());
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
package cn.iocoder.yudao.module.inspection.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.enums.DriverLicenseType;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static io.micrometer.core.instrument.config.validate.Validated.valid;
|
||||
|
||||
/**
|
||||
* inspectionFileController
|
||||
*
|
||||
* @author zcy
|
||||
* @date 2023-10-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/inspectionStaff")
|
||||
public class InspectionStaffController extends BaseController {
|
||||
@Autowired
|
||||
private InspectionStaffService inspectionStaffService;
|
||||
|
||||
/**
|
||||
* 获取检测员工列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CommonResult list(InspectionStaffQuery query,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<InspectionStaffSaveVo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionStaffSaveVo> list = inspectionStaffService.getList(page, query);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检测员工详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public CommonResult get(Long id) {
|
||||
return success(inspectionStaffService.get(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑检测员工
|
||||
*
|
||||
* @param inspectionStaff 员工信息
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public CommonResult update(@RequestBody InspectionStaffSaveVo inspectionStaff) {
|
||||
Assert.notNull(inspectionStaff.getUserId(), "员工id不能为空");
|
||||
//校验
|
||||
verify(inspectionStaff);
|
||||
return success(inspectionStaffService.edit(inspectionStaff));
|
||||
}
|
||||
|
||||
@GetMapping("/get-import-template")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
// 手动创建导出 demo
|
||||
// 输出
|
||||
ExcelUtils.write(response, "用户导入模板.xls", "用户列表", StaffImportExcelVO.class, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验信息
|
||||
*
|
||||
* @param inspectionStaff
|
||||
*/
|
||||
public void verify(InspectionStaffSaveVo inspectionStaff) {
|
||||
if (ObjectUtil.isNotEmpty(inspectionStaff.getIdCard())) { //身份证
|
||||
boolean validCard = IdcardUtil.isValidCard(inspectionStaff.getIdCard());
|
||||
if (!validCard) {
|
||||
throw new RuntimeException("身份证格式不正确");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(inspectionStaff.getMobile())) { //手机号
|
||||
boolean phone = PhoneUtil.isPhone(inspectionStaff.getMobile());
|
||||
if (!phone) {
|
||||
throw new RuntimeException("手机号格式不正确");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(inspectionStaff.getEmail())) { //邮箱
|
||||
boolean email = Validator.isEmail(inspectionStaff.getEmail());
|
||||
if (!email) {
|
||||
throw new RuntimeException("邮箱格式不正确");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(inspectionStaff.getEmergencyContactPhone())) { //紧急联系人手机号
|
||||
boolean phone = PhoneUtil.isPhone(inspectionStaff.getEmergencyContactPhone());
|
||||
if (!phone) {
|
||||
throw new RuntimeException("紧急联系人手机号格式不正确");
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(inspectionStaff.getDriverLicenseTypeArr())) {
|
||||
// 以逗号隔开
|
||||
String driverLicenseType = CollUtil.join(inspectionStaff.getDriverLicenseTypeArr(), ",");
|
||||
inspectionStaff.setDriverLicenseType(driverLicenseType);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,14 +16,11 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
public class InspectionStaff extends TenantBaseDO {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Integer userId;
|
||||
@TableId(type = IdType.NONE)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
@ -49,12 +46,6 @@ public class InspectionStaff extends TenantBaseDO {
|
||||
@TableField("school")
|
||||
private String school;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@TableField("mobile")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 短号
|
||||
*/
|
||||
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.inspection.enums;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.vo.CommonDownRespVo;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Getter
|
||||
public enum DriverLicenseType {
|
||||
A1("A1", "小型汽车"),
|
||||
A2("A2", "小型自动挡汽车"),
|
||||
A3("A3", "低速载货汽车"),
|
||||
B1("B1", "中型客车"),
|
||||
B2("B2", "大型货车"),
|
||||
C1("C1", "小型汽车"),
|
||||
C2("C2", "小型自动挡汽车"),
|
||||
C3("C3", "低速载货汽车"),
|
||||
C4("C4", "三轮汽车"),
|
||||
C5("C5", "残疾人专用小型自动挡载客汽车"),
|
||||
D("D", "城市公交车"),
|
||||
E("E", "大型客车"),
|
||||
F("F", "大型货车"),
|
||||
M("M", "轮式自行机械车"),
|
||||
N("N", "无轨电车"),
|
||||
P("P", "有轨电车");
|
||||
|
||||
private final String id;
|
||||
private final String msg;
|
||||
|
||||
DriverLicenseType(String id, String msg) {
|
||||
this.id = id;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static List<CommonDownRespVo> getAll() {
|
||||
DriverLicenseType[] values = DriverLicenseType.values();
|
||||
return Arrays.stream(values).map(item -> {
|
||||
CommonDownRespVo commonDownRespVo = new CommonDownRespVo();
|
||||
commonDownRespVo.setId(item.getId());
|
||||
commonDownRespVo.setMsg(item.getMsg());
|
||||
return commonDownRespVo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package cn.iocoder.yudao.module.inspection.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionGoods;
|
||||
import cn.iocoder.yudao.module.inspection.query.GoodsQuery;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.vo.GoodsVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.PartnerListVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -21,5 +24,21 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionStaffMapper extends BaseMapper<InspectionStaff> {
|
||||
/**
|
||||
* 分页查询检测员工子表
|
||||
*
|
||||
* @param page
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
IPage<InspectionStaffSaveVo> getList(Page<InspectionStaffSaveVo> page, InspectionStaffQuery query);
|
||||
|
||||
/**
|
||||
* 根据条件查询检测员工子表
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
InspectionStaffSaveVo get(Long id);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.inspection.query;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 检测员工vo
|
||||
* @Author: 86187
|
||||
* @Date: 2025/01/22 13:36
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class InspectionStaffQuery extends InspectionStaff {
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 用户手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
**/
|
||||
private String sex;
|
||||
}
|
@ -1,14 +1,9 @@
|
||||
package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionGoodsSku;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionCategory;
|
||||
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionGoods;
|
||||
import cn.iocoder.yudao.module.inspection.entity.*;
|
||||
import cn.iocoder.yudao.module.inspection.query.GoodsQuery;
|
||||
import cn.iocoder.yudao.module.inspection.vo.GoodsDetail;
|
||||
import cn.iocoder.yudao.module.inspection.vo.GoodsVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.OrderGoodsInfo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.PartnerListVo;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.vo.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -22,5 +17,30 @@ import java.util.List;
|
||||
* @since 2023-08-01 16:04:14
|
||||
*/
|
||||
public interface InspectionStaffService extends IService<InspectionStaff> {
|
||||
|
||||
/**
|
||||
* 获取检测员工分页
|
||||
*
|
||||
* @param page
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
IPage<InspectionStaffSaveVo> getList(Page<InspectionStaffSaveVo> page, InspectionStaffQuery query);
|
||||
|
||||
/**
|
||||
* 编辑检测员工
|
||||
*
|
||||
* @param inspectionStaffVo
|
||||
* @return
|
||||
*/
|
||||
boolean edit(InspectionStaffSaveVo inspectionStaffVo);
|
||||
|
||||
/**
|
||||
* 获取检测员工详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
InspectionStaffSaveVo get(Long id);
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,26 @@
|
||||
package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionStaffMapper;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* 检测员工子表(InspectionStaff)表服务实现类
|
||||
@ -15,5 +30,62 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service("InspectionStaffService")
|
||||
public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMapper, InspectionStaff> implements InspectionStaffService {
|
||||
|
||||
@Autowired
|
||||
private AdminUserService userService;
|
||||
|
||||
/**
|
||||
* 获取检测员工分页
|
||||
*
|
||||
* @param page
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<InspectionStaffSaveVo> getList(Page<InspectionStaffSaveVo> page, InspectionStaffQuery query) {
|
||||
return baseMapper.getList(page, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑检测员工
|
||||
*
|
||||
* @param inspectionStaffVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean edit(InspectionStaffSaveVo inspectionStaffVo) {
|
||||
//更新system_users主表
|
||||
UserSaveReqVO userDTO = BeanUtil.copyProperties(inspectionStaffVo, UserSaveReqVO.class);
|
||||
userDTO.setId(inspectionStaffVo.getUserId());
|
||||
userService.updateUser(userDTO);
|
||||
|
||||
//查询员工子表是否存在数据
|
||||
InspectionStaff staff = this.getOne(Wrappers.<InspectionStaff>lambdaQuery().eq(InspectionStaff::getUserId, inspectionStaffVo.getUserId()));
|
||||
if (ObjectUtil.isNull(staff)) {
|
||||
InspectionStaff inspectionStaff = BeanUtil.copyProperties(inspectionStaffVo, InspectionStaff.class);
|
||||
//新增
|
||||
return this.save(inspectionStaff);
|
||||
} else {
|
||||
//更新检测员工子表
|
||||
BeanUtil.copyProperties(inspectionStaffVo, staff);
|
||||
return this.updateById(staff);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检测员工详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public InspectionStaffSaveVo get(Long id) {
|
||||
InspectionStaffSaveVo inspectionStaffSaveVo = baseMapper.get(id);
|
||||
//将驾驶证类型转为数组
|
||||
if (ObjectUtil.isNotEmpty(inspectionStaffSaveVo.getDriverLicenseType())) {
|
||||
inspectionStaffSaveVo.setDriverLicenseTypeArr(Arrays.asList(inspectionStaffSaveVo.getDriverLicenseType().split(",")));
|
||||
}
|
||||
return inspectionStaffSaveVo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 通用枚举下拉框
|
||||
* @Author: 86187
|
||||
* @Date: 2025/01/22 16:43
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CommonDownRespVo {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 检测员工vo
|
||||
* @Author: 86187
|
||||
* @Date: 2025/01/22 13:36
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class InspectionStaffSaveVo extends InspectionStaff {
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
private Long deptId;
|
||||
/**
|
||||
* 用户手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
**/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 驾驶证类型集合
|
||||
*/
|
||||
private List<String> driverLicenseTypeArr;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 检测员工Excel
|
||||
* @Author: 86187
|
||||
* @Date: 2025/01/22 17:23
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class StaffImportExcelVO {
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("员工姓名")
|
||||
private String username;
|
||||
|
||||
@ExcelProperty("身份证号码")
|
||||
private String idCard;
|
||||
|
||||
@ExcelProperty("居住地址")
|
||||
private String address;
|
||||
|
||||
@ExcelProperty("学历")
|
||||
private String educational;
|
||||
|
||||
@ExcelProperty("毕业院校")
|
||||
private String school;
|
||||
|
||||
@ExcelProperty("电话号码")
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty("短号")
|
||||
private String shortNumber;
|
||||
|
||||
@ExcelProperty("入职时间")
|
||||
private String joinDate;
|
||||
|
||||
@ExcelProperty("试用期")
|
||||
private String probationPeriod;
|
||||
|
||||
@ExcelProperty("社保购买日期")
|
||||
private String socialSecurityBuyDate;
|
||||
|
||||
@ExcelProperty("紧急联系人")
|
||||
private String emergencyContactName;
|
||||
|
||||
@ExcelProperty("紧急联系人电话")
|
||||
private String emergencyContactPhone;
|
||||
|
||||
@ExcelProperty("驾驶证类型")
|
||||
private String driverLicenseType;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
}
|
@ -3,4 +3,69 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionStaffMapper">
|
||||
<select id="getList" resultType="cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo">
|
||||
SELECT distinct
|
||||
su.id,
|
||||
su.nickname,
|
||||
su.username,
|
||||
su.user_type,
|
||||
su.remark,
|
||||
su.dept_id,
|
||||
su.mobile,
|
||||
su.password,
|
||||
su.avatar,
|
||||
su.sex,
|
||||
su.status,
|
||||
iss.id_card,
|
||||
iss.address,
|
||||
iss.educational,
|
||||
iss.school,
|
||||
iss.short_number,
|
||||
iss.join_date,
|
||||
iss.probation_period,
|
||||
iss.social_security_buy_date,
|
||||
iss.emergency_contact_name,
|
||||
iss.emergency_contact_phone,
|
||||
iss.driver_license_type
|
||||
FROM system_users su
|
||||
left join system_user_role sur on su.id = sur.user_id
|
||||
left join system_role sr on sur.role_id = sr.id
|
||||
left join inspection_staff iss on iss.user_id = su.id
|
||||
<where>
|
||||
sr.service_package_id = 'jiance' and sr.code != 'jcyh'
|
||||
</where>
|
||||
</select>
|
||||
<select id="get" resultType="cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo">
|
||||
SELECT distinct
|
||||
su.id as id,
|
||||
su.nickname,
|
||||
su.username,
|
||||
su.user_type,
|
||||
su.remark,
|
||||
su.dept_id,
|
||||
su.mobile,
|
||||
su.password,
|
||||
su.avatar,
|
||||
su.sex,
|
||||
su.status,
|
||||
iss.id_card,
|
||||
iss.address,
|
||||
iss.educational,
|
||||
iss.school,
|
||||
iss.short_number,
|
||||
iss.join_date,
|
||||
iss.probation_period,
|
||||
iss.social_security_buy_date,
|
||||
iss.emergency_contact_name,
|
||||
iss.emergency_contact_phone,
|
||||
iss.driver_license_type
|
||||
FROM system_users su
|
||||
left join system_user_role sur on su.id = sur.user_id
|
||||
left join system_role sr on sur.role_id = sr.id
|
||||
left join inspection_staff iss on iss.user_id = su.id
|
||||
<where>
|
||||
sr.service_package_id = 'jiance' and sr.code != 'jcyh'
|
||||
and su.id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -54,5 +54,9 @@ public class UserDTO {
|
||||
* 用户openId
|
||||
**/
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and sr.role_id = #{role.roleId}
|
||||
</if>
|
||||
<if test="role.nickname != null">
|
||||
and su.nickname like CONCAT('%',#{role.nickname},'%')
|
||||
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like CONCAT('%',#{role.nickname},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user