Pre Merge pull request !11 from dxfeng/feature/dxf

pull/11/MERGE
dxfeng 3 years ago committed by Gitee
commit 759498460b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -18,7 +18,7 @@ import java.util.Map;
public class ExtendInfoBO { public class ExtendInfoBO {
// 封装对象为table组件 // 封装对象为table组件
public static List<Map<String, Object>> convertInfoListToTable(List<ExtendInfoPO> infoPOList, int operateType, boolean showLabel) { public static List<Map<String, Object>> convertInfoListToTable(List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel) {
List<Map<String, Object>> lsCol = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> lsCol = new ArrayList<Map<String, Object>>();
Map<String, Object> col = null; Map<String, Object> col = null;
@ -31,7 +31,7 @@ public class ExtendInfoBO {
col.put("key", tmpkey); col.put("key", tmpkey);
col.put("dataIndex", tmpkey); col.put("dataIndex", tmpkey);
col.put("com", getFieldDetialInfo(extendInfoPO, operateType, showLabel, width)); col.put("com", getFieldDetialInfo(extendInfoPO, viewAttr, showLabel, width));
col.put("width", width + "%"); col.put("width", width + "%");
@ -46,12 +46,12 @@ public class ExtendInfoBO {
* *
* *
* @param extendInfoPO * @param extendInfoPO
* @param operateType * @param viewAttr
* @return * @return
*/ */
private static List<FieldItem> getFieldDetialInfo(ExtendInfoPO extendInfoPO, int operateType, boolean showLabel, int width) { private static List<FieldItem> getFieldDetialInfo(ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) {
List<FieldItem> ls = new ArrayList<FieldItem>(); List<FieldItem> ls = new ArrayList<FieldItem>();
FieldItem fieldItem = createField(extendInfoPO, operateType, showLabel, width); FieldItem fieldItem = createField(extendInfoPO, viewAttr, showLabel, width);
ls.add(fieldItem); ls.add(fieldItem);
return ls; return ls;
} }
@ -60,12 +60,12 @@ public class ExtendInfoBO {
* *
* *
* @param extendInfoPO * @param extendInfoPO
* @param operateType * @param viewAttr
* @param showLabel * @param showLabel
* @param width * @param width
* @return * @return
*/ */
private static FieldItem createField(ExtendInfoPO extendInfoPO, int operateType, boolean showLabel, int width) { private static FieldItem createField(ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) {
FieldItem fieldItem = new FieldItem(); FieldItem fieldItem = new FieldItem();
if (showLabel) { if (showLabel) {
fieldItem.setLabel(extendInfoPO.getFieldNameDesc()); fieldItem.setLabel(extendInfoPO.getFieldNameDesc());
@ -76,8 +76,8 @@ public class ExtendInfoBO {
fieldItem.setType(getFieldhtmltype(extendInfoPO.getControlType() + "")); fieldItem.setType(getFieldhtmltype(extendInfoPO.getControlType() + ""));
fieldItem.setKey(extendInfoPO.getFieldName()); fieldItem.setKey(extendInfoPO.getFieldName());
// 查看操作 全部设置为只读 // 查看操作 全部设置为只读
if (0 == operateType) { if (1 == viewAttr) {
fieldItem.setViewAttr(1); fieldItem.setViewAttr(viewAttr);
} else { } else {
// 必填 // 必填
if (1 == extendInfoPO.getIsrequired()) { if (1 == extendInfoPO.getIsrequired()) {
@ -98,7 +98,7 @@ public class ExtendInfoBO {
* @param fieldhtmltype * @param fieldhtmltype
* @return * @return
*/ */
private static FieldType getFieldhtmltype(String fieldhtmltype) { public static FieldType getFieldhtmltype(String fieldhtmltype) {
FieldType fieldtype = null; FieldType fieldtype = null;
if (fieldhtmltype.equals("1")) { if (fieldhtmltype.equals("1")) {
fieldtype = FieldType.INPUT; fieldtype = FieldType.INPUT;

@ -0,0 +1,35 @@
package com.engine.organization.mapper.comp;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/20
* @version: 1.0
*/
public interface CompExtDTMapper {
/**
* id,
*
* @param tableName
* @param id
* @return
*/
@MapKey("id")
List<Map<String, Object>> listCompExtDT(@Param("tableName") String tableName, @Param("id") long id, @Param("fields") String fields);
/**
* mainId
*
* @param tableName
* @param mainId
* @return
*/
int deleteByMainID(@Param("tableName") String tableName, @Param("mainId") String mainId);
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.comp.CompExtDTMapper">
<delete id="deleteByMainID">
delete
from ${tableName}
where mainid = #{id}
</delete>
<select id="listCompExtDT" resultType="java.util.Map">
select ${fields}
from ${tableName}
where mainid = #{id}
and delete_type = 0
</select>
</mapper>

@ -0,0 +1,23 @@
package com.engine.organization.mapper.comp;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* @description: TODO
* @author:dxfeng
* @createTime: 2022/05/20
* @version: 1.0
*/
public interface CompExtMapper {
/**
* id,
*
* @param tableName
* @param id
* @return
*/
Map<String, Object> listCompExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id);
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.comp.CompExtMapper">
<select id="listCompExt" resultType="map">
select ${fields}
from ${tableName}
where delete_type = 0
and id = #{id}
</select>
</mapper>

@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @description: TODO * @description: TODO
@ -55,13 +54,21 @@ public interface CompMapper {
/** /**
* id, * /
* *
* @param tableName * @param compPO
* @param id * @return
*/
int insertIgnoreNull(CompPO compPO);
/**
*
*
* @param compPO
* @return * @return
*/ */
List<Map<String, Object>> listCompExtDT(@Param("tableName") String tableName, @Param("id") long id, @Param("fields") String fields); int updateBaseComp(CompPO compPO);
/** /**
* *

@ -50,6 +50,89 @@
and NVL(parent_company,'0')='0' and NVL(parent_company,'0')='0'
</sql> </sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.comp.po.CompPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_comp
<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="compNo != null ">
comp_no,
</if>
<if test="compName != null ">
comp_name,
</if>
<if test="compNameShort != null ">
comp_name_short,
</if>
<if test="parentCompany != null ">
parent_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
<if test="industry != null ">
industry,
</if>
<if test="compPrincipal != null ">
comp_principal,
</if>
<if test="description != null ">
description,
</if>
forbidden_tag,
</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="compNo != null ">
#{compNo},
</if>
<if test="compName != null ">
#{compName},
</if>
<if test="compNameShort != null ">
#{compNameShort},
</if>
<if test="parentCompany != null ">
#{parentCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
</if>
<if test="industry != null ">
#{industry},
</if>
<if test="compPrincipal != null ">
#{compPrincipal},
</if>
<if test="description != null ">
#{description},
</if>
0,
</trim>
</insert>
<select id="list" resultMap="BaseResultMap"> <select id="list" resultMap="BaseResultMap">
SELECT SELECT
<include refid="baseColumns"/> <include refid="baseColumns"/>
@ -94,14 +177,6 @@
from jcl_org_comp t where comp_no = #{compNo} AND delete_type = 0 from jcl_org_comp t where comp_no = #{compNo} AND delete_type = 0
</select> </select>
<select id="listCompExtDT" resultType="java.util.Map">
select ${fields}
from ${tableName}
where mainid = #{id}
and delete_type = 0
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO"> <update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp update jcl_org_comp
<set> <set>
@ -120,4 +195,8 @@
</foreach> </foreach>
</update> </update>
<update id="updateBaseComp">
</update>
</mapper> </mapper>

@ -21,6 +21,14 @@ public interface CompService {
*/ */
Map<String, Object> listPage(CompSearchParam params); Map<String, Object> listPage(CompSearchParam params);
/**
* /
*
* @param params
* @return
*/
int saveBaseComp(CompSearchParam params);
/** /**
* *
* *
@ -29,6 +37,15 @@ public interface CompService {
int updateForbiddenTagById(CompSearchParam params); int updateForbiddenTagById(CompSearchParam params);
/**
*
*
* @param params
* @return
*/
int updateComp(Map<String, Object> params);
/** /**
* ID * ID
* *
@ -67,6 +84,14 @@ public interface CompService {
*/ */
Map<String, Object> getCompBaseForm(Map<String, Object> params); Map<String, Object> getCompBaseForm(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
Map<String, Object> getCompExtForm(Map<String, Object> params);
/** /**
* *

@ -1,6 +1,7 @@
package com.engine.organization.service.impl; package com.engine.organization.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.api.browser.bean.BrowserBean; import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionItem;
@ -16,6 +17,8 @@ import com.engine.organization.entity.comp.param.CompSearchParam;
import com.engine.organization.entity.comp.po.CompPO; import com.engine.organization.entity.comp.po.CompPO;
import com.engine.organization.entity.extend.bo.ExtendInfoBO; import com.engine.organization.entity.extend.bo.ExtendInfoBO;
import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.mapper.comp.CompExtDTMapper;
import com.engine.organization.mapper.comp.CompExtMapper;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper; import com.engine.organization.mapper.extend.ExtendGroupMapper;
import com.engine.organization.mapper.extend.ExtendInfoMapper; import com.engine.organization.mapper.extend.ExtendInfoMapper;
@ -30,6 +33,7 @@ import com.engine.organization.util.page.PageUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import weaver.crm.Maint.SectorInfoComInfo; import weaver.crm.Maint.SectorInfoComInfo;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo; import weaver.hrm.resource.ResourceComInfo;
import java.util.*; import java.util.*;
@ -54,6 +58,14 @@ public class CompServiceImpl extends Service implements CompService {
return MapperProxyFactory.getProxy(ExtendInfoMapper.class); return MapperProxyFactory.getProxy(ExtendInfoMapper.class);
} }
private CompExtDTMapper getCompExtDTMapper() {
return MapperProxyFactory.getProxy(CompExtDTMapper.class);
}
private CompExtMapper getCompExtMapper() {
return MapperProxyFactory.getProxy(CompExtMapper.class);
}
@Override @Override
public Map<String, Object> listPage(CompSearchParam params) { public Map<String, Object> listPage(CompSearchParam params) {
@ -93,12 +105,50 @@ public class CompServiceImpl extends Service implements CompService {
return datas; return datas;
} }
@Override
public int saveBaseComp(CompSearchParam params) {
List<CompPO> list = getCompMapper().listByNo(Util.null2String(params.getCompNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID());
return getCompMapper().insertIgnoreNull(compPO);
}
@Override @Override
public int updateForbiddenTagById(CompSearchParam params) { public int updateForbiddenTagById(CompSearchParam params) {
CompPO compPO = CompPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build(); CompPO compPO = CompPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
return getCompMapper().updateForbiddenTagById(compPO); return getCompMapper().updateForbiddenTagById(compPO);
} }
@Override
public int updateComp(Map<String, Object> params) {
System.out.println(params);
CompSearchParam param = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
System.out.println(param);
// TODO 更新主表数据
// 获取分部明细表的所有拓展列
String tableName = "JCL_ORG_COMPEXT_DT1";
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields("1", "", tableName);
List<String> dtFields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList());
List<Map<String, Object>> insertList = new ArrayList<>();
System.out.println(dtFields);
// TODO 删除明细表数据
// 处理明细表数据
int rowNum = Util.getIntValue((String) params.get("rownum"));
for (int i = 0; i < rowNum; i++) {
Map<String, Object> map = new HashMap<>();
for (String dtField : dtFields) {
map.put(dtField, params.get(dtField + "_" + i));
}
insertList.add(map);
}
System.out.println(insertList);
return 0;
}
@Override @Override
public int deleteByIds(Collection<Long> ids) { public int deleteByIds(Collection<Long> ids) {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
@ -186,7 +236,7 @@ public class CompServiceImpl extends Service implements CompService {
@Override @Override
public Map<String, Object> getCompBaseForm(Map<String, Object> params) { public Map<String, Object> getCompBaseForm(Map<String, Object> params) {
OrganizationAssert.notNull(params.get("operateType"), "请标识操作类型"); OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
List<SearchConditionItem> conditionItems = new ArrayList<>(); List<SearchConditionItem> conditionItems = new ArrayList<>();
// 编号 // 编号
SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "compNo"); SearchConditionItem compNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "compNo");
@ -207,7 +257,7 @@ public class CompServiceImpl extends Service implements CompService {
// 负责人 // 负责人
SearchConditionItem compPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "负责人", "1", "compPrincipal", ""); SearchConditionItem compPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "负责人", "1", "compPrincipal", "");
// 说明 // 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "description"); SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
conditionItems.add(compNoItem); conditionItems.add(compNoItem);
@ -219,44 +269,43 @@ public class CompServiceImpl extends Service implements CompService {
conditionItems.add(compPrincipalItem); conditionItems.add(compPrincipalItem);
conditionItems.add(descriptionItem); conditionItems.add(descriptionItem);
// 0 查看 1新增 2编辑 // 2编辑 1查看
int operateType = Integer.parseInt((String) params.get("operateType")); int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
long id = Long.parseLong((String) params.get("id")); long id = Long.parseLong((String) params.get("id"));
// 编辑、查看状态赋值,设置只读状态 // 编辑、查看状态赋值,设置只读状态
if (1 != operateType) {
// 赋值
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());
// 查看,全部置位只读 // 赋值
if (0 == operateType) { CompPO compPO = getCompMapper().listById(id);
for (SearchConditionItem item : conditionItems) { OrganizationAssert.notNull(compPO, "数据不存在或数据已删除");
item.setViewAttr(1); 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());
// 查看,全部置位只读
if (1 == viewAttr) {
for (SearchConditionItem item : conditionItems) {
item.setViewAttr(viewAttr);
} }
} }
@ -276,7 +325,7 @@ public class CompServiceImpl extends Service implements CompService {
resultMap.put("buttons", buttonsMap); resultMap.put("buttons", buttonsMap);
resultMap.put("conditions", conditionsMap); resultMap.put("conditions", conditionsMap);
resultMap.put("id", id); resultMap.put("id", id);
resultMap.put("tables", getExtendTables(id, operateType, false)); resultMap.put("tables", getExtendTables(id, viewAttr, false));
Map<String, Object> apiDatas = new HashMap<>(); Map<String, Object> apiDatas = new HashMap<>();
apiDatas.put("result", resultMap); apiDatas.put("result", resultMap);
@ -284,6 +333,67 @@ public class CompServiceImpl extends Service implements CompService {
return apiDatas; return apiDatas;
} }
@Override
public Map<String, Object> getCompExtForm(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
// 分组名称
String groupId = (String) params.get("viewCondition");
// 2编辑 1查看
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
long id = Long.parseLong((String) params.get("id"));
OrganizationAssert.notNull(groupId, "请选择对应的拓展页");
String tableName = "JCL_ORG_COMPEXT";
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields("1", groupId, tableName);
String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
Map<String, Object> compExtMap = getCompExtMapper().listCompExt(tableName, fields, id);
// 组装拓展页内容
for (ExtendInfoPO extendInfoPO : infoPOList) {
SearchConditionItem item = null;
switch (ExtendInfoBO.getFieldhtmltype(extendInfoPO.getControlType() + "")) {
case INPUT:
item = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName());
item.setValue(compExtMap.get(extendInfoPO.getFieldName()));
break;
case TEXTAREA:
item = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 1, 60, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName());
item.setValue(compExtMap.get(extendInfoPO.getFieldName()));
break;
case BROWSER:
// TODO
// item=OrganizationFormItemUtil.browserItem()
break;
case CHECKBOX:
item = OrganizationFormItemUtil.checkboxItem(user, 2, 16, 1, true, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName());
item.setValue(compExtMap.get(extendInfoPO.getFieldName()));
break;
case SELECT:
// TODO
// item = OrganizationFormItemUtil.selectItem();
break;
case FILEUPLOAD:
case TEXT:
default:
break;
}
if (null != item) {
// 根据viewAttr设置编辑或只读
item.setViewAttr(viewAttr);
// 是否必填
if (1 == extendInfoPO.getIsrequired()) {
item.setViewAttr(3);
item.setRules("required|string");
}
conditionItems.add(item);
}
}
addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, conditionItems));
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override @Override
public Map<String, Object> getCompSaveForm() { public Map<String, Object> getCompSaveForm() {
Map<String, Object> apiDatas = new HashMap<>(); Map<String, Object> apiDatas = new HashMap<>();
@ -308,7 +418,7 @@ public class CompServiceImpl extends Service implements CompService {
// 负责人 // 负责人
SearchConditionItem compPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "负责人", "1", "compPrincipal", ""); SearchConditionItem compPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "负责人", "1", "compPrincipal", "");
// 说明 // 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "description"); SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
conditionItems.add(compNoItem); conditionItems.add(compNoItem);
conditionItems.add(compNameItem); conditionItems.add(compNameItem);
@ -378,7 +488,7 @@ public class CompServiceImpl extends Service implements CompService {
* *
* @return * @return
*/ */
private List<Map<String, Object>> getExtendTables(long id, int operateType, boolean showLabel) { private List<Map<String, Object>> getExtendTables(long id, int viewAttr, boolean showLabel) {
List<Map<String, Object>> tables = new ArrayList<>(); List<Map<String, Object>> tables = new ArrayList<>();
String tableName = "JCL_ORG_COMPEXT_DT1"; String tableName = "JCL_ORG_COMPEXT_DT1";
// 查询所有分布模块,拓展明细表信息 // 查询所有分布模块,拓展明细表信息
@ -390,11 +500,11 @@ public class CompServiceImpl extends Service implements CompService {
tableMap.put("hide", false); tableMap.put("hide", false);
tableMap.put("tabname", getExtendGroupMapper().getGroupNameById(entry.getKey() + "")); tableMap.put("tabname", getExtendGroupMapper().getGroupNameById(entry.getKey() + ""));
Map<String, Object> tabinfoMap = new HashMap<>(); Map<String, Object> tabinfoMap = new HashMap<>();
tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(entry.getValue(), operateType, showLabel)); tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(entry.getValue(), viewAttr, showLabel));
tabinfoMap.put("rownum", "rownum"); tabinfoMap.put("rownum", "rownum");
String fields = entry.getValue().stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); String fields = entry.getValue().stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
tabinfoMap.put("datas", getCompMapper().listCompExtDT(tableName, id, fields)); tabinfoMap.put("datas", getCompExtDTMapper().listCompExtDT(tableName, id, fields));
tableMap.put("tabinfo", tabinfoMap); tableMap.put("tabinfo", tabinfoMap);
tables.add(tableMap); tables.add(tableMap);
} }

@ -51,6 +51,27 @@ 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) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/** /**
* *
* *
@ -71,6 +92,26 @@ public class CompController {
} }
} }
/**
*
*
* @param request
* @param response
* @return
*/
@POST
@Path("/updateComp")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateComp(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getCompWrapper(user).updateComp(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/** /**
* ID * ID
@ -151,6 +192,34 @@ public class CompController {
} }
} }
/**
*
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getCompExtForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getCompExtForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getCompWrapper(user).getCompExtForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
*
*
* @param request
* @param response
* @return
*/
@GET @GET
@Path("/getCompSaveForm") @Path("/getCompSaveForm")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)

@ -31,6 +31,17 @@ public class CompWrapper extends Service {
return getCompService(user).listPage(params); return getCompService(user).listPage(params);
} }
/**
* /
*
* @param params
* @return
*/
public int saveBaseComp(CompSearchParam params) {
return getCompService(user).saveBaseComp(params);
}
/** /**
* *
* *
@ -40,6 +51,16 @@ public class CompWrapper extends Service {
return getCompService(user).updateForbiddenTagById(params); return getCompService(user).updateForbiddenTagById(params);
} }
/**
*
*
* @param params
* @return
*/
public int updateComp(Map<String, Object> params) {
return getCompService(user).updateComp(params);
}
/** /**
* ID * ID
* *
@ -78,6 +99,16 @@ public class CompWrapper extends Service {
return getCompService(user).getCompBaseForm(params); return getCompService(user).getCompBaseForm(params);
} }
/**
*
*
* @param params
* @return
*/
public Map<String, Object> getCompExtForm(Map<String, Object> params) {
return getCompService(user).getCompExtForm(params);
}
/** /**
* *
* *

Loading…
Cancel
Save