dev:修改
parent
f1ddba3960
commit
6340fc6149
|
|
@ -26,5 +26,9 @@
|
|||
<groupId>com.zcloud.basic.info</groupId>
|
||||
<artifactId>web-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jjb.saas</groupId>
|
||||
<artifactId>jjb-saas-framework-job</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,112 @@
|
|||
package com.zcloud.basic.info.plan;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.jjb.saas.framework.job.Job;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
@Slf4j
|
||||
public class DockingRZUserPlanJob implements Job {
|
||||
|
||||
private static final String BASE_URL = "http://192.168.10.56:8090";
|
||||
|
||||
|
||||
// @JobRegister(cron = "0 30 0 * * ?", jobDesc = "超期未检查记录",triggerStatus = 1)
|
||||
// @XxlJob("com.zcloud.zcGbsServicer.plan.CheckRecordPlanJob")
|
||||
public ReturnT<String> execute(String param) {
|
||||
System.out.println("开始执行计划任务");
|
||||
XxlJobHelper.log( "============定时获取人资人员信息开始==========");
|
||||
// 获取总页数
|
||||
Integer userInfoCount = getUserInfoCount();
|
||||
// 定义每页大小
|
||||
int pageSize = 200;
|
||||
// 计算总页数
|
||||
int totalPages = (int) Math.ceil((double) userInfoCount / pageSize);
|
||||
|
||||
for (int pageNum = 1; pageNum <= totalPages; pageNum++) {
|
||||
try {
|
||||
XxlJobHelper.log("正在获取第 " + pageNum + "/" + totalPages + " 页数据...");
|
||||
|
||||
// 调用接口
|
||||
getUserInfo(pageNum, pageSize);
|
||||
|
||||
XxlJobHelper.log("第 " + pageNum + " 页数据获取成功");
|
||||
|
||||
// 可选:添加延时,避免请求过快
|
||||
if (pageNum < totalPages) {
|
||||
Thread.sleep(1000); // 1000毫秒间隔
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
XxlJobHelper.log("第 " + pageNum + " 页获取失败: " + e.getMessage());
|
||||
// 可以选择继续执行下一页,或者中断
|
||||
// break; // 如果需要失败就停止
|
||||
}
|
||||
}
|
||||
XxlJobHelper.log( "============定时获取人资人员信息结束==========");
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人资人员信息总数
|
||||
* @return
|
||||
*/
|
||||
public static Integer getUserInfoCount(){
|
||||
String url = BASE_URL + "/docking/rz/getUserInfoCount";
|
||||
|
||||
// 发送 POST 请求
|
||||
String result = HttpRequest.post(url)
|
||||
.timeout(30000) // 30秒超时
|
||||
.execute()
|
||||
.body();
|
||||
|
||||
System.out.println("响应结果:" + result);
|
||||
if(result == null || StringUtils.isEmpty(result)){
|
||||
return 0;
|
||||
}
|
||||
return Integer.valueOf(result);
|
||||
}
|
||||
|
||||
public static String getUserInfo(Integer pageNum, Integer pageSize) {
|
||||
// 方式1:GET 请求(如果接口是GET方式)
|
||||
String url = BASE_URL + "/docking/rz/getUserInfo";
|
||||
|
||||
// 构建请求参数
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("pageNum", pageNum);
|
||||
params.put("pageSize", pageSize);
|
||||
|
||||
// 发送 POST 请求
|
||||
String result = HttpRequest.post(url)
|
||||
.form(params) // 表单参数
|
||||
.timeout(30000) // 30秒超时
|
||||
.execute()
|
||||
.body();
|
||||
|
||||
System.out.println("响应结果:" + result);
|
||||
JSONArray jsonArray = JSONUtil.parseArray(result);
|
||||
|
||||
if(jsonArray == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.zcloud.basic.info.web;
|
||||
|
||||
|
||||
import com.zcloud.basic.info.api.RzUserServiceI;
|
||||
import com.zcloud.basic.info.dto.RzUserAddCmd;
|
||||
import com.zcloud.basic.info.dto.RzUserPageQry;
|
||||
import com.zcloud.basic.info.dto.RzUserListQry;
|
||||
import com.zcloud.basic.info.dto.RzUserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.RzUserRemoveCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.RzUserCO;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Api(tags = "人资人员信息表")
|
||||
@RequestMapping("/${application.gateway}/rzUser")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class RzUserController {
|
||||
private final RzUserServiceI rzUserService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<RzUserCO> add(@Validated @RequestBody RzUserAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return rzUserService.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping("/edit")
|
||||
public SingleResponse edit(@Validated @RequestBody RzUserUpdateCmd cmd) {
|
||||
rzUserService.edit(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<RzUserCO> page(@RequestBody RzUserPageQry qry) {
|
||||
return rzUserService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<RzUserCO> listAll(@RequestBody RzUserListQry qry) {
|
||||
return rzUserService.list(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
@GetMapping("/getInfoById")
|
||||
public SingleResponse<RzUserCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||
return rzUserService.getInfoById(id);
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@PutMapping("/remove")
|
||||
public Response remove(@RequestParam(value = "id") Long id) {
|
||||
rzUserService.remove(id);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
@PutMapping("/removeBatch")
|
||||
public Response removeBatch(@Validated @RequestBody RzUserRemoveCmd cmd) {
|
||||
rzUserService.removeBatch(cmd.getIds());
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ import com.alibaba.cola.dto.Response;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
|||
|
|
@ -7,14 +7,11 @@ import com.alibaba.cola.dto.Response;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.system.client.role.response.RoleCO;
|
||||
import com.zcloud.basic.info.api.UserServiceI;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.plan.DockingRZUserPlanJob;
|
||||
import com.zcloud.gbscommon.translateaop.TranslateField;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
|
||||
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -23,8 +20,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
|
|
@ -156,5 +151,13 @@ public class UserController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
private final DockingRZUserPlanJob dockingRZPlanJob;
|
||||
@ApiOperation("手动调用获取人资人员信息定时")
|
||||
@PostMapping("/dockingRZ")
|
||||
public Response dockingRZ(){
|
||||
dockingRZPlanJob.execute("");
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,112 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.zcloud.basic.info.domain.gateway.RzUserGateway;
|
||||
import com.zcloud.basic.info.domain.model.RzUserE;
|
||||
import com.zcloud.basic.info.dto.RzUserAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:55
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RzUserAddExe {
|
||||
private final RzUserGateway rzUserGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(RzUserAddCmd cmd) {
|
||||
RzUserE rzUserE = new RzUserE();
|
||||
BeanUtils.copyProperties(cmd, rzUserE);
|
||||
boolean res = false;
|
||||
try {
|
||||
res = rzUserGateway.add(rzUserE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void execute(JSONArray jsonArray){
|
||||
List<RzUserDO> collect = jsonArray.stream().map(o -> {
|
||||
JSONObject json = new JSONObject(o);
|
||||
RzUserDO user = new RzUserDO();
|
||||
user.setRzUserId(UuidUtil.get32UUID());
|
||||
user.setEmployeeName(json.getStr("employee_name"));
|
||||
user.setEmployeeGender(json.getStr("employee_gender"));
|
||||
user.setEmployeeAge(json.getInt("employee_age"));
|
||||
user.setEntryTime(json.getStr("entry_time"));
|
||||
user.setEmployeeStatus(json.getStr("employee_status"));
|
||||
user.setJobName(json.getStr("job_name"));
|
||||
user.setJobLevel(json.getStr("job_level"));
|
||||
user.setDeptName(json.getStr("dept_name"));
|
||||
user.setDeptCode(json.getStr("dept_code"));
|
||||
user.setPositionName(json.getStr("position_name"));
|
||||
user.setPhoneNumber(json.getStr("phone_number"));
|
||||
user.setIdCardNumber(json.getStr("id_card_number"));
|
||||
user.setEmployeeImagesCode(json.getStr("employee_images_code"));
|
||||
user.setCorporationCode(json.getStr("corporation_code"));
|
||||
user.setCorporationName(json.getStr("corporation_name"));
|
||||
|
||||
// 1、通过姓名或手机号查找用户是否可以对应上
|
||||
// 系统中存在姓名为“张三” 但实际保存为“张 三”的情况,需要将此类情况对应上
|
||||
// List<PageData> sysUserList = usersService.findByUserNameAndPhone(
|
||||
// json.getStr("employee_name")
|
||||
// , json.getStr("phone_number")
|
||||
// , String.join(" ", json.getStr("employee_name").split("")));
|
||||
// String userId = sysUserList.get(0).getString("user_id");
|
||||
// // 2、如果对应上,记录用户id以及确认状态
|
||||
// if (ObjectUtil.isNotEmpty(sysUserList)) {
|
||||
// user.setUSER_ID(userId);
|
||||
// user.setIs_confirm("1");
|
||||
// user.setConfirm_status("1");
|
||||
// PageData pd = new PageData();
|
||||
// pd.put("user_id", userId);
|
||||
// pd.put("in_hr_user", "1");
|
||||
// pd.put("user_id_card", user.getId_card_number());
|
||||
// usersService.updateUserIdCard(pd);
|
||||
//
|
||||
// }
|
||||
/**
|
||||
* 1.寻找用户的图片信息
|
||||
* 2.我有用户的头型图片,就不下载了
|
||||
*
|
||||
*/
|
||||
// boolean isUpdateImg = true; //是否下载头像图片.
|
||||
// if (!Tools.isEmpty(userId)) {
|
||||
// List<PageData> userImgesByUserId = usersService.getUserImgesByUserId(userId);
|
||||
// if (ObjectUtil.isNotEmpty(userImgesByUserId)) {
|
||||
// isUpdateImg = false;
|
||||
// }
|
||||
// }
|
||||
// if (isUpdateImg) {
|
||||
// downloadUserImg(user.getId_card_number(), user.getUSER_ID()); //下载用户图片
|
||||
// }
|
||||
// long countByIdCardNumber = humanResourceUserService.countByIdCardNumber(user.getId_card_number());
|
||||
// if (countByIdCardNumber == 0) {
|
||||
// humanResourceUserService.save(user);
|
||||
// }
|
||||
return user;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.zcloud.basic.info.domain.gateway.RzUserGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RzUserRemoveExe {
|
||||
private final RzUserGateway rzUserGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean res = rzUserGateway.deletedRzUserById(id);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = rzUserGateway.deletedRzUserByIds(ids);
|
||||
if (!res) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.RzUserGateway;
|
||||
import com.zcloud.basic.info.domain.model.RzUserE;
|
||||
import com.zcloud.basic.info.dto.RzUserUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RzUserUpdateExe {
|
||||
private final RzUserGateway rzUserGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(RzUserUpdateCmd cmd) {
|
||||
RzUserE rzUserE = new RzUserE();
|
||||
BeanUtils.copyProperties(cmd, rzUserE);
|
||||
boolean res = rzUserGateway.update(rzUserE);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.zcloud.basic.info.domain.gateway.UserChangeRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.basic.info.command;
|
|||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserChangeRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.basic.info.command.convertor;
|
||||
|
||||
import com.zcloud.basic.info.dto.clientobject.RzUserCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RzUserCoConvertor {
|
||||
/**
|
||||
* @param rzUserDOs
|
||||
* @return
|
||||
*/
|
||||
List<RzUserCO> converDOsToCOs(List<RzUserDO> rzUserDOs);
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.zcloud.basic.info.command.convertor;
|
||||
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.basic.info.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.basic.info.command.convertor.RzUserCoConvertor;
|
||||
import com.zcloud.basic.info.dto.RzUserPageQry;
|
||||
import com.zcloud.basic.info.dto.RzUserListQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.RzUserCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.RzUserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RzUserQueryExe {
|
||||
private final RzUserRepository rzUserRepository;
|
||||
private final RzUserCoConvertor rzUserCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<RzUserCO> execute(RzUserPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<RzUserDO> pageResponse = rzUserRepository.listPage(params);
|
||||
List<RzUserCO> examCenterCOS = rzUserCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public MultiResponse<RzUserCO> execute(RzUserListQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
List<RzUserDO> list = rzUserRepository.list(params);
|
||||
List<RzUserCO> examCenterCOS = rzUserCoConvertor.converDOsToCOs(list);
|
||||
return MultiResponse.of(examCenterCOS);
|
||||
}
|
||||
|
||||
public SingleResponse<RzUserCO> execute(Long id) {
|
||||
SingleResponse<RzUserDO> rzUserDO = rzUserRepository.getInfoById(id);
|
||||
RzUserCO co = new RzUserCO();
|
||||
BeanUtils.copyProperties(rzUserDO.getData(), co);
|
||||
return SingleResponse.of(co);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -4,6 +4,8 @@ import com.alibaba.cola.dto.MultiResponse;
|
|||
import com.zcloud.basic.info.command.convertor.UserChangeRecordCoConvertor;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordPageQry;
|
||||
import com.zcloud.basic.info.dto.UserChangeRecordListQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserChangeRecordRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
package com.zcloud.basic.info.service;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.basic.info.api.RzUserServiceI;
|
||||
import com.zcloud.basic.info.command.RzUserAddExe;
|
||||
import com.zcloud.basic.info.command.RzUserRemoveExe;
|
||||
import com.zcloud.basic.info.command.RzUserUpdateExe;
|
||||
import com.zcloud.basic.info.command.query.RzUserQueryExe;
|
||||
import com.zcloud.basic.info.dto.RzUserAddCmd;
|
||||
import com.zcloud.basic.info.dto.RzUserPageQry;
|
||||
import com.zcloud.basic.info.dto.RzUserListQry;
|
||||
import com.zcloud.basic.info.dto.RzUserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.RzUserCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RzUserServiceImpl implements RzUserServiceI {
|
||||
private final RzUserAddExe rzUserAddExe;
|
||||
private final RzUserUpdateExe rzUserUpdateExe;
|
||||
private final RzUserRemoveExe rzUserRemoveExe;
|
||||
private final RzUserQueryExe rzUserQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<RzUserCO> listPage(RzUserPageQry qry) {
|
||||
return rzUserQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<RzUserCO> list(RzUserListQry qry) {
|
||||
return rzUserQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<RzUserCO> getInfoById(Long id) {
|
||||
return rzUserQueryExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(RzUserAddCmd cmd) {
|
||||
rzUserAddExe.execute(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(RzUserUpdateCmd cmd) {
|
||||
rzUserUpdateExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
rzUserRemoveExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBatch(Long[] ids) {
|
||||
rzUserRemoveExe.execute(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.basic.info.api;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.zcloud.basic.info.dto.RzUserAddCmd;
|
||||
import com.zcloud.basic.info.dto.RzUserPageQry;
|
||||
import com.zcloud.basic.info.dto.RzUserListQry;
|
||||
import com.zcloud.basic.info.dto.RzUserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.RzUserCO;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
public interface RzUserServiceI {
|
||||
PageResponse<RzUserCO> listPage(RzUserPageQry qry);
|
||||
|
||||
MultiResponse<RzUserCO> list(RzUserListQry qry);
|
||||
|
||||
SingleResponse<RzUserCO> getInfoById(Long id);
|
||||
|
||||
SingleResponse<RzUserCO> add(RzUserAddCmd cmd);
|
||||
|
||||
void edit(RzUserUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
}
|
||||
|
||||
|
|
@ -8,6 +8,7 @@ import com.zcloud.basic.info.dto.UserChangeRecordUpdateCmd;
|
|||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserChangeRecordCO;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:55
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RzUserAddCmd extends Command {
|
||||
@ApiModelProperty(value = "用户名", name = "employeeName", required = true)
|
||||
@NotEmpty(message = "用户名不能为空")
|
||||
private String employeeName;
|
||||
|
||||
@ApiModelProperty(value = "用户性别", name = "employeeGender", required = true)
|
||||
@NotEmpty(message = "用户性别不能为空")
|
||||
private String employeeGender;
|
||||
|
||||
@ApiModelProperty(value = "年龄", name = "employeeAge", required = true)
|
||||
@NotNull(message = "年龄不能为空")
|
||||
private Integer employeeAge;
|
||||
|
||||
@ApiModelProperty(value = "入职时间", name = "entryTime", required = true)
|
||||
@NotEmpty(message = "入职时间不能为空")
|
||||
private String entryTime;
|
||||
|
||||
@ApiModelProperty(value = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)", name = " employeeStatus", required = true)
|
||||
@NotEmpty(message = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)不能为空")
|
||||
private String employeeStatus;
|
||||
|
||||
@ApiModelProperty(value = "职务", name = "jobName", required = true)
|
||||
@NotEmpty(message = "职务不能为空")
|
||||
private String jobName;
|
||||
|
||||
@ApiModelProperty(value = "职务级别", name = "jobLevel", required = true)
|
||||
@NotEmpty(message = "职务级别不能为空")
|
||||
private String jobLevel;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", name = "deptName", required = true)
|
||||
@NotEmpty(message = "部门名称不能为空")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "部门编码", name = "deptCode", required = true)
|
||||
@NotEmpty(message = "部门编码不能为空")
|
||||
private String deptCode;
|
||||
|
||||
@ApiModelProperty(value = "岗位", name = "positionName", required = true)
|
||||
@NotEmpty(message = "岗位不能为空")
|
||||
private String positionName;
|
||||
|
||||
@ApiModelProperty(value = "手机号码", name = "phoneNumber", required = true)
|
||||
@NotEmpty(message = "手机号码不能为空")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty(value = "身份证号", name = "idCardNumber", required = true)
|
||||
@NotEmpty(message = "身份证号不能为空")
|
||||
private String idCardNumber;
|
||||
|
||||
@ApiModelProperty(value = "员工照片编码", name = "employeeImagesCode", required = true)
|
||||
@NotEmpty(message = "员工照片编码不能为空")
|
||||
private String employeeImagesCode;
|
||||
|
||||
@ApiModelProperty(value = "员工照片(base64 格式,图片格式:jpg)", name = " employeeImages", required = true)
|
||||
@NotEmpty(message = "员工照片(base64 格式,图片格式:jpg)不能为空")
|
||||
private String employeeImages;
|
||||
|
||||
@ApiModelProperty(value = "企业编码", name = "corporationCode", required = true)
|
||||
@NotEmpty(message = "企业编码不能为空")
|
||||
private String corporationCode;
|
||||
|
||||
@ApiModelProperty(value = "企业名称", name = "corporationName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
private String corporationName;
|
||||
|
||||
@ApiModelProperty(value = "是否确认", name = "isConfirm", required = true)
|
||||
@NotEmpty(message = "是否确认不能为空")
|
||||
private String isConfirm;
|
||||
|
||||
@ApiModelProperty(value = "确认状态(0:未确认,1:自动确认,2:用户手动确认)", name = "confirmStatus", required = true)
|
||||
@NotEmpty(message = "确认状态(0:未确认,1:自动确认,2:用户手动确认)不能为空")
|
||||
private String confirmStatus;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Data
|
||||
public class RzUserListQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeRzUserId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Data
|
||||
public class RzUserPageQry extends PageQuery {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeRzUserId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RzUserRemoveCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
@Size(min = 1, message = "请选择数据")
|
||||
private Long[] ids;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RzUserUpdateCmd extends Command {
|
||||
@ApiModelProperty(value = "主键", name = "id", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键id", name = "rzUserId", required = true)
|
||||
@NotEmpty(message = "业务主键id不能为空")
|
||||
private String rzUserId;
|
||||
@ApiModelProperty(value = "用户名", name = "employeeName", required = true)
|
||||
@NotEmpty(message = "用户名不能为空")
|
||||
private String employeeName;
|
||||
@ApiModelProperty(value = "用户性别", name = "employeeGender", required = true)
|
||||
@NotEmpty(message = "用户性别不能为空")
|
||||
private String employeeGender;
|
||||
@ApiModelProperty(value = "年龄", name = "employeeAge", required = true)
|
||||
@NotNull(message = "年龄不能为空")
|
||||
private Integer employeeAge;
|
||||
@ApiModelProperty(value = "入职时间", name = "entryTime", required = true)
|
||||
@NotEmpty(message = "入职时间不能为空")
|
||||
private String entryTime;
|
||||
@ApiModelProperty(value = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)", name = " employeeStatus", required = true)
|
||||
@NotEmpty(message = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)不能为空")
|
||||
private String employeeStatus;
|
||||
@ApiModelProperty(value = "职务", name = "jobName", required = true)
|
||||
@NotEmpty(message = "职务不能为空")
|
||||
private String jobName;
|
||||
@ApiModelProperty(value = "职务级别", name = "jobLevel", required = true)
|
||||
@NotEmpty(message = "职务级别不能为空")
|
||||
private String jobLevel;
|
||||
@ApiModelProperty(value = "部门名称", name = "deptName", required = true)
|
||||
@NotEmpty(message = "部门名称不能为空")
|
||||
private String deptName;
|
||||
@ApiModelProperty(value = "部门编码", name = "deptCode", required = true)
|
||||
@NotEmpty(message = "部门编码不能为空")
|
||||
private String deptCode;
|
||||
@ApiModelProperty(value = "岗位", name = "positionName", required = true)
|
||||
@NotEmpty(message = "岗位不能为空")
|
||||
private String positionName;
|
||||
@ApiModelProperty(value = "手机号码", name = "phoneNumber", required = true)
|
||||
@NotEmpty(message = "手机号码不能为空")
|
||||
private String phoneNumber;
|
||||
@ApiModelProperty(value = "身份证号", name = "idCardNumber", required = true)
|
||||
@NotEmpty(message = "身份证号不能为空")
|
||||
private String idCardNumber;
|
||||
@ApiModelProperty(value = "员工照片编码", name = "employeeImagesCode", required = true)
|
||||
@NotEmpty(message = "员工照片编码不能为空")
|
||||
private String employeeImagesCode;
|
||||
@ApiModelProperty(value = "员工照片(base64 格式,图片格式:jpg)", name = " employeeImages", required = true)
|
||||
@NotEmpty(message = "员工照片(base64 格式,图片格式:jpg)不能为空")
|
||||
private String employeeImages;
|
||||
@ApiModelProperty(value = "企业编码", name = "corporationCode", required = true)
|
||||
@NotEmpty(message = "企业编码不能为空")
|
||||
private String corporationCode;
|
||||
@ApiModelProperty(value = "企业名称", name = "corporationName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
private String corporationName;
|
||||
@ApiModelProperty(value = "是否确认", name = "isConfirm", required = true)
|
||||
@NotEmpty(message = "是否确认不能为空")
|
||||
private String isConfirm;
|
||||
@ApiModelProperty(value = "确认状态(0:未确认,1:自动确认,2:用户手动确认)", name = "confirmStatus", required = true)
|
||||
@NotEmpty(message = "确认状态(0:未确认,1:自动确认,2:用户手动确认)不能为空")
|
||||
private String confirmStatus;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.zcloud.basic.info.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:55
|
||||
*/
|
||||
@Data
|
||||
public class RzUserCO extends ClientObject {
|
||||
//主键
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String rzUserId;
|
||||
//用户名
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String employeeName;
|
||||
//用户性别
|
||||
@ApiModelProperty(value = "用户性别")
|
||||
private String employeeGender;
|
||||
//年龄
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private Integer employeeAge;
|
||||
//入职时间
|
||||
@ApiModelProperty(value = "入职时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime entryTime;
|
||||
//状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)
|
||||
@ApiModelProperty(value = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)")
|
||||
private String employeeStatus;
|
||||
//职务
|
||||
@ApiModelProperty(value = "职务")
|
||||
private String jobName;
|
||||
//职务级别
|
||||
@ApiModelProperty(value = "职务级别")
|
||||
private String jobLevel;
|
||||
//部门名称
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
//部门编码
|
||||
@ApiModelProperty(value = "部门编码")
|
||||
private String deptCode;
|
||||
//岗位
|
||||
@ApiModelProperty(value = "岗位")
|
||||
private String positionName;
|
||||
//手机号码
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phoneNumber;
|
||||
//身份证号
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String idCardNumber;
|
||||
//员工照片编码
|
||||
@ApiModelProperty(value = "员工照片编码")
|
||||
private String employeeImagesCode;
|
||||
//员工照片(base64 格式,图片格式:jpg)
|
||||
@ApiModelProperty(value = "员工照片(base64 格式,图片格式:jpg)")
|
||||
private String employeeImages;
|
||||
//企业编码
|
||||
@ApiModelProperty(value = "企业编码")
|
||||
private String corporationCode;
|
||||
//企业名称
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corporationName;
|
||||
//是否确认
|
||||
@ApiModelProperty(value = "是否确认")
|
||||
private String isConfirm;
|
||||
//确认状态(0:未确认,1:自动确认,2:用户手动确认)
|
||||
@ApiModelProperty(value = "确认状态(0:未确认,1:自动确认,2:用户手动确认)")
|
||||
private String confirmStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.basic.info.domain.gateway;
|
||||
|
||||
import com.zcloud.basic.info.domain.model.RzUserE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
public interface RzUserGateway {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Boolean add(RzUserE rzUserE);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(RzUserE rzUserE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
Boolean deletedRzUserById(Long id);
|
||||
|
||||
Boolean deletedRzUserByIds(Long[] id);
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.zcloud.basic.info.domain.gateway;
|
||||
|
||||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Data
|
||||
public class RzUserE extends BaseE {
|
||||
//主键
|
||||
private Long id;
|
||||
//业务主键id
|
||||
private String rzUserId;
|
||||
//用户名
|
||||
private String employeeName;
|
||||
//用户性别
|
||||
private String employeeGender;
|
||||
//年龄
|
||||
private Integer employeeAge;
|
||||
//入职时间
|
||||
private String entryTime;
|
||||
//状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)
|
||||
private String employeeStatus;
|
||||
//职务
|
||||
private String jobName;
|
||||
//职务级别
|
||||
private String jobLevel;
|
||||
//部门名称
|
||||
private String deptName;
|
||||
//部门编码
|
||||
private String deptCode;
|
||||
//岗位
|
||||
private String positionName;
|
||||
//手机号码
|
||||
private String phoneNumber;
|
||||
//身份证号
|
||||
private String idCardNumber;
|
||||
//员工照片编码
|
||||
private String employeeImagesCode;
|
||||
//员工照片(base64 格式,图片格式:jpg)
|
||||
private String employeeImages;
|
||||
//企业编码
|
||||
private String corporationCode;
|
||||
//企业名称
|
||||
private String corporationName;
|
||||
//是否确认
|
||||
private String isConfirm;
|
||||
//确认状态(0:未确认,1:自动确认,2:用户手动确认)
|
||||
private String confirmStatus;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.zcloud.basic.info.gatewayimpl;
|
||||
|
||||
import com.zcloud.basic.info.domain.gateway.RzUserGateway;
|
||||
import com.zcloud.basic.info.domain.model.RzUserE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.RzUserRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RzUserGatewayImpl implements RzUserGateway {
|
||||
private final RzUserRepository rzUserRepository;
|
||||
|
||||
@Override
|
||||
public Boolean add(RzUserE rzUserE) {
|
||||
RzUserDO d = new RzUserDO();
|
||||
BeanUtils.copyProperties(rzUserE, d);
|
||||
rzUserRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(RzUserE rzUserE) {
|
||||
RzUserDO d = new RzUserDO();
|
||||
BeanUtils.copyProperties(rzUserE, d);
|
||||
rzUserRepository.updateById(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedRzUserById(Long id) {
|
||||
return rzUserRepository.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedRzUserByIds(Long[] ids) {
|
||||
return rzUserRepository.removeByIds(Collections.singletonList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.zcloud.basic.info.gatewayimpl;
|
||||
|
||||
import com.zcloud.basic.info.domain.gateway.UserChangeRecordGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserChangeRecordE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserChangeRecordRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.basic.info.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Data
|
||||
@TableName("rz_user")
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RzUserDO extends BaseDO {
|
||||
//业务主键id
|
||||
@ApiModelProperty(value = "业务主键id")
|
||||
private String rzUserId;
|
||||
//用户名
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String employeeName;
|
||||
//用户性别
|
||||
@ApiModelProperty(value = "用户性别")
|
||||
private String employeeGender;
|
||||
//年龄
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private Integer employeeAge;
|
||||
//入职时间
|
||||
@ApiModelProperty(value = "入职时间")
|
||||
private String entryTime;
|
||||
//状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)
|
||||
@ApiModelProperty(value = "状态(未入职、实习生、实习结束、在职、离职、退休、劳务派遣、劳务派遣结束)")
|
||||
private String employeeStatus;
|
||||
//职务
|
||||
@ApiModelProperty(value = "职务")
|
||||
private String jobName;
|
||||
//职务级别
|
||||
@ApiModelProperty(value = "职务级别")
|
||||
private String jobLevel;
|
||||
//部门名称
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
//部门编码
|
||||
@ApiModelProperty(value = "部门编码")
|
||||
private String deptCode;
|
||||
//岗位
|
||||
@ApiModelProperty(value = "岗位")
|
||||
private String positionName;
|
||||
//手机号码
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phoneNumber;
|
||||
//身份证号
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String idCardNumber;
|
||||
//员工照片编码
|
||||
@ApiModelProperty(value = "员工照片编码")
|
||||
private String employeeImagesCode;
|
||||
//员工照片(base64 格式,图片格式:jpg)
|
||||
@ApiModelProperty(value = "员工照片(base64 格式,图片格式:jpg)")
|
||||
private String employeeImages;
|
||||
//企业编码
|
||||
@ApiModelProperty(value = "企业编码")
|
||||
private String corporationCode;
|
||||
//企业名称
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corporationName;
|
||||
//是否确认
|
||||
@ApiModelProperty(value = "是否确认")
|
||||
private String isConfirm;
|
||||
//确认状态(0:未确认,1:自动确认,2:用户手动确认)
|
||||
@ApiModelProperty(value = "确认状态(0:未确认,1:自动确认,2:用户手动确认)")
|
||||
private String confirmStatus;
|
||||
|
||||
public RzUserDO(String rzUserId) {
|
||||
this.rzUserId = rzUserId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.basic.info.persistence.mapper;
|
||||
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:56
|
||||
*/
|
||||
@Mapper
|
||||
public interface RzUserMapper extends BaseMapper<RzUserDO> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.basic.info.persistence.repository;
|
||||
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
public interface RzUserRepository extends BaseRepository<RzUserDO> {
|
||||
|
||||
PageResponse<RzUserDO> listPage(Map<String, Object> params);
|
||||
|
||||
List<RzUserDO> list(Map<String, Object> params);
|
||||
|
||||
SingleResponse<RzUserDO> getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.persistence.repository;
|
|||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.basic.info.persistence.repository.impl;
|
||||
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.basic.info.persistence.dataobject.RzUserDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.RzUserMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.RzUserRepository;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author SondonYong
|
||||
* @Date 2025-12-02 17:15:57
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RzUserRepositoryImpl extends BaseRepositoryImpl<RzUserMapper, RzUserDO> implements RzUserRepository {
|
||||
private final RzUserMapper rzUserMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<RzUserDO> listPage(Map<String, Object> params) {
|
||||
IPage<RzUserDO> iPage = new Query<RzUserDO>().getPage(params);
|
||||
QueryWrapper<RzUserDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<RzUserDO> result = rzUserMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RzUserDO> list(Map<String, Object> params) {
|
||||
QueryWrapper<RzUserDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<RzUserDO> result = rzUserMapper.selectList(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<RzUserDO> getInfoById(Long id) {
|
||||
return SingleResponse.of(rzUserMapper.selectById(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.persistence.repository.impl;
|
||||
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.UserChangeRecordMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.UserChangeRecordRepository;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.zcloud.basic.info.persistence.mapper.RzUserMapper">
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue