fuliqi
2025-02-19 e1cf283ea35aaf3feea32a22712a7c9c735a7d62
中标单位改为多个
4个文件已修改
102 ■■■■■ 已修改文件
business/src/main/java/com/ycl/domain/entity/ProjectInfo.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/form/ProjectInfoForm.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/entity/ProjectInfo.java
@@ -101,17 +101,17 @@
    /** 计划竣工时间 */
    private Date planCompleteTime;
    @TableField("win_unit")
    /** 中标单位 */
    private String winUnit;
    @TableField("win_amount")
    /** 中标金额 */
    private String winAmount;
    @TableField("win_time")
    /** 中标时间 */
    private Date winTime;
//    @TableField("win_unit")
//    /** 中标单位 */
//    private String winUnit;
//
//    @TableField("win_amount")
//    /** 中标金额 */
//    private String winAmount;
//
//    @TableField("win_time")
//    /** 中标时间 */
//    private Date winTime;
    @TableField("project_address")
    /** 详细地址 */
business/src/main/java/com/ycl/domain/form/ProjectInfoForm.java
@@ -96,15 +96,17 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date planCompleteTime;
    @ApiModelProperty("中标单位")
    private String winUnit;
    @ApiModelProperty("中标金额")
    private String winAmount;
    @ApiModelProperty("中标时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date winTime;
//    @ApiModelProperty("中标单位")
//    private String winUnit;
//
//    @ApiModelProperty("中标金额")
//    private String winAmount;
//
//    @ApiModelProperty("中标时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date winTime;
    @ApiModelProperty("中标单位信息")
    private List<ProjectInfoWinUnitForm> winUnitList;
    @ApiModelProperty("详细地址")
    private String projectAddress;
business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java
@@ -111,19 +111,21 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date planCompleteTime;
//    /** 中标单位 */
//    @ApiModelProperty("中标单位")
//    private String winUnit;
//
//    /** 中标金额 */
//    @ApiModelProperty("中标金额")
//    private String winAmount;
//
//    /** 中标时间 */
//    @ApiModelProperty("中标时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    private Date winTime;
    /** 中标单位 */
    @ApiModelProperty("中标单位")
    private String winUnit;
    /** 中标金额 */
    @ApiModelProperty("中标金额")
    private String winAmount;
    /** 中标时间 */
    @ApiModelProperty("中标时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date winTime;
    private List<ProjectInfoWinUnitVO> winUnitVOList;
    /** 详细地址 */
    @ApiModelProperty("详细地址")
    private String projectAddress;
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -41,6 +41,7 @@
import com.ycl.mapper.*;
import com.ycl.service.FileService;
import com.ycl.service.ProjectInfoService;
import com.ycl.service.ProjectInfoWinUnitService;
import com.ycl.system.mapper.SysDeptMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.codec.Charsets;
@@ -77,6 +78,7 @@
public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, ProjectInfo> implements ProjectInfoService {
    private final ProjectInfoMapper projectInfoMapper;
    private final ProjectInfoWinUnitService projectInfoWinUnitService;
    private final ProjectInvestmentFundingMapper investmentFundingMapper;
    private final ProjectInvestmentInfoMapper investmentInfoMapper;
    private final ProjectInvestmentPolicyComplianceMapper policyMapper;
@@ -103,6 +105,7 @@
        ProjectInfo entity = ProjectInfoForm.getEntityByForm(form, null);
        Long userId = SecurityUtils.getUserId();
        Long deptId = SecurityUtils.getDeptId();
        List<ProjectInfoWinUnitForm> projectInfoWinUnitForm = form.getWinUnitList();
        entity.setProjectOwnerUnit(deptId);
        entity.setCreateBy(userId);
        entity.setUpdateBy(userId);
@@ -119,6 +122,9 @@
            item.setType(FileTypeEnum.PROJECT_INFO);
        });
        fileService.saveBatch(fileList);
        //添加项目中标单位
        saveUnit(projectInfoWinUnitForm);
        return Result.ok("添加成功").data(entity.getId());
    }
@@ -163,7 +169,28 @@
        fileMapper.delete(fileQueryWrapper);
        //替换成现有
        fileService.saveBatch(fileList);
        //修改项目中标单位
        //删除原数据
        List<ProjectInfoWinUnitForm> projectInfoWinUnitForm = form.getWinUnitList();
        QueryWrapper<ProjectInfoWinUnit> unitWrapper = new QueryWrapper<>();
        unitWrapper.eq("project_info_id",form.getId());
        projectInfoWinUnitService.remove(unitWrapper);
        //添加项目中标单位
        saveUnit(projectInfoWinUnitForm);
        return Result.ok("修改成功");
    }
    private void saveUnit(List<ProjectInfoWinUnitForm> projectInfoWinUnitForm) {
        List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>();
        for (ProjectInfoWinUnitForm winUnitForm : projectInfoWinUnitForm) {
            ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null);
            projectInfoWinUnits.add(projectInfoWinUnit);
        }
        if (!CollectionUtils.isEmpty(projectInfoWinUnits)) {
            projectInfoWinUnitService.saveBatch(projectInfoWinUnits);
        }
    }
    /**
@@ -191,6 +218,7 @@
        investmentInfoMapper.delete(new QueryWrapper<ProjectInvestmentInfo>().eq("project_id", id));
        policyMapper.delete(new QueryWrapper<ProjectInvestmentPolicyCompliance>().eq("project_id", id));
        unitRegistrationInfoMapper.delete(new QueryWrapper<ProjectUnitRegistrationInfo>().eq("project_id", id));
        projectInfoWinUnitService.remove(new QueryWrapper<ProjectInfoWinUnit>().eq("project_info_id",id));
        List<String> types = new ArrayList<>();
        types.add(FileTypeEnum.PROJECT_INFO.getType());
@@ -296,8 +324,16 @@
        QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
        fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType());
        fileQueryWrapper.eq("bus_id", vo.getId());
        List<File> files = fileMapper.selectList(fileQueryWrapper);
        vo.setFileList(files);
        List<ProjectInfoWinUnitVO> unitVOS = new ArrayList<>();
        List<ProjectInfoWinUnit> unitList = projectInfoWinUnitService.list(new QueryWrapper<ProjectInfoWinUnit>().eq("project_info_id", id));
        for (ProjectInfoWinUnit projectInfoWinUnit : unitList) {
            ProjectInfoWinUnitVO unitVO = ProjectInfoWinUnitVO.getVoByEntity(projectInfoWinUnit,null);
            unitVOS.add(unitVO);
        }
        vo.setWinUnitVOList(unitVOS);
        return Result.ok().data(vo);
    }