feat: There is no way the,buss
This commit is contained in:
+8
-8
@@ -47,7 +47,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
@Override
|
||||
public String mergeModelFile(String pid, String taskId,String fileSuffix){
|
||||
|
||||
String fileSavePath = filePath +"bussEdit"+ getUUIDPath(pid,taskId);
|
||||
String fileSavePath = "bussEdit"+ getUUIDPath(pid,taskId);
|
||||
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append(filePath);
|
||||
@@ -64,12 +64,12 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
try {
|
||||
if(!hisList.isEmpty()){
|
||||
newFileName = fileSavePath+taskId + "_" + pid + "_count." + fileSuffix;
|
||||
|
||||
String changeFile = filePath + newFileName;
|
||||
for (int i = 0; i < hisList.size(); i++) {
|
||||
if(i == 0){
|
||||
PoiWord.wordRedDocument(modelPath,null,newFileName,hisList.get(i).getEditFilePath());
|
||||
PoiWord.wordRedDocument(filePath+hisList.get(i).getEditFilePath(),null,changeFile,modelPath);
|
||||
}else {
|
||||
PoiWord.wordRedDocument(newFileName,null,newFileName,hisList.get(i).getEditFilePath());
|
||||
PoiWord.wordRedDocument(filePath+hisList.get(i).getEditFilePath(),null,changeFile,changeFile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
*/
|
||||
public String saveProcessFile(String filePath,String pid,String taskId,String fileSuffix){
|
||||
|
||||
String fileSavePath = filePath +"bussEdit"+ getUUIDPath(pid,taskId);
|
||||
String fileSavePath = "bussEdit"+ getUUIDPath(pid,taskId);
|
||||
String newFileName = "";
|
||||
try {
|
||||
|
||||
@@ -111,15 +111,15 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
newFileName = taskId + "_" + pid + "_node." + fileSuffix;
|
||||
File saveFile = new File(fileSavePath + newFileName);
|
||||
newFileName = fileSavePath + taskId + "_" + pid + "_node." + fileSuffix;
|
||||
File saveFile = new File(filePath + newFileName);
|
||||
FileUtils.write(saveFile, "","UTF-8");
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return fileSavePath+newFileName;
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public static String getUUIDPath(String pid,String taskId){
|
||||
|
||||
@@ -51,20 +51,18 @@ public class BLApplicantAfter implements TaskListener{
|
||||
String prcName = "企标制修订流程及企业标准库流程";
|
||||
|
||||
// 下个节点执行人处理逻辑
|
||||
List<String> nextUserList = new ArrayList();
|
||||
List<String> finalNextUserList = new ArrayList();
|
||||
List<BusProcessModelHis> busProcessModelHisList = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(object.getString("modelData"))){
|
||||
List<JSONObject> valueArr = JSONArray.parseArray(object.getString("modelData"),JSONObject.class);
|
||||
Map<String, List<JSONObject>> listMap = valueArr.stream().collect(
|
||||
Collectors.groupingBy(a -> Utils.format("{0}", a.getString("userId"))));
|
||||
List<String> finalNextUserList = nextUserList;
|
||||
Collectors.groupingBy(a -> Utils.format("{0}", a.getString("zrUserId"))));
|
||||
listMap.forEach((s, jsonObjects) -> {
|
||||
String json = JSONArray.toJSONString(jsonObjects);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
modelHis.setPId(delegateTask.getProcessInstanceId());
|
||||
modelHis.setMesg(json);
|
||||
modelHis.setTaskInfo(delegateTask.getName());
|
||||
modelHis.setUserId(s);
|
||||
modelHis.setPrcName(prcName);
|
||||
modelHis.setEditType("node");
|
||||
@@ -73,15 +71,14 @@ public class BLApplicantAfter implements TaskListener{
|
||||
busProcessModelHisList.add(modelHis);
|
||||
finalNextUserList.add(s);
|
||||
});
|
||||
nextUserList.addAll(finalNextUserList);
|
||||
// if(object.getString("qcUserId").contains(",")){
|
||||
// nextUserList = Arrays.asList(object.getString("qcUserId").split(","));
|
||||
// }else {
|
||||
// nextUserList.add(object.getString("qcUserId"));
|
||||
// }
|
||||
// 配置多实例
|
||||
delegateTask.setVariable("qcUserList",nextUserList);
|
||||
delegateTask.addCandidateUsers(nextUserList);
|
||||
delegateTask.setVariable("qcUserList",finalNextUserList);
|
||||
delegateTask.addCandidateUsers(finalNextUserList);
|
||||
}else {
|
||||
throw new ActivitiException("1#2其他起草人参数不存在,请配置相关用户");
|
||||
}
|
||||
@@ -110,8 +107,8 @@ public class BLApplicantAfter implements TaskListener{
|
||||
busProcessNew.setTaskInfo(delegateTask.getName());
|
||||
busBean.save(busProcessNew);
|
||||
|
||||
if(nextUserList != null && !nextUserList.isEmpty()){
|
||||
for(String nextUser : nextUserList){
|
||||
if(finalNextUserList != null && !finalNextUserList.isEmpty()){
|
||||
for(String nextUser : finalNextUserList){
|
||||
BusProcessNew busProcessNewNext = new BusProcessNew();
|
||||
busProcessNewNext.setMsgType("clause");
|
||||
busProcessNewNext.setPId(delegateTask.getProcessInstanceId());
|
||||
|
||||
@@ -50,6 +50,7 @@ public class BussLibrary2Before implements TaskListener{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
BusProcessModelHis modelHis = hisList.get(0);
|
||||
modelHis.setTaskId(delegateTask.getId());
|
||||
modelHis.setTaskInfo(delegateTask.getName());
|
||||
String filePath = hisService.saveBussModelFile(delegateTask.getProcessInstanceId(),delegateTask.getId());
|
||||
modelHis.setEditFilePath(filePath);
|
||||
modelHis.setUpdateTime(sdf.format(new Date()));
|
||||
|
||||
@@ -601,7 +601,7 @@ public class PoiWord {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
wordRedDocument("E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc-1.docx",null,"E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc3.docx","E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc-2.docx");
|
||||
wordRedDocument("E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc-2.docx",null,"E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc3.docx","E:\\Software\\rtpro\\Foton\\File\\doc\\create_toc-1.docx");
|
||||
// writeWordBanch();
|
||||
// writeToDocx();
|
||||
// writeTOC();
|
||||
|
||||
Reference in New Issue
Block a user