excl标准写入
This commit is contained in:
+1
@@ -32,6 +32,7 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
|||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
public ResponseMessage<Boolean> deleteList(MultipartFile file,MultipartFile file2) {
|
public ResponseMessage<Boolean> deleteList(MultipartFile file,MultipartFile file2) {
|
||||||
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
|
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
|
||||||
|
importExcelService.storageExclData(mapMap);
|
||||||
ResponseMessage responseMessage=new ResponseMessage();
|
ResponseMessage responseMessage=new ResponseMessage();
|
||||||
responseMessage.setMessage(mapMap.toString());
|
responseMessage.setMessage(mapMap.toString());
|
||||||
responseMessage.isOk();
|
responseMessage.isOk();
|
||||||
|
|||||||
+3
@@ -11,4 +11,7 @@ public interface ImportExcelService extends IService<ImportDto> {
|
|||||||
|
|
||||||
Map<String, List<ImportDto>> getExcelData(MultipartFile file,MultipartFile file2);
|
Map<String, List<ImportDto>> getExcelData(MultipartFile file,MultipartFile file2);
|
||||||
|
|
||||||
|
|
||||||
|
public int storageExclData(Map<String, List<ImportDto>> importListMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+409
@@ -1,25 +1,81 @@
|
|||||||
package com.adc.da.slrs.ImportExcelDatas.service.impl;
|
package com.adc.da.slrs.ImportExcelDatas.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.att.service.IAttFileEOService;
|
||||||
|
import com.adc.da.att.vo.AttFileVo;
|
||||||
|
import com.adc.da.mq.CreateStandMQService;
|
||||||
|
import com.adc.da.scheduled.dao.SarStandardInfoDao;
|
||||||
import com.adc.da.slrs.ImportExcelDatas.dao.ImportExcelDao;
|
import com.adc.da.slrs.ImportExcelDatas.dao.ImportExcelDao;
|
||||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||||
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
|
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
|
||||||
|
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||||
|
import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo;
|
||||||
|
import com.adc.da.slrs.sarBussStandAttrInfo.service.impl.SarBussStandAttrInfoServiceImpl;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.service.impl.SarBussionessStandServiceImpl;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.service.impl.SarStandAttrInfoServiceImpl;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
|
||||||
|
import com.adc.da.slrs.standardSplit.entity.SarStandardsInfoEO;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.tdunning.math.stats.Sort;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDto> implements ImportExcelService {
|
public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDto> implements ImportExcelService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAttFileEOService attFileEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CreateStandMQService createStandMQService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandardsInfoServiceImpl sarStandardsInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandardsInfoDao sarStandardInfoDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandAttrInfoDao sarStandAttrInfoDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarBussionessStandDao sarBussionessStandDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarBussStandAttrInfoDao sarBussStandAttrInfoDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarBussionessStandServiceImpl sarBussionessStandService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarBussStandAttrInfoServiceImpl sarBussStandAttrInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandAttrInfoServiceImpl sarStandAttrInfoService;
|
||||||
|
|
||||||
|
|
||||||
private final static String GN = "GB,GB/T,QC/T,GJB,JB,JT,HG,YV,SY,SH,GA,HJ,QB,JG,NB,JC,YS/T,FZ/T,TB/T,JJG,SJ/T,T/TBPS" +
|
private final static String GN = "GB,GB/T,QC/T,GJB,JB,JT,HG,YV,SY,SH,GA,HJ,QB,JG,NB,JC,YS/T,FZ/T,TB/T,JJG,SJ/T,T/TBPS" +
|
||||||
",NB/T,CJ/T,YS/T,SJ/T,BB/T,SN/T,SB/T,MH/T,DB11,SZDB/Z,HKG,T/ZSA,CSAE,T/CAS,T/CADA,T/CHTS,T/ITS,T/BJQC";
|
",NB/T,CJ/T,YS/T,SJ/T,BB/T,SN/T,SB/T,MH/T,DB11,SZDB/Z,HKG,T/ZSA,CSAE,T/CAS,T/CADA,T/CHTS,T/ITS,T/BJQC";
|
||||||
private final static String QB = "Q/QCBFC,Q/FT,Q/FL,Q/QCFLC,Q/BQB,Q/SGT," +
|
private final static String QB = "Q/QCBFC,Q/FT,Q/FL,Q/QCFLC,Q/BQB,Q/SGT," +
|
||||||
@@ -227,4 +283,357 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int storageExclData(Map<String, List<ImportDto>> importListMap) {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 海外标准
|
||||||
|
*/
|
||||||
|
importListMap.get("HWBZ").forEach(item->{
|
||||||
|
|
||||||
|
String standID = UUIDUtils.randomUUID20();
|
||||||
|
|
||||||
|
SarStandardsInfo sarStandardsInfo = parseImportDtoToStandardsInfo(item, standID);
|
||||||
|
|
||||||
|
|
||||||
|
if (sarStandardsInfo!=null)
|
||||||
|
{
|
||||||
|
SarStandAttrInfo sarStandAttrInfo = parseImportDtoToStandAttrInfo(item, standID);
|
||||||
|
|
||||||
|
sarStandardsInfo.setValidFlag("0");
|
||||||
|
sarStandardsInfo.setStandType("FOREIGN");
|
||||||
|
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||||
|
standSaveWrapper
|
||||||
|
.eq("STAND_SORT",sarStandardsInfo.getStandSort())
|
||||||
|
.eq("STAND_NUMBER",sarStandardsInfo.getStandNumber())
|
||||||
|
.eq("STAND_YEAR",sarStandardsInfo.getStandYear());
|
||||||
|
|
||||||
|
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||||
|
if (one!=null){
|
||||||
|
sarStandardsInfo.setId(one.getId());
|
||||||
|
|
||||||
|
sarStandardsInfoService.update(sarStandardsInfo,standSaveWrapper);
|
||||||
|
QueryWrapper<SarStandAttrInfo> standAttrWrapper = new QueryWrapper<>();
|
||||||
|
standAttrWrapper.eq("STAND_ID",one.getId());
|
||||||
|
|
||||||
|
sarStandAttrInfo.setStandId(one.getId());
|
||||||
|
sarStandAttrInfoService.update(sarStandAttrInfo,standAttrWrapper);
|
||||||
|
}else {
|
||||||
|
sarStandardsInfoService.save(sarStandardsInfo);
|
||||||
|
String field="ID,STAND_ID,VALID_FLAG,DTBJH,SSRQ";
|
||||||
|
String value="\'"+sarStandAttrInfo.getId()+"\'"+","+ "\'"+sarStandAttrInfo.getStandId()+"\'"+","+"\'"+"0"+"\'";
|
||||||
|
|
||||||
|
|
||||||
|
if (sarStandAttrInfo.getDtbjh()!=null){
|
||||||
|
value+=","+"\'"+sarStandAttrInfo.getDtbjh()+"\'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sarStandAttrInfo.getSsrq()!=null){
|
||||||
|
value+=","+"\'"+sarStandAttrInfo.getSsrq()+"\'";
|
||||||
|
}
|
||||||
|
sarStandAttrInfoDao.insertStandAttr(field,value);
|
||||||
|
// sarStandAttrInfoDao.insert(sarStandAttrInfo);
|
||||||
|
// sarStandAttrInfoService.save(sarStandAttrInfo);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内标准
|
||||||
|
*/
|
||||||
|
|
||||||
|
importListMap.get("GNBZ").forEach(item->{
|
||||||
|
String standID = UUIDUtils.randomUUID20();
|
||||||
|
|
||||||
|
SarStandardsInfo sarStandardsInfo = parseImportDtoToStandardsInfo(item, standID);
|
||||||
|
|
||||||
|
if (sarStandardsInfo!=null){
|
||||||
|
SarStandAttrInfo sarStandAttrInfo = parseImportDtoToStandAttrInfo(item, standID);
|
||||||
|
|
||||||
|
sarStandardsInfo.setValidFlag("0");
|
||||||
|
sarStandardsInfo.setStandType("INLAND");
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||||
|
standSaveWrapper
|
||||||
|
.eq("STAND_SORT",sarStandardsInfo.getStandSort())
|
||||||
|
.eq("STAND_NUMBER",sarStandardsInfo.getStandNumber())
|
||||||
|
.eq("STAND_YEAR",sarStandardsInfo.getStandYear());
|
||||||
|
|
||||||
|
|
||||||
|
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||||
|
if (one!=null){
|
||||||
|
sarStandardsInfo.setId(one.getId());
|
||||||
|
sarStandardsInfoService.update(sarStandardsInfo,standSaveWrapper);
|
||||||
|
|
||||||
|
QueryWrapper<SarStandAttrInfo> standAttrWrapper = new QueryWrapper<>();
|
||||||
|
standAttrWrapper.eq("STAND_ID",one.getId());
|
||||||
|
sarStandAttrInfo.setStandId(one.getId());
|
||||||
|
sarStandAttrInfoService.update(sarStandAttrInfo,standAttrWrapper);
|
||||||
|
}else {
|
||||||
|
|
||||||
|
|
||||||
|
sarStandardsInfoService.save(sarStandardsInfo);
|
||||||
|
|
||||||
|
|
||||||
|
String field="ID,STAND_ID,VALID_FLAG,DTBJH,SSRQ";
|
||||||
|
String value="\'"+sarStandAttrInfo.getId()+"\'"+","+"\'"+sarStandAttrInfo.getStandId()+"\'"+","+"\'"+"0"+"\'";
|
||||||
|
|
||||||
|
|
||||||
|
if (sarStandAttrInfo.getDtbjh()!=null){
|
||||||
|
value+=","+"\'"+sarStandAttrInfo.getDtbjh()+"\'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sarStandAttrInfo.getSsrq()!=null){
|
||||||
|
value+=","+"\'"+sarStandAttrInfo.getSsrq()+"\'";
|
||||||
|
}
|
||||||
|
sarStandAttrInfoDao.insertStandAttr(field,value);
|
||||||
|
// sarStandAttrInfoDao.insert(sarStandAttrInfo);
|
||||||
|
// sarStandAttrInfoService.save(sarStandAttrInfo);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
importListMap.get("error").add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业标准
|
||||||
|
*/
|
||||||
|
|
||||||
|
importListMap.get("QYBZ").forEach(item->{
|
||||||
|
String standId=UUIDUtils.randomUUID20();
|
||||||
|
|
||||||
|
SarBussionessStand sarBussionessStand = parseImportDtoToSarBussionessStand(item, standId);
|
||||||
|
|
||||||
|
SarBussStandAttrInfo sarBussStandAttrInfo = parseImportDtoToSarBussStandAttrInfo(item, standId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
QueryWrapper<SarBussionessStand> saveWrapper = new QueryWrapper<>();
|
||||||
|
saveWrapper.eq("STAND_CODE",item.getStandId());
|
||||||
|
SarBussionessStand one = sarBussionessStandService.getOne(saveWrapper);
|
||||||
|
if (one!=null){
|
||||||
|
sarBussionessStandService.update(sarBussionessStand,saveWrapper);
|
||||||
|
|
||||||
|
QueryWrapper<SarBussStandAttrInfo> bussAttrWrapper = new QueryWrapper<>();
|
||||||
|
bussAttrWrapper.eq("STAND_ID",one.getId());
|
||||||
|
sarBussStandAttrInfoService.update(sarBussStandAttrInfo,bussAttrWrapper);
|
||||||
|
sarBussStandAttrInfoDao.updateStandInfo(one.getId(),"GLWJBUSS",sarBussStandAttrInfo.getGlwj());
|
||||||
|
|
||||||
|
}else {
|
||||||
|
sarBussionessStandService.save(sarBussionessStand);
|
||||||
|
sarBussStandAttrInfoService.save(sarBussStandAttrInfo);
|
||||||
|
|
||||||
|
sarBussStandAttrInfoDao.updateStandInfo(sarBussStandAttrInfo.getStandId(),"GLWJBUSS",sarBussStandAttrInfo.getGlwj());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
importListMap.get("error").add(item);
|
||||||
|
System.out.println("issueTime====Hello======"+sarBussionessStand.getIssueTime()+"===hello====="+item);
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
importListMap.get("error");
|
||||||
|
String head="standId,standName,standNameEN,publishTime,implementedTime" +
|
||||||
|
",standStatus,replaceId,path";
|
||||||
|
String headStr="标准号,标准名称,英文名称,发布时间,实施时间,标准状态,代替标准号,附件路径";
|
||||||
|
|
||||||
|
|
||||||
|
List<ImportDto> error = importListMap.get("error");
|
||||||
|
System.out.println(error);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public SarStandardsInfo parseImportDtoToStandardsInfo(ImportDto importDto,String standId){
|
||||||
|
|
||||||
|
String sort="";
|
||||||
|
String number="";
|
||||||
|
String year="";
|
||||||
|
try {
|
||||||
|
String[] sortAndNumberAndYear = importDto.getStandId().split("\\s+");
|
||||||
|
sort = sortAndNumberAndYear[0];
|
||||||
|
String[] numberAndYear = sortAndNumberAndYear[1].split("\\-");
|
||||||
|
number=numberAndYear[0];
|
||||||
|
year=numberAndYear[1];
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
System.out.println("id为"+importDto.getStandId()+"格式无法解析");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||||
|
sarStandardsInfo.setId(standId);
|
||||||
|
|
||||||
|
|
||||||
|
sarStandardsInfo.setStandSort(sort);
|
||||||
|
sarStandardsInfo.setStandNumber(number);
|
||||||
|
sarStandardsInfo.setStandYear(year);
|
||||||
|
|
||||||
|
sarStandardsInfo.setStandName(importDto.getStandName());
|
||||||
|
sarStandardsInfo.setStandEnName(importDto.getStandNameEN());
|
||||||
|
sarStandardsInfo.setIssueTime(importDto.getPublishTime());//标准发布日期
|
||||||
|
|
||||||
|
String standStatus = importDto.getStandStatus();
|
||||||
|
if ("有效".equals(standStatus)){
|
||||||
|
sarStandardsInfo.setTextStatus("vsaga7nwub");//现行有效
|
||||||
|
}
|
||||||
|
|
||||||
|
return sarStandardsInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public SarStandAttrInfo parseImportDtoToStandAttrInfo(ImportDto importDto,String standId) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SarStandAttrInfo sarStandAttrInfo = new SarStandAttrInfo();
|
||||||
|
sarStandAttrInfo.setId(UUIDUtils.randomUUID20());
|
||||||
|
sarStandAttrInfo.setStandId(standId);
|
||||||
|
sarStandAttrInfo.setDtbjh(importDto.getReplaceId());
|
||||||
|
sarStandAttrInfo.setSsrq(importDto.getImplementedTime());
|
||||||
|
sarStandAttrInfo.setValidFlag("0");
|
||||||
|
|
||||||
|
|
||||||
|
// Arrays.stream(path).limit(2,path.length);
|
||||||
|
|
||||||
|
if (importDto.getPath()!=null)
|
||||||
|
{
|
||||||
|
String path[] = importDto.getPath().split("/");
|
||||||
|
String realPath="";
|
||||||
|
for (int i = 4; i < path.length; i++) {
|
||||||
|
realPath=realPath+"\\"+path[i];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||||
|
if (file.exists()){
|
||||||
|
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||||
|
HashMap<String, String> fileMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * @Param: [standId, fileMap] fileMap<field,fileIds>
|
||||||
|
*/
|
||||||
|
fileMap.put("GLWJ",fileInfo.getAttId());
|
||||||
|
try {
|
||||||
|
sarStandardsInfoService.createStandFile(standId,fileMap);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("创建标准文件异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
sarStandAttrInfo.setGlwj(fileInfo.getAttId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return sarStandAttrInfo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public SarBussionessStand parseImportDtoToSarBussionessStand(ImportDto importDto,String standId){
|
||||||
|
|
||||||
|
|
||||||
|
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||||
|
sarBussionessStand.setId(standId);
|
||||||
|
sarBussionessStand.setStandCode(importDto.getStandId());
|
||||||
|
sarBussionessStand.setStandName(importDto.getStandName());
|
||||||
|
sarBussionessStand.setStandEnName(importDto.getStandNameEN());
|
||||||
|
sarBussionessStand.setIssueTime(importDto.getPublishTime());
|
||||||
|
sarBussionessStand.setPutTime(importDto.getImplementedTime());
|
||||||
|
sarBussionessStand.setReplacedStandNum(importDto.getReplaceId());
|
||||||
|
sarBussionessStand.setValidFlag(0);
|
||||||
|
if ("有效".equals(importDto.getStandStatus())){
|
||||||
|
sarBussionessStand.setTextStatusBuss("vsaga7nwub");
|
||||||
|
}
|
||||||
|
return sarBussionessStand;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SarBussStandAttrInfo parseImportDtoToSarBussStandAttrInfo(ImportDto importDto,String standId){
|
||||||
|
SarBussStandAttrInfo sarBussStandAttrInfo = new SarBussStandAttrInfo();
|
||||||
|
sarBussStandAttrInfo.setId(UUIDUtils.randomUUID20());
|
||||||
|
sarBussStandAttrInfo.setStandId(standId);
|
||||||
|
sarBussStandAttrInfo.setValidFlag("0");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (importDto.getPath()!=null)
|
||||||
|
{
|
||||||
|
String path[] = importDto.getPath().split("/");
|
||||||
|
String realPath="";
|
||||||
|
for (int i = 4; i < path.length; i++) {
|
||||||
|
realPath=realPath+"\\"+path[i];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||||
|
if (file.exists()){
|
||||||
|
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||||
|
HashMap<String, String> fileMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * @Param: [standId, fileMap] fileMap<field,fileIds>
|
||||||
|
*/
|
||||||
|
fileMap.put("GLWJBUSS",fileInfo.getAttId());
|
||||||
|
try {
|
||||||
|
sarBussionessStandService.createStandFile(standId,fileMap);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("创建标准文件异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
sarBussStandAttrInfo.setGlwj(fileInfo.getAttId());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return sarBussStandAttrInfo;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -52,6 +52,8 @@ public class SarBussStandAttrInfo extends BaseEntity {
|
|||||||
@TableField("MODIFY_TIME")
|
@TableField("MODIFY_TIME")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
|
|
||||||
|
private String glwj;
|
||||||
//
|
//
|
||||||
// @TableField("SVPPS")
|
// @TableField("SVPPS")
|
||||||
// private String svpps;
|
// private String svpps;
|
||||||
|
|||||||
Reference in New Issue
Block a user