mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-19 13:48:31 +08:00
业务数据动态表单关联修改
This commit is contained in:
parent
2392beebb6
commit
988c4d0f45
16 changed files with 623 additions and 60 deletions
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<SkyeyeClassDsFormLinkMation> {
|
||||
|
||||
List<Map<String, Object>> queryDsFormLinkList(CommonPageInfo commonPageInfo);
|
||||
|
||||
Map<String, Object> queryDsFormLinkMationById(@Param("id") String id, @Param("code") String code);
|
||||
|
||||
void editDsFormLinkMationById(Map<String, Object> map);
|
||||
|
||||
}
|
|
@ -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<Map<String, Object>> {
|
||||
|
||||
@Override
|
||||
protected TypeReference<List<Map<String, Object>>> specificType() {
|
||||
return new TypeReference<List<Map<String, Object>>>() {
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Map<String, Object>> valueList;
|
||||
|
||||
}
|
||||
|
|
|
@ -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<ListenerMation> {
|
||||
|
||||
@Override
|
||||
protected TypeReference<List<ListenerMation>> specificType() {
|
||||
return new TypeReference<List<ListenerMation>>() {
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -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<ListenerMation> listenerList;
|
||||
|
||||
|
|
|
@ -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<SkyeyeClassDsFormLinkMation> classNameList;
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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<SkyeyeClassDsFormLinkMation> {
|
||||
|
||||
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);
|
||||
|
||||
}
|
|
@ -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<SkyeyeClassDsFormLinkDao, SkyeyeClassDsFormLinkMation> 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<SkyeyeClassDsFormLinkMation> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getAppId), skyeyeClassDsFormLinkApiMation.getAppId());
|
||||
List<SkyeyeClassDsFormLinkMation> oldList = super.list(wrapper);
|
||||
Map<String, String> classNameToDsFormId = oldList.stream().filter(bean -> !ToolUtil.isBlank(bean.getDsFormPageIds())).collect(Collectors.toMap(SkyeyeClassDsFormLinkMation::getClassName, SkyeyeClassDsFormLinkMation::getDsFormPageIds));
|
||||
List<String> oldKeys = oldList.stream().map(bean -> bean.getClassName() + bean.getServiceName()).collect(Collectors.toList());
|
||||
|
||||
// 获取入参的数据
|
||||
List<SkyeyeClassDsFormLinkMation> classNameList = skyeyeClassDsFormLinkApiMation.getClassNameList();
|
||||
for (SkyeyeClassDsFormLinkMation classNameBean : classNameList) {
|
||||
classNameBean.setAppId(skyeyeClassDsFormLinkApiMation.getAppId());
|
||||
classNameBean.setAppName(skyeyeClassDsFormLinkApiMation.getAppName());
|
||||
DataCommonUtil.setCommonDataByGenericity(classNameBean, "0dc9dd4cd4d446ae9455215fe753c44e");
|
||||
DataCommonUtil.setId(classNameBean);
|
||||
}
|
||||
List<String> newKeys = classNameList.stream().map(bean -> bean.getClassName() + bean.getServiceName()).collect(Collectors.toList());
|
||||
|
||||
// (旧数据 - 新数据) 从数据库删除
|
||||
List<SkyeyeClassDsFormLinkMation> deleteBeans = oldList.stream().filter(item -> !newKeys.contains(item.getClassName() + item.getServiceName())).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(deleteBeans)) {
|
||||
List<String> classNames = deleteBeans.stream().map(bean -> bean.getClassName()).collect(Collectors.toList());
|
||||
QueryWrapper<SkyeyeClassDsFormLinkMation> deleteWrapper = new QueryWrapper<>();
|
||||
deleteWrapper.eq(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getAppId), skyeyeClassDsFormLinkApiMation.getAppId());
|
||||
deleteWrapper.in(MybatisPlusUtil.toColumns(SkyeyeClassDsFormLinkMation::getClassName), classNames);
|
||||
remove(deleteWrapper);
|
||||
}
|
||||
|
||||
// (新数据 - 旧数据) 添加到数据库
|
||||
List<SkyeyeClassDsFormLinkMation> 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<Map<String, Object>> 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<String, Object> map = inputObject.getParams();
|
||||
String id = map.get("id").toString();
|
||||
Map<String, Object> 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<Map<String, Object>> dsFormPageMations = new ArrayList<>();
|
||||
Arrays.asList(dsFormPageIds).forEach(dsFormPageId -> {
|
||||
// 获取表单页面信息
|
||||
Map<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> bean = skyeyeClassDsFormLinkDao.queryDsFormLinkMationById(id, code);
|
||||
if (CollectionUtils.isEmpty(bean)) {
|
||||
return;
|
||||
}
|
||||
String[] dsFormPageIds = bean.get("dsFormPageIds").toString().split(",");
|
||||
// 返回给前台的值
|
||||
List<Map<String, Object>> dsFormPageMations = new ArrayList<>();
|
||||
for (String dsFormPageId : Arrays.asList(dsFormPageIds)) {
|
||||
// 获取表单页面信息
|
||||
Map<String, Object> 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());
|
||||
}
|
||||
|
||||
}
|
|
@ -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<SkyeyeClassEnumDao,
|
|||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void writeClassEnum(InputObject inputObject, OutputObject outputObject) {
|
||||
SkyeyeClassEnumApiMation skyeyeClassEnumApiMation = inputObject.getParams(SkyeyeClassEnumApiMation.class);
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.skyeye.clazz.entity.classflowable.SkyeyeClassFlowableLinkMation;
|
|||
import com.skyeye.clazz.service.SkyeyeClassFlowableService;
|
||||
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.List;
|
||||
|
@ -47,6 +48,7 @@ public class SkyeyeClassFlowableServiceImpl extends ServiceImpl<SkyeyeClassFlowa
|
|||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void writeClassFlowable(InputObject inputObject, OutputObject outputObject) {
|
||||
SkyeyeClassFlowableLinkApiMation skyeyeClassFlowableLinkApiMation = inputObject.getParams(SkyeyeClassFlowableLinkApiMation.class);
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<?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.skyeye.clazz.dao.SkyeyeClassDsFormLinkDao">
|
||||
|
||||
<select id="queryDsFormLinkList" resultType="java.util.Map">
|
||||
SELECT
|
||||
a.id,
|
||||
a.service_name serviceName,
|
||||
a.class_name className,
|
||||
a.app_id appId,
|
||||
a.app_name appName,
|
||||
a.create_id createId,
|
||||
CONVERT(a.create_time, char) createTime,
|
||||
a.last_update_id lastUpdateId,
|
||||
CONVERT(a.last_update_time, char) lastUpdateTime
|
||||
FROM
|
||||
skyeye_class_ds_form_link a
|
||||
<where>
|
||||
<if test="sqlExtract != '' and sqlExtract != null">
|
||||
${sqlExtract}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (a.service_name like '%${keyword}%' OR a.class_name LIKE '%${keyword}%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="queryDsFormLinkMationById" resultType="java.util.Map">
|
||||
SELECT
|
||||
a.id,
|
||||
a.service_name serviceName,
|
||||
a.class_name className,
|
||||
a.app_id appId,
|
||||
a.app_name appName,
|
||||
IFNULL(a.ds_form_page_ids, '') dsFormPageIds,
|
||||
a.create_id createId,
|
||||
CONVERT(a.create_time, char) createTime,
|
||||
a.last_update_id lastUpdateId,
|
||||
CONVERT(a.last_update_time, char) lastUpdateTime
|
||||
FROM
|
||||
skyeye_class_ds_form_link a
|
||||
<where>
|
||||
<if test="id != '' and id != null">
|
||||
AND a.id = #{id}
|
||||
</if>
|
||||
<if test="code != '' and code != null">
|
||||
AND a.code = #{code}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="editDsFormLinkMationById">
|
||||
UPDATE skyeye_class_ds_form_link
|
||||
SET
|
||||
ds_form_page_ids = #{dsFormPageIds},
|
||||
last_update_id = #{userId},
|
||||
last_update_time = #{lastUpdateTime}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Loading…
Reference in a new issue