Commit 73a78212 by zhaoxiaolei

上传校验

parent c4d2be67
...@@ -23,6 +23,8 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -23,6 +23,8 @@ import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List; import java.util.List;
/** /**
...@@ -115,9 +117,9 @@ public class CharacteristicController { ...@@ -115,9 +117,9 @@ public class CharacteristicController {
* @param dto * @param dto
* @param response * @param response
*/ */
@PostMapping("/exportCharacteristic") @GetMapping("/exportCharacteristic")
@ApiOperation(value = "特征管理 导出特征", notes = "特征管理 导出特征", httpMethod = "POST") @ApiOperation(value = "特征管理 导出特征", notes = "特征管理 导出特征", httpMethod = "GET")
public void exportCharacteristic(@RequestBody CharacteristicRequestParamDto dto, HttpServletResponse response){ public void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response) throws ParseException, IOException {
characteristicService.exportCharacteristic(dto,response); characteristicService.exportCharacteristic(dto,response);
} }
......
...@@ -103,9 +103,9 @@ public class CharacteristicValueController { ...@@ -103,9 +103,9 @@ public class CharacteristicValueController {
* @param dto * @param dto
* @param response * @param response
*/ */
@PostMapping("/exportCharacteristicValue") @GetMapping("/exportCharacteristicValue")
@ApiOperation(value = "特征值管理 导出特征值", notes = "特征值管理 导出特征值", httpMethod = "GPOSTET") @ApiOperation(value = "特征值管理 导出特征值", notes = "特征值管理 导出特征值", httpMethod = "GET")
public void exportCharacteristicValue(@RequestBody CharacteristicValueRequestParamDto dto, HttpServletResponse response){ public void exportCharacteristicValue(CharacteristicValueRequestParamDto dto, HttpServletResponse response){
characteristicValueService.exportCharacteristicValue(dto,response); characteristicValueService.exportCharacteristicValue(dto,response);
} }
......
...@@ -75,9 +75,9 @@ public class SuperBomPriceCalculateController { ...@@ -75,9 +75,9 @@ public class SuperBomPriceCalculateController {
* @param dto * @param dto
* @param response * @param response
*/ */
@PostMapping("/exportCharacteristicValuePrice") @GetMapping("/exportCharacteristicValuePrice")
@ApiOperation(value = "特征值价格管理 导出特征值价格", notes = "特征值价格管理 导出特征值价格", httpMethod = "POST") @ApiOperation(value = "特征值价格管理 导出特征值价格", notes = "特征值价格管理 导出特征值价格", httpMethod = "GET")
public void exportCharacteristicValuePrice(@RequestBody CharacteristicValueExportDto dto, HttpServletResponse response){ public void exportCharacteristicValuePrice( CharacteristicValueExportDto dto, HttpServletResponse response){
superBomPriceCalculateService.exportCharacteristicValuePrice(dto,response); superBomPriceCalculateService.exportCharacteristicValuePrice(dto,response);
} }
......
...@@ -27,6 +27,8 @@ public class CharacteristicExportDto implements Serializable { ...@@ -27,6 +27,8 @@ public class CharacteristicExportDto implements Serializable {
*/ */
@FieldNameMapping(name = "superBomCode", value = "SuperBOM") @FieldNameMapping(name = "superBomCode", value = "SuperBOM")
private String superBomCode; private String superBomCode;
@FieldNameMapping(name = "superBomName", value = "superBomName")
private String superBomName;
/** /**
* 特征编码 * 特征编码
*/ */
......
...@@ -23,6 +23,8 @@ public class CharacteristicValueExportDto implements Serializable{ ...@@ -23,6 +23,8 @@ public class CharacteristicValueExportDto implements Serializable{
*/ */
@FieldNameMapping(name = "superBomCode", value = "SuperBOM") @FieldNameMapping(name = "superBomCode", value = "SuperBOM")
private String superBomCode; private String superBomCode;
@FieldNameMapping(name = "superBomName", value = "superBomName")
private String superBomName;
/** /**
* 特征编码 * 特征编码
......
...@@ -8,6 +8,9 @@ import com.github.pagehelper.PageInfo; ...@@ -8,6 +8,9 @@ import com.github.pagehelper.PageInfo;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.List; import java.util.List;
/** /**
...@@ -57,7 +60,7 @@ public interface CharacteristicService { ...@@ -57,7 +60,7 @@ public interface CharacteristicService {
Object updateCharacteristicIsH3C(CharacteristicRequestParamDto dto); Object updateCharacteristicIsH3C(CharacteristicRequestParamDto dto);
void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response); void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response) throws ParseException, IOException;
Object batchUpdateByUpload(MultipartFile file); Object batchUpdateByUpload(MultipartFile file);
} }
...@@ -72,7 +72,7 @@ public interface CharacteristicValueService { ...@@ -72,7 +72,7 @@ public interface CharacteristicValueService {
* @param file * @param file
* @return * @return
*/ */
String batchUpdateByUpload(MultipartFile file); Object batchUpdateByUpload(MultipartFile file);
/** /**
* @desc 询配询价 导出可用配置和OD关系表 * @desc 询配询价 导出可用配置和OD关系表
......
...@@ -4,6 +4,7 @@ import cn.com.uitech.authorization.exception.BizException; ...@@ -4,6 +4,7 @@ import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.CharacteristicMapper; import cn.com.uitech.authorization.mapper.CharacteristicMapper;
import cn.com.uitech.authorization.pojo.dto.CharacteristicExportDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicExportDto;
import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto; import cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.GetProductOutDto;
import cn.com.uitech.authorization.pojo.entity.Characteristic; import cn.com.uitech.authorization.pojo.entity.Characteristic;
import cn.com.uitech.authorization.service.CharacteristicService; import cn.com.uitech.authorization.service.CharacteristicService;
import cn.com.uitech.authorization.service.CtoBomService; import cn.com.uitech.authorization.service.CtoBomService;
...@@ -29,8 +30,11 @@ import tk.mybatis.mapper.entity.Example; ...@@ -29,8 +30,11 @@ import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.*; import java.util.*;
/** /**
...@@ -131,9 +135,8 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -131,9 +135,8 @@ public class CharacteristicServiceImpl implements CharacteristicService {
} }
@Override @Override
public void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response) { public void exportCharacteristic(CharacteristicRequestParamDto dto, HttpServletResponse response) throws ParseException, IOException {
//根据页面输入框查询要导出的数据 //根据页面输入框查询要导出的数据
try {
Date date = DateUitl.getNowAll(); Date date = DateUitl.getNowAll();
String format = DateUitl.format(date, "yyyy-MM-dd"); String format = DateUitl.format(date, "yyyy-MM-dd");
String[] split = format.split("-"); String[] split = format.split("-");
...@@ -146,11 +149,11 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -146,11 +149,11 @@ public class CharacteristicServiceImpl implements CharacteristicService {
List<CharacteristicExportDto> excelDtos = new ArrayList<>(); List<CharacteristicExportDto> excelDtos = new ArrayList<>();
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
file = dto.getSuperBomCode() + worktableTitle + ".xls";
//根据页面输入框查询要导出的数据 //根据页面输入框查询要导出的数据
priceModelList = characteristicMapper.exportCharacteristic(dto); priceModelList = characteristicMapper.exportCharacteristic(dto);
excelDtos = exportStandBom(priceModelList); excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos); wb = exportExcelBom(excelDtos);
file = dto.getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征信息" + ".xls";
String filename = null; String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1); filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
...@@ -160,9 +163,6 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -160,9 +163,6 @@ public class CharacteristicServiceImpl implements CharacteristicService {
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
wb.write(outputStream); wb.write(outputStream);
outputStream.close(); outputStream.close();
} catch (Exception e) {
throw new BizException(ApiResult.INTERNAL_SERVER_ERROR, e.getMessage());
}
} }
private List<CharacteristicExportDto> exportStandBom(List<CharacteristicExportDto> priceModelList) { private List<CharacteristicExportDto> exportStandBom(List<CharacteristicExportDto> priceModelList) {
...@@ -299,26 +299,37 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -299,26 +299,37 @@ public class CharacteristicServiceImpl implements CharacteristicService {
* @desc 特征管理 上传文件更新 * @desc 特征管理 上传文件更新
*/ */
@Override @Override
public String batchUpdateByUpload(MultipartFile file) { public GetProductOutDto batchUpdateByUpload(MultipartFile file) {
int result = 0; GetProductOutDto result = new GetProductOutDto();
//判断文件是否为空 try {
if (null == file || file.isEmpty()) { //判断文件是否为空
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征上传文件批量更新-上传文件为空"); if (null == file || file.isEmpty()) {
} throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征上传文件批量更新-上传文件为空");
//读取文件内容
List<CharacteristicExportDto> list = uploadExcl(file);
//非空校验
if (!CollectionUtils.isEmpty(list)) {
ArrayList<String> checkFileIsNull = checkFileIsNull(list);
if (!CollectionUtils.isEmpty(checkFileIsNull)) {
return String.valueOf(checkFileIsNull);
} }
} else { //读取文件内容
List<CharacteristicExportDto> list = uploadExcl(file);
//非空校验
if (!CollectionUtils.isEmpty(list)) {
ArrayList<String> checkFileIsNull = checkFileIsNull(list);
if (!CollectionUtils.isEmpty(checkFileIsNull)) {
result.setData(null);
result.setMsg(String.valueOf(checkFileIsNull));
result.setCode(500);
return result;
}
} else {
}
updateData(list);
result.setData(null);
result.setMsg("更新附件内容成功");
result.setCode(200);
return result;
} catch (Exception e) {
result.setData(null);
result.setMsg("特征上传文件批量更新-请检查上传文件");
result.setCode(500);
return result;
} }
updateData(list);
return "更新附件内容成功";
} }
/** /**
...@@ -379,12 +390,11 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -379,12 +390,11 @@ public class CharacteristicServiceImpl implements CharacteristicService {
* @return List<CharacteristicExportDto> * @return List<CharacteristicExportDto>
* @desc 解析上传文件 * @desc 解析上传文件
*/ */
public List<CharacteristicExportDto> uploadExcl(MultipartFile file) { public List<CharacteristicExportDto> uploadExcl(MultipartFile file) throws IOException {
long startDate = Calendar.getInstance().getTimeInMillis(); List<CharacteristicExportDto> list = Lists.newArrayList();
List<CharacteristicExportDto> list = Lists.newArrayList();
Workbook wook = null;
try { try {
Workbook wook = null;
String filename = file.getOriginalFilename(); String filename = file.getOriginalFilename();
if (filename.endsWith("xls")) { if (filename.endsWith("xls")) {
ZipSecureFile.setMinInflateRatio(-1.0d); ZipSecureFile.setMinInflateRatio(-1.0d);
...@@ -400,16 +410,21 @@ public class CharacteristicServiceImpl implements CharacteristicService { ...@@ -400,16 +410,21 @@ public class CharacteristicServiceImpl implements CharacteristicService {
int rows = sheetAt.getPhysicalNumberOfRows(); int rows = sheetAt.getPhysicalNumberOfRows();
for (int j = 1; j < rows; j++) { for (int j = 1; j < rows; j++) {
Row row = sheetAt.getRow(j); Row row = sheetAt.getRow(j);
int cells = row.getPhysicalNumberOfCells(); Integer cells = row.getPhysicalNumberOfCells();
//把每条数据封装进对象里 if (cells.equals(6)) {
CharacteristicExportDto dto = setCharacteristicExportDto(row, cells); //把每条数据封装进对象里
list.add(dto); CharacteristicExportDto dto = setCharacteristicExportDto(row, cells);
list.add(dto);
} else {
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征上传文件批量更新-请检查上传文件");
}
} }
} }
} catch (Exception e) {
e.printStackTrace(); }catch (Exception e){
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征上传文件批量更新-请检查上传文件");
} }
long endDate = Calendar.getInstance().getTimeInMillis();
return list; return list;
} }
......
...@@ -218,11 +218,11 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -218,11 +218,11 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
List<CharacteristicValueExportDto> excelDtos = new ArrayList<>(); List<CharacteristicValueExportDto> excelDtos = new ArrayList<>();
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
file = dto.getSuperBomCode() + worktableTitle + ".xls";
//根据页面输入框查询要导出的数据 //根据页面输入框查询要导出的数据
priceModelList = characteristicValueMapper.exportCharacteristicValue(dto); priceModelList = characteristicValueMapper.exportCharacteristicValue(dto);
excelDtos = exportStandBom(priceModelList); excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos); wb = exportExcelBom(excelDtos);
file = dto.getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征值信息" + ".xls";
String filename = null; String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1); filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
...@@ -444,8 +444,9 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -444,8 +444,9 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
* @desc 特征值管理 上传文件更新 * @desc 特征值管理 上传文件更新
*/ */
@Override @Override
public String batchUpdateByUpload(MultipartFile file) { public GetProductOutDto batchUpdateByUpload(MultipartFile file) {
int result = 0; GetProductOutDto result = new GetProductOutDto();
try {
//判断文件是否为空 //判断文件是否为空
if (null == file || file.isEmpty()) { if (null == file || file.isEmpty()) {
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值上传文件批量更新-上传文件为空"); throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值上传文件批量更新-上传文件为空");
...@@ -456,13 +457,23 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -456,13 +457,23 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
ArrayList<String> checkFileIsNull = checkFileIsNull(list); ArrayList<String> checkFileIsNull = checkFileIsNull(list);
if (!CollectionUtils.isEmpty(checkFileIsNull)) { if (!CollectionUtils.isEmpty(checkFileIsNull)) {
return String.valueOf(checkFileIsNull); result.setData(null);
result.setMsg(String.valueOf(checkFileIsNull));
result.setCode(500);
return result;
} }
} else {
} }
updateData(list); updateData(list);
result.setData(null);
return "更新附件内容成功"; result.setMsg("更新附件内容成功");
result.setCode(200);
return result;
} catch (Exception e) {
result.setData(null);
result.setMsg("特征值上传文件批量更新-请检查上传文件");
result.setCode(500);
return result;
}
} }
...@@ -528,7 +539,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -528,7 +539,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
* @desc 解析上传文件 * @desc 解析上传文件
*/ */
public List<CharacteristicValueExportDto> uploadExcl(MultipartFile file) { public List<CharacteristicValueExportDto> uploadExcl(MultipartFile file) {
long startDate = Calendar.getInstance().getTimeInMillis();
List<CharacteristicValueExportDto> list = Lists.newArrayList(); List<CharacteristicValueExportDto> list = Lists.newArrayList();
Workbook wook = null; Workbook wook = null;
...@@ -548,16 +558,19 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -548,16 +558,19 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
int rows = sheetAt.getPhysicalNumberOfRows(); int rows = sheetAt.getPhysicalNumberOfRows();
for (int j = 1; j < rows; j++) { for (int j = 1; j < rows; j++) {
Row row = sheetAt.getRow(j); Row row = sheetAt.getRow(j);
int cells = row.getPhysicalNumberOfCells(); Integer cells = row.getPhysicalNumberOfCells();
//把每条数据封装进对象里 if (cells.equals(12)) {
CharacteristicValueExportDto dto = setCharacteristicValueExportDto(row, cells); //把每条数据封装进对象里
list.add(dto); CharacteristicValueExportDto dto = setCharacteristicValueExportDto(row, cells);
list.add(dto);
} else {
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值上传文件批量更新-请检查上传文件");
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值上传文件批量更新-请检查上传文件");
} }
long endDate = Calendar.getInstance().getTimeInMillis();
return list; return list;
} }
......
...@@ -275,7 +275,6 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -275,7 +275,6 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
List<SuperCharacterPriceInfoDto> excelDtos = new ArrayList<>(); List<SuperCharacterPriceInfoDto> excelDtos = new ArrayList<>();
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
file = "特征值价格" + worktableTitle + ".xls";
//根据页面输入框查询要导出的数据 //根据页面输入框查询要导出的数据
priceModelList = superBomPriceCalculateMapper.exportCharacteristicValuePrice(dto); priceModelList = superBomPriceCalculateMapper.exportCharacteristicValuePrice(dto);
if (ObjectUtils.isEmpty(priceModelList)) { if (ObjectUtils.isEmpty(priceModelList)) {
...@@ -313,6 +312,7 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -313,6 +312,7 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
excelDtos = exportStandBom(priceModelList); excelDtos = exportStandBom(priceModelList);
wb = exportExcelBom(excelDtos); wb = exportExcelBom(excelDtos);
file = priceModelList.get(0).getSuperBomCode() + priceModelList.get(0).getSuperBomName() + "特征值价格信息" + ".xls";
String filename = null; String filename = null;
filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1); filename = new String(file.getBytes("GBK"), StandardCharsets.ISO_8859_1);
response.setContentType("APPLICATION/OCTET-STREAM"); response.setContentType("APPLICATION/OCTET-STREAM");
...@@ -548,8 +548,9 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -548,8 +548,9 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
* @desc 特征值价格管理 上传文件更新 * @desc 特征值价格管理 上传文件更新
*/ */
@Override @Override
public String batchUpdateByUpload(MultipartFile file) { public GetProductOutDto batchUpdateByUpload(MultipartFile file) {
int result = 0; GetProductOutDto result = new GetProductOutDto();
try {
//判断文件是否为空 //判断文件是否为空
if (null == file || file.isEmpty()) { if (null == file || file.isEmpty()) {
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值价格上传文件批量更新-上传文件为空"); throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值价格上传文件批量更新-上传文件为空");
...@@ -560,13 +561,23 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -560,13 +561,23 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
ArrayList<String> checkFileIsNull = checkFileIsNull(list); ArrayList<String> checkFileIsNull = checkFileIsNull(list);
if (!CollectionUtils.isEmpty(checkFileIsNull)) { if (!CollectionUtils.isEmpty(checkFileIsNull)) {
return String.valueOf(checkFileIsNull); result.setData(null);
result.setMsg(String.valueOf(checkFileIsNull));
result.setCode(500);
return result;
} }
} else {
} }
updateData(list); updateData(list);
result.setData(null);
return "更新附件内容成功"; result.setMsg("更新附件内容成功");
result.setCode(200);
return result;
} catch (Exception e) {
result.setData(null);
result.setMsg("特征值价格上传文件批量更新-请检查上传文件");
result.setCode(500);
return result;
}
} }
...@@ -645,7 +656,6 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -645,7 +656,6 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
* @desc 解析上传文件 * @desc 解析上传文件
*/ */
public List<SuperCharacterPriceInfoDto> uploadExcl(MultipartFile file) { public List<SuperCharacterPriceInfoDto> uploadExcl(MultipartFile file) {
long startDate = Calendar.getInstance().getTimeInMillis();
List<SuperCharacterPriceInfoDto> list = Lists.newArrayList(); List<SuperCharacterPriceInfoDto> list = Lists.newArrayList();
Workbook wook = null; Workbook wook = null;
...@@ -665,16 +675,19 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate ...@@ -665,16 +675,19 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
int rows = sheetAt.getPhysicalNumberOfRows(); int rows = sheetAt.getPhysicalNumberOfRows();
for (int j = 1; j < rows; j++) { for (int j = 1; j < rows; j++) {
Row row = sheetAt.getRow(j); Row row = sheetAt.getRow(j);
int cells = row.getPhysicalNumberOfCells(); Integer cells = row.getPhysicalNumberOfCells();
//把每条数据封装进对象里 if (cells.equals(14)) {
SuperCharacterPriceInfoDto dto = setCharacteristicPriceExportDto(row, cells); //把每条数据封装进对象里
list.add(dto); SuperCharacterPriceInfoDto dto = setCharacteristicPriceExportDto(row, cells);
list.add(dto);
} else {
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值价格上传文件批量更新-请检查上传文件");
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值价格上传文件批量更新-请检查上传文件");
} }
long endDate = Calendar.getInstance().getTimeInMillis();
return list; return list;
} }
......
...@@ -238,6 +238,7 @@ ...@@ -238,6 +238,7 @@
select select
sort, sort,
a.super_bom_code as superBomCode, a.super_bom_code as superBomCode,
b.super_bom_name as superBomName,
characteristic_code as characteristicCode, characteristic_code as characteristicCode,
characteristic_name as characteristicName, characteristic_name as characteristicName,
unis_sales_c_name as unisSalesCName, unis_sales_c_name as unisSalesCName,
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
resultType="cn.com.uitech.authorization.pojo.dto.CharacteristicValueExportDto"> resultType="cn.com.uitech.authorization.pojo.dto.CharacteristicValueExportDto">
SELECT DISTINCT SELECT DISTINCT
a.super_bom_code as superBomCode, a.super_bom_code as superBomCode,
c.super_bom_name as superBomName,
a.Characteristic_Code as CharacteristicCode, a.Characteristic_Code as CharacteristicCode,
b.unis_Sales_C_Name as CharacteristicName, b.unis_Sales_C_Name as CharacteristicName,
A.Characteristic_Value_Code AS CharacteristicValueCode, A.Characteristic_Value_Code AS CharacteristicValueCode,
...@@ -180,7 +181,7 @@ ...@@ -180,7 +181,7 @@
b.sort b.sort
FROM FROM
super_characteristic_value_info super_characteristic_value_info
A LEFT JOIN super_characteristic_info b ON A.Characteristic_Code = b.Characteristic_Code A LEFT JOIN super_characteristic_info b ON A.Characteristic_Code = b.Characteristic_Code AND A.super_bom_code = B.super_bom_code
LEFT JOIN super_bom_info C ON b.super_BOM_Code = c.super_BOM_Code LEFT JOIN super_bom_info C ON b.super_BOM_Code = c.super_BOM_Code
<where> <where>
<if test="productClassCode!=null and productClassCode!=''"> <if test="productClassCode!=null and productClassCode!=''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment