Commit 4ca3813a by chenweisong

更新

parent 258d106c
......@@ -172,6 +172,8 @@ public class IndexCtrl {
.taskAssignee(judge.getUsername()).list();
Task task = taskList.get(0);
taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
job.setStatus(Job.STATUS_COMPLETED);
jobService.update(job);
return ApiResponse.ok();
}
......@@ -196,7 +198,6 @@ public class IndexCtrl {
// return ApiResponse.ok();
// }
@ApiOperation(value = "获取补录人员列表")
@PostMapping(value = "/user/list")
public ApiResponse getUserList() {
......@@ -207,7 +208,12 @@ public class IndexCtrl {
@ApiOperation(value = "填写补录数据")
@PostMapping(value = "/excel/saveData")
public ApiResponse saveRecordData(@RequestBody RecordDataForm form) {
RecordData recordData = recordDataService.save(form);
RecordData recordData;
if (form.getDataId() != null) {
recordData = recordDataService.update(form);
} else {
recordData = recordDataService.save(form);
}
List<User> userList = userService.findAllByRole(User.ROLE_NORMAL);
User curUser = userList.get(0);
Excel excel = excelService.get(form.getExcelId());
......
......@@ -30,7 +30,7 @@ public class Excel implements Serializable {
private String config;
@Column
private String desc;
private String remark;
@Column(nullable = false, name = "create_at")
@CreationTimestamp
......
package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.Excel;
import com.keymobile.rest.vo.ExcelForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.List;
@Service
......@@ -17,8 +19,10 @@ public class ExcelService {
public Excel save(ExcelForm form) {
Excel excel = new Excel();
excel.setConfig(form.getConfig());
excel.setDesc(form.getDesc());
excel.setRemark(form.getRemark());
excel.setJob(form.getJob());
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
excel.setCreateAt(now);
excel = excelDao.save(excel);
return excel;
}
......
......@@ -23,6 +23,10 @@ public class JobService {
return jobDao.getOne(id);
}
public Job update(Job job) {
return jobDao.save(job);
}
public Job save(JobForm form) {
Job job = new Job();
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
......
package com.keymobile.rest.service;
import com.keymobile.activiti.utils.DateUtil;
import com.keymobile.rest.dao.*;
import com.keymobile.rest.model.RecordData;
import com.keymobile.rest.vo.RecordDataForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
@Service
public class RecordDataService {
@Autowired
private RecordDataDao recordDataDao;
public RecordData get(long id) {
return recordDataDao.getOne(id);
}
public RecordData save(RecordDataForm form) {
RecordData data = new RecordData();
Timestamp now = Timestamp.valueOf(DateUtil.getDateTime());
data.setCreateAt(now);
data = recordDataDao.save(data);
return data;
}
public RecordData update(RecordDataForm form) {
RecordData data = this.get(form.getDataId());
data = recordDataDao.save(data);
return data;
}
......
......@@ -19,8 +19,8 @@ public class ExcelForm {
@ApiModelProperty(name = "config", value = "表格配置", required = true)
private String config;
@ApiModelProperty(name = "desc", value = "表格描述")
private String desc;
@ApiModelProperty(name = "remark", value = "表格描述")
private String remark;
@JsonIgnore
private Job job;
......
......@@ -16,7 +16,7 @@ public class JobForm {
private String name;
@ApiModelProperty(required = true, name = "type", value = "收数类型 1手动 2自动")
private int type;
private int type = 1;
@ApiModelProperty(name = "startAt", value = "自动发起需要提写的时间")
private String startAt;
......
......@@ -10,9 +10,14 @@ import java.util.List;
@ApiModel
public class RecordDataForm {
@ApiModelProperty(name = "dataId", value = "修改数据记录时回填")
private Long dataId;
@ApiModelProperty(required = true, name = "excelId", value = "当前模板id")
private long excelId;
@ApiModelProperty(required = true, name = "dataList", value = "当前数据数组")
private List<Object> dataList;
}
......@@ -13,12 +13,12 @@
<sequenceFlow id="_11" sourceRef="JudgeData" targetRef="JudgeGateway"/>
<sequenceFlow id="_12" sourceRef="JudgeGateway" targetRef="RecordEndEvent">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${pass = true}]]>
<![CDATA[${pass == 'true'}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_13" sourceRef="JudgeGateway" targetRef="addData">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${pass = false}]]>
<![CDATA[${pass == 'false'}]]>
</conditionExpression>
</sequenceFlow>
</process>
......
......@@ -11,8 +11,8 @@ spring:
jpa:
show-sql: true
database-platform: org.hibernate.dialect.MySQL5Dialect
# hibernate:
# ddl-auto: update
# hibernate:
# ddl-auto: update
datasource:
url: jdbc:mysql://47.105.193.165:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username: root
......@@ -52,8 +52,8 @@ app:
active-process: RecordStandardProcess.bpmn
swagger2:
host: localhost:8110
# host: 47.105.236.43/activiti
# host: localhost:8110
host: 47.105.236.43/activiti
......
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