From f059f2b76ab3e512d97a2ba569c797e41329c42b Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sun, 24 Apr 2022 17:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=8A=E6=9E=B6=20?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceMountController.java | 19 +++++++++++++++---- .../dto/TResourceBatchMountApplyDTO.java | 10 ++-------- .../dto/TResourceMountApplyDTO.java | 7 ++----- .../entity/TResourceMountApplyEntity.java | 14 ++------------ .../impl/TResourceMountApplyServiceImpl.java | 2 +- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java b/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java index 46505231..30b9c005 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java @@ -19,6 +19,8 @@ import io.renren.modules.resourceMountApply.service.TResourceMountApplyService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.codehaus.jackson.map.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,11 +30,13 @@ import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Api(tags = "资源上架") @RestController @RequestMapping("/resource/center") public class ResourceMountController { + private static Logger logger = LoggerFactory.getLogger(ResourceMountController.class); @Autowired private ActProcessService actProcessService; @@ -58,7 +62,10 @@ public class ResourceMountController { if (page.getTotal() <= 0) { // return new Result().error("联系管理员添加流程"); } - tResourceBatchMountApplyDTO.getResourceDTO().stream().map(index -> { + logger.info("---------------------------------------------------"); + logger.info(JSONObject.toJSONString(tResourceBatchMountApplyDTO)); + logger.info("####################################################"); + return new Result().ok(tResourceBatchMountApplyDTO.getResourceDTO().stream().map(index -> { TResourceMountApplyDTO tResourceMountApplyDTO = new TResourceMountApplyDTO(); tResourceMountApplyDTO.setPhone(tResourceBatchMountApplyDTO.getPhone()); tResourceMountApplyDTO.setDeptId(tResourceBatchMountApplyDTO.getDeptId()); @@ -73,6 +80,7 @@ public class ResourceMountController { if (tResourceMountApplyDTO.getId() == null) { return null; } + logger.info("-------------------1.保存申请表单成功--------------------------"); // 仿照请求接口 /act/running/startOfBusinessKey ProcessStartDTO processStartDTO = new ProcessStartDTO(); processStartDTO.setBusinessKey(tResourceMountApplyDTO.getId().toString()); @@ -81,14 +89,17 @@ public class ResourceMountController { Map variables = oMapper.convertValue(tResourceMountApplyDTO, Map.class); processStartDTO.setVariables(variables); ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); + logger.info("-------------------2.启动流程成功--------------------------"); + logger.info("ProcessInstanceDTO.getBusinessKey:" + dto.getBusinessKey()); if (Long.valueOf(dto.getBusinessKey()) != null) { // 仿照请求接口 /processForm/tabilityapplication/updateInstanceId tResourceMountApplyService.updateInstanceId(dto.getProcessInstanceId(), Long.valueOf(dto.getBusinessKey())); + logger.info("-------------------更新updateInstanceId.成功--------------------------"); + logger.info("ProcessInstanceDTO.getProcessInstanceId:" + dto.getProcessInstanceId()); } - return tResourceMountApplyDTO; - }).filter(index -> ObjectUtil.isNotNull(index)); - return null; + return dto; + }).filter(index -> ObjectUtil.isNotNull(index)).collect(Collectors.toList())); } } diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceBatchMountApplyDTO.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceBatchMountApplyDTO.java index 5c0ad15d..22cd8853 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceBatchMountApplyDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceBatchMountApplyDTO.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -16,13 +15,13 @@ public class TResourceBatchMountApplyDTO implements Serializable { private static final long serialVersionUID = 1L; private Long id; @ApiModelProperty(value = "上架申请人id") - private Integer userId; + private String userId; @ApiModelProperty(value = "上架申请人名字") private String userName; @ApiModelProperty(value = "上架申请人电话") private String phone; @ApiModelProperty(value = "上架申请人部门") - private Long deptId; + private String deptId; @ApiModelProperty(value = "流程实例ID") private String instanceId; @ApiModelProperty(value = "删除标记:0:正常使用;1:已删除;9:其他") @@ -31,12 +30,7 @@ public class TResourceBatchMountApplyDTO implements Serializable { private List parameterContent; @ApiModelProperty(value = "参数内容 md5 <后端生成>") private String parameterContentMd5; - @ApiModelProperty(value = "创建该条申请的时间") - private Date createtime; @ApiModelProperty(value = "资源信息的信息") private List resourceDTO; - public TResourceBatchMountApplyDTO() { - this.createtime = new Date(); - } } diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceMountApplyDTO.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceMountApplyDTO.java index a035b6f9..1f734252 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceMountApplyDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceMountApplyDTO.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; -import java.util.Date; /** * 资源挂载申请表单 @@ -21,13 +20,13 @@ public class TResourceMountApplyDTO implements Serializable { private Long id; @ApiModelProperty(value = "上架申请人id") - private Integer userId; + private String userId; @ApiModelProperty(value = "上架申请人名字") private String userName; @ApiModelProperty(value = "上架申请人电话") private String phone; @ApiModelProperty(value = "上架申请人部门") - private Long deptId; + private String deptId; @ApiModelProperty(value = "流程实例ID") private String instanceId; @ApiModelProperty(value = "删除标记:0:正常使用;1:已删除;9:其他") @@ -36,8 +35,6 @@ public class TResourceMountApplyDTO implements Serializable { private String parameterContent; @ApiModelProperty(value = "参数内容 md5") private String parameterContentMd5; - @ApiModelProperty(value = "创建该条申请的时间") - private Date createtime; @ApiModelProperty(value = "申请的资源信息") private ResourceDTO resourceDTO; diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/entity/TResourceMountApplyEntity.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/entity/TResourceMountApplyEntity.java index f6a2f022..77796df4 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/entity/TResourceMountApplyEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/entity/TResourceMountApplyEntity.java @@ -2,14 +2,11 @@ package io.renren.modules.resourceMountApply.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.renren.common.entity.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 资源挂载申请表单 * @@ -22,13 +19,10 @@ import java.util.Date; public class TResourceMountApplyEntity extends BaseEntity { private static final long serialVersionUID = 1L; - @TableId - private Long id; - /** * 上架申请人id */ - private Integer userId; + private String userId; /** * 上架申请人名字 */ @@ -41,7 +35,7 @@ public class TResourceMountApplyEntity extends BaseEntity { * 上架申请人部门 */ @TableField(fill = FieldFill.INSERT) - private Long deptId; + private String deptId; /** * 流程实例ID */ @@ -58,8 +52,4 @@ public class TResourceMountApplyEntity extends BaseEntity { * 参数内容 md5 */ private String parameterContentMd5; - /** - * 创建该条申请的时间 - */ - private Date createtime; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/service/impl/TResourceMountApplyServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/service/impl/TResourceMountApplyServiceImpl.java index 84976a09..668cee06 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/service/impl/TResourceMountApplyServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/service/impl/TResourceMountApplyServiceImpl.java @@ -30,6 +30,6 @@ public class TResourceMountApplyServiceImpl extends CrudServiceImpl