|
@@ -208,7 +208,7 @@ public class OrderFormController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String id,
|
|
|
+ String clientName, String clientOrderNumber, String feilihuaOrderNumber, String productName,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -223,8 +223,17 @@ public class OrderFormController {
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("id_","asc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(clientName)) {
|
|
|
+ searchParams.put("clientName","%" + clientName + "%");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(clientOrderNumber)) {
|
|
|
+ searchParams.put("clientOrderNumber","%" + clientOrderNumber + "%");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(feilihuaOrderNumber)) {
|
|
|
+ searchParams.put("feilihuaOrderNumber","%" + feilihuaOrderNumber + "%");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(productName)) {
|
|
|
+ searchParams.put("productName","%" + productName + "%");
|
|
|
}
|
|
|
|
|
|
Page<OrderForm> page = orderFormService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
@@ -251,35 +260,197 @@ public class OrderFormController {
|
|
|
|
|
|
for(int rowIndex=1; rowIndex<=sheet1.getLastRowNum(); rowIndex++){
|
|
|
try {
|
|
|
- String strBatch = poiUtils.getCellValue(0,rowIndex,0).toString();
|
|
|
- String strSerialNo = poiUtils.getCellValue(0,rowIndex,1).toString();
|
|
|
- String strComplainant = poiUtils.getCellValue(0,rowIndex,2).toString();
|
|
|
- String strComplainantPhone = poiUtils.getCellValue(0,rowIndex,3).toString();
|
|
|
- String strProblem = poiUtils.getCellValue(0,rowIndex,4).toString();
|
|
|
- String strArea = poiUtils.getCellValue(0,rowIndex,5).toString();
|
|
|
- String strSpecialClass = poiUtils.getCellValue(0,rowIndex,6).toString();
|
|
|
- String strSuggestedDate = poiUtils.getCellValue(0,rowIndex,7).toString();
|
|
|
- String strOrg = poiUtils.getCellValue(0,rowIndex,8).toString();
|
|
|
- String strWarnDate1 = poiUtils.getCellValue(0,rowIndex,9).toString();
|
|
|
- String strWarnDate2 = poiUtils.getCellValue(0,rowIndex,10).toString();
|
|
|
- String strWarnDate3 = poiUtils.getCellValue(0,rowIndex,11).toString();
|
|
|
- String strAllotedDate = poiUtils.getCellValue(0,rowIndex,12).toString();
|
|
|
- String strRemark = poiUtils.getCellValue(0,rowIndex,13).toString();
|
|
|
-
|
|
|
- //案件信息
|
|
|
-// Incident incident = new Incident();
|
|
|
-// incident.setId(UUID.randomUUID().toString());
|
|
|
-
|
|
|
-// if(StringUtils.isNotEmpty(strSuggestedDate)){
|
|
|
-// incident.setSuggestedDate(sdf.parse(strSuggestedDate));
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写建议办结时限!");
|
|
|
-// failCount++;
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-
|
|
|
-// incidentService.insert(incident);
|
|
|
+ String strClientEmail = poiUtils.getCellValue(0,rowIndex,0).toString();
|
|
|
+ String strClientName = poiUtils.getCellValue(0,rowIndex,1).toString();
|
|
|
+ String strClientOrderNumber = poiUtils.getCellValue(0,rowIndex,2).toString();
|
|
|
+ String strFeilihuaOrderNumber = poiUtils.getCellValue(0,rowIndex,3).toString();
|
|
|
+ String strProductName = poiUtils.getCellValue(0,rowIndex,4).toString();
|
|
|
+ String strTrademark = poiUtils.getCellValue(0,rowIndex,5).toString();
|
|
|
+ String strProductSpecification = poiUtils.getCellValue(0,rowIndex,6).toString();
|
|
|
+ String strOrderQuantity = poiUtils.getCellValue(0,rowIndex,7).toString();
|
|
|
+ String strUnit = poiUtils.getCellValue(0,rowIndex,8).toString();
|
|
|
+ String strRequiredDeliveryTime = poiUtils.getCellValue(0,rowIndex,9).toString();
|
|
|
+ String strReviewDeliveryTime = poiUtils.getCellValue(0,rowIndex,10).toString();
|
|
|
+ String strStockQuantity = poiUtils.getCellValue(0,rowIndex,11).toString();
|
|
|
+ String strProductionQuantity = poiUtils.getCellValue(0,rowIndex,12).toString();
|
|
|
+ String strExpiryTime = poiUtils.getCellValue(0,rowIndex,13).toString();
|
|
|
+
|
|
|
+ //订单信息
|
|
|
+ OrderForm orderForm = new OrderForm();
|
|
|
+ orderForm.setId(UUID.randomUUID().toString());
|
|
|
+ orderForm.setDelFlag(false);
|
|
|
+ orderForm.setCreateBy(subject);
|
|
|
+ orderForm.setCreateTime(new Date());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strClientEmail)){
|
|
|
+ orderForm.setClientEmail(strClientEmail);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写客户邮箱!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strClientName)){
|
|
|
+ orderForm.setClientName(strClientName);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写客户名称!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strClientOrderNumber)){
|
|
|
+ orderForm.setClientOrderNumber(strClientOrderNumber);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写客户订单号!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strFeilihuaOrderNumber)){
|
|
|
+ orderForm.setFeilihuaOrderNumber(strFeilihuaOrderNumber);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写菲利华订单号!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strProductName)){
|
|
|
+ orderForm.setProductName(strProductName);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写产品名称!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strTrademark)){
|
|
|
+ orderForm.setTrademark(strTrademark);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写牌号!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strProductSpecification)){
|
|
|
+ orderForm.setProductSpecification(strProductSpecification);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写产品规格!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strOrderQuantity)){
|
|
|
+ try {
|
|
|
+ orderForm.setOrderQuantity(Integer.parseInt(strOrderQuantity));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("订单数量数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写订单数量!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strUnit)){
|
|
|
+ orderForm.setUnit(strUnit);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写单位!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strRequiredDeliveryTime)){
|
|
|
+ try {
|
|
|
+ orderForm.setRequiredDeliveryTime(sdf.parse(strRequiredDeliveryTime));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("要求交期数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写要求交期!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strReviewDeliveryTime)){
|
|
|
+ try {
|
|
|
+ orderForm.setReviewDeliveryTime(sdf.parse(strReviewDeliveryTime));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("评审交期数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写评审交期!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strStockQuantity)){
|
|
|
+ try {
|
|
|
+ orderForm.setStockQuantity(Integer.parseInt(strStockQuantity));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("库存数量数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写库存数量!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strProductionQuantity)){
|
|
|
+ try {
|
|
|
+ orderForm.setProductionQuantity(Integer.parseInt(strProductionQuantity));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("还需生产数量数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写还需生产数量!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(strExpiryTime)){
|
|
|
+ try {
|
|
|
+ orderForm.setExpiryTime(sdf.parse(strExpiryTime));
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("过期时间数据错误!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("请填写过期时间!");
|
|
|
+ failCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ orderFormService.insert(orderForm);
|
|
|
|
|
|
affectCount++;
|
|
|
}
|
|
@@ -307,7 +478,7 @@ public class OrderFormController {
|
|
|
//格式化holidayInfo
|
|
|
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
String fileName = "error" + sim.format(new Date()) + ".xls";
|
|
|
- String downloadUrl = OSSUtil.upload(ossConfig,"excellent",fileName,input);
|
|
|
+ String downloadUrl = OSSUtil.upload(ossConfig,"FeilihuaOrder",fileName,input);
|
|
|
|
|
|
//todo 返回导入失败报表下载链接
|
|
|
msgResult.setData(downloadUrl);
|