获取物料PLM文件
This commit is contained in:
parent
49c4b26cd3
commit
73bea97b49
|
@ -127,28 +127,42 @@ public class InvoiceDownloadAction implements ICommonAction {
|
|||
}
|
||||
|
||||
String ctcode = "";
|
||||
HYSuperDMO dmo = new HYSuperDMO();
|
||||
IVApplogVO[] ivApplogVO = (IVApplogVO[]) dmo.queryByWhereClause(IVApplogVO.class, "fphm='" + headVO.getFphm() + "' and dr=0 ");
|
||||
if (ivApplogVO != null && ivApplogVO.length > 0) {
|
||||
IVApplicationHeadVO ivApplicationHeadVO = (IVApplicationHeadVO) dmo.queryByPrimaryKey(IVApplicationHeadVO.class, ivApplogVO[0].getLyid());
|
||||
// ctcode = ivApplicationHeadVO.getDef2(); // ºÏͬºÅ
|
||||
String codeSql="select DISTINCT sscivm_ivapplication.DEF2 from sscivm_ivapplog, sscivm_ivapplication where sscivm_ivapplication.dr = 0 and ( sscivm_ivapplication.pk_ivapplication = sscivm_ivapplog.lyid or sscivm_ivapplication.pk_ivapplication in ( select ron.pk_ivapplication from sscivm_inv_ina_relation ron where ron.fpqqlsh = sscivm_ivapplog.lyid ) ) and sscivm_ivapplog.fphm = '" + headVO.getFphm() + "' and sscivm_ivapplog.dr = 0";
|
||||
Map<String, Object> val = (Map<String, Object>) getQueryService().executeQuery(codeSql, new MapProcessor());
|
||||
if(!val.isEmpty()){
|
||||
String operationSql = "SELECT bd.NAME name from bd_defdoc bd LEFT join bd_defdoclist bdl ON bd.pk_defdoclist=bdl.pk_defdoclist WHERE bdl.code ='zdy-001'\n" +
|
||||
"AND bd.pk_defdoc = '" + ivApplicationHeadVO.getDef2().toString() + "' ";
|
||||
"AND bd.pk_defdoc = '" + val.get("def2") + "' ";
|
||||
// List<Map<String,Object>> operationresult = (List<Map<String,Object>>) getQueryService().executeQuery(operationSql, new ArrayListProcessor());
|
||||
Map<String, Object> valList = (Map<String, Object>) getQueryService().executeQuery(operationSql, new MapProcessor());
|
||||
if(!valList.isEmpty()){
|
||||
if(null!=valList && !valList.isEmpty()){
|
||||
ctcode = (String) valList.get("name"); // 合同号
|
||||
}else{
|
||||
ctcode =ivApplicationHeadVO.getDef2();
|
||||
ctcode = (String) val.get("def2");
|
||||
}
|
||||
}
|
||||
|
||||
// HYSuperDMO dmo = new HYSuperDMO();
|
||||
// IVApplogVO[] ivApplogVO = (IVApplogVO[]) dmo.queryByWhereClause(IVApplogVO.class, "fphm='" + headVO.getFphm() + "' and dr=0 ");
|
||||
// if (ivApplogVO != null && ivApplogVO.length > 0) {
|
||||
// IVApplicationHeadVO ivApplicationHeadVO = (IVApplicationHeadVO) dmo.queryByPrimaryKey(IVApplicationHeadVO.class, ivApplogVO[0].getLyid());
|
||||
// ctcode = ivApplicationHeadVO.getDef2(); // ºÏͬºÅ
|
||||
// String operationSql = "SELECT bd.NAME name from bd_defdoc bd LEFT join bd_defdoclist bdl ON bd.pk_defdoclist=bdl.pk_defdoclist WHERE bdl.code ='zdy-001'\n" +
|
||||
// "AND bd.pk_defdoc = '" + ivApplicationHeadVO.getDef2().toString() + "' ";
|
||||
// List<Map<String,Object>> operationresult = (List<Map<String,Object>>) getQueryService().executeQuery(operationSql, new ArrayListProcessor());
|
||||
// Map<String, Object> valList = (Map<String, Object>) getQueryService().executeQuery(operationSql, new MapProcessor());
|
||||
// if(!valList.isEmpty()){
|
||||
// ctcode = (String) valList.get("name"); // ºÏͬºÅ
|
||||
// }else{
|
||||
// ctcode =ivApplicationHeadVO.getDef2();
|
||||
// }
|
||||
// }
|
||||
if(!ctcode.equals("") && !ctcode.equals("/") ){
|
||||
ctcode=ctcode+"_";
|
||||
}
|
||||
// 添加 PDF
|
||||
if (!MMValueCheck.isEmpty(pdfData)) {
|
||||
byte[] pdfBytes = DatatypeConverter.parseBase64Binary(pdfData);
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".pdf"));
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toBigDecimal().toPlainString()) + ".pdf"));
|
||||
zipStream.write(pdfBytes);
|
||||
zipStream.closeEntry();
|
||||
}
|
||||
|
@ -156,7 +170,7 @@ public class InvoiceDownloadAction implements ICommonAction {
|
|||
// 添加 XML
|
||||
if (!MMValueCheck.isEmpty(xmlData)) {
|
||||
byte[] xmlBytes = DatatypeConverter.parseBase64Binary(xmlData);
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".xml"));
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toBigDecimal().toPlainString()) + ".xml"));
|
||||
zipStream.write(xmlBytes);
|
||||
zipStream.closeEntry();
|
||||
}
|
||||
|
@ -164,11 +178,11 @@ public class InvoiceDownloadAction implements ICommonAction {
|
|||
// 添加 OFD
|
||||
if (!MMValueCheck.isEmpty(ofdData)) {
|
||||
byte[] ofdBytes = DatatypeConverter.parseBase64Binary(ofdData);
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".ofd"));
|
||||
zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toBigDecimal().toPlainString()) + ".ofd"));
|
||||
zipStream.write(ofdBytes);
|
||||
zipStream.closeEntry();
|
||||
}
|
||||
zipName=ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble());
|
||||
zipName=ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toBigDecimal().toPlainString());
|
||||
} else {
|
||||
throw new Exception("获取发票信息失败");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package nccloud.web.uapbd.material.action;
|
||||
|
||||
import nc.bs.uapbd.util.GetPlmFileUtil;
|
||||
import nccloud.framework.core.io.WebFile;
|
||||
import nccloud.framework.web.container.IRequest;
|
||||
import nccloud.web.action.NCCAction;
|
||||
import nccloud.web.uapbd.commons.web.ParamUtils;
|
||||
|
||||
/**
|
||||
* »ñÈ¡ÎïÁÏPLMÎļþ
|
||||
*
|
||||
* @author mzr
|
||||
* @date 2025/8/4
|
||||
*/
|
||||
public class MaterialPlmDownloadAction extends NCCAction {
|
||||
@Override
|
||||
public <T> Object execute(IRequest request, T para) throws Exception {
|
||||
ParamUtils param = new ParamUtils(request);
|
||||
String materialCode = param.getString("materialCode", null);
|
||||
materialCode = "101092250323";
|
||||
String[] materialCodeArr = materialCode.split(",", -1);
|
||||
GetPlmFileUtil fileUtil = new GetPlmFileUtil();
|
||||
WebFile files = fileUtil.getPlmFiles(materialCodeArr);
|
||||
return files;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<actions>
|
||||
<action>
|
||||
<name>uapbd.material.downloadPlmFile</name>
|
||||
<label>物料-下载PLM物料文件</label>
|
||||
<clazz>nccloud.web.uapbd.material.action.MaterialPlmDownloadAction</clazz>
|
||||
</action>
|
||||
</actions>
|
|
@ -0,0 +1,8 @@
|
|||
<authorizes>
|
||||
<authorize>
|
||||
<appcode>*</appcode>
|
||||
<actions>
|
||||
<action>uapbd.material.downloadPlmFile</action>
|
||||
</actions>
|
||||
</authorize>
|
||||
</authorizes>
|
Loading…
Reference in New Issue