From da0bc6579f13300035d0bc43d60b2f6961db8c1b Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 27 十一月 2024 18:37:39 +0800 Subject: [PATCH] 项目新增暂提 --- business/src/main/resources/mapper/ProjectInfoMapper.xml | 14 +++++++------- business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | 3 +++ business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java | 22 ++++++---------------- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java index 667bc84..2fc8f32 100644 --- a/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java +++ b/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; } diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java index 13afe3e..5c18d4a 100644 --- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java +++ b/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("娣诲姞鎴愬姛"); } diff --git a/business/src/main/resources/mapper/ProjectInfoMapper.xml b/business/src/main/resources/mapper/ProjectInfoMapper.xml index 04aa6e3..4beeb90 100644 --- a/business/src/main/resources/mapper/ProjectInfoMapper.xml +++ b/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 -- Gitblit v1.8.0