commit
124756b0b7
|
|
@ -2,70 +2,70 @@
|
|||
insert into SystemRights (id,rightdesc,righttype) values (-20220601,'等级方案权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220601,7,'等级方案权限','等级方案权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220601,8,'Scheme Right','Scheme Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220601,'等级方案权限','Scheme:All:',-20220601) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220601,'等级方案权限','Scheme:All',-20220601) ;
|
||||
|
||||
-- 职等
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220602,'职等权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220602,7,'职等权限','职等权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220602,8,'Level Right','Level Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220602,'职等权限','Level:All:',-20220602) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220602,'职等权限','Level:All',-20220602) ;
|
||||
|
||||
-- 职级
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220603,'职级权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220603,7,'职级权限','职级权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220603,8,'Grade Right','Grade Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220603,'职级权限','Grade:All:',-20220603) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220603,'职级权限','Grade:All',-20220603) ;
|
||||
|
||||
-- 岗位序列
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220604,'岗位序列权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220604,7,'岗位序列权限','岗位序列权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220604,8,'Sequence Right','Sequence Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220604,'岗位序列权限','Sequence:All:',-20220604) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220604,'岗位序列权限','Sequence:All',-20220604) ;
|
||||
|
||||
-- 职务分类
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220605,'职务分类权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220605,7,'职务分类权限','职务分类权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220605,8,'Post Right','Post Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220605,'职务分类权限','Post:All:',-20220605) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220605,'职务分类权限','Post:All',-20220605) ;
|
||||
|
||||
-- 职务信息
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220606,'职务信息权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220606,7,'职务信息权限','职务信息权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220606,8,'PostInfo Right','PostInfo Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220606,'职务信息权限','PostInfo:All:',-20220606) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220606,'职务信息权限','PostInfo:All',-20220606) ;
|
||||
|
||||
-- 集团管理
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220607,'集团管理权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220607,7,'集团管理权限','集团管理权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220607,8,'Group Right','Group Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220607,'集团管理权限','Group:All:',-20220607) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220607,'集团管理权限','Group:All',-20220607) ;
|
||||
|
||||
-- 公司/分部管理
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220608,'公司/分部管理权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220608,7,'公司/分部管理权限','公司/分部管理权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220608,8,'Company Right','Company Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220608,'公司/分部管理权限','Company:All:',-20220608) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220608,'公司/分部管理权限','Company:All',-20220608) ;
|
||||
|
||||
-- 部门管理
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220609,'部门管理权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220609,7,'部门管理权限','部门管理权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220609,8,'Department Right','Department Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220609,'部门管理权限','Department:All:',-20220609) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220609,'部门管理权限','Department:All',-20220609) ;
|
||||
|
||||
-- 岗位管理
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220610,'岗位管理权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220610,7,'岗位管理权限','岗位管理权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220610,8,'Job Right','Job Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220610,'岗位管理权限','Job:All:',-20220610) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220610,'岗位管理权限','Job:All',-20220610) ;
|
||||
|
||||
-- 编制方案
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220611,'编制方案权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220611,7,'编制方案权限','编制方案权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220611,8,'StaffPlan Right','StaffPlan Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220611,'编制方案权限','StaffPlan:All:',-20220611) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220611,'编制方案权限','StaffPlan:All',-20220611) ;
|
||||
|
||||
-- 编制表
|
||||
insert into SystemRights (id,rightdesc,righttype) values (-20220612,'编制表权限','0');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220612,7,'编制表权限','编制表权限');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (-20220612,8,'Staff Right','Staff Right');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220612,'编制表权限','Staff:All:',-20220612) ;
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (-20220612,'编制表权限','Staff:All',-20220612) ;
|
||||
|
|
@ -119,6 +119,7 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
|
|||
pid int null,
|
||||
extend_type int null,
|
||||
group_name varchar(100) NULL,
|
||||
show_order int null,
|
||||
creator int null,
|
||||
delete_type int null,
|
||||
create_time date null,
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
|
|||
PID NUMBER NULL,
|
||||
EXTEND_TYPE NUMBER NULL,
|
||||
GROUP_NAME NVARCHAR2(100) NULL,
|
||||
SHOW_ORDER NUMBER null,
|
||||
CREATOR NUMBER NULL,
|
||||
DELETE_TYPE NUMBER NULL,
|
||||
CREATE_TIME DATE NULL,
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
|
|||
pid int null,
|
||||
extend_type int null,
|
||||
group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
|
||||
show_order int null,
|
||||
creator int null,
|
||||
delete_type int null,
|
||||
create_time datetime null,
|
||||
|
|
|
|||
|
|
@ -38,4 +38,78 @@ public class SelectOptionParam {
|
|||
}
|
||||
return selectOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自定义浏览按钮标识
|
||||
*
|
||||
* @param customValue
|
||||
* @return
|
||||
*/
|
||||
public static String getCustomBrowserId(String customValue) {
|
||||
try {
|
||||
JSONArray objects = JSONObject.parseArray(customValue);
|
||||
if (null != objects && objects.size() > 2) {
|
||||
JSONObject object = (JSONObject) objects.get(2);
|
||||
return object.getString("value");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return customValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自定义浏览按钮标识
|
||||
*
|
||||
* @param customValue
|
||||
* @return
|
||||
*/
|
||||
public static String getCustomBrowserValueSpan(String customValue) {
|
||||
JSONArray objects = JSONObject.parseArray(customValue);
|
||||
if (null != objects && objects.size() > 2) {
|
||||
JSONObject object = (JSONObject) objects.get(2);
|
||||
return object.getString("valueSpan");
|
||||
}
|
||||
return customValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文本长度
|
||||
*
|
||||
* @param customValue
|
||||
* @return
|
||||
*/
|
||||
public static String getTextLength(String customValue) {
|
||||
JSONArray objects = JSONObject.parseArray(customValue);
|
||||
|
||||
if (null != objects && objects.size() > 2) {
|
||||
return objects.get(2).toString();
|
||||
}
|
||||
return customValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下拉框信息
|
||||
*
|
||||
* @param customValue
|
||||
* @return
|
||||
*/
|
||||
public static List<Object> getSelectFields(String customValue) {
|
||||
List<Object> selectFields = new ArrayList<>();
|
||||
JSONArray objects = JSONObject.parseArray(customValue);
|
||||
if (objects.size() < 3) {
|
||||
return selectFields;
|
||||
}
|
||||
JSONObject o = (JSONObject) objects.get(2);
|
||||
JSONArray datas = o.getJSONArray("datas");
|
||||
if (!datas.isEmpty()) {
|
||||
int size = datas.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
selectFields.add(datas.get(i));
|
||||
}
|
||||
}
|
||||
return selectFields;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,13 +63,13 @@ public class ExtendGroupBO {
|
|||
public static String getTableNameByGroupPO(ExtendGroupPO extendGroupPO) {
|
||||
String tableName = "";
|
||||
switch (extendGroupPO.getExtendType()) {
|
||||
case -1:
|
||||
case 1:
|
||||
tableName = "JCL_ORG_COMP";
|
||||
break;
|
||||
case -2:
|
||||
case 2:
|
||||
tableName = "JCL_ORG_DEPT";
|
||||
break;
|
||||
case -3:
|
||||
case 3:
|
||||
tableName = "JCL_ORG_JOB";
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -16,8 +16,12 @@ import com.engine.organization.entity.SelectOptionParam;
|
|||
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -81,6 +85,9 @@ public class ExtendInfoBO {
|
|||
String controlType = infoFieldParam.getControlType();
|
||||
String browserType = infoFieldParam.getBrowserType(controlType);
|
||||
String dbType = infoFieldParam.getDbType(controlType, browserType);
|
||||
if (StringUtils.isEmpty(dbType)) {
|
||||
dbType = infoFieldParam.getDbType("2", "");
|
||||
}
|
||||
return ExtendInfoPO
|
||||
.builder()
|
||||
.id(infoFieldParam.getId())
|
||||
|
|
@ -93,10 +100,10 @@ public class ExtendInfoBO {
|
|||
.controlType(Integer.parseInt(controlType))
|
||||
.browserType(browserType)
|
||||
.extendGroupId(extendGroupId)
|
||||
.isenable(Integer.parseInt(infoFieldParam.getEnable()))
|
||||
.isrequired(Integer.parseInt(infoFieldParam.getRequired()))
|
||||
.isenable(null == infoFieldParam.getEnable() ? null : Integer.parseInt(infoFieldParam.getEnable()))
|
||||
.isrequired(null == infoFieldParam.getRequired() ? null : Integer.parseInt(infoFieldParam.getRequired()))
|
||||
.listShow(1)
|
||||
.editShow(1)
|
||||
.editShow(null == infoFieldParam.getIsModify() ? null : Integer.parseInt(infoFieldParam.getIsModify()))
|
||||
.addShow(1)
|
||||
.browserShow(1)
|
||||
.customValue(infoFieldParam.getFieldType().toString())
|
||||
|
|
@ -107,6 +114,22 @@ public class ExtendInfoBO {
|
|||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前自定义字段是否已使用
|
||||
*
|
||||
* @param tableName
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
public static boolean fieldIsUsed(String tableName, String fieldName) {
|
||||
if (StringUtils.isAnyEmpty(tableName, fieldName)) {
|
||||
return true;
|
||||
}
|
||||
List<Object> objects = MapperProxyFactory.getProxy(ExtendInfoMapper.class).listFieldsByTableName(tableName, fieldName);
|
||||
objects.removeIf(Objects::isNull);
|
||||
return CollectionUtils.isNotEmpty(objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细表字段
|
||||
*
|
||||
|
|
@ -157,7 +180,8 @@ public class ExtendInfoBO {
|
|||
|
||||
// 浏览按钮特殊处理
|
||||
if (FieldType.BROWSER.equals(fieldItem.getType())) {
|
||||
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), extendInfoPO.getCustomValue()).getBrowserConditionParam();
|
||||
String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue());
|
||||
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam();
|
||||
fieldItem.setBrowserConditionParam(browserConditionParam);
|
||||
}
|
||||
|
||||
|
|
@ -224,6 +248,7 @@ public class ExtendInfoBO {
|
|||
} else if (fieldhtmltype.equals("2")) {//多行文本框
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.TEXTAREA, fieldlabel, fieldname);
|
||||
} else if (fieldhtmltype.equals("3")) {//浏览按钮
|
||||
customValue = SelectOptionParam.getCustomBrowserId(customValue);
|
||||
if (detailtype.equals("2")) {
|
||||
if (!extendInfoPO.getTableName().toLowerCase().contains("_dt")) {
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.organization.entity.extend.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ExtendFieldSearchParam {
|
||||
private String groupId;
|
||||
private String groupType;
|
||||
}
|
||||
|
|
@ -13,11 +13,20 @@ import java.util.List;
|
|||
*/
|
||||
public interface ExtendInfoMapper {
|
||||
|
||||
List<ExtendInfoPO> listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName,@Param("operateType")String operateType);
|
||||
List<ExtendInfoPO> listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName, @Param("operateType") String operateType);
|
||||
|
||||
int countFieldsByGroupId(@Param("groupId") Long groupId);
|
||||
|
||||
int updateExtendInfo(ExtendInfoPO extendInfo);
|
||||
|
||||
int insertExtendInfo(ExtendInfoPO extendInfo);
|
||||
|
||||
// 添加表结构
|
||||
void addTableColumn(@Param("tableName") String tableName, @Param("fieldName") String fieldName, @Param("dbType") String dbType);
|
||||
|
||||
Long getMaxId();
|
||||
|
||||
List<Object> listFieldsByTableName(@Param("tableName") String tableName, @Param("fieldName") String fieldName);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,156 @@
|
|||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
<update id="updateExtendInfo">
|
||||
|
||||
<insert id="insertExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO"
|
||||
keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_field_extendinfo
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="extendType != null ">
|
||||
extend_type,
|
||||
</if>
|
||||
<if test="tableName != null ">
|
||||
table_name,
|
||||
</if>
|
||||
<if test="fieldName != null ">
|
||||
field_name,
|
||||
</if>
|
||||
<if test="fieldNameDesc != null ">
|
||||
field_name_desc,
|
||||
</if>
|
||||
<if test="fieldType != null ">
|
||||
field_type,
|
||||
</if>
|
||||
<if test="controlType != null ">
|
||||
control_type,
|
||||
</if>
|
||||
<if test="browserType != null ">
|
||||
browser_type,
|
||||
</if>
|
||||
<if test="extendGroupId != null ">
|
||||
extend_group_id,
|
||||
</if>
|
||||
<if test="isenable != null ">
|
||||
isenable,
|
||||
</if>
|
||||
<if test="isrequired != null ">
|
||||
isrequired,
|
||||
</if>
|
||||
<if test="listShow != null ">
|
||||
list_show,
|
||||
</if>
|
||||
<if test="searchShow != null ">
|
||||
search_show,
|
||||
</if>
|
||||
<if test="editShow != null ">
|
||||
edit_show,
|
||||
</if>
|
||||
<if test="addShow != null ">
|
||||
add_show,
|
||||
</if>
|
||||
<if test="browserShow != null ">
|
||||
browser_show,
|
||||
</if>
|
||||
<if test="customValue != null ">
|
||||
custom_value,
|
||||
</if>
|
||||
<if test="showOrder != null ">
|
||||
show_order,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="extendType != null ">
|
||||
#{extendType},
|
||||
</if>
|
||||
<if test="tableName != null ">
|
||||
#{tableName},
|
||||
</if>
|
||||
<if test="fieldName != null ">
|
||||
#{fieldName},
|
||||
</if>
|
||||
<if test="fieldNameDesc != null ">
|
||||
#{fieldNameDesc},
|
||||
</if>
|
||||
<if test="fieldType != null ">
|
||||
#{fieldType},
|
||||
</if>
|
||||
<if test="controlType != null ">
|
||||
#{controlType},
|
||||
</if>
|
||||
<if test="browserType != null ">
|
||||
#{browserType},
|
||||
</if>
|
||||
<if test="extendGroupId != null ">
|
||||
#{extendGroupId},
|
||||
</if>
|
||||
<if test="isenable != null ">
|
||||
#{isenable},
|
||||
</if>
|
||||
<if test="isrequired != null ">
|
||||
#{isrequired},
|
||||
</if>
|
||||
<if test="listShow != null ">
|
||||
#{listShow},
|
||||
</if>
|
||||
<if test="searchShow != null ">
|
||||
#{searchShow},
|
||||
</if>
|
||||
<if test="editShow != null ">
|
||||
#{editShow},
|
||||
</if>
|
||||
<if test="addShow != null ">
|
||||
#{addShow},
|
||||
</if>
|
||||
<if test="browserShow != null ">
|
||||
#{browserShow},
|
||||
</if>
|
||||
<if test="customValue != null ">
|
||||
#{customValue},
|
||||
</if>
|
||||
<if test="showOrder != null ">
|
||||
#{showOrder},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="addTableColumn">
|
||||
ALTER TABLE ${tableName}
|
||||
ADD ${fieldName} ${dbType} NULL;
|
||||
</update>
|
||||
<update id="updateExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO">
|
||||
update jcl_field_extendinfo
|
||||
<set>
|
||||
update_time=#{updateTime},
|
||||
field_name_desc=#{fieldNameDesc},
|
||||
isenable=#{isenable},
|
||||
isrequired=#{isrequired},
|
||||
edit_show=#{editShow},
|
||||
show_order=#{showOrder},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
|
|
@ -84,6 +232,15 @@
|
|||
where t.delete_type = 0
|
||||
and extend_group_id = #{groupId}
|
||||
</select>
|
||||
<select id="getMaxId" resultType="java.lang.Long">
|
||||
select max(id)
|
||||
from jcl_field_extendinfo
|
||||
order by id desc
|
||||
</select>
|
||||
<select id="listFieldsByTableName" resultType="java.lang.Object">
|
||||
select ${fieldName}
|
||||
from ${tableName}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
|
||||
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
|
||||
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
|
|
@ -79,7 +80,7 @@ public interface FieldDefinedService {
|
|||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getFieldDefinedInfo(ExtendTitleSaveParam param);
|
||||
Map<String, Object> getFieldDefinedInfo(ExtendFieldSearchParam param);
|
||||
|
||||
/**
|
||||
* 删除树类型
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONArray;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.SelectOptionParam;
|
||||
import com.engine.organization.entity.extend.bo.ExtendGroupBO;
|
||||
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
||||
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
|
||||
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
|
|
@ -24,10 +26,12 @@ import com.engine.organization.util.OrganizationAssert;
|
|||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
import weaver.workflow.field.BrowserComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -92,7 +96,8 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
// 主表、主表拓展表为extend_title主键;明细表为extend_group主键
|
||||
Long extendGroupId = jsonObject.getLong("groupId");
|
||||
|
||||
JSONArray records = (JSONArray) jsonObject.get("records");
|
||||
JSONArray records = jsonObject.getJSONArray("records");
|
||||
int updateCount = 0;
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
// 存在ID则更新 ,不存在ID则增加
|
||||
ExtendInfoFieldParam infoFieldParam = JSONObject.toJavaObject((JSONObject) records.get(i), ExtendInfoFieldParam.class);
|
||||
|
|
@ -101,15 +106,24 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
|
||||
if (null != extendInfo.getId()) {
|
||||
// 更新 extend_title数据
|
||||
getExtendInfoMapper().updateExtendInfo(extendInfo);
|
||||
|
||||
updateCount += getExtendInfoMapper().updateExtendInfo(extendInfo);
|
||||
} else {
|
||||
// 新增extend_title数据
|
||||
|
||||
// 获取操作表最大id,生成字段名
|
||||
Long maxId = getExtendInfoMapper().getMaxId();
|
||||
extendInfo.setFieldName("field" + (maxId + 1));
|
||||
updateCount += getExtendInfoMapper().insertExtendInfo(extendInfo);
|
||||
// 新增表结构
|
||||
getExtendInfoMapper().addTableColumn(extendInfo.getTableName(), extendInfo.getFieldName(), extendInfo.getFieldType());
|
||||
// 明细表且为浏览按钮字段,添加span字段
|
||||
if (null != extendGroup.getPid() && 3 == extendInfo.getControlType()) {
|
||||
String dbType = infoFieldParam.getDbType("2", "");
|
||||
getExtendInfoMapper().addTableColumn(extendInfo.getTableName(), extendInfo.getFieldName() + "span", dbType);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -122,7 +136,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
String data = param.getData();
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
Set<Long> ids = new HashSet<>();
|
||||
JSONArray records = (JSONArray) jsonObject.get("records");
|
||||
JSONArray records = jsonObject.getJSONArray("records");
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
ExtendTitlePO extendTitle = new ExtendTitlePO();
|
||||
JSONObject object = (JSONObject) records.get(i);
|
||||
|
|
@ -160,13 +174,13 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
Map<String, Object> datas = new HashMap<>();
|
||||
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType());
|
||||
ExtendTitlePO extendTitlePO = titlesByGroupID.stream().max(Comparator.comparing(ExtendTitlePO::getShowOrder)).get();
|
||||
ExtendTitlePO extendTitlePO = titlesByGroupID.stream().max(Comparator.comparing(ExtendTitlePO::getShowOrder)).orElse(ExtendTitlePO.builder().showOrder(1).build());
|
||||
Set<Long> ids = titlesByGroupID.stream().map(ExtendTitlePO::getId).collect(Collectors.toSet());
|
||||
ExtendTitlePO extendTitle = new ExtendTitlePO();
|
||||
extendTitle.setGroupId(param.getGroupType());
|
||||
extendTitle.setIsShow(param.getIsShow());
|
||||
extendTitle.setTitle(param.getGroupName());
|
||||
extendTitle.setShowOrder(null == extendTitlePO ? 0 : extendTitlePO.getShowOrder() + 1);
|
||||
extendTitle.setShowOrder(extendTitlePO.getShowOrder() + 1);
|
||||
extendTitle.setCreator((long) user.getUID());
|
||||
extendTitle.setCreateTime(new Date());
|
||||
extendTitle.setDeleteType(0);
|
||||
|
|
@ -183,12 +197,12 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
if (fieldTypeTreeParam.getId() == null) {
|
||||
List<ExtendGroupPO> extendGroupPOList = MapperProxyFactory.getProxy(ExtendGroupMapper.class).listGroupByPid(fieldTypeTreeParam.getParentId());
|
||||
ExtendGroupPO extendGroup = extendGroupPOList.stream().max(Comparator.comparing(ExtendGroupPO::getShowOrder)).get();
|
||||
ExtendGroupPO extendGroupPO = buildExtendGroupType(moduleTypeEnum, fieldTypeTreeParam,extendGroup.getShowOrder());
|
||||
ExtendGroupPO extendGroupPO = buildExtendGroupType(moduleTypeEnum, fieldTypeTreeParam, extendGroup.getShowOrder());
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).insertIgnoreNull(extendGroupPO);
|
||||
//默认新增title
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(extendGroup.getId());
|
||||
ExtendTitlePO extendTitle = titlesByGroupID.stream().max(Comparator.comparing(ExtendTitlePO::getShowOrder)).get();
|
||||
ExtendTitlePO extendTitlePO = buildExtendTitleType(extendGroupPO,extendTitle.getShowOrder());
|
||||
ExtendTitlePO extendTitlePO = buildExtendTitleType(extendGroupPO, extendTitle.getShowOrder());
|
||||
MapperProxyFactory.getProxy(ExtendTitleMapper.class).insertIgnoreNull(extendTitlePO);
|
||||
} else {
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).update(fieldTypeTreeParam.getId(), fieldTypeTreeParam.getName());
|
||||
|
|
@ -202,9 +216,210 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFieldDefinedInfo(ExtendTitleSaveParam param) {
|
||||
public Map<String, Object> getFieldDefinedInfo(ExtendFieldSearchParam param) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
List<Map<String, Object>> lsFieldInfo = new ArrayList<>();
|
||||
Map<String, Object> fieldInfo;
|
||||
Map<String, Object> recordInfo;
|
||||
Map<String, Object> propsInfo;
|
||||
Map<String, Object> comInfo;
|
||||
List<Object> fieldTypeInfo;
|
||||
List<Object> lsComDetialInfo;
|
||||
Map<String, Object> comDetialInfo;
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields("", param.getGroupId(), "", "");
|
||||
for (ExtendInfoPO extendInfoPO : infoPOList) {
|
||||
Long fieldId = extendInfoPO.getId();
|
||||
String fieldName = extendInfoPO.getFieldName();
|
||||
String fieldLabel = extendInfoPO.getFieldNameDesc();
|
||||
String fieldHtmlType = extendInfoPO.getControlType().toString();
|
||||
String browserType = extendInfoPO.getBrowserType();
|
||||
String customValue = extendInfoPO.getCustomValue();
|
||||
String fieldStrLength = SelectOptionParam.getTextLength(customValue);
|
||||
//自定义字段排序 标识rowKey
|
||||
String fieldIdRowKey;
|
||||
int showOrder = extendInfoPO.getShowOrder();
|
||||
boolean isUsed = false;
|
||||
// TODO 去除脏数据后调整为extendInfoPO.getId() > 0
|
||||
// 系统字段id<0
|
||||
boolean isSysField = extendInfoPO.getExtendGroupId() < 0;
|
||||
if (isSysField) {
|
||||
fieldIdRowKey = fieldId + "_hrm";
|
||||
} else {
|
||||
fieldIdRowKey = fieldId + "_cus";
|
||||
}
|
||||
if (!isSysField) {
|
||||
isUsed = ExtendInfoBO.fieldIsUsed(extendInfoPO.getTableName(), extendInfoPO.getFieldName());
|
||||
}
|
||||
// TODO 去除脏数据后调整为extendInfoPO.getId() > 0
|
||||
boolean allowHide = extendInfoPO.getExtendGroupId() > 0;
|
||||
boolean allowModify = extendInfoPO.getExtendGroupId() > 0;
|
||||
|
||||
return null;
|
||||
BrowserComInfo BrowserComInfo = new BrowserComInfo();
|
||||
List<Object> fieldTypeObj = new ArrayList<>();
|
||||
String fieldType = "";
|
||||
switch (fieldHtmlType) {
|
||||
case "1":
|
||||
fieldTypeObj.add("input");
|
||||
fieldType = SystemEnv.getHtmlLabelName(688, user.getLanguage());
|
||||
switch (browserType) {
|
||||
case "1":
|
||||
fieldTypeObj.add("text");
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(608, user.getLanguage());
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(608, user.getLanguage()) + ":" + fieldStrLength;
|
||||
fieldTypeObj.add(fieldStrLength);
|
||||
break;
|
||||
case "2":
|
||||
fieldTypeObj.add("int");
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(696, user.getLanguage());
|
||||
break;
|
||||
case "3":
|
||||
fieldTypeObj.add("float");
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(697, user.getLanguage());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
fieldTypeObj.add("textarea");
|
||||
fieldType = SystemEnv.getHtmlLabelName(689, user.getLanguage());
|
||||
break;
|
||||
case "3": {
|
||||
fieldTypeObj.add("browser");
|
||||
List<Object> replaceDatas = new ArrayList<>();
|
||||
Map<String, Object> tmp = new HashMap<>();
|
||||
tmp.put("value", browserType);
|
||||
tmp.put("valueSpan", SystemEnv.getHtmlLabelName(Util.getIntValue(BrowserComInfo.getBrowserlabelid(browserType), 0), user.getLanguage()));
|
||||
Map<String, Object> tmp1 = new HashMap<>();
|
||||
tmp1.put("id", browserType);
|
||||
tmp1.put("name", SystemEnv.getHtmlLabelName(Util.getIntValue(BrowserComInfo.getBrowserlabelid(browserType), 0), user.getLanguage()));
|
||||
replaceDatas.add(tmp1);
|
||||
tmp.put("replaceDatas", replaceDatas);
|
||||
fieldTypeObj.add(tmp);
|
||||
fieldType = SystemEnv.getHtmlLabelName(695, user.getLanguage());
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(Util.getIntValue(BrowserComInfo.getBrowserlabelid(browserType), 0), user.getLanguage());
|
||||
if (browserType.equals("161") || browserType.equals("162") || browserType.equals("256") || browserType.equals("257")) {
|
||||
tmp = new HashMap<>();
|
||||
tmp.put("value", SelectOptionParam.getCustomBrowserId(customValue));
|
||||
tmp.put("valueSpan", SelectOptionParam.getCustomBrowserValueSpan(customValue));
|
||||
fieldTypeObj.add(tmp);
|
||||
fieldType += " " + SelectOptionParam.getCustomBrowserValueSpan(customValue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "4":
|
||||
fieldTypeObj.add("check");
|
||||
fieldType = SystemEnv.getHtmlLabelName(691, user.getLanguage());
|
||||
break;
|
||||
case "5": {
|
||||
fieldTypeObj.add("select");
|
||||
fieldTypeObj.add("select");
|
||||
Map<String, Object> tmp = new HashMap<>();
|
||||
tmp.put("datas", SelectOptionParam.getSelectFields(customValue));
|
||||
tmp.put("sort", "horizontal");
|
||||
fieldTypeObj.add(tmp);
|
||||
fieldType = SystemEnv.getHtmlLabelName(690, user.getLanguage());
|
||||
break;
|
||||
}
|
||||
case "6":
|
||||
fieldTypeObj.add("upload");
|
||||
fieldTypeObj.add("file");
|
||||
fieldType = SystemEnv.getHtmlLabelName(17616, user.getLanguage());
|
||||
fieldType += " " + SystemEnv.getHtmlLabelName(20798, user.getLanguage());
|
||||
break;
|
||||
}
|
||||
|
||||
fieldInfo = new HashMap<>();
|
||||
recordInfo = new HashMap<>();
|
||||
recordInfo.put("id", "" + fieldId);
|
||||
recordInfo.put("fieldlabel", fieldLabel);
|
||||
recordInfo.put("fieldname", fieldName);
|
||||
recordInfo.put("fieldType", fieldType);
|
||||
recordInfo.put("fieldTypeObj", fieldTypeObj);
|
||||
recordInfo.put("enable", extendInfoPO.getIsenable() + "");
|
||||
recordInfo.put("required", extendInfoPO.getIsrequired() + "");
|
||||
recordInfo.put("isModify", extendInfoPO.getEditShow() + "");
|
||||
recordInfo.put("viewAttr", isUsed || isSysField ? 1 : 2);
|
||||
recordInfo.put("key", "" + showOrder);
|
||||
recordInfo.put("fieldidrowKey", fieldIdRowKey);
|
||||
|
||||
fieldInfo.put("record", recordInfo);
|
||||
|
||||
propsInfo = new HashMap<>();
|
||||
Map<String, Object> checkPropsInfo = new HashMap<>();
|
||||
Map<String, Object> checkPropsEnableInfo = new HashMap<>();
|
||||
Map<String, Object> checkPropsRequiredInfo = new HashMap<>();
|
||||
|
||||
//允许个人修改字段check框属性
|
||||
Map<String, Object> checkPropsModifyInfo = new HashMap<>();
|
||||
checkPropsEnableInfo.put("viewAttr", allowHide ? 2 : 1);
|
||||
checkPropsModifyInfo.put("viewAttr", allowModify ? 2 : 1);
|
||||
checkPropsRequiredInfo.put("viewAttr", allowHide ? 2 : 1);
|
||||
|
||||
checkPropsInfo.put("enable", checkPropsEnableInfo);
|
||||
checkPropsInfo.put("required", checkPropsRequiredInfo);
|
||||
checkPropsInfo.put("isModify", checkPropsModifyInfo);
|
||||
propsInfo.put("checkProps", checkPropsInfo);
|
||||
fieldInfo.put("props", propsInfo);
|
||||
|
||||
comInfo = new HashMap<>();
|
||||
|
||||
lsComDetialInfo = new ArrayList<>();
|
||||
comDetialInfo = new HashMap<>();
|
||||
comDetialInfo.put("label", "");
|
||||
if (isSysField) {
|
||||
comDetialInfo.put("type", "TEXT");
|
||||
} else {
|
||||
comDetialInfo.put("type", "INPUT");
|
||||
}
|
||||
comDetialInfo.put("width", "15%");
|
||||
comDetialInfo.put("key", "fieldlabel");
|
||||
comDetialInfo.put("viewAttr", "3");
|
||||
lsComDetialInfo.add(comDetialInfo);
|
||||
comInfo.put("fieldlabel", lsComDetialInfo);
|
||||
|
||||
lsComDetialInfo = new ArrayList<>();
|
||||
comDetialInfo = new HashMap<>();
|
||||
comDetialInfo.put("label", "");
|
||||
comDetialInfo.put("type", "TEXT");
|
||||
comDetialInfo.put("width", "15%");
|
||||
comDetialInfo.put("key", "fieldname");
|
||||
comDetialInfo.put("viewAttr", "3");
|
||||
lsComDetialInfo.add(comDetialInfo);
|
||||
comInfo.put("fieldname", lsComDetialInfo);
|
||||
|
||||
lsComDetialInfo = new ArrayList<>();
|
||||
comDetialInfo = new HashMap<>();
|
||||
comDetialInfo.put("label", "");
|
||||
comDetialInfo.put("type", fieldHtmlType.equals("5") ? "CUSTOMFIELD" : "TEXT");
|
||||
comDetialInfo.put("width", "60%");
|
||||
comDetialInfo.put("key", "fieldType");
|
||||
lsComDetialInfo.add(comDetialInfo);
|
||||
comInfo.put("fieldType", lsComDetialInfo);
|
||||
|
||||
fieldInfo.put("com", comInfo);
|
||||
fieldInfo.put("isSysField", isSysField);
|
||||
|
||||
fieldTypeInfo = new ArrayList<>();
|
||||
fieldTypeInfo.add("select");
|
||||
fieldTypeInfo.add("select");
|
||||
Map<String, Object> fieldTypeParamInfo = new HashMap<>();
|
||||
|
||||
if (fieldHtmlType.equals("5")) {
|
||||
|
||||
fieldTypeParamInfo.put("datas", SelectOptionParam.getSelectFields(customValue));
|
||||
fieldTypeParamInfo.put("sort", "horizontal");
|
||||
fieldTypeInfo.add(fieldTypeParamInfo);
|
||||
fieldInfo.put("fieldType", fieldTypeInfo);
|
||||
}
|
||||
lsFieldInfo.add(fieldInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
returnMap.put("data", lsFieldInfo);
|
||||
returnMap.put("encryptEnable", false);
|
||||
// TODO 后续去除
|
||||
returnMap.put("status", "1");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -217,12 +432,12 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
List<Long> collect = MapperProxyFactory.getProxy(ExtendGroupMapper.class)
|
||||
.listGroupByPid(fieldTypeTreeParam.getParentId()).stream().map(ExtendGroupPO::getId).collect(Collectors.toList());
|
||||
Integer extendType = moduleTypeEnum.getValue();
|
||||
List<ExtendGroupPO> extendGroupPOS = JSONArray.parseArray(fieldTypeTreeParam.getData(),ExtendGroupPO.class);
|
||||
List<ExtendGroupPO> extendGroupPOS = JSONArray.parseArray(fieldTypeTreeParam.getData(), ExtendGroupPO.class);
|
||||
|
||||
List<Long> collect1 = extendGroupPOS.stream().map(ExtendGroupPO::getId).collect(Collectors.toList());
|
||||
Set<Long> removeSet = new HashSet<>();
|
||||
collect1.forEach(e->{
|
||||
if(!collect.contains(e)){
|
||||
collect1.forEach(e -> {
|
||||
if (!collect.contains(e)) {
|
||||
removeSet.add(e);
|
||||
}
|
||||
});
|
||||
|
|
@ -233,25 +448,23 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
e.setExtendType(extendType);
|
||||
e.setPid(fieldTypeTreeParam.getParentId());
|
||||
e.setIsShow(fieldTypeTreeParam.getIsShow());
|
||||
e.setShowOrder(showOrder+1);
|
||||
e.setCreator((long)user.getUID());
|
||||
e.setShowOrder(showOrder + 1);
|
||||
e.setCreator((long) user.getUID());
|
||||
e.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
e.setCreateTime(new Date());
|
||||
e.setUpdateTime(new Date());
|
||||
|
||||
if (e.getId() == null){//新增
|
||||
if (e.getId() == null) {//新增
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).insertIgnoreNull(e);
|
||||
}else { //更新
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).updateNameAndOrder(e.getId(),e.getGroupName(),e.getShowOrder());
|
||||
} else { //更新
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).updateNameAndOrder(e.getId(), e.getGroupName(), e.getShowOrder());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private ExtendTitlePO buildExtendTitleType(ExtendGroupPO extendGroupPO,Integer max) {
|
||||
private ExtendTitlePO buildExtendTitleType(ExtendGroupPO extendGroupPO, Integer max) {
|
||||
return ExtendTitlePO.builder()
|
||||
.groupId(extendGroupPO.getId())
|
||||
.title(extendGroupPO.getGroupName())
|
||||
|
|
@ -264,7 +477,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
}
|
||||
|
||||
|
||||
private ExtendGroupPO buildExtendGroupType(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam,Integer max) {
|
||||
private ExtendGroupPO buildExtendGroupType(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam, Integer max) {
|
||||
return ExtendGroupPO.builder()
|
||||
.extendType(moduleTypeEnum.getValue())
|
||||
.groupName(fieldTypeTreeParam.getName())
|
||||
|
|
|
|||
|
|
@ -298,8 +298,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
tableMap.put("tabname", "职等职级");
|
||||
Map<String, Object> tabinfoMap = new HashMap<>();
|
||||
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
||||
infoPOList.add(ExtendInfoPO.builder().fieldName("gradeId").fieldNameDesc("职级").controlType(3).isrequired(1).browserType("161").customValue("gradeBrowser").build());
|
||||
infoPOList.add(ExtendInfoPO.builder().fieldName("levelId").fieldNameDesc("职等").controlType(3).isrequired(1).browserType("162").customValue("levelBrowser").build());
|
||||
infoPOList.add(ExtendInfoPO.builder().fieldName("gradeId").fieldNameDesc("职级").controlType(3).isrequired(1).browserType("161").customValue("[\"browser\",{\"value\":\"161\",\"valueSpan\":\"自定义单选\",\"replaceDatas\":[{\"id\":\"161\",\"name\":\"自定义单选\"}]},{\"value\":\"gradeBrowser\",\"valueSpan\":\"职级浏览按钮\",\"replaceDatas\":[{\"showname\":\"gradeBrowser\",\"shownamespan\":\"gradeBrowser\",\"namespan\":\"职级浏览按钮\",\"name\":\"职级浏览按钮\",\"showtypespan\":\"列表式\",\"randomFieldIdspan\":\"\",\"showtype\":\"1\",\"randomFieldId\":\"gradeBrowser\",\"id\":\"gradeBrowser\"}]}]").build());
|
||||
infoPOList.add(ExtendInfoPO.builder().fieldName("levelId").fieldNameDesc("职等").controlType(3).isrequired(1).browserType("162").customValue("[\"browser\",{\"value\":\"162\",\"valueSpan\":\"自定义多选\",\"replaceDatas\":[{\"id\":\"162\",\"name\":\"自定义多选\"}]},{\"value\":\"LevelBrowser\",\"valueSpan\":\"职等浏览按钮\",\"replaceDatas\":[{\"showname\":\"LevelBrowser\",\"shownamespan\":\"LevelBrowser\",\"namespan\":\"职等浏览按钮\",\"name\":\"职等浏览按钮\",\"showtypespan\":\"列表式\",\"randomFieldIdspan\":\"\",\"showtype\":\"1\",\"randomFieldId\":\"LevelBrowser\",\"id\":\"LevelBrowser\"}]}]").build());
|
||||
tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, viewAttr, false));
|
||||
tabinfoMap.put("rownum", "rownum");
|
||||
// 去除null 元素
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.engine.organization.web;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
|
||||
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
||||
import com.engine.organization.enums.ModuleTypeEnum;
|
||||
|
|
@ -150,4 +152,33 @@ public class FieldDefinedController {
|
|||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/{moduleTypeEnum}/saveFields")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveFields(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody ExtendTitleSaveParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getFieldDefinedWrapper(user).saveFields(param.getData()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{moduleTypeEnum}/getFieldDefinedInfo")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getFieldDefinedInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum) {
|
||||
// TODO
|
||||
//try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
String groupType = (String) map.get("groupType");
|
||||
String groupId = (String) map.get("groupId");
|
||||
// return ReturnResult.successed(getFieldDefinedWrapper(user).getFieldDefinedInfo(ExtendFieldSearchParam.builder().groupType(groupType).groupId(groupId).build()));
|
||||
return JSON.toJSONString(getFieldDefinedWrapper(user).getFieldDefinedInfo(ExtendFieldSearchParam.builder().groupType(groupType).groupId(groupId).build()));
|
||||
//} catch (Exception e) {
|
||||
// return ReturnResult.exceptionHandle(e.getMessage());
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.organization.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
|
||||
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
|
|
@ -66,6 +67,8 @@ public class FieldDefinedWrapper extends Service {
|
|||
return ReturnResult.successed();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int deleteTitle(Long id) {
|
||||
return getFieldDefinedService(user).deleteTitle(id);
|
||||
}
|
||||
|
|
@ -80,4 +83,12 @@ public class FieldDefinedWrapper extends Service {
|
|||
getFieldDefinedService(user).saveTree(moduleTypeEnum, fieldTypeTreeParam);
|
||||
return ReturnResult.successed();
|
||||
}
|
||||
|
||||
public int saveFields(String data) {
|
||||
return getFieldDefinedService(user).saveFields(data);
|
||||
}
|
||||
|
||||
public Map<String, Object> getFieldDefinedInfo(ExtendFieldSearchParam param) {
|
||||
return getFieldDefinedService(user).getFieldDefinedInfo(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue