diff --git a/src/com/engine/organization/entity/fieldset/param/FieldTypeTreeParam.java b/src/com/engine/organization/entity/fieldset/param/FieldTypeTreeParam.java new file mode 100644 index 00000000..57e20c61 --- /dev/null +++ b/src/com/engine/organization/entity/fieldset/param/FieldTypeTreeParam.java @@ -0,0 +1,34 @@ +package com.engine.organization.entity.fieldset.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: + * @Date 2022/6/15 + * @Version V1.0 + **/ + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FieldTypeTreeParam { + + private Long id; + + private Long parentid; + + private String name; + + private String isShow; + + private String groupOrder; + + private List childs; +} diff --git a/src/com/engine/organization/service/FieldDefinedService.java b/src/com/engine/organization/service/FieldDefinedService.java index af197acf..6a5cdd02 100644 --- a/src/com/engine/organization/service/FieldDefinedService.java +++ b/src/com/engine/organization/service/FieldDefinedService.java @@ -1,6 +1,8 @@ package com.engine.organization.service; + import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; +import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.enums.ModuleTypeEnum; @@ -16,6 +18,11 @@ import java.util.Map; public interface FieldDefinedService { + /** + * 获取左侧树 + * @param moduleTypeEnum + * @return + */ List getTree(ModuleTypeEnum moduleTypeEnum); /** @@ -50,4 +57,13 @@ public interface FieldDefinedService { */ Map saveTitle(ExtendTitleSaveParam param); + + /** + * 新增类型树 + * @param moduleTypeEnum + * @param fieldTypeTreeParam + * @return + */ + void addTree(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam); + } diff --git a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java index aeb8f01f..10a95554 100644 --- a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java +++ b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java @@ -8,6 +8,7 @@ import com.engine.organization.entity.extend.bo.ExtendGroupBO; import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendTitlePO; +import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.mapper.extend.ExtendGroupMapper; @@ -30,6 +31,7 @@ import java.util.stream.Collectors; * @Version V1.0 **/ public class FieldDefinedServiceImpl extends Service implements FieldDefinedService { + private ExtendTitleMapper getExtendTitleMapper() { return MapperProxyFactory.getProxy(ExtendTitleMapper.class); } @@ -144,4 +146,17 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ datas.put("status", "1"); return datas; } + + public void addTree(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam) { + buildExtentGroup(moduleTypeEnum,fieldTypeTreeParam); + } + + private void buildExtentGroup(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam) { + + } + + + + + } diff --git a/src/com/engine/organization/web/FieldDefinedController.java b/src/com/engine/organization/web/FieldDefinedController.java index c56a3e90..552a6717 100644 --- a/src/com/engine/organization/web/FieldDefinedController.java +++ b/src/com/engine/organization/web/FieldDefinedController.java @@ -3,6 +3,7 @@ package com.engine.organization.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; +import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.util.response.ReturnResult; import com.engine.organization.wrapper.FieldDefinedWrapper; @@ -32,7 +33,7 @@ public class FieldDefinedController { @GET @Path("/{moduleTypeEnum}/getTree") @Produces(MediaType.APPLICATION_JSON) - public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response, + public ReturnResult getTree(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum) { try { User user = HrmUserVarify.getUser(request, response); @@ -42,6 +43,45 @@ public class FieldDefinedController { } } + @POST + @Path("/{moduleTypeEnum}/saveTree") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult saveTree(@Context HttpServletRequest request, @Context HttpServletResponse response, + @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum) { + try { + User user = HrmUserVarify.getUser(request, response); + return getFieldDefinedWrapper(user).getTree(moduleTypeEnum); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + @POST + @Path("/{moduleTypeEnum}/addTree") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult addTree(@Context HttpServletRequest request, @Context HttpServletResponse response, + @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody FieldTypeTreeParam fieldTypeTreeParam) { + try { + User user = HrmUserVarify.getUser(request, response); + return getFieldDefinedWrapper(user).addTree(moduleTypeEnum,fieldTypeTreeParam); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + @POST + @Path("/{moduleTypeEnum}/editTree") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult editTree(@Context HttpServletRequest request, @Context HttpServletResponse response, + @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum,@RequestBody FieldTypeTreeParam fieldTypeTreeParam) { + try { + User user = HrmUserVarify.getUser(request, response); + return getFieldDefinedWrapper(user).getTree(moduleTypeEnum); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + @GET @Path("/getTabInfo") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/organization/wrapper/FieldDefinedWrapper.java b/src/com/engine/organization/wrapper/FieldDefinedWrapper.java index 1f007ef5..0aa5b93e 100644 --- a/src/com/engine/organization/wrapper/FieldDefinedWrapper.java +++ b/src/com/engine/organization/wrapper/FieldDefinedWrapper.java @@ -3,6 +3,7 @@ package com.engine.organization.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; +import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.service.FieldDefinedService; @@ -33,7 +34,6 @@ public class FieldDefinedWrapper extends Service { /** * 获取标题分组 - * * @param groupType * @return */ @@ -53,11 +53,16 @@ public class FieldDefinedWrapper extends Service { /** * 新建分组 - * * @param param * @return */ public Map saveTitle(ExtendTitleSaveParam param) { return getFieldDefinedService(user).saveTitle(param); } + + + public ReturnResult addTree(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam) { + getFieldDefinedService(user).addTree(moduleTypeEnum,fieldTypeTreeParam); + return ReturnResult.successed(); + } }