Exemplo n.º 1
0
 def next(self, action):
     if action == constants.work_command.ACT_RETRIVE_QI:
         return state_quality_inspecting
     else:
         raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                               {"action": action_name(action),
                                "status": status_name(self.status)}))
Exemplo n.º 2
0
 def next(self, action):
     if action == constants.work_command.ACT_DISPATCH:
         return state_assigning
     else:
         raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                               {"action": action_name(action),
                                "status": status_name(self.status)}))
Exemplo n.º 3
0
 def next(self, action):
     if action == constants.work_command.ACT_DISPATCH:
         return state_assigning
     else:
         raise InvalidAction(
             _(
                 u"%(status)s状态不允许进行%(action)s操作" % {
                     "action": action_name(action),
                     "status": status_name(self.status)
                 }))
Exemplo n.º 4
0
 def next(self, action):
     if action == constants.work_command.ACT_RETRIVE_QI:
         return state_quality_inspecting
     else:
         raise InvalidAction(
             _(
                 u"%(status)s状态不允许进行%(action)s操作" % {
                     "action": action_name(action),
                     "status": status_name(self.status)
                 }))
Exemplo n.º 5
0
 def next(self, action):
     if action == constants.work_command.ACT_AFFIRM_RETRIEVAL:
         return state_dispatching
     elif action == constants.work_command.ACT_REFUSE_RETRIEVAL:
         # TODO should inform scheduler
         return state_ending
     else:
         raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                               {"action": action_name(action),
                                "status": status_name(self.status)}))
Exemplo n.º 6
0
 def side_effect(self, **kwargs):
     self.sm.obj.set_status(constants.work_command.STATUS_ASSIGNING)
     if kwargs.get("department"):
         self.sm.obj.department = kwargs["department"]
     self.sm.obj.tech_req = kwargs["tech_req"]
     if kwargs.get("procedure_id"):
         self.sm.obj.procedure_id = kwargs.get("procedure_id")
     self.sm.obj.team = None
     if not self.sm.obj.department:
         raise InvalidStatus(_(u"%(status)s状态必须有department字段") % {
             "status": status_name(self.status)})
Exemplo n.º 7
0
 def next(self, action):
     if action == constants.work_command.ACT_ASSIGN:
         return state_ending
     elif action == constants.work_command.ACT_REFUSE:
         return state_refused
     elif action == constants.work_command.ACT_RETRIEVAL:
         return state_dispatching
     else:
         raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                               {"action": action_name(action),
                                "status": status_name(self.status)}))
Exemplo n.º 8
0
 def side_effect(self, **kwargs):
     self.sm.obj.set_status(constants.work_command.STATUS_ASSIGNING)
     if kwargs.get("department"):
         self.sm.obj.department = kwargs["department"]
     self.sm.obj.tech_req = kwargs["tech_req"]
     if kwargs.get("procedure_id"):
         self.sm.obj.procedure_id = kwargs.get("procedure_id")
     self.sm.obj.team = None
     if not self.sm.obj.department:
         raise InvalidStatus(
             _(u"%(status)s状态必须有department字段") %
             {"status": status_name(self.status)})
Exemplo n.º 9
0
 def next(self, action):
     if action == constants.work_command.ACT_AFFIRM_RETRIEVAL:
         return state_dispatching
     elif action == constants.work_command.ACT_REFUSE_RETRIEVAL:
         # TODO should inform scheduler
         return state_ending
     else:
         raise InvalidAction(
             _(
                 u"%(status)s状态不允许进行%(action)s操作" % {
                     "action": action_name(action),
                     "status": status_name(self.status)
                 }))
Exemplo n.º 10
0
 def next(self, action):
     if action == constants.work_command.ACT_ASSIGN:
         return state_ending
     elif action == constants.work_command.ACT_REFUSE:
         return state_refused
     elif action == constants.work_command.ACT_RETRIEVAL:
         return state_dispatching
     else:
         raise InvalidAction(
             _(
                 u"%(status)s状态不允许进行%(action)s操作" % {
                     "action": action_name(action),
                     "status": status_name(self.status)
                 }))
Exemplo n.º 11
0
 def next(self, action):
     if action == constants.work_command.ACT_ADD_WEIGHT:
         return self
     elif action == constants.work_command.ACT_RETRIEVAL:
         return state_locked
     elif action == constants.work_command.ACT_END:
         return state_quality_inspecting
     elif action == constants.work_command.ACT_CARRY_FORWARD:
         if self.sm.obj.processed_cnt == 0:  # carry forward COMPLETELY
             return state_assigning
         else:
             return state_quality_inspecting
     elif action == constants.work_command.ACT_QUICK_CARRY_FORWARD:
         return state_ending
     else:
         raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                               {"action": action_name(action),
                                "status": status_name(self.status)}))
Exemplo n.º 12
0
 def next(self, action):
     if action == constants.work_command.ACT_ADD_WEIGHT:
         return self
     elif action == constants.work_command.ACT_RETRIEVAL:
         return state_locked
     elif action == constants.work_command.ACT_END:
         return state_quality_inspecting
     elif action == constants.work_command.ACT_CARRY_FORWARD:
         if self.sm.obj.processed_cnt == 0:  # carry forward COMPLETELY
             return state_assigning
         else:
             return state_quality_inspecting
     elif action == constants.work_command.ACT_QUICK_CARRY_FORWARD:
         return state_ending
     else:
         raise InvalidAction(
             _(
                 u"%(status)s状态不允许进行%(action)s操作" % {
                     "action": action_name(action),
                     "status": status_name(self.status)
                 }))
Exemplo n.º 13
0
 def next(self, action):
     raise InvalidAction(
         _(u"%(status)s状态不允许进行%(action)s操作" % {
             "action": action_name(action),
             "status": status_name(self.status)
         }))
Exemplo n.º 14
0
 def next(self, action):
     raise InvalidAction(_(u"%(status)s状态不允许进行%(action)s操作" %
                           {"action": action_name(action),
                            "status": status_name(self.status)}))