generated from root/miduo_server
master
parent
cf2608222a
commit
8c3f8168ef
|
|
@ -6,6 +6,8 @@ import com.jmfy.model.*;
|
|||
import com.jmfy.model.vo.CDKInfoVo;
|
||||
import com.jmfy.model.vo.UseCDKInfoVo;
|
||||
import com.jmfy.utils.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
|
@ -25,6 +27,7 @@ import java.util.*;
|
|||
*/
|
||||
@Controller
|
||||
public class CdkInfoController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CdkInfoController.class);
|
||||
@Resource
|
||||
private CdkInfoDao cdkInfoDao;
|
||||
@Resource
|
||||
|
|
@ -135,13 +138,13 @@ public class CdkInfoController {
|
|||
path = "./config/txt/";
|
||||
}
|
||||
List<CdkInfo> cdkInfoList = cdkInfoDao.findCdkUseInfoByGoodsId(goodsId);
|
||||
|
||||
path = path + "cdk_"+goodsId + System.currentTimeMillis()+"_.txt";
|
||||
List<String> cdkNumList = new ArrayList<>();
|
||||
for (CdkInfo cdkInfo :cdkInfoList){
|
||||
cdkNumList.add(cdkInfo.getId());
|
||||
}
|
||||
TXTUtils.writeToTxt(cdkNumList ,path);
|
||||
LOGGER.info("downloadFile=>path={}",path);
|
||||
File file = new File(path);
|
||||
return TXTUtils.buildResponseEntity(file);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue