| | |
| | | package com.zt.life.modules.configItemChange.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.configItemChange.dao.ConfigItemChangeDao; |
| | | import com.zt.life.modules.configItemChange.dto.ConfigItemChangeDto; |
| | | import com.zt.life.modules.configItemChange.model.ConfigItemChange; |
| | | import com.zt.life.modules.configItemWarehouse.dto.ConfigItemWarehouseDto; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseQaAudit; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseCmAuditService; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseConfigItemService; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseQaAuditService; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrder; |
| | | import com.zt.life.modules.testCheckOrder.service.TestCheckOrderService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | public List<ConfigItemChange> page(QueryFilter queryFilter) { |
| | | List<ConfigItemChange> list= baseDao.getList(queryFilter.getQueryParams()); |
| | | workflowService.getRunFlow(list,"pzxbg"); |
| | | List<ConfigItemChange> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | workflowService.getRunFlow(list, "pzxbg"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | |
| | | configItemDto.getConfigItemChange().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(configItemDto.getConfigItemChange()); |
| | | changeId = configItemDto.getConfigItemChange().getId(); |
| | | |
| | | } |
| | | |
| | | for (WarehouseConfigItem configItem : configItemDto.getConfigChangeList()) { |
| | |
| | | return data; |
| | | } |
| | | |
| | | public void exportConfigChange(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ConfigItemChangeDto dataObj = this.getDto(null, id); |
| | | |
| | | String qaAuditorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getQaAuditorId())); |
| | | dataObj.getConfigItemChange().setQaAuditor(qaAuditorPath); |
| | | String cmAuditorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getCmAuditorId())); |
| | | dataObj.getConfigItemChange().setCmAuditor(cmAuditorPath); |
| | | String implementerPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getImplementerId())); |
| | | dataObj.getConfigItemChange().setImplementer(implementerPath); |
| | | String approvalSignPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getApprovalId())); |
| | | dataObj.getConfigItemChange().setApprovalSign(approvalSignPath); |
| | | String warehouseOperatorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getWarehouseOperatorId())); |
| | | dataObj.getConfigItemChange().setWarehouseOperator(warehouseOperatorPath); |
| | | /*String outboundOperatorPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getConfigItemChange().getOutboundOperatorId())); |
| | | dataObj.getConfigItemChange().setOutboundOperator(outboundOperatorPath);*/ |
| | | //通用字典列表字符串生成 |
| | | String libraryTypeStr = getShowDictList.getShowDictList(dataObj.getConfigItemChange().getLibraryType(), "library_type", false); |
| | | dataObj.getConfigItemChange().setLibraryType(libraryTypeStr); |
| | | |
| | | String QaAuditResultStr = getShowDictList.getShowDictList(dataObj.getConfigItemChange().getQaAuditResults(), "is_pass", false); |
| | | dataObj.getConfigItemChange().setQaAuditResults(QaAuditResultStr); |
| | | |
| | | String CmAuditResultStr = getShowDictList.getShowDictList(dataObj.getConfigItemChange().getCmAuditResults(), "is_pass", false); |
| | | dataObj.getConfigItemChange().setCmAuditResults(CmAuditResultStr); |
| | | |
| | | String ApprovalOpinionStr = getShowDictList.getShowDictList(dataObj.getConfigItemChange().getApprovalOpinions(), "is_agree", false); |
| | | dataObj.getConfigItemChange().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.getConfigChangeList()) { |
| | | 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(); |
| | | } |
| | | } |
| | | } |