|
|
|
@@ -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) { |
|
|
|
@@ -226,7 +227,6 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
|
|
|
|
doImport(lFile, tenantId, importKey); |
|
|
|
throw new MallinkException(Result.SUCCESS, "模板正在导入"); |
|
|
|
} |
|
|
|
|
|
|
|
private void doImport(File file, String tenantId, String importKey) { |
|
|
|
@@ -830,10 +830,12 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
Map<Long, MallUserInfo> usersMap = getMap(userInfoService.getByIds(getIds(recordList, InvestOperateRecordEntity::getOperator)), MallUserInfo::getId); |
|
|
|
|
|
|
|
//品牌信息 |
|
|
|
Map<String, WxBrand> brandMap = getBrandMap(); |
|
|
|
List<WxBrand> brands = brandService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
Map<Long, WxBrand> brandMap = getMap(brands, WxBrand::getId); |
|
|
|
|
|
|
|
//业态信息 |
|
|
|
Map<String, WxBusiness> businesseMap = getBusinessMap(); |
|
|
|
List<WxBusiness> businesses = businessService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
Map<Integer, WxBusiness> businesseMap = getMap(businesses, WxBusiness::getId); |
|
|
|
|
|
|
|
List<InvestOperateRecordVo> resultList = new ArrayList<>(); |
|
|
|
for (InvestOperateRecordEntity recordEntity : recordList) { |
|
|
|
@@ -952,6 +954,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); |
|
|
|
|