diff --git a/src/main/java/com/spring/modules/project/dao/ProjectDao.java b/src/main/java/com/spring/modules/project/dao/ProjectDao.java index e4e0b0f2..af0e0829 100644 --- a/src/main/java/com/spring/modules/project/dao/ProjectDao.java +++ b/src/main/java/com/spring/modules/project/dao/ProjectDao.java @@ -227,4 +227,6 @@ public interface ProjectDao extends BaseMapper { void addContact(ProjectContactData itemDate); void deleteContact(ProjectContactData itemDate); + + PlmProjectInfo getProjectData(@Param("site") String site,@Param("projectId") String projectId); } diff --git a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java index f5fbbc67..744a342a 100644 --- a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java +++ b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java @@ -16,7 +16,9 @@ import com.spring.modules.part.mapper.BomManagementMapper; import com.spring.modules.part.mapper.MasterPartInformationMapper; import com.spring.modules.part.mapper.PartInformationMapper; import com.spring.modules.part.vo.*; +import com.spring.modules.project.dao.ProjectDao; import com.spring.modules.project.data.*; +import com.spring.modules.project.entity.PlmProjectInfo; import com.spring.modules.project.entity.PlmProjectTeam; import com.spring.modules.quotation.entity.QuotationHeader; import com.spring.modules.quotation.mapper.QuotationInformationMapper; @@ -43,6 +45,8 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification @Autowired private ProcedureDao procedureDao; @Autowired + private ProjectDao projectDao; + @Autowired private BomManagementMapper bomManagementMapper; @Autowired private QuotationInformationMapper quotationInformationMapper; @@ -105,6 +109,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification inData.setCreateBy(sysUserEntity.getUsername()); inData.setStatus("cg"); technicalSpecificationMapper.saveTechnicalSpecificationSheet(inData); + }else { // PlmProjectInfoData checkPlmProjectInfoData=projectDao.checkPlmProjectInfoData(inData); // if(!checkPlmProjectInfoData.getCustomerId().equals(inData.getCustomerId())){ @@ -144,7 +149,8 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification for (int i = 0; i ossEntity = sysFileService.uploadProject(file, inData); + return R.ok().put("ossEntity", ossEntity); + } + /** * @description: 按照orderRef1的查询 * @author LR diff --git a/src/main/java/com/spring/modules/sys/service/SysFileService.java b/src/main/java/com/spring/modules/sys/service/SysFileService.java index 7766cf8d..270aebe8 100644 --- a/src/main/java/com/spring/modules/sys/service/SysFileService.java +++ b/src/main/java/com/spring/modules/sys/service/SysFileService.java @@ -24,7 +24,13 @@ public interface SysFileService { * @version 1.0 */ SysOssEntity upload(MultipartFile file, GetParamInData inData); - + /** + * @description: 项目文件上传 + * @author LR + * @date 2023/3/1 15:57 + * @version 1.0 + */ + List uploadProject(MultipartFile[] file, GetParamInData inData); /** * @description: 按照orderRef1查询文件文件参数 * @author LR diff --git a/src/main/java/com/spring/modules/sys/service/impl/SysFileServiceImpl.java b/src/main/java/com/spring/modules/sys/service/impl/SysFileServiceImpl.java index 1e13c729..4c4d6c78 100644 --- a/src/main/java/com/spring/modules/sys/service/impl/SysFileServiceImpl.java +++ b/src/main/java/com/spring/modules/sys/service/impl/SysFileServiceImpl.java @@ -15,11 +15,13 @@ import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -41,6 +43,17 @@ public class SysFileServiceImpl implements SysFileService { @Value("${sys-file.file-path}") private String filePath; + @Override + @Transactional + public List uploadProject(MultipartFile[] file, GetParamInData inData){ + List result=new ArrayList<>(); + for (int i = 0; i < file.length; i++) { + SysOssEntity data= upload(file[i],inData); + result.add(data); + } + return result; + } + @Override public SysOssEntity upload(MultipartFile file, GetParamInData inData) { if (file.isEmpty()) { diff --git a/src/main/resources/mapper/project/ProjectDao.xml b/src/main/resources/mapper/project/ProjectDao.xml index 4424eae8..7e9f5a7d 100644 --- a/src/main/resources/mapper/project/ProjectDao.xml +++ b/src/main/resources/mapper/project/ProjectDao.xml @@ -418,4 +418,10 @@ and test_part_no = #{testPartNo} + + diff --git a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml index dcf88c85..f2103995 100644 --- a/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml +++ b/src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml @@ -79,8 +79,7 @@ SELECT top 1 a.id,a.site,a.code_no,a.project_id,a.test_part_no,a.status,a.rev_no,a.work_center_no,a.ECN_flag,a.ECN_no, a.ECN_address,a.remark,a.create_date,a.create_by,a.update_date,a.update_by,b.final_part_no,dbo.plm_get_projectBaseDesc(b.part_type,'part_type') partTypeDesc, b.part_type,b.part_name,b.part_desc,b.part_spec,dbo.plm_get_technicalBaseDesc(a.status,'status') statusDesc,a.proofing_no, - dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,stage,process, - dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'technician') technician, + dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'engineer') engineer,stage,process,remarkPage, dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,a.ori_code_no FROM plm_technical_specification_sheet a left join view_Project_Part b on a.site=b.site and a.project_id=b.project_id and a.test_part_no=b.test_part_no @@ -128,7 +127,7 @@ - update plm_technical_specification_sheet set status=#{status},stage=#{stage} + update plm_technical_specification_sheet set status=#{status},stage=#{stage},remarkPage=#{remarkPage} ,rev_no=#{revNo},ECN_no=#{ecnNo},ECN_flag=#{ecnFlag},ECN_address=#{ecnAddress},update_date=GetDate(),update_by=#{updateBy} where site=#{site} and code_no=#{codeNo} @@ -260,8 +259,10 @@ a.wiRevison,a.wiDate,a.routingRemark,a.routingAction, insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id) - select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,null,null,'BM',a.order_id - from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM' and a.code_no=b.properties_code_no + select #{site},#{buNo},#{codeNo},#{type},1,b.code_desc,a.seq_no,a.properties_item_no,c.DefaultValue,null,'BM',a.order_id + from plm_bm_model_header b left join plm_properties_model_detail a on a.site=#{site} and a.function_type='BM' + and a.code_no=b.properties_code_no + left join plm_properties_item c on a.properties_item_no=c.ItemNo and a.site=c.site and a.function_type=c.ItemType where b.site=#{site} and b.bu_no=#{buNo} and b.function_type='BM' and b.code_no=#{type} and a.code_no is not null