|
|
@@ -1,11 +1,17 @@
|
|
|
package com.malk.jiuyousimu.delegate;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.malk.delegate.DDEvent;
|
|
|
+import com.malk.jiuyousimu.entity.basic.FNumber;
|
|
|
+import com.malk.jiuyousimu.entity.reimbursement.CostDetail;
|
|
|
import com.malk.jiuyousimu.service.DeptService;
|
|
|
import com.malk.jiuyousimu.service.DingTalkService;
|
|
|
import com.malk.jiuyousimu.service.DocumentService;
|
|
|
import com.malk.service.dingtalk.DDClient;
|
|
|
import com.malk.service.dingtalk.DDClient_Workflow;
|
|
|
+import com.malk.utils.UtilMap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -13,6 +19,7 @@ import org.springframework.context.annotation.Primary;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
@@ -87,7 +94,24 @@ public class DDDelegate implements DDEvent {
|
|
|
}else if (cost.equals(processCode)){
|
|
|
documentService.saveCost(processData);
|
|
|
} else if (trip.equals(processCode)) {
|
|
|
- documentService.saveTrip(processData);
|
|
|
+ List<Map> formComponentValues = (List<Map>) processData.get("formComponentValues");
|
|
|
+ String type = "";
|
|
|
+ for (int i = 0; i < formComponentValues.size(); i++) {
|
|
|
+ Object componentType = formComponentValues.get(i).get("componentType");
|
|
|
+ if (!"TextNote".equals(componentType) && !"TableField".equals(componentType)){
|
|
|
+ String name = formComponentValues.get(i).get("name").toString();
|
|
|
+ String value = formComponentValues.get(i).get("value").toString();
|
|
|
+ if ("报销类型".equals(name)){
|
|
|
+ type = value;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("差旅费报销".equals(type)){
|
|
|
+ documentService.saveTrip(processData);
|
|
|
+ } else if ("费用报销".equals(type)) {
|
|
|
+ documentService.saveCost(processData);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|