| | |
| | | package com.zt.life.modules.itemCirculatOrder.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.core.sys.dto.DictDto; |
| | | import com.zt.core.sys.dto.DictItemDto; |
| | | import com.zt.core.sys.dto.DictLeafDto; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.itemCirculatOrder.dao.ItemCirculatOrderDao; |
| | | import com.zt.life.modules.itemCirculatOrder.dao.ItemCirculatOrderTechnicalDao; |
| | | import com.zt.life.modules.itemCirculatOrder.dto.ItemCirculatOrderDto; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrder; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrderTechnical; |
| | | import com.zt.life.modules.project.dto.SoftwareTestOrderDto; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.project.model.*; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.project.service.SoftwareTestOrderService; |
| | | import com.zt.life.modules.sysBaseInfo.service.TestAgencyInfoService; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private WorkflowService workflowService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | Long bizId = itemCirculatOrderDto.getCirculatOrder().getId(); |
| | | FlowInfoDto flowInfoDto = itemCirculatOrderDto.getFlowInfoDto(); |
| | | |
| | | if (flowInfoDto != null && "tj,bl".contains(flowInfoDto.getSubmitType())) { |
| | | if (flowInfoDto != null && flowInfoDto.getSubmitType() != null && "tj,bl".contains(flowInfoDto.getSubmitType())) { |
| | | if ("tj".equals(flowInfoDto.getSubmitType())) { |
| | | workflowService.startFlow(flowInfoDto.getFlowCode(), bizId); |
| | | } |
| | |
| | | project.setSoftwareType(type); |
| | | data.setProject(project); |
| | | } |
| | | |
| | | if (data.getTestAgencyInfo() == null) |
| | | data.setTestAgencyInfo(testAgencyInfoService.get(10000L)); |
| | | |
| | | if (circulatOrderid != null) { |
| | | for (ItemCirculatOrderTechnical technical : data.getTechnicalList()) { |
| | | Long technicalId = technical.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(technicalId, "circulat_order"); |
| | | if (ossDto != null) { |
| | | technical.setFiles(ossDto); |
| | | } |
| | | } |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | public void exportCirculatOrder(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ItemCirculatOrderDto dataObj = this.getDto(null, id); |
| | | |
| | | String acceptorPath = "文件图片:"+ getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemAcceptorId())); |
| | | dataObj.getCirculatOrder().setItemAcceptor(acceptorPath); |
| | | String detectorPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getCalibratDetectorId())); |
| | | dataObj.getCirculatOrder().setCalibratDetector(detectorPath); |
| | | String issuerPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemIssuerId())); |
| | | dataObj.getCirculatOrder().setItemIssuer(issuerPath); |
| | | //通用字典列表字符串生成 |
| | | String itemRequireStr = getShowDictList.getShowDictList(dataObj.getCirculatOrder().getItemRequire(), "is_or_not", false); |
| | | dataObj.getCirculatOrder().setItemRequireStr(itemRequireStr); |
| | | |
| | | String acceptSituationStr = getShowDictList.getShowDictList(dataObj.getCirculatOrder().getAcceptSituation(), "is_or_not", false); |
| | | dataObj.getCirculatOrder().setAcceptSituationStr(acceptSituationStr); |
| | | |
| | | String detectSituationStr = getShowDictList.getShowDictList(dataObj.getCirculatOrder().getDetectSituation(), "is_or_not", false); |
| | | dataObj.getCirculatOrder().setDetectSituationStr(detectSituationStr); |
| | | |
| | | String issueSituationStr = getShowDictList.getShowDictList(dataObj.getCirculatOrder().getIssueSituation(), "is_or_not", false); |
| | | dataObj.getCirculatOrder().setIssueSituationStr(issueSituationStr); |
| | | |
| | | for (ItemCirculatOrderTechnical technical : dataObj.getTechnicalList()) { |
| | | String value = technical.getSecretClass(); |
| | | String secretClassStr = getShowDictList.getShowDictList(value, "secret_class", false); |
| | | technical.setSecretClass(secretClassStr); |
| | | } |
| | | |
| | | |
| | | WordFile wordFile = new WordFile(); |
| | | wordFile.setModulePath("物品流转单.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_物品流转单.docx"); |
| | | wordFileService.exportWordFile(request, dataObj, wordFile, response); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |