diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java index fac9e9ec..50db87a4 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -18,7 +18,7 @@ import java.util.Map; public class ExtendInfoBO { // 封装对象为table组件 - public static List> convertInfoListToTable(List infoPOList, int operateType, boolean showLabel) { + public static List> convertInfoListToTable(List infoPOList, int viewAttr, boolean showLabel) { List> lsCol = new ArrayList>(); Map col = null; @@ -31,7 +31,7 @@ public class ExtendInfoBO { col.put("key", 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 + "%"); @@ -46,12 +46,12 @@ public class ExtendInfoBO { * 明细表字段 * * @param extendInfoPO - * @param operateType + * @param viewAttr * @return */ - private static List getFieldDetialInfo(ExtendInfoPO extendInfoPO, int operateType, boolean showLabel, int width) { + private static List getFieldDetialInfo(ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { List ls = new ArrayList(); - FieldItem fieldItem = createField(extendInfoPO, operateType, showLabel, width); + FieldItem fieldItem = createField(extendInfoPO, viewAttr, showLabel, width); ls.add(fieldItem); return ls; } @@ -60,12 +60,12 @@ public class ExtendInfoBO { * 创建列表字段信息 * * @param extendInfoPO - * @param operateType + * @param viewAttr * @param showLabel * @param width * @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(); if (showLabel) { fieldItem.setLabel(extendInfoPO.getFieldNameDesc()); @@ -76,8 +76,8 @@ public class ExtendInfoBO { fieldItem.setType(getFieldhtmltype(extendInfoPO.getControlType() + "")); fieldItem.setKey(extendInfoPO.getFieldName()); // 查看操作 全部设置为只读 - if (0 == operateType) { - fieldItem.setViewAttr(1); + if (1 == viewAttr) { + fieldItem.setViewAttr(viewAttr); } else { // 必填 if (1 == extendInfoPO.getIsrequired()) { @@ -98,7 +98,7 @@ public class ExtendInfoBO { * @param fieldhtmltype * @return */ - private static FieldType getFieldhtmltype(String fieldhtmltype) { + public static FieldType getFieldhtmltype(String fieldhtmltype) { FieldType fieldtype = null; if (fieldhtmltype.equals("1")) { fieldtype = FieldType.INPUT; diff --git a/src/com/engine/organization/mapper/comp/CompExtDTMapper.java b/src/com/engine/organization/mapper/comp/CompExtDTMapper.java new file mode 100644 index 00000000..3387a7ed --- /dev/null +++ b/src/com/engine/organization/mapper/comp/CompExtDTMapper.java @@ -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> 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); +} diff --git a/src/com/engine/organization/mapper/comp/CompExtDTMapper.xml b/src/com/engine/organization/mapper/comp/CompExtDTMapper.xml new file mode 100644 index 00000000..e48f947b --- /dev/null +++ b/src/com/engine/organization/mapper/comp/CompExtDTMapper.xml @@ -0,0 +1,18 @@ + + + + + delete + from ${tableName} + where mainid = #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/comp/CompExtMapper.java b/src/com/engine/organization/mapper/comp/CompExtMapper.java new file mode 100644 index 00000000..d5b66dd1 --- /dev/null +++ b/src/com/engine/organization/mapper/comp/CompExtMapper.java @@ -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 listCompExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id); +} diff --git a/src/com/engine/organization/mapper/comp/CompExtMapper.xml b/src/com/engine/organization/mapper/comp/CompExtMapper.xml new file mode 100644 index 00000000..3fa95837 --- /dev/null +++ b/src/com/engine/organization/mapper/comp/CompExtMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index d2ef7201..1139155c 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; -import java.util.Map; /** * @description: TODO @@ -55,13 +54,21 @@ public interface CompMapper { /** - * 根据主表id,查询拓展表数据 + * 保存公司/分部基础信息 * - * @param tableName - * @param id + * @param compPO + * @return + */ + int insertIgnoreNull(CompPO compPO); + + + /** + * 更新主表内容 + * + * @param compPO * @return */ - List> listCompExtDT(@Param("tableName") String tableName, @Param("id") long id, @Param("fields") String fields); + int updateBaseComp(CompPO compPO); /** * 更新禁用标记 diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 4fcda970..53f71cf7 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -50,6 +50,89 @@ and NVL(parent_company,'0')='0' + + INSERT INTO jcl_org_comp + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + comp_no, + + + comp_name, + + + comp_name_short, + + + parent_company, + + + org_code, + + + industry, + + + comp_principal, + + + description, + + forbidden_tag, + + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + #{compNo}, + + + #{compName}, + + + #{compNameShort}, + + + #{parentCompany}, + + + #{orgCode}, + + + #{industry}, + + + #{compPrincipal}, + + + #{description}, + + 0, + + + - - - update jcl_org_comp @@ -120,4 +195,8 @@ + + + + \ No newline at end of file diff --git a/src/com/engine/organization/service/CompService.java b/src/com/engine/organization/service/CompService.java index 50c533f7..a33d7f79 100644 --- a/src/com/engine/organization/service/CompService.java +++ b/src/com/engine/organization/service/CompService.java @@ -21,6 +21,14 @@ public interface CompService { */ Map listPage(CompSearchParam params); + /** + * 保存公司/分部基础信息 + * + * @param params + * @return + */ + int saveBaseComp(CompSearchParam params); + /** * 更新禁用标记 * @@ -29,6 +37,15 @@ public interface CompService { int updateForbiddenTagById(CompSearchParam params); + /** + * 更新分部主表、拓展表、明细表 + * + * @param params + * @return + */ + int updateComp(Map params); + + /** * 根据ID批量删除 * @@ -67,6 +84,14 @@ public interface CompService { */ Map getCompBaseForm(Map params); + /** + * 获取拓展表单 + * + * @param params + * @return + */ + Map getCompExtForm(Map params); + /** * 获取新增表单 diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 4408f5f3..f6d75f54 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -1,6 +1,7 @@ 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; @@ -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.extend.bo.ExtendInfoBO; 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.extend.ExtendGroupMapper; 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 weaver.crm.Maint.SectorInfoComInfo; import weaver.general.StringUtil; +import weaver.general.Util; import weaver.hrm.resource.ResourceComInfo; import java.util.*; @@ -54,6 +58,14 @@ public class CompServiceImpl extends Service implements CompService { return MapperProxyFactory.getProxy(ExtendInfoMapper.class); } + private CompExtDTMapper getCompExtDTMapper() { + return MapperProxyFactory.getProxy(CompExtDTMapper.class); + } + + private CompExtMapper getCompExtMapper() { + return MapperProxyFactory.getProxy(CompExtMapper.class); + } + @Override public Map listPage(CompSearchParam params) { @@ -93,12 +105,50 @@ public class CompServiceImpl extends Service implements CompService { return datas; } + @Override + public int saveBaseComp(CompSearchParam params) { + List list = getCompMapper().listByNo(Util.null2String(params.getCompNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID()); + return getCompMapper().insertIgnoreNull(compPO); + } + @Override public int updateForbiddenTagById(CompSearchParam params) { CompPO compPO = CompPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build(); return getCompMapper().updateForbiddenTagById(compPO); } + @Override + public int updateComp(Map 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 infoPOList = getExtendInfoMapper().listFields("1", "", tableName); + List dtFields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList()); + + List> insertList = new ArrayList<>(); + System.out.println(dtFields); + // TODO 删除明细表数据 + // 处理明细表数据 + int rowNum = Util.getIntValue((String) params.get("rownum")); + for (int i = 0; i < rowNum; i++) { + Map map = new HashMap<>(); + for (String dtField : dtFields) { + map.put(dtField, params.get(dtField + "_" + i)); + } + insertList.add(map); + } + System.out.println(insertList); + + return 0; + } + @Override public int deleteByIds(Collection ids) { OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); @@ -186,7 +236,7 @@ public class CompServiceImpl extends Service implements CompService { @Override public Map getCompBaseForm(Map params) { - OrganizationAssert.notNull(params.get("operateType"), "请标识操作类型"); + OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型"); List conditionItems = new ArrayList<>(); // 编号 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 descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "description"); + SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description"); conditionItems.add(compNoItem); @@ -219,44 +269,43 @@ public class CompServiceImpl extends Service implements CompService { conditionItems.add(compPrincipalItem); conditionItems.add(descriptionItem); - // 0 查看 1新增 2编辑 - int operateType = Integer.parseInt((String) params.get("operateType")); + // 2编辑 1查看 + int viewAttr = Integer.parseInt((String) params.get("viewAttr")); 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) { - for (SearchConditionItem item : conditionItems) { - item.setViewAttr(1); - } + // 赋值 + 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 (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("conditions", conditionsMap); resultMap.put("id", id); - resultMap.put("tables", getExtendTables(id, operateType, false)); + resultMap.put("tables", getExtendTables(id, viewAttr, false)); Map apiDatas = new HashMap<>(); apiDatas.put("result", resultMap); @@ -284,6 +333,67 @@ public class CompServiceImpl extends Service implements CompService { return apiDatas; } + @Override + public Map getCompExtForm(Map params) { + Map apiDatas = new HashMap<>(); + List addGroups = new ArrayList<>(); + List 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 infoPOList = getExtendInfoMapper().listFields("1", groupId, tableName); + String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); + Map 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 public Map getCompSaveForm() { Map 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 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(compNameItem); @@ -378,7 +488,7 @@ public class CompServiceImpl extends Service implements CompService { * * @return */ - private List> getExtendTables(long id, int operateType, boolean showLabel) { + private List> getExtendTables(long id, int viewAttr, boolean showLabel) { List> tables = new ArrayList<>(); String tableName = "JCL_ORG_COMPEXT_DT1"; // 查询所有分布模块,拓展明细表信息 @@ -390,11 +500,11 @@ public class CompServiceImpl extends Service implements CompService { tableMap.put("hide", false); tableMap.put("tabname", getExtendGroupMapper().getGroupNameById(entry.getKey() + "")); Map 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"); 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); tables.add(tableMap); } diff --git a/src/com/engine/organization/web/CompController.java b/src/com/engine/organization/web/CompController.java index d4a7dcf5..21b32223 100644 --- a/src/com/engine/organization/web/CompController.java +++ b/src/com/engine/organization/web/CompController.java @@ -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 map = ParamUtil.request2Map(request); + return ReturnResult.successed(getCompWrapper(user).updateComp(map)); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + /** * 根据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 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 @Path("/getCompSaveForm") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/organization/wrapper/CompWrapper.java b/src/com/engine/organization/wrapper/CompWrapper.java index 699a6821..45a4d40f 100644 --- a/src/com/engine/organization/wrapper/CompWrapper.java +++ b/src/com/engine/organization/wrapper/CompWrapper.java @@ -31,6 +31,17 @@ public class CompWrapper extends Service { 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); } + /** + * 更新分部主表、拓展表、明细表 + * + * @param params + * @return + */ + public int updateComp(Map params) { + return getCompService(user).updateComp(params); + } + /** * 根据ID批量删除 * @@ -78,6 +99,16 @@ public class CompWrapper extends Service { return getCompService(user).getCompBaseForm(params); } + /** + * 获取拓展表单 + * + * @param params + * @return + */ + public Map getCompExtForm(Map params) { + return getCompService(user).getCompExtForm(params); + } + /** * 新增表单 *