fuliqi
2024-11-28 a1fc7e3e337393954a95b5f85c1a3f59d61208c4
投资基本信息
6个文件已修改
78 ■■■■■ 已修改文件
business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java
@@ -27,55 +27,55 @@
@RequiredArgsConstructor
@Api(value = "投资项目基础信息表", tags = "投资项目基础信息表管理")
@RestController
@RequestMapping("/project-investment-info")
@RequestMapping("/project/investmentInfo")
public class ProjectInvestmentInfoController {
    private final ProjectInvestmentInfoService projectInvestmentInfoService;
    @PostMapping
    @ApiOperation(value = "添加", notes = "添加")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:add')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:add')")
    public Result add(@RequestBody @Validated(Add.class) ProjectInvestmentInfoForm form) {
        return projectInvestmentInfoService.add(form);
    }
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:edit')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:edit')")
    public Result update(@RequestBody @Validated(Update.class) ProjectInvestmentInfoForm form) {
        return projectInvestmentInfoService.update(form);
    }
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:del')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:del')")
    public Result removeById(@PathVariable("id") String id) {
        return projectInvestmentInfoService.removeById(id);
    }
    @DeleteMapping("/batch")
    @ApiOperation(value = "批量删除", notes = "批量删除")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:del:batch')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:del:batch')")
    public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) {
        return projectInvestmentInfoService.remove(ids);
    }
    @GetMapping("/page")
    @ApiOperation(value = "分页", notes = "分页")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:page')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:page')")
    public Result page(ProjectInvestmentInfoQuery query) {
        return projectInvestmentInfoService.page(query);
    }
    @GetMapping("/{id}")
    @ApiOperation(value = "详情", notes = "详情")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:detail')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:detail')")
    public Result detail(@PathVariable("id") Integer id) {
        return projectInvestmentInfoService.detail(id);
    }
    @GetMapping("/list")
    @PreAuthorize("hasAuthority('projectInvestmentInfo:list')")
//    @PreAuthorize("hasAuthority('projectInvestmentInfo:list')")
    @ApiOperation(value = "列表", notes = "列表")
    public Result list() {
        return projectInvestmentInfoService.all();
business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java
@@ -6,6 +6,7 @@
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * 投资项目基础信息表
@@ -45,11 +46,11 @@
    @TableField("planned_start_date")
    /** 计划开工时间 */
    private LocalDateTime plannedStartDate;
    private Date plannedStartDate;
    @TableField("expected_completion_date")
    /** 拟建成时间 */
    private LocalDateTime expectedCompletionDate;
    private Date expectedCompletionDate;
    @TableField("national_industry_classification")
    /** 国标行业分类 */
@@ -79,17 +80,10 @@
    /** 建管平台代码 */
    private String code;
    @TableField("gmt_create_time")
    /** 创建时间 */
    private LocalDateTime gmtCreateTime;
    @TableField("create_by")
    /** 创建人 */
    private Long createBy;
    @TableField("gmt_update_time")
    /** 更新时间 */
    private LocalDateTime gmtUpdateTime;
    @TableField("update_by")
    /** 更新人 */
business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java
@@ -1,5 +1,6 @@
package com.ycl.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.common.group.Update;
import com.ycl.common.group.Add;
import com.ycl.system.domain.base.AbsForm;
@@ -23,79 +24,56 @@
@ApiModel(value = "ProjectInvestmentInfo表单", description = "投资项目基础信息表表单")
public class ProjectInvestmentInfoForm extends AbsForm {
    @NotNull(message = "项目id不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("项目id")
    private Long projectId;
    @NotNull(message = "建设地点是否跨域不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("建设地点是否跨域")
    private Integer beCrossRegion;
    @NotBlank(message = "项目建设地点不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("项目建设地点")
    private String constructionLocation;
    @NotBlank(message = "建设详细地址不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("建设详细地址")
    private String detailedAddress;
    @NotNull(message = "是否是补码项目不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("是否是补码项目")
    private Integer beCompensationProject;
    @NotBlank(message = "补码原因不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("补码原因")
    private String compensationReason;
    @NotNull(message = "计划开工时间不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("计划开工时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date plannedStartDate;
    @NotNull(message = "拟建成时间不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("拟建成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expectedCompletionDate;
    @NotBlank(message = "国标行业分类不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("国标行业分类")
    private String nationalIndustryClassification;
    @NotBlank(message = "所属行业分类不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("所属行业分类")
    private String industryClassification;
    @NotBlank(message = "项目建设性质不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("项目建设性质")
    private String projectNature;
    @NotBlank(message = "项目属性不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("项目属性")
    private String projectAttribute;
    @NotNull(message = "是否使用土地不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("是否使用土地")
    private Integer useEarth;
    @NotBlank(message = "主要建设内容及规模不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("主要建设内容及规模")
    private String contentScale;
    @NotBlank(message = "建管平台代码不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("建管平台代码")
    private String code;
    @NotNull(message = "创建时间不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("创建时间")
    private Date gmtCreateTime;
    @NotNull(message = "创建人不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("创建人")
    private Long createBy;
    @NotNull(message = "更新时间不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("更新时间")
    private Date gmtUpdateTime;
    @NotNull(message = "更新人不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty("更新人")
    private Long updateBy;
business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java
@@ -1,5 +1,6 @@
package com.ycl.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.domain.base.AbsVo;
import com.ycl.domain.entity.ProjectInvestmentInfo;
import java.util.List;
@@ -46,10 +47,12 @@
    /** 计划开工时间 */
    @ApiModelProperty("计划开工时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date plannedStartDate;
    /** 拟建成时间 */
    @ApiModelProperty("拟建成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expectedCompletionDate;
    /** 国标行业分类 */
@@ -80,17 +83,9 @@
    @ApiModelProperty("建管平台代码")
    private String code;
    /** 创建时间 */
    @ApiModelProperty("创建时间")
    private Date gmtCreateTime;
    /** 创建人 */
    @ApiModelProperty("创建人")
    private Long createBy;
    /** 更新时间 */
    @ApiModelProperty("更新时间")
    private Date gmtUpdateTime;
    /** 更新人 */
    @ApiModelProperty("更新人")
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -63,7 +63,7 @@
            item.setType(FileTypeEnum.PROJECT_INFO);
        });
        fileService.saveBatch(fileList);
        return Result.ok("添加成功");
        return Result.ok("添加成功").data(entity.getId());
    }
    /**
business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
@@ -1,6 +1,7 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.common.utils.SecurityUtils;
import com.ycl.domain.entity.ProjectInvestmentInfo;
import com.ycl.mapper.ProjectInvestmentInfoMapper;
import com.ycl.service.ProjectInvestmentInfoService;
@@ -38,8 +39,12 @@
    @Override
    public Result add(ProjectInvestmentInfoForm form) {
        ProjectInvestmentInfo entity = ProjectInvestmentInfoForm.getEntityByForm(form, null);
        Long userId = SecurityUtils.getUserId();
        entity.setCreateBy(userId);
        entity.setUpdateBy(userId);
        baseMapper.insert(entity);
        return Result.ok("添加成功");
        return Result.ok("添加成功").data(entity.getId());
    }
    /**
@@ -54,6 +59,8 @@
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        BeanUtils.copyProperties(form, entity);
        Long userId = SecurityUtils.getUserId();
        entity.setUpdateBy(userId);
        baseMapper.updateById(entity);
        return Result.ok("修改成功");
    }