Пример #1
0
 def get_sys_vars(self, kind=0):
     if self.autoid != 0:
         try:
             if kind == 0:
                 pm = ProductController()
                 vlist = ('prodid', 'prodname', 'commonname', 'batchno',
                          'spec', 'package', 'medkind', 'planamount',
                          'mpunit', 'plantime', 'realamount', 'makedate',
                          'linename', 'workshopid', 'workshopname')
                 self.proddetail = pm.get_producingplan(
                     *vlist, autoid=self.autoid)[0]
             elif kind == 1:
                 sm = StuffController()
                 self.stuffdetail = sm.get_prodstuff(ppid=self.autoid)
                 for item in self.stuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailZC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailFC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailNB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailWB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailQC.append(item)
             elif kind == 2:
                 sm = StuffController()
                 self.mstuffdetail = sm.get_Mprodstuff(self.autoid)
                 for item in self.mstuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailMZC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailMFC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailMNB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailMWB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailMQC.append(item)
             elif kind == 3:
                 lm = LabrecordsController()
                 self.labdetail = lm.get_labrecord(self.autoid)[0]
         except:
             # traceback.print_exc()
             SaveExcept("获取系统变量出错", self.get_content(), kind)
Пример #2
0
 def get_sys_vars(self, kind=0):
     if self.autoid != 0:
         try:
             if kind == 0:
                 pm = ProductController()
                 self.proddetail = pm.get_producingplan(
                     autoid=self.autoid)[0]
             elif kind == 1:
                 sm = StuffController()
                 self.stuffdetail = sm.get_prodstuff(self.autoid)
                 for item in self.stuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailZC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailFC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailNB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailWB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailQC.append(item)
             elif kind == 2:
                 sm = StuffController()
                 self.mstuffdetail = sm.get_Mprodstuff(self.autoid)
                 for item in self.mstuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailMZC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailMFC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailMNB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailMWB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailMQC.append(item)
             elif kind == 3:
                 lm = LabrecordsController()
                 self.labdetail = lm.get_labrecord(1, autoid=self.autoid)[0]
         except:
             # traceback.print_exc()
             pass