Commit 5dbc3051 authored by yangyang's avatar yangyang

fix(报检权限):1.统一业务状态(待提交、已提交、已完成);2.修复开通申请时间格式

parent 8115a91a
......@@ -74,6 +74,7 @@ public class JyjcOpeningApplication extends BaseEntity {
* 受理日期(接收日期)
*/
@TableField("accept_date")
@JsonFormat (pattern = "yyyy-MM-dd")
private Date acceptDate;
/**
......
......@@ -11,7 +11,10 @@ import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import java.io.IOException;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/**
......@@ -26,6 +29,8 @@ import java.util.Objects;
*/
public class BizCustomDateSerializer extends StdSerializer<Date> {
private List<String> customFields = Arrays.asList("acceptDate", "expiryDate");
public BizCustomDateSerializer()
{
super(Date.class);
......@@ -35,14 +40,23 @@ public class BizCustomDateSerializer extends StdSerializer<Date> {
public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
try {
Class<?> clazz = jgen.getCurrentValue().getClass();
Field field = clazz.getDeclaredField(jgen.getOutputContext().getCurrentName());
if (Objects.equals(field.getType(), Date.class)) {
if (field.isAnnotationPresent(JsonFormat.class)) {
String pattern = field.getAnnotation(JsonFormat.class).pattern();
if (StringUtils.isNotBlank(pattern)) {
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
jgen.writeString(formatter.format(value));
return;
if (Objects.equals(clazz, HashMap.class)) {
// 分页参数
if (customFields.contains(jgen.getOutputContext().getCurrentName())) {
SimpleDateFormat formatter = new SimpleDateFormat(DateTimeUtil.ISO_DATE);
jgen.writeString(formatter.format(value));
return;
}
} else {
Field field = clazz.getDeclaredField(jgen.getOutputContext().getCurrentName());
if (Objects.equals(field.getType(), Date.class)) {
if (field.isAnnotationPresent(JsonFormat.class)) {
String pattern = field.getAnnotation(JsonFormat.class).pattern();
if (StringUtils.isNotBlank(pattern)) {
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
jgen.writeString(formatter.format(value));
return;
}
}
}
}
......
......@@ -369,6 +369,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
*/
public void execueFlow(Map<String, Object> params) {
String role = "";
String taskName = "流程结束";
String op = params.get("op").toString();
String instanceId = params.get("instanceId").toString();
String comments = params.get("comments").toString();
......@@ -405,14 +406,18 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
jyjcOpeningApplicationMapper.updateById(jyjcOpeningApplication);
}
role = (String) nextNodeInfo.get("role");
taskName = (String) nextNodeInfo.get("taskName");
}
String taskName = "流程结束";
String status;
if ("流程结束".equals(taskName)) {
status = FlowStatusEnum.TO_BE_FINISHED.getCode() + "";
} else {
if ("1".equals(op)) {
// 如果是回退, 则业务状态改为未提交
status = "1".equals(op) ? FlowStatusEnum.TO_BE_SUBMITTED.getCode() + "" : FlowStatusEnum.SUBMITTED.getCode() + "";
status = FlowStatusEnum.TO_BE_SUBMITTED.getCode() + "";
} else {
if ("流程结束".equals(taskName)) {
status = FlowStatusEnum.TO_BE_FINISHED.getCode() + "";
} else {
status = FlowStatusEnum.SUBMITTED.getCode() + "";
}
}
updateModelByInstanceId(instanceId, status, role);
} catch (Exception e) {
......
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