jinlin
2023-12-08 02b942d804cfa1ea094256b914a08083288695ed
modules/mainPart/src/main/java/com/zt/life/modules/configItemWarehouse/service/ConfigItemWarehouseService.java
@@ -15,6 +15,8 @@
import com.zt.life.modules.project.model.SoftwareTestOrderMeasured;
import com.zt.life.modules.project.service.ProjectService;
import com.zt.life.modules.sysBaseInfo.service.TestAgencyInfoService;
import com.zt.life.modules.testCheckOrder.model.TestCheckOrder;
import com.zt.life.modules.testCheckOrder.service.TestCheckOrderService;
import com.zt.life.sys.service.SysOssConfigService;
import com.zt.modules.coderule.service.SysCodeRuleService;
import com.zt.modules.oss.service.SysOssService;
@@ -23,6 +25,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zt.common.db.query.QueryFilter;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
@@ -32,11 +35,11 @@
/**
 * config_item_warehouse
 *
 * @author zt generator
 * @author zt generator
 * @since 1.0.0 2023-11-27
 */
@Service
public class ConfigItemWarehouseService  extends BaseService<ConfigItemWarehouseDao, ConfigItemWarehouse> {
public class ConfigItemWarehouseService extends BaseService<ConfigItemWarehouseDao, ConfigItemWarehouse> {
    @Autowired
    private SysOssConfigService sysOssConfigService;
@@ -60,6 +63,9 @@
    @Autowired
    private WarehouseConfigItemService configItemService;
    @Autowired
    private TestCheckOrderService testCheckOrderService;
    /**
     * 分页查询
@@ -87,7 +93,7 @@
        else {
            Map<String, String> map = new HashMap<>();
            map.put("funCode", "config_item_warehouse");
            map.put("projectId",configItemDto.getProjectId().toString());
            map.put("projectId", configItemDto.getProjectId().toString());
            configItemDto.getConfigItemWarehouse().setProjectId(configItemDto.getProjectId());
            configItemDto.getConfigItemWarehouse().setCode(sysCodeRuleService.getNewCode(map));
            baseDao.insert(configItemDto.getConfigItemWarehouse());
@@ -97,10 +103,34 @@
        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);
                }
                configItemService.update(configItem);
            } else {
                configItem.setWarehouseId(warehouseId);
                configItem.setProjectId(configItemDto.getConfigItemWarehouse().getProjectId());
                configItemService.insert(configItem);
            }
            Long checkId = configItem.getCheckId();
            if (checkId != null) {
                TestCheckOrder testCheckOrder = testCheckOrderService.get(checkId);
                if (testCheckOrder.getConfigItemId() == null) {
                    Long configItemId = configItem.getId();
                    testCheckOrder.setConfigItemId(configItemId);
                    testCheckOrderService.update(testCheckOrder);
                }
            }
            sysOssConfigService.updateOss(configItem.getId(), configItem.getFiles());// 保存附件
        }
@@ -128,7 +158,7 @@
        Long bizId = configItemDto.getConfigItemWarehouse().getId();
        FlowInfoDto flowInfoDto = configItemDto.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);
            }
@@ -144,7 +174,7 @@
            ConfigItemWarehouse configItemWarehouse = this.get(warehouseId);
            data.setConfigItemWarehouse(configItemWarehouse);
            if (projectId==null) {
            if (projectId == null) {
                projectId = configItemWarehouse.getProjectId();
            }
            List<WarehouseCmAudit> CmAuditList = cmAuditService.getList(warehouseId);
@@ -155,7 +185,7 @@
            data.setConfigItemList(ConfigItemList);
        } else {
            ConfigItemWarehouse configItemWarehouse =new ConfigItemWarehouse();
            ConfigItemWarehouse configItemWarehouse = new ConfigItemWarehouse();
            data.setConfigItemWarehouse(configItemWarehouse);
            List<?> cmList = baseDao.itemList("warehouse_cm_audit");
            List<?> CmAuditList = cmList;