Browse Source

1127

master
ruanqi 2 years ago
parent
commit
226294d9e2
  1. 2
      src/main/java/com/spring/modules/project/dao/ProjectDao.java
  2. 10
      src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java
  3. 12
      src/main/java/com/spring/modules/sys/controller/SysFileController.java
  4. 8
      src/main/java/com/spring/modules/sys/service/SysFileService.java
  5. 13
      src/main/java/com/spring/modules/sys/service/impl/SysFileServiceImpl.java
  6. 6
      src/main/resources/mapper/project/ProjectDao.xml
  7. 11
      src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

2
src/main/java/com/spring/modules/project/dao/ProjectDao.java

@ -227,4 +227,6 @@ public interface ProjectDao extends BaseMapper<PlmProjectInfo> {
void addContact(ProjectContactData itemDate); void addContact(ProjectContactData itemDate);
void deleteContact(ProjectContactData itemDate); void deleteContact(ProjectContactData itemDate);
PlmProjectInfo getProjectData(@Param("site") String site,@Param("projectId") String projectId);
} }

10
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.MasterPartInformationMapper;
import com.spring.modules.part.mapper.PartInformationMapper; import com.spring.modules.part.mapper.PartInformationMapper;
import com.spring.modules.part.vo.*; import com.spring.modules.part.vo.*;
import com.spring.modules.project.dao.ProjectDao;
import com.spring.modules.project.data.*; import com.spring.modules.project.data.*;
import com.spring.modules.project.entity.PlmProjectInfo;
import com.spring.modules.project.entity.PlmProjectTeam; import com.spring.modules.project.entity.PlmProjectTeam;
import com.spring.modules.quotation.entity.QuotationHeader; import com.spring.modules.quotation.entity.QuotationHeader;
import com.spring.modules.quotation.mapper.QuotationInformationMapper; import com.spring.modules.quotation.mapper.QuotationInformationMapper;
@ -43,6 +45,8 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
@Autowired @Autowired
private ProcedureDao procedureDao; private ProcedureDao procedureDao;
@Autowired @Autowired
private ProjectDao projectDao;
@Autowired
private BomManagementMapper bomManagementMapper; private BomManagementMapper bomManagementMapper;
@Autowired @Autowired
private QuotationInformationMapper quotationInformationMapper; private QuotationInformationMapper quotationInformationMapper;
@ -105,6 +109,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
inData.setCreateBy(sysUserEntity.getUsername()); inData.setCreateBy(sysUserEntity.getUsername());
inData.setStatus("cg"); inData.setStatus("cg");
technicalSpecificationMapper.saveTechnicalSpecificationSheet(inData); technicalSpecificationMapper.saveTechnicalSpecificationSheet(inData);
}else { }else {
// PlmProjectInfoData checkPlmProjectInfoData=projectDao.checkPlmProjectInfoData(inData); // PlmProjectInfoData checkPlmProjectInfoData=projectDao.checkPlmProjectInfoData(inData);
// if(!checkPlmProjectInfoData.getCustomerId().equals(inData.getCustomerId())){ // if(!checkPlmProjectInfoData.getCustomerId().equals(inData.getCustomerId())){
@ -144,7 +149,8 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
for (int i = 0; i <plmTechnicalSpecificationTeams.size() ; i++) { for (int i = 0; i <plmTechnicalSpecificationTeams.size() ; i++) {
technicalSpecificationMapper.saveTechnicalSpecificationTeams(plmTechnicalSpecificationTeams.get(i)); technicalSpecificationMapper.saveTechnicalSpecificationTeams(plmTechnicalSpecificationTeams.get(i));
} }
PlmProjectInfo plmProjectInfo=projectDao.getProjectData(inData.getSite(),inData.getProjectId());
inData.setBuNo(plmProjectInfo.getBuNo());
return inData; return inData;
} }
@ -967,4 +973,6 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
} }
return data; return data;
} }
} }

12
src/main/java/com/spring/modules/sys/controller/SysFileController.java

@ -37,6 +37,18 @@ public class SysFileController extends AbstractController {
return R.ok().put("ossEntity", ossEntity); return R.ok().put("ossEntity", ossEntity);
} }
/**
* @description: 文件上传
* @author LR
* @date 2023/3/1 15:27
* @version 1.0
*/
@PostMapping("/uploadProject")
public R uploadProject(@RequestParam("file") MultipartFile[] file, @ModelAttribute GetParamInData inData){
List<SysOssEntity> ossEntity = sysFileService.uploadProject(file, inData);
return R.ok().put("ossEntity", ossEntity);
}
/** /**
* @description: 按照orderRef1的查询 * @description: 按照orderRef1的查询
* @author LR * @author LR

8
src/main/java/com/spring/modules/sys/service/SysFileService.java

@ -24,7 +24,13 @@ public interface SysFileService {
* @version 1.0 * @version 1.0
*/ */
SysOssEntity upload(MultipartFile file, GetParamInData inData); SysOssEntity upload(MultipartFile file, GetParamInData inData);
/**
* @description: 项目文件上传
* @author LR
* @date 2023/3/1 15:57
* @version 1.0
*/
List<SysOssEntity> uploadProject(MultipartFile[] file, GetParamInData inData);
/** /**
* @description: 按照orderRef1查询文件文件参数 * @description: 按照orderRef1查询文件文件参数
* @author LR * @author LR

13
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.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -41,6 +43,17 @@ public class SysFileServiceImpl implements SysFileService {
@Value("${sys-file.file-path}") @Value("${sys-file.file-path}")
private String filePath; private String filePath;
@Override
@Transactional
public List<SysOssEntity> uploadProject(MultipartFile[] file, GetParamInData inData){
List<SysOssEntity> result=new ArrayList<>();
for (int i = 0; i < file.length; i++) {
SysOssEntity data= upload(file[i],inData);
result.add(data);
}
return result;
}
@Override @Override
public SysOssEntity upload(MultipartFile file, GetParamInData inData) { public SysOssEntity upload(MultipartFile file, GetParamInData inData) {
if (file.isEmpty()) { if (file.isEmpty()) {

6
src/main/resources/mapper/project/ProjectDao.xml

@ -418,4 +418,10 @@
and test_part_no = #{testPartNo} and test_part_no = #{testPartNo}
</if> </if>
</select> </select>
<select id="getProjectData" resultType="com.spring.modules.project.entity.PlmProjectInfo">
select project_id,ori_project_id,project_type_db,project_name,status,project_source,customer_id,create_by,create_date,
update_by,update_date,priority,site,id,project_desc,customer_remark,remark,need_date,bu_no,parent_project_no,final_customer_id
from plm_project_info where site=#{site} and project_id=#{projectId}
</select>
</mapper> </mapper>

11
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, 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, 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, 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 dbo.get_technicalSpecificationTeamName(a.site,a.code_no,'quotationOfficer') quotationOfficer,c.customer_Id,a.ori_code_no
FROM plm_technical_specification_sheet a 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 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 @@
</where> </where>
</select> </select>
<update id="updateBMBasicInformation" > <update id="updateBMBasicInformation" >
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} ,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} and code_no=#{codeNo}
</update> </update>
@ -260,8 +259,10 @@ a.wiRevison,a.wiDate,a.routingRemark,a.routingAction,
<insert id="savePlmBmPropertiesValueData"> <insert id="savePlmBmPropertiesValueData">
insert into plm_bm_propertiesValue(Site,bu_no,PartNo,CodeNo,SubCodeSeqNo,SubCodeDesc,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id) 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 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
</insert> </insert>

Loading…
Cancel
Save