材质信息

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); List<AbnormalBill> abnormalBillList = abnormalBillMapper.selectList(queryWrapper);
if (abnormalBillList.size()>0){ if (abnormalBillList.size()>0){
AbnormalBill abnormalBilltop=abnormalBillList.get(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的上一个异常还没有进行方案确认请联系工艺评审人员进行处理"); throw new BaseException("此SFC的上一个异常还没有进行方案确认请联系工艺评审人员进行处理");
} }
} }

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

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

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

@ -478,7 +478,11 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
labelPrintDto.setSfc(prodReadyTask.getSfc()); labelPrintDto.setSfc(prodReadyTask.getSfc());
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, prodReadyTask.getSfc())); Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, prodReadyTask.getSfc()));
String drawingRevision = customFieldsService.getCustomFieldsValue(sfcServiceById.getItemBo(), CustomFieldConstant.ITEM_DWG_NO); 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.setDrawingVersion(drawingRevision);
labelPrintDto.setTexture(Texturemap.get("TEXTURE").toString());
labelPrintDto.setQty(new BigDecimal(sfcServiceById.getQty())); labelPrintDto.setQty(new BigDecimal(sfcServiceById.getQty()));
String workOrder = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), CustomFieldConstant.SO_WORK_ORDER); String workOrder = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), CustomFieldConstant.SO_WORK_ORDER);
String itemNumber = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), CustomFieldConstant.SO_ITEM_NUMBER); 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()); labelPrintDto.setItemTypeOrder(sfcDispatchDto.getOther2());
labelPrintDtoList.add(labelPrintDto); labelPrintDtoList.add(labelPrintDto);
printData = JSON.toJSONString(labelPrintDtoList); printData = JSON.toJSONString(labelPrintDtoList);
//打印记录 //打印记录

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

@ -780,11 +780,15 @@
ZLT.STATUS, ZLT.STATUS,
CASE WHEN ZLT.IS_RECEIVE = 'Y' THEN '已接收' ELSE '未接收' END IS_RECEIVE, CASE WHEN ZLT.IS_RECEIVE = 'Y' THEN '已接收' ELSE '未接收' END IS_RECEIVE,
ZNU.FULL_NAME COMFIRM_USER, ZNU.FULL_NAME COMFIRM_USER,
ZNU2.FULL_NAME DELETE_USER,
ZLT.COM_DATE_TIME, ZLT.COM_DATE_TIME,
ZLT.OTHER4 ZLT.OTHER4,
CASE WHEN ZLT.OTHER6 ='1' THEN '已删除' ELSE '' END OTHER6
FROM FROM
Z_LOGISTICS_TURNOVER ZLT Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN Z_NWA_USER ZNU ON ZLT.OTHER5 = ZNU.USER_NAME 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 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_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN WORK_CENTER WC1 ON WC1.WORK_CENTER = ZLT.TURNOUT_WORKCENTER 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.SFC, sfcDispatchById.getSfc());
queryWrapper.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder()); queryWrapper.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + i)); 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.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo()); // queryWrapper.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrapper); nextsfcDispatch = sfcDispatchService.getOne(queryWrapper);
if (nextsfcDispatch != null && !stringList.contains(nextsfcDispatch.getOperation()) if (nextsfcDispatch != null && !stringList.contains(nextsfcDispatch.getOperation())
&& !nextsfcDispatch.getWorkCenter().equals(sfcDispatchById.getWorkCenter())) { && !nextsfcDispatch.getWorkCenter().equals(sfcDispatchById.getWorkCenter())) {
@ -773,8 +773,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
queryWrappers.eq(SfcDispatch.SFC, sfcDispatchById.getSfc()); queryWrappers.eq(SfcDispatch.SFC, sfcDispatchById.getSfc());
queryWrappers.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder()); queryWrappers.eq(SfcDispatch.SHOP_ORDER, sfcDispatchById.getShopOrder());
queryWrappers.eq(SfcDispatch.DISPATCH_SEQ, String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq()) + (i-1))); 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.like(SfcDispatch.ROUTER_BO, sfcDispatchById.getRouterBo().substring(0,sfcDispatchById.getRouterBo().lastIndexOf(",")));
queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo()); // queryWrappers.eq(SfcDispatch.ROUTER_BO,sfcDispatchById.getRouterBo());
nextsfcDispatch = sfcDispatchService.getOne(queryWrappers); nextsfcDispatch = sfcDispatchService.getOne(queryWrappers);
if (nextsfcDispatch.getOther2() != null && Constants.RK.equals(nextsfcDispatch.getOther2()) && stringList.contains(nextsfcDispatch.getOperation())){ if (nextsfcDispatch.getOther2() != null && Constants.RK.equals(nextsfcDispatch.getOther2()) && stringList.contains(nextsfcDispatch.getOperation())){
nextsfcDispatch.setOperation(nextsfcDispatch.getOperation()); nextsfcDispatch.setOperation(nextsfcDispatch.getOperation());

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

Loading…
Cancel
Save