Forráskód Böngészése

刻章申请监听

xieyn 1 éve
szülő
commit
cd35591da0

+ 11 - 4
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/activiti/listener/ListenerApplySeal.java

@@ -58,9 +58,16 @@ public class ListenerApplySeal implements TaskListener, ExecutionListener {
             SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
             Date engravingDate = ft.parse(applicationDate);
             //附件
-//            String accessory = String.valueOf(variables.get("accessory"));
-//            JSONArray ay= JSONArray.parseArray(accessory);
-
+            String accessory = String.valueOf(variables.get("accessory"));
+            String file = null;
+            if(!"[]".equals(accessory)){
+                JSONArray ay= JSONArray.parseArray(accessory);
+                for(int i=0;i<ay.size();i++) {
+                    file += ay.getJSONObject(i).get("url")+",";
+                    System.out.println(ay.getJSONObject(i).get("url"));
+                }
+                file = file.substring(0, file.length() - 1);
+            }
             SealArchives sealArchives = new SealArchives();
             sealArchives.setSealName(name);
             sealArchives.setSealType(carvingType);
@@ -70,7 +77,7 @@ public class ListenerApplySeal implements TaskListener, ExecutionListener {
             sealArchives.setSealCustodian(sealKeeper);
             sealArchives.setCustodianDept(custodyDepartment);
             sealArchives.setEngravingDate(engravingDate);
-//            sealArchives.setFile(accessory);
+            sealArchives.setFile(file);
             sealArchivesMapper.insert(sealArchives);
         } else if ("take".equals(eventName)) {
             // 连线监听器