浏览代码

申请刻制印章监听

xieyn 1 年之前
父节点
当前提交
e9abc279f2

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.activiti.listener;
 
+import com.alibaba.fastjson.JSONArray;
 import org.activiti.engine.delegate.*;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.api.ISysBaseAPI;
@@ -12,8 +13,9 @@ import org.jeecg.modules.oa.mapper.SealTurnMapper;
 import org.jeecg.modules.oa.service.IActivitiService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,12 +42,36 @@ public class ListenerApplySeal implements TaskListener, ExecutionListener {
             //todo
             Map<String, Object> variables = delegateExecution.getVariables();
 //            //印章类别
-//            String type = String.valueOf(variables.get("sealType"));
+            String carvingType = String.valueOf(variables.get("carving_type"));
 //            //印章名称
-//            String name = String.valueOf(variables.get("sealName"));
-//            //
-//            SealArchives sealArchives = new SealArchives();
-//            sealArchivesMapper.insert(sealArchives);
+            String name = String.valueOf(variables.get("seal_name"));
+            //印章材质seal_size
+            String sealMaterial = String.valueOf(variables.get("seal_material"));
+            //印章尺寸seal_size
+            String sealSize = String.valueOf(variables.get("seal_size"));
+            //印章保管人seal_custodian
+            String sealKeeper = String.valueOf(variables.get("seal_keeper"));
+            //印章保管部门custodian_dept
+            String custodyDepartment = String.valueOf(variables.get("custody_department"));
+            //刻章日期engraving_date
+            String applicationDate = String.valueOf(variables.get("application_date"));
+            SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
+            Date engravingDate = ft.parse(applicationDate);
+            //附件
+//            String accessory = String.valueOf(variables.get("accessory"));
+//            JSONArray ay= JSONArray.parseArray(accessory);
+
+            SealArchives sealArchives = new SealArchives();
+            sealArchives.setSealName(name);
+            sealArchives.setSealType(carvingType);
+            sealArchives.setSealSize(sealSize);
+            sealArchives.setSealMaterial(sealMaterial);
+            sealArchives.setSealStatus("正在使用");
+            sealArchives.setSealCustodian(sealKeeper);
+            sealArchives.setCustodianDept(custodyDepartment);
+            sealArchives.setEngravingDate(engravingDate);
+//            sealArchives.setFile(accessory);
+            sealArchivesMapper.insert(sealArchives);
         } else if ("take".equals(eventName)) {
             // 连线监听器
         }