| | |
| | | import com.java110.boot.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.boot.smo.undo.IUndoSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.dto.oaWorkflow.OaWorkflowDto; |
| | | import com.java110.dto.workflow.WorkflowDto; |
| | | import com.java110.entity.audit.AuditUser; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.intf.common.IOaWorkflowActivitiInnerServiceSMO; |
| | | import com.java110.intf.oa.IOaWorkflowInnerServiceSMO; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private IOaWorkflowActivitiInnerServiceSMO oaWorkflowUserInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Autowired |
| | | private IOaWorkflowInnerServiceSMO oaWorkflowInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> listUndos(IPageData pd) throws SMOException { |
| | |
| | | } else { |
| | | doing.put("allocation", "0"); |
| | | } |
| | | getItemReleaseCount(result, doing); |
| | | |
| | | return ResultVo.createResponseEntity(doing); |
| | | } |
| | | |
| | | private void getItemReleaseCount(ComponentValidateResult result, JSONObject data) { |
| | | OaWorkflowDto oaWorkflowDto = new OaWorkflowDto(); |
| | | oaWorkflowDto.setState(OaWorkflowDto.STATE_COMPLAINT); |
| | | oaWorkflowDto.setFlowType(OaWorkflowDto.FLOW_TYPE_ITEM_RELEASE); |
| | | List<OaWorkflowDto> oaWorkflowDtos = oaWorkflowInnerServiceSMOImpl.queryOaWorkflows(oaWorkflowDto); |
| | | |
| | | if (oaWorkflowDtos == null || oaWorkflowDtos.size() < 1) { |
| | | data.put("itemReleaseCount", "0"); |
| | | return ; |
| | | } |
| | | List<String> flowIds = new ArrayList<>(); |
| | | for (OaWorkflowDto tmpOaWorkflowDto : oaWorkflowDtos) { |
| | | flowIds.add(WorkflowDto.DEFAULT_PROCESS + tmpOaWorkflowDto.getFlowId()); |
| | | } |
| | | |
| | | AuditUser auditUser = new AuditUser(); |
| | | auditUser.setUserId(result.getUserId()); |
| | | auditUser.setProcessDefinitionKeys(flowIds); |
| | | |
| | | long itemReleaseCount = oaWorkflowUserInnerServiceSMOImpl.getDefinitionKeysUserTaskCount(auditUser); |
| | | data.put("itemReleaseCount", itemReleaseCount); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |