工艺卡片查看,物流相关模块。

master
yangwl 3 years ago
parent 1083002a16
commit 84663f802b

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.anomaly.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.foreverwin.mesnac.anomaly.model.AbnormalPlan;
import java.time.LocalDateTime;
@ -25,6 +26,16 @@ public class AbnormalPlanDto extends AbnormalPlan {
private String ReapirContent;
private String sendUserGroupDescription;
public String getSendUserGroupDescription() {
return sendUserGroupDescription;
}
public void setSendUserGroupDescription(String sendUserGroupDescription) {
this.sendUserGroupDescription = sendUserGroupDescription;
}
public String getReapirContent() {
return ReapirContent;
}

@ -557,7 +557,7 @@
SELECT ZAP.ABNORMAL_NO ABNORMAL_NO ,ZAP.ABNORMAL_METHOD ABNORMAL_METHOD ,
ZAP.SHOP_ORDER SHOP_ORDER ,R.RESRCE RESRCE,R.DESCRIPTION RESRCE_DESCRIPTION,ZAP.STATUS STATUS ,I.ITEM ITEM,
IT.DESCRIPTION ITEM_DESCRIPTION,ZAP.QTY QTY ,ZNU.FULL_NAME FULL_NAME,
ZAP.SEND_USER_GROUP SEND_USER_GROUP,RT.ROUTER REPAIR_ROUTER,RT.HANDLE RT_HANDLE
ZAP.SEND_USER_GROUP SEND_USER_GROUP,UGP.DESCRIPTION SEND_USER_GROUP_DESCRIPTION,ROUTER REPAIR_ROUTER,RT.HANDLE RT_HANDLE
FROM Z_ABNORMAL_PLAN ZAP
INNER JOIN Z_ABNORMAL_BILL ZAB ON ZAB.ABNORMAL_NO = ZAP.ABNORMAL_NO AND ZAB.SITE = #{abnormalPlanDto.site}
AND ZAB.TYPE = 'Z'
@ -567,6 +567,7 @@
LEFT JOIN ITEM I ON I.HANDLE = ZAP.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = ZAP.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAP.PROCESSOR AND ZNU.SITE = ZAP.SITE
LEFT JOIN USER_GROUP UGP ON ZAP.SEND_USER_GROUP=UGP.USER_GROUP
<where>
ZAP.SITE =#{abnormalPlanDto.site}
<if test="abnormalPlanDto.workCenter != null and abnormalPlanDto.workCenter != ''">

@ -213,4 +213,10 @@ public interface Constants {
String USER_GROUP_CJDD = "CJDD";
//总计划
String USER_GROUP_ZJH = "ZJH";
//物料转运
String LOGISTICS_NEW="NEW";
String LOGISTICS_TRANSPORT="LOGISTICS_TRANSPORT";
String LOGISTICS_COM="COM";
}

@ -1,7 +1,8 @@
package com.foreverwin.mesnac.common.controller;
import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.ftp.DrawingFtpClient;
import com.foreverwin.mesnac.common.ftp.JSchClient;
import com.foreverwin.mesnac.common.ftp.WorkmanshipCardFtpClient;
import com.foreverwin.mesnac.common.service.FileService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException;
@ -39,11 +40,17 @@ public class FileController {
private final Logger logger = LoggerFactory.getLogger(FileController.class);
private static String TYPE=null;
@Autowired
private FileService fileService;
@Autowired
public CappFtpClient ftpClient;
public DrawingFtpClient ftpClient;
@Autowired
public WorkmanshipCardFtpClient workmanshipCardFtpClient;
/**
@ -77,12 +84,13 @@ public class FileController {
*/
@ResponseBody
@RequestMapping(method = RequestMethod.GET, value = "/getPdfPathByItem")
public R getPdfPathByItemBo(String itemBo) {
public R getPdfPathByItemBo(String itemBo,String type) {
if (StringUtils.isBlank(itemBo)) {
throw new BaseException("物料编码不能为空!");
}
try {
Map<String, String> paths = fileService.getFilePathsByItemBoSFTP(itemBo);
Map<String, String> paths = fileService.getFilePathsByItemBoSFTP(itemBo,type);
if (paths.size() == 0) {
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认!");
}
@ -101,7 +109,7 @@ public class FileController {
}
/**
*
*
*
* @return
*/
@ -111,14 +119,18 @@ public class FileController {
InputStream in = null;
OutputStream out = null;
String path = request.getParameter("Path");
try {
//服务器发布
//String coderPath = new String(path.getBytes("ISO8859_1"));
//String newPath = new String(coderPath.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING);
//in = ftpClient.getFtp(path);
// if (null == in && Type.equals("DRAWING")) {
// in= fileService.getSFTP(path);
// // in = workmanshipCardFtpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
// }
if (null == in) {
in = fileService.getSFTP(path);
// in = ftpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
in = workmanshipCardFtpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
}
//本地测试
/*String newPath = new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING);
@ -143,7 +155,6 @@ public class FileController {
out = response.getOutputStream();
out.write(data);
out.flush();
/* byte[] buffer = new byte[1024];
int len = 0;
while ((len = in.read(buffer)) != -1) {
@ -171,6 +182,9 @@ public class FileController {
}
/**
*
*

@ -0,0 +1,366 @@
package com.foreverwin.mesnac.common.ftp;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPClientConfig;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import java.io.*;
import java.net.SocketException;
import java.util.regex.Matcher;
@Component
@ConditionalOnProperty( prefix = "drawingftp", name = { "server", "port", "username", "password", "uploadDir", "downloadDir" }, matchIfMissing = false )
public class DrawingFtpClient {
private FTPClient ftp;
@Value("${drawingftp.server}")
private String address;
@Value("${drawingftp.port}")
private int port;
@Value("${drawingftp.username}")
private String userName;
@Value("${drawingftp.password}")
private String password;
@Value("${drawingftp.uploadDir}")
private String uploadDir;
@Value("${drawingftp.downloadDir}")
private String downloadDir;
/**Ftp协议字符编码*/
private String serverCharset = "ISO-8859-1";
/**本体字符编码*/
private String localCharset = "GBK";
public String getAddress() {
return address;
}
public int getPort() {
return port;
}
public String getUserName() {
return userName;
}
public String getPassword() {
return password;
}
public FTPClient connect() throws Exception {
try {
//getFtpConf(ftpConfig);
ftp = new FTPClient();
ftp.setConnectTimeout(10000);
ftp.connect(address, port);
//2021/1/8 roc 修改读取文件阻塞时间
//ftp.setSoTimeout(10 * 60 * 1000);
ftp.setSoTimeout(30 * 1000);
ftp.login(userName, password);
//设置linux环境
FTPClientConfig conf = new FTPClientConfig( FTPClientConfig.SYST_UNIX);
ftp.configure(conf);
//ftp.setControlEncoding(localCharset); // 中文支持
//设置访问被动模式
ftp.setRemoteVerificationEnabled(false);
ftp.enterLocalPassiveMode();
ftp.setFileType(ftp.BINARY_FILE_TYPE);// 设置传输模式
return ftp;
}
catch (SocketException e) {
throw new Exception("登录ftp服务器 " + address + " 失败,连接超时!", e);
}
catch (IOException e) {
throw new Exception("登录ftp服务器 " + address + " 失败FTP服务器无法打开", e);
}
catch (Exception e) {
throw new Exception("访问FTP服务器【" + address + "】失败!", e);
}
}
/**
*
*
* @param file
* @throws Exception
*/
public void upload( File file ) throws Exception{
connect();
_upload( file );
closeConnect();
}
/**
*
*
* @param remotePath
* @param file
* @throws IOException
*/
public void upload( String remotePath, File file ) throws Exception{
connect();
_upload( remotePath, file );
closeConnect();
}
/**
*
*
* @param remotePath
* @param localPath
* @throws Exception
*/
public void download( String remotePath, String localPath ) throws Exception{
connect();
_download( remotePath, localPath );
closeConnect();
}
public InputStream downLoadFile(String filePath, String remoteFileName) throws Exception {
InputStream in = null;
// 下载文件
try {
connect();
ftp.setControlEncoding("UTF-8"); // 中文支持
ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
remoteFileName = filePath + remoteFileName;
String remote = new String(remoteFileName.getBytes(localCharset),serverCharset);
in = ftp.retrieveFileStream(remote);
if (null == in || ftp.getReplyCode() == 550) {
throw new Exception("文件不存在");
}
return in;
}
catch (Exception e) {
throw e;
}
finally {
try {
if (ftp != null || ftp.isConnected()) {
//ftpClient.logout();
ftp.disconnect();
ftp = null;
}
}
catch (Exception e) {
throw e;
}
}
}
/**
* ftp
*
* @param remoteFile
* @param localFile
* @throws Exception
*/
public void download( String remoteFile, File localFile ) throws Exception{
connect();
_download( remoteFile, localFile );
closeConnect();
}
/**
*
*
* @param remotePath
* @throws IOException
*/
public void deleteFile( String remotePath ) throws Exception{
connect();
_deleteFile( remotePath );
closeConnect();
}
public void deleteFile1( String filePath ) throws Exception{
connect();
boolean b =ftp.deleteFile( filePath );
closeConnect();
}
public void mkdirs( String remotePath ) throws Exception {
connect();
String[] paths = remotePath.split( Matcher.quoteReplacement(File.separator) );
for( String p : paths ){
ftp.makeDirectory( p );
ftp.changeWorkingDirectory( p );
}
closeConnect();
}
private void _upload( File file ) throws Exception{
if(file.isDirectory()){
ftp.makeDirectory(file.getName());
ftp.changeWorkingDirectory(file.getName());
String[] files = file.list();
for (int i = 0; i < files.length; i++) {
File file1 = new File(file.getPath()+ File.separator +files[i] );
_upload(file1);
}
ftp.changeToParentDirectory();
}else{
FileInputStream input = new FileInputStream(file);
ftp.storeFile(file.getName(), input);
input.close();
}
}
private void _upload( String remotePath, File file ) throws Exception {
String[] paths = remotePath.split( Matcher.quoteReplacement(File.separator) );
for( String p : paths ){
ftp.makeDirectory( p );
ftp.changeWorkingDirectory( p );
}
_upload( file );
}
private void _download( String remotePath, String localPath ) throws Exception {
FTPFile[] ftpFiles = ftp.listFiles( remotePath );
if( ftpFiles.length > 0 ){
for( FTPFile ftpFile : ftpFiles ){
if( ftpFile.isDirectory() ){
_download( remotePath + File.separator + ftpFile.getName(), localPath + File.separator + ftpFile.getName() );
}else{
File localDir = new File( localPath );
localDir.mkdirs();
File localFile = new File( localPath + File.separator + ftpFile.getName() );
localFile.createNewFile();
FileOutputStream fos = new FileOutputStream( localFile );
ftp.retrieveFile( remotePath + File.separator + ftpFile.getName(), fos );
fos.flush();
fos.close();
}
}
}
}
private void _download( String remoteFile, File localFile ) throws Exception {
localFile.createNewFile();
FileOutputStream fos = new FileOutputStream( localFile );
ftp.retrieveFile( remoteFile, fos );
fos.flush();
fos.close();
}
private void _deleteFile( String remotePath ) throws Exception {
FTPFile[] ftpFiles = ftp.listFiles( remotePath );
boolean b = false;
if( ftpFiles.length > 0 ){
for( FTPFile ftpFile : ftpFiles ){
if( ftpFile.isDirectory() ){
_deleteFile( remotePath + File.separator + ftpFile.getName() );
b = ftp.removeDirectory( remotePath + File.separator + ftpFile.getName() );
}else{
b= ftp.deleteFile( remotePath + File.separator + ftpFile.getName() );
}
}
}
}
private String convertFtpCharset( String fileName ){
try {
return new String( fileName.getBytes( localCharset ), serverCharset );
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return fileName;
}
private String convertLocalCharset( String fileName ){
try {
return new String( fileName.getBytes( serverCharset ), localCharset );
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return fileName;
}
private void closeConnect() {
try{
if( ftp != null && ftp.isConnected() ){
ftp.logout();
ftp.disconnect();
}
}catch (IOException e) {
e.printStackTrace();
}
}
public String getUploadDir(){
return uploadDir;
}
public String getDownloadDir(){
return downloadDir;
}
/**
*
* @param path
* @return
* @throws Exception
*/
public InputStream getFtp(String path) throws Exception {
login();
ftp.enterLocalPassiveMode();
InputStream in = ftp.retrieveFileStream(path);
return in;
}
/**
*
*
* @param
*/
public boolean changeWorkingDirectory(String fDir) throws Exception {
try {
ftp.changeToParentDirectory();
return ftp.changeWorkingDirectory(fDir);
}
catch (Exception ioe) {
throw ioe;
}
}
public FTPClient login() throws IOException{
this.ftp=new FTPClient();
this.ftp.connect(address,port);
if(FTPReply.isPositiveCompletion(this.ftp.getReplyCode())){
if(this.ftp.login(userName, password)){
this.ftp.setControlEncoding("GBK");
return this.ftp;
}
}
if(this.ftp.isConnected()){
this.ftp.disconnect();
}
return this.ftp;
}
}

@ -1,3 +1,8 @@
//package com.foreverwin.mesnac.common.ftp;
//
//public class WorkmanshipCardFtpClient {
//}
package com.foreverwin.mesnac.common.ftp;
import org.apache.commons.net.ftp.FTPClient;
@ -14,7 +19,7 @@ import java.util.regex.Matcher;
@Component
@ConditionalOnProperty( prefix = "cappftp", name = { "server", "port", "username", "password", "uploadDir", "downloadDir" }, matchIfMissing = false )
public class CappFtpClient {
public class WorkmanshipCardFtpClient {
private FTPClient ftp;
@ -232,7 +237,7 @@ public class CappFtpClient {
}
private void _download( String remotePath, String localPath ) throws Exception {
FTPFile[] ftpFiles = ftp.listFiles( remotePath );
FTPFile[] ftpFiles = ftp.listFiles( remotePath );
if( ftpFiles.length > 0 ){
for( FTPFile ftpFile : ftpFiles ){
if( ftpFile.isDirectory() ){

@ -16,7 +16,7 @@ public interface FileService {
* @return
* @throws Exception
*/
Map<String,String> getFilePathsByItemBoSFTP(String itemBo) throws Exception;
Map<String,String> getFilePathsByItemBoSFTP(String itemBo,String type) throws Exception;
/**
*
*

@ -1,8 +1,9 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.ftp.DrawingFtpClient;
import com.foreverwin.mesnac.common.ftp.JSchClient;
import com.foreverwin.mesnac.common.ftp.WorkmanshipCardFtpClient;
import com.foreverwin.mesnac.common.service.FileService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.GetDrawingVersionUtil;
@ -35,10 +36,13 @@ public class FileServiceImpl implements FileService {
@Autowired
private SfcDispatchDrawingService sfcDispatchDrawingService;
@Autowired
private CappFtpClient cappFtpClient;
private DrawingFtpClient drawingFtpClient;
@Autowired
private JSchClient jSchClient;
@Autowired
private WorkmanshipCardFtpClient workmanshipCardFtpClient;
@Override
public Map<String, String> getFilePaths(String site, String sfc, String operation, String step) throws IOException {
@ -57,7 +61,7 @@ public class FileServiceImpl implements FileService {
List<Integer> list = new ArrayList<Integer>();
Map<String, String> pathMap = new HashMap<>();
try {
connect = cappFtpClient.login();
connect = drawingFtpClient.login();
boolean flag = connect.changeWorkingDirectory(path);
connect.enterLocalPassiveMode();
FTPFile[] files = connect.listFiles();
@ -101,45 +105,45 @@ public class FileServiceImpl implements FileService {
FTPClient connect = null;
Map<String, String> pathMap = new HashMap<>();
List<Integer> list = new ArrayList<Integer>();
try {
connect = cappFtpClient.login();
String vision = GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect);
String path = "/" + StringUtil.trimHandle(itemBo) + "_" + vision + "/";
boolean flag = connect.changeWorkingDirectory(path);
connect.enterLocalPassiveMode();
FTPFile[] files = connect.listFiles();
if (files != null && flag) {
for (FTPFile ftpFile : files) {
String tmp = ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_") + 1, ftpFile.getName().lastIndexOf("_") + 2);
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
if (pattern.matcher(tmp).matches()) {
list.add(Integer.parseInt(tmp));
}
if (ftpFile.getName().equals(path.substring(1, path.length() - 1) + ".pdf") && ftpFile.isFile()) {
pathMap.put(ftpFile.getName(), path + ftpFile.getName());
}
}
int max = (int) Collections.max(list);
for (FTPFile ftpFile : files) {
if (ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_") + 1, ftpFile.getName().lastIndexOf("_") + 2).equals(String.valueOf(max)) && ftpFile.isFile()) {
pathMap.put(ftpFile.getName(), path + ftpFile.getName());
}
}
} else {
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
}
connect.disconnect();
} catch (Exception e) {
ExceptionUtil.throwException(e);
} finally {
if (connect != null && connect.isConnected()) {
connect.logout();
connect.disconnect();
}
}
if (pathMap == null) {
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
}
// try {
// connect = drawingFtpClient.login();
// String vision = GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect);
// String path = "/" + StringUtil.trimHandle(itemBo) + "_" + vision + "/";
// boolean flag = connect.changeWorkingDirectory(path);
// connect.enterLocalPassiveMode();
// FTPFile[] files = connect.listFiles();
// if (files != null && flag) {
// for (FTPFile ftpFile : files) {
// String tmp = ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_") + 1, ftpFile.getName().lastIndexOf("_") + 2);
// Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
// if (pattern.matcher(tmp).matches()) {
// list.add(Integer.parseInt(tmp));
// }
// if (ftpFile.getName().equals(path.substring(1, path.length() - 1) + ".pdf") && ftpFile.isFile()) {
// pathMap.put(ftpFile.getName(), path + ftpFile.getName());
// }
// }
// int max = (int) Collections.max(list);
// for (FTPFile ftpFile : files) {
// if (ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_") + 1, ftpFile.getName().lastIndexOf("_") + 2).equals(String.valueOf(max)) && ftpFile.isFile()) {
// pathMap.put(ftpFile.getName(), path + ftpFile.getName());
// }
// }
// } else {
// throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
// }
// connect.disconnect();
// } catch (Exception e) {
// ExceptionUtil.throwException(e);
// } finally {
// if (connect != null && connect.isConnected()) {
// connect.logout();
// connect.disconnect();
// }
// }
// if (pathMap == null) {
// throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
// }
return pathMap;
}
@ -152,43 +156,90 @@ public class FileServiceImpl implements FileService {
* @throws Exception
*/
@Override
public Map<String, String> getFilePathsByItemBoSFTP(String itemBo) throws Exception {
public Map<String, String> getFilePathsByItemBoSFTP(String itemBo,String type) throws Exception {
Map<String, String> pathMap = new HashMap<>();
//初始化SFTP参数
jSchClient = new JSchClient(cappFtpClient.getAddress(), cappFtpClient.getUserName(),
cappFtpClient.getPassword(), cappFtpClient.getPort());
String[] itemBos = null;
//多物料编码传入
if (itemBo.contains(",")) {
itemBos = itemBo.split(",");
for (String item : itemBos) {
//通过SFTP连接服务器
jSchClient.connectSFTP();
String directory = cappFtpClient.getDownloadDir() + "/" + item;
//判断目录是否存在
if (jSchClient.isDirExist(directory)){
pathMap.put(item + ".PDF", directory + "/" + item + ".PDF");
List<Integer> list = new ArrayList<Integer>();
if (type.equals("CARD")){
FTPClient connect = null;
String[] itemBos = null;
try {
connect = workmanshipCardFtpClient.login();
//获取路径
itemBos = itemBo.split(",");
for (String item:itemBos) {
String vision = GetDrawingVersionUtil.GetDrawingVerson(item, connect);
String path = StringUtil.trimHandle(item) + "_" + vision + "/";
boolean flag = connect.changeWorkingDirectory(path);
connect.enterLocalPassiveMode();
FTPFile[] files = connect.listFiles();
if (files.length!=0&& flag){
for (FTPFile ftpFile : files){
pathMap.put(ftpFile.getName(), path + ftpFile.getName());
}
}
else {
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系工艺部门确认");
}
}
connect.disconnect();
}catch (Exception e){
ExceptionUtil.throwException(e);
}
} else {
//单物料编码传入
try {
//通过SFTP连接服务器
jSchClient.connectSFTP();
//获取版本号
String path = GetDrawingVersionSFTP(itemBo, jSchClient, cappFtpClient.getDownloadDir());
if (null != path) {
//拼接文件路径
String ftpFilePath = cappFtpClient.getDownloadDir() + "/" + itemBo + "_" + path + "/" +
itemBo + "_" + path + ".PDF";
pathMap.put(itemBo + "_" + path + ".PDF", ftpFilePath);
finally {
if (connect != null && connect.isConnected()) {
connect.logout();
connect.disconnect();
}
jSchClient.close();
} catch (Exception e) {
e.printStackTrace();
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
}
}
//看图纸
if (type.equals("DRAWING")){
//初始化SFTP参数
jSchClient = new JSchClient(drawingFtpClient.getAddress(), drawingFtpClient.getUserName(),
drawingFtpClient.getPassword(), drawingFtpClient.getPort());
String[] itemBos = null;
//多物料编码传入
if (itemBo.contains(",")) {
itemBos = itemBo.split(",");
for (String item : itemBos) {
//通过SFTP连接服务器
jSchClient.connectSFTP();
String directory = drawingFtpClient.getDownloadDir() + "/" + item;
//判断目录是否存在
if (jSchClient.isDirExist(directory)){
pathMap.put(item + ".PDF", directory + "/" + item + ".PDF");
}
}
} else {
//单物料编码传入
try {
//通过SFTP连接服务器
jSchClient.connectSFTP();
//获取版本号
String path = GetDrawingVersionSFTP(itemBo, jSchClient, drawingFtpClient.getDownloadDir());
if (null != path) {
//拼接文件路径
String ftpFilePath = drawingFtpClient.getDownloadDir() + "/" + itemBo + "_" + path + "/" +
itemBo + "_" + path + ".PDF";
pathMap.put(itemBo + "_" + path + ".PDF", ftpFilePath);
}
jSchClient.close();
} catch (Exception e) {
e.printStackTrace();
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
}
}
}
if (pathMap == null) {
throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认");
}
return pathMap;
}
@ -205,8 +256,8 @@ public class FileServiceImpl implements FileService {
InputStream in;
try {
//初始化SFTP参数
jSchClient = new JSchClient(cappFtpClient.getAddress(), cappFtpClient.getUserName(),
cappFtpClient.getPassword(), cappFtpClient.getPort());
jSchClient = new JSchClient(drawingFtpClient.getAddress(), drawingFtpClient.getUserName(),
drawingFtpClient.getPassword(), drawingFtpClient.getPort());
//通过SFTP连接服务器
jSchClient.connectSFTP();
in = jSchClient.getSFTP(path);

@ -13,7 +13,7 @@ public class GetDrawingVersionUtil {
char VersionInit = 'A';
List<String> list = new ArrayList<>();
for (int i = 0; i < 26; i++) {
String path = StringUtil.trimHandle(itemBo) + "_" + VersionInit + "/";
String path = StringUtil.trimHandle(itemBo) + "_" + VersionInit;
boolean flag = connect.changeWorkingDirectory(path);
if (flag) {
list.add(String.valueOf(VersionInit));

@ -325,7 +325,7 @@
IT.DESCRIPTION,
ZSD.DISPATCH_QTY,
RS.DESCRIPTION RESRCE_DESCRIPTION,
ZUR.USER_DESCRIPTION,
ZSD.EMPLOYEE_DESCRIPTION USER_DESCRIPTION,
ZSD.ACTUAL_START_DATE
FROM
"Z_SFC_DISPATCH" ZSD
@ -333,7 +333,7 @@
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
LEFT JOIN RESRCE RS ON ZSD.RESRCE = RS.RESRCE
LEFT JOIN Z_USER_RESOURCE ZUR ON ZSD.EMPLOYEE = ZUR.USER_ID
AND IT.LOCALE = 'zh'
WHERE
DISPATCH_STATUS = 'START'
@ -347,7 +347,7 @@
IT.DESCRIPTION,
RS.DESCRIPTION,
ZSD.DISPATCH_QTY,
ZUR.USER_DESCRIPTION
ZSD.EMPLOYEE_DESCRIPTION
</select>
<!--异常待解决\异常已解决\异常正在处理-->

@ -10,7 +10,6 @@ import com.foreverwin.mesnac.common.constant.IntegrationTypeConstant;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
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.model.IntegrationLog;
import com.foreverwin.mesnac.common.service.IntegrationLogService;
import com.foreverwin.mesnac.common.service.ProdReadyTaskService;

@ -6,7 +6,7 @@ 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;
@ -90,8 +90,8 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
private BomComponentService bomComponentService;
@Autowired
private BomService bomService;
@Autowired
private CappFtpClient cappFtpClient;
// @Autowired
// private CappFtpClient cappFtpClient;
@Override
public List<RouterDTO> selectShopOrderRouter(String routerBo) {
@ -315,9 +315,9 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//循环步骤标识记录派工数据
//登录Capp的FTP文件服务器
FTPClient connect = null;
//FTPClient connect = null;
try {
connect = cappFtpClient.login();
// connect = cappFtpClient.login();
for (int m = 0 ; m < map.size(); m++) {
RouterDTO routerDTO = map.get(routerStepBo);
if (routerDTO == null) {
@ -402,12 +402,12 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
}catch (Exception e){
ExceptionUtil.throwException(e);
}
finally {
if (connect!=null&&connect.isConnected()){
connect.logout();
connect.disconnect();
}
}
// finally {
// if (connect!=null&&connect.isConnected()){
// connect.logout();
// connect.disconnect();
// }
// }
//批量插入工位&人员派工数据
sfcDispatchService.saveBatch(sfcDispatchList);
}

@ -159,7 +159,8 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
// 默认新建状态
resourceRepairTask.setStatus("401");
// 创建人、创建时间
String reportUser = resourceRepairTask.getReportUser();
String reportUser = CommonMethods.getUser();
//String reportUser = resourceRepairTask.getReportUser();
if (reportUser == null){
throw BusinessException.build("提报人不能为空!!!");
}

@ -31,8 +31,8 @@ public class GeneratorApplication {
dataSourceConfig.setTypeConvert( new OracleTypeConvert() );
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.dispatch" )
.tables("Z_ABNORMAL_BILL")
.packageName( "com.foreverwin.mesnac.meapi" )
.tables("Z_LOGISTICS_TURNOVER")
.author("YANG.WL")
.uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.prod")

@ -0,0 +1,144 @@
package com.foreverwin.mesnac.meapi.controller;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.LogisticsTurnoverService;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import java.util.List;
import java.util.Optional;
/**
*
* @author YANG.WL
* @since 2022-07-27
*/
@RestController
@RequestMapping("/Z-LOGISTICS-TURNOVER")
public class LogisticsTurnoverController {
@Autowired
public LogisticsTurnoverService logisticsTurnoverService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getLogisticsTurnoverById(@PathVariable String id) {
return R.ok( logisticsTurnoverService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getLogisticsTurnoverList(LogisticsTurnover logisticsTurnover){
List<LogisticsTurnover> result;
QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(logisticsTurnover);
result = logisticsTurnoverService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/queryLogisticsTurnoverList")
public String queryLogisticsTurnoverList(LogisticsDto logisticsDto){
List<LogisticsDto> result;
// QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
// queryWrapper.setEntity(logisticsTurnover);
result = logisticsTurnoverService.queryLogisticsTurnoverList(logisticsDto);
return Optional.ofNullable(result)
.map(t -> JSONObject.toJSONString(t)).orElse("null");
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<LogisticsTurnover> frontPage, LogisticsTurnover logisticsTurnover){
IPage result;
QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(logisticsTurnover);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(LogisticsTurnover::getHandle, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getSfcDispatchBo, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getStatus, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getUser, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getUserName, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther1, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther2, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther3, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getStorageLocation, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getTurnoverWorkCenter, frontPage.getGlobalQuery())
);
}
result = logisticsTurnoverService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param logisticsTurnover
* @return null
*/
@PostMapping
public R save(@RequestBody LogisticsTurnover logisticsTurnover) {
return R.ok(logisticsTurnoverService.save(logisticsTurnover));
}
/**
*
* @param logisticsTurnover
* @return null
*/
@PutMapping
public R updateById(@RequestBody LogisticsTurnover logisticsTurnover) {
return R.ok(logisticsTurnoverService.updateById(logisticsTurnover));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(logisticsTurnoverService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(logisticsTurnoverService.removeByIds(ids));
}
}

@ -0,0 +1,100 @@
package com.foreverwin.mesnac.meapi.dto;
public class LogisticsDto {
private String nextWorkCenter;
private String sfc;
private String workOrder;
private String itemDescription;
private String blankingSize;
private String dispatchQty;
private String overOperation;
private String employeeDescription;
private String nextOperation;
public String getNextWorkCenter() {
return nextWorkCenter;
}
public void setNextWorkCenter(String nextWorkCenter) {
this.nextWorkCenter = nextWorkCenter;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public String getBlankingSize() {
return blankingSize;
}
public void setBlankingSize(String blankingSize) {
this.blankingSize = blankingSize;
}
public String getDispatchQty() {
return dispatchQty;
}
public void setDispatchQty(String dispatchQty) {
this.dispatchQty = dispatchQty;
}
public String getOverOperation() {
return overOperation;
}
public void setOverOperation(String overOperation) {
this.overOperation = overOperation;
}
public String getEmployeeDescription() {
return employeeDescription;
}
public void setEmployeeDescription(String employeeDescription) {
this.employeeDescription = employeeDescription;
}
public String getNextOperation() {
return nextOperation;
}
public void setNextOperation(String nextOperation) {
this.nextOperation = nextOperation;
}
@Override
public String toString() {
return "LogisticsDto{" +
"nextWorkCenter='" + nextWorkCenter + '\'' +
", sfc='" + sfc + '\'' +
", workOrder='" + workOrder + '\'' +
", itemDescription='" + itemDescription + '\'' +
", blankingSize='" + blankingSize + '\'' +
", dispatchQty='" + dispatchQty + '\'' +
", overOperation='" + overOperation + '\'' +
", employeeDescription='" + employeeDescription + '\'' +
", nextOperation='" + nextOperation + '\'' +
'}';
}
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author YANG.WL
* @since 2022-07-27
*/
@Repository
public interface LogisticsTurnoverMapper extends BaseMapper<LogisticsTurnover> {
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
}

@ -0,0 +1,208 @@
package com.foreverwin.mesnac.meapi.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author YANG.WL
* @since 2022-07-27
*/
@TableName("Z_LOGISTICS_TURNOVER")
public class LogisticsTurnover extends Model<LogisticsTurnover> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SFC_DISPATCH_BO")
private String sfcDispatchBo;
/**
*
*/
@TableField("STATUS")
private String status;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("USER")
private String user;
/**
*
*/
@TableField("USER_NAME")
private String userName;
@TableField("OTHER1")
private String other1;
@TableField("OTHER2")
private String other2;
@TableField("OTHER3")
private String other3;
/**
*
*/
@TableField("STORAGE_LOCATION")
private String storageLocation;
/**
*
*/
@TableField("TURNOVER_WORK_CENTER")
private String turnoverWorkCenter;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSfcDispatchBo() {
return sfcDispatchBo;
}
public void setSfcDispatchBo(String sfcDispatchBo) {
this.sfcDispatchBo = sfcDispatchBo;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getOther1() {
return other1;
}
public void setOther1(String other1) {
this.other1 = other1;
}
public String getOther2() {
return other2;
}
public void setOther2(String other2) {
this.other2 = other2;
}
public String getOther3() {
return other3;
}
public void setOther3(String other3) {
this.other3 = other3;
}
public String getStorageLocation() {
return storageLocation;
}
public void setStorageLocation(String storageLocation) {
this.storageLocation = storageLocation;
}
public String getTurnoverWorkCenter() {
return turnoverWorkCenter;
}
public void setTurnoverWorkCenter(String turnoverWorkCenter) {
this.turnoverWorkCenter = turnoverWorkCenter;
}
public static final String HANDLE = "HANDLE";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
public static final String STATUS = "STATUS";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String USER = "USER";
public static final String USER_NAME = "USER_NAME";
public static final String OTHER1 = "OTHER1";
public static final String OTHER2 = "OTHER2";
public static final String OTHER3 = "OTHER3";
public static final String STORAGE_LOCATION = "STORAGE_LOCATION";
public static final String TURNOVER_WORK_CENTER = "TURNOVER_WORK_CENTER";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "LogisticsTurnover{" +
"handle = " + handle +
", sfcDispatchBo = " + sfcDispatchBo +
", status = " + status +
", createdDateTime = " + createdDateTime +
", user = " + user +
", userName = " + userName +
", other1 = " + other1 +
", other2 = " + other2 +
", other3 = " + other3 +
", storageLocation = " + storageLocation +
", turnoverWorkCenter = " + turnoverWorkCenter +
"}";
}
}

@ -0,0 +1,31 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author YANG.WL
* @since 2022-07-27
*/
public interface LogisticsTurnoverService extends IService<LogisticsTurnover> {
/**
*
* @param frontPage
* @return
*/
IPage<LogisticsTurnover> selectPage(FrontPage<LogisticsTurnover> frontPage, LogisticsTurnover logisticsTurnover);
List<LogisticsTurnover> selectList(LogisticsTurnover logisticsTurnover);
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
}

@ -0,0 +1,52 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import com.foreverwin.mesnac.meapi.mapper.LogisticsTurnoverMapper;
import com.foreverwin.mesnac.meapi.service.LogisticsTurnoverService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author YANG.WL
* @since 2022-07-27
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class LogisticsTurnoverServiceImpl extends ServiceImpl<LogisticsTurnoverMapper, LogisticsTurnover> implements LogisticsTurnoverService {
@Autowired
private LogisticsTurnoverMapper logisticsTurnoverMapper;
@Override
public IPage<LogisticsTurnover> selectPage(FrontPage<LogisticsTurnover> frontPage, LogisticsTurnover logisticsTurnover) {
QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(logisticsTurnover);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<LogisticsTurnover> selectList(LogisticsTurnover logisticsTurnover) {
QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(logisticsTurnover);
return super.list(queryWrapper);
}
@Override
public List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto) {
return logisticsTurnoverMapper.queryLogisticsTurnoverList(logisticsDto);
}
}

@ -0,0 +1,456 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.meapi.mapper.LogisticsTurnoverMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
<id column="HANDLE" property="handle" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="STATUS" property="status" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="USER" property="user" />
<result column="USER_NAME" property="userName" />
<result column="OTHER1" property="other1" />
<result column="OTHER2" property="other2" />
<result column="OTHER3" property="other3" />
<result column="STORAGE_LOCATION" property="storageLocation" />
<result column="TURNOVER_WORK_CENTER" property="turnoverWorkCenter" />
</resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.meapi.dto.LogisticsDto">
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOGISTICS_TURNOVER
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="queryLogisticsTurnoverList" resultMap="FullResultMap">
SELECT
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
INSERT INTO Z_LOGISTICS_TURNOVER
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
<if test="status!=null">STATUS,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="user!=null">USER,</if>
<if test="userName!=null">USER_NAME,</if>
<if test="other1!=null">OTHER1,</if>
<if test="other2!=null">OTHER2,</if>
<if test="other3!=null">OTHER3,</if>
<if test="storageLocation!=null">STORAGE_LOCATION,</if>
<if test="turnoverWorkCenter!=null">TURNOVER_WORK_CENTER,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
<if test="status!=null">#{status},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="user!=null">#{user},</if>
<if test="userName!=null">#{userName},</if>
<if test="other1!=null">#{other1},</if>
<if test="other2!=null">#{other2},</if>
<if test="other3!=null">#{other3},</if>
<if test="storageLocation!=null">#{storageLocation},</if>
<if test="turnoverWorkCenter!=null">#{turnoverWorkCenter},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
INSERT INTO Z_LOGISTICS_TURNOVER
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{sfcDispatchBo},
#{status},
#{createdDateTime},
#{user},
#{userName},
#{other1},
#{other2},
#{other3},
#{storageLocation},
#{turnoverWorkCenter},
</trim>
</insert>
<update id="updateById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.user!=null">USER=#{et.user},</if>
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
<if test="et.other1!=null">OTHER1=#{et.other1},</if>
<if test="et.other2!=null">OTHER2=#{et.other2},</if>
<if test="et.other3!=null">OTHER3=#{et.other3},</if>
<if test="et.storageLocation!=null">STORAGE_LOCATION=#{et.storageLocation},</if>
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
STATUS=#{et.status},
CREATED_DATE_TIME=#{et.createdDateTime},
USER=#{et.user},
USER_NAME=#{et.userName},
OTHER1=#{et.other1},
OTHER2=#{et.other2},
OTHER3=#{et.other3},
STORAGE_LOCATION=#{et.storageLocation},
TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.user!=null">USER=#{et.user},</if>
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
<if test="et.other1!=null">OTHER1=#{et.other1},</if>
<if test="et.other2!=null">OTHER2=#{et.other2},</if>
<if test="et.other3!=null">OTHER3=#{et.other3},</if>
<if test="et.storageLocation!=null">STORAGE_LOCATION=#{et.storageLocation},</if>
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_LOGISTICS_TURNOVER
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_LOGISTICS_TURNOVER
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -46,6 +46,22 @@ public class PodTemplateController {
return R.ok(podTemplateService.sfcEnter(sfcDto));
}
/**
* sfc
* @param sfc,site
* @return
*/
@ResponseBody
@GetMapping("/Androidsfc")
public R Androidsfc(@RequestParam("sfc") String sfc,@RequestParam("site")String site) {
SfcDto sfcDto=new SfcDto();
sfcDto.setSfc(sfc);
sfcDto.setSite(site);
return R.ok(podTemplateService.sfcEnter(sfcDto));
}
/**
* sfc
* @param map

@ -263,6 +263,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
String stepId = sfcDto.getStepId();
String dispatchNo = sfcDto.getDispatchNo();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
if (!operation.equals("WX_6106GX")){
@ -285,12 +286,34 @@ public class PodTemplateServiceImpl implements PodTemplateService {
queryWrapper.eq(InspectionTask.SFC, sfc);
queryWrapper.orderByDesc(InspectionTask.CREATED_DATE_TIME);
List<InspectionTask> list = inspectionTaskService.list(queryWrapper);
SfcDispatch sfcDispatchById = sfcDispatchService.getById(HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo));
RouterStep routerStep=routerService.findRepairOperation(site,sfcDispatchById.getRouterBo(),stepId);
if (!list.isEmpty()) {
InspectionTask inspectionTask = list.get(0);
String result = inspectionTask.getResult();
if (!inspectionTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)||StringUtil.isBlank(result)||!result.equals(Constants.RSESULT_OK)){
String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
throw new BaseException("请联系"+checkUser+",处理专检任务。");
if (!inspectionTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)||StringUtil.isBlank(result)){
String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
throw new BaseException("请联系"+checkUser+",处理专检任务。");
// if (routerStep.getRework().equals("true") && stepId.startsWith("9")){
// return;
// }else if (!result.equals(Constants.RSESULT_OK )||StringUtil.isBlank(result)){
//
// String checkUser = resrceMapper.findCustomFieldByResrce(site, inspectionTask.getResrce(), "CHECK_USR");
// throw new BaseException("请联系"+checkUser+",处理专检任务。");
// }
/***
*
*/
}else if (routerStep.getRework().equals("true") && stepId.startsWith("9") && !result.equals(Constants.RSESULT_OK )){
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
}
}
try {
@ -300,7 +323,6 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.START.getCode(),null);
});
}

@ -11,6 +11,8 @@ import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import com.foreverwin.mesnac.meapi.service.LogisticsTurnoverService;
import com.foreverwin.mesnac.quality.dto.InspectionTaskManageRequest;
import com.foreverwin.mesnac.quality.mapper.InspectionTaskManageMapper;
import com.foreverwin.mesnac.quality.model.InspectionTaskManageDetail;
@ -40,6 +42,9 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
private InspectionTaskDetailService inspectionTaskDetailService;
@Autowired
private SfcDispatchService sfcDispatchService;
@Autowired
private LogisticsTurnoverService logisticsTurnoverService;
@Override
public List<InspectionTaskManage> findInspectionTask(InspectionTaskManageRequest inspectionTaskManageRequest) {
@ -219,8 +224,14 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
if (sfcDispatch!=null&&!sfcDispatchById.getWorkCenter().equals(sfcDispatch.getWorkCenter())){
//生成周转任务的同时发送消息提示到手持设备
LogisticsTurnover logisticsTurnover=new LogisticsTurnover();
logisticsTurnover.setHandle("LogisticsBO:1000"+","+UUID.randomUUID().toString());
logisticsTurnover.setSfcDispatchBo(sfcDispatchById.getHandle());
logisticsTurnover.setStatus(Constants.LOGISTICS_NEW);
logisticsTurnover.setCreatedDateTime(LocalDateTime.now());
logisticsTurnover.setOther1(sfcDispatch.getOperation());
logisticsTurnover.setTurnoverWorkCenter(sfcDispatch.getWorkCenter());
logisticsTurnoverService.save(logisticsTurnover);
}

@ -7,9 +7,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.constant.IntegrationTypeConstant;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.IntegrationLog;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.CommonService;
import com.foreverwin.mesnac.common.service.IntegrationLogService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
@ -33,9 +36,11 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
@ -64,6 +69,8 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
private NcCodeService ncCodeService;
@Autowired
private UserGroupMapper userGroupMapper;
@Autowired
private IntegrationLogService integrationLogService;
@Override
public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) {
@ -190,6 +197,21 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
selfReport.setModifyUser(user);
selfReport.setModifiedDateTime(LocalDateTime.now());
selfReport.setReportUserGroup(userGroup);
/**
*
*/
//记录接口日志
IntegrationLog log = new IntegrationLog();
log.setHandle(UUID.randomUUID().toString());
log.setSite(site);
log.setIntegrationType(IntegrationTypeConstant.ITEM);
log.setCategory("Z-REPORT");
log.setIntegrationWay("ZREPORT");
log.setIntegrationMethod("");
log.setParam(selfReport.toString());
log.setCreatedDateTime(LocalDateTime.now());
integrationLogService.saveIntegrationLog(log);
save(selfReport);
}
}

Loading…
Cancel
Save