diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassCodeRuleController.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassCodeRuleController.java index 69934999..ddb7db16 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassCodeRuleController.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassCodeRuleController.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController; /** * @ClassName: SkyeyeClassCodeRuleController - * @Description: 需要获取编码的服务类服务服务层 + * @Description: 需要获取编码的服务类服务控制层 * @author: skyeye云系列--卫志强 * @date: 2022/9/18 16:08 * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassDsFormLinkController.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassDsFormLinkController.java new file mode 100644 index 00000000..7f112a1b --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/controller/SkyeyeClassDsFormLinkController.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.controller; + +import com.skyeye.annotation.api.Api; +import com.skyeye.annotation.api.ApiImplicitParam; +import com.skyeye.annotation.api.ApiImplicitParams; +import com.skyeye.annotation.api.ApiOperation; +import com.skyeye.clazz.entity.dsformlink.SkyeyeClassDsFormLinkApiMation; +import com.skyeye.clazz.service.SkyeyeClassDsFormLinkService; +import com.skyeye.common.entity.CommonPageInfo; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @ClassName: SkyeyeClassDsFormLinkController + * @Description: 动态表单的服务类注册控制层 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@RestController +@Api(value = "动态表单的服务类注册", tags = "动态表单的服务类注册", modelName = "系统公共模块") +public class SkyeyeClassDsFormLinkController { + + @Autowired + private SkyeyeClassDsFormLinkService skyeyeClassDsFormLinkService; + + /** + * 动态表单的服务类注册 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "writeDsFormLink", value = "动态表单的服务类注册", method = "POST", allUse = "0") + @ApiImplicitParams(classBean = SkyeyeClassDsFormLinkApiMation.class) + @RequestMapping("/post/SkyeyeClassDsFormLinkController/writeDsFormLink") + public void writeDsFormLink(InputObject inputObject, OutputObject outputObject) { + skyeyeClassDsFormLinkService.writeDsFormLink(inputObject, outputObject); + } + + /** + * 获取业务逻辑表单关联列表 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "dsFormObjectRelation001", value = "获取业务逻辑表单关联列表", method = "POST", allUse = "1") + @ApiImplicitParams(classBean = CommonPageInfo.class) + @RequestMapping("/post/SkyeyeClassDsFormLinkController/queryDsFormLinkList") + public void queryDsFormLinkList(InputObject inputObject, OutputObject outputObject) { + skyeyeClassDsFormLinkService.queryDsFormLinkList(inputObject, outputObject); + } + + /** + * 获取业务逻辑表单关联信息详情 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "dsFormObjectRelation004", value = "获取业务逻辑表单关联信息详情", method = "GET", allUse = "2") + @ApiImplicitParams({ + @ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")}) + @RequestMapping("/post/SkyeyeClassDsFormLinkController/queryDsFormLinkMationById") + public void queryDsFormLinkMationById(InputObject inputObject, OutputObject outputObject) { + skyeyeClassDsFormLinkService.queryDsFormLinkMationById(inputObject, outputObject); + } + + /** + * 编辑业务逻辑表单关联信息 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "dsFormObjectRelation005", value = "编辑业务逻辑表单关联信息", method = "PUT", allUse = "1") + @ApiImplicitParams({ + @ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required"), + @ApiImplicitParam(id = "dsFormPageIds", name = "dsFormPageIds", value = "动态表单的id,多个用逗号隔开")}) + @RequestMapping("/post/SkyeyeClassDsFormLinkController/editDsFormLinkMationById") + public void editDsFormLinkMationById(InputObject inputObject, OutputObject outputObject) { + skyeyeClassDsFormLinkService.editDsFormLinkMationById(inputObject, outputObject); + } + + /** + * 根据code/id获取关联的动态表单信息 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "dsFormObjectRelation006", value = "根据code/id获取关联的动态表单信息", method = "GET", allUse = "2") + @ApiImplicitParams({ + @ApiImplicitParam(id = "dsFormObjectRelationCode", name = "dsFormObjectRelationCode", value = "动态表单-----业务逻辑表单关联表的code,与id至少有一个必填"), + @ApiImplicitParam(id = "dsFormObjectRelationId", name = "dsFormObjectRelationId", value = "动态表单-----业务逻辑表单关联表的id,与code至少有一个必填")}) + @RequestMapping("/post/SkyeyeClassDsFormLinkController/queryDsFormLinkListByCode") + public void queryDsFormLinkListByCode(InputObject inputObject, OutputObject outputObject) { + skyeyeClassDsFormLinkService.queryDsFormLinkListByCode(inputObject, outputObject); + } + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/dao/SkyeyeClassDsFormLinkDao.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/dao/SkyeyeClassDsFormLinkDao.java new file mode 100644 index 00000000..8303021a --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/dao/SkyeyeClassDsFormLinkDao.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.dao; + +import com.skyeye.clazz.entity.dsformlink.SkyeyeClassDsFormLinkMation; +import com.skyeye.common.entity.CommonPageInfo; +import com.skyeye.eve.dao.SkyeyeBaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: SkyeyeClassDsFormLinkDao + * @Description: 动态表单的服务类注册数据层 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +public interface SkyeyeClassDsFormLinkDao extends SkyeyeBaseMapper { + + List> queryDsFormLinkList(CommonPageInfo commonPageInfo); + + Map queryDsFormLinkMationById(@Param("id") String id, @Param("code") String code); + + void editDsFormLinkMationById(Map map); + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumListTypeHandler.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumListTypeHandler.java deleted file mode 100644 index 6ea007f8..00000000 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumListTypeHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye - ******************************************************************************/ - -package com.skyeye.clazz.entity.classenum; - -import com.alibaba.fastjson.TypeReference; -import com.skyeye.common.base.handler.ListTypeHandler; - -import java.util.List; -import java.util.Map; - -/** - * @ClassName: SkyeyeClassEnumListTypeHandler - * @Description: 枚举类集合转换处理类 - * @author: skyeye云系列--卫志强 - * @date: 2022/9/12 13:21 - * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. - * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 - */ -public class SkyeyeClassEnumListTypeHandler extends ListTypeHandler> { - - @Override - protected TypeReference>> specificType() { - return new TypeReference>>() { - }; - } - -} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumMation.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumMation.java index 77d52df1..0a834565 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumMation.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classenum/SkyeyeClassEnumMation.java @@ -7,6 +7,7 @@ package com.skyeye.clazz.entity.classenum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.skyeye.annotation.api.ApiModel; import com.skyeye.common.entity.CommonOperatorUserInfo; import lombok.AllArgsConstructor; @@ -50,7 +51,7 @@ public class SkyeyeClassEnumMation extends CommonOperatorUserInfo implements Ser /** * 枚举对应的值 */ - @TableField(value = "value_list", typeHandler = SkyeyeClassEnumListTypeHandler.class) + @TableField(value = "value_list", typeHandler = JacksonTypeHandler.class) private List> valueList; } diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkListenerListTypeHandler.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkListenerListTypeHandler.java deleted file mode 100644 index 70cd6402..00000000 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkListenerListTypeHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye - ******************************************************************************/ - -package com.skyeye.clazz.entity.classflowable; - -import com.alibaba.fastjson.TypeReference; -import com.skyeye.common.base.handler.ListTypeHandler; - -import java.util.List; - -/** - * @ClassName: SkyeyeClassFlowableLinkListenerListTypeHandler - * @Description: 工作流业务对象服务对应的监听器集合转换处理类 - * @author: skyeye云系列--卫志强 - * @date: 2022/9/20 13:21 - * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. - * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 - */ -public class SkyeyeClassFlowableLinkListenerListTypeHandler extends ListTypeHandler { - - @Override - protected TypeReference> specificType() { - return new TypeReference>() { - }; - } - -} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkMation.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkMation.java index 04f88e09..a772d318 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkMation.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/classflowable/SkyeyeClassFlowableLinkMation.java @@ -7,6 +7,7 @@ package com.skyeye.clazz.entity.classflowable; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import com.google.common.base.Joiner; import com.skyeye.annotation.api.ApiModel; import com.skyeye.annotation.api.ApiModelProperty; @@ -62,7 +63,7 @@ public class SkyeyeClassFlowableLinkMation extends CommonOperatorUserInfo implem @ApiModelProperty(value = "需要提交到工作流的属性获取的Entity类", required = "required") private String transformClassBean; - @TableField(value = "listener_list", typeHandler = SkyeyeClassFlowableLinkListenerListTypeHandler.class) + @TableField(value = "listener_list", typeHandler = JacksonTypeHandler.class) @ApiModelProperty(value = "该工作流对应的监听器") private List listenerList; diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkApiMation.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkApiMation.java new file mode 100644 index 00000000..938e7529 --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkApiMation.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.entity.dsformlink; + +import com.skyeye.annotation.api.ApiModel; +import com.skyeye.annotation.api.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName: SkyeyeClassDsFormLinkApiMation + * @Description: 动态表单的服务类注册对应的实体类BOX + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:00 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@Data +@ApiModel("动态表单的服务类注册对应的实体类BOX") +public class SkyeyeClassDsFormLinkApiMation implements Serializable { + + /** + * 服务的APPID + */ + @ApiModelProperty(value = "服务的APPID", required = "required") + private String appId; + + /** + * 服务的appName + */ + @ApiModelProperty(value = "服务的appName", required = "required") + private String appName; + + /** + * 服务类信息 + */ + @ApiModelProperty(value = "服务类信息") + private List classNameList; + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkMation.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkMation.java new file mode 100644 index 00000000..91bc840b --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/entity/dsformlink/SkyeyeClassDsFormLinkMation.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.entity.dsformlink; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.skyeye.annotation.api.ApiModel; +import com.skyeye.annotation.api.ApiModelProperty; +import com.skyeye.common.entity.CommonOperatorUserInfo; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @ClassName: SkyeyeClassDsFormLinkMation + * @Description: 动态表单的服务类注册实体类 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 13:11 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@TableName(value = "skyeye_class_ds_form_link", autoResultMap = true) +@ApiModel("动态表单的服务类注册实体类") +public class SkyeyeClassDsFormLinkMation extends CommonOperatorUserInfo implements Serializable { + + @TableId("id") + private String id; + + /** + * 服务的APPID + */ + @TableField("app_id") + private String appId; + + /** + * 服务的appName + */ + @TableField("app_name") + private String appName; + + /** + * 需要获取编码的服务类的className + */ + @TableField("class_name") + @ApiModelProperty(value = "需要获取编码的服务类的className", required = "required") + private String className; + + /** + * className对应的服务名称 + */ + @TableField("service_name") + @ApiModelProperty(value = "className对应的服务名称", required = "required") + private String serviceName; + + @TableField("ds_form_page_ids") + @ApiModelProperty(value = "动态表单id,多个用逗号隔开") + private String dsFormPageIds; + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageContentService.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageContentService.java new file mode 100644 index 00000000..8e5ae238 --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageContentService.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.rest; + +import com.skyeye.common.client.ClientConfiguration; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * @ClassName: DsFormPageContentService + * @Description: 动态表单页面关联组件管理服务接口 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@FeignClient(value = "${webroot.skyeye-flowable}", configuration = ClientConfiguration.class) +public interface DsFormPageContentService { + + /** + * 查看某个动态表单中的表单控件 + * + * @param pageId + * @return + */ + @GetMapping("/dsformpage004") + String queryFormPageContentByPageId(@RequestParam("pageId") String pageId); + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageService.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageService.java new file mode 100644 index 00000000..2bc63e70 --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/rest/DsFormPageService.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.rest; + +import com.skyeye.common.client.ClientConfiguration; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * @ClassName: DsFormPageService + * @Description: 动态表单页面管理服务接口 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@FeignClient(value = "${webroot.skyeye-flowable}", configuration = ClientConfiguration.class) +public interface DsFormPageService { + + /** + * 通过id查找对应的动态表单页面 + * + * @param rowId + * @return + */ + @GetMapping("/dsformpage006") + String queryDsFormPageById(@RequestParam("rowId") String rowId); + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/SkyeyeClassDsFormLinkService.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/SkyeyeClassDsFormLinkService.java new file mode 100644 index 00000000..c379d7da --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/SkyeyeClassDsFormLinkService.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.skyeye.clazz.entity.dsformlink.SkyeyeClassDsFormLinkMation; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +/** + * @ClassName: SkyeyeClassDsFormLinkService + * @Description: 动态表单的服务类注册服务接口层 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +public interface SkyeyeClassDsFormLinkService extends IService { + + void writeDsFormLink(InputObject inputObject, OutputObject outputObject); + + void queryDsFormLinkList(InputObject inputObject, OutputObject outputObject); + + void queryDsFormLinkMationById(InputObject inputObject, OutputObject outputObject); + + void editDsFormLinkMationById(InputObject inputObject, OutputObject outputObject); + + void queryDsFormLinkListByCode(InputObject inputObject, OutputObject outputObject); + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassDsFormLinkServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassDsFormLinkServiceImpl.java new file mode 100644 index 00000000..470f62b4 --- /dev/null +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassDsFormLinkServiceImpl.java @@ -0,0 +1,209 @@ +/******************************************************************************* + * Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye + ******************************************************************************/ + +package com.skyeye.clazz.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.skyeye.clazz.dao.SkyeyeClassDsFormLinkDao; +import com.skyeye.clazz.entity.dsformlink.SkyeyeClassDsFormLinkApiMation; +import com.skyeye.clazz.entity.dsformlink.SkyeyeClassDsFormLinkMation; +import com.skyeye.clazz.rest.DsFormPageContentService; +import com.skyeye.clazz.rest.DsFormPageService; +import com.skyeye.clazz.service.SkyeyeClassDsFormLinkService; +import com.skyeye.common.client.ExecuteFeignClient; +import com.skyeye.common.entity.CommonPageInfo; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.DataCommonUtil; +import com.skyeye.common.util.DateUtil; +import com.skyeye.common.util.ToolUtil; +import com.skyeye.common.util.mybatisplus.MybatisPlusUtil; +import com.skyeye.eve.service.IAuthUserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @ClassName: SkyeyeClassDsFormLinkServiceImpl + * @Description: 动态表单的服务类注册服务层 + * @author: skyeye云系列--卫志强 + * @date: 2022/9/18 16:08 + * @Copyright: 2022 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@Service +public class SkyeyeClassDsFormLinkServiceImpl extends ServiceImpl implements SkyeyeClassDsFormLinkService { + + @Autowired + private SkyeyeClassDsFormLinkDao skyeyeClassDsFormLinkDao; + + @Autowired + private DsFormPageService dsFormPageService; + + @Autowired + private DsFormPageContentService dsFormPageContentService; + + @Autowired + private IAuthUserService iAuthUserService; + + /** + * 动态表单的服务类注册 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @Override + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void writeDsFormLink(InputObject inputObject, OutputObject outputObject) { + SkyeyeClassDsFormLinkApiMation skyeyeClassDsFormLinkApiMation = inputObject.getParams(SkyeyeClassDsFormLinkApiMation.class); + + // 获取数据库中的数据 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getAppId), skyeyeClassDsFormLinkApiMation.getAppId()); + List oldList = super.list(wrapper); + Map classNameToDsFormId = oldList.stream().filter(bean -> !ToolUtil.isBlank(bean.getDsFormPageIds())).collect(Collectors.toMap(SkyeyeClassDsFormLinkMation::getClassName, SkyeyeClassDsFormLinkMation::getDsFormPageIds)); + List oldKeys = oldList.stream().map(bean -> bean.getClassName() + bean.getServiceName()).collect(Collectors.toList()); + + // 获取入参的数据 + List classNameList = skyeyeClassDsFormLinkApiMation.getClassNameList(); + for (SkyeyeClassDsFormLinkMation classNameBean : classNameList) { + classNameBean.setAppId(skyeyeClassDsFormLinkApiMation.getAppId()); + classNameBean.setAppName(skyeyeClassDsFormLinkApiMation.getAppName()); + DataCommonUtil.setCommonDataByGenericity(classNameBean, "0dc9dd4cd4d446ae9455215fe753c44e"); + DataCommonUtil.setId(classNameBean); + } + List newKeys = classNameList.stream().map(bean -> bean.getClassName() + bean.getServiceName()).collect(Collectors.toList()); + + // (旧数据 - 新数据) 从数据库删除 + List deleteBeans = oldList.stream().filter(item -> !newKeys.contains(item.getClassName() + item.getServiceName())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(deleteBeans)) { + List classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList()); + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getAppId), skyeyeClassDsFormLinkApiMation.getAppId()); + deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getClassName), classNames); + remove(deleteWrapper); + } + + // (新数据 - 旧数据) 添加到数据库 + List addBeans = classNameList.stream().filter(item -> !oldKeys.contains(item.getClassName() + item.getServiceName())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(addBeans)) { + addBeans.forEach(bean -> { + bean.setDsFormPageIds(classNameToDsFormId.get(bean.getClassName())); + }); + saveBatch(addBeans); + } + } + + /** + * 获取业务逻辑表单关联列表 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @Override + public void queryDsFormLinkList(InputObject inputObject, OutputObject outputObject) { + CommonPageInfo commonPageInfo = inputObject.getParams(CommonPageInfo.class); + Page pages = PageHelper.startPage(commonPageInfo.getPage(), commonPageInfo.getLimit()); + List> beans = skyeyeClassDsFormLinkDao.queryDsFormLinkList(commonPageInfo); + iAuthUserService.setNameByIdList(beans, "createId", "createName"); + iAuthUserService.setNameByIdList(beans, "lastUpdateId", "lastUpdateName"); + outputObject.setBeans(beans); + outputObject.settotal(pages.getTotal()); + } + + /** + * 获取业务逻辑表单关联信息详情 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @Override + public void queryDsFormLinkMationById(InputObject inputObject, OutputObject outputObject) { + Map map = inputObject.getParams(); + String id = map.get("id").toString(); + Map bean = skyeyeClassDsFormLinkDao.queryDsFormLinkMationById(id, StringUtils.EMPTY); + if (CollectionUtils.isEmpty(bean)) { + outputObject.setreturnMessage("this data is non-exits."); + return; + } + String[] dsFormPageIds = bean.get("dsFormPageIds").toString().split(","); + List> dsFormPageMations = new ArrayList<>(); + Arrays.asList(dsFormPageIds).forEach(dsFormPageId -> { + // 获取表单页面信息 + Map formPageMation = ExecuteFeignClient.get(() -> dsFormPageService.queryDsFormPageById(dsFormPageId)).getBean(); + if (!CollectionUtils.isEmpty(formPageMation)) { + // 表单页面信息不为空 + dsFormPageMations.add(formPageMation); + } + }); + bean.put("dsFormPageMations", dsFormPageMations); + iAuthUserService.setNameByIdBean(bean, "createId", "createName"); + iAuthUserService.setNameByIdBean(bean, "lastUpdateId", "lastUpdateName"); + outputObject.setBean(bean); + outputObject.settotal(1); + } + + /** + * 编辑业务逻辑表单关联信息 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @Override + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void editDsFormLinkMationById(InputObject inputObject, OutputObject outputObject) { + Map map = inputObject.getParams(); + map.put("userId", inputObject.getLogParams().get("id")); + map.put("lastUpdateTime", DateUtil.getTimeAndToString()); + skyeyeClassDsFormLinkDao.editDsFormLinkMationById(map); + } + + /** + * 根据code/id获取关联的动态表单信息 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @Override + public void queryDsFormLinkListByCode(InputObject inputObject, OutputObject outputObject) { + Map map = inputObject.getParams(); + String id = map.get("dsFormObjectRelationId").toString(); + String code = map.get("dsFormObjectRelationCode").toString(); + if (ToolUtil.isBlank(id) && ToolUtil.isBlank(code)) { + outputObject.setreturnMessage("错误的参数."); + return; + } + // 获取与动态表单的关联关系 + Map bean = skyeyeClassDsFormLinkDao.queryDsFormLinkMationById(id, code); + if (CollectionUtils.isEmpty(bean)) { + return; + } + String[] dsFormPageIds = bean.get("dsFormPageIds").toString().split(","); + // 返回给前台的值 + List> dsFormPageMations = new ArrayList<>(); + for (String dsFormPageId : Arrays.asList(dsFormPageIds)) { + // 获取表单页面信息 + Map formPageMation = ExecuteFeignClient.get(() -> dsFormPageService.queryDsFormPageById(dsFormPageId)).getBean(); + if (!CollectionUtils.isEmpty(formPageMation)) { + // 表单页面信息不为空 + formPageMation.put("content", dsFormPageContentService.queryFormPageContentByPageId(formPageMation.get("id").toString())); + dsFormPageMations.add(formPageMation); + } + } + outputObject.setBeans(dsFormPageMations); + outputObject.settotal(dsFormPageMations.size()); + } + +} diff --git a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassEnumServiceImpl.java b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassEnumServiceImpl.java index 85b1ece9..29d2d4b4 100644 --- a/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassEnumServiceImpl.java +++ b/skyeye-promote/skyeye-common/src/main/java/com/skyeye/clazz/service/impl/SkyeyeClassEnumServiceImpl.java @@ -18,6 +18,7 @@ import com.skyeye.clazz.entity.classenum.SkyeyeClassEnumMation; import com.skyeye.clazz.service.SkyeyeClassEnumService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; @@ -46,6 +47,7 @@ public class SkyeyeClassEnumServiceImpl extends ServiceImpl + + + + + + + + + UPDATE skyeye_class_ds_form_link + SET + ds_form_page_ids = #{dsFormPageIds}, + last_update_id = #{userId}, + last_update_time = #{lastUpdateTime} + WHERE id = #{id} + + + \ No newline at end of file