Răsfoiți Sursa

fix: contract sign date

Blizzard 1 an în urmă
părinte
comite
b2f9be6d5b

+ 9 - 0
blade-service-api/wt-okr-api/src/main/java/com/wtkj/entity/TaskContract.java

@@ -2,15 +2,18 @@ package com.wtkj.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * @author Blizzard
@@ -56,4 +59,10 @@ public class TaskContract extends BaseEntity {
 	@ApiModelProperty(value = "签订年")
 	private Integer year;
 
+	@TableField("sign_date")
+	@ApiModelProperty(value = "签订日期")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	private Date signDate;
+
 }

+ 0 - 5
blade-service/wutong-okr/src/main/java/com/wtkj/controller/TaskController.java

@@ -22,7 +22,6 @@ import org.springblade.system.user.entity.User;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -191,10 +190,6 @@ public class TaskController {
 	@ApiOperationSupport(order = 13)
 	@ApiOperation(value = "新增或者修改任务合同", notes = "")
 	public R<Boolean> submitContracts(@RequestBody @Valid TaskContract contract) {
-		if (contract.getId() == null) {
-			int year = LocalDate.now().getYear();
-			contract.setYear(year);
-		}
 		return R.status(taskContractService.saveOrUpdate(contract));
 
 	}