yuansh 2 years ago
parent
commit
6055e43ae0

+ 17 - 8
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/Impl/ActBusinessServiceImpl.java

@@ -284,11 +284,16 @@ public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBu
 
             if (actZprocess != null) {
 
-                QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
-                practiceQueryWrapper.eq("business_table_id", tableId);
-                practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+                try {
 
-                tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
+                    QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+                    practiceQueryWrapper.eq("business_table_id", tableId);
+                    practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+
+                    tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
+                }catch (Exception ee){
+                    System.out.println("业务信息获取错误"+ee.getMessage());
+                }
 
                 String pattern = oConvertUtils.getString(actZprocess.getDescription());
                 if (oConvertUtils.isNotEmpty(pattern) && pattern.startsWith("(") && pattern.endsWith(")") && tableInfoPractice != null){
@@ -318,12 +323,16 @@ public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBu
                 ActZprocess actZprocess = actZprocessMapper.selectById(actBusiness.getProcDefId());
                 TbTableInfoPractice tableInfoPractice = null;
                 if (actZprocess != null) {
+                    try {
 
-                    QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
-                    practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
-                    practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+                        QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+                        practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
+                        practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
 
-                    tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
+                        tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
+                    }catch (Exception ee){
+                        System.out.println("业务信息获取错误"+ee.getMessage());
+                    }
 
                     String pattern = oConvertUtils.getString(actZprocess.getDescription());
 

+ 17 - 12
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -616,21 +616,26 @@ public class ActBusinessController {
                 }
             }
 
-            // 关联额外信息e
-            TbTableInfoPractice tbTableInfoPractice = tbTableInfoPracticeService.getById(e.getTableId());
-            if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
-                e.setDescription(tbTableInfoPractice.getExtraInfo());
-            }else{
-                QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
-                practiceQueryWrapper.eq("business_table_id", e.getTableId());
-                practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
-                tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
+
+            try {
+                // 关联额外信息e
+                TbTableInfoPractice tbTableInfoPractice = tbTableInfoPracticeService.getById(e.getTableId());
                 if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
                     e.setDescription(tbTableInfoPractice.getExtraInfo());
+                }else{
+                    QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+                    practiceQueryWrapper.eq("business_table_id", e.getTableId());
+                    practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+                    tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
+                    if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
+                        e.setDescription(tbTableInfoPractice.getExtraInfo());
+                    }
                 }
-            }
-            if (e.getDescription() == null){
-                e.setDescription("");
+                if (e.getDescription() == null){
+                    e.setDescription("");
+                }
+            }catch (Exception ee){
+                System.out.println("业务信息获取错误"+ee.getMessage());
             }
 
         });

+ 22 - 10
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActTaskController.java

@@ -157,17 +157,24 @@ public class ActTaskController {
                 tv.setTableId(actBusiness.getTableId());
                 tv.setTableName(actBusiness.getTableName());
             }
+
+
             // 关联额外信息
             TbTableInfoPractice tbTableInfoPractice = tbTableInfoPracticeService.getById(actBusiness.getTableId());
             if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
                 tv.setDescription(tbTableInfoPractice.getExtraInfo());
             }else{
-                QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
-                practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
-                practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
-                tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
-                if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
-                    tv.setDescription(tbTableInfoPractice.getExtraInfo());
+                try {
+
+                    QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+                    practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
+                    practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+                    tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
+                    if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
+                        tv.setDescription(tbTableInfoPractice.getExtraInfo());
+                    }
+                }catch (Exception ee){
+                    System.out.println("业务信息获取错误"+ee.getMessage());
                 }
             }
             if (tv.getDescription() == null){
@@ -784,11 +791,16 @@ public class ActTaskController {
                 if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
                     htv.setDescription(tbTableInfoPractice.getExtraInfo());
                 }else{
-                    QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
-                    practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
-                    practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+                    try {
 
-                    tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
+                        QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+                        practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
+                        practiceQueryWrapper.and(i-> i.eq("is_initial","1").or().eq("is_initial",null).or().eq("is_initial",""));
+
+                        tbTableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
+                    }catch (Exception ee){
+                        System.out.println("业务信息获取错误"+ee.getMessage());
+                    }
                     if (tbTableInfoPractice != null && oConvertUtils.isNotEmpty(tbTableInfoPractice.getExtraInfo())){
                         htv.setDescription(tbTableInfoPractice.getExtraInfo());
                     }