| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.api.smo.undo.IUndoSMO; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | 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 { |
| | |
| | | |
| | | JSONObject doing = new JSONObject(); |
| | | //查询 报修待办 |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/ownerRepair.listStaffRepairs" + mapToUrlParam(paramIn); |
| | | String apiUrl = "ownerRepair.listStaffRepairs" + mapToUrlParam(paramIn); |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | paramIn.put("staffId", result.getUserId()); |
| | | |
| | | |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/auditUser.listAuditComplaints" + mapToUrlParam(paramIn); |
| | | apiUrl = "auditUser.listAuditComplaints" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | doing.put("complaint", "0"); |
| | | } |
| | | //采购待办 |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/auditUser.listAuditOrders" + mapToUrlParam(paramIn); |
| | | apiUrl = "auditUser.listAuditOrders" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | doing.put("purchase", "0"); |
| | | } |
| | | //物品领用待办 |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/collection/getCollectionAuditOrder" + mapToUrlParam(paramIn); |
| | | apiUrl = "/collection/getCollectionAuditOrder" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | |
| | | //contract/queryContractTask |
| | | //合同起草待办 |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/contract/queryContractTask" + mapToUrlParam(paramIn); |
| | | apiUrl = "/contract/queryContractTask" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | } |
| | | //contract/queryContractTask |
| | | //合同变更 |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/contract/queryContractChangeTask" + mapToUrlParam(paramIn); |
| | | apiUrl = "/contract/queryContractChangeTask" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | } |
| | | |
| | | //合同变更 |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/resourceStore.listAllocationStoreAuditOrders" + mapToUrlParam(paramIn); |
| | | apiUrl = "resourceStore.listAllocationStoreAuditOrders" + mapToUrlParam(paramIn); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | |
| | | } 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() { |
| | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | | } |