!119 转移分部

Merge pull request !119 from dxfeng/feature/dxf
pull/120/MERGE
dxfeng 3 years ago committed by Gitee
commit 141c9964e0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -1,6 +1,7 @@
package com.engine.organization.service;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import java.util.Collection;
import java.util.Map;
@ -82,5 +83,12 @@ public interface CompService {
* @return
*/
Map<String, Object> getCompSaveForm();
/**
*
*
* @param moveParam
* @return
*/
int moveCompany(DepartmentMoveParam moveParam);
}

@ -16,6 +16,7 @@ import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
@ -293,6 +294,16 @@ public class CompServiceImpl extends Service implements CompService {
}
@Override
public int moveCompany(DepartmentMoveParam moveParam) {
Long targetCompanyId = moveParam.getCompany();
OrganizationAssert.notNull(targetCompanyId, "请选择要转移到的分部");
Long companyId = moveParam.getId();
CompPO compPO = getCompMapper().listById(companyId);
compPO.setParentCompany(targetCompanyId);
return getCompMapper().updateBaseComp(compPO);
}
/**
*

@ -4,6 +4,7 @@ import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.CompWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -211,4 +212,17 @@ public class CompController {
}
}
@POST
@Path("/moveCompany")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult moveCompany(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DepartmentMoveParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).moveCompany(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

@ -3,6 +3,7 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.service.CompService;
import com.engine.organization.service.impl.CompServiceImpl;
import weaver.hrm.User;
@ -108,4 +109,14 @@ public class CompWrapper extends Service {
return getCompService(user).getCompSaveForm();
}
/**
*
*
* @param moveParam
* @return
*/
public int moveCompany(DepartmentMoveParam moveParam) {
return getCompService(user).moveCompany(moveParam);
}
}

Loading…
Cancel
Save