PAL资产库修改数据状态代码提交
This commit is contained in:
parent
0534397440
commit
0702114385
@ -77,6 +77,8 @@ public class UpateFileStateController {
|
||||
if ("1".equals(type)) {
|
||||
BO bo_eu_pal_repository = SDK.getBOAPI().query("BO_EU_PAL_REPOSITORY").addQuery("PLID = ", plId).detail();
|
||||
bo_eu_pal_repository.set("ISPUBLISH",state);
|
||||
bo_eu_pal_repository.set("ISSTOP",0);
|
||||
bo_eu_pal_repository.set("ISAPPROVAL",0);
|
||||
SDK.getBOAPI().update("BO_EU_PAL_REPOSITORY",bo_eu_pal_repository);
|
||||
|
||||
//修改发布状态
|
||||
@ -226,6 +228,8 @@ public class UpateFileStateController {
|
||||
}else if ("4".equals(type)) {
|
||||
BO bo_eu_pal_repository = SDK.getBOAPI().query("BO_EU_PAL_REPOSITORY").addQuery("PLID = ", plId).detail();
|
||||
bo_eu_pal_repository.set("ISSTOP",state);
|
||||
bo_eu_pal_repository.set("ISPUBLISH",0);
|
||||
bo_eu_pal_repository.set("ISAPPROVAL",0);
|
||||
SDK.getBOAPI().update("BO_EU_PAL_REPOSITORY",bo_eu_pal_repository);
|
||||
|
||||
// 修改流程文件的停用状态
|
||||
@ -254,42 +258,50 @@ public class UpateFileStateController {
|
||||
|
||||
|
||||
BO bo_act_coe_publish_n = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N").addQuery("PUBLISHFILEID=", plId).detail();
|
||||
if(bo_act_coe_publish_n!=null){
|
||||
String bindid=bo_act_coe_publish_n.getBindId();
|
||||
|
||||
BO publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH").detailByBindId(bindid);
|
||||
|
||||
String bindid=bo_act_coe_publish_n.getBindId();
|
||||
//作废时间
|
||||
Date cancelDate=new Date();
|
||||
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd");
|
||||
propertyDao.updatePropertyByPropertyId(plId, "obsolescence_time", sdfs.format(cancelDate));
|
||||
|
||||
BO publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH").detailByBindId(bindid);
|
||||
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plId);
|
||||
if (plModel != null) {
|
||||
|
||||
DesignerShapeRelationModel designerShapeRelationModel=new DesignerShapeRelationModel();
|
||||
designerShapeRelationModel.setId(UUIDGener.getUUID());
|
||||
designerShapeRelationModel.setFileId(plId);
|
||||
designerShapeRelationModel.setAttrId("nullifier");
|
||||
designerShapeRelationModel.setRelationFileId("00000000-0000-0000-0000-000000000000");
|
||||
designerShapeRelationModel.setRelationShapeId("00000000-0000-0000-0000-000000000000");
|
||||
|
||||
//作废时间
|
||||
Date cancelDate=new Date();
|
||||
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd");
|
||||
propertyDao.updatePropertyByPropertyId(plId, "obsolescence_time", sdfs.format(cancelDate));
|
||||
if(publish!=null){
|
||||
JSONObject js=new JSONObject();
|
||||
js.put("name", publish.getString("APPLYUSERNAME"));
|
||||
js.put("id", publish.getString("APPLYUSERID"));
|
||||
js.put("type", "user");
|
||||
designerShapeRelationModel.setRelationShapeText(js.toString());
|
||||
|
||||
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plId);
|
||||
if (plModel != null) {
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
dao.insert(designerShapeRelationModel);
|
||||
|
||||
DesignerShapeRelationModel designerShapeRelationModel=new DesignerShapeRelationModel();
|
||||
designerShapeRelationModel.setId(UUIDGener.getUUID());
|
||||
designerShapeRelationModel.setFileId(plId);
|
||||
designerShapeRelationModel.setAttrId("nullifier");
|
||||
designerShapeRelationModel.setRelationFileId("00000000-0000-0000-0000-000000000000");
|
||||
designerShapeRelationModel.setRelationShapeId("00000000-0000-0000-0000-000000000000");
|
||||
PALRepositoryCache.getCache().put(plId, plModel);
|
||||
}
|
||||
|
||||
JSONObject js=new JSONObject();
|
||||
js.put("name", publish.getString("APPLYUSERNAME"));
|
||||
js.put("id", publish.getString("APPLYUSERID"));
|
||||
js.put("type", "user");
|
||||
}
|
||||
|
||||
designerShapeRelationModel.setRelationShapeText(js.toString());
|
||||
|
||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||
dao.insert(designerShapeRelationModel);
|
||||
|
||||
|
||||
PALRepositoryCache.getCache().put(plId, plModel);
|
||||
}else{
|
||||
SDK.getLogAPI().consoleInfo("未找到流程发布表ID为'"+plId+"'的数据===========>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
package com.awspaas.user.bpa;
|
||||
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.awspaas.user.bpa.util.PptCreateUtil;
|
||||
import com.spire.presentation.*;
|
||||
import com.spire.presentation.drawing.IImageData;
|
||||
import com.spire.xls.Workbook;
|
||||
import com.spire.xls.Worksheet;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.hslf.extractor.PowerPointExtractor;
|
||||
import org.apache.poi.sl.usermodel.PictureData;
|
||||
import org.apache.poi.xslf.usermodel.*;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
|
||||
import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape;
|
||||
import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
|
||||
import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class test {
|
||||
public static void main(String[] args) throws Exception {
|
||||
//新建PowerPoint文档
|
||||
Presentation ppt = new Presentation();
|
||||
|
||||
//加载Excel文档,将指定单元格数据保存为图片
|
||||
Workbook workbook = new Workbook();
|
||||
workbook.loadFromFile("test.xlsx");
|
||||
Worksheet sheet = workbook.getWorksheets().get(0);
|
||||
sheet.saveToImage("image.png",1,1,8,7);//将指定单元格数据范围保存为图片
|
||||
|
||||
//加载保存的表格图片(作为OLE对象图标)
|
||||
File file = new File("image.png");
|
||||
BufferedImage image = ImageIO.read(file);
|
||||
IImageData oleImage = ppt.getImages().append(image);
|
||||
Rectangle rec = new Rectangle(120, 30, image.getWidth()/2, image.getHeight()/2);
|
||||
|
||||
//将Excel数据保存到流
|
||||
File oldFile = new File("test.xlsx");
|
||||
FileInputStream inputStream = new FileInputStream(oldFile);
|
||||
byte[] data = new byte[(int)oldFile.length()];
|
||||
inputStream.read(data,0,data.length);
|
||||
|
||||
//将Excel文档作为OLE对象插入到幻灯片
|
||||
IOleObject oleObject = ppt.getSlides().get(0).getShapes().appendOleObject("excel", data, rec);
|
||||
oleObject.getSubstituteImagePictureFillFormat().getPicture().setEmbedImage(oleImage);
|
||||
oleObject.setProgId("Excel.Sheet.12");
|
||||
|
||||
//保存文档
|
||||
ppt.saveToFile("EmbedExcelAsOLE.pptx", FileFormat.PPTX_2013);
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user