Merge pull request 'feature/cl' (#168) from feature/cl into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/168
This commit is contained in:
commit
5edb1cc55b
|
|
@ -0,0 +1,14 @@
|
|||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/6/27 3:38 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Path("/bs/hrmorganization/virtual")
|
||||
public class OrgVirtualController extends com.engine.organization.web.OrgVirtualController {
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ public class CompanyTreePO {
|
|||
public boolean getIsLeaf() {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from hrmsubcompany where (canceled is null or canceled != '1') and supsubcomid = ?",id);
|
||||
return rs.next();
|
||||
return !rs.next();
|
||||
}
|
||||
|
||||
public String getpId() {
|
||||
|
|
|
|||
|
|
@ -75,4 +75,14 @@ public interface OrgChartService {
|
|||
*/
|
||||
String synchronousData(Map<String, Object> request2Map, User user);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 版本记录描述存储
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2023/6/28 1:53 PM
|
||||
* @param: [fclass, description]
|
||||
* @return: void
|
||||
*/
|
||||
void insertChartVersion(Integer fclass,String description);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/6/27 3:45 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface OrgVirtualService {
|
||||
|
||||
/**
|
||||
* @Description: 虚拟组织列表
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2023/6/27 3:56 PM
|
||||
* @param: [params]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -17,19 +17,17 @@ import com.engine.organization.util.db.DBType;
|
|||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.detach.DetachUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import tebie.applib.api.O;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @className: OrgChartServiceImpl
|
||||
* @author: dengjp
|
||||
* @date: 2022/7/7
|
||||
* @description: 组织架构图ServiceImpl
|
||||
**/
|
||||
|
||||
public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||
|
||||
private RecordSet grs = new RecordSet();
|
||||
|
|
@ -606,6 +604,22 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
return "同步成功";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertChartVersion(Integer fclass, String description) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String recordDate = OrganizationDateUtil.getFormatLocalDateTime(LocalDateTime.now());
|
||||
String createDate = OrganizationDateUtil.getFormatLocalDate(LocalDate.now());
|
||||
rs.executeQuery("select id from JCL_ORG_CHARTVERSION where fclass = ? and createdate = ?",fclass,createDate);
|
||||
rs.next();
|
||||
String id = Util.null2String(rs.getString("id"));
|
||||
if(StringUtils.isNotEmpty(id)){
|
||||
rs.executeUpdate("update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createdate = ?",recordDate,description,user.getUID(),fclass,createDate);
|
||||
}else {
|
||||
rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createdate,fclass) values(?,?,?,?,?,?)",recordDate,description,user.getUID(),0,createDate,fclass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新在岗、编制数
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.service.OrgVirtualService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/6/27 3:45 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class OrgVirtualServiceImpl extends Service implements OrgVirtualService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -47,6 +47,8 @@ public class OrgChartController {
|
|||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getSubCompanyTree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
@ -56,6 +58,7 @@ public class OrgChartController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
//实例化Service 并调用业务类处理
|
||||
apidatas = getOrgChartWrapper(user).getSubCompanyTree(ParamUtil.request2Map(request), user);
|
||||
apidatas.put("api_status", true);
|
||||
} catch (Exception e) {
|
||||
//异常处理
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.engine.organization.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.OrgVirtualWrapper;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/6/27 3:41 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class OrgVirtualController {
|
||||
|
||||
public OrgVirtualWrapper getVirtualWrapper(User user) {
|
||||
return ServiceUtil.getService(OrgVirtualWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getTable")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult listOrgVirtual(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getVirtualWrapper(user).listPage(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.service.OrgVirtualService;
|
||||
import com.engine.organization.service.impl.OrgVirtualServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2023/6/27 3:42 PM
|
||||
* @Description: TODO
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class OrgVirtualWrapper extends Service {
|
||||
|
||||
private OrgVirtualService getOrgVirtualService(User user) {
|
||||
return ServiceUtil.getService(OrgVirtualServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return getOrgVirtualService(user).listPage(params);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue