Exemple #1
0
 def getPushedListByResp(self, jsonInfo):
     info = json.loads(jsonInfo)
     info['userType'] = USER_TAG_RESPONSIBLEPERSON
     (status, userID) = PushedTenderManager.isTokenValidByUserType(info=info)
     if status is not True:
         errorInfo = ErrorInfo['TENDER_01']
         return (False, errorInfo)
     pushedTenderManager = PushedTenderManager()
     return pushedTenderManager.getPushedTenderListByUserType(info=info)
Exemple #2
0
 def getAuditorPushedListByBoss(self, jsonInfo):
     info = json.loads(jsonInfo)
     info['userType'] = USER_TAG_BOSS
     (status,
      userID) = PushedTenderManager.isTokenValidByUserType(info=info)
     if status is not True:
         errorInfo = ErrorInfo['TENDER_01']
         return (False, errorInfo)
     info['userType'] = USER_TAG_AUDITOR
     pushedTenderManager = PushedTenderManager()
     return pushedTenderManager.getPushedTenderListByUserType(info=info)
Exemple #3
0
 def getRespPushedListByBoss(self, jsonInfo):
     info = json.loads(jsonInfo)
     info['userType'] = USER_TAG_BOSS
     (status,
      userID) = PushedTenderManager.isTokenValidByUserType(info=info)
     if status is not True:
         errorInfo = ErrorInfo['TENDER_01']
         return (False, errorInfo)
     info['userID'] = userID
     pushedTenderManager = PushedTenderManager()
     # 此方法同 负责人获取我的推送 所以此处伪装成负责人
     info['userType'] = USER_TAG_RESPONSIBLEPERSON
     return pushedTenderManager.getPushedTenderListByUserType(info=info)
Exemple #4
0
    def getRespPushedListByAuditor(self, jsonInfo):
        info = json.loads(jsonInfo)
        info['userType'] = USER_TAG_AUDITOR
        (status,
         userID) = PushedTenderManager.isTokenValidByUserType(info=info)
        if status is not True:
            errorInfo = ErrorInfo['TENDER_01']
            return (False, errorInfo)
        info['userType'] = USER_TAG_RESPONSIBLEPERSON
        pushedTenderManager = PushedTenderManager()
        (status,
         tenderResult) = pushedTenderManager.getPushedTenderListByUserType(
             info=info)
        if status is True:
            try:
                dataList = tenderResult['dataList']
                tenderIDTuple = (o['tenderID'] for o in dataList)

                pushedResult = db.session.query(PushedTenderInfo).filter(
                    and_(PushedTenderInfo.auditorPushedTime != None,
                         PushedTenderInfo.tenderID.in_(tenderIDTuple))).all()
                pushedTenderIDList = [o.tenderID for o in pushedResult]
                for o in dataList:
                    if o['tenderID'] in pushedTenderIDList:
                        o['pushed'] = True
                    else:
                        o['pushed'] = False
                return (True, tenderResult)
            except Exception as e:
                print str(e)
                traceback.print_stack()
                db.session.rollback()
                errorInfo = ErrorInfo['TENDER_02']
                errorInfo['detail'] = str(e)
                return (False, errorInfo)
        return (False, tenderResult)