diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java index 20bbcc25..0a8cd84b 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java @@ -90,6 +90,7 @@ public class AbilityCenterController { if (tAbilityApplicationDTO.getId() == null) { return null; } + tAbilityApplicationDTO.setCompleteEntry(Boolean.TRUE); // 仿照请求接口 /act/running/startOfBusinessKey ProcessStartDTO processStartDTO = new ProcessStartDTO(); diff --git a/renren-admin/src/main/java/io/renren/common/controller/DemandDataController.java b/renren-admin/src/main/java/io/renren/common/controller/DemandDataController.java index 242ed284..5163f391 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/DemandDataController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/DemandDataController.java @@ -67,7 +67,7 @@ public class DemandDataController { if (tDemandDataDTO.getId() == null) { return null; } - + tDemandDataDTO.setCompleteEntry(Boolean.TRUE); logger.info("-------------------1.保存申请表单成功--------------------------"); // 仿照请求接口 /act/running/startOfBusinessKey ProcessStartDTO processStartDTO = new ProcessStartDTO(); 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 406b7e99..8a7104c2 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 @@ -34,10 +34,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; @Api(tags = "资源上架") @@ -103,6 +100,7 @@ public class ResourceMountController { if (tResourceMountApplyDTO.getId() == null) { return null; } + tResourceMountApplyDTO.setCompleteEntry(Boolean.TRUE); logger.info("-------------------1.保存申请表单成功--------------------------"); // 仿照请求接口 /act/running/startOfBusinessKey ProcessStartDTO processStartDTO = new ProcessStartDTO(); @@ -121,7 +119,6 @@ public class ResourceMountController { logger.info("-------------------更新updateInstanceId.成功--------------------------"); logger.info("ProcessInstanceDTO.getProcessInstanceId:" + dto.getProcessInstanceId()); } - return dto; }).filter(index -> ObjectUtil.isNotNull(index)).collect(Collectors.toList())); } @@ -138,6 +135,7 @@ public class ResourceMountController { logger.info(JSONObject.toJSONString(tResourceUndercarriageApplyDTO)); logger.info("####################################################"); return new Result().ok(tResourceUndercarriageApplyDTO.getResource().stream().map(index -> { + List dtoList = new ArrayList<>(); Long resourceId = Long.valueOf(index.get("resourceId")); String resourceName = index.get("resourceName"); Optional resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); @@ -152,21 +150,22 @@ public class ResourceMountController { ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); resourceService.update(dto); logger.error(resourceDTO.get().toString()); + resourceDTO.get().setCompleteEntry(Boolean.TRUE); + + logger.info("-------------------1.保存申请表单成功--------------------------"); + // 仿照请求接口 /act/running/startOfBusinessKey + ProcessStartDTO processStartDTO = new ProcessStartDTO(); + processStartDTO.setBusinessKey(resourceId.toString()); + processStartDTO.setProcessDefinitionKey(undercarriage_key); // 限定资源下架 + ObjectMapper oMapper = new ObjectMapper(); + Map variables = oMapper.convertValue(resourceDTO.get(), Map.class); + processStartDTO.setVariables(variables); + ProcessInstanceDTO index_ = actRunningService.startOfBusinessKey(processStartDTO); + logger.info("-------------------2.启动流程成功--------------------------"); + logger.info("ProcessInstanceDTO.getBusinessKey:" + index_.getBusinessKey()); + dtoList.add(index_); }); - - logger.info("-------------------1.保存申请表单成功--------------------------"); - // 仿照请求接口 /act/running/startOfBusinessKey - ProcessStartDTO processStartDTO = new ProcessStartDTO(); - processStartDTO.setBusinessKey(resourceId.toString()); - processStartDTO.setProcessDefinitionKey(undercarriage_key); // 限定资源下架 - ObjectMapper oMapper = new ObjectMapper(); - Map variables = oMapper.convertValue(resourceDTO.get(), Map.class); - processStartDTO.setVariables(variables); - ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); - logger.info("-------------------2.启动流程成功--------------------------"); - logger.info("ProcessInstanceDTO.getBusinessKey:" + dto.getBusinessKey()); - - return dto; - }).filter(index -> ObjectUtil.isNotNull(index)).collect(Collectors.toList())); + return dtoList.stream().findAny().orElse(null); + }).filter(ObjectUtil::isNotNull).collect(Collectors.toList())); } } diff --git a/renren-admin/src/main/java/io/renren/common/dto/AuditingBaseDTO.java b/renren-admin/src/main/java/io/renren/common/dto/AuditingBaseDTO.java new file mode 100644 index 00000000..084f6e72 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/common/dto/AuditingBaseDTO.java @@ -0,0 +1,33 @@ +package io.renren.common.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 审核流程各数据类 基础DTO + */ +@Data +public class AuditingBaseDTO implements Serializable { + /** + * 流程中是否存在拒绝? + */ + private Boolean reject = null; + + /** + * 流程直接被终止? + */ + private Boolean termination = null; + + /** + * 流程被驳回到第一个用户任务? + */ + private Boolean backToFirst = null; + + /** + * 流程完成表单录入? + */ + private Boolean completeEntry = null; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 642146ba..fa0ab6f1 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -159,7 +159,7 @@ public class ActTaskController { * 任务委托 */ @PostMapping("entrust") - @ApiOperation("任务委托") + @ApiOperation("任务委托(更改审批人)") @ApiImplicitParams({ @ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "assignee", value = "受理人", paramType = "query", dataType = "String") @@ -261,7 +261,7 @@ public class ActTaskController { * 终止流程 */ @PostMapping("endProcess") - @ApiOperation("终止流程") + @ApiOperation("终止流程(直接全拒绝)") @ApiImplicitParams({ @ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "comment", value = "终止审核意见", paramType = "query", dataType = "String") @@ -276,7 +276,7 @@ public class ActTaskController { * 驳回 */ @PostMapping("backToFirst") - @ApiOperation("驳回,回退至第一个用户任务") + @ApiOperation("驳回,回退至第一个用户任务(重新录入表单)") @ApiImplicitParams({ @ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "comment", value = "驳回审核意见", paramType = "query", dataType = "String") diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index a1f05582..e164b8e0 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -592,6 +592,7 @@ public class ActTaskService extends BaseServiceImpl { throw new RenException(ErrorCode.SUPERIOR_NOT_EXIST); } variables = processInstance.getProcessVariables(); + variables.put("backToFirst", Boolean.TRUE); // 标识驳回到第一个任务节点 for (Task task : tasks) { String commentMode = MessageUtils.getMessage(ErrorCode.REJECT_MESSAGE); if (StringUtils.isNotEmpty(comment)) { diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java b/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java index b9aaebb5..81faac27 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java @@ -1,5 +1,6 @@ package io.renren.modules.demanData.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -15,7 +16,7 @@ import java.util.Date; */ @Data @ApiModel(value = "能力需求评审主体") -public class TDemandDataDTO implements Serializable { +public class TDemandDataDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "id") diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java b/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java index 40d1824c..fc198bb3 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/listener/DemandDataListener.java @@ -1,7 +1,10 @@ package io.renren.modules.demanData.listener; import com.alibaba.fastjson.JSONObject; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; import io.renren.modules.demanData.dto.TDemandDataDTO; import io.renren.modules.demanData.service.TDemandDataService; import io.renren.modules.sys.dto.SysDeptDTO; @@ -21,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.lang.reflect.Type; import java.util.Date; import java.util.Map; @@ -108,11 +110,7 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti private void create(DelegateTask delegateTask, final SysRoleDTO roleDTO) { Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); @@ -154,11 +152,7 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti logger.error("---------------------------流程节点完成---------------------------------"); Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java index 48fcc350..586a25bf 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java @@ -1,5 +1,6 @@ package io.renren.modules.processForm.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -14,7 +15,7 @@ import java.io.Serializable; */ @Data @ApiModel(value = "能力申请表单") -public class TAbilityApplicationDTO implements Serializable { +public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; private Long id; diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java index e5d54d1b..60fc1bb6 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java @@ -1,5 +1,6 @@ package io.renren.modules.processForm.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -11,7 +12,7 @@ import java.util.Map; @Data @ApiModel(value = "批量能力申请表单") -public class TAbilityBatchApplicationDTO implements Serializable { +public class TAbilityBatchApplicationDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; private Long id; diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java index 5a7f9745..4ab9689d 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java @@ -1,6 +1,9 @@ package io.renren.modules.processForm.listener; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; import io.renren.modules.activiti.service.ActTaskService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.service.ApiGatewayService; @@ -26,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.lang.reflect.Type; import java.util.Date; import java.util.Map; import java.util.Optional; @@ -114,11 +116,7 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti */ private void endTake(Map kv) { // 进入最后结束节点 GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); @@ -139,11 +137,7 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti private void create(DelegateTask delegateTask) { Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); @@ -212,11 +206,7 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti !ActTaskService.Task_HANDLE_STATE_AGREE.equals(kv.get(ActTaskService.Task_HANDLE_STATE))) return; try { GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java index 96fa9528..529d88bc 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/DataCenterListener.java @@ -1,6 +1,9 @@ package io.renren.modules.processForm.listener; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -21,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.lang.reflect.Type; import java.util.Date; import java.util.Map; import java.util.Optional; @@ -110,11 +112,7 @@ public class DataCenterListener implements TaskListener, ExecutionListener, Acti Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java index cedae88f..1d5d11a9 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java @@ -1,5 +1,6 @@ package io.renren.modules.resource.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.renren.modules.resource.entity.AttrEntity; import io.renren.modules.resource.entity.ResourceEntityDelFlag; import io.swagger.annotations.ApiModel; @@ -19,7 +20,7 @@ import java.util.Optional; */ @Data @ApiModel(value = "资源表") -public class ResourceDTO implements Serializable { +public class ResourceDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键ID") diff --git a/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java b/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java index df5b8095..2fc9fecd 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/listener/ResourceUndercarriageListener.java @@ -1,6 +1,9 @@ package io.renren.modules.resource.listener; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.entity.ResourceEntityDelFlag; import io.renren.modules.resource.service.ResourceService; @@ -21,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.lang.reflect.Type; import java.util.Date; import java.util.Map; @@ -89,11 +91,7 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis */ private void endTake(Map kv) { // 进入最后结束节点 GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); @@ -115,11 +113,7 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis private void create(DelegateTask delegateTask, final SysRoleDTO roleDTO) { Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); 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 de21eb36..2eda4f14 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 @@ -1,5 +1,6 @@ package io.renren.modules.resourceMountApply.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -11,7 +12,7 @@ import java.util.List; @Data @ApiModel(value = "批量资源挂载申请表单 前端录入用") -public class TResourceBatchMountApplyDTO implements Serializable { +public class TResourceBatchMountApplyDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; private Long id; @ApiModelProperty(value = "上架申请人id") 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 174a9a2d..0a4a1f4d 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 @@ -1,6 +1,7 @@ package io.renren.modules.resourceMountApply.dto; import com.alibaba.fastjson.JSON; +import io.renren.common.dto.AuditingBaseDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -16,7 +17,7 @@ import java.io.Serializable; */ @Data @ApiModel(value = "资源挂载申请表单") -public class TResourceMountApplyDTO implements Serializable { +public class TResourceMountApplyDTO extends AuditingBaseDTO implements Serializable { private static final long serialVersionUID = 1L; private Long id; diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceUndercarriageApplyDTO.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceUndercarriageApplyDTO.java index f32a5b9f..91b9c9c3 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceUndercarriageApplyDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dto/TResourceUndercarriageApplyDTO.java @@ -1,5 +1,6 @@ package io.renren.modules.resourceMountApply.dto; +import io.renren.common.dto.AuditingBaseDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -11,7 +12,7 @@ import java.util.Map; @Data @ApiModel(value = "资源下架申请表单") -public class TResourceUndercarriageApplyDTO implements Serializable { +public class TResourceUndercarriageApplyDTO extends AuditingBaseDTO implements Serializable { @ApiModelProperty(value = "下架申请人id") private String userId; @ApiModelProperty(value = "下架申请人名字") diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java index ce48f155..8352643a 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java @@ -1,7 +1,10 @@ package io.renren.modules.resourceMountApply.listener; import com.alibaba.fastjson.JSONObject; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; import io.renren.modules.processForm.service.ApiGatewayService; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -22,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.lang.reflect.Type; import java.util.Date; import java.util.Map; @@ -116,11 +118,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A */ private void endTake(Map kv) { // 进入最后结束节点 GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); @@ -146,18 +144,11 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A private void complete(DelegateTask delegateTask) { Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv); TResourceMountApplyDTO resourceMountApplyDTO = gson.fromJson(jsonElement, TResourceMountApplyDTO.class); - Long resourceID = resourceMountApplyDTO.getResourceDTO().getId(); -// apiGatewayService.registerApi2Gateway(String.valueOf(resourceID)); - ResourceDTO re = resourceMountApplyDTO.getResourceDTO(); if (re != null) { re.setDelFlag(0); @@ -175,11 +166,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A private void create(DelegateTask delegateTask, final SysRoleDTO roleDTO) { Map kv = delegateTask.getVariables(); GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(Date.class, new JsonDeserializer() { - public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - return new Date(json.getAsJsonPrimitive().getAsLong()); - } - }); + builder.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong())); Gson gson = builder.create(); JsonElement jsonElement = gson.toJsonTree(kv);