| | |
| | | */ |
| | | package com.java110.front.controller.activiti; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.oaWorkflow.StencilsetJson; |
| | | import com.java110.dto.workflow.WorkflowModelDto; |
| | | import com.java110.front.smo.activiti.IModelSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.xml.ws.Response; |
| | | |
| | | /** |
| | | * @desc add by 吴学文 8:38 |
| | |
| | | * @param modelId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/model/{modelId}/json", method = RequestMethod.GET,produces = "application/json;charset=UTF-8") |
| | | public ResponseEntity<String> queryJson(@PathVariable String modelId) { |
| | | @RequestMapping(value = "/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") |
| | | public String queryJson(@PathVariable String modelId) { |
| | | |
| | | return modelSMOImpl.getJson(modelId); |
| | | JSONObject paramOut = JSONObject.parseObject(modelSMOImpl.getJson(modelId).getBody()); |
| | | |
| | | return paramOut.getJSONObject("data").toJSONString(); |
| | | } |
| | | |
| | | /** |
| | | * 查询工作流json |
| | | * |
| | | * @param version |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") |
| | | public String stencilset(@RequestParam(value = "version", required = false) String version) { |
| | | |
| | | return StencilsetJson.JSON; |
| | | } |
| | | |
| | | /** |
| | | * 更新流程 |
| | | * |
| | | * @param modelId 模型ID |
| | | * @param xmlJson 流程模型名称 |
| | | */ |
| | | @RequestMapping(value = "/model/{modelId}/save", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveModel(@PathVariable String modelId |
| | | , @RequestBody String xmlJson) { |
| | | JSONObject paramJson = JSONObject.parseObject(xmlJson); |
| | | WorkflowModelDto workflowModelDto = new WorkflowModelDto(); |
| | | workflowModelDto.setJson_xml(paramJson.getString("xml")); |
| | | workflowModelDto.setSvg_xml(paramJson.getString("svg")); |
| | | workflowModelDto.setModelId(modelId); |
| | | return modelSMOImpl.saveModel(workflowModelDto); |
| | | } |
| | | } |