whyclxw
4 天以前 10c3d3300cce0ccef45b9db8865b61999385158b
src/main/java/com/whyc/service/TechnicalSpecificationService.java
@@ -166,6 +166,7 @@
        specification.setFileUrl(specificationHttpUrl+File.separator+file1Name);
        specification.setExcelUrl(specificationHttpUrl+File.separator+file2Name);
        specification.setCreateTime(date);
        specification.setUploadUser(ActionUtil.getUser().getName());
        //锁定-负责人才能解锁
        specification.setLockFlag(1);
        mapper.insert(specification);
@@ -301,10 +302,10 @@
            for (TechnicalSpecification t:list) {
                TechnicalSpecification enableTe=getEnableVersion(t);
                if(enableTe!=null){
                   if(enableTe.getOwner()!=t.getOwner()){
                       t.setFlag(0);
                   }else{
                   if(enableTe.getOwner().equals(t.getOwner())){
                       t.setFlag(1);
                   }else{
                       t.setFlag(0);
                   }
                }else {
                    t.setFlag(1);
@@ -320,7 +321,7 @@
        wrapper.eq("apply_material_code",t.getApplyMaterialCode());
        wrapper.eq("apply_model",t.getApplyModel());
        wrapper.eq("apply_custom_code",t.getApplyCustomCode());
        wrapper.last("limit1");
        wrapper.last("limit 1");
        TechnicalSpecification enableTe=mapper.selectOne(wrapper);
        return enableTe;
    }
@@ -338,6 +339,21 @@
            query.eq("apply_custom_code",applyCustomCode);
        }
        List<TechnicalSpecification> list=mapper.selectList(query);
        //标识每条记录适用机型可用的版本的负责人是不是这条记录的负责人
        if(list!=null&&list.size()>0){
            for (TechnicalSpecification t:list) {
                TechnicalSpecification enableTe=getEnableVersion(t);
                if(enableTe!=null){
                    if(enableTe.getOwner().equals(t.getOwner())){
                        t.setFlag(1);
                    }else{
                        t.setFlag(0);
                    }
                }else {
                    t.setFlag(1);
                }
            }
        }
        return new Response().setII(1,list!=null,list,"查询指定技术规格书的所有版本");
    }
}