提交时创建手册报错问题解决,生成编号规则修改
This commit is contained in:
parent
1973dd4e05
commit
b831b5c3a1
@ -16,77 +16,77 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.sym;
|
||||
* @date 2022/7/12 23:00
|
||||
*/
|
||||
public class ProcesNumberUtil {
|
||||
/**
|
||||
* 根据流程等级和区域编码 获取编号
|
||||
*
|
||||
* @param levelCode
|
||||
* @param regionCode
|
||||
* @return
|
||||
*/
|
||||
public String getProcessNum(String levelCode, String regionCode,String plcategory) {
|
||||
/**
|
||||
* 根据流程等级和区域编码 获取编号
|
||||
*
|
||||
* @param levelCode
|
||||
* @param regionCode
|
||||
* @return
|
||||
*/
|
||||
public String getProcessNum(String levelCode, String regionCode,String plcategory) {
|
||||
|
||||
int nowNum = 1;
|
||||
//流程编号
|
||||
if (plcategory.contains("process")) {
|
||||
String querySql = "select ID,PROCESS_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
int update = DBSql.update(String.format(sql, id, levelCode, regionCode, nowNum + 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("PROCESS_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set PROCESS_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
int nowNum = 1;
|
||||
//流程编号
|
||||
if (plcategory.contains("process")) {
|
||||
String querySql = "select ID,PROCESS_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
int update = DBSql.update(String.format(sql, id, levelCode, regionCode, nowNum + 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("PROCESS_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set PROCESS_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
|
||||
} else if (plcategory.contains("control")) {
|
||||
//制度编号
|
||||
String querySql = "select ID,SYSTEM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
DBSql.update(String.format(sql, id, levelCode, regionCode, 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("SYSTEM_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set SYSTEM_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
DBSql.update(String.format(sql, id, levelCode, regionCode, 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("SYSTEM_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set SYSTEM_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
|
||||
} else if (plcategory.contains("form")) {
|
||||
//表单编号
|
||||
String querySql = "select ID,FORM_NUMBERS from BO_ACT_PROCESSNUMBER where LEVELNUM = '%s' and REGIONCODE='%s'";
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
DBSql.update(String.format(sql, id, levelCode, regionCode, 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("FORM_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set FORM_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
RowMap result = DBSql.getMap(String.format(querySql, levelCode, regionCode));
|
||||
//如果没有就新增
|
||||
if (result == null) {
|
||||
String sql = "insert into BO_ACT_PROCESSNUMBER (ID,LEVELNUM,REGIONCODE,PROCESS_NUMBERS,SYSTEM_NUMBERS,FORM_NUMBERS) values ('%s', '%s', '%s', %s, %s, %s)";
|
||||
String id = UUIDGener.getUUID();
|
||||
DBSql.update(String.format(sql, id, levelCode, regionCode, 1, 1, 1));
|
||||
return "01";
|
||||
}
|
||||
nowNum = result.getInt("FORM_NUMBERS");
|
||||
String updateSql = "update BO_ACT_PROCESSNUMBER set FORM_NUMBERS=%s where ID='%s'";
|
||||
DBSql.update(String.format(updateSql, nowNum + 1, result.getString("ID")));
|
||||
if (nowNum < 10) {
|
||||
return "0" + nowNum;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return nowNum + "";
|
||||
}
|
||||
return nowNum + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成编号并写入数据库
|
||||
@ -144,74 +144,74 @@ public class ProcesNumberUtil {
|
||||
String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
|
||||
int update2 = DBSql.update(String.format(updateAttrsql, new_number, fileName, changAfterFileId));
|
||||
System.out.println("更新模型文件编号:" + update2 + "--->" + new_number);
|
||||
}else {
|
||||
// 查询出主表数据
|
||||
BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
|
||||
// 根据主表数据查询出权限的编码
|
||||
String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s'"
|
||||
+ " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
|
||||
RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
|
||||
mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
|
||||
mainData.getString("LEVEL_3_PROCESS_NAME"), mainData.getString("ADAPT_REGION_NAME"),
|
||||
mainData.getString("APPLICABLE_PRODUCT")));
|
||||
// 获取所有的流程编码 如果为空则为00
|
||||
String orgCode = authData.getString("ORGCODE");
|
||||
String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
|
||||
String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
|
||||
String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
|
||||
String regionCode = authData.getString("ADAPT_REGION_CODE");
|
||||
String productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
|
||||
// 依次生成编号~并回填 修改
|
||||
if (UtilString.isNotEmpty(levelTwo)) {
|
||||
levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
|
||||
} else {
|
||||
levelTwo = "00";
|
||||
}
|
||||
if (UtilString.isNotEmpty(levelThree)) {
|
||||
levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
|
||||
} else {
|
||||
levelThree = "00";
|
||||
}
|
||||
String levelnum = levelOne + "." + levelTwo + "." + levelThree;
|
||||
|
||||
String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where ID = '%s'";
|
||||
rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
|
||||
+ changAfterFileId + "' AND" + " ISUSE = 1 ");
|
||||
String name = "18R18";
|
||||
String fileName = "file_number";
|
||||
String plver = "2.0";
|
||||
if (rowMap != null) {
|
||||
String plcategory = rowMap.getString("PLMETHODID");
|
||||
String plvers = rowMap.getString("PLVER");
|
||||
String number = getProcessNum(levelnum, orgCode,plcategory);
|
||||
System.err.println("=======number======="+number);
|
||||
number = "19";
|
||||
if (plcategory.contains("process")) {
|
||||
name = number + "/P" + number;
|
||||
} else if (plcategory.contains("control")) {
|
||||
name = "00" + "/R" + number;
|
||||
} else if (plcategory.contains("form")) {
|
||||
fileName = "form_number";
|
||||
name = number + "/T" + number;
|
||||
}
|
||||
if (!"".equals(plvers)) {
|
||||
if (plvers.length() > 1) {
|
||||
plver = plvers.substring(0, 1) + "."
|
||||
+ plvers.substring(plvers.length() - 1, plvers.length());
|
||||
} else {
|
||||
plver = plvers.substring(0, 1) + ".0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String processNum = levelnum + "." + name + "V" + plver +"-"+ orgCode + regionCode + productCode;
|
||||
String s = changData.getId();
|
||||
int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
|
||||
System.out.println("更新表单文件编号回填:" + update + "--->" + processNum+" 文件id"+s);
|
||||
String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
|
||||
int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, changAfterFileId));
|
||||
System.out.println("更新模型文件编号回填:" + update2 + "--->" + processNum +" 文件id"+changAfterFileId);
|
||||
}else {
|
||||
// 查询出主表数据
|
||||
BO mainData = SDK.getBOAPI().getByProcess("BO_ACT_COE_PUBLISH", bindId);
|
||||
// 根据主表数据查询出权限的编码
|
||||
String qxSql = "select * from BO_ACT_AUTH_INFO where ORGNAME='%s' and LEVEL_1_PROCESS_NAME='%s' and LEVEL_2_PROCESS_NAME='%s' and LEVEL_3_PROCESS_NAME='%s'"
|
||||
+ " and ADAPT_REGION_NAME = '%s' and APPLICABLE_PRODUCT='%s'";
|
||||
RowMap authData = DBSql.getMap(String.format(qxSql, mainData.getString("ADAPT_NAME_THE_COMPANY"),
|
||||
mainData.getString("LEVEL_1_PROCESS_NAME"), mainData.getString("LEVEL_2_PROCESS_NAME"),
|
||||
mainData.getString("LEVEL_3_PROCESS_NAME"), mainData.getString("ADAPT_REGION_NAME"),
|
||||
mainData.getString("APPLICABLE_PRODUCT")));
|
||||
// 获取所有的流程编码 如果为空则为00
|
||||
String orgCode = authData.getString("ORGCODE");
|
||||
String levelOne = authData.getString("LEVEL_1_PROCESS_ID");
|
||||
String levelTwo = authData.getString("LEVEL_2_PROCESS_ID");
|
||||
String levelThree = authData.getString("LEVEL_3_PROCESS_ID");
|
||||
String regionCode = authData.getString("ADAPT_REGION_CODE");
|
||||
String productCode = authData.getString("APPLICABLE_PRODUCT_CODE");
|
||||
// 依次生成编号~并回填 修改
|
||||
if (UtilString.isNotEmpty(levelTwo)) {
|
||||
levelTwo = levelTwo.substring(levelTwo.indexOf(".") + 1, levelTwo.length());
|
||||
} else {
|
||||
levelTwo = "00";
|
||||
}
|
||||
if (UtilString.isNotEmpty(levelThree)) {
|
||||
levelThree = levelThree.substring(levelThree.lastIndexOf(".") + 1, levelThree.length());
|
||||
} else {
|
||||
levelThree = "00";
|
||||
}
|
||||
String levelnum = levelOne + "." + levelTwo + "." + levelThree;
|
||||
|
||||
String updateSql = "update BO_ACT_COE_PUBLISH_C set CHANGE_NUMBER = '%s' where ID = '%s'";
|
||||
rowMap = DBSql.getMap("SELECT PLVER,PLMETHODID FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID='"
|
||||
+ changAfterFileId + "' AND" + " ISUSE = 1 ");
|
||||
String name = "18R18";
|
||||
String fileName = "file_number";
|
||||
String plver = "2.0";
|
||||
if (rowMap != null) {
|
||||
String plcategory = rowMap.getString("PLMETHODID");
|
||||
String plvers = rowMap.getString("PLVER");
|
||||
String number = getProcessNum(levelnum, orgCode,plcategory);
|
||||
System.err.println("=======number======="+number);
|
||||
number = "19";
|
||||
if (plcategory.contains("process")) {
|
||||
name = number + "/P" + number;
|
||||
} else if (plcategory.contains("control")) {
|
||||
name = "00" + "/R" + number;
|
||||
} else if (plcategory.contains("form")) {
|
||||
fileName = "form_number";
|
||||
name = number + "/T" + number;
|
||||
}
|
||||
if (!"".equals(plvers)) {
|
||||
if (plvers.length() > 1) {
|
||||
plver = plvers.substring(0, 1) + "."
|
||||
+ plvers.substring(plvers.length() - 1, plvers.length());
|
||||
} else {
|
||||
plver = plvers.substring(0, 1) + ".0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String processNum = levelnum + "." + name + "V" + plver +"-"+ orgCode + regionCode + productCode;
|
||||
String s = changData.getId();
|
||||
int update = DBSql.update(String.format(updateSql, processNum, s.toLowerCase()));
|
||||
System.out.println("更新表单文件编号回填:" + update + "--->" + processNum+" 文件id"+s);
|
||||
String updateAttrsql = "update APP_ACT_COE_PAL_PROP set PROPERTYVALUE='%s' where PROPERTYID='%s' AND PLID='%s'";
|
||||
int update2 = DBSql.update(String.format(updateAttrsql, processNum, fileName, changAfterFileId));
|
||||
System.out.println("更新模型文件编号回填:" + update2 + "--->" + processNum +" 文件id"+changAfterFileId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3534,10 +3534,9 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
String newTaskId = createOutputReport(model, model.getWsId(), _uc.getUID(), "", model.getId());
|
||||
|
||||
JSONObject object = JSONObject.parseObject(newTaskId);
|
||||
if ("ok".equals(object.getString("result"))) {
|
||||
newTaskId = object.getJSONObject("data").getString("taskId");
|
||||
//JSONObject object = JSONObject.parseObject(newTaskId);
|
||||
if (UtilString.isNotEmpty(newTaskId)) {
|
||||
//newTaskId = object.getJSONObject("data").getString("taskId");
|
||||
SDK.getLogAPI().consoleInfo("流程发布表单[发布]提交时创建流程手册成功,processInstId=" + processInstId + ",publishFileId=" + publishFileId);
|
||||
int count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_N SET TASKID='" + newTaskId + "' WHERE ID ='" + bn.getId() + "'");
|
||||
SDK.getLogAPI().consoleInfo("流程发布表单[发布]提交时创建流程手册保存数据库成功,processInstId" + processInstId + ",publishFileId=" + publishFileId + ",执行SQL条数[" + count + "]");
|
||||
@ -3575,9 +3574,9 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
String newTaskId = createOutputReport(model, model.getWsId(), _uc.getUID(), "", model.getId());
|
||||
JSONObject object = JSONObject.parseObject(newTaskId);
|
||||
if ("ok".equals(object.getString("result"))) {
|
||||
newTaskId = object.getJSONObject("data").getString("taskId");
|
||||
// JSONObject object = JSONObject.parseObject(newTaskId);
|
||||
if (UtilString.isNotEmpty(newTaskId)) {
|
||||
// newTaskId = object.getJSONObject("data").getString("taskId");
|
||||
SDK.getLogAPI().consoleInfo("流程发布表单[变更]提交时创建流程手册成功,processInstId=" + processInstId + ",changedFileIdNew=" + changedFileIdNew);
|
||||
int count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_C SET TASKID='" + newTaskId + "' WHERE ID ='" + bc.getId() + "'");
|
||||
SDK.getLogAPI().consoleInfo("流程发布表单[变更]提交时创建流程手册保存数据库成功,processInstId=" + processInstId + ",changedFileIdNew=" + changedFileIdNew + ",执行SQL条数[" + count + "]");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user