|
|
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -62,7 +63,26 @@ public class DLController {
|
|
|
McR testToken(@RequestParam("id") String processInstanceId) {
|
|
|
String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);
|
|
|
Map processData = ddClient_workflow.getProcessInstanceId(token, processInstanceId);
|
|
|
- documentService.saveCost(processData);
|
|
|
+ log.info("开始执行回调:{}",processInstanceId);
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
return McR.success();
|
|
|
}
|
|
|
|
|
|
@@ -120,7 +140,7 @@ public class DLController {
|
|
|
Map header = UtilServlet.getHeaders(request);
|
|
|
log.info("流程发起, {}, {}", data, header);
|
|
|
McException.assertException(!"dingspvmfolrjzhak6ge".equals(header.get("authorization")), McREnum.NOT_AUTHORIZED);
|
|
|
- return McR.success();
|
|
|
+ return McR.success();
|
|
|
}
|
|
|
|
|
|
}
|