|
|
|
@@ -37,10 +37,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.BufferedInputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.function.Function; |
|
|
|
@@ -186,8 +183,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
targetFile.mkdirs(); |
|
|
|
} |
|
|
|
String fileName = "invest_1.xlsx"; |
|
|
|
int dot = mFile.getOriginalFilename().lastIndexOf('.'); |
|
|
|
fileName = fileName + mFile.getOriginalFilename().substring(dot); |
|
|
|
//int dot = mFile.getOriginalFilename().lastIndexOf('.'); |
|
|
|
//fileName = fileName + mFile.getOriginalFilename().substring(dot); |
|
|
|
|
|
|
|
File lFile = new File(fpath + File.separator + fileName); |
|
|
|
|
|
|
|
@@ -195,7 +192,11 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
BufferedInputStream fs = null; |
|
|
|
try { |
|
|
|
fos = new FileOutputStream(lFile); |
|
|
|
fs = (BufferedInputStream) mFile.getInputStream(); |
|
|
|
if (mFile.getInputStream() instanceof ByteArrayInputStream) { |
|
|
|
fs = new BufferedInputStream(mFile.getInputStream()); |
|
|
|
} else { |
|
|
|
fs = (BufferedInputStream) mFile.getInputStream(); |
|
|
|
} |
|
|
|
byte[] buffer = new byte[1024]; |
|
|
|
int len = 0; |
|
|
|
while ((len = fs.read(buffer)) != -1) { |
|
|
|
@@ -952,6 +953,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
private InvestDemandVo buildDemindItem(InvestDemandEntity item, InvestCustomerEntity customer, WxBrand brand, |
|
|
|
WxShop shop, Map<Long, MallUserInfo> usersMap) { |
|
|
|
if (Objects.isNull(customer.getBrandId())) { |
|
|
|
customer.setBrandId(null); |
|
|
|
} |
|
|
|
InvestDemandVo resultItemVo = new InvestDemandVo(); |
|
|
|
BeanUtils.copyProperties(customer, resultItemVo); |
|
|
|
resultItemVo.setBrand(brand); |
|
|
|
|