Compare commits
2 Commits
4b6d66e9b4
...
cb3bea2ad3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cb3bea2ad3 | ||
![]() |
e230c5ab09 |
@ -105,15 +105,15 @@ public class CompanyStaffController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
@PostMapping("/createByExistUser")
|
||||
public CommonResult<?> createByExistUser(@RequestBody CompanyStaffRespVO staffRespVO){
|
||||
staffService.createByExistUser(staffRespVO);
|
||||
@PostMapping("/updateByExistUser")
|
||||
public CommonResult<?> updateByExistUser(@RequestBody CompanyStaffRespVO staffRespVO){
|
||||
staffService.updateByExistUser(staffRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
|
@ -120,13 +120,13 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("转正时间")
|
||||
private LocalDateTime formalDate;
|
||||
private Date formalDate;
|
||||
|
||||
/** 购买保险时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("购买保险时间")
|
||||
private LocalDateTime safeDate;
|
||||
private Date safeDate;
|
||||
|
||||
/** 附件的名称们,手动填写,逗号分隔,没有也要占位,和下面的urls对应 */
|
||||
private String fileNames;
|
||||
|
@ -141,12 +141,12 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
|
||||
CompanyStaffRespVO getMyAdviser(Long tenantId,String sysCode);
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
void createByExistUser(CompanyStaffRespVO staffRespVO);
|
||||
void updateByExistUser(CompanyStaffRespVO staffRespVO);
|
||||
|
||||
}
|
||||
|
@ -689,26 +689,43 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
public void createByExistUser(CompanyStaffRespVO staffRespVO){
|
||||
AdminUserRespDTO loginUser = getLoginUser();
|
||||
// 设置新增员工部门
|
||||
staffRespVO.setDeptId(loginUser.getDeptId());
|
||||
// 1 获取当前登录用户的企业信息给添加的员工
|
||||
DeptRespDTO loginDept = getLoginDept(loginUser.getDeptId());
|
||||
staffRespVO.setCorpId(loginDept.getCorpId());
|
||||
// 2 生成唯一推广码
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
if (!ObjectUtil.isNotEmpty(uniqueCode)) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
@Override
|
||||
public void updateByExistUser(CompanyStaffRespVO staffRespVO){
|
||||
if (ObjectUtil.isEmpty(staffRespVO.getId())){
|
||||
AdminUserRespDTO loginUser = getLoginUser();
|
||||
// 设置新增员工部门
|
||||
staffRespVO.setDeptId(loginUser.getDeptId());
|
||||
// 1 获取当前登录用户的企业信息给添加的员工
|
||||
DeptRespDTO loginDept = getLoginDept(loginUser.getDeptId());
|
||||
staffRespVO.setCorpId(loginDept.getCorpId());
|
||||
// 2 生成唯一推广码
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
if (!ObjectUtil.isNotEmpty(uniqueCode)) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
}
|
||||
staffRespVO.setUniqueCode(uniqueCode);
|
||||
// 3 保存员工信息到数据库
|
||||
baseMapper.insert(staffRespVO);
|
||||
}else {
|
||||
AdminUserRespDTO user = adminUserApi.getUser(staffRespVO.getUserId());
|
||||
AdminUserRespDTO newUser = new AdminUserRespDTO();
|
||||
newUser.setId(user.getId());
|
||||
if (!user.getUsername().equals(staffRespVO.getTel())){
|
||||
newUser.setUsername(staffRespVO.getTel());
|
||||
}
|
||||
if (!user.getNickname().equals(staffRespVO.getName())){
|
||||
newUser.setNickname(staffRespVO.getName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(newUser.getUsername()) || ObjectUtil.isNotEmpty(newUser.getNickname())){
|
||||
adminUserApi.updateUser(newUser);
|
||||
}
|
||||
baseMapper.updateById(staffRespVO);
|
||||
}
|
||||
staffRespVO.setUniqueCode(uniqueCode);
|
||||
// 3 保存员工信息到数据库
|
||||
baseMapper.insert(staffRespVO);
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +213,8 @@ where sig.partner_id =#{partnerId}
|
||||
<select id="inspectionList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
SELECT
|
||||
info.id,info.worker_name,info.worker_phone,info.worker_avatar,info.`status`,info.is_pass,info.start_time,info.end_time,step.title as lastTitle,
|
||||
su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial
|
||||
su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial,
|
||||
info.customer_source as customerSource, info.other_phone as otherPhone,oi.sku_id as skuId, oi.sku_name as skuName,oi.goods_price as goodsPrice
|
||||
from
|
||||
inspection_info info
|
||||
LEFT JOIN inspection_step_info step ON info.id = step.inspection_info_id
|
||||
|
@ -162,4 +162,13 @@ public interface AdminUserApi {
|
||||
**/
|
||||
void setOpenId(Long userId,String openId);
|
||||
|
||||
/**
|
||||
* 更新用户信息,慎用!
|
||||
*
|
||||
* @author 小李
|
||||
* @date 11:47 2024/12/20
|
||||
* @param newUser 新用户信息
|
||||
**/
|
||||
void updateUser(AdminUserRespDTO newUser);
|
||||
|
||||
}
|
||||
|
@ -195,4 +195,17 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
userService.setOpenId(userId, openId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户信息,慎用!
|
||||
*
|
||||
* @author 小李
|
||||
* @date 11:47 2024/12/20
|
||||
* @param newUser 新用户信息
|
||||
**/
|
||||
@Override
|
||||
public void updateUser(AdminUserRespDTO newUser){
|
||||
AdminUserDO bean = BeanUtil.toBean(newUser, AdminUserDO.class);
|
||||
userService.updateById(bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user