!73 部门、岗位 主表、拓展表动态添加字段、动态分组
Merge pull request !73 from dxfeng/feature/dxf
This commit is contained in:
commit
88b4830364
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.organization.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class SelectOptionParam {
|
||||
|
||||
/**
|
||||
* 下拉框Json转换
|
||||
*
|
||||
* @param datas
|
||||
* @return
|
||||
*/
|
||||
public static List<SearchConditionOption> convertJsonToListOption(String datas) {
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(datas)) {
|
||||
JSONArray objectArray = JSON.parseArray(datas);
|
||||
int size = objectArray.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
JSONObject jsonObject = (JSONObject) objectArray.get(i);
|
||||
SearchConditionOption option = new SearchConditionOption(jsonObject.getString("key"), jsonObject.getString("option"));
|
||||
selectOptions.add(option);
|
||||
}
|
||||
}
|
||||
return selectOptions;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,20 @@ public class CompBO {
|
|||
|
||||
Map<Long, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
|
||||
|
||||
List<CompListDTO> dtoList = list.stream().map(e -> CompListDTO.builder().id(e.getId()).compNo(e.getCompNo()).compName(e.getCompName()).compNameShort(e.getCompNameShort()).parentCompany(e.getParentCompany()).parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()).orgCode(e.getOrgCode()).industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")).compPrincipal(getUserNameById(e.getCompPrincipal() + "")).forbiddenTag(e.getForbiddenTag()).build()).collect(Collectors.toList());
|
||||
List<CompListDTO> dtoList = list.stream().map(e ->
|
||||
CompListDTO
|
||||
.builder()
|
||||
.id(e.getId())
|
||||
.compNo(e.getCompNo())
|
||||
.compName(e.getCompName())
|
||||
.compNameShort(e.getCompNameShort())
|
||||
.parentCompany(e.getParentCompany())
|
||||
.parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName())
|
||||
.orgCode(e.getOrgCode())
|
||||
.industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + ""))
|
||||
.compPrincipal(getUserNameById(e.getCompPrincipal() + ""))
|
||||
.forbiddenTag(e.getForbiddenTag())
|
||||
.build()).collect(Collectors.toList());
|
||||
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));
|
||||
// 处理被引用数据
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.organization.entity.extend;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum ExtendInfoOperateType {
|
||||
LIST("list"),
|
||||
SEARCH("search"),
|
||||
EDIT("edit"),
|
||||
ADD("add");
|
||||
|
||||
private String value;
|
||||
|
||||
ExtendInfoOperateType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.entity.extend.bo;
|
|||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.BrowserValueInfo;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.browser.service.BrowserValueInfoService;
|
||||
import com.api.browser.util.BrowserInitUtil;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
|
|
@ -11,6 +12,7 @@ import com.api.hrm.bean.FieldItem;
|
|||
import com.api.hrm.util.FieldType;
|
||||
import com.api.hrm.util.ServiceUtil;
|
||||
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
|
||||
import com.engine.organization.entity.SelectOptionParam;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
|
||||
|
|
@ -114,7 +116,7 @@ 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.getCustomBrowserId()).getBrowserConditionParam();
|
||||
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), extendInfoPO.getCustomValue()).getBrowserConditionParam();
|
||||
fieldItem.setBrowserConditionParam(browserConditionParam);
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +165,7 @@ public class ExtendInfoBO {
|
|||
String fieldlabel = Util.null2String(extendInfoPO.getFieldNameDesc());//字段显示名
|
||||
String fieldhtmltype = Util.null2String(extendInfoPO.getControlType());//字段类型
|
||||
String detailtype = Util.null2String(extendInfoPO.getBrowserType());//字段二级类型(浏览框--单人力)
|
||||
String dmlurl = Util.null2String("");
|
||||
String customValue = Util.null2String(extendInfoPO.getCustomValue());
|
||||
boolean isQuickSearch = true;
|
||||
boolean isScope = false;
|
||||
|
||||
|
|
@ -176,7 +178,7 @@ public class ExtendInfoBO {
|
|||
} else if (detailtype.equals("2")) {//数字
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch);
|
||||
} else {
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, fieldlabel, fieldname, isQuickSearch);
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, "25034", fieldname, isQuickSearch);
|
||||
}
|
||||
} else if (fieldhtmltype.equals("2")) {//多行文本框
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.TEXTAREA, fieldlabel, fieldname);
|
||||
|
|
@ -212,25 +214,25 @@ public class ExtendInfoBO {
|
|||
searchConditionItem = conditionFactory.createCondition(ConditionType.TIMERANGEPICKER, fieldlabel, domkey);
|
||||
searchConditionItem.setValue(fieldvalue);
|
||||
} else {
|
||||
//if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) {
|
||||
// BrowserBean browserbean = new BrowserBean(detailtype + "");
|
||||
// BrowserInitUtil browserInitUtil = new BrowserInitUtil();
|
||||
// String fielddbtype = dmlurl;
|
||||
// if (!dmlurl.startsWith("browser.")) {
|
||||
// fielddbtype = "browser." + dmlurl;
|
||||
// }
|
||||
// if (detailtype.equals("161") || detailtype.equals("162")) {
|
||||
// browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID());
|
||||
// } else {
|
||||
// browserbean.getDataParams().put("cube_treeid", dmlurl);
|
||||
// browserbean.getDataParams().put("currenttime", System.currentTimeMillis());
|
||||
// browserInitUtil.initBrowser(browserbean, user.getLanguage());
|
||||
// }
|
||||
// searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, SystemEnv.getHtmlLabelNames(fieldlabel, user.getLanguage()), new String[]{fieldname}, browserbean);
|
||||
//} else {
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype);
|
||||
//}
|
||||
// searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(hrmFieldBean.getHideVirtualOrg());
|
||||
if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) {
|
||||
BrowserBean browserbean = new BrowserBean(detailtype + "");
|
||||
BrowserInitUtil browserInitUtil = new BrowserInitUtil();
|
||||
String fielddbtype = customValue;
|
||||
if (!customValue.startsWith("browser.")) {
|
||||
fielddbtype = "browser." + customValue;
|
||||
}
|
||||
if (detailtype.equals("161") || detailtype.equals("162")) {
|
||||
browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID());
|
||||
} else {
|
||||
browserbean.getDataParams().put("cube_treeid", customValue);
|
||||
browserbean.getDataParams().put("currenttime", System.currentTimeMillis());
|
||||
browserInitUtil.initBrowser(browserbean, user.getLanguage());
|
||||
}
|
||||
searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, fieldlabel, new String[]{fieldname}, browserbean);
|
||||
} else {
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype);
|
||||
}
|
||||
//searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(hrmFieldBean.getHideVirtualOrg());
|
||||
List<Map<String, Object>> replaceDatas = new ArrayList<Map<String, Object>>();
|
||||
String tmpFieldValue = Util.null2String(fieldvalue);
|
||||
if (detailtype.equals("mkqshift")) {
|
||||
|
|
@ -260,7 +262,9 @@ public class ExtendInfoBO {
|
|||
for (int i = 0; fieldvalues != null && i < fieldvalues.size(); i++) {
|
||||
BrowserValueInfo valueInfo = fieldvalues.get(i);
|
||||
String fieldshowname = valueInfo.getName();
|
||||
if (fieldshowname.length() == 0) continue;
|
||||
if (fieldshowname.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> replaceData = new HashMap<String, Object>();
|
||||
replaceData.put("id", valueInfo.getId());
|
||||
replaceData.put("name", fieldshowname);
|
||||
|
|
@ -268,7 +272,7 @@ public class ExtendInfoBO {
|
|||
}
|
||||
} else {
|
||||
if (tmpFieldValue.length() > 0) {
|
||||
String fieldshowname = hrmFieldManager.getFieldvalue(user, dmlurl, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0);
|
||||
String fieldshowname = hrmFieldManager.getFieldvalue(user, customValue, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0);
|
||||
String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
|
||||
String[] fieldshownames = Util.splitString(fieldshowname, ",");
|
||||
if (detailtype.equals("257")) {
|
||||
|
|
@ -281,7 +285,9 @@ public class ExtendInfoBO {
|
|||
if (fieldvalues.length != fieldshownames.length) {
|
||||
break;
|
||||
}
|
||||
if (Util.null2String(fieldshownames[i]).length() == 0) continue;
|
||||
if (Util.null2String(fieldshownames[i]).length() == 0) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> replaceData = new HashMap<String, Object>();
|
||||
replaceData.put("id", fieldvalues[i]);
|
||||
replaceData.put("name", fieldshownames[i]);
|
||||
|
|
@ -298,49 +304,15 @@ public class ExtendInfoBO {
|
|||
}
|
||||
|
||||
} else if (fieldhtmltype.equals("5")) { //选择框
|
||||
// List<SearchConditionOption> statusOptions = hrmFieldBean.getSelectOption();
|
||||
// if (statusOptions == null) statusOptions = new ArrayList<SearchConditionOption>();
|
||||
// try {
|
||||
// if (fieldid.length() > 0) {
|
||||
// rs = new RecordSet();
|
||||
// char flag = Util.getSeparator();
|
||||
// if (hrmFieldBean.getIsFormField()) {
|
||||
// if (Util.null2String(hrmFieldBean.getIssystem()).equals("1")) {
|
||||
// rs.executeProc("hrm_selectitembyid_new", "" + fieldid + flag + 1);
|
||||
// } else {
|
||||
// rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1);
|
||||
// }
|
||||
// } else {
|
||||
// if (fieldname.startsWith("column_")) {
|
||||
// rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1);
|
||||
// } else {
|
||||
// rs.executeProc("hrm_searchselectitembyid", fieldid);
|
||||
// }
|
||||
// }
|
||||
// while (rs.next()) {
|
||||
// String tmpselectvalue = Util.null2String(rs.getString("selectvalue"));
|
||||
// String tmpselectname = Util.toScreen(rs.getString("selectname"), user.getLanguage());
|
||||
// if (Util.null2String(rs.getString("cancel")).equals("1")) continue;
|
||||
// boolean isDefault = Util.null2String(rs.getString("isdefault")).equals("y");
|
||||
// if (!isDefault) {
|
||||
// isDefault = Util.null2String(rs.getString("hrm_isdefault")).equals("1");
|
||||
// }
|
||||
// SearchConditionOption searchConditionOption = new SearchConditionOption(tmpselectvalue, tmpselectname, isDefault);
|
||||
// if (!statusOptions.contains(searchConditionOption)) {
|
||||
// statusOptions.add(searchConditionOption);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// writeLog(e);
|
||||
// }
|
||||
// searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, statusOptions);
|
||||
// if (detailtype.equals("") || detailtype.equals("0")) {
|
||||
// detailtype = "1";
|
||||
// }
|
||||
// searchConditionItem.setKey(Util.null2String(fieldvalue));
|
||||
// searchConditionItem.setValue(fieldvalue);
|
||||
// searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3));
|
||||
|
||||
List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue);
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, searchConditionOptions);
|
||||
if (detailtype.equals("") || detailtype.equals("0")) {
|
||||
detailtype = "1";
|
||||
}
|
||||
searchConditionItem.setKey(Util.null2String(fieldvalue));
|
||||
searchConditionItem.setValue(fieldvalue+"");
|
||||
searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3));
|
||||
} else if (fieldhtmltype.equals("6")) {//附件
|
||||
if (fieldname.equals("resourceimageid")) {
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ public class ExtendGroupPO {
|
|||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 所属分组
|
||||
*/
|
||||
private Long pid;
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ public class ExtendInfoPO {
|
|||
private Integer browserShow;
|
||||
|
||||
/**
|
||||
* 自定义浏览按钮标识
|
||||
* 自定义标识
|
||||
*/
|
||||
private String customBrowserId;
|
||||
private String customValue;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public interface ExtMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listCompExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id);
|
||||
Map<String, Object> listExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id);
|
||||
|
||||
/**
|
||||
* 判断当前数据是否存在
|
||||
|
|
@ -28,7 +28,7 @@ public interface ExtMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int countCompExtById(@Param("tableName") String tableName, @Param("id") long id);
|
||||
int countExtById(@Param("tableName") String tableName, @Param("id") long id);
|
||||
|
||||
/**
|
||||
* 插入主表拓展表
|
||||
|
|
@ -36,7 +36,7 @@ public interface ExtMapper {
|
|||
* @param map
|
||||
* @return
|
||||
*/
|
||||
int insertCompExt(@Param("tableName") String tableName, @Param("map") Map<String, Object> map);
|
||||
int insertExt(@Param("tableName") String tableName, @Param("map") Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 更新主表拓展表
|
||||
|
|
@ -44,5 +44,5 @@ public interface ExtMapper {
|
|||
* @param map
|
||||
* @return
|
||||
*/
|
||||
int updateCompExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map<String, Object> map);
|
||||
int updateExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map<String, Object> map);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.engine.organization.mapper.extend.ExtMapper">
|
||||
|
||||
|
||||
<insert id="insertCompExt" parameterType="java.util.Map">
|
||||
<insert id="insertExt" parameterType="java.util.Map">
|
||||
insert into ${tableName} (
|
||||
<foreach collection="map" item="value" index="key" separator=",">
|
||||
${key}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateCompExt" parameterType="java.util.Map">
|
||||
<update id="updateExt" parameterType="java.util.Map">
|
||||
update ${tableName} set
|
||||
<foreach collection="map" item="value" index="key" separator=",">
|
||||
${key} = #{value}
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="listCompExt" resultType="map">
|
||||
<select id="listExt" resultType="map">
|
||||
select ${fields}
|
||||
from ${tableName}
|
||||
where delete_type = 0
|
||||
and id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="countCompExtById" resultType="java.lang.Integer">
|
||||
<select id="countExtById" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from ${tableName}
|
||||
where delete_type = 0
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.mapper.extend;
|
|||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -15,10 +16,26 @@ public interface ExtendGroupMapper {
|
|||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param groupType
|
||||
* @param extendType
|
||||
* @return
|
||||
*/
|
||||
List<ExtendGroupPO> listByType(@Param("groupType") String groupType);
|
||||
List<ExtendGroupPO> listByType(@Param("extendType") String extendType);
|
||||
|
||||
/**
|
||||
* 根据ID 查询数据
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<ExtendGroupPO> listGroupByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据ID 查询数据
|
||||
*
|
||||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
List<ExtendGroupPO> listGroupByPid(@Param("pid") Long pid);
|
||||
|
||||
/**
|
||||
* 根据ID查询分组名称
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
t
|
||||
.
|
||||
id
|
||||
, t.pid
|
||||
, t.extend_type
|
||||
, t.group_name
|
||||
, t.creator
|
||||
|
|
@ -38,7 +39,25 @@
|
|||
<select id="getGroupNameById" resultType="java.lang.String">
|
||||
select group_name
|
||||
from jcl_field_extendgroup
|
||||
where id = #{id} and delete_type = 0
|
||||
where id = #{id}
|
||||
and delete_type = 0
|
||||
</select>
|
||||
<select id="listGroupByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_field_extendgroup t
|
||||
WHERE t.delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listGroupByPid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_field_extendgroup t
|
||||
WHERE t.delete_type = 0
|
||||
and t.pid= #{pid}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,5 +20,5 @@ public interface ExtendInfoMapper {
|
|||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
List<ExtendInfoPO> listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName);
|
||||
List<ExtendInfoPO> listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName,@Param("operateType")String operateType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
<result column="edit_show" property="editShow"/>
|
||||
<result column="add_show" property="addShow"/>
|
||||
<result column="browser_show" property="browserShow"/>
|
||||
<result column="custom_value" property="customValue"/>
|
||||
<result column="show_order" property="showOrder"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
|
|
@ -45,6 +46,7 @@
|
|||
, t.edit_show
|
||||
, t.add_show
|
||||
, t.browser_show
|
||||
, t.custom_value
|
||||
, t.show_order
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
|
|
@ -68,6 +70,10 @@
|
|||
<if test=" tableName != null and tableName != '' ">
|
||||
and table_name = #{tableName}
|
||||
</if>
|
||||
<if test=" operateType != null and operateType !='' ">
|
||||
and ${operateType}_show = 1
|
||||
</if>
|
||||
order by show_order
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public interface CompService {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
int saveBaseComp(CompSearchParam params);
|
||||
int saveBaseComp(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public interface DepartmentService {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
int saveBaseForm(DeptSearchParam params);
|
||||
int saveBaseForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 更新禁用标记
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import java.util.Map;
|
|||
public interface ExtService {
|
||||
|
||||
/**
|
||||
* 组装主表拓展表表单
|
||||
* 组装主表、主表拓展表表单
|
||||
*
|
||||
* @param user
|
||||
* @param extendType
|
||||
|
|
@ -26,7 +26,19 @@ public interface ExtService {
|
|||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionItem> getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId);
|
||||
List<SearchConditionItem> getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId, String... readOnlyFields);
|
||||
|
||||
/**
|
||||
* 组装主表新增表单
|
||||
*
|
||||
* @param user
|
||||
* @param extendType
|
||||
* @param tableName
|
||||
* @param viewAttr
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionItem> getExtSaveForm(User user, String extendType, String tableName, int viewAttr, String groupId, String autoNoField, String serialType);
|
||||
|
||||
/**
|
||||
* 组装明细表表单
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public interface JobService {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
int saveBaseForm(JobSearchParam params);
|
||||
int saveBaseForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 更新主表、拓展表、明细表
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.organization.service.impl;
|
|||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
|
|
@ -12,12 +11,11 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
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.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
||||
import com.engine.organization.service.CompService;
|
||||
|
|
@ -31,11 +29,10 @@ import com.engine.organization.util.db.MapperProxyFactory;
|
|||
import com.engine.organization.util.page.Column;
|
||||
import com.engine.organization.util.page.PageInfo;
|
||||
import com.engine.organization.util.page.PageUtil;
|
||||
import weaver.crm.Maint.SectorInfoComInfo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -54,6 +51,10 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
* 3:岗位
|
||||
*/
|
||||
private static final String EXTEND_TYPE = "1";
|
||||
/**
|
||||
* 主表表名
|
||||
*/
|
||||
private static final String JCL_ORG_COMP = "JCL_ORG_COMP";
|
||||
/**
|
||||
* 主表拓展表
|
||||
*/
|
||||
|
|
@ -65,6 +66,11 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
private static final String RIGHT_NAME = "Company:All";
|
||||
|
||||
/**
|
||||
* 公司/分部主表title指定ID
|
||||
*/
|
||||
private static final Long GROUP_ID = -1L;
|
||||
|
||||
private CompMapper getCompMapper() {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
}
|
||||
|
|
@ -126,14 +132,15 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int saveBaseComp(CompSearchParam params) {
|
||||
public int saveBaseComp(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
// 自动编号
|
||||
params.setCompNo(CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, params.getCompNo()));
|
||||
List<CompPO> list = getCompMapper().listByNo(Util.null2String(params.getCompNo()));
|
||||
String compNo = (String) params.get("comp_no");
|
||||
compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo);
|
||||
List<CompPO> list = getCompMapper().listByNo(Util.null2String(compNo));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID());
|
||||
return getCompMapper().insertIgnoreNull(compPO);
|
||||
params.put("comp_no", compNo);
|
||||
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -148,14 +155,16 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
CompPO compPO = CompBO.convertParamToPO(searchParam, (long) user.getUID());
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
int updateCount = 0;
|
||||
// 更新主表数据
|
||||
updateCount += getCompMapper().updateBaseComp(compPO);
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
|
||||
// 更新主表拓展表
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, compPO.getId());
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, searchParam.getId());
|
||||
//更新明细表
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, compPO.getId());
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, searchParam.getId());
|
||||
|
||||
return updateCount;
|
||||
}
|
||||
|
|
@ -228,10 +237,14 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
buttonsMap.put("hasSave", true);
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) {
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, getBaseForm(viewAttr, id)));
|
||||
} else {
|
||||
addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtService(user).getExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, viewAttr, id, groupId)));
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId));
|
||||
if (CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_COMPEXT : JCL_ORG_COMP, viewAttr, id, extendGroupPO.getId().toString(), "comp_no")));
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
|
|
@ -255,91 +268,17 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "compNo");
|
||||
compNoItem.setRules("required|string");
|
||||
// 判断是否开启自动编号
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.SUBCOMPANY.getValue());
|
||||
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
||||
compNoItem.setViewAttr(2);
|
||||
compNoItem.setHelpfulTip("编号为空,则按照指定规则自动生成编号");
|
||||
compNoItem.setRules("");
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID);
|
||||
if (CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendGroupPO.getId().toString(), "comp_no", RuleCodeType.SUBCOMPANY.getValue())));
|
||||
}
|
||||
}
|
||||
getSameFormItem(conditionItems, compNoItem, null);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, conditionItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
|
||||
return apiDatas;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增、编辑表单,相同属性
|
||||
*
|
||||
* @param conditionItems
|
||||
* @param compNoItem
|
||||
*/
|
||||
private void getSameFormItem(List<SearchConditionItem> conditionItems, SearchConditionItem compNoItem, Long id) {
|
||||
// 名称
|
||||
SearchConditionItem compNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "compName");
|
||||
compNameItem.setRules("required|string");
|
||||
// 简称
|
||||
SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "compNameShort");
|
||||
compNameShortItem.setRules("required|string");
|
||||
// 上级公司
|
||||
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentCompany", "compBrowser");
|
||||
// 组织机构代码
|
||||
SearchConditionItem orgCodeItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "组织机构代码", "orgCode");
|
||||
orgCodeItem.setRules("required|string");
|
||||
// 行业
|
||||
SearchConditionItem industryItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "行业", "63", "industry", "");
|
||||
// 负责人
|
||||
SearchConditionItem compPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "负责人", "1", "compPrincipal", "");
|
||||
compPrincipalItem.setRules("required|string");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
|
||||
|
||||
conditionItems.add(compNoItem);
|
||||
conditionItems.add(compNameItem);
|
||||
conditionItems.add(compNameShortItem);
|
||||
conditionItems.add(compBrowserItem);
|
||||
conditionItems.add(orgCodeItem);
|
||||
conditionItems.add(industryItem);
|
||||
conditionItems.add(compPrincipalItem);
|
||||
conditionItems.add(descriptionItem);
|
||||
|
||||
if (null == id) {
|
||||
return;
|
||||
}
|
||||
// 赋值
|
||||
CompPO compPO = getCompMapper().listById(id);
|
||||
OrganizationAssert.notNull(compPO, "数据不存在或数据已删除");
|
||||
compNoItem.setValue(compPO.getCompNo());
|
||||
compNameItem.setValue(compPO.getCompName());
|
||||
compNameShortItem.setValue(compPO.getCompNameShort());
|
||||
|
||||
// compBrowserItem
|
||||
if (null != compPO.getParentCompany()) {
|
||||
BrowserBean compBrowserBean = compBrowserItem.getBrowserConditionParam();
|
||||
compBrowserBean.setReplaceDatas(creatReplaceDatas(compPO.getParentCompany(), getCompMapper().listById(compPO.getParentCompany()).getCompName()));
|
||||
compBrowserItem.setBrowserConditionParam(compBrowserBean);
|
||||
}
|
||||
orgCodeItem.setValue(compPO.getOrgCode());
|
||||
// industryItem
|
||||
BrowserBean industryBean = industryItem.getBrowserConditionParam();
|
||||
industryBean.setReplaceDatas(creatReplaceDatas(compPO.getIndustry(), new SectorInfoComInfo().getSectorInfoname(compPO.getIndustry() + "")));
|
||||
industryItem.setBrowserConditionParam(industryBean);
|
||||
try {
|
||||
// compPrincipalItem
|
||||
BrowserBean PrincipalBean = compPrincipalItem.getBrowserConditionParam();
|
||||
PrincipalBean.setReplaceDatas(creatReplaceDatas(compPO.getCompPrincipal(), new ResourceComInfo().getLastname(compPO.getCompPrincipal() + "")));
|
||||
compPrincipalItem.setBrowserConditionParam(PrincipalBean);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
descriptionItem.setValue(compPO.getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为搜索查询
|
||||
|
|
@ -358,45 +297,4 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
&& null == compPO.getForbiddenTag());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 浏览按钮类型赋值转换
|
||||
*
|
||||
* @param id
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<Map<String, Object>> creatReplaceDatas(Object id, Object name) {
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", id);
|
||||
map.put("name", name);
|
||||
datas.add(map);
|
||||
return datas;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 基本信息基础表单
|
||||
*
|
||||
* @param viewAttr
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private List<SearchConditionItem> getBaseForm(int viewAttr, long id) {
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "编号", "compNo");
|
||||
getSameFormItem(conditionItems, compNoItem, id);
|
||||
// 查看,全部置位只读
|
||||
if (1 == viewAttr) {
|
||||
for (SearchConditionItem item : conditionItems) {
|
||||
item.setViewAttr(viewAttr);
|
||||
}
|
||||
}
|
||||
return conditionItems;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
|
|
@ -11,7 +10,6 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.company.bo.CompBO;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
|
|
@ -19,12 +17,12 @@ import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
|||
import com.engine.organization.entity.department.param.*;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
||||
|
|
@ -64,6 +62,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
* 3:岗位
|
||||
*/
|
||||
private static final String EXTEND_TYPE = "2";
|
||||
/**
|
||||
* 主表
|
||||
*/
|
||||
private static final String JCL_ORG_DEPT = "JCL_ORG_DEPT";
|
||||
/**
|
||||
* 主表拓展表
|
||||
*/
|
||||
|
|
@ -75,6 +77,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
private static final String RIGHT_NAME = "Department:All";
|
||||
|
||||
/**
|
||||
* 部门主表title指定ID
|
||||
*/
|
||||
private static final Long GROUP_ID = -2L;
|
||||
|
||||
|
||||
private DepartmentMapper getDepartmentMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
|
|
@ -178,14 +185,15 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
|
||||
@Override
|
||||
public int saveBaseForm(DeptSearchParam params) {
|
||||
public int saveBaseForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
// 自动编号
|
||||
params.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, params.getDeptNo()));
|
||||
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(params.getDeptNo()));
|
||||
String deptNo = (String) params.get("dept_no");
|
||||
deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo);
|
||||
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(deptNo));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(params, user.getUID());
|
||||
return getDepartmentMapper().insertIgnoreNull(departmentPO);
|
||||
params.put("dept_no", deptNo);
|
||||
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -200,14 +208,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(searchParam, user.getUID());
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
int updateCount = 0;
|
||||
// 更新主表数据
|
||||
updateCount += getDepartmentMapper().updateBaseDept(departmentPO);
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
|
||||
// 更新主表拓展表
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, departmentPO.getId());
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
|
||||
//更新明细表
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, departmentPO.getId());
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
|
||||
|
||||
return updateCount;
|
||||
}
|
||||
|
|
@ -279,10 +289,15 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
buttonsMap.put("hasSave", true);
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) {
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, getBaseForm(viewAttr, id)));
|
||||
} else {
|
||||
addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtService(user).getExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, viewAttr, id, groupId)));
|
||||
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId));
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_DEPTEXT : JCL_ORG_DEPT, viewAttr, id, extendGroupPO.getId().toString(), "dept_no")));
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
|
|
@ -302,48 +317,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSaveForm() {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "deptNo");
|
||||
deptNoItem.setRules("required|string");
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.DEPARTMENT.getValue());
|
||||
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
||||
deptNoItem.setViewAttr(2);
|
||||
deptNoItem.setRules("");
|
||||
deptNoItem.setHelpfulTip("编号为空,则按照指定规则自动生成编号");
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendGroupPO.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue())));
|
||||
}
|
||||
}
|
||||
// 名称
|
||||
SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "departmentName");
|
||||
deptNameItem.setRules("required|string");
|
||||
// 简称
|
||||
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "deptNameShort");
|
||||
deptNameShortItem.setRules("required|string");
|
||||
// 所属分部
|
||||
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
||||
//上级部门
|
||||
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "161", "parentDept", "deptBrowser");
|
||||
// 部门负责人
|
||||
SearchConditionItem deptPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
|
||||
// 显示顺序
|
||||
SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "显示顺序", "showOrder");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
|
||||
|
||||
conditionItems.add(deptNoItem);
|
||||
conditionItems.add(deptNameItem);
|
||||
conditionItems.add(deptNameShortItem);
|
||||
conditionItems.add(compBrowserItem);
|
||||
conditionItems.add(deptBrowserItem);
|
||||
conditionItems.add(deptPrincipalItem);
|
||||
conditionItems.add(showOrderItem);
|
||||
conditionItems.add(descriptionItem);
|
||||
|
||||
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, conditionItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
|
|
@ -512,101 +495,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
return !(StringUtil.isEmpty(departmentPO.getDeptNo()) && StringUtil.isEmpty(departmentPO.getDeptName()) && StringUtil.isEmpty(departmentPO.getDeptNameShort()) && null == departmentPO.getParentComp() && null == departmentPO.getParentDept() && null == departmentPO.getDeptPrincipal() && null == departmentPO.getShowOrder() && null == departmentPO.getForbiddenTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本信息基础表单
|
||||
*
|
||||
* @param viewAttr
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private List<SearchConditionItem> getBaseForm(int viewAttr, long id) {
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "编号", "deptNo");
|
||||
// 名称
|
||||
SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "departmentName");
|
||||
deptNameItem.setRules("required|string");
|
||||
// 简称
|
||||
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "deptNameShort");
|
||||
deptNameShortItem.setRules("required|string");
|
||||
// 所属分部
|
||||
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
||||
// 上级部门
|
||||
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "161", "parentDept", "deptBrowser");
|
||||
// 部门负责人
|
||||
SearchConditionItem deptPrincipalBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
|
||||
// 显示顺序
|
||||
SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "显示顺序", "showOrder");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
|
||||
|
||||
|
||||
conditionItems.add(deptNoItem);
|
||||
conditionItems.add(deptNameItem);
|
||||
conditionItems.add(deptNameShortItem);
|
||||
conditionItems.add(parentCompBrowserItem);
|
||||
conditionItems.add(parentDeptBrowserItem);
|
||||
conditionItems.add(deptPrincipalBrowserItem);
|
||||
conditionItems.add(showOrderItem);
|
||||
conditionItems.add(descriptionItem);
|
||||
|
||||
|
||||
// 编辑、查看状态赋值,设置只读状态
|
||||
|
||||
// 赋值
|
||||
DepartmentPO departmentPO = getDepartmentMapper().getDeptById(id);
|
||||
OrganizationAssert.notNull(departmentPO, "数据不存在或数据已删除");
|
||||
deptNoItem.setValue(departmentPO.getDeptNo());
|
||||
deptNameItem.setValue(departmentPO.getDeptName());
|
||||
deptNameShortItem.setValue(departmentPO.getDeptNameShort());
|
||||
|
||||
// parentCompBrowserItem
|
||||
if (null != departmentPO.getParentComp()) {
|
||||
BrowserBean browserBean = parentCompBrowserItem.getBrowserConditionParam();
|
||||
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getParentComp(), getCompMapper().listById(departmentPO.getParentComp()).getCompName()));
|
||||
parentCompBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
// parentDeptBrowserItem
|
||||
if (null != departmentPO.getParentDept()) {
|
||||
BrowserBean browserBean = parentDeptBrowserItem.getBrowserConditionParam();
|
||||
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getParentDept(), getDepartmentMapper().getDeptById(departmentPO.getParentDept()).getDeptName()));
|
||||
parentDeptBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
// deptPrincipalBrowserItem
|
||||
if (null != departmentPO.getDeptPrincipal()) {
|
||||
BrowserBean browserBean = deptPrincipalBrowserItem.getBrowserConditionParam();
|
||||
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getDeptPrincipal(), DepartmentBO.getEmployeeNameById(departmentPO.getDeptPrincipal())));
|
||||
deptPrincipalBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
showOrderItem.setValue(departmentPO.getShowOrder());
|
||||
descriptionItem.setValue(departmentPO.getDescription());
|
||||
|
||||
// 查看,全部置位只读
|
||||
if (1 == viewAttr) {
|
||||
for (SearchConditionItem item : conditionItems) {
|
||||
item.setViewAttr(viewAttr);
|
||||
}
|
||||
}
|
||||
return conditionItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览按钮类型赋值转换
|
||||
*
|
||||
* @param id
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private List<Map<String, Object>> creatReplaceDatas(Object id, Object name) {
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", id);
|
||||
map.put("name", name);
|
||||
datas.add(map);
|
||||
return datas;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据keyword查询数据
|
||||
|
|
|
|||
|
|
@ -3,8 +3,12 @@ package com.engine.organization.service.impl;
|
|||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.TopTab;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.extend.ExtendInfoOperateType;
|
||||
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.extend.ExtDTMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
||||
|
|
@ -13,6 +17,7 @@ import com.engine.organization.service.ExtService;
|
|||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -54,23 +59,56 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
|
||||
|
||||
@Override
|
||||
public List<SearchConditionItem> getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId) {
|
||||
public List<SearchConditionItem> getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId, String... readOnlyFields) {
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
||||
// 2编辑 1查看
|
||||
OrganizationAssert.notNull(groupId, "请选择对应的拓展页");
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName);
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue());
|
||||
String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
|
||||
infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
|
||||
Map<String, Object> compExtMap = getExtMapper().listCompExt(tableName, fields, id);
|
||||
Map<String, Object> compExtMap = getExtMapper().listExt(tableName, fields, id);
|
||||
List<String> readOnlyFieldList = Arrays.asList(readOnlyFields);
|
||||
// 组装拓展页内容
|
||||
for (ExtendInfoPO extendInfoPO : infoPOList) {
|
||||
SearchConditionItem item = ExtendInfoBO.getSearchConditionItem(user, viewAttr, extendInfoPO, null == compExtMap ? null : compExtMap.get(extendInfoPO.getFieldName()));
|
||||
item.setFieldcol(16);
|
||||
if (2 == viewAttr && 1 == extendInfoPO.getIsrequired()) {
|
||||
if (2 == viewAttr) {
|
||||
if (readOnlyFieldList.contains(extendInfoPO.getFieldName())) {
|
||||
item.setViewAttr(1);
|
||||
} else if (1 == extendInfoPO.getIsrequired()) {
|
||||
item.setViewAttr(3);
|
||||
item.setRules("required|string");
|
||||
}
|
||||
}
|
||||
conditionItems.add(item);
|
||||
}
|
||||
return conditionItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchConditionItem> getExtSaveForm(User user, String extendType, String tableName, int viewAttr, String groupId, String autoNoField, String serialType) {
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
|
||||
// 2编辑 1查看
|
||||
OrganizationAssert.notNull(groupId, "请选择对应的拓展页");
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.ADD.getValue());
|
||||
// 组装拓展页内容
|
||||
for (ExtendInfoPO extendInfoPO : infoPOList) {
|
||||
SearchConditionItem item = ExtendInfoBO.getSearchConditionItem(user, viewAttr, extendInfoPO, null);
|
||||
item.setFieldcol(16);
|
||||
if (1 == extendInfoPO.getIsrequired()) {
|
||||
item.setViewAttr(3);
|
||||
item.setRules("required|string");
|
||||
}
|
||||
if (extendInfoPO.getFieldName().equals(autoNoField)) {
|
||||
// 判断是否开启自动编号
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(serialType);
|
||||
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
||||
item.setViewAttr(2);
|
||||
item.setHelpfulTip("编号为空,则按照指定规则自动生成编号");
|
||||
item.setRules("");
|
||||
}
|
||||
}
|
||||
conditionItems.add(item);
|
||||
}
|
||||
return conditionItems;
|
||||
|
|
@ -80,7 +118,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
public List<Map<String, Object>> getExtendTables(User user, String extendType, String tableName, long id, int viewAttr, boolean showLabel) {
|
||||
List<Map<String, Object>> tables = new ArrayList<>();
|
||||
// 查询所有分布模块,拓展明细表信息
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName);
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, "");
|
||||
Map<Long, List<ExtendInfoPO>> groupMap = infoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId));
|
||||
// 遍历Map,组装数据
|
||||
for (Map.Entry<Long, List<ExtendInfoPO>> entry : groupMap.entrySet()) {
|
||||
|
|
@ -116,11 +154,12 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
*/
|
||||
public List<TopTab> getTabInfo(String extendType, String tableName) {
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
// 基本信息
|
||||
topTabs.add(TopTab.builder().color("#000000").groupId("0").showcount(false).title("基本信息").viewCondition("0").build());
|
||||
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName);
|
||||
List<Long> extendGroups = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList());
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, ExtendInfoOperateType.EDIT.getValue());
|
||||
List<ExtendInfoPO> infoPOList1 = getExtendInfoMapper().listFields(extendType, "", tableName.toLowerCase().replace("ext", ""), ExtendInfoOperateType.EDIT.getValue());
|
||||
infoPOList.addAll(infoPOList1);
|
||||
List<Long> ids = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList());
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByIds(ids);
|
||||
Set<Long> extendGroups = extendGroupPOS.stream().map(ExtendGroupPO::getPid).collect(Collectors.toSet());
|
||||
// 拓展信息
|
||||
if (CollectionUtils.isNotEmpty(extendGroups)) {
|
||||
for (Long groupId : extendGroups) {
|
||||
|
|
@ -133,31 +172,44 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
@Override
|
||||
public int updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id) {
|
||||
int updateBaseComp;
|
||||
List<ExtendInfoPO> extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName);
|
||||
List<String> extFields = extInfoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList());
|
||||
List<ExtendInfoPO> extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (String dtField : extFields) {
|
||||
map.put(dtField, params.get(dtField));
|
||||
for (ExtendInfoPO extendInfoPO : extInfoPOList) {
|
||||
String key = extendInfoPO.getFieldName();
|
||||
Object value = params.get(extendInfoPO.getFieldName());
|
||||
if ("int".equals(extendInfoPO.getFieldType()) && StringUtils.isEmpty((String) value)) {
|
||||
value = null;
|
||||
}
|
||||
map.put(key, value);
|
||||
}
|
||||
// 判断更新还是插入
|
||||
int count = getExtMapper().countCompExtById(tableName, id);
|
||||
if (count > 0) {
|
||||
map.put("update_time", new Date());
|
||||
updateBaseComp = getExtMapper().updateCompExt(tableName, id, map);
|
||||
if (null != id) {
|
||||
// 判断更新还是插入
|
||||
int count = getExtMapper().countExtById(tableName, id);
|
||||
if (count > 0) {
|
||||
map.put("update_time", new Date());
|
||||
updateBaseComp = getExtMapper().updateExt(tableName, id, map);
|
||||
} else {
|
||||
map.put("creator", user.getUID());
|
||||
map.put("delete_type", 0);
|
||||
map.put("create_time", new Date());
|
||||
map.put("update_time", new Date());
|
||||
map.put("id", id);
|
||||
updateBaseComp = getExtMapper().insertExt(tableName, map);
|
||||
}
|
||||
} else {
|
||||
map.put("forbidden_tag", 0);
|
||||
map.put("creator", user.getUID());
|
||||
map.put("delete_type", 0);
|
||||
map.put("create_time", new Date());
|
||||
map.put("update_time", new Date());
|
||||
map.put("id", id);
|
||||
updateBaseComp = getExtMapper().insertCompExt(tableName, map);
|
||||
updateBaseComp = getExtMapper().insertExt(tableName, map);
|
||||
}
|
||||
return updateBaseComp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtDT(User user, String extendType, String tableName, Map<String, Object> params, Long id) {
|
||||
List<ExtendInfoPO> dtInfoPOList = getExtendInfoMapper().listFields(extendType, "", tableName);
|
||||
List<ExtendInfoPO> dtInfoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, "");
|
||||
List<Long> groupIds = dtInfoPOList.stream().map(ExtendInfoPO::getExtendGroupId).distinct().collect(Collectors.toList());
|
||||
Map<Long, List<ExtendInfoPO>> poMaps = dtInfoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId));
|
||||
// 删除原有明细表数据
|
||||
|
|
@ -169,7 +221,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
for (int i = 0; i < rowNum; i++) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (ExtendInfoPO extendInfoPO : filterS) {
|
||||
if (BROWSER_TYPE == extendInfoPO.getControlType()) {
|
||||
if (BROWSER_TYPE.equals(extendInfoPO.getControlType())) {
|
||||
map.put(extendInfoPO.getFieldName() + "span", params.get(extendInfoPO.getFieldName() + "span_" + i));
|
||||
}
|
||||
map.put(extendInfoPO.getFieldName(), params.get(extendInfoPO.getFieldName() + "_" + i));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
|
|
@ -12,13 +11,13 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.company.bo.CompBO;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.employee.vo.EmployeeTableVO;
|
||||
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
||||
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
|
|
@ -28,7 +27,6 @@ import com.engine.organization.entity.job.po.JobPO;
|
|||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
||||
|
|
@ -83,6 +81,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
* 3:岗位
|
||||
*/
|
||||
private static final String EXTEND_TYPE = "3";
|
||||
/**
|
||||
* 主表
|
||||
*/
|
||||
private static final String JCL_ORG_JOB = "JCL_ORG_JOB";
|
||||
/**
|
||||
* 主表拓展表
|
||||
*/
|
||||
|
|
@ -94,6 +96,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
private static final String RIGHT_NAME = "Job:All";
|
||||
|
||||
/**
|
||||
* 岗位主表title指定ID
|
||||
*/
|
||||
private static final Long GROUP_ID = -3L;
|
||||
|
||||
private JobMapper getJobMapper() {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
|
@ -251,51 +258,15 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getSaveForm() {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem jobNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "jobNo");
|
||||
jobNoItem.setRules("required|string");
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.JOBTITLES.getValue());
|
||||
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
||||
jobNoItem.setViewAttr(2);
|
||||
jobNoItem.setRules("");
|
||||
jobNoItem.setHelpfulTip("编号为空,则按照指定规则自动生成编号");
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendGroupPO.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue())));
|
||||
}
|
||||
}
|
||||
// 名称
|
||||
SearchConditionItem jobNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "jobName");
|
||||
jobNameItem.setRules("required|string");
|
||||
// 所属分部
|
||||
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
||||
// 所属部门
|
||||
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属部门", "161", "parentDept", "deptBrowser");
|
||||
// 岗位序列
|
||||
SearchConditionItem sequenceBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
||||
// 等级方案
|
||||
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
// 上级岗位
|
||||
SearchConditionItem parentJobBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级岗位", "161", "parentJob", "jobBrowser");
|
||||
// 是否关键岗
|
||||
List<SearchConditionOption> isKeyOptions = new ArrayList<>();
|
||||
SearchConditionOption yesOption = new SearchConditionOption("0", "否");
|
||||
SearchConditionOption noOption = new SearchConditionOption("1", "是");
|
||||
isKeyOptions.add(yesOption);
|
||||
isKeyOptions.add(noOption);
|
||||
SearchConditionItem isKeyItem = OrganizationFormItemUtil.selectItem(user, isKeyOptions, 2, 16, 6, false, "是否关键岗", "isKey");
|
||||
isKeyItem.setDetailtype(3);
|
||||
isKeyItem.setValue("0");
|
||||
|
||||
conditionItems.add(jobNoItem);
|
||||
conditionItems.add(jobNameItem);
|
||||
conditionItems.add(parentCompBrowserItem);
|
||||
conditionItems.add(parentDeptBrowserItem);
|
||||
conditionItems.add(sequenceBrowserItem);
|
||||
conditionItems.add(schemeBrowserItem);
|
||||
conditionItems.add(parentJobBrowserItem);
|
||||
conditionItems.add(isKeyItem);
|
||||
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, conditionItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
|
@ -314,12 +285,15 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
buttonsMap.put("hasSave", true);
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) {
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, getBaseForm(viewAttr, id)));
|
||||
} else {
|
||||
addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtService(user).getExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, viewAttr, id, groupId)));
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId));
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) {
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupPOS) {
|
||||
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_JOBEXT : JCL_ORG_JOB, viewAttr, id, extendGroupPO.getId().toString(), "job_no")));
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("buttons", buttonsMap);
|
||||
resultMap.put("conditions", addGroups);
|
||||
|
|
@ -334,8 +308,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").customBrowserId("gradeBrowser").build());
|
||||
infoPOList.add(ExtendInfoPO.builder().fieldName("levelId").fieldNameDesc("职等").controlType(3).isrequired(1).browserType("162").customBrowserId("levelBrowser").build());
|
||||
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());
|
||||
tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, viewAttr, false));
|
||||
tabinfoMap.put("rownum", "rownum");
|
||||
// 去除null 元素
|
||||
|
|
@ -356,15 +330,21 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int saveBaseForm(JobSearchParam params) {
|
||||
public int saveBaseForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
|
||||
// 处理自动编号
|
||||
params.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, params.getJobNo()));
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(params.getJobNo()));
|
||||
searchParam.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, searchParam.getJobNo()));
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(searchParam.getJobNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
JobPO jobPO = JobBO.convertParamsToPO(params, user.getUID());
|
||||
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID());
|
||||
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey());
|
||||
int insertCount = getJobMapper().insertIgnoreNull(jobPO);
|
||||
params.put("job_no", jobPO.getJobNo());
|
||||
params.put("is_key", jobPO.getIsKey());
|
||||
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", jobPO.getId());
|
||||
if (null != jobPO.getSchemeId()) {
|
||||
// 插入明细表信息
|
||||
// 根据等级方案查询职等、职级
|
||||
|
|
@ -383,24 +363,28 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID());
|
||||
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey());
|
||||
searchParam.setIsKey(null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
int updateCount = 0;
|
||||
// 更新主表数据
|
||||
updateCount += getJobMapper().updateBaseJob(jobPO);
|
||||
params.put("is_key", searchParam.getIsKey());
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
||||
|
||||
// 更新主表拓展表
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, jobPO.getId());
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
|
||||
// 更新明细表
|
||||
getJobDTMapper().deleteByIds(jobPO.getId());
|
||||
getJobDTMapper().deleteByIds(searchParam.getId());
|
||||
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
||||
for (int i = 0; i < rowNum; i++) {
|
||||
String levelId = (String) params.get("levelId_" + i);
|
||||
String gradeId = (String) params.get("gradeId_" + i);
|
||||
String levelIdspan = (String) params.get("levelIdspan_" + i);
|
||||
String gradeIdspan = (String) params.get("gradeIdspan_" + i);
|
||||
getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(levelId).gradeId(gradeId).levelIdspan(levelIdspan).gradeIdspan(gradeIdspan).mainId(jobPO.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
|
||||
getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(levelId).gradeId(gradeId).levelIdspan(levelIdspan).gradeIdspan(gradeIdspan).mainId(searchParam.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
|
||||
}
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, jobPO.getId());
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
|
|
@ -564,112 +548,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
&& null == jobPO.getForbiddenTag();
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本信息基础表单
|
||||
*
|
||||
* @param viewAttr
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private List<SearchConditionItem> getBaseForm(int viewAttr, long id) {
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
// 编号
|
||||
SearchConditionItem jobNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "编号", "jobNo");
|
||||
// 名称
|
||||
SearchConditionItem jobNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "jobName");
|
||||
jobNameItem.setRules("required|string");
|
||||
// 所属分部
|
||||
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
||||
// 所属部门
|
||||
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属部门", "161", "parentDept", "deptBrowser");
|
||||
// 岗位序列
|
||||
SearchConditionItem sequenceBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
||||
// 等级方案
|
||||
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
// 上级岗位
|
||||
SearchConditionItem parentJobBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级岗位", "161", "parentJob", "jobBrowser");
|
||||
// 是否关键岗
|
||||
List<SearchConditionOption> isKeyOptions = new ArrayList<>();
|
||||
SearchConditionOption yesOption = new SearchConditionOption("0", "否");
|
||||
SearchConditionOption noOption = new SearchConditionOption("1", "是");
|
||||
isKeyOptions.add(yesOption);
|
||||
isKeyOptions.add(noOption);
|
||||
SearchConditionItem isKeyItem = OrganizationFormItemUtil.selectItem(user, isKeyOptions, 2, 16, 6, false, "是否关键岗", "isKey");
|
||||
isKeyItem.setDetailtype(3);
|
||||
// 工作地点
|
||||
SearchConditionItem workplaceItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "工作地点", "workplace");
|
||||
// 工作概述
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "工作概述", "description");
|
||||
// 任职职责
|
||||
SearchConditionItem workDutyItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "任职职责", "workDuty");
|
||||
// 工作权限
|
||||
SearchConditionItem workAuthorityItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "工作权限", "workAuthority");
|
||||
|
||||
conditionItems.add(jobNoItem);
|
||||
conditionItems.add(jobNameItem);
|
||||
conditionItems.add(parentCompBrowserItem);
|
||||
conditionItems.add(parentDeptBrowserItem);
|
||||
conditionItems.add(sequenceBrowserItem);
|
||||
conditionItems.add(schemeBrowserItem);
|
||||
conditionItems.add(parentJobBrowserItem);
|
||||
conditionItems.add(isKeyItem);
|
||||
conditionItems.add(workplaceItem);
|
||||
conditionItems.add(descriptionItem);
|
||||
conditionItems.add(workDutyItem);
|
||||
conditionItems.add(workAuthorityItem);
|
||||
|
||||
|
||||
// 编辑、查看状态赋值,设置只读状态
|
||||
JobPO jobPO = getJobMapper().getJobById(id);
|
||||
OrganizationAssert.notNull(jobPO, "数据不存在或数据已删除");
|
||||
jobNoItem.setValue(jobPO.getJobNo());
|
||||
jobNameItem.setValue(jobPO.getJobName());
|
||||
isKeyItem.setValue(null == jobPO.getIsKey() ? "0" : jobPO.getIsKey() + "");
|
||||
workplaceItem.setValue(jobPO.getWorkplace());
|
||||
descriptionItem.setValue(jobPO.getDescription());
|
||||
workDutyItem.setValue(jobPO.getWorkDuty());
|
||||
workAuthorityItem.setValue(jobPO.getWorkAuthority());
|
||||
|
||||
if (null != jobPO.getParentComp()) {
|
||||
BrowserBean browserBean = parentCompBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> compMaps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(jobPO.getParentComp().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(compMaps);
|
||||
parentCompBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
if (null != jobPO.getParentDept()) {
|
||||
BrowserBean browserBean = parentDeptBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> deptMaps = getDepartmentMapper().listDeptsByIds(DeleteParam.builder().ids(jobPO.getParentDept().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(deptMaps);
|
||||
parentDeptBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
if (null != jobPO.getSequenceId()) {
|
||||
BrowserBean browserBean = sequenceBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> deptMaps = getSequenceMapper().listSequencesByIds(DeleteParam.builder().ids(jobPO.getSequenceId().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(deptMaps);
|
||||
sequenceBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
if (null != jobPO.getSchemeId()) {
|
||||
BrowserBean browserBean = schemeBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> deptMaps = getSchemeMapper().listSchemesByIds(DeleteParam.builder().ids(jobPO.getSchemeId().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(deptMaps);
|
||||
schemeBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
if (null != jobPO.getParentJob()) {
|
||||
BrowserBean browserBean = parentJobBrowserItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> deptMaps = getJobMapper().listJobsByIds(DeleteParam.builder().ids(jobPO.getParentJob().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(deptMaps);
|
||||
parentJobBrowserItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
|
||||
// 查看,全部置为只读
|
||||
if (1 == viewAttr) {
|
||||
for (SearchConditionItem item : conditionItems) {
|
||||
item.setViewAttr(viewAttr);
|
||||
}
|
||||
}
|
||||
return conditionItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待删除数据的子级元素
|
||||
*
|
||||
|
|
|
|||
|
|
@ -57,13 +57,12 @@ public class CompController {
|
|||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveBaseComp")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CompSearchParam params) {
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody Map<String,Object> params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params));
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class DepartmentController {
|
|||
@POST
|
||||
@Path("/saveBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeptSearchParam params) {
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getDepartmentWrapper(user).saveBaseForm(params));
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public class JobController {
|
|||
@POST
|
||||
@Path("/saveBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody JobSearchParam params) {
|
||||
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getJobWrapper(user).saveBaseForm(params));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class CompWrapper extends Service {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public int saveBaseComp(CompSearchParam params) {
|
||||
public int saveBaseComp(Map<String, Object> params) {
|
||||
return getCompService(user).saveBaseComp(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class DepartmentWrapper extends Service {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public int saveBaseForm(DeptSearchParam params) {
|
||||
public int saveBaseForm(Map<String, Object> params) {
|
||||
return getDepartmentService(user).saveBaseForm(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public class JobWrapper extends Service {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public int saveBaseForm(JobSearchParam params) {
|
||||
public int saveBaseForm(Map<String, Object> params) {
|
||||
return getJobService(user).saveBaseForm(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue