fuliqi
2024-11-27 da0bc6579f13300035d0bc43d60b2f6961db8c1b
项目新增暂提
3个文件已修改
39 ■■■■■ 已修改文件
business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/resources/mapper/ProjectInfoMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java
@@ -14,6 +14,7 @@
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * 项目管理基础信息表展示
@@ -138,14 +139,6 @@
    @ApiModelProperty("联系方式")
    private String contact;
    /** 创建时间 */
    @ApiModelProperty("创建时间")
    private Date gmtCreateTime;
    /** 更新时间 */
    @ApiModelProperty("更新时间")
    private Date gmtUpdateTime;
    /** 更新人 */
    @ApiModelProperty("更新人")
    private Long updateBy;
@@ -153,8 +146,6 @@
    /** 创建人 */
    @ApiModelProperty("创建人")
    private Long createBy;
    // TODO 关联其它几张表
    public static ProjectInfoVO getVoByEntity(@NonNull ProjectInfo entity, ProjectInfoVO vo) {
        if(vo == null) {
@@ -164,16 +155,15 @@
        //主管部门转成list
        String competentDepartment = entity.getCompetentDepartment();
        if(!StringUtils.isBlank(competentDepartment)){
            List<Long> competentDepartmentList = new ArrayList<>();
            String[] split = competentDepartment.split(",");
            for (String s : split) {
                Long.parseLong(s);
            }
            List<Long> list = Arrays.stream(competentDepartment.split(","))
                    .map(Long::parseLong)
                    .collect(Collectors.toList());
            vo.setCompetentDepartmentList(list);
        }
        //管理归口转换
        String managementCentralization = entity.getManagementCentralization();
        if(!StringUtils.isBlank(managementCentralization)){
            Arrays.asList(managementCentralization.split(","));
            vo.setManagementCentralizationList(Arrays.asList(managementCentralization.split(",")));
        }
        return vo;
    }
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -14,6 +14,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.util.ArrayList;
@@ -41,12 +42,14 @@
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Result add(ProjectInfoForm form) {
        //添加基本信息
        ProjectInfo entity = ProjectInfoForm.getEntityByForm(form, null);
//        baseMapper.insert(entity);
        //添加文件
        List<File> fileList = form.getFileList();
        return Result.ok("添加成功");
    }
business/src/main/resources/mapper/ProjectInfoMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="com.ycl.mapper.ProjectInfoMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectInfoVO">
    <resultMap id="BaseResultMap" type="com.ycl.domain.entity.ProjectInfo">
        <id column="id" property="id"/>
        <result column="project_name" property="projectName" />
        <result column="project_code" property="projectCode" />
@@ -33,8 +33,8 @@
        <result column="project_owner_unit" property="projectOwnerUnit" />
        <result column="project_contact_person" property="projectContactPerson" />
        <result column="contact" property="contact" />
        <result column="gmt_create_time" property="gmtCreateTime" />
        <result column="gmt_update_time" property="gmtUpdateTime" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_update" property="gmtUpdate" />
        <result column="update_by" property="updateBy" />
        <result column="create_by" property="createBy" />
    </resultMap>
@@ -70,8 +70,8 @@
            TPI.project_owner_unit,
            TPI.project_contact_person,
            TPI.contact,
            TPI.gmt_create_time,
            TPI.gmt_update_time,
            TPI.gmt_create,
            TPI.gmt_update,
            TPI.update_by,
            TPI.create_by,
            TPI.id
@@ -112,8 +112,8 @@
            TPI.project_owner_unit,
            TPI.project_contact_person,
            TPI.contact,
            TPI.gmt_create_time,
            TPI.gmt_update_time,
            TPI.gmt_create,
            TPI.gmt_update,
            TPI.update_by,
            TPI.create_by,
            TPI.id