Merge remote-tracking branch 'gitee/master'
# Conflicts: # core/src/main/java/com/dite/znpt/constant/Message.java
This commit is contained in:
commit
d691db5eee
|
@ -39,6 +39,11 @@ public class Message implements Serializable {
|
||||||
public static final String CERTIFICATION_TYPE_ILLEGAL = "证书类型不合法";
|
public static final String CERTIFICATION_TYPE_ILLEGAL = "证书类型不合法";
|
||||||
public static final String CERTIFICATION_CODE_EXIST = "证书编码已存在";
|
public static final String CERTIFICATION_CODE_EXIST = "证书编码已存在";
|
||||||
public static final String CERTIFICATION_ID_NOT_EXIST = "证书id不存在";
|
public static final String CERTIFICATION_ID_NOT_EXIST = "证书id不存在";
|
||||||
|
public static final String INSURANCE_TYPE_NAME_IS_EXIST = "保险类型名称已存在";
|
||||||
|
public static final String INSURANCE_TYPE_ID_IS_NOT_EXIST = "保险类型id不存在";
|
||||||
|
public static final String INSURANCE_COMPANY_NAME_IS_EXIST = "保险公司名称已存在";
|
||||||
|
public static final String INSURANCE_COMPANY_ID_IS_NOT_EXIST = "保险公司id不存在";
|
||||||
|
public static final String INSURANCE_INFO_ID_IS_NOT_EXIST = "保险信息id不存在";
|
||||||
public static final String TASK_ID_GROUP_ID_ALL_EMPTY = "任务id和任务组id不可同时为空";
|
public static final String TASK_ID_GROUP_ID_ALL_EMPTY = "任务id和任务组id不可同时为空";
|
||||||
public static final String TASK_STATUS_NOT_PENDING = "任务状态不是未开始";
|
public static final String TASK_STATUS_NOT_PENDING = "任务状态不是未开始";
|
||||||
public static final String TASK_STATUS_NOT_IN_PROGRESS = "任务状态不是进行中";
|
public static final String TASK_STATUS_NOT_IN_PROGRESS = "任务状态不是进行中";
|
||||||
|
|
|
@ -71,5 +71,22 @@ public interface Converts {
|
||||||
|
|
||||||
List<CertificationResp> toCertificationResp(List<CertificationEntity> list);
|
List<CertificationResp> toCertificationResp(List<CertificationEntity> list);
|
||||||
|
|
||||||
|
List<InsuranceTypeResp> toInsuranceTypeResp(List<InsuranceTypeEntity> list);
|
||||||
|
|
||||||
|
InsuranceTypeResp toInsuranceTypeResp(InsuranceTypeEntity entity);
|
||||||
|
|
||||||
|
InsuranceTypeEntity toInsuranceTypeEntity(InsuranceTypeReq req);
|
||||||
|
|
||||||
|
List<InsuranceCompanyResp> toInsuranceCompanyResp(List<InsuranceCompanyEntity> list);
|
||||||
|
|
||||||
|
InsuranceCompanyResp toInsuranceCompanyResp(InsuranceCompanyEntity entity);
|
||||||
|
|
||||||
|
InsuranceCompanyEntity toInsuranceCompanyEntity(InsuranceCompanyReq req);
|
||||||
|
|
||||||
|
List<InsuranceInfoResp> toInsuranceInfoResp(List<InsuranceInfoEntity> list);
|
||||||
|
|
||||||
|
InsuranceInfoResp toInsuranceInfoResp(InsuranceInfoEntity entity);
|
||||||
|
|
||||||
|
InsuranceInfoEntity toInsuranceInfoEntity(InsuranceInfoReq req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.dite.znpt.domain.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.dite.znpt.domain.AuditableEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:15
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("insurance_company")
|
||||||
|
@ApiModel(value="InsuranceCompanyEntity对象", description="保险公司信息")
|
||||||
|
public class InsuranceCompanyEntity extends AuditableEntity implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 6335457810854776901L;
|
||||||
|
|
||||||
|
@ApiModelProperty("公司id")
|
||||||
|
@TableId(value = "insurance_company_id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("公司名称")
|
||||||
|
@TableField("insurance_company_name")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人")
|
||||||
|
@TableField("contact")
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人电话")
|
||||||
|
@TableField("contact_phone")
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态:0-合作中,1-终止合作")
|
||||||
|
@TableField("status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志(0代表存在 ,1代表删除)")
|
||||||
|
@TableField("del_flag")
|
||||||
|
private String delFlag;
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.dite.znpt.domain.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.dite.znpt.domain.AuditableEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:15
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("insurance_info")
|
||||||
|
@ApiModel(value="InsuranceInfoEntity对象", description="保险信息")
|
||||||
|
public class InsuranceInfoEntity extends AuditableEntity implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 465741795038101117L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险信息id")
|
||||||
|
@TableId(value = "insurance_info_id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String insuranceInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工id")
|
||||||
|
@TableField("user_id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工姓名")
|
||||||
|
@TableField("name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工工号")
|
||||||
|
@TableField("user_code")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司id")
|
||||||
|
@TableField("insurance_company_id")
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司")
|
||||||
|
@TableField("insurance_company_name")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
@TableField("insurance_type_id")
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型")
|
||||||
|
@TableField("insurance_type_name")
|
||||||
|
private String insuranceTypeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险单号")
|
||||||
|
@TableField("insurance_bill_code")
|
||||||
|
private String insuranceBillCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("生效日期")
|
||||||
|
@TableField("effective_date")
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("到期日期")
|
||||||
|
@TableField("expire_date")
|
||||||
|
private LocalDate expireDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("保费")
|
||||||
|
@TableField("insurance_premium")
|
||||||
|
private BigDecimal insurancePremium;
|
||||||
|
|
||||||
|
@ApiModelProperty("保额")
|
||||||
|
@TableField("insurance_amount")
|
||||||
|
private BigDecimal insuranceAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
@TableField("insurance_status")
|
||||||
|
private String insuranceStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志(0代表存在 ,1代表删除)")
|
||||||
|
@TableField("del_flag")
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.dite.znpt.domain.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.dite.znpt.domain.AuditableEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:15
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("insurance_type")
|
||||||
|
@ApiModel(value="InsuranceTypeEntity对象", description="保险类型")
|
||||||
|
public class InsuranceTypeEntity extends AuditableEntity implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 3027186714895190416L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
@TableId(value = "insurance_type_id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型名称")
|
||||||
|
@TableField("insurance_type_name")
|
||||||
|
private String insuranceTypeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("描述")
|
||||||
|
@TableField("description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志(0代表存在 ,1代表删除)")
|
||||||
|
@TableField("del_flag")
|
||||||
|
private String delFlag;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:39
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险公司列表查询条件")
|
||||||
|
public class InsuranceCompanyListReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -3926269785176954672L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司名称")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人")
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人电话")
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态,0-合作中,1-终止合作")
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.dite.znpt.util.ValidationGroup;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:44
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险公司请求实体")
|
||||||
|
public class InsuranceCompanyReq implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -5949181233497299673L;
|
||||||
|
|
||||||
|
@NotBlank(message = "保险公司不能为空")
|
||||||
|
@Size(max = 50, message = "保险公司不能超过50个字符")
|
||||||
|
@ApiModelProperty("保险公司")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@NotBlank(message = "联系人不能为空")
|
||||||
|
@Size(max = 20, message = "联系人不能超过20个字符")
|
||||||
|
@ApiModelProperty("联系人")
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
@NotBlank(message = "联系电话不能为空")
|
||||||
|
@Pattern(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, regexp ="^$|1\\d{10}$", message = "联系电话格式不正确")
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态,0-合作中,1-终止合作")
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:46
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险公司响应实体")
|
||||||
|
public class InsuranceCompanyResp implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 7275887907802349727L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司id")
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司名称")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人")
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人电话")
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态,0-合作中,1-终止合作")
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:44
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险信息查询条件")
|
||||||
|
public class InsuranceInfoListReq implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -47047804822030641L;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("员工编号")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司id")
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态,枚举:InsuranceStatusEnum")
|
||||||
|
private String insuranceStatus;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:44
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险信息请求实体")
|
||||||
|
public class InsuranceInfoReq implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 3352397101804468290L;
|
||||||
|
|
||||||
|
@NotBlank(message = "用户id不能为空")
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@NotBlank(message = "保险类型id不能为空")
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@NotBlank(message = "保险公司id不能为空")
|
||||||
|
@ApiModelProperty("保险公司id")
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@NotBlank(message = "保单号不能为空")
|
||||||
|
@ApiModelProperty("保单号")
|
||||||
|
private String insuranceBillCode;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@NotNull(message = "生效日期不能为空")
|
||||||
|
@ApiModelProperty("生效日期")
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@NotNull(message = "失效日期不能为空")
|
||||||
|
@ApiModelProperty("失效日期")
|
||||||
|
private LocalDate expireDate;
|
||||||
|
|
||||||
|
@NotNull(message = "保险金额不能为空")
|
||||||
|
@ApiModelProperty("保险金额,单位元,精确到分")
|
||||||
|
private BigDecimal insuranceAmount;
|
||||||
|
|
||||||
|
@NotNull(message = "保险保费不能为空")
|
||||||
|
@ApiModelProperty("保险保费,单位元,精确到分")
|
||||||
|
private BigDecimal insurancePremium;
|
||||||
|
|
||||||
|
@Size(max = 200, message = "备注不能超过200个字符")
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:46
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险信息响应实体")
|
||||||
|
public class InsuranceInfoResp implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 4703855943894592615L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险信息id")
|
||||||
|
private String insuranceInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户编码")
|
||||||
|
private String userCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型名称")
|
||||||
|
private String insuranceTypeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司id")
|
||||||
|
private String insuranceCompanyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险公司名称")
|
||||||
|
private String insuranceCompanyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("保单号")
|
||||||
|
private String insuranceBillCode;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty("生效日期")
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty("失效日期")
|
||||||
|
private LocalDate expireDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险金额")
|
||||||
|
private BigDecimal insuranceAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险保费")
|
||||||
|
private BigDecimal insurancePremium;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remarks;
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:44
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险类型请求实体")
|
||||||
|
public class InsuranceTypeReq implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -47047804822030641L;
|
||||||
|
|
||||||
|
@NotBlank(message = "保险类型名称不能为空")
|
||||||
|
@Size(max = 50, message = "保险类型名称不能超过50个字符")
|
||||||
|
@ApiModelProperty("保险类型名称")
|
||||||
|
private String insuranceTypeName;
|
||||||
|
|
||||||
|
@Size(max = 200, message = "描述信息不能超过200个字符")
|
||||||
|
@ApiModelProperty("描述信息")
|
||||||
|
private String description;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/6/24 23:46
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("保险类型响应实体")
|
||||||
|
public class InsuranceTypeResp implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -2745493272695038596L;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型id")
|
||||||
|
private String insuranceTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("保险类型名称")
|
||||||
|
private String insuranceTypeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("描述信息")
|
||||||
|
private String description;
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.dite.znpt.enums;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 10:49
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum InsuranceStatusEnum {
|
||||||
|
|
||||||
|
EFFECTIVE("EFFECTIVE","有效"),
|
||||||
|
EXPIRED("EXPIRED","过期");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
InsuranceStatusEnum(String code, String desc){
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InsuranceStatusEnum getByCode(String code){
|
||||||
|
for (InsuranceStatusEnum e : InsuranceStatusEnum.values() ) {
|
||||||
|
if(e.code.equals(code)){
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
InsuranceStatusEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<JSONObject> listAll(){
|
||||||
|
List<JSONObject> list = new ArrayList<>(InsuranceStatusEnum.values().length);
|
||||||
|
for (InsuranceStatusEnum e : InsuranceStatusEnum.values() ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.set(e.code, e.desc);
|
||||||
|
list.add(jsonObject);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.dite.znpt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceCompanyEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:30
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceCompanyMapper extends BaseMapper<InsuranceCompanyEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.dite.znpt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceInfoEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:29
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceInfoMapper extends BaseMapper<InsuranceInfoEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.dite.znpt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceTypeEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:29
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceTypeMapper extends BaseMapper<InsuranceTypeEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.dite.znpt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceCompanyEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:28
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceCompanyService extends IService<InsuranceCompanyEntity> {
|
||||||
|
List<InsuranceCompanyResp> page(InsuranceCompanyListReq req);
|
||||||
|
List<InsuranceCompanyResp> list(InsuranceCompanyListReq req);
|
||||||
|
InsuranceCompanyResp detail(String insuranceCompanyId);
|
||||||
|
void save(InsuranceCompanyReq req);
|
||||||
|
void update(String insuranceCompanyId, InsuranceCompanyReq req);
|
||||||
|
void deleteById(String insuranceCompanyId);
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.dite.znpt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceInfoEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:28
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceInfoService extends IService<InsuranceInfoEntity> {
|
||||||
|
List<InsuranceInfoResp> page(InsuranceInfoListReq req);
|
||||||
|
List<InsuranceInfoResp> list(InsuranceInfoListReq req);
|
||||||
|
InsuranceInfoResp detail(String insuranceInfoId);
|
||||||
|
void save(InsuranceInfoReq req);
|
||||||
|
void update(String insuranceInfoId, InsuranceInfoReq req);
|
||||||
|
void deleteById(String insuranceInfoId);
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.dite.znpt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceTypeEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:28
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface InsuranceTypeService extends IService<InsuranceTypeEntity> {
|
||||||
|
|
||||||
|
List<InsuranceTypeResp> page(String insuranceTypeName);
|
||||||
|
List<InsuranceTypeResp> list(String insuranceTypeName);
|
||||||
|
InsuranceTypeResp detail(String insuranceTypeId);
|
||||||
|
void save(InsuranceTypeReq req);
|
||||||
|
void update(String insuranceTypeId, InsuranceTypeReq req);
|
||||||
|
void deleteById(String insuranceTypeId);
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Constants;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
|
import com.dite.znpt.converts.Converts;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceCompanyEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyResp;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
|
import com.dite.znpt.mapper.InsuranceCompanyMapper;
|
||||||
|
import com.dite.znpt.service.InsuranceCompanyService;
|
||||||
|
import com.dite.znpt.util.PageUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:34
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InsuranceCompanyServiceImpl extends ServiceImpl<InsuranceCompanyMapper, InsuranceCompanyEntity> implements InsuranceCompanyService {
|
||||||
|
@Override
|
||||||
|
public List<InsuranceCompanyResp> page(InsuranceCompanyListReq req) {
|
||||||
|
PageUtil.startPage();
|
||||||
|
return this.list(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InsuranceCompanyResp> list(InsuranceCompanyListReq req) {
|
||||||
|
return Converts.INSTANCE.toInsuranceCompanyResp(this.list(
|
||||||
|
Wrappers.lambdaQuery(InsuranceCompanyEntity.class)
|
||||||
|
.eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.like(StrUtil.isNotBlank(req.getInsuranceCompanyName()), InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName())
|
||||||
|
.like(StrUtil.isNotBlank(req.getContact()), InsuranceCompanyEntity::getContact, req.getContact())
|
||||||
|
.like(StrUtil.isNotBlank(req.getContactPhone()), InsuranceCompanyEntity::getContactPhone, req.getContactPhone())
|
||||||
|
.eq(StrUtil.isNotBlank(req.getStatus()), InsuranceCompanyEntity::getStatus, req.getStatus())
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InsuranceCompanyResp detail(String insuranceCompanyId) {
|
||||||
|
InsuranceCompanyEntity entity = this.getById(insuranceCompanyId);
|
||||||
|
if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
return Converts.INSTANCE.toInsuranceCompanyResp(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void save(InsuranceCompanyReq req) {
|
||||||
|
this.getOneOpt(
|
||||||
|
Wrappers.lambdaQuery(InsuranceCompanyEntity.class)
|
||||||
|
.eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.eq(InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName())
|
||||||
|
).ifPresent(insuranceCompany -> {throw new ServiceException(Message.INSURANCE_COMPANY_NAME_IS_EXIST);});
|
||||||
|
this.save(Converts.INSTANCE.toInsuranceCompanyEntity(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void update(String insuranceCompanyId, InsuranceCompanyReq req) {
|
||||||
|
InsuranceCompanyEntity insuranceCompany = this.getById(insuranceCompanyId);
|
||||||
|
if(null == insuranceCompany || !insuranceCompany.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if(!req.getInsuranceCompanyName().equals(insuranceCompany.getInsuranceCompanyName())){
|
||||||
|
this.getOneOpt(
|
||||||
|
Wrappers.lambdaQuery(InsuranceCompanyEntity.class)
|
||||||
|
.eq(InsuranceCompanyEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.eq(InsuranceCompanyEntity::getInsuranceCompanyName, req.getInsuranceCompanyName())
|
||||||
|
).ifPresent(company -> {throw new ServiceException(Message.INSURANCE_COMPANY_NAME_IS_EXIST);});
|
||||||
|
}
|
||||||
|
InsuranceCompanyEntity entity = Converts.INSTANCE.toInsuranceCompanyEntity(req);
|
||||||
|
entity.setInsuranceCompanyId(insuranceCompanyId);
|
||||||
|
this.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void deleteById(String insuranceCompanyId) {
|
||||||
|
InsuranceCompanyEntity entity = this.getById(insuranceCompanyId);
|
||||||
|
if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
entity.setDelFlag(Constants.DEL_FLAG_1);
|
||||||
|
this.updateById(entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,143 @@
|
||||||
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Constants;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
|
import com.dite.znpt.converts.Converts;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceCompanyEntity;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceInfoEntity;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceTypeEntity;
|
||||||
|
import com.dite.znpt.domain.entity.UserEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceInfoResp;
|
||||||
|
import com.dite.znpt.enums.InsuranceStatusEnum;
|
||||||
|
import com.dite.znpt.enums.UserStatusEnum;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
|
import com.dite.znpt.mapper.InsuranceInfoMapper;
|
||||||
|
import com.dite.znpt.service.InsuranceCompanyService;
|
||||||
|
import com.dite.znpt.service.InsuranceInfoService;
|
||||||
|
import com.dite.znpt.service.InsuranceTypeService;
|
||||||
|
import com.dite.znpt.service.UserService;
|
||||||
|
import com.dite.znpt.util.PageUtil;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InsuranceInfoServiceImpl extends ServiceImpl<InsuranceInfoMapper, InsuranceInfoEntity> implements InsuranceInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InsuranceCompanyService insuranceCompanyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InsuranceTypeService insuranceTypeService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InsuranceInfoResp> page(InsuranceInfoListReq req) {
|
||||||
|
PageUtil.startPage();
|
||||||
|
return this.list(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InsuranceInfoResp> list(InsuranceInfoListReq req) {
|
||||||
|
return Converts.INSTANCE.toInsuranceInfoResp(
|
||||||
|
this.list(Wrappers.lambdaQuery(InsuranceInfoEntity.class)
|
||||||
|
.like(StrUtil.isNotBlank(req.getName()), InsuranceInfoEntity::getName, req.getName())
|
||||||
|
.like(StrUtil.isNotBlank(req.getUserCode()), InsuranceInfoEntity::getUserCode, req.getUserCode())
|
||||||
|
.eq(StrUtil.isNotBlank(req.getInsuranceTypeId()), InsuranceInfoEntity::getInsuranceTypeId, req.getInsuranceCompanyId())
|
||||||
|
.eq(StrUtil.isNotBlank(req.getInsuranceCompanyId()), InsuranceInfoEntity::getInsuranceCompanyId, req.getInsuranceCompanyId())
|
||||||
|
.eq(StrUtil.isNotBlank(req.getInsuranceStatus()), InsuranceInfoEntity::getInsuranceStatus, req.getInsuranceStatus())
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InsuranceInfoResp detail(String insuranceInfoId) {
|
||||||
|
InsuranceInfoEntity insuranceInfoEntity = this.getById(insuranceInfoId);
|
||||||
|
if(null == insuranceInfoEntity || !Constants.DEL_FLAG_0.equals(insuranceInfoEntity.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
return Converts.INSTANCE.toInsuranceInfoResp(insuranceInfoEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void save(InsuranceInfoReq req) {
|
||||||
|
this.save(validation(Converts.INSTANCE.toInsuranceInfoEntity(req)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void update(String insuranceInfoId, InsuranceInfoReq req) {
|
||||||
|
InsuranceInfoEntity insuranceInfoEntity = this.getById(insuranceInfoId);
|
||||||
|
if(null == insuranceInfoEntity || !Constants.DEL_FLAG_0.equals(insuranceInfoEntity.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
InsuranceInfoEntity entity = Converts.INSTANCE.toInsuranceInfoEntity(req);
|
||||||
|
entity.setInsuranceInfoId(insuranceInfoId);
|
||||||
|
this.updateById(validation(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private InsuranceInfoEntity validation(InsuranceInfoEntity entity) {
|
||||||
|
UserEntity user = userService.getById(entity.getUserId());
|
||||||
|
if(null == user || !Constants.STATUS_0.equals(user.getStatus())
|
||||||
|
|| !Constants.DEL_FLAG_0.equals(user.getDelFlag())
|
||||||
|
|| !UserStatusEnum.EMPLOYED.getCode().equals(user.getUserStatus())){
|
||||||
|
throw new ServiceException(Message.USER_ID_NOT_EXIST_OR_ILLEGAL);
|
||||||
|
}
|
||||||
|
entity.setName(user.getName());
|
||||||
|
entity.setUserCode(user.getUserCode());
|
||||||
|
InsuranceCompanyEntity company = insuranceCompanyService.getById(entity.getInsuranceCompanyId());
|
||||||
|
if(null == company ||!Constants.DEL_FLAG_0.equals(company.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.INSURANCE_COMPANY_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
entity.setInsuranceCompanyName(company.getInsuranceCompanyName());
|
||||||
|
InsuranceTypeEntity type = insuranceTypeService.getById(entity.getInsuranceTypeId());
|
||||||
|
if(null == type || !Constants.DEL_FLAG_0.equals(type.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
entity.setInsuranceTypeName(type.getInsuranceTypeName());
|
||||||
|
entity.setInsuranceStatus(entity.getExpireDate().isBefore(LocalDate.now()) ? InsuranceStatusEnum.EXPIRED.getCode() : InsuranceStatusEnum.EFFECTIVE.getCode());
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void deleteById(String insuranceInfoId) {
|
||||||
|
InsuranceInfoEntity insuranceInfoEntity = this.getById(insuranceInfoId);
|
||||||
|
if(null == insuranceInfoEntity || !Constants.DEL_FLAG_0.equals(insuranceInfoEntity.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.INSURANCE_INFO_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
insuranceInfoEntity.setDelFlag(Constants.DEL_FLAG_1);
|
||||||
|
this.updateById(insuranceInfoEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Scheduled(cron = "0 15 0 * * ?")
|
||||||
|
public void updateInsuranceStatus(){
|
||||||
|
List<InsuranceInfoEntity> list = this.list(
|
||||||
|
Wrappers.lambdaQuery(InsuranceInfoEntity.class)
|
||||||
|
.eq(InsuranceInfoEntity::getInsuranceStatus, InsuranceStatusEnum.EFFECTIVE.getCode())
|
||||||
|
.lt(InsuranceInfoEntity::getExpireDate, LocalDate.now())
|
||||||
|
);
|
||||||
|
list.forEach(entity -> {
|
||||||
|
entity.setInsuranceStatus(InsuranceStatusEnum.EXPIRED.getCode());
|
||||||
|
});
|
||||||
|
this.updateBatchById(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Constants;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
|
import com.dite.znpt.converts.Converts;
|
||||||
|
import com.dite.znpt.domain.entity.InsuranceTypeEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeResp;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
|
import com.dite.znpt.mapper.InsuranceTypeMapper;
|
||||||
|
import com.dite.znpt.service.InsuranceTypeService;
|
||||||
|
import com.dite.znpt.util.PageUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InsuranceTypeServiceImpl extends ServiceImpl<InsuranceTypeMapper, InsuranceTypeEntity> implements InsuranceTypeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InsuranceTypeResp> page(String insuranceTypeName) {
|
||||||
|
PageUtil.startPage();
|
||||||
|
return this.list(insuranceTypeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InsuranceTypeResp> list(String insuranceTypeName) {
|
||||||
|
return Converts.INSTANCE.toInsuranceTypeResp(
|
||||||
|
this.list(Wrappers.lambdaQuery(InsuranceTypeEntity.class)
|
||||||
|
.eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.like(StrUtil.isNotBlank(insuranceTypeName), InsuranceTypeEntity::getInsuranceTypeName, insuranceTypeName))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InsuranceTypeResp detail(String insuranceTypeId) {
|
||||||
|
InsuranceTypeEntity entity = this.getById(insuranceTypeId);
|
||||||
|
if(null == entity || !entity.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
return Converts.INSTANCE.toInsuranceTypeResp(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void save(InsuranceTypeReq req) {
|
||||||
|
this.getOneOpt(
|
||||||
|
Wrappers.lambdaQuery(InsuranceTypeEntity.class)
|
||||||
|
.eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.eq(InsuranceTypeEntity::getInsuranceTypeName, req.getInsuranceTypeName())
|
||||||
|
).ifPresent( insuranceTypeEntity -> {throw new ServiceException(Message.INSURANCE_TYPE_NAME_IS_EXIST);});
|
||||||
|
this.save(Converts.INSTANCE.toInsuranceTypeEntity(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void update(String insuranceTypeId, InsuranceTypeReq req) {
|
||||||
|
InsuranceTypeEntity insurance = this.getById(insuranceTypeId);
|
||||||
|
if(null == insurance || !insurance.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if(!insurance.getInsuranceTypeName().equals(req.getInsuranceTypeName())){
|
||||||
|
this.getOneOpt(
|
||||||
|
Wrappers.lambdaQuery(InsuranceTypeEntity.class)
|
||||||
|
.eq(InsuranceTypeEntity::getDelFlag, Constants.DEL_FLAG_0)
|
||||||
|
.eq(InsuranceTypeEntity::getInsuranceTypeName, req.getInsuranceTypeName())
|
||||||
|
).ifPresent( insuranceTypeEntity -> {throw new ServiceException(Message.INSURANCE_TYPE_NAME_IS_EXIST);});
|
||||||
|
}
|
||||||
|
InsuranceTypeEntity entity = Converts.INSTANCE.toInsuranceTypeEntity(req);
|
||||||
|
entity.setInsuranceTypeId(insuranceTypeId);
|
||||||
|
this.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void deleteById(String insuranceTypeId) {
|
||||||
|
InsuranceTypeEntity insurance = this.getById(insuranceTypeId);
|
||||||
|
if(null == insurance || !insurance.getDelFlag().equals(Constants.DEL_FLAG_0)){
|
||||||
|
throw new ServiceException(Message.INSURANCE_TYPE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
insurance.setDelFlag(Constants.DEL_FLAG_1);
|
||||||
|
this.updateById(insurance);
|
||||||
|
}
|
||||||
|
}
|
|
@ -47,21 +47,21 @@ public class CertificationController {
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "新增人员资质", httpMethod = "POST")
|
@ApiOperation(value = "新增人员资质", httpMethod = "POST")
|
||||||
public Result add(@Validated @RequestBody CertificationReq req){
|
public Result<?> add(@Validated @RequestBody CertificationReq req){
|
||||||
certificationService.save(req);
|
certificationService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/{certificationId}")
|
@PutMapping("/{certificationId}")
|
||||||
@ApiOperation(value = "修改人员资质信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改人员资质信息", httpMethod = "PUT")
|
||||||
public Result update(@PathVariable String certificationId, @Validated @RequestBody CertificationReq req){
|
public Result<?> update(@PathVariable String certificationId, @Validated @RequestBody CertificationReq req){
|
||||||
certificationService.update(certificationId, req);
|
certificationService.update(certificationId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/{certificationId}")
|
@DeleteMapping("/{certificationId}")
|
||||||
@ApiOperation(value = "删除人员资质信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除人员资质信息", httpMethod = "DELETE")
|
||||||
public Result remove(@PathVariable String certificationId){
|
public Result<?> remove(@PathVariable String certificationId){
|
||||||
certificationService.deleteById(certificationId);
|
certificationService.deleteById(certificationId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,85 +29,85 @@ public class CommonController {
|
||||||
|
|
||||||
@ApiOperation(value = "查询缺陷级别", httpMethod = "GET")
|
@ApiOperation(value = "查询缺陷级别", httpMethod = "GET")
|
||||||
@GetMapping("/list/defect-level")
|
@GetMapping("/list/defect-level")
|
||||||
public Result listDefectLevel(){
|
public Result<?> listDefectLevel(){
|
||||||
return Result.ok(DefectLevelEnum.listAll());
|
return Result.ok(DefectLevelEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询缺陷来源", httpMethod = "GET")
|
@ApiOperation(value = "查询缺陷来源", httpMethod = "GET")
|
||||||
@GetMapping("/list/defect-source")
|
@GetMapping("/list/defect-source")
|
||||||
public Result listDefectSource(){
|
public Result<?> listDefectSource(){
|
||||||
return Result.ok(DefectSourceEnum.listAll());
|
return Result.ok(DefectSourceEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询缺陷类型", httpMethod = "GET")
|
@ApiOperation(value = "查询缺陷类型", httpMethod = "GET")
|
||||||
@GetMapping("/list/defect-type")
|
@GetMapping("/list/defect-type")
|
||||||
public Result listDefectType(){
|
public Result<?> listDefectType(){
|
||||||
return Result.ok(DefectTypeEnum.listAll());
|
return Result.ok(DefectTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询图像类型", httpMethod = "GET")
|
@ApiOperation(value = "查询图像类型", httpMethod = "GET")
|
||||||
@GetMapping("/list/image-type")
|
@GetMapping("/list/image-type")
|
||||||
public Result listImageType(){
|
public Result<?> listImageType(){
|
||||||
return Result.ok(ImageTypeEnum.listAll());
|
return Result.ok(ImageTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询项目状态", httpMethod = "GET")
|
@ApiOperation(value = "查询项目状态", httpMethod = "GET")
|
||||||
@GetMapping("/list/project-status")
|
@GetMapping("/list/project-status")
|
||||||
public Result listProjectStatus(){
|
public Result<?> listProjectStatus(){
|
||||||
return Result.ok(ProjectStatusEnum.listAll());
|
return Result.ok(ProjectStatusEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询项目工作岗位", httpMethod = "GET")
|
@ApiOperation(value = "查询项目工作岗位", httpMethod = "GET")
|
||||||
@GetMapping("/list/project-work-job/{projectWorkType}")
|
@GetMapping("/list/project-work-job/{projectWorkType}")
|
||||||
public Result listProjectWorkJob(@PathVariable String projectWorkType){
|
public Result<?> listProjectWorkJob(@PathVariable String projectWorkType){
|
||||||
return Result.ok(ProjectWorkJobEnum.listByWorkType(projectWorkType));
|
return Result.ok(ProjectWorkJobEnum.listByWorkType(projectWorkType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询项目工作类型", httpMethod = "GET")
|
@ApiOperation(value = "查询项目工作类型", httpMethod = "GET")
|
||||||
@GetMapping("/list/project-work-type")
|
@GetMapping("/list/project-work-type")
|
||||||
public Result listProjectWorkType(){
|
public Result<?> listProjectWorkType(){
|
||||||
return Result.ok(ProjectWorkTypeEnum.listAll());
|
return Result.ok(ProjectWorkTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询维修状态", httpMethod = "GET")
|
@ApiOperation(value = "查询维修状态", httpMethod = "GET")
|
||||||
@GetMapping("/list/repair-status")
|
@GetMapping("/list/repair-status")
|
||||||
public Result listRepairStatus(){
|
public Result<?> listRepairStatus(){
|
||||||
return Result.ok(RepairStatusEnum.listAll());
|
return Result.ok(RepairStatusEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询拍摄方式", httpMethod = "GET")
|
@ApiOperation(value = "查询拍摄方式", httpMethod = "GET")
|
||||||
@GetMapping("/list/shooting-method")
|
@GetMapping("/list/shooting-method")
|
||||||
public Result listShootingMethod(){
|
public Result<?> listShootingMethod(){
|
||||||
return Result.ok(ShootingMethodEnum.listAll());
|
return Result.ok(ShootingMethodEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询天气", httpMethod = "GET")
|
@ApiOperation(value = "查询天气", httpMethod = "GET")
|
||||||
@GetMapping("/list/weather")
|
@GetMapping("/list/weather")
|
||||||
public Result listWeather(){
|
public Result<?> listWeather(){
|
||||||
return Result.ok(WeatherEnum.listAll());
|
return Result.ok(WeatherEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询通用图片来源", httpMethod = "GET")
|
@ApiOperation(value = "查询通用图片来源", httpMethod = "GET")
|
||||||
@GetMapping("/list/common-image-source")
|
@GetMapping("/list/common-image-source")
|
||||||
public Result listCommonImageSource(){
|
public Result<?> listCommonImageSource(){
|
||||||
return Result.ok(ImageSourceEnum.list(Boolean.FALSE));
|
return Result.ok(ImageSourceEnum.list(Boolean.FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询学历", httpMethod = "GET")
|
@ApiOperation(value = "查询学历", httpMethod = "GET")
|
||||||
@GetMapping("/list/education")
|
@GetMapping("/list/education")
|
||||||
public Result listEducation(){
|
public Result<?> listEducation(){
|
||||||
return Result.ok(EducationEnum.listAll());
|
return Result.ok(EducationEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询性别", httpMethod = "GET")
|
@ApiOperation(value = "查询性别", httpMethod = "GET")
|
||||||
@GetMapping("/list/gender")
|
@GetMapping("/list/gender")
|
||||||
public Result listGender(){
|
public Result<?> listGender(){
|
||||||
return Result.ok(GenderEnum.listAll());
|
return Result.ok(GenderEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "上传图片", httpMethod = "POST")
|
@ApiOperation(value = "上传图片", httpMethod = "POST")
|
||||||
@PostMapping("/upload-image/{imageSource}")
|
@PostMapping("/upload-image/{imageSource}")
|
||||||
public Result uploadImage(@PathVariable String imageSource, ImageWorkReq workReq, MultipartFile file) throws IOException {
|
public Result<?> uploadImage(@PathVariable String imageSource, ImageWorkReq workReq, MultipartFile file) throws IOException {
|
||||||
if(null == file){
|
if(null == file){
|
||||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||||
}
|
}
|
||||||
|
@ -116,34 +116,40 @@ public class CommonController {
|
||||||
|
|
||||||
@ApiOperation(value = "批量上传图片", httpMethod = "POST")
|
@ApiOperation(value = "批量上传图片", httpMethod = "POST")
|
||||||
@PostMapping("/batch-upload-image/{imageSource}")
|
@PostMapping("/batch-upload-image/{imageSource}")
|
||||||
public Result batchUploadImage(@PathVariable String imageSource, ImageWorkReq workReq,
|
public Result<?> batchUploadImage(@PathVariable String imageSource, ImageWorkReq workReq,
|
||||||
@RequestParam("file") MultipartFile[] files) throws IOException {
|
@RequestParam("file") MultipartFile[] files) throws IOException {
|
||||||
return Result.ok(imageService.batchUploadCommonImage(imageSource, workReq, files));
|
return Result.ok(imageService.batchUploadCommonImage(imageSource, workReq, files));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询菜单类型", httpMethod = "GET")
|
@ApiOperation(value = "查询菜单类型", httpMethod = "GET")
|
||||||
@GetMapping("/list/menu-type")
|
@GetMapping("/list/menu-type")
|
||||||
public Result listMenuType(){
|
public Result<?> listMenuType(){
|
||||||
return Result.ok(MenuTypeEnum.listAll());
|
return Result.ok(MenuTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询终端类型", httpMethod = "GET")
|
@ApiOperation(value = "查询终端类型", httpMethod = "GET")
|
||||||
@GetMapping("/list/terminal-type")
|
@GetMapping("/list/terminal-type")
|
||||||
public Result listTerminalType(){
|
public Result<?> listTerminalType(){
|
||||||
return Result.ok(TerminalTypeEnum.listAll());
|
return Result.ok(TerminalTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询在职状态", httpMethod = "GET")
|
@ApiOperation(value = "查询在职状态", httpMethod = "GET")
|
||||||
@GetMapping("/list/user_status")
|
@GetMapping("/list/user_status")
|
||||||
public Result listUserStatus(){
|
public Result<?> listUserStatus(){
|
||||||
return Result.ok(UserStatusEnum.listAll());
|
return Result.ok(UserStatusEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询员工性质", httpMethod = "GET")
|
@ApiOperation(value = "查询员工性质", httpMethod = "GET")
|
||||||
@GetMapping("/list/user_type")
|
@GetMapping("/list/user_type")
|
||||||
public Result listUserType(){
|
public Result<?> listUserType(){
|
||||||
return Result.ok(UserTypeEnum.listAll());
|
return Result.ok(UserTypeEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险状态", httpMethod = "GET")
|
||||||
|
@GetMapping("/list/insurance_status")
|
||||||
|
public Result<?> listInsuranceStatus(){
|
||||||
|
return Result.ok(InsuranceStatusEnum.listAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,21 +51,21 @@ public class DefectController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增缺陷记录", httpMethod = "POST")
|
@ApiOperation(value = "新增缺陷记录", httpMethod = "POST")
|
||||||
@PostMapping("/{imageId}")
|
@PostMapping("/{imageId}")
|
||||||
public Result save(@PathVariable String imageId, @RequestBody DefectReq req) {
|
public Result<?> save(@PathVariable String imageId, @RequestBody DefectReq req) {
|
||||||
defectService.save(imageId, req);
|
defectService.save(imageId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改缺陷记录", httpMethod = "PUT")
|
@ApiOperation(value = "修改缺陷记录", httpMethod = "PUT")
|
||||||
@PutMapping("/{defectId}")
|
@PutMapping("/{defectId}")
|
||||||
public Result edit(@PathVariable String defectId, @RequestBody DefectReq req) {
|
public Result<?> edit(@PathVariable String defectId, @RequestBody DefectReq req) {
|
||||||
defectService.update(defectId, req);
|
defectService.update(defectId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除缺陷记录", httpMethod = "DELETE")
|
@ApiOperation(value = "删除缺陷记录", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{defectId}")
|
@DeleteMapping("/{defectId}")
|
||||||
public Result remove(@PathVariable String defectId) {
|
public Result<?> remove(@PathVariable String defectId) {
|
||||||
defectService.deleteById(defectId);
|
defectService.deleteById(defectId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class DeptController {
|
||||||
|
|
||||||
@ApiOperation(value = "查询部门树", httpMethod = "GET")
|
@ApiOperation(value = "查询部门树", httpMethod = "GET")
|
||||||
@GetMapping("/tree")
|
@GetMapping("/tree")
|
||||||
public Result tree (@RequestParam(name = "deptName", required = false) String deptName) {
|
public Result<?> tree (@RequestParam(name = "deptName", required = false) String deptName) {
|
||||||
return Result.ok(deptService.tree(deptName));
|
return Result.ok(deptService.tree(deptName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,21 +41,21 @@ public class DeptController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增部门信息", httpMethod = "POST")
|
@ApiOperation(value = "新增部门信息", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody DeptReq req) {
|
public Result<?> add(@Validated(ValidationGroup.Insert.class) @RequestBody DeptReq req) {
|
||||||
deptService.save(req);
|
deptService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改部门信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改部门信息", httpMethod = "PUT")
|
||||||
@PutMapping("/{deptId}")
|
@PutMapping("/{deptId}")
|
||||||
public Result edit(@PathVariable String deptId, @Validated(ValidationGroup.Update.class) @RequestBody DeptReq req) {
|
public Result<?> edit(@PathVariable String deptId, @Validated(ValidationGroup.Update.class) @RequestBody DeptReq req) {
|
||||||
deptService.update(deptId, req);
|
deptService.update(deptId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除部门信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除部门信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{deptId}")
|
@DeleteMapping("/{deptId}")
|
||||||
public Result remove(@PathVariable String deptId) {
|
public Result<?> remove(@PathVariable String deptId) {
|
||||||
deptService.deleteById(deptId);
|
deptService.deleteById(deptId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,14 +66,14 @@ public class ImageController {
|
||||||
|
|
||||||
@ApiOperation(value = "设置信息", httpMethod = "POST")
|
@ApiOperation(value = "设置信息", httpMethod = "POST")
|
||||||
@PostMapping("/setting-info/{partId}")
|
@PostMapping("/setting-info/{partId}")
|
||||||
public Result save(@PathVariable String partId, @RequestBody ImageCollectReq req) {
|
public Result<?> save(@PathVariable String partId, @RequestBody ImageCollectReq req) {
|
||||||
imageCollectService.save(partId, req);
|
imageCollectService.save(partId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除图像", httpMethod = "DELETE")
|
@ApiOperation(value = "删除图像", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{imageId}")
|
@DeleteMapping("/{imageId}")
|
||||||
public Result remove(@PathVariable String imageId){
|
public Result<?> remove(@PathVariable String imageId){
|
||||||
imageService.delete(imageId);
|
imageService.delete(imageId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class ImageController {
|
||||||
|
|
||||||
@ApiOperation(value = "关联APP上传图片到机组", httpMethod = "POST")
|
@ApiOperation(value = "关联APP上传图片到机组", httpMethod = "POST")
|
||||||
@PostMapping("/linkAppImagesToPart")
|
@PostMapping("/linkAppImagesToPart")
|
||||||
public Result linkAppImagesToPart(@RequestBody AppImageToPartReq partReq) {
|
public Result<?> linkAppImagesToPart(@RequestBody AppImageToPartReq partReq) {
|
||||||
imageService.linkAppImagesToPart(partReq);
|
imageService.linkAppImagesToPart(partReq);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
|
import com.dite.znpt.domain.PageResult;
|
||||||
|
import com.dite.znpt.domain.Result;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceCompanyResp;
|
||||||
|
import com.dite.znpt.service.InsuranceCompanyService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:10
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Api(tags = "保险公司信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/insurance-company")
|
||||||
|
public class InsuranceCompanyController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InsuranceCompanyService insuranceCompanyService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询保险公司信息列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public PageResult<InsuranceCompanyResp> page(InsuranceCompanyListReq req) {
|
||||||
|
return PageResult.ok(insuranceCompanyService.page(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险公司信息列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<InsuranceCompanyResp>> list(InsuranceCompanyListReq req) {
|
||||||
|
return Result.ok(insuranceCompanyService.list(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险公司信息详情", httpMethod = "GET")
|
||||||
|
@GetMapping("/detail/{insuranceCompanyId}")
|
||||||
|
public Result<InsuranceCompanyResp> detail(@PathVariable String insuranceCompanyId) {
|
||||||
|
return Result.ok(insuranceCompanyService.detail(insuranceCompanyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增保险公司信息", httpMethod = "POST")
|
||||||
|
@PostMapping
|
||||||
|
public Result<?> add(@Valid @RequestBody InsuranceCompanyReq req) {
|
||||||
|
insuranceCompanyService.save(req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改保险公司信息", httpMethod = "POST")
|
||||||
|
@PutMapping("/{insuranceCompanyId}")
|
||||||
|
public Result<?> edit(@PathVariable String insuranceCompanyId, @Valid @RequestBody InsuranceCompanyReq req) {
|
||||||
|
insuranceCompanyService.update(insuranceCompanyId, req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除保险公司信息", httpMethod = "DELETE")
|
||||||
|
@DeleteMapping("/{insuranceCompanyId}")
|
||||||
|
public Result<?> remove(@PathVariable String insuranceCompanyId) {
|
||||||
|
insuranceCompanyService.deleteById(insuranceCompanyId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
|
import com.dite.znpt.domain.PageResult;
|
||||||
|
import com.dite.znpt.domain.Result;
|
||||||
|
import com.dite.znpt.domain.vo.*;
|
||||||
|
import com.dite.znpt.service.InsuranceInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:09
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Api(tags = "保险信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/insurance-info")
|
||||||
|
public class InsuranceInfoController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InsuranceInfoService insuranceInfoService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询保险信息列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public PageResult<InsuranceInfoResp> page(InsuranceInfoListReq req) {
|
||||||
|
return PageResult.ok(insuranceInfoService.page(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险信息列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<InsuranceInfoResp>> list(InsuranceInfoListReq req) {
|
||||||
|
return Result.ok(insuranceInfoService.list(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险信息详情", httpMethod = "GET")
|
||||||
|
@GetMapping("/detail/{insuranceInfoId}")
|
||||||
|
public Result<InsuranceInfoResp> detail(@PathVariable String insuranceInfoId) {
|
||||||
|
return Result.ok(insuranceInfoService.detail(insuranceInfoId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增保险信息", httpMethod = "POST")
|
||||||
|
@PostMapping
|
||||||
|
public Result<?> add(@Valid @RequestBody InsuranceInfoReq req) {
|
||||||
|
insuranceInfoService.save(req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改保险信息", httpMethod = "POST")
|
||||||
|
@PutMapping("/{insuranceInfoId}")
|
||||||
|
public Result<?> edit(@PathVariable String insuranceInfoId, @Valid @RequestBody InsuranceInfoReq req) {
|
||||||
|
insuranceInfoService.update(insuranceInfoId, req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除保险信息", httpMethod = "DELETE")
|
||||||
|
@DeleteMapping("/{insuranceInfoId}")
|
||||||
|
public Result<?> remove(@PathVariable String insuranceInfoId) {
|
||||||
|
insuranceInfoService.deleteById(insuranceInfoId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
|
import com.dite.znpt.domain.PageResult;
|
||||||
|
import com.dite.znpt.domain.Result;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeReq;
|
||||||
|
import com.dite.znpt.domain.vo.InsuranceTypeResp;
|
||||||
|
import com.dite.znpt.service.InsuranceTypeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/6/26/周四 9:10
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Api(tags = "保险类型类型")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/insurance-type")
|
||||||
|
public class InsuranceTypeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InsuranceTypeService insuranceTypeService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询保险类型列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public PageResult<InsuranceTypeResp> page(@RequestParam(required = false) String insuranceTypeName) {
|
||||||
|
return PageResult.ok(insuranceTypeService.page(insuranceTypeName));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险类型列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<InsuranceTypeResp>> list(@RequestParam(required = false) String insuranceTypeName) {
|
||||||
|
return Result.ok(insuranceTypeService.list(insuranceTypeName));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询保险类型详情", httpMethod = "GET")
|
||||||
|
@GetMapping("/detail/{insuranceTypeId}")
|
||||||
|
public Result<InsuranceTypeResp> detail(@PathVariable String insuranceTypeId) {
|
||||||
|
return Result.ok(insuranceTypeService.detail(insuranceTypeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增保险类型", httpMethod = "POST")
|
||||||
|
@PostMapping
|
||||||
|
public Result<?> add(@Valid @RequestBody InsuranceTypeReq req) {
|
||||||
|
insuranceTypeService.save(req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改保险类型", httpMethod = "POST")
|
||||||
|
@PutMapping("/{insuranceTypeId}")
|
||||||
|
public Result<?> edit(@PathVariable String insuranceTypeId, @Valid @RequestBody InsuranceTypeReq req) {
|
||||||
|
insuranceTypeService.update(insuranceTypeId, req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除保险类型", httpMethod = "DELETE")
|
||||||
|
@DeleteMapping("/{insuranceTypeId}")
|
||||||
|
public Result<?> remove(@PathVariable String insuranceTypeId) {
|
||||||
|
insuranceTypeService.deleteById(insuranceTypeId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ public class MenuController {
|
||||||
|
|
||||||
@ApiOperation(value = "查询菜单树", httpMethod = "GET")
|
@ApiOperation(value = "查询菜单树", httpMethod = "GET")
|
||||||
@GetMapping("/tree")
|
@GetMapping("/tree")
|
||||||
public Result tree (@RequestParam(name = "menuName", required = false) String menuName, @RequestParam(defaultValue = "PC") String terminalType) {
|
public Result<?> tree (@RequestParam(name = "menuName", required = false) String menuName, @RequestParam(defaultValue = "PC") String terminalType) {
|
||||||
return Result.ok(menuService.tree(menuName, terminalType));
|
return Result.ok(menuService.tree(menuName, terminalType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,21 +37,21 @@ public class MenuController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增菜单", httpMethod = "POST")
|
@ApiOperation(value = "新增菜单", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody MenuReq req) {
|
public Result<?> add(@RequestBody MenuReq req) {
|
||||||
menuService.save(req);
|
menuService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改菜单", httpMethod = "PUT")
|
@ApiOperation(value = "修改菜单", httpMethod = "PUT")
|
||||||
@PutMapping("/{menuId}")
|
@PutMapping("/{menuId}")
|
||||||
public Result update(@PathVariable String menuId, @RequestBody MenuReq req) {
|
public Result<?> update(@PathVariable String menuId, @RequestBody MenuReq req) {
|
||||||
menuService.update(menuId, req);
|
menuService.update(menuId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除菜单", httpMethod = "DELETE")
|
@ApiOperation(value = "删除菜单", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{menuId}")
|
@DeleteMapping("/{menuId}")
|
||||||
public Result delete(@PathVariable String menuId) {
|
public Result<?> delete(@PathVariable String menuId) {
|
||||||
menuService.deleteById(menuId);
|
menuService.deleteById(menuId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,21 +54,21 @@ public class PartController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增部件信息", httpMethod = "POST")
|
@ApiOperation(value = "新增部件信息", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Object> add(@Validated(ValidationGroup.Insert.class) @RequestBody PartReq req) {
|
public Result<?> add(@Validated(ValidationGroup.Insert.class) @RequestBody PartReq req) {
|
||||||
partService.save(req);
|
partService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改部件信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改部件信息", httpMethod = "PUT")
|
||||||
@PutMapping("/{partId}")
|
@PutMapping("/{partId}")
|
||||||
public Result<Object> edit(@Validated(ValidationGroup.Update.class) @PathVariable String partId, @RequestBody PartReq req) {
|
public Result<?> edit(@Validated(ValidationGroup.Update.class) @PathVariable String partId, @RequestBody PartReq req) {
|
||||||
partService.update(partId, req);
|
partService.update(partId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除部件信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除部件信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{partId}")
|
@DeleteMapping("/{partId}")
|
||||||
public Result<Object> remove(@PathVariable String partId) {
|
public Result<?> remove(@PathVariable String partId) {
|
||||||
partService.deleteById(partId);
|
partService.deleteById(partId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class PartController {
|
||||||
|
|
||||||
@ApiOperation(value = "导入部件-需求待明确", httpMethod = "POST")
|
@ApiOperation(value = "导入部件-需求待明确", httpMethod = "POST")
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
public Result<Object> importData(@RequestExcel List<PartEntity> dataList, BindingResult bindingResult) {
|
public Result<?> importData(@RequestExcel List<PartEntity> dataList, BindingResult bindingResult) {
|
||||||
// JSR 303 校验通用校验获取失败的数据
|
// JSR 303 校验通用校验获取失败的数据
|
||||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
||||||
|
|
|
@ -46,21 +46,21 @@ public class PostController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增岗位信息", httpMethod = "POST")
|
@ApiOperation(value = "新增岗位信息", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody PostReq req){
|
public Result<?> add(@Validated(ValidationGroup.Insert.class) @RequestBody PostReq req){
|
||||||
postService.save(req);
|
postService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改岗位信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改岗位信息", httpMethod = "PUT")
|
||||||
@PutMapping("/{postId}")
|
@PutMapping("/{postId}")
|
||||||
public Result edit(@PathVariable String postId, @Validated(ValidationGroup.Update.class) @RequestBody PostReq req){
|
public Result<?> edit(@PathVariable String postId, @Validated(ValidationGroup.Update.class) @RequestBody PostReq req){
|
||||||
postService.update(postId, req);
|
postService.update(postId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除岗位信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除岗位信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{postId}")
|
@DeleteMapping("/{postId}")
|
||||||
public Result remove(@PathVariable String postId){
|
public Result<?> remove(@PathVariable String postId){
|
||||||
postService.deleteById(postId);
|
postService.deleteById(postId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,21 +54,21 @@ public class ProjectController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增项目信息", httpMethod = "POST")
|
@ApiOperation(value = "新增项目信息", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@Validated(ValidationGroup.Insert.class) @RequestBody ProjectReq req) {
|
public Result<?> add(@Validated(ValidationGroup.Insert.class) @RequestBody ProjectReq req) {
|
||||||
projectService.save(req);
|
projectService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改项目信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改项目信息", httpMethod = "PUT")
|
||||||
@PutMapping("/{projectId}")
|
@PutMapping("/{projectId}")
|
||||||
public Result<Object> edit(@PathVariable String projectId, @Validated(ValidationGroup.Update.class) @RequestBody ProjectReq req) {
|
public Result<?> edit(@PathVariable String projectId, @Validated(ValidationGroup.Update.class) @RequestBody ProjectReq req) {
|
||||||
projectService.update(projectId, req);
|
projectService.update(projectId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除项目信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除项目信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{projectId}")
|
@DeleteMapping("/{projectId}")
|
||||||
public Result<Object> remove(@PathVariable String projectId) {
|
public Result<?> remove(@PathVariable String projectId) {
|
||||||
projectService.deleteById(projectId);
|
projectService.deleteById(projectId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class ProjectController {
|
||||||
|
|
||||||
@ApiOperation(value = "导入项目信息-需求待明确", httpMethod = "POST")
|
@ApiOperation(value = "导入项目信息-需求待明确", httpMethod = "POST")
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
public Result<Object> importData(@RequestExcel List<ProjectEntity> dataList, BindingResult bindingResult) {
|
public Result<?> importData(@RequestExcel List<ProjectEntity> dataList, BindingResult bindingResult) {
|
||||||
// JSR 303 校验通用校验获取失败的数据
|
// JSR 303 校验通用校验获取失败的数据
|
||||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
||||||
|
|
|
@ -54,28 +54,28 @@ public class RoleController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增角色信息", httpMethod = "POST")
|
@ApiOperation(value = "新增角色信息", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody RoleReq req){
|
public Result<?> add(@RequestBody RoleReq req){
|
||||||
roleService.save(req);
|
roleService.save(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改角色信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改角色信息", httpMethod = "PUT")
|
||||||
@PutMapping("/{roleId}")
|
@PutMapping("/{roleId}")
|
||||||
public Result edit(@PathVariable String roleId, @RequestBody RoleReq req){
|
public Result<?> edit(@PathVariable String roleId, @RequestBody RoleReq req){
|
||||||
roleService.update(roleId, req);
|
roleService.update(roleId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除角色信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除角色信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{roleId}")
|
@DeleteMapping("/{roleId}")
|
||||||
public Result delete(@PathVariable String roleId){
|
public Result<?> delete(@PathVariable String roleId){
|
||||||
roleService.deleteById(roleId);
|
roleService.deleteById(roleId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "绑定菜单", httpMethod = "PUT")
|
@ApiOperation(value = "绑定菜单", httpMethod = "PUT")
|
||||||
@PutMapping("/bind-menu")
|
@PutMapping("/bind-menu")
|
||||||
public Result bindMenu(@Validated @RequestBody RoleMenuReq req){
|
public Result<?> bindMenu(@Validated @RequestBody RoleMenuReq req){
|
||||||
roleMenuService.bindRoleMenu(req);
|
roleMenuService.bindRoleMenu(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,14 +70,14 @@ public class TurbineController {
|
||||||
|
|
||||||
@ApiOperation(value = "修改机组", httpMethod = "PUT")
|
@ApiOperation(value = "修改机组", httpMethod = "PUT")
|
||||||
@PutMapping("/{turbineId}")
|
@PutMapping("/{turbineId}")
|
||||||
public Result edit(@PathVariable String turbineId, @Validated(ValidationGroup.Insert.class) @RequestBody TurbineReq req) {
|
public Result<?> edit(@PathVariable String turbineId, @Validated(ValidationGroup.Insert.class) @RequestBody TurbineReq req) {
|
||||||
turbineService.update(turbineId, req);
|
turbineService.update(turbineId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除机组", httpMethod = "DELETE")
|
@ApiOperation(value = "删除机组", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{turbineId}")
|
@DeleteMapping("/{turbineId}")
|
||||||
public Result<Object> remove(@PathVariable String turbineId) {
|
public Result<?> remove(@PathVariable String turbineId) {
|
||||||
turbineService.deleteById(turbineId);
|
turbineService.deleteById(turbineId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class TurbineController {
|
||||||
|
|
||||||
@ApiOperation(value = "导入机组-需求待明确", httpMethod = "POST")
|
@ApiOperation(value = "导入机组-需求待明确", httpMethod = "POST")
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
public Result<Object> importData(@RequestExcel List<TurbineEntity> dataList, BindingResult bindingResult) {
|
public Result<?> importData(@RequestExcel List<TurbineEntity> dataList, BindingResult bindingResult) {
|
||||||
// JSR 303 校验通用校验获取失败的数据
|
// JSR 303 校验通用校验获取失败的数据
|
||||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
||||||
|
|
|
@ -62,14 +62,14 @@ public class UserController {
|
||||||
|
|
||||||
@ApiOperation(value = "绑定角色", httpMethod = "PUT")
|
@ApiOperation(value = "绑定角色", httpMethod = "PUT")
|
||||||
@PutMapping("/bind-role")
|
@PutMapping("/bind-role")
|
||||||
public Result bindRole(@Validated @RequestBody UserRoleReq req){
|
public Result<?> bindRole(@Validated @RequestBody UserRoleReq req){
|
||||||
userRoleService.bindUserRole(req);
|
userRoleService.bindUserRole(req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除用户信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除用户信息", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{userId}")
|
@DeleteMapping("/{userId}")
|
||||||
public Result<Object> remove(@PathVariable String userId) {
|
public Result<?> remove(@PathVariable String userId) {
|
||||||
userService.deleteById(userId);
|
userService.deleteById(userId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,21 +44,21 @@ public class WeatherTypeController {
|
||||||
|
|
||||||
@ApiOperation(value = "新增天气类型", httpMethod = "POST")
|
@ApiOperation(value = "新增天气类型", httpMethod = "POST")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Object> add(@RequestBody WeatherTypeEntity weatherType) {
|
public Result<?> add(@RequestBody WeatherTypeEntity weatherType) {
|
||||||
weatherTypeService.saveData(weatherType);
|
weatherTypeService.saveData(weatherType);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改天气类型", httpMethod = "PUT")
|
@ApiOperation(value = "修改天气类型", httpMethod = "PUT")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result<Object> edit(@RequestBody WeatherTypeEntity weatherType) {
|
public Result<?> edit(@RequestBody WeatherTypeEntity weatherType) {
|
||||||
weatherTypeService.updateData(weatherType);
|
weatherTypeService.updateData(weatherType);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除天气类型", httpMethod = "DELETE")
|
@ApiOperation(value = "删除天气类型", httpMethod = "DELETE")
|
||||||
@DeleteMapping("/{weatherCode}")
|
@DeleteMapping("/{weatherCode}")
|
||||||
public Result<Object> remove(@PathVariable String weatherCode) {
|
public Result<?> remove(@PathVariable String weatherCode) {
|
||||||
weatherTypeService.deleteById(weatherCode);
|
weatherTypeService.deleteById(weatherCode);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class WeatherTypeController {
|
||||||
|
|
||||||
@ApiOperation(value = "导入天气类型", httpMethod = "POST")
|
@ApiOperation(value = "导入天气类型", httpMethod = "POST")
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
public Result<Object> importData(@RequestExcel List<WeatherTypeEntity> dataList, BindingResult bindingResult) {
|
public Result<?> importData(@RequestExcel List<WeatherTypeEntity> dataList, BindingResult bindingResult) {
|
||||||
// JSR 303 校验通用校验获取失败的数据
|
// JSR 303 校验通用校验获取失败的数据
|
||||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue