Exemplo n.º 1
0
 def showConfig(self, project=""):
     if project == "":
         project = Project("")
     self.modifyManagerText.setText(
         project.ServiceProcess.Config.modifyManager)
     self.configManagerText.setText(
         project.ServiceProcess.Config.configManager)
     self.releaseManagerText.setText(
         project.ServiceProcess.Config.releaseManager)
     self.relatedManagerText.setText(
         project.ServiceProcess.Config.relatedManager)
     self.configVersionText.setText(
         project.ServiceProcess.Config.configVersion)
     self.configReleaseDateText.setText(
         project.ServiceProcess.Config.configReleaseDate)
     self.changesText.setText(str(project.ServiceProcess.Config.changes))
     self.releasesText.setText(str(project.ServiceProcess.Config.releases))
     self.ConfigReleaseDateText.setText(
         project.ServiceProcess.Config.releaseDate)
     self.ConfigPreReleaseDateText.setText(
         project.ServiceProcess.Config.preReleaseDate)
     self.applicationDateText.setText(
         project.ServiceProcess.Config.applicationDate)
     self.SNText.setText(project.ServiceProcess.Config.SN)
     self.targetText.setText(project.ServiceProcess.Config.target)
     self.itemText.setText(project.ServiceProcess.Config.item)
     self.releaseVersionText.setText(
         project.ServiceProcess.Config.releaseVersion)
     self.subjectText.setText(project.ServiceProcess.Config.subject)
Exemplo n.º 2
0
 def showTeam(self, project=""):
     if project == "":
         project = Project("")
     self.startTimeText.setText(project.BasicInfo.Team.startTime)
     self.requireText.setText(project.BasicInfo.Team.require)
     self.PMText.setText(project.BasicInfo.Team.PM)
     self.TMText.setText(project.BasicInfo.Team.TM)
Exemplo n.º 3
0
 def showA(self, project=""):
     if project == "":
         project = Project("")
     self.AprojectNameText.setText(project.BasicInfo.PartyA.projectName)
     self.AcompanyText.setText(project.BasicInfo.PartyA.company)
     self.AnameText.setText(project.BasicInfo.PartyA.name)
     self.AphoneText.setText(project.BasicInfo.PartyA.phone)
     self.AaddressText.setText(project.BasicInfo.PartyA.address)
Exemplo n.º 4
0
 def showB(self, project=""):
     if project == "":
         project = Project("")
     self.BcontactNameText.setText(project.BasicInfo.PartyB.contactName)
     self.BserviceNameText.setText(project.BasicInfo.PartyB.serviceName)
     self.BserviceMailText.setText(project.BasicInfo.PartyB.serviceMail)
     self.BservicePhoneText.setText(project.BasicInfo.PartyB.servicePhone)
     self.BcomplainNameText.setText(project.BasicInfo.PartyB.complainName)
     self.BcomplainMailText.setText(project.BasicInfo.PartyB.complainMail)
     self.BcomplainPhoneText.setText(project.BasicInfo.PartyB.complainPhone)
Exemplo n.º 5
0
 def showProjectEvent(self, project=""):
     if project == "":
         project = Project("")
     self.eventManagerText.setText(
         project.ServiceProcess.Event.eventManager)
     self.issueManagerText.setText(
         project.ServiceProcess.Event.issueManager)
     self.S1acceptedText.setValue(project.ServiceProcess.Event.S1)
     self.S2acceptedText.setValue(project.ServiceProcess.Event.S2)
     self.S3acceptedText.setValue(project.ServiceProcess.Event.S3)
     self.S4acceptedText.setValue(project.ServiceProcess.Event.S4)
     self.closedText.setValue(project.ServiceProcess.Event.closed)
     self.transformedText.setValue(project.ServiceProcess.Event.transformed)
     self.summarizedText.setValue(project.ServiceProcess.Event.summarized)
Exemplo n.º 6
0
 def showDetail(self, project=""):
     if project == "":
         project = Project("")
     self.amountText.setText(project.BasicInfo.Detail.amount)
     self.periodText.setText(project.BasicInfo.Detail.period)
     self.configText.setPlainText("\n".join(
         project.BasicInfo.Detail.config))
     self.detailNameText.setText(project.BasicInfo.Detail.name)
     self.detailLevelText.setText(project.BasicInfo.Detail.level)
     self.detailsText.setPlainText("\n".join(
         project.BasicInfo.Detail.details))
     self.demandText.setPlainText("\n".join(
         project.BasicInfo.Detail.demand))
     self.ddlText.setText(project.BasicInfo.Detail.ddl)
Exemplo n.º 7
0
 def showContinuity(self, project=""):
     if project == "":
         project = Project("")
     self.processText.setPlainText("\n".join(
         project.ServiceProcess.Continuity.process))
     self.resultText.setPlainText("\n".join(
         project.ServiceProcess.Continuity.result))
     self.ContinuityDateText.setText(project.ServiceProcess.Continuity.date)
     self.technicistText.setText(
         project.ServiceProcess.Continuity.technicist)
     self.ContinuityApproverText.setText(
         project.ServiceProcess.Continuity.approver)
     self.ContinuityCompileDateText.setText(
         project.ServiceProcess.Continuity.compileDate)
     self.ContinuityAuditDateText.setText(
         project.ServiceProcess.Continuity.auditDate)
Exemplo n.º 8
0
 def addProject(self, projectName="项目名称"):
     self.projectList.addItem(projectName)
     new = Project(projectName)
     self.user.projects.append(new)
     self.projectList.setCurrentItem(
         self.projectList.item(self.projectList.count() - 1))
Exemplo n.º 9
0
 def showReport(self, project=""):
     if project == "":
         project = Project("")
     self.reportTimeText.setText(project.ServiceProcess.Report.time)
     self.keypointText.setText(project.ServiceProcess.Report.keypoint)
     self.revisitText.setText(project.ServiceProcess.Report.revisit)
Exemplo n.º 10
0
    def searchById(self, id):
        id = id.replace("\\", '\\\\').replace("'", "\\'").replace('"', '\\"')
        ptr = self.db.cursor()
        sql0 = """
               SELECT *
               FROM info
               WHERE company = '%s';
               """ % (id)
        sql1 = """
               SELECT name, leader, operator, level, intro, func
               FROM department
               WHERE refId = '%s'
               ORDER BY seq;
               """ % (id)
        sql2 = """
               SELECT logopath
               FROM logoStore
               WHERE refId = '%s';
               """ % (id)
        sql3 = """
               SELECT projectInfo.*, serviceProcess.*
               FROM projectInfo left join serviceProcess on (projectInfo.AprojectName = serviceProcess.refAprojectName 
               and projectInfo.refId = serviceProcess.refId)
               WHERE projectInfo.refId = '%s'
               ORDER BY projectInfo.seq;
               """ % (id)
        sql4 = """
               SELECT *
               FROM organization
               WHERE organization.refId = '%s';
               """ % (id)

        info = userInfo()
        try:
            ptr.execute(sql0)
            results = ptr.fetchall()
            for row in results:
                info.fileName = row[0]
                info.company = row[1]
                info.address = row[2]
                info.introduction = row[3].split("#")
                info.coverField = row[4]
                info.corporateRepresentative = row[5]
                info.manager = row[6]
                info.guandai = row[7]
                info.compiler = row[8]
                info.approver = row[9]
                info.audit = row[10]
                info.announcer = row[11]
                info.releaseDate = row[12]
                info.auditDate = row[13]
                info.zip = row[14]
                info.phone = row[15]
                info.policy = row[16]
                info.picPath = row[17]
                info.depStruct = row[18]
                info.color = row[19]
        except Exception as e:
            print("Search Info Error:", e)
            self.dbException = str(e)
        try:
            ptr.execute(sql1)
            results = ptr.fetchall()
            info.departments = []
            for row in results:
                dep = {}
                dep["name"] = row[0]
                dep["leader"] = row[1]
                dep["operator"] = row[2]
                dep["level"] = int(row[3])
                dep["intro"] = row[4].split("#")
                dep["func"] = self.formatFunc(
                    list(filter(lambda x: x != '', row[5].split("#"))), "int")
                dep["func"].sort()
                info.departments.append(dep)
        except Exception as e:
            print("Search Department Error:", e)
            self.dbException = str(e)
        try:
            ptr.execute(sql2)
            results = ptr.fetchall()
            for row in results:
                info.logoPath = row[0]
        except Exception as e:
            print("Search Logo Error:", e)
            self.dbException = str(e)

        try:
            ptr.execute(sql3)
            results = ptr.fetchall()
            for row in results:
                project = Project()
                firstIndex = 1
                try:
                    project.BasicInfo.PartyA.projectName = row[firstIndex + 0]
                    project.BasicInfo.PartyA.company = row[firstIndex + 1]
                    project.BasicInfo.PartyA.name = row[firstIndex + 2]
                    project.BasicInfo.PartyA.phone = row[firstIndex + 3]
                    project.BasicInfo.PartyA.address = row[firstIndex + 4]
                    project.BasicInfo.PartyB.contactName = row[firstIndex + 5]
                    project.BasicInfo.PartyB.serviceName = row[firstIndex + 6]
                    project.BasicInfo.PartyB.serviceMail = row[firstIndex + 7]
                    project.BasicInfo.PartyB.servicePhone = row[firstIndex + 8]
                    project.BasicInfo.PartyB.complainName = row[firstIndex + 9]
                    project.BasicInfo.PartyB.complainMail = row[firstIndex +
                                                                10]
                    project.BasicInfo.PartyB.complainPhone = row[firstIndex +
                                                                 11]
                    project.BasicInfo.Detail.amount = row[firstIndex + 12]
                    project.BasicInfo.Detail.period = row[firstIndex + 13]
                    project.BasicInfo.Detail.config = row[firstIndex +
                                                          14].split("#")
                    project.BasicInfo.Detail.name = row[firstIndex + 15]
                    project.BasicInfo.Detail.level = row[firstIndex + 16]
                    project.BasicInfo.Detail.details = row[firstIndex +
                                                           17].split("#")
                    project.BasicInfo.Detail.demand = row[firstIndex +
                                                          18].split("#")
                    project.BasicInfo.Detail.ddl = row[firstIndex + 19]
                    project.BasicInfo.Team.startTime = row[firstIndex + 20]
                    project.BasicInfo.Team.require = row[firstIndex + 21]
                    project.BasicInfo.Team.PM = row[firstIndex + 22]
                    project.BasicInfo.Team.TM = row[firstIndex + 23]
                    # 24,25,26跳过
                    project.ServiceProcess.Report.time = row[firstIndex + 27]
                    project.ServiceProcess.Report.keypoint = row[firstIndex +
                                                                 28]
                    project.ServiceProcess.Report.revisit = row[firstIndex +
                                                                29]
                    project.ServiceProcess.Event.eventManager = row[firstIndex
                                                                    + 30]
                    project.ServiceProcess.Event.issueManager = row[firstIndex
                                                                    + 31]
                    project.ServiceProcess.Event.S1 = row[firstIndex + 32]
                    project.ServiceProcess.Event.S2 = row[firstIndex + 33]
                    project.ServiceProcess.Event.S3 = row[firstIndex + 34]
                    project.ServiceProcess.Event.S4 = row[firstIndex + 35]
                    project.ServiceProcess.Event.closed = row[firstIndex + 36]
                    project.ServiceProcess.Event.transformed = row[firstIndex +
                                                                   37]
                    project.ServiceProcess.Event.summarized = row[firstIndex +
                                                                  38]
                    project.ServiceProcess.Config.modifyManager = row[
                        firstIndex + 39]
                    project.ServiceProcess.Config.configManager = row[
                        firstIndex + 40]
                    project.ServiceProcess.Config.releaseManager = row[
                        firstIndex + 41]
                    project.ServiceProcess.Config.relatedManager = row[
                        firstIndex + 42]
                    project.ServiceProcess.Config.configVersion = row[
                        firstIndex + 43]
                    project.ServiceProcess.Config.configReleaseDate = row[
                        firstIndex + 44]
                    project.ServiceProcess.Config.changes = row[firstIndex +
                                                                45]
                    project.ServiceProcess.Config.releases = row[firstIndex +
                                                                 46]
                    project.ServiceProcess.Config.releaseDate = row[firstIndex
                                                                    + 47]
                    project.ServiceProcess.Config.preReleaseDate = row[
                        firstIndex + 48]
                    project.ServiceProcess.Config.applicationDate = row[
                        firstIndex + 49]
                    project.ServiceProcess.Config.SN = row[firstIndex + 50]
                    project.ServiceProcess.Config.target = row[firstIndex + 51]
                    project.ServiceProcess.Config.item = row[firstIndex + 52]
                    project.ServiceProcess.Config.releaseVersion = row[
                        firstIndex + 53]
                    project.ServiceProcess.Config.subject = row[firstIndex +
                                                                54]
                    project.ServiceProcess.Continuity.process = row[
                        firstIndex + 55].split("#")
                    project.ServiceProcess.Continuity.result = row[
                        firstIndex + 56].split("#")
                    project.ServiceProcess.Continuity.date = row[firstIndex +
                                                                 57]
                    project.ServiceProcess.Continuity.technicist = row[
                        firstIndex + 58]
                    project.ServiceProcess.Continuity.approver = row[firstIndex
                                                                     + 59]
                    project.ServiceProcess.Continuity.compileDate = row[
                        firstIndex + 60]
                    project.ServiceProcess.Continuity.auditDate = row[
                        firstIndex + 61]
                except Exception as e:
                    print("Get Project Error:", e)
                    continue
                info.projects.append(project)
        except Exception as e1:
            print("Search Project Error:", e1)
            self.dbException = str(e1)

        try:
            ptr.execute(sql4)
            results = ptr.fetchall()
            organization = Organization()
            firstIndex = 1
            for row in results:
                organization.Audit.planDate = row[firstIndex + 0]
                organization.Audit.auditDate = row[firstIndex + 1]
                organization.Audit.auditLeader = row[firstIndex + 2]
                organization.Audit.audit1 = row[firstIndex + 3]
                organization.Audit.audit2 = row[firstIndex + 4]
                organization.Audit.audit3 = row[firstIndex + 5]
                organization.Audit.reviewDate = row[firstIndex + 6]
                organization.Audit.scheduleDate = row[firstIndex + 7]
                organization.Audit.excuteDate = row[firstIndex + 8]
                organization.Audit.reportDate = row[firstIndex + 9]
                organization.Audit.compiler = row[firstIndex + 10]
                organization.Audit.audit = row[firstIndex + 11]
                organization.Audit.compileDate = row[firstIndex + 12]
                organization.Audit.approveDate = row[firstIndex + 13]
                organization.Record.target = row[firstIndex + 14]
                organization.Record.time = row[firstIndex + 15]
                organization.Record.staff = row[firstIndex + 16]
                organization.Record.arrange = row[firstIndex + 17].split("#")
                organization.Record.content = row[firstIndex + 18].split("#")
                organization.Record.fileName = row[firstIndex + 19]
                organization.Record.auditContent = row[firstIndex +
                                                       20].split("#")
                organization.Record.auditProcess = row[firstIndex +
                                                       21].split("#")
                organization.Record.audit = row[firstIndex + 22]
                organization.Record.auditDate = row[firstIndex + 23]
                organization.Record.approver = row[firstIndex + 24]
                organization.Record.approveDate = row[firstIndex + 25]
                organization.Record.provider = row[firstIndex + 26]
            info.organization = organization
        except Exception as e:
            print("Search Organization Error:", e)
            self.dbException = str(e)
        # 测试语句
        # with open("projectOutTest.json", "w") as f:
        #     json.dump(info.projects[0].Info, f, indent=4)
        return info