资源上架 申请功能
This commit is contained in:
parent
4c23160773
commit
f059f2b76a
|
@ -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<String, Object> 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()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<String> parameterContent;
|
||||
@ApiModelProperty(value = "参数内容 md5 <后端生成>")
|
||||
private String parameterContentMd5;
|
||||
@ApiModelProperty(value = "创建该条申请的时间")
|
||||
private Date createtime;
|
||||
@ApiModelProperty(value = "资源信息的信息")
|
||||
private List<ResourceDTO> resourceDTO;
|
||||
|
||||
public TResourceBatchMountApplyDTO() {
|
||||
this.createtime = new Date();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -30,6 +30,6 @@ public class TResourceMountApplyServiceImpl extends CrudServiceImpl<TResourceMou
|
|||
|
||||
@Override
|
||||
public void updateInstanceId(String instanceId, Long id) {
|
||||
|
||||
baseDao.updateInstanceId(instanceId, id);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue