| | |
| | | package com.zt.life.modules.configItemWarehouse.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.CommonUtils; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.configItemWarehouse.dao.ConfigItemWarehouseDao; |
| | | import com.zt.life.modules.configItemWarehouse.dto.ConfigItemWarehouseDto; |
| | | import com.zt.life.modules.configItemWarehouse.model.ConfigItemWarehouse; |
| | |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrder; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrderTechnical; |
| | | import com.zt.life.modules.itemCirculatOrder.service.ItemCirculatOrderTechnicalService; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderDeliverable; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderMeasured; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private TestCheckOrderService testCheckOrderService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | */ |
| | | public List<ConfigItemWarehouse> page(QueryFilter queryFilter) { |
| | | List<ConfigItemWarehouse> list= baseDao.getList(queryFilter.getQueryParams()); |
| | | workflowService.getRunFlow(list,"pzxrk"); |
| | | if (list.size() > 0) { |
| | | workflowService.getRunFlow(list, "pzxrk"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | if (CommonUtils.isActureChangeData(configItem,configItem2)) { |
| | | configItemService.update(configItem); |
| | | } |
| | | if(CommonUtils.isActureChangeData(configItemDto.getConfigItemWarehouse().getLibraryType(),configItem.getLibraryType())){ |
| | | configItem.setLibraryType(configItemDto.getConfigItemWarehouse().getLibraryType()); |
| | | configItemService.update(configItem); |
| | | } |
| | | } else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | String pageCode = configItem.getPageCode(); |
| | | if (StringUtils.isNotBlank(pageCode) && "plan,explain,record,report".contains(pageCode)) { |
| | | map.put("funCode", "test_" + pageCode); |
| | | //map.put("projectId",configItemDto.getProjectId().toString()); |
| | | configItem.setItemIdentify(sysCodeRuleService.getNewCode(map)); |
| | | } |
| | | configItem.setLibraryType(configItemDto.getConfigItemWarehouse().getLibraryType()); |
| | | configItem.setWarehouseId(warehouseId); |
| | | configItem.setProjectId(configItemDto.getConfigItemWarehouse().getProjectId()); |
| | | configItemService.insert(configItem); |
| | |
| | | return data; |
| | | } |
| | | |
| | | public void exportWarehouseOrder(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ConfigItemWarehouseDto dataObj = this.getDto(null, id); |
| | | |
| | | String qaAuditorPath = "文件图片:"+ getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemWarehouse().getQaAuditorId())); |
| | | dataObj.getConfigItemWarehouse().setQaAuditor(qaAuditorPath); |
| | | String cmAuditorPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemWarehouse().getCmAuditorId())); |
| | | dataObj.getConfigItemWarehouse().setCmAuditor(cmAuditorPath); |
| | | String approvalSignPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemWarehouse().getApprovalId())); |
| | | dataObj.getConfigItemWarehouse().setApprovalSign(approvalSignPath); |
| | | String operatorPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemWarehouse().getOperatorId())); |
| | | dataObj.getConfigItemWarehouse().setOperator(operatorPath); |
| | | //通用字典列表字符串生成 |
| | | String libraryTypeStr = getShowDictList.getShowDictList(dataObj.getConfigItemWarehouse().getLibraryType(), "library_type", false); |
| | | dataObj.getConfigItemWarehouse().setLibraryType(libraryTypeStr); |
| | | |
| | | String QaAuditResultStr = getShowDictList.getShowDictList(dataObj.getConfigItemWarehouse().getQaAuditResults(), "is_pass", false); |
| | | dataObj.getConfigItemWarehouse().setQaAuditResults(QaAuditResultStr); |
| | | |
| | | String CmAuditResultStr = getShowDictList.getShowDictList(dataObj.getConfigItemWarehouse().getCmAuditResults(), "is_pass", false); |
| | | dataObj.getConfigItemWarehouse().setCmAuditResults(CmAuditResultStr); |
| | | |
| | | String ApprovalOpinionStr = getShowDictList.getShowDictList(dataObj.getConfigItemWarehouse().getApprovalOpinions(), "is_agree", false); |
| | | dataObj.getConfigItemWarehouse().setApprovalOpinions(ApprovalOpinionStr); |
| | | |
| | | for (WarehouseCmAudit cmAuditList : dataObj.getCmAuditList()) { |
| | | String value = cmAuditList.getExamineResult(); |
| | | String ExamineResultStr = getShowDictList.getShowDictList(value, "tristate2", false); |
| | | cmAuditList.setExamineResult(ExamineResultStr); |
| | | } |
| | | for (WarehouseQaAudit qaAuditList : dataObj.getQaAuditList()) { |
| | | String value = qaAuditList.getExamineResult(); |
| | | String ExamineResultStr = getShowDictList.getShowDictList(value, "tristate2", false); |
| | | qaAuditList.setExamineResult(ExamineResultStr); |
| | | } |
| | | for (WarehouseConfigItem configItemList : dataObj.getConfigItemList()) { |
| | | String value = configItemList.getSecretClass(); |
| | | String secretClassStr = getShowDictList.getShowDictList(value, "secret_class", false); |
| | | configItemList.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(); |
| | | } |
| | | } |
| | | } |