提交 0e3d4776 authored 作者: zhoushaopan's avatar zhoushaopan

feat(配套模块): 修改导入excel

修改导入excel
上级 06e8aabb
...@@ -157,7 +157,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -157,7 +157,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//型号 名称 //型号 名称
predicateBuilder.eq(deviceLibrarySelectVo.getModel() != null,"model",deviceLibrarySelectVo.getModel()); predicateBuilder.eq(deviceLibrarySelectVo.getModel() != null,"model",deviceLibrarySelectVo.getModel());
predicateBuilder.eq(deviceLibrarySelectVo.getName() != null,"name",deviceLibrarySelectVo.getName()); predicateBuilder.eq(deviceLibrarySelectVo.getName() != null,"name",deviceLibrarySelectVo.getName());
return deviceLibraryDao.findAll(predicateBuilder.build()); List<DeviceLibrary> deviceLibraryList = deviceLibraryDao.findAll(predicateBuilder.build());
deviceLibraryList.forEach(DeviceLibrary::setConfigName);
return deviceLibraryList;
} }
@Override @Override
......
...@@ -516,7 +516,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -516,7 +516,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
// file.createNewFile(); // file.createNewFile();
log.info("创建文件夹"); log.info("创建文件夹");
} }
FileOutputStream fileOutputStream = new FileOutputStream(file + uuid + ".xlsx"); FileOutputStream fileOutputStream = new FileOutputStream(fileExcel + uuid + ".xlsx");
workbook.write(fileOutputStream); workbook.write(fileOutputStream);
fileOutputStream.close(); fileOutputStream.close();
return uuid+ ".xlsx"; return uuid+ ".xlsx";
......
package com.tykj.dev.device.matching.subject.vo; package com.tykj.dev.device.matching.subject.vo;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill; import com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -61,6 +62,8 @@ public class MatchingDeviceBillSaveVo { ...@@ -61,6 +62,8 @@ public class MatchingDeviceBillSaveVo {
BeanUtils.copyProperties(this, matchingDeviceBillEntity); BeanUtils.copyProperties(this, matchingDeviceBillEntity);
matchingDeviceBillEntity.setBillStatus(2); matchingDeviceBillEntity.setBillStatus(2);
matchingDeviceBillEntity.setDeviceDetail("x"); matchingDeviceBillEntity.setDeviceDetail("x");
//单独处理单据
matchingDeviceBillEntity.setFileRets(FilesUtil.stringFileToList(this.getFileRets()));
return matchingDeviceBillEntity; return matchingDeviceBillEntity;
} }
} }
...@@ -93,6 +93,7 @@ public class MatchingDeviceSaveVo { ...@@ -93,6 +93,7 @@ public class MatchingDeviceSaveVo {
private String signDate; private String signDate;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
@Excel(name = "备注")
private String remake; private String remake;
// @NotNull(message = "type不能为空") // @NotNull(message = "type不能为空")
...@@ -143,7 +144,9 @@ public class MatchingDeviceSaveVo { ...@@ -143,7 +144,9 @@ public class MatchingDeviceSaveVo {
matchingDeviceLibraryEntity.setLifeStatus(2); matchingDeviceLibraryEntity.setLifeStatus(2);
matchingDeviceLibraryEntity.setDeviceId(0); matchingDeviceLibraryEntity.setDeviceId(0);
matchingDeviceLibraryEntity.setLocationUnitId(this.createUnitId); matchingDeviceLibraryEntity.setLocationUnitId(this.createUnitId);
matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate)); if (this.signDate != null && !"".equals(this.signDate)){
matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate));
}
//签订日期进行时间的转换 //签订日期进行时间的转换
// matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate)); // matchingDeviceLibraryEntity.setSignDate(DateUtil.string2LocalDate(this.signDate));
// if (matchingDeviceLibraryEntity.getRfidCardId()==null||"".equals(matchingDeviceLibraryEntity.getRfidCardId())){ // if (matchingDeviceLibraryEntity.getRfidCardId()==null||"".equals(matchingDeviceLibraryEntity.getRfidCardId())){
......
...@@ -107,7 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -107,7 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.cors() .cors()
.and() .and()
.authorizeRequests() .authorizeRequests()
.antMatchers("/file/**","/actuator/**","/admin/**").permitAll() .antMatchers("/file/**","/actuator/**","/admin/**","/excel/**").permitAll()
.antMatchers("/file/llq/**").permitAll() .antMatchers("/file/llq/**").permitAll()
.antMatchers("/login/impersonate*").permitAll() .antMatchers("/login/impersonate*").permitAll()
.antMatchers("/logout/impersonate*").permitAll() .antMatchers("/logout/impersonate*").permitAll()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论