增加发布流程发布通知@公式\点击保存保存操作指导、制度更新到扩展字段\制度手册解决企微浏览器乱码问题\解决主数据部门名称不同步问题

This commit is contained in:
zhal 2024-02-20 11:43:52 +08:00
parent 385a40a8c9
commit b36ea97e06
12 changed files with 123 additions and 21 deletions

View File

@ -261,6 +261,12 @@ public class IntegrationJob implements IJob {
if(map!=null) {
SDK.getORGAPI().updateDepartment(createDepartment, org_name, org_code, ORGAPI.NO_UPDATE, hr_org_id, buName, full_name, map.getString("BUSINESS_UNIT"), ext5.toString(), dept_flag, org_code, start_date, end_date);
}
DepartmentModel departmentModel=SDK.getORGAPI().getDepartmentById(currentId);
String departname=departmentModel.getName();
if(!org_name.equals(departname)){
SDK.getORGAPI().updateDepartment(currentId, org_name, org_code, ORGAPI.NO_UPDATE, hr_org_id, buName, full_name, ORGAPI.NO_UPDATE, ext5.toString(), dept_flag, org_code, start_date, end_date);
}
/*
String sql ="SELECT USERID FROM ORGUSER WHERE DEPARTMENTID = '"+createDepartment+"'";
* String userId = DBSql.getString(sql); UserModel user =
@ -287,6 +293,14 @@ public class IntegrationJob implements IJob {
if(map!=null) {
SDK.getORGAPI().updateDepartment(currentId, org_name, org_code, ORGAPI.NO_UPDATE, hr_org_id, buName, full_name, map.getString("BUSINESS_UNIT"), ext5.toString(), dept_flag, org_code, start_date, end_date);
}
DepartmentModel departmentModel=SDK.getORGAPI().getDepartmentById(currentId);
String departname=departmentModel.getName();
if(!org_name.equals(departname)){
SDK.getORGAPI().updateDepartment(currentId, org_name, org_code, ORGAPI.NO_UPDATE, hr_org_id, buName, full_name, ORGAPI.NO_UPDATE, ext5.toString(), dept_flag, org_code, start_date, end_date);
}
if("A".equals(eff_status)) {
if(SDK.getORGAPI().getDepartmentById(currentId).isClosed()) {
SDK.getORGAPI().activeDepartment(currentId);

View File

@ -136,7 +136,11 @@ public class CopyJob implements IJob {
/**
* 创建线程发送待阅数据
*/
course(lists,startTime,jsonObject,pc,list);
try {
course(lists,startTime,jsonObject,pc,list);
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println("发送人员数据>>>>>>>>>>>>>>"+list);
}else {
int size = users.length/length;
@ -156,7 +160,11 @@ public class CopyJob implements IJob {
/**
* 创建线程发送待阅数据
*/
course(lists,startTime,jsonObject,pc,list);
try {
course(lists,startTime,jsonObject,pc,list);
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println("发送人员数据>>>>>>>>>>>>>>"+list);
}

View File

@ -172,7 +172,11 @@ public class InsertOAJob implements IJob {
/**
* 创建线程发送待阅数据
*/
course(lists,startTime,jsonObject,pc,taskInstance,list);
try {
course(lists,startTime,jsonObject,pc,taskInstance,list);
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println("发送人员数据>>>>>>>>>>>>>>"+list);
}else {
int size = users.length/length;
@ -192,7 +196,11 @@ public class InsertOAJob implements IJob {
/**
* 创建线程发送待阅数据
*/
course(lists,startTime,jsonObject,pc,taskInstance,list);
try {
course(lists,startTime,jsonObject,pc,taskInstance,list);
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println("发送人员数据>>>>>>>>>>>>>>"+list);
}

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.publisher.at.SendPublisherMessageAt;
import com.actionsoft.apps.coe.pal.publisher.client.web.ProcessPublishClientWeb;
import com.actionsoft.apps.coe.pal.publisher.client.web.ProcessPublishWeb;
import com.actionsoft.apps.coe.pal.publisher.conf.PublisherConf;
@ -145,6 +146,10 @@ public class Plugins implements PluginListener {
params15.put("icon", "");
list.add(new AppExtensionProfile("流程发布->通知", "aslp://com.actionsoft.apps.notification/registerApp", params15));
// 注册AT公式
list.add(new AtFormulaPluginProfile("根据发布部门返回应发送发布人员账号", "@SendPublishMessage(*depName)", SendPublisherMessageAt.class.getName(), "返回发送发布人员账号", "返回发送发布人员账号"));
return list;
}

View File

@ -0,0 +1,29 @@
package com.actionsoft.apps.coe.pal.publisher.at;
import com.actionsoft.apps.coe.pal.system.util.StringUtil;
import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.commons.at.AbstExpression;
import com.actionsoft.bpms.commons.at.ExpressionContext;
import com.actionsoft.exception.AWSExpressionException;
import com.actionsoft.sdk.local.SDK;
import org.apache.commons.lang3.StringUtils;
public class SendPublisherMessageAt extends AbstExpression {
public SendPublisherMessageAt(ExpressionContext atContext, String expressionValue) {
super(atContext, expressionValue);
}
public String execute(String expression) {
// 获取发送部门
String depName = getParameter(expression, 1);
BO act_sendpublishmessage=SDK.getBOAPI().query("BO_ACT_SENDPUBLISHMESSAGE").addQuery("DEPNAME=",depName).detail();
String sendperson=null;
if(act_sendpublishmessage!=null){
sendperson=act_sendpublishmessage.getString("SENDPERSON");
}
return sendperson;
}
}

View File

@ -230,6 +230,7 @@ public class OutputWordUtil {
* @param docName
*/
public static void createZdDoc2(JSONObject dataMap, String tempPath, String tempName, String docName, JSONObject wizardJsonData, String repositoryId, String docPath) throws FileNotFoundException {
Configuration configuration = new Configuration();
configuration.setDefaultEncoding("UTF-8");
@ -733,7 +734,6 @@ public class OutputWordUtil {
if (relationList2.size() > 0) {
for (DesignerShapeRelationModel relation : relationList2) {
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
System.out.println("relationFileId============="+relationFileId);
PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId);
if (model != null) {
@ -1073,22 +1073,27 @@ public class OutputWordUtil {
// 排序
Collections.sort(search2, new Comparator<UpfileModel>() {
@Override
public int compare(UpfileModel o1, UpfileModel o2) {
String p1 = o1.getFileName();
String p2 = o2.getFileName();
try {
Collections.sort(search2, new Comparator<UpfileModel>() {
@Override
public int compare(UpfileModel o1, UpfileModel o2) {
String p1 = o1.getFileName();
String p2 = o2.getFileName();
if (p1.substring(0, 2).equals("附件") && p2.substring(0, 2).equals("附件") && p1.contains("") && p2.contains("") && StringUtils.isNumeric(p1.substring(2, p1.indexOf(""))) && StringUtils.isNumeric(p2.substring(2, p2.indexOf("")))) {
return Integer.parseInt(p1.substring(2, p1.indexOf(""))) - Integer.parseInt(p2.substring(2, p2.indexOf("")));
} else {
return 0;
}
if (p1.substring(0, 2).equals("附件") && p2.substring(0, 2).equals("附件") && p1.contains("") && p2.contains("") && StringUtils.isNumeric(p1.substring(2, p1.indexOf(""))) && StringUtils.isNumeric(p2.substring(2, p2.indexOf("")))) {
return Integer.parseInt(p1.substring(2, p1.indexOf(""))) - Integer.parseInt(p2.substring(2, p2.indexOf("")));
} else {
return 0;
}
});
} catch (Exception e) {
}
});
e.printStackTrace();
}
//读取模型附件插入手册中文档对象
if (search2 != null && search2.size() > 0) {
@ -1369,7 +1374,7 @@ public class OutputWordUtil {
tr4.getCharacterFormat().setBold(true);
tr4.getCharacterFormat().setFontName("宋体");
paragraph.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式
//paragraph.applyStyle(BuiltinStyle.Heading_2); //应用标题1样式
//doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);

View File

@ -6456,6 +6456,32 @@ public class CoeProcessLevelWeb extends ActionWeb {
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE);
}
ro.put("define", definition);
PALRepositoryModel palmodel = PALRepositoryCache.getCache().get(definition.get("uuid").toString());
if(palmodel!=null){
PALRepository dao = new PALRepository();
if(palmodel.getMethodId().equals("control.policy")){
JSONObject elements = definition.getJSONObject("elements");
Iterator<String> ite = elements.keySet().iterator();
PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao();
while (ite.hasNext()) {
String key = ite.next();
JSONObject shape = elements.getJSONObject(key);
String name = shape.getString("name");
if(name.equals("I/O_L4")){
int r = dao.updateRepositoryExt(definition.get("uuid").toString(), palmodel.getExt1(), palmodel.getExt2(), "I/O_L4", palmodel.getExt4());
break;
} else if (name.equals("regulation")) {
int r = dao.updateRepositoryExt(definition.get("uuid").toString(), palmodel.getExt1(), palmodel.getExt2(), "regulation", palmodel.getExt4());
break;
}
}
}
}
return ro.toString();
}
@ -8873,7 +8899,6 @@ public class CoeProcessLevelWeb extends ActionWeb {
//新建一个uuid
String shapeId = UUIDGener.getObjectId();
//拿到基础结构
JSONObject shape;
if (type.equals("1")) {
@ -8885,6 +8910,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
shape.put("id", shapeId);
shape.put("text", title);
}
//图形的数据属性配置
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, plModel.getMethodId());
for (PALMethodAttributeModel attributeModel : attributeModels) {

View File

@ -79,8 +79,12 @@ public class Report1Gener {
log.info("begin...");
log.info("-------------------");
// ----文件处理-----
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj);
Map<String,String> errorMap=new HashMap<>();
genarateWord(tempPath, tempName, dcContext.getPath(), jsonObj,errorMap);
log.info("end");
// xml转换成word格式
OutputWordUtil.xml2Word(log, dcContext.getPath());
// }
} finally {
// isRunning = false;
@ -96,7 +100,7 @@ public class Report1Gener {
* @param docPath
* @param wizardJsonData
*/
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData) throws FileNotFoundException {
private void genarateWord(String tempPath, String tempName, String docPath, JSONObject wizardJsonData,Map<String,String> errorMap) throws FileNotFoundException {
String[] repositoryIds = wizardJsonData.getString("targetFileId").split(",");
String reportName = wizardJsonData.getString("reportNameIsItName"); //页面上设计的文件命名规则