BUG修复 岗位复制
This commit is contained in:
parent
5b2ab89a06
commit
d7f910aa84
|
|
@ -240,8 +240,10 @@ CREATE TABLE JCL_ORG_JOB (
|
|||
CREATE TABLE JCL_ORG_JOBDT (
|
||||
id int auto_increment NOT NULL,
|
||||
mainid int NULL,
|
||||
level_id int null,
|
||||
grade_id int null,
|
||||
level_id varchar(100) NULL,
|
||||
grade_id varchar(100) NULL,
|
||||
level_id_span varchar(100) NULL,
|
||||
grade_id_span varchar(100) NULL,
|
||||
creator int null,
|
||||
delete_type int null,
|
||||
create_time date null,
|
||||
|
|
@ -249,14 +251,14 @@ CREATE TABLE JCL_ORG_JOBDT (
|
|||
CONSTRAINT JCL_ORG_JOBDT_PK PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
-- JCL_ORG_JOBPEXT
|
||||
CREATE TABLE JCL_ORG_JOBPEXT (
|
||||
-- JCL_ORG_JOBEXT
|
||||
CREATE TABLE JCL_ORG_JOBEXT (
|
||||
id int auto_increment NOT NULL,
|
||||
creator int null,
|
||||
delete_type int null,
|
||||
create_time date null,
|
||||
update_time date null,
|
||||
CONSTRAINT JCL_ORG_JOBPEXT_PK PRIMARY KEY (id)
|
||||
CONSTRAINT JCL_ORG_JOBEXT_PK PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
-- JCL_ORG_JOBEXT_DT1
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import weaver.general.StringUtil;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -29,8 +28,7 @@ public class DeleteParam {
|
|||
if(StringUtil.isEmpty(ids)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Long> collect = Arrays.stream(ids.split(",")).map(item -> Long.parseLong(item)).collect(Collectors.toList());
|
||||
return collect;
|
||||
return Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ public class JobBO {
|
|||
.id(param.getId() == null ? 0 : param.getId())
|
||||
.jobNo(param.getJobNo())
|
||||
.jobName(param.getJobName())
|
||||
.parentComp(param.getParentComp())
|
||||
.parentDept(param.getParentDept())
|
||||
.parentComp(null==param.getParentComp()?param.getSubcompanyid1():param.getParentComp())
|
||||
.parentDept(null==param.getParentDept()?param.getDepartmentid():param.getParentDept())
|
||||
.sequenceId(param.getSequenceId())
|
||||
.schemeId(param.getSchemeId())
|
||||
.parentJob(param.getParentJob())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.organization.entity.job.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobCopyParam {
|
||||
private String ids;
|
||||
|
||||
private String department;
|
||||
|
||||
}
|
||||
|
|
@ -73,4 +73,8 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
* 禁用标记
|
||||
*/
|
||||
private Boolean forbiddenTag;
|
||||
|
||||
private Long subcompanyid1;
|
||||
|
||||
private Long departmentid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ public interface JobService {
|
|||
/**
|
||||
* 复制岗位到指定部门
|
||||
*
|
||||
* @param id
|
||||
* @param departmentId
|
||||
* @param ids
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
int copyJobItem(long id, long departmentId);
|
||||
int copyJobItem(String ids, String department);
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
|
|
|
|||
|
|
@ -422,12 +422,19 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int copyJobItem(long id, long departmentId) {
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
// TODO 自动编号
|
||||
jobById.setJobNo("复制_" + jobById.getJobNo());
|
||||
jobById.setParentDept(departmentId);
|
||||
return getJobMapper().insertIgnoreNull(jobById);
|
||||
public int copyJobItem(String ids, String department) {
|
||||
OrganizationAssert.notBlank(department, "请指定需要复制的部门");
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
for (Long id : idList) {
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
// TODO 自动编号
|
||||
jobById.setJobNo("复制_" + jobById.getJobNo());
|
||||
jobById.setParentDept(Long.parseLong(department));
|
||||
insertCount += getJobMapper().insertIgnoreNull(jobById);
|
||||
}
|
||||
|
||||
return insertCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.job.param.JobCopyParam;
|
||||
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
|
|
@ -168,13 +169,21 @@ public class JobController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制到指定部门
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/copyJobItem")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult copyJobItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody JobSearchParam param) {
|
||||
public ReturnResult copyJobItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody JobCopyParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getJobWrapper(user).copyJobItem(param.getId(), param.getParentDept()));
|
||||
return ReturnResult.successed(getJobWrapper(user).copyJobItem(param.getIds(), param.getDepartment()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,12 +106,12 @@ public class JobWrapper extends Service {
|
|||
/**
|
||||
* 复制岗位到指定部门
|
||||
*
|
||||
* @param id
|
||||
* @param departmentId
|
||||
* @param ids
|
||||
* @param department
|
||||
* @return
|
||||
*/
|
||||
public int copyJobItem(long id, long departmentId) {
|
||||
return getJobService(user).copyJobItem(id, departmentId);
|
||||
public int copyJobItem(String ids, String department) {
|
||||
return getJobService(user).copyJobItem(ids, department);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -135,6 +135,7 @@ public class JobWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取复制表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ReturnResult getCopyForm() {
|
||||
|
|
@ -149,6 +150,7 @@ public class JobWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 根据岗位获取人员
|
||||
*
|
||||
* @param jobId
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue