Commit 4ca3813a by chenweisong

更新

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