培训计划相关接口调整

master
徐杰盟 2024-09-25 16:25:05 +08:00
parent f38fb5d9ae
commit b10f5db41a
7 changed files with 26 additions and 11 deletions

View File

@ -60,7 +60,7 @@ public class PersonnelPlanController extends AbstractCommonFileController{
throw new IllegalArgumentException("当前培训主题培训班名称重复"); throw new IllegalArgumentException("当前培训主题培训班名称重复");
} }
if (dto.getStm().compareTo(dto.getEtm()) >= 0){ if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) > 0){
throw new IllegalArgumentException("开始时间不能大于结束时间"); throw new IllegalArgumentException("开始时间不能大于结束时间");
} }
@ -85,7 +85,7 @@ public class PersonnelPlanController extends AbstractCommonFileController{
throw new IllegalArgumentException("当前培训主题培训班名称重复"); throw new IllegalArgumentException("当前培训主题培训班名称重复");
} }
if (dto.getStm().compareTo(dto.getEtm()) >= 0){ if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) > 0){
throw new IllegalArgumentException("开始时间不能大于结束时间"); throw new IllegalArgumentException("开始时间不能大于结束时间");
} }

View File

@ -58,7 +58,7 @@ public class PersonnelPlanLogController extends AbstractCommonFileController{
@PostMapping("/insert") @PostMapping("/insert")
public R<PersonnelPlanLog> insert(@Validated(Insert.class) @RequestBody PersonnelPlanLog dto) { public R<PersonnelPlanLog> insert(@Validated(Insert.class) @RequestBody PersonnelPlanLog dto) {
if (dto.getStm().compareTo(dto.getEtm()) >= 0) { if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) >= 0){
throw new IllegalArgumentException("开始时间不能大于结束时间"); throw new IllegalArgumentException("开始时间不能大于结束时间");
} }
@ -86,7 +86,8 @@ public class PersonnelPlanLogController extends AbstractCommonFileController{
@Operation(summary = "修改") @Operation(summary = "修改")
@PostMapping("/update") @PostMapping("/update")
public R<PersonnelPlanLog> update(@Validated(Update.class) @RequestBody PersonnelPlanLog dto) { public R<PersonnelPlanLog> update(@Validated(Update.class) @RequestBody PersonnelPlanLog dto) {
if (dto.getStm().compareTo(dto.getEtm()) >= 0) {
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) >= 0){
throw new IllegalArgumentException("开始时间不能大于结束时间"); throw new IllegalArgumentException("开始时间不能大于结束时间");
} }
@ -251,6 +252,11 @@ public class PersonnelPlanLogController extends AbstractCommonFileController{
query.eq(PersonnelPlanLog::getType, type); query.eq(PersonnelPlanLog::getType, type);
} }
Long planId = page.getPlanId();
if (Objects.nonNull(planId)) {
query.eq(PersonnelPlanLog::getPlanId, planId);
}
String trainees = page.getTrainees(); String trainees = page.getTrainees();
if (StringUtils.isNotBlank(trainees)) { if (StringUtils.isNotBlank(trainees)) {
query.like(PersonnelPlanLog::getName, trainees); query.like(PersonnelPlanLog::getName, trainees);

View File

@ -39,6 +39,12 @@ public class PersonnelPlanLogPage extends GenericPageParams {
@Schema(description="主办单位") @Schema(description="主办单位")
private String unit; private String unit;
/**
*
*/
@Schema(description="培训计划id")
private Long planId;
/** /**
* *
*/ */

View File

@ -1,5 +1,6 @@
package com.gunshi.project.xyt.model; package com.gunshi.project.xyt.model;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@ -26,7 +27,7 @@ public class CommCreate {
/** /**
* Id * Id
*/ */
@TableField(value="create_by") @TableField(value="create_by" ,updateStrategy = FieldStrategy.NOT_NULL)
@Schema(description="填报人Id") @Schema(description="填报人Id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long createBy; private Long createBy;
@ -34,7 +35,7 @@ public class CommCreate {
/** /**
* *
*/ */
@TableField(value="create_name") @TableField(value="create_name" ,updateStrategy = FieldStrategy.NOT_NULL)
@Schema(description="填报人名字") @Schema(description="填报人名字")
@Size(max = 30,message = "填报人名字最大长度要小于 30") @Size(max = 30,message = "填报人名字最大长度要小于 30")
private String createName; private String createName;
@ -43,7 +44,7 @@ public class CommCreate {
* *
*/ */
@Schema(description="填报时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS) @Schema(description="填报时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
@TableField(value="create_time") @TableField(value="create_time" ,updateStrategy = FieldStrategy.NOT_NULL)
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8") @JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date createTime; private Date createTime;

View File

@ -1,5 +1,6 @@
package com.gunshi.project.xyt.model; package com.gunshi.project.xyt.model;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@ -28,7 +29,7 @@ public class CommUpdate extends CommCreate{
/** /**
* Id * Id
*/ */
@TableField(value="update_by") @TableField(value="update_by" ,updateStrategy = FieldStrategy.NOT_NULL)
@Schema(description="更新人Id") @Schema(description="更新人Id")
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long updateBy; private Long updateBy;
@ -36,7 +37,7 @@ public class CommUpdate extends CommCreate{
/** /**
* *
*/ */
@TableField(value="update_name") @TableField(value="update_name" ,updateStrategy = FieldStrategy.NOT_NULL)
@Schema(description="更新人名字") @Schema(description="更新人名字")
@Size(max = 30,message = "更新人名字最大长度要小于 30") @Size(max = 30,message = "更新人名字最大长度要小于 30")
private String updateName; private String updateName;
@ -45,7 +46,7 @@ public class CommUpdate extends CommCreate{
* *
*/ */
@Schema(description="更新时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS) @Schema(description="更新时间 格式:" + DateFormatString.YYYY_MM_DD_HH_MM_SS)
@TableField(value="update_time") @TableField(value="update_time" ,updateStrategy = FieldStrategy.NOT_NULL)
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8") @JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date updateTime; private Date updateTime;

View File

@ -163,6 +163,7 @@ public class PersonnelPlanLog extends CommUpdate implements Serializable {
*/ */
@Schema(description="登记日期") @Schema(description="登记日期")
@TableField(value="reg_date") @TableField(value="reg_date")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
private Date regDate; private Date regDate;
@TableField(exist = false) @TableField(exist = false)

View File

@ -151,7 +151,7 @@ public class SzCase extends CommUpdate implements Serializable {
*/ */
@TableField(value="party_type") @TableField(value="party_type")
@Schema(description="当事人类型 0:自然人,1:法人或其他组织,2:待定") @Schema(description="当事人类型 0:自然人,1:法人或其他组织,2:待定")
@NotBlank(message = "当事人类型不能为空",groups = {Insert.class, Update.class}) @NotNull(message = "当事人类型不能为空",groups = {Insert.class, Update.class})
@Size(max = 1,message = "当事人类型最大长度要小于 2") @Size(max = 1,message = "当事人类型最大长度要小于 2")
private Integer partyType; private Integer partyType;