|
@@ -19,6 +19,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -184,7 +185,13 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
|
|
pageIndex=-1;
|
|
pageIndex=-1;
|
|
pageSize=-1;
|
|
pageSize=-1;
|
|
}
|
|
}
|
|
- orderLambdaQueryWrapper.orderByDesc(SalesOrder::getCreateTime);
|
|
|
|
|
|
+ if(isDelete!=null){
|
|
|
|
+ orderLambdaQueryWrapper.eq(SalesOrder::getIsDelete,isDelete);
|
|
|
|
+ orderLambdaQueryWrapper.orderByDesc(SalesOrder::getUpdateTime);
|
|
|
|
+ }else {
|
|
|
|
+ orderLambdaQueryWrapper.eq(SalesOrder::getIsDelete,0);
|
|
|
|
+ orderLambdaQueryWrapper.orderByDesc(SalesOrder::getCreateTime);
|
|
|
|
+ }
|
|
IPage<SalesOrder> orderIPage = salesOrderMapper.selectPage(new Page<>(pageIndex, pageSize), orderLambdaQueryWrapper);
|
|
IPage<SalesOrder> orderIPage = salesOrderMapper.selectPage(new Page<>(pageIndex, pageSize), orderLambdaQueryWrapper);
|
|
List<SalesOrder> records = orderIPage.getRecords();
|
|
List<SalesOrder> records = orderIPage.getRecords();
|
|
List<Integer> orderIds = records.stream().map(SalesOrder::getId).distinct().collect(Collectors.toList());
|
|
List<Integer> orderIds = records.stream().map(SalesOrder::getId).distinct().collect(Collectors.toList());
|
|
@@ -279,8 +286,13 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional
|
|
public HttpRespMsg importData(MultipartFile multipartFile) {
|
|
public HttpRespMsg importData(MultipartFile multipartFile) {
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
|
+ if(!multipartFile.getOriginalFilename().endsWith(".xlsx")){
|
|
|
|
+ msg.setError("文件格式错误,请使用.xlsx格式的Excel文件进行导入");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
String fileName = multipartFile.getOriginalFilename();
|
|
String fileName = multipartFile.getOriginalFilename();
|
|
File file = new File(fileName == null ? "file" : fileName);
|
|
File file = new File(fileName == null ? "file" : fileName);
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
@@ -552,12 +564,14 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
|
|
}
|
|
}
|
|
} catch (IOException | NoSuchMethodException e) {
|
|
} catch (IOException | NoSuchMethodException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ msg.setError("验证失败");
|
|
} catch (IllegalAccessException e) {
|
|
} catch (IllegalAccessException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} catch (InvocationTargetException e) {
|
|
} catch (InvocationTargetException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ msg.setError("验证失败");
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|