@ -0,0 +1,12 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/personnelcard")
|
||||
public class PersonnelCardController extends com.engine.organization.web.PersonnelCardController {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 锚点实体类
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Anchor {
|
||||
private String id;
|
||||
private String title;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FormItem {
|
||||
private String id;
|
||||
private String title;
|
||||
private List<Item> items;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Iframe {
|
||||
private String id;
|
||||
private String title;
|
||||
private String url;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Item {
|
||||
private String fieldId;
|
||||
private Object fieldValue;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 人员自定义显示栏目实体类
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ResourceBaseTab {
|
||||
private Integer id;
|
||||
private String groupName;
|
||||
private Integer groupLabel;
|
||||
private Integer dspOrder;
|
||||
private String isOpen;
|
||||
private String isMand;
|
||||
private String isUsed;
|
||||
private String isSystem;
|
||||
private String linkUrl;
|
||||
private String tabNum;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class Statistical {
|
||||
private Integer workflowCount;
|
||||
private Integer docCount;
|
||||
private Integer cusCount;
|
||||
private Integer collaborationCount;
|
||||
private Integer weiboCount;
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.engine.organization.entity.personnelcard;
|
||||
|
||||
import com.api.system.language.service.LanguageService;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.util.field.FieldDefinedValueUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class User {
|
||||
private Integer id;
|
||||
private String image;
|
||||
private String name;
|
||||
private String sex;
|
||||
private String email;
|
||||
private String phone;
|
||||
private String belongTo;
|
||||
private String status;
|
||||
|
||||
public String getSex() {
|
||||
if ("0".equals(sex)) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
weaver.hrm.User user = new weaver.hrm.User();
|
||||
user.setLanguage(LanguageService.getDefaultLang());
|
||||
return FieldDefinedValueUtil.getFieldValue(user, ExtendInfoPO.builder().controlType(6).browserType("1").build(), image);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.engine.organization.mapper.personnelcard;
|
||||
|
||||
import com.engine.organization.entity.personnelcard.ResourceBaseTab;
|
||||
import com.engine.organization.entity.personnelcard.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface PersonnelCardMapper {
|
||||
/**
|
||||
* 获取人员卡片User对象
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
User getUserById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取自定义显示栏目
|
||||
* @return
|
||||
*/
|
||||
List<ResourceBaseTab> getResourceBaseTabList();
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
<?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.engine.organization.mapper.personnelcard.PersonnelCardMapper">
|
||||
<resultMap id="UserMap" type="com.engine.organization.entity.personnelcard.User">
|
||||
<result column="id" property="id"/>
|
||||
<result column="messagerurl" property="image"/>
|
||||
<result column="lastname" property="name"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="mobile" property="phone"/>
|
||||
<result column="belongto" property="belongTo"/>
|
||||
<result column="status" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BaseTabMap" type="com.engine.organization.entity.personnelcard.ResourceBaseTab">
|
||||
<result column="id" property="id"/>
|
||||
<result column="groupname" property="groupName"/>
|
||||
<result column="grouplabel" property="groupLabel"/>
|
||||
<result column="dsporder" property="dspOrder"/>
|
||||
<result column="isopen" property="isOpen"/>
|
||||
<result column="ismand" property="isMand"/>
|
||||
<result column="isused" property="isUsed"/>
|
||||
<result column="issystem" property="isSystem"/>
|
||||
<result column="linkurl" property="linkUrl"/>
|
||||
<result column="tabnum" property="tabNum"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getUserById" resultMap="UserMap">
|
||||
select id,
|
||||
messagerurl,
|
||||
lastname,
|
||||
sex,
|
||||
email,
|
||||
mobile,
|
||||
belongto,
|
||||
status
|
||||
from hrmresource
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getResourceBaseTabList" resultMap="BaseTabMap">
|
||||
select *
|
||||
from HrmResourceBaseTab
|
||||
where isopen = 1
|
||||
order by dsporder
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.personnelcard.Iframe;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmPersonnelCardService {
|
||||
/**
|
||||
* 获取人事卡片信息
|
||||
*
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getPersonnelCard(Long uId);
|
||||
|
||||
/**
|
||||
* 获取人事自定义显示栏目
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Iframe> getIframeList();
|
||||
}
|
@ -0,0 +1,314 @@
|
||||
package com.engine.organization.util.field;
|
||||
|
||||
import com.engine.hrm.biz.HrmClassifiedProtectionBiz;
|
||||
import com.engine.hrm.biz.HrmCountryCityBiz;
|
||||
import com.engine.organization.entity.SelectOptionParam;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.cpt.capital.CapitalComInfo;
|
||||
import weaver.crm.Maint.CustomerInfoComInfo;
|
||||
import weaver.docs.docs.DocComInfo;
|
||||
import weaver.docs.senddoc.DocReceiveUnitComInfo;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.formmode.browser.FormModeBrowserUtil;
|
||||
import weaver.formmode.tree.CustomTreeUtil;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.StaticObj;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.city.CityComInfo;
|
||||
import weaver.hrm.city.CitytwoComInfo;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
import weaver.hrm.province.ProvinceComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
import weaver.hrm.tools.TrainTypeComInfo;
|
||||
import weaver.hrm.train.TrainLayoutComInfo;
|
||||
import weaver.hrm.train.TrainResourceComInfo;
|
||||
import weaver.interfaces.workflow.browser.Browser;
|
||||
import weaver.interfaces.workflow.browser.BrowserBean;
|
||||
import weaver.proj.Maint.ProjectInfoComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
import weaver.workflow.field.BrowserComInfo;
|
||||
import weaver.workflow.request.ResourceConditionManager;
|
||||
import weaver.workflow.workflow.WorkflowRequestComInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class FieldDefinedValueUtil {
|
||||
|
||||
/**
|
||||
* 根据值获取展示信息
|
||||
* @param user
|
||||
* @param infoPO
|
||||
* @param fieldValue
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldValue(User user, ExtendInfoPO infoPO, String fieldValue) {
|
||||
int fieldHtmlType = infoPO.getControlType();
|
||||
int fieldType = Integer.parseInt(infoPO.getBrowserType());
|
||||
String requestId = SelectOptionParam.getCustomBrowserId(infoPO.getCustomValue());
|
||||
RecordSet rs = new RecordSet();
|
||||
StringBuilder showName = new StringBuilder();
|
||||
if (fieldHtmlType == 3) {
|
||||
if (fieldType == 402 || fieldType == 403) {
|
||||
showName = new StringBuilder(fieldValue);
|
||||
}
|
||||
List<String> tempshowidlist = Util.splitString2List(fieldValue, ",");
|
||||
if (fieldType == 1 || fieldType == 17) { // 人员,多人员
|
||||
for (String o : tempshowidlist) {
|
||||
try {
|
||||
showName.append(new ResourceComInfo()
|
||||
.getResourcename(o)).append(",");
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} else if (fieldType == 2 || fieldType == 19) { // 日期,时间
|
||||
showName.append(fieldValue);
|
||||
} else if (fieldType == 141) { // 人力资源条件
|
||||
ResourceConditionManager rcm = new ResourceConditionManager();
|
||||
showName.append(rcm.getFormShowName(fieldValue, user.getLanguage()));
|
||||
} else if (fieldType == 4 || fieldType == 57) { // 部门,多部门
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new DepartmentComInfo()
|
||||
.getDepartmentname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 8 || fieldType == 135) { // 项目,多项目
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new ProjectInfoComInfo()
|
||||
.getProjectInfoname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 7 || fieldType == 18) { // 客户,多客户
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new CustomerInfoComInfo()
|
||||
.getCustomerInfoname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 164) { // 分部
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new SubCompanyComInfo()
|
||||
.getSubCompanyname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 170) { // 分权多分部
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new SubCompanyComInfo().getSubCompanyname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 9) { // 单文档
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new DocComInfo()
|
||||
.getDocname((String) s));
|
||||
}
|
||||
} else if (fieldType == 37) { // 多文档
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new DocComInfo()
|
||||
.getDocname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 23) { // 资产
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new CapitalComInfo()
|
||||
.getCapitalname((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 16 || fieldType == 152) { // 相关请求
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(new WorkflowRequestComInfo()
|
||||
.getRequestName((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 142) {// 收发文单位
|
||||
DocReceiveUnitComInfo docReceiveUnitComInfo = new DocReceiveUnitComInfo();
|
||||
for (String s : tempshowidlist) {
|
||||
showName.append(docReceiveUnitComInfo
|
||||
.getReceiveUnitName((String) s)).append(",");
|
||||
}
|
||||
} else if (fieldType == 226 || fieldType == 227) {// -zzl系统集成浏览按钮
|
||||
showName.append(fieldValue);
|
||||
} else if (fieldType == 301) {//培训种类
|
||||
showName.append(new TrainTypeComInfo().getTrainTypename(fieldValue));
|
||||
} else if (fieldType == 302) {//培训规划
|
||||
showName.append(new TrainLayoutComInfo().getLayoutname(fieldValue));
|
||||
} else if (fieldType == 303) {//培训资源
|
||||
showName.append(new TrainResourceComInfo().getResourcename(fieldValue));
|
||||
} else if (fieldType == 304) {//人事--合同模板
|
||||
String sql = "select templetname from HrmContractTemplet where id=" + fieldValue;
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
if (recordSet.next()) {
|
||||
showName.append(recordSet.getString("templetname"));
|
||||
}
|
||||
} else if (fieldType == 305) {//人事--考核项目
|
||||
String sql = "select checkitemname from HrmCheckItem where id=" + fieldValue;
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
if (recordSet.next()) {
|
||||
showName.append(recordSet.getString("checkitemname"));
|
||||
}
|
||||
} else if (fieldType == 307) {//人事--招聘信息
|
||||
String sql = "select b.jobtitlename from HrmCareerInvite a left join HrmJobTitles b on a.careername = b.id where a.id=" + fieldValue;
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
if (recordSet.next()) {
|
||||
showName.append(recordSet.getString("jobtitlename"));
|
||||
}
|
||||
} else if (fieldType == 308) {//人事--招聘计划
|
||||
String sql = "select topic from HrmCareerPlan where id=" + fieldValue;
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
if (recordSet.next()) {
|
||||
showName.append(recordSet.getString("topic"));
|
||||
}
|
||||
} else if (fieldType == 309) {//人事--用工需求
|
||||
String sql = "select j.jobtitlename from HrmUseDemand a left join HrmJobTitles j on a.demandjobtitle = j.id where a.id=" + fieldValue;
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
if (recordSet.next()) {
|
||||
showName.append(recordSet.getString("jobtitlename"));
|
||||
}
|
||||
} else if (fieldType == 311) {
|
||||
HrmClassifiedProtectionBiz hrmClassifiedProtectionBiz = new HrmClassifiedProtectionBiz();
|
||||
showName = new StringBuilder(hrmClassifiedProtectionBiz.getUserSecLevelShowName(fieldValue, "" + user.getLanguage()));
|
||||
} else if (fieldType == 312) {
|
||||
HrmClassifiedProtectionBiz hrmClassifiedProtectionBiz = new HrmClassifiedProtectionBiz();
|
||||
showName = new StringBuilder(hrmClassifiedProtectionBiz.getResourceSecLevelShowName(fieldValue, "" + user.getLanguage()));
|
||||
} else if (fieldType == 313) {//人事--网段策略
|
||||
String sql = "select * from HrmNetworkSegStr where id in (" + fieldValue + ") ";
|
||||
RecordSet recordSet = new RecordSet();
|
||||
recordSet.executeQuery(sql);
|
||||
while (recordSet.next()) {
|
||||
String inceptipaddress = Util.null2String(recordSet.getString("inceptipaddress"));//起始IP地址
|
||||
String endipaddress = Util.null2String(recordSet.getString("endipaddress"));//截止IP地址
|
||||
|
||||
showName.append(",").append(inceptipaddress).append("~").append(endipaddress);
|
||||
}
|
||||
showName = new StringBuilder(showName.length() > 0 ? showName.substring(1) : "");
|
||||
} else if (fieldType == 24) {//岗位
|
||||
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
||||
String[] fieldValueArr = fieldValue.split(",");
|
||||
for (String s : fieldValueArr) {
|
||||
showName.append(",").append(jobTitlesComInfo.getJobTitlesmark(s));
|
||||
}
|
||||
if (showName.length() > 0) {
|
||||
showName = new StringBuilder(showName.substring(1));
|
||||
}
|
||||
} else if (fieldType == 2222) { // 省份
|
||||
ProvinceComInfo provinceComInfo = new ProvinceComInfo();
|
||||
HrmCountryCityBiz hrmCountryCityBiz = new HrmCountryCityBiz(fieldType + "");
|
||||
String name = hrmCountryCityBiz.getPath(fieldValue, fieldType + "");
|
||||
showName.append(name).append(provinceComInfo.getProvincename(fieldValue));
|
||||
} else if (fieldType == 58) { //城市
|
||||
CityComInfo cityComInfo = new CityComInfo();
|
||||
HrmCountryCityBiz hrmCountryCityBiz = new HrmCountryCityBiz(fieldType + "");
|
||||
String name = hrmCountryCityBiz.getPath(fieldValue, fieldType + "");
|
||||
showName.append(name).append(cityComInfo.getCityname(fieldValue));
|
||||
} else if (fieldType == 263) { //区县
|
||||
CitytwoComInfo citytwoComInfo = new CitytwoComInfo();
|
||||
HrmCountryCityBiz hrmCountryCityBiz = new HrmCountryCityBiz(fieldType + "");
|
||||
String name = hrmCountryCityBiz.getPath(fieldValue, fieldType + "");
|
||||
showName.append(name).append(citytwoComInfo.getCityname(fieldValue));
|
||||
} else if (fieldType == 278) {
|
||||
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
||||
String[] fieldValueArr = fieldValue.split(",");
|
||||
for (String s : fieldValueArr) {
|
||||
showName.append(",").append(jobTitlesComInfo.getJobTitlesmark(s));
|
||||
}
|
||||
if (showName.length() > 0) {
|
||||
showName = new StringBuilder(showName.substring(1));
|
||||
}
|
||||
} else if (fieldType == 161 || fieldType == 162) { //自定义浏览按钮
|
||||
try {
|
||||
String fieldDbType = requestId;//用requestid传递数据 dmlurl
|
||||
if (Util.null2String(fieldDbType).length() == 0 || fieldDbType.equals("emptyVal")) return "";
|
||||
String sql = "select count(1) from mode_browser where showname = '" + fieldDbType + "'";
|
||||
rs.execute(sql);
|
||||
if (rs.next()) {//建模浏览框
|
||||
if (!fieldDbType.startsWith("browser.")) {
|
||||
fieldDbType = "browser." + fieldDbType;
|
||||
}
|
||||
FormModeBrowserUtil FormModeBrowserUtil = new FormModeBrowserUtil();
|
||||
showName = new StringBuilder(Util.null2String(FormModeBrowserUtil.getBrowserNameById(fieldDbType, fieldValue, user).get("browsername")));
|
||||
} else {//集成浏览框
|
||||
if (!fieldDbType.startsWith("browser.")) {
|
||||
fieldDbType = "browser." + fieldDbType;
|
||||
}
|
||||
Browser browser = (Browser) StaticObj.getServiceByFullname(fieldDbType, Browser.class);
|
||||
for (String s : tempshowidlist) {
|
||||
try {
|
||||
BrowserBean bb = browser.searchById(s);
|
||||
String name = Util.null2String(bb.getName());
|
||||
if (showName.toString().equals("")) {
|
||||
showName.append(name);
|
||||
} else {
|
||||
showName.append(",").append(name);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
}
|
||||
|
||||
} else if (fieldType == 256 || fieldType == 257) {
|
||||
if (!fieldValue.equals("null")) {
|
||||
CustomTreeUtil customTreeUtil = new CustomTreeUtil();
|
||||
for (String s : tempshowidlist) {
|
||||
String show_val = Util.null2String(s);
|
||||
String name = customTreeUtil.getTreeFieldShowName(show_val, requestId);
|
||||
if (showName.toString().equals("")) {
|
||||
showName.append(name);
|
||||
} else {
|
||||
showName.append(",").append(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String sql = "";
|
||||
String tableName = new BrowserComInfo().getBrowsertablename(""
|
||||
+ fieldType);
|
||||
String columName = new BrowserComInfo().getBrowsercolumname(""
|
||||
+ fieldType);
|
||||
String keyColumName = new BrowserComInfo()
|
||||
.getBrowserkeycolumname("" + fieldType);
|
||||
if (columName.equals("") || tableName.equals("")
|
||||
|| keyColumName.equals("") || fieldValue.equals("")) {
|
||||
new BaseBean().writeLog("GET FIELD ERR: fieldType=" + fieldType);
|
||||
} else {
|
||||
sql = "select " + columName + " from " + tableName
|
||||
+ " where " + keyColumName + " in(" + fieldValue
|
||||
+ ")";
|
||||
rs.execute(sql);
|
||||
while (rs.next()) {
|
||||
showName.append(rs.getString(1)).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showName.toString().endsWith(",")) {
|
||||
showName = new StringBuilder(showName.substring(0, showName.length() - 1));
|
||||
}
|
||||
} else if (fieldHtmlType == 4) { // check框
|
||||
if (fieldValue.equals("1")) {
|
||||
showName.append("√");
|
||||
}
|
||||
} else if (fieldHtmlType == 5) {
|
||||
showName = new StringBuilder(SelectOptionParam.getSelectOption(infoPO.getCustomValue(), fieldValue));
|
||||
} else if (fieldHtmlType == 6) { // 附件
|
||||
if (Util.null2String(fieldValue).length() > 0) {
|
||||
String[] fileids = Util.splitString(fieldValue, ",");
|
||||
for (String fileid : fileids) {
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(Util.getIntValue(fileid));
|
||||
showName.append("<div id='file").append(fileid).append("'>").append(manager.getImageFileName()).append(" ").append("<A href=\"/weaver/weaver.file.FileDownload?fileid=").append(fileid).append("&download=1\" target=\"_blank\">").append(SystemEnv.getHtmlLabelName(258, user.getLanguage())).append("</A> </div>");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showName = new StringBuilder(fieldValue);
|
||||
}
|
||||
return showName.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
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.PersonnelCardWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
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:dxfeng
|
||||
* @createTime: 2022/10/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PersonnelCardController {
|
||||
public PersonnelCardWrapper getPersonnelCardWrapper(User user) {
|
||||
return ServiceUtil.getService(PersonnelCardWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getPersonnelCard")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getPersonnelCard(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
String id = Util.null2String(map.get("id"));
|
||||
return ReturnResult.successed(getPersonnelCardWrapper(user).getPersonnelCard(StringUtils.isBlank(id) ? null : Long.parseLong(id)));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getIframeList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getIframeList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getPersonnelCardWrapper(user).getIframeList());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.personnelcard.Iframe;
|
||||
import com.engine.organization.service.HrmPersonnelCardService;
|
||||
import com.engine.organization.service.impl.HrmPersonnelCardServiceImpl;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PersonnelCardWrapper extends OrganizationWrapper {
|
||||
private HrmPersonnelCardService getHrmPersonnelCardService(User user) {
|
||||
return ServiceUtil.getService(HrmPersonnelCardServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getPersonnelCard(Long uId) {
|
||||
return getHrmPersonnelCardService(user).getPersonnelCard(uId);
|
||||
}
|
||||
|
||||
public List<Iframe> getIframeList() {
|
||||
return getHrmPersonnelCardService(user).getIframeList();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue