材质信息

master
杨万里 2 years ago
parent 48951a26c0
commit 0a32f42315

@ -272,7 +272,12 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
List<AbnormalBill> abnormalBillList = abnormalBillMapper.selectList(queryWrapper);
if (abnormalBillList.size()>0){
AbnormalBill abnormalBilltop=abnormalBillList.get(0);
if (StringUtils.isBlank(abnormalBilltop.getProgram()) && !abnormalBilltop.getStatus().equals("Q")){
/**
* SFC
*/
String handle = HandleEnum.SFC.getHandle(site, abnormalBill.getSfc());
Sfc sfcServiceById = sfcService.getById(handle);
if (StringUtils.isBlank(abnormalBilltop.getProgram()) && !abnormalBilltop.getStatus().equals("Q") && sfcServiceById.getQty().equals(abnormalBill.getNcQty())){
throw new BaseException("此SFC的上一个异常还没有进行方案确认请联系工艺评审人员进行处理");
}
}

@ -13,7 +13,6 @@ import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.sun.deploy.net.URLEncoder;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.poi.ss.usermodel.Workbook;
@ -49,6 +48,9 @@ public class FileController {
@Autowired
public DrawingFtpClient ftpClient;
@Autowired
private DrawingFtpClient drawingFtpClient;
@Autowired
public WorkmanshipCardFtpClient workmanshipCardFtpClient;
@ -127,6 +129,7 @@ public class FileController {
String path = request.getParameter("Path");
String type = request.getParameter("Type");
try {
//服务器发布
//String coderPath = new String(path.getBytes("ISO8859_1"));
@ -138,9 +141,11 @@ public class FileController {
// }
if (null == in) {
if (type.equals("DRAWING")){
jSchClient = new JSchClient(drawingFtpClient.getAddress(), drawingFtpClient.getUserName(),
drawingFtpClient.getPassword(), drawingFtpClient.getPort());
jSchClient.connectSFTP();
in = jSchClient.getSFTP(path);
//in = fileService.getSFTP(path);
in = jSchClient.getSFTP(path);
// in = fileService.getSFTP(path);
}else {
in = workmanshipCardFtpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
}
@ -179,7 +184,6 @@ public class FileController {
} catch (Exception e) {
return R.failed("获取文件失败:文件路径为" + path + ":" + e.getMessage());
} finally {
try {
if (null != out) {
out.close();
@ -190,10 +194,10 @@ public class FileController {
if (null != outStream){
outStream.close();
}
if (jSchClient != null ){
jSchClient.close();
}
} catch (Exception e1) {
return R.failed("获取文件失败:关闭文件流处理异常" + e1.getMessage());
}
@ -206,51 +210,51 @@ public class FileController {
*
* @return
*/
@ResponseBody
@RequestMapping(method = RequestMethod.GET, value = "/LabelPrintPdf/{fileName}")
public R getLabelPrintPdf(HttpServletRequest request, HttpServletResponse response, @PathVariable("fileName") String fileName) {
InputStream in = null;
OutputStream out = null;
String path = request.getParameter("Path").replace('-', '/');
;
try {
//服务器发布
in = ftpClient.getFtp(path);
if (null == in) {
in = ftpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
}
if (null == in) {
throw new BaseException("获取FTP文件路径为:【" + path + "】的文件流失败!");
}
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
while ((nRead = in.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
byte[] data2 = buffer.toByteArray();
out = response.getOutputStream();
out.write(data2);
out.flush();
} catch (Exception e) {
return R.failed("下载文件失败:文件路径为" + path + ":" + e.getMessage());
} finally {
try {
if (null != out) {
out.close();
}
if (null != in) {
in.close();
}
} catch (Exception e1) {
return R.failed("下载文件失败:关闭文件流处理异常" + e1.getMessage());
}
}
return R.ok(null, "下载文件成功!");
}
// @ResponseBody
// @RequestMapping(method = RequestMethod.GET, value = "/LabelPrintPdf/{fileName}")
// public R getLabelPrintPdf(HttpServletRequest request, HttpServletResponse response, @PathVariable("fileName") String fileName) {
// InputStream in = null;
// OutputStream out = null;
// String path = request.getParameter("Path").replace('-', '/');
// ;
// try {
// //服务器发布
// in = ftpClient.getFtp(path);
// if (null == in) {
// in = ftpClient.getFtp(new String(path.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING));
// }
//
// if (null == in) {
// throw new BaseException("获取FTP文件路径为:【" + path + "】的文件流失败!");
// }
// ByteArrayOutputStream buffer = new ByteArrayOutputStream();
// int nRead;
// byte[] data = new byte[16384];
// while ((nRead = in.read(data, 0, data.length)) != -1) {
// buffer.write(data, 0, nRead);
// }
// byte[] data2 = buffer.toByteArray();
// out = response.getOutputStream();
// out.write(data2);
// out.flush();
//
// } catch (Exception e) {
// return R.failed("下载文件失败:文件路径为" + path + ":" + e.getMessage());
// } finally {
// try {
// if (null != out) {
// out.close();
// }
// if (null != in) {
// in.close();
// }
//
// } catch (Exception e1) {
// return R.failed("下载文件失败:关闭文件流处理异常" + e1.getMessage());
// }
// }
// return R.ok(null, "下载文件成功!");
// }
public static char byteToChar(byte[] b) {
int hi = (b[0] & 0xFF) << 8;

@ -104,6 +104,7 @@ public class JSchClient {
}
public InputStream downloadStream(String directory, String downloadFile){
ChannelSftp sftp;
try{

@ -226,19 +226,19 @@ public class FileServiceImpl implements FileService {
if (itemBo.contains(",")) {
itemBos = itemBo.split(",");
// for (String item : itemBos) {
// //通过SFTP连接服务器
// jSchClient.connectSFTP();
// if (version==null || version.equals("")){
// version =GetDrawingVersionSFTP(item, jSchClient, drawingFtpClient.getDownloadDir());
// }
// if (null != version) {
// //拼接文件路径
// String ftpFilePath = drawingFtpClient.getDownloadDir() + "/" + item + "_" + version + "/" +
// item + "_" + version + ".PDF";
// pathMap.put(item + "_" + version + ".PDF", ftpFilePath);
// }
// }
for (String item : itemBos) {
//通过SFTP连接服务器
jSchClient.connectSFTP();
if (version==null || version.equals("")){
version =GetDrawingVersionSFTP(item, jSchClient, drawingFtpClient.getDownloadDir());
}
if (null != version) {
//拼接文件路径
String ftpFilePath = drawingFtpClient.getDownloadDir() + "/" + item + "_" + version + "/" +
item + "_" + version + ".PDF";
pathMap.put(item + "_" + version + ".PDF", ftpFilePath);
}
}
} else {
//单物料编码传入
@ -258,11 +258,10 @@ public class FileServiceImpl implements FileService {
} catch (Exception e) {
e.printStackTrace();
}
// finally {
// jSchClient.close();
// }
}
if (jSchClient != null){
jSchClient.close();
}
}
if (pathMap == null || pathMap.size() == 0) {
throw new BaseException("未找到图纸相应信息,请在图纸管理系统申请!");

@ -478,7 +478,11 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
labelPrintDto.setSfc(prodReadyTask.getSfc());
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, prodReadyTask.getSfc()));
String drawingRevision = customFieldsService.getCustomFieldsValue(sfcServiceById.getItemBo(), CustomFieldConstant.ITEM_DWG_NO);
Map map=new HashMap();
map.put("itemBo",selectCurrent.getItem());
Map Texturemap = itemService.findTextureByItemBo(map);
labelPrintDto.setDrawingVersion(drawingRevision);
labelPrintDto.setTexture(Texturemap.get("TEXTURE").toString());
labelPrintDto.setQty(new BigDecimal(sfcServiceById.getQty()));
String workOrder = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), CustomFieldConstant.SO_WORK_ORDER);
String itemNumber = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), CustomFieldConstant.SO_ITEM_NUMBER);
@ -510,6 +514,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
//打印物料去向
labelPrintDto.setItemTypeOrder(sfcDispatchDto.getOther2());
labelPrintDtoList.add(labelPrintDto);
printData = JSON.toJSONString(labelPrintDtoList);
//打印记录

@ -43,6 +43,15 @@ public class LogisticsDto {
private String completeToDate;
private String createdDateTime;
private String other6;
private String deleteUser;
public String getDeleteUser() {
return deleteUser;
}
public void setDeleteUser(String deleteUser) {
this.deleteUser = deleteUser;
}
public String getOther6() {
return other6;

@ -780,11 +780,15 @@
ZLT.STATUS,
CASE WHEN ZLT.IS_RECEIVE = 'Y' THEN '已接收' ELSE '未接收' END IS_RECEIVE,
ZNU.FULL_NAME COMFIRM_USER,
ZNU2.FULL_NAME DELETE_USER,
ZLT.COM_DATE_TIME,
ZLT.OTHER4
ZLT.OTHER4,
CASE WHEN ZLT.OTHER6 ='1' THEN '已删除' ELSE '' END OTHER6
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN Z_NWA_USER ZNU ON ZLT.OTHER5 = ZNU.USER_NAME
LEFT JOIN Z_NWA_USER ZNU2 ON ZLT.DELETE_USER = ZNU2.USER_NAME
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 WORK_CENTER WC1 ON WC1.WORK_CENTER = ZLT.TURNOUT_WORKCENTER

@ -751,8 +751,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
queryWrapper.eq(SfcDispatch.SFC, sfcDispatchById.getSfc());
queryWrapper.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + i));
// queryWrapper.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
queryWrapper.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
// queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrapper);
if (nextsfcDispatch != null && !stringList.contains(nextsfcDispatch.getOperation())
&& !nextsfcDispatch.getWorkCenter().equals(sfcDispatchById.getWorkCenter())) {
@ -773,8 +773,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
queryWrappers.eq(SfcDispatch.SFC, sfcDispatchById.getSfc());
queryWrappers.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrappers.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + (i-1)));
// queryWrappers.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
queryWrappers.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
// queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrappers);
if (nextsfcDispatch.getOther2() != null && Constants.RK.equals(nextsfcDispatch.getOther2()) && stringList.contains(nextsfcDispatch.getOperation())){
nextsfcDispatch.setOperation(nextsfcDispatch.getOperation());

@ -308,8 +308,8 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
queryWrapper.eq(SfcDispatch.SFC, sfcDispatchById.getSfc());
queryWrapper.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + i));
//queryWrapper.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
queryWrapper.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
//queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrapper);
if (nextsfcDispatch != null && !stringList.contains(nextsfcDispatch.getOperation())
&& !nextsfcDispatch.getWorkCenter().equals(sfcDispatchById.getWorkCenter())) {
@ -329,7 +329,8 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
queryWrappers.eq(SfcDispatch.SFC, sfcDispatchById.getSfc());
queryWrappers.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrappers.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + (i-1)));
queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
queryWrappers.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
// queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrappers);
if (nextsfcDispatch.getOther2() != null && Constants.RK.equals(nextsfcDispatch.getOther2()) &&
stringList.contains(nextsfcDispatch.getOperation())){

Loading…
Cancel
Save