|
|
|
@ -3,8 +3,11 @@ package com.foreverwin.mesnac.dispatch.service.impl;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.foreverwin.mesnac.common.constant.Constants;
|
|
|
|
|
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
|
|
|
|
|
import com.foreverwin.mesnac.common.dto.shopOrderReleaseDto;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.ftp.CappFtpClient;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.ExcelUtils;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.ExceptionUtil;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.GetDrawingVersionUtil;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
@ -38,8 +41,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
@ -104,6 +109,42 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 工艺数据导入
|
|
|
|
|
* @param site
|
|
|
|
|
* @param user
|
|
|
|
|
* @param fileType
|
|
|
|
|
* @param message
|
|
|
|
|
* @param multipartFile
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean importRouter(String site, String user, String fileType, StringBuffer message, MultipartFile multipartFile) throws Exception {
|
|
|
|
|
InputStream inputStream = null;
|
|
|
|
|
//工单List
|
|
|
|
|
List<shopOrderReleaseDto> shopOrderList;
|
|
|
|
|
try {
|
|
|
|
|
shopOrderList = ExcelUtils.readExcel(fileType, shopOrderReleaseDto.class, multipartFile, null);
|
|
|
|
|
} finally {
|
|
|
|
|
if (inputStream != null){
|
|
|
|
|
try {
|
|
|
|
|
inputStream.close();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (shopOrderList == null || shopOrderList.size() <= 0) {
|
|
|
|
|
throw BusinessException.build("上传的Excel没有数据,或者数据格式不正确!");
|
|
|
|
|
}else {
|
|
|
|
|
//导入数据成功
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void shopOrderBomComponentUpdate(String site, String user, List<ShopOrderRelease> shopOrderList) {
|
|
|
|
|
if (shopOrderList == null || shopOrderList.size() <= 0) {
|
|
|
|
|