| | |
| | | package com.zt.life.modules.configItemWarehouse.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.CommonUtils; |
| | | 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.modules.oss.service.SysOssService; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import com.zt.modules.workflow.service.WorkflowService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | |
| | | for (WarehouseConfigItem configItem : configItemDto.getConfigItemList()) { |
| | | configItem.setWarehouseId(warehouseId); |
| | | if (configItem.getId() != null) { |
| | | if (configItem.getCheckId()!=null){ |
| | | String code ="719CTC-09-ST"; |
| | | String projectCode = configItemDto.getProject().getCode(); |
| | | if (configItem.getItemName().equals("软件测试计划")){ |
| | | code=code+"P"; |
| | | }else if (configItem.getItemName().equals("软件测试说明")){ |
| | | code=code+"D"; |
| | | }else if (configItem.getItemName().equals("软件测试记录")){ |
| | | code=code+"H"; |
| | | }else if (configItem.getItemName().equals("软件测试报告")){ |
| | | code=code+"R"; |
| | | } |
| | | configItem.setItemIdentify(code+"-"+projectCode); |
| | | WarehouseConfigItem configItem2 = configItemService.get(configItem.getId()); |
| | | if (CommonUtils.isActureChangeData(configItem,configItem2)) { |
| | | configItemService.update(configItem); |
| | | } |
| | | 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.setWarehouseId(warehouseId); |
| | | configItem.setProjectId(configItemDto.getConfigItemWarehouse().getProjectId()); |
| | | configItemService.insert(configItem); |
| | |
| | | if (testCheckOrder.getConfigItemId() == null) { |
| | | Long configItemId = configItem.getId(); |
| | | testCheckOrder.setConfigItemId(configItemId); |
| | | testCheckOrder.setConfigOrderId(warehouseId); |
| | | testCheckOrderService.update(testCheckOrder); |
| | | } |
| | | } |