Commit f3d7a839 authored by wujipeng's avatar wujipeng
Browse files

优化

parent 47a35197
...@@ -3,6 +3,7 @@ package com.platform.controller; ...@@ -3,6 +3,7 @@ package com.platform.controller;
import com.platform.model.entity.CaseRuleConfigEntity; import com.platform.model.entity.CaseRuleConfigEntity;
import com.platform.model.resp.Result; import com.platform.model.resp.Result;
import com.platform.service.CaseRuleConfigService; import com.platform.service.CaseRuleConfigService;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -16,7 +17,12 @@ public class CaseRuleConfigController extends BaseController { ...@@ -16,7 +17,12 @@ public class CaseRuleConfigController extends BaseController {
@PostMapping("/saveOrUpdate") @PostMapping("/saveOrUpdate")
public Result saveOrUpdate(@RequestBody CaseRuleConfigEntity caseRuleConfigEntity) { public Result saveOrUpdate(@RequestBody CaseRuleConfigEntity caseRuleConfigEntity) {
return toAjax(caseRuleConfigService.saveOrUpdate(caseRuleConfigEntity)); if(ObjectUtils.isEmpty(caseRuleConfigEntity.getId())){
return toAjax(caseRuleConfigService.save(caseRuleConfigEntity));
}else {
caseRuleConfigService.removeById(caseRuleConfigEntity.getId());
return toAjax(caseRuleConfigService.save(caseRuleConfigEntity));
}
} }
@GetMapping("/data/{caseId}") @GetMapping("/data/{caseId}")
......
...@@ -3,6 +3,7 @@ package com.platform.model.entity; ...@@ -3,6 +3,7 @@ package com.platform.model.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -26,8 +27,10 @@ public class CaseRuleConfigEntity { ...@@ -26,8 +27,10 @@ public class CaseRuleConfigEntity {
private Integer maxTransaction; private Integer maxTransaction;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime; private Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime; private Date endTime;
private Integer principal; private Integer principal;
......
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