人基础员信息
parent
ed3b6a5e06
commit
8043012b41
@ -0,0 +1,13 @@
|
|||||||
|
package com.api.organization.web;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
@Path("/bs/hrmorganization/resourceBasicInfo")
|
||||||
|
public class ResourceBasicInfoController extends com.engine.organization.web.ResourceBasicInfoController{
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.engine.organization.entity.hrmresource.vo;
|
||||||
|
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||||
|
import com.engine.organization.annotation.OrganizationTable;
|
||||||
|
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||||
|
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@OrganizationTable(pageId = "516e81fb-65d4-4010-b916-9f6ab337b199",
|
||||||
|
fields = "t.fid," +
|
||||||
|
"t.fno," +
|
||||||
|
"t.fname," +
|
||||||
|
"t.fmemo",
|
||||||
|
fromSql = "FROM jcl_org_item t ",
|
||||||
|
orderby = "fno",
|
||||||
|
sortway = "asc",
|
||||||
|
primarykey = "id",
|
||||||
|
operates = {
|
||||||
|
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||||
|
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||||
|
@OrganizationTableOperate(index = "2", text = "恢复")
|
||||||
|
},
|
||||||
|
tableType = WeaTableType.CHECKBOX
|
||||||
|
)
|
||||||
|
public class ResourceBasicInfoVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(column = "fid", display = false)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "编号", width = "25%", column = "fno", orderkey = "fno")
|
||||||
|
private String fNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "名称", width = "25%", column = "fname")
|
||||||
|
private String fName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(text = "说明", width = "25%", column = "fmemo")
|
||||||
|
private String fMemo;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.engine.organization.service;
|
||||||
|
|
||||||
|
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public interface ResourceBasicInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> listPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取左侧树
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TypeTreeVO> getTreeData();
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.engine.organization.service.impl;
|
||||||
|
|
||||||
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.organization.component.OrganizationWeaTable;
|
||||||
|
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||||
|
import com.engine.organization.entity.hrmresource.vo.ResourceBasicInfoVO;
|
||||||
|
import com.engine.organization.service.ResourceBasicInfoService;
|
||||||
|
import com.engine.organization.util.HasRightUtil;
|
||||||
|
import com.engine.organization.util.db.DBType;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public class ResourceBasicInfoServiceImpl extends Service implements ResourceBasicInfoService {
|
||||||
|
|
||||||
|
private static final String RIGHT_NAME = "ResourceBasicInfo:All";
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||||
|
Map<String,Object> resultMap = new HashMap<>();
|
||||||
|
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||||
|
resultMap.put("hasRight", hasRight);
|
||||||
|
if (!hasRight) {
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
OrganizationWeaTable<ResourceBasicInfoVO> table = new OrganizationWeaTable<>(user,ResourceBasicInfoVO.class);
|
||||||
|
String sqlWhere = buildSqlWhere(params);
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
resultMap.putAll(result.getResultMap());
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TypeTreeVO> getTreeData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildSqlWhere(Map<String, Object> params) {
|
||||||
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||||
|
String sqlWhere = " where t.fdelete = 0 ";
|
||||||
|
String fclassid = (String) params.get("fclassid");
|
||||||
|
if (StringUtils.isNotBlank(fclassid) && !"-1".equals(fclassid)) {
|
||||||
|
sqlWhere += " AND t.fclassid = '" + fclassid + "'";
|
||||||
|
}
|
||||||
|
String fno = (String) params.get("fno");
|
||||||
|
if (StringUtils.isNotBlank(fno)) {
|
||||||
|
sqlWhere += " AND t.fno = '" + fno + "'";
|
||||||
|
}
|
||||||
|
String fname = (String) params.get("fname");
|
||||||
|
if (StringUtils.isNotBlank(fname)) {
|
||||||
|
sqlWhere += " AND t.fname " + dbType.like(fname);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sqlWhere;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
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.ResourceBasicInfoWrapper;
|
||||||
|
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 weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public class ResourceBasicInfoController {
|
||||||
|
|
||||||
|
private ResourceBasicInfoWrapper getResourceBasicInfoWrapper(User user) {
|
||||||
|
return ServiceUtil.getService(ResourceBasicInfoWrapper.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/getTable")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public ReturnResult getResourceBasicInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getResourceBasicInfo(map));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ReturnResult.exceptionHandle(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/getTreeData")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getTreeData());
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ReturnResult.exceptionHandle(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.engine.organization.wrapper;
|
||||||
|
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||||
|
import com.engine.organization.service.ResourceBasicInfoService;
|
||||||
|
import com.engine.organization.service.impl.ResourceBasicInfoServiceImpl;
|
||||||
|
import com.engine.organization.util.OrganizationWrapper;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/8/23
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
||||||
|
|
||||||
|
private ResourceBasicInfoService getResourceBasicInfoService(User user){
|
||||||
|
return ServiceUtil.getService(ResourceBasicInfoServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getResourceBasicInfo(Map<String, Object> params) {
|
||||||
|
return getResourceBasicInfoService(user).listPage(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TypeTreeVO> getTreeData() {
|
||||||
|
return getResourceBasicInfoService(user).getTreeData();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue