| | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 项目管理基础信息表展示 |
| | |
| | | @ApiModelProperty("联系方式") |
| | | private String contact; |
| | | |
| | | /** 创建时间 */ |
| | | @ApiModelProperty("创建时间") |
| | | private Date gmtCreateTime; |
| | | |
| | | /** 更新时间 */ |
| | | @ApiModelProperty("更新时间") |
| | | private Date gmtUpdateTime; |
| | | |
| | | /** 更新人 */ |
| | | @ApiModelProperty("更新人") |
| | | private Long updateBy; |
| | |
| | | /** 创建人 */ |
| | | @ApiModelProperty("创建人") |
| | | private Long createBy; |
| | | |
| | | // TODO 关联其它几张表 |
| | | |
| | | public static ProjectInfoVO getVoByEntity(@NonNull ProjectInfo entity, ProjectInfoVO vo) { |
| | | if(vo == null) { |
| | |
| | | //主管部门转成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; |
| | | } |
| | |
| | | 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; |
| | |
| | | * @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("添加成功"); |
| | | } |
| | | |
| | |
| | | <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" /> |
| | |
| | | <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> |
| | |
| | | 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 |
| | |
| | | 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 |