Commit 6917afe4 by chenweisong

更新

parent d7b1a8af
...@@ -58,7 +58,7 @@ public class ExcelController { ...@@ -58,7 +58,7 @@ public class ExcelController {
@ApiOperation(value = "传excelId过来,获取用户填写的数据") @ApiOperation(value = "传excelId过来,获取用户填写的数据")
@PostMapping(value = "/excel/getData") @PostMapping(value = "/excel/getData")
public ApiResponse getRecordData(@RequestParam long excelId) { public ApiResponse getRecordData(@RequestParam long excelId) {
User curUser = userService.getNormalUser(); // User curUser = userService.getNormalUser();
// ProcessInfo processInfo = processInfoService.findByExcelIdAndUserId(excelId, curUser.getId()); // ProcessInfo processInfo = processInfoService.findByExcelIdAndUserId(excelId, curUser.getId());
// //
// List<DataInfo> dataInfoList = processInfo.getDataInfoList(); // List<DataInfo> dataInfoList = processInfo.getDataInfoList();
......
...@@ -5,7 +5,7 @@ import com.keymobile.rest.common.bean.ApiResponse; ...@@ -5,7 +5,7 @@ import com.keymobile.rest.common.bean.ApiResponse;
import com.keymobile.rest.common.validator.TwinkleValidator; import com.keymobile.rest.common.validator.TwinkleValidator;
import com.keymobile.rest.model.Activity; import com.keymobile.rest.model.Activity;
import com.keymobile.rest.model.Template; import com.keymobile.rest.model.Template;
import com.keymobile.rest.model.ProcessInfo; import com.keymobile.rest.model.Mission;
import com.keymobile.rest.model.User; import com.keymobile.rest.model.User;
import com.keymobile.rest.service.TemplateService; import com.keymobile.rest.service.TemplateService;
import com.keymobile.rest.service.ProcessInfoService; import com.keymobile.rest.service.ProcessInfoService;
...@@ -82,28 +82,28 @@ public class TaskController { ...@@ -82,28 +82,28 @@ public class TaskController {
@ApiOperation(value = "补录任务列表及审核任务列表") @ApiOperation(value = "补录任务列表及审核任务列表")
@PostMapping(value = "/getMyTasks") @PostMapping(value = "/getMyTasks")
public ApiResponse getMyTasks() { public ApiResponse getMyTasks() {
User user = userService.getNormalUser(); // User user = userService.getNormalUser();
User audit = userService.getAudit(); // User audit = userService.getAudit();
List<Activity> activityList = new ArrayList<>(); List<Activity> activityList = new ArrayList<>();
// 获取任务 // 获取任务
List<Task> tasks = taskService.createNativeTaskQuery() // List<Task> tasks = taskService.createNativeTaskQuery()
.sql("SELECT * FROM " + managementService.getTableName(Task.class) + " T WHERE T.ASSIGNEE_ = #{assignee1} OR T.ASSIGNEE_ = #{assignee2}") // .sql("SELECT * FROM " + managementService.getTableName(Task.class) + " T WHERE T.ASSIGNEE_ = #{assignee1} OR T.ASSIGNEE_ = #{assignee2}")
.parameter("assignee1", user.getUsername()).parameter("assignee2", audit.getUsername()) // .parameter("assignee1", user.getUsername()).parameter("assignee2", audit.getUsername())
.list(); // .list();
for (Task task : tasks) { // for (Task task : tasks) {
String processId = task.getProcessInstanceId(); // String processId = task.getProcessInstanceId();
Activity activity = assignmentService.findByProcessId(processId); // Activity activity = assignmentService.findByProcessId(processId);
// if (assignment != null && assignment.getStatus() != Assignment.STATUS_COMPLETED) { // if (assignment != null && assignment.getStatus() != Assignment.STATUS_COMPLETED) {
if (task.getTaskDefinitionKey().equals("addData")) { // if (task.getTaskDefinitionKey().equals("addData")) {
// assignment.setKind(Assignment.KIND_RECORD); // assignment.setKind(Assignment.KIND_RECORD);
} else { // } else {
// assignment.setKind(Assignment.KIND_AUDIT); // assignment.setKind(Assignment.KIND_AUDIT);
} // }
activityList.add(activity); // activityList.add(activity);
// } // }
} // }
return ApiResponse.ok(); return ApiResponse.ok();
} }
...@@ -115,8 +115,8 @@ public class TaskController { ...@@ -115,8 +115,8 @@ public class TaskController {
TwinkleValidator.notNull(form.getType(), "类型不能为空"); TwinkleValidator.notNull(form.getType(), "类型不能为空");
TwinkleValidator.isFalse((form.getExcels() == null || form.getExcels().size() == 0), "补录模板不能为空"); TwinkleValidator.isFalse((form.getExcels() == null || form.getExcels().size() == 0), "补录模板不能为空");
// 创建人 // 创建人
User manager = userService.getManager(); // User manager = userService.getManager();
form.setUser(manager); // form.setUser(manager);
Activity activity = assignmentService.save(form); Activity activity = assignmentService.save(form);
// 新建excel实例 // 新建excel实例
List<ExcelForm> excelFormList = form.getExcels(); List<ExcelForm> excelFormList = form.getExcels();
...@@ -196,9 +196,9 @@ public class TaskController { ...@@ -196,9 +196,9 @@ public class TaskController {
TwinkleValidator.notLessThan(templateList.size(), 1, "补录模板不存在"); TwinkleValidator.notLessThan(templateList.size(), 1, "补录模板不存在");
Template template = templateList.get(0); Template template = templateList.get(0);
List<ProcessInfo> processInfoList = processInfoService.findAllByTemplateId(template.getId()); List<Mission> missionList = processInfoService.findAllByTemplateId(template.getId());
TwinkleValidator.notLessThan(processInfoList.size(), 1, "补录人员不存在"); TwinkleValidator.notLessThan(missionList.size(), 1, "补录人员不存在");
taskService.complete(resultTask.getId(), ImmutableMap.of("userId", processInfoList.get(0).getUser().getUsername())); taskService.complete(resultTask.getId(), ImmutableMap.of("userId", missionList.get(0).getUser().getUsername()));
return ApiResponse.ok(); return ApiResponse.ok();
} }
...@@ -208,7 +208,7 @@ public class TaskController { ...@@ -208,7 +208,7 @@ public class TaskController {
public ApiResponse passTask(@RequestParam Long taskId) { public ApiResponse passTask(@RequestParam Long taskId) {
Activity activity = assignmentService.get(taskId); Activity activity = assignmentService.get(taskId);
// 完结活动, 流程跑完 // 完结活动, 流程跑完
User judge = userService.getAudit(); // User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId()) // List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list(); // .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败"); // TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
...@@ -225,7 +225,7 @@ public class TaskController { ...@@ -225,7 +225,7 @@ public class TaskController {
public ApiResponse rejectTask(@RequestParam Long taskId) { public ApiResponse rejectTask(@RequestParam Long taskId) {
Activity activity = assignmentService.get(taskId); Activity activity = assignmentService.get(taskId);
// 完结活动, 流程跑完 // 完结活动, 流程跑完
User judge = userService.getAudit(); // User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId()) // List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list(); // .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败"); // TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
......
...@@ -16,9 +16,18 @@ import java.util.*; ...@@ -16,9 +16,18 @@ import java.util.*;
public class UserController { public class UserController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private GroupService groupService;
private Group root = new Group();
@ApiOperation(value = "获取补录人员列表") {
root.setId(0L);
root.setName("招商银行");
}
@ApiOperation(value = "获取补录范围列表")
@PostMapping(value = "/user/list") @PostMapping(value = "/user/list")
public ApiResponse getUserList() { public ApiResponse getUserList() {
// List<User> userList = userService.findAllByRole(UserConstant.ROLE_NORMAL); // List<User> userList = userService.findAllByRole(UserConstant.ROLE_NORMAL);
...@@ -26,4 +35,17 @@ public class UserController { ...@@ -26,4 +35,17 @@ public class UserController {
} }
@ApiOperation(value = "获取机构数据")
@PostMapping(value = "/group/list")
public ApiResponse getGroupList() {
return ApiResponse.ok(getGroupTree());
}
public Group getGroupTree() {
List<Group> children = groupService.findAllByParentId(root.getId());
root.setChildren(children);
return root;
}
} }
package com.keymobile.rest.dao;
import com.keymobile.rest.model.Group;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface GroupDao extends JpaRepository<Group, Long> {
List<Group> findAllByParentId(long parentId);
}
package com.keymobile.rest.dao; package com.keymobile.rest.dao;
import com.keymobile.rest.model.ProcessInfo; import com.keymobile.rest.model.Mission;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List; import java.util.List;
public interface ProcessInfoDao extends JpaRepository<ProcessInfo, Long> { public interface ProcessInfoDao extends JpaRepository<Mission, Long> {
List<ProcessInfo> findAllByTemplateId(long eid); List<Mission> findAllByTemplateId(long eid);
List<ProcessInfo> findAllByUserId(long uid); List<Mission> findAllByUserId(long uid);
void deleteAllByTemplateId(long eid); void deleteAllByTemplateId(long eid);
ProcessInfo findByTemplateIdAndUserId(long eid, long uid); Mission findByTemplateIdAndUserId(long eid, long uid);
} }
...@@ -7,8 +7,6 @@ import java.util.List; ...@@ -7,8 +7,6 @@ import java.util.List;
public interface UserDao extends JpaRepository<User, Long> { public interface UserDao extends JpaRepository<User, Long> {
List<User> findAllByRole(int role);
List<User> findAllByIdIn(List<Long> ids); List<User> findAllByIdIn(List<Long> ids);
} }
package com.keymobile.rest.model; package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -19,14 +20,12 @@ import java.util.List; ...@@ -19,14 +20,12 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_activity")
public class Activity implements Serializable { public class Activity implements Serializable {
public static int TYPE_AUTO = 2; public static int TYPE_AUTO = 2;
public static int TYPE_MANUAL = 1; public static int TYPE_MANUAL = 1;
public static int NEED_AUDIT = 1;
public static int NO_NEED_AUDIT = 2;
// 报送频度 按年 按年 按周 按月 按日 自动推送 // 报送频度 按年 按年 按周 按月 按日 自动推送
public static int FREQ_YEAR = 1; public static int FREQ_YEAR = 1;
public static int FREQ_WEEK = 2; public static int FREQ_WEEK = 2;
...@@ -37,22 +36,16 @@ public class Activity implements Serializable { ...@@ -37,22 +36,16 @@ public class Activity implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("varchar(100) comment '活动名'"))
private String name; private String name;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("integer(2) default 1 comment '下发方式'"))
private int type; private int type;
@Column(nullable = false) @Column(columnDefinition = ("varchar(200) comment '备注'"))
private int needAudit;
@Column
private String remark; private String remark;
/* @Column(columnDefinition = ("integer(2) comment '频度'"))
频度
*/
@Column
private int freq; private int freq;
@Column(nullable = false, name = "create_at") @Column(nullable = false, name = "create_at")
...@@ -67,4 +60,12 @@ public class Activity implements Serializable { ...@@ -67,4 +60,12 @@ public class Activity implements Serializable {
*/ */
@ManyToOne @ManyToOne
private User user; private User user;
/*
* 该活动跑过得所有流程
*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = "activity")
@JsonIgnore
private List<Process> processList;
} }
...@@ -17,20 +17,21 @@ import java.sql.Timestamp; ...@@ -17,20 +17,21 @@ import java.sql.Timestamp;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_data_info")
public class DataInfo implements Serializable { public class DataInfo implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("varchar(3000) comment '填写的数据'"))
private String datas; private String data;
@Column(name = "create_at", nullable = false) @Column(nullable = false, name = "create_at")
@CreationTimestamp @CreationTimestamp
private Timestamp createAt; private Timestamp createAt;
@ManyToOne(fetch = FetchType.LAZY) @OneToOne(fetch = FetchType.LAZY)
@JsonIgnore @JsonIgnore
private ProcessInfo processInfo; private Mission mission;
} }
...@@ -6,26 +6,32 @@ import lombok.NoArgsConstructor; ...@@ -6,26 +6,32 @@ import lombok.NoArgsConstructor;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @name 机构 * @name 机构
* @desc 包含一些活动的定义以及绑定一些spreadJs生成的excel模板 * @desc
*/ */
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}) @JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_group")
public class Group implements Serializable { public class Group implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(nullable = false, columnDefinition = ("varchar(20) comment '机构名称'"))
@Column
private String name; private String name;
@Column(nullable = false, columnDefinition = ("integer(2) default 0 comment '机构层级'"))
private int level;
@Column(name = "parent_id", columnDefinition = ("bigint(22) default 0 comment '父机构id'"))
private long parentId;
@Column @Transient
private long pid; private List<Group> children;
} }
package com.keymobile.rest.model; package com.keymobile.rest.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -17,16 +18,31 @@ import java.util.List; ...@@ -17,16 +18,31 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
public class ProcessInfo implements Serializable { @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 @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(name = "create_at", nullable = false, columnDefinition = "DATETIME COMMENT '创建时间'") @Column(name = "create_at", nullable = false, columnDefinition = ("DATETIME COMMENT '创建时间'"))
@CreationTimestamp @CreationTimestamp
private Timestamp createAt; private Timestamp createAt;
@Column(nullable = false, columnDefinition = ("integer(2) default 1 COMMENT '类型'"))
private int type;
@Column(nullable = false, columnDefinition = ("integer(2) default 1 COMMENT '状态'"))
private int status;
/* /*
补录模板 补录模板
*/ */
...@@ -34,7 +50,7 @@ public class ProcessInfo implements Serializable { ...@@ -34,7 +50,7 @@ public class ProcessInfo implements Serializable {
private Template template; private Template template;
/* /*
补录人员 操作人员
*/ */
@OneToOne @OneToOne
private User user; private User user;
...@@ -42,7 +58,13 @@ public class ProcessInfo implements Serializable { ...@@ -42,7 +58,13 @@ public class ProcessInfo implements Serializable {
/* /*
补录数据 补录数据
*/ */
@OneToMany(mappedBy = "processInfo", fetch = FetchType.EAGER) @OneToOne(fetch = FetchType.EAGER)
List<DataInfo> dataInfoList; private DataInfo dataInfo;
/*
补录数据
*/
@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore
private Process process;
} }
...@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; ...@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @name 进程 * @name 进程
...@@ -17,8 +18,14 @@ import java.io.Serializable; ...@@ -17,8 +18,14 @@ import java.io.Serializable;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_process")
public class Process implements Serializable { public class Process implements Serializable {
public static int STATUS_BEGIN = 0;
public static int STATUS_RECORDING = 1;
public static int STATUS_AUDIT = 2;
public static int STATUS_COMPLETED = 3;
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
...@@ -26,9 +33,19 @@ public class Process implements Serializable { ...@@ -26,9 +33,19 @@ public class Process implements Serializable {
/* /*
activiti运行中的流程实例id activiti运行中的流程实例id
*/ */
@Column(name = "process_id") @Column(name = "process_id", columnDefinition = ("varchar(100) comment '当前活动在跑进程 id'"))
private String processId; private String processId;
@Column(nullable = false, columnDefinition = ("integer(2) default 0 comment '进程状态'"))
private int status;
/*
* 该进程启动得所有子任务
*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = "process")
@JsonIgnore
private List<Mission> missionList;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JsonIgnore @JsonIgnore
private Activity activity; private Activity activity;
......
...@@ -17,22 +17,48 @@ import java.sql.Timestamp; ...@@ -17,22 +17,48 @@ import java.sql.Timestamp;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_template")
public class Template implements Serializable { public class Template implements Serializable {
public static int NEED_AUDIT = 1;
public static int NO_NEED_AUDIT = 2;
public static int NEED_CONFIRM = 1;
public static int NO_NEED_CONFIRM = 2;
public static int NEED_MERGE = 1;
public static int NO_NEED_MERGE = 2;
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("varchar(20) comment '模板名称'"))
private String name; private String name;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("varchar(2000) comment '模板配置'"))
private String config; private String config;
@Column(nullable = false, name = "data_at") @Column(name = "data_at", columnDefinition = ("integer(20) default 1 comment '数据开始行数'"))
private Integer dataAt; private int dataAt;
@Column(name = "need_audit", columnDefinition = ("integer(2) default 0 comment '需要审核'"))
private int needAudit;
@Column(name = "need_confirm", columnDefinition = ("integer(2) default 0 comment '需要负责人确认'"))
private int needConfirm;
@Column(name = "need_merge", columnDefinition = ("integer(2) default 0 comment '需要数据合并'"))
private int needMerge;
@Column(name = "up_stream_addr", columnDefinition = ("varchar(100) comment '上游地址'"))
private int upStreamAddr;
@Column(name = "back_stream_addr", columnDefinition = ("varchar(100) comment '回流地址'"))
private int backStreamAddr;
@Column @Column(columnDefinition = ("varchar(200) comment '备注'"))
private String remark; private String remark;
@Column(nullable = false, name = "create_at") @Column(nullable = false, name = "create_at")
......
...@@ -11,25 +11,22 @@ import java.io.Serializable; ...@@ -11,25 +11,22 @@ import java.io.Serializable;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Entity @Entity
@Table(name = "t_user")
public class User implements Serializable { public class User implements Serializable {
public static int ROLE_NORMAL = 1; public static int ROLE_NORMAL = 1;
public static int ROLE_AUDIT = 2; public static int ROLE_AUDIT = 2;
public static int ROLE_MANAGER = 3;
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(nullable = false) @Column(nullable = false, columnDefinition = ("varchar(100) comment '用户名'"))
private String username; private String username;
/** /**
* 1 补录人员 2 审核人员 3 发起人 * 所属结构id
*/ */
@Column @ManyToOne(fetch = FetchType.EAGER)
private int role; private Group group;
} }
...@@ -35,7 +35,6 @@ public class AssignmentService { ...@@ -35,7 +35,6 @@ public class AssignmentService {
Activity activity = new Activity(); Activity activity = new Activity();
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime()); Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
activity.setCreateAt(now); activity.setCreateAt(now);
activity.setNeedAudit(Activity.NEED_AUDIT);
activity.setName(form.getName()); activity.setName(form.getName());
activity.setType(form.getType()); activity.setType(form.getType());
if (form.getType() == Activity.TYPE_AUTO) { if (form.getType() == Activity.TYPE_AUTO) {
......
...@@ -21,8 +21,7 @@ public class DataInfoService { ...@@ -21,8 +21,7 @@ public class DataInfoService {
public DataInfo save(RecordDataForm form) { public DataInfo save(RecordDataForm form) {
DataInfo data = new DataInfo(); DataInfo data = new DataInfo();
data.setDatas(form.getDataStr()); data.setMission(form.getMission());
data.setProcessInfo(form.getProcessInfo());
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime()); Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
data.setCreateAt(now); data.setCreateAt(now);
data = dataInfoDao.save(data); data = dataInfoDao.save(data);
......
package com.keymobile.rest.service;
import com.keymobile.rest.dao.GroupDao;
import com.keymobile.rest.model.Group;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class GroupService {
@Autowired
private GroupDao groupDao;
public List<Group> findAllByParentId(long parentId) {
return groupDao.findAllByParentId(parentId);
}
}
...@@ -3,7 +3,7 @@ package com.keymobile.rest.service; ...@@ -3,7 +3,7 @@ package com.keymobile.rest.service;
import com.keymobile.rest.common.utils.DateUtil; import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.dao.*; import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.Template; import com.keymobile.rest.model.Template;
import com.keymobile.rest.model.ProcessInfo; import com.keymobile.rest.model.Mission;
import com.keymobile.rest.model.User; import com.keymobile.rest.model.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -17,8 +17,8 @@ public class ProcessInfoService { ...@@ -17,8 +17,8 @@ public class ProcessInfoService {
@Autowired @Autowired
private ProcessInfoDao processInfoDao; private ProcessInfoDao processInfoDao;
public ProcessInfo save(User user, Template template) { public Mission save(User user, Template template) {
ProcessInfo info = new ProcessInfo(); Mission info = new Mission();
info.setTemplate(template); info.setTemplate(template);
info.setUser(user); info.setUser(user);
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime()); Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
...@@ -27,15 +27,15 @@ public class ProcessInfoService { ...@@ -27,15 +27,15 @@ public class ProcessInfoService {
return info; return info;
} }
public List<ProcessInfo> findAllByTemplateId(long eid) { public List<Mission> findAllByTemplateId(long eid) {
return processInfoDao.findAllByTemplateId(eid); return processInfoDao.findAllByTemplateId(eid);
} }
public ProcessInfo findByTemplateIdAndUserId(long eid, long uid) { public Mission findByTemplateIdAndUserId(long eid, long uid) {
return processInfoDao.findByTemplateIdAndUserId(eid, uid); return processInfoDao.findByTemplateIdAndUserId(eid, uid);
} }
public List<ProcessInfo> findByUserId(long uid) { public List<Mission> findByUserId(long uid) {
return processInfoDao.findAllByUserId(uid); return processInfoDao.findAllByUserId(uid);
} }
......
...@@ -17,27 +17,4 @@ public class UserService { ...@@ -17,27 +17,4 @@ public class UserService {
return userDao.findAllByIdIn(ids); return userDao.findAllByIdIn(ids);
} }
public List<User> findAllByRole(int role) {
return userDao.findAllByRole(role);
}
public User getAudit() {
List<User> userList = userDao.findAllByRole(User.ROLE_AUDIT);
User user = userList.get(0);
return user;
}
public User getNormalUser() {
List<User> userList = userDao.findAllByRole(User.ROLE_NORMAL);
User user = userList.get(0);
return user;
}
public User getManager() {
List<User> userList = userDao.findAllByRole(User.ROLE_MANAGER);
User user = userList.get(0);
return user;
}
} }
package com.keymobile.rest.vo; package com.keymobile.rest.vo;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.keymobile.rest.model.ProcessInfo; import com.keymobile.rest.model.Mission;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -27,7 +27,7 @@ public class RecordDataForm { ...@@ -27,7 +27,7 @@ public class RecordDataForm {
private List<Object> dataList; private List<Object> dataList;
@JsonIgnore @JsonIgnore
private ProcessInfo processInfo; private Mission mission;
} }
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