Commit 312d8463 by chenweisong

更新

parent 816140a4
...@@ -40,7 +40,6 @@ public class ExcelController { ...@@ -40,7 +40,6 @@ public class ExcelController {
@Autowired @Autowired
private RuntimeService runtimeService; private RuntimeService runtimeService;
@ApiOperation(value = "当前补录任务填写补录") @ApiOperation(value = "当前补录任务填写补录")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskId", required = true, value = "补录任务id", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "taskId", required = true, value = "补录任务id", dataType = "string", paramType = "query"),
...@@ -64,7 +63,6 @@ public class ExcelController { ...@@ -64,7 +63,6 @@ public class ExcelController {
DataInfo dataInfo = new DataInfo(); DataInfo dataInfo = new DataInfo();
dataInfo.setCreateAt(DateUtil.getTimestamp()); dataInfo.setCreateAt(DateUtil.getTimestamp());
dataInfo.setTemplate(template); dataInfo.setTemplate(template);
dataInfo.setTaskId(taskId);
dataInfo.setUserId(user.getId()); dataInfo.setUserId(user.getId());
dataInfo.setProcess(process); dataInfo.setProcess(process);
dataInfo.setData(dataStr); dataInfo.setData(dataStr);
...@@ -108,17 +106,19 @@ public class ExcelController { ...@@ -108,17 +106,19 @@ public class ExcelController {
} }
} }
taskService.complete(task.getId(), vars); taskService.complete(task.getId(), vars);
return "成功"; return "成功";
} }
@ApiOperation(value = "传excelId过来,获取用户填写的数据") @ApiOperation(value = "传excelId过来,获取用户填写的数据")
@ApiImplicitParams( @ApiImplicitParams({
@ApiImplicitParam(name = "excelId", required = true, value = "当前模板id", dataType = "long", paramType = "query") @ApiImplicitParam(name = "excelId", required = true, value = "当前模板id", dataType = "long", paramType = "path"),
) @ApiImplicitParam(name = "processId", required = true, value = "当前任务的processId", dataType = "string", paramType = "query")
})
@GetMapping(value = "/excel/getData/{excelId}") @GetMapping(value = "/excel/getData/{excelId}")
public Object getRecordData(@PathVariable long excelId) { public Object getRecordData(String processId, @PathVariable long excelId) {
return "成功"; DataInfo info = dataInfoService.findByProcessProcessIdAndTemplateId(processId, excelId);
CommonValidator.notNull(info, "数据不存在");
return info;
} }
} }
...@@ -5,4 +5,6 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -5,4 +5,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
public interface DataInfoDao extends JpaRepository<DataInfo, Long> { public interface DataInfoDao extends JpaRepository<DataInfo, Long> {
DataInfo findByProcessProcessIdAndTemplateId(String processId, long templateId);
} }
...@@ -74,11 +74,4 @@ public class Activity implements Serializable { ...@@ -74,11 +74,4 @@ public class Activity implements Serializable {
@OneToMany(fetch = FetchType.LAZY, mappedBy = "activity") @OneToMany(fetch = FetchType.LAZY, mappedBy = "activity")
@JsonIgnore @JsonIgnore
private List<Process> processList; private List<Process> processList;
/**
* 该活动跑过得所有任务
*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = "activity")
@JsonIgnore
private List<Mission> missionList;
} }
package com.keymobile.rest.model; package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
...@@ -23,15 +24,14 @@ public class DataInfo implements Serializable { ...@@ -23,15 +24,14 @@ public class DataInfo implements Serializable {
private String data; private String data;
@Column(nullable = false, name = "create_at") @Column(nullable = false, name = "create_at")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Timestamp createAt; private Timestamp createAt;
@Column(nullable = false, columnDefinition = ("bigint(22) comment '补录人员id'")) @Column(nullable = false, columnDefinition = ("bigint(22) comment '补录人员id'"))
private Long userId; private Long userId;
@Column(nullable = false, columnDefinition = ("bigint(22) comment 'task id'"))
private String taskId;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private Process process; private Process process;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
......
package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* 任务流水
*/
@Data
@Entity
@Table(name = "t_mission")
public class Mission implements Serializable {
public static int TYPE_RECORD = 1;
public static int TYPE_AUDIT = 2;
public static int STATUS_BEGIN = 1;
public static int STATUS_COMPLETED = 2;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(name = "create_at", nullable = false, columnDefinition = ("DATETIME COMMENT '创建时间'"))
private Timestamp createAt;
@Column(nullable = false, columnDefinition = ("integer(2) default 1 COMMENT '类型'"))
private int type;
@Column(columnDefinition = ("varchar(20) COMMENT '当前activiti任务id'"))
private String taskId;
/**
* 操作人员id
*/
@Column(columnDefinition = ("bigint(20) COMMENT '当前用户id'"))
private long userId;
@Column(nullable = false, columnDefinition = ("integer(2) default 1 COMMENT '状态'"))
private int status;
/**
* 补录模板
*/
@OneToOne
private Template template;
/**
* 补录数据
*/
@OneToOne(fetch = FetchType.EAGER)
private DataInfo dataInfo;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private Process process;
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private Activity activity;
}
...@@ -37,7 +37,7 @@ public class Process implements Serializable { ...@@ -37,7 +37,7 @@ public class Process implements Serializable {
*/ */
@OneToMany(fetch = FetchType.LAZY, mappedBy = "process") @OneToMany(fetch = FetchType.LAZY, mappedBy = "process")
@JsonIgnore @JsonIgnore
private List<Mission> missionList; private List<DataInfo> dataInfoList;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore @JsonIgnore
......
...@@ -12,12 +12,12 @@ public class DataInfoService { ...@@ -12,12 +12,12 @@ public class DataInfoService {
@Autowired @Autowired
private DataInfoDao dataInfoDao; private DataInfoDao dataInfoDao;
public DataInfo findById(long id) {
return dataInfoDao.findById(id).get();
}
public DataInfo save(DataInfo dataInfo) { public DataInfo save(DataInfo dataInfo) {
dataInfoDao.save(dataInfo); dataInfoDao.save(dataInfo);
return dataInfo; return dataInfo;
} }
public DataInfo findByProcessProcessIdAndTemplateId(String processId, long templateId) {
return dataInfoDao.findByProcessProcessIdAndTemplateId(processId, templateId);
}
} }
...@@ -11,7 +11,6 @@ import org.activiti.engine.runtime.ProcessInstance; ...@@ -11,7 +11,6 @@ import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.IdentityLink; import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.Task; import org.activiti.engine.task.Task;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment