Ejemplo n.º 1
0
 def status(self, bugId, status, currentUser):
     """
     查询调试记录列表
     """
     try:
         bugSQL = """
             UPDATE man_pro_bug
             SET
                 BUG_STATUS='{status}',
                 HANDLE_BY='{handleBy}',
                 HANDLE_TIME='{handleTime}'
             WHERE BUG_ID='{bugId}';
             """.format(status='created' if status == 'reset' else status,
                        handleBy=currentUser,
                        handleTime=Utils.getLocalTime(),
                        bugId=bugId)
         recordSQL = """
             INSERT INTO man_bug_record(
                 ID,
                 BUG_ID,
                 BUG_STATUS,
                 HANDLE_BY,
                 HANDLE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}'
             );
             """.format(Utils.makeId(), bugId, status, currentUser,
                        Utils.getLocalTime())
         Utils.log('更新问题状态SQL', bugSQL)
         Utils.log('插入调试记录SQL', recordSQL)
         return PySQL.execute(bugSQL) > 0 and PySQL.execute(recordSQL) > 0
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
         return False
Ejemplo n.º 2
0
 def insert(self, proId, proName, modId, modName, bugTitle, bugLevel,
            bugDes, userId, currentUser):
     """
     添加新建问题记录
     """
     count = 0
     try:
         bugId = Utils.makeId()
         sql = """
             INSERT INTO man_pro_bug(
                 BUG_ID,
                 PRO_ID,
                 PRO_NAME,
                 MODULE_ID,
                 MODULE_NAME,
                 BUG_TITLE,
                 BUG_LEVEL,
                 BUG_DES,
                 CREATE_BY,
                 CREATE_TIME,
                 HANDLE_BY,
                 HANDLE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}'
             );
             """.format(bugId, proId, proName, modId, modName, bugTitle,
                        bugLevel, bugDes, currentUser, Utils.getLocalTime(),
                        userId if userId else currentUser,
                        Utils.getLocalTime())
         recordSQL = """
             INSERT INTO man_bug_record(
                 ID,
                 BUG_ID,
                 BUG_STATUS,
                 HANDLE_BY,
                 HANDLE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}'
             );
             """.format(Utils.makeId(), bugId, 'created', currentUser,
                        Utils.getLocalTime())
         Utils.log('打印新建问题SQL', sql)  # print log
         count = PySQL.execute(sql)
         PySQL.execute(recordSQL)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 3
0
 def inset(self, fileName, projectId, projectName, uploadBy):
     """
     上传文件信息入库
     """
     count = 0
     try:
         sql = """
             INSERT INTO man_pro_file(
                 ID,
                 FILE_NAME,
                 PRO_ID,
                 PRO_NAME,
                 UPLOAD_BY,
                 UPLOAD_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}','{}'
             );
             """.format(Utils.makeId(), fileName, projectId, projectName,
                        uploadBy, Utils.getLocalTime())
         Utils.log('打印上传文件信息入库SQL', sql)
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 4
0
 def insert(self, proName, proType, proUse, proDes, userCreator):
     """
     添加 project 记录
     """
     count = 0
     try:
         sql = """
             INSERT INTO man_pro_info(
                 PRO_ID,
                 PRO_NAME,
                 PRO_TYPE,
                 PRO_LEADER,
                 PRO_USE,
                 PRO_CRE_TIME,
                 PRO_DES
             )VALUES(
                 '{}','{}','{}','{}','{}','{}','{}'
             );
             """.format(self.makeProId(), proName, proType, userCreator,
                        proUse, Utils.getLocalTime(), proDes)
         Utils.log('打印创建项目SQL', sql)  # print log
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 5
0
 def insert(self, userId, userName, userAuth, userLogin, userCreator):
     """
     添加用户记录
     """
     count = 0
     try:
         sql = """
             INSERT INTO man_auth_user(
                 USER_ID,
                 USER_NAME,
                 USER_AUTH,
                 USER_LOGIN,
                 USER_CREATOR,
                 USER_CRE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}','{}'
             );
             """.format(userId, userName, userAuth, userLogin, userCreator,
                        Utils.getLocalTime())
         Utils.log('添加用户记录SQL', sql)
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 6
0
 def insert(self, proId, userId, modId, modName, modDes, modStart, modEnd):
     """
     添加分配任务记录
     """
     count = 0
     try:
         sql = """
             INSERT INTO man_pro_task(
                 PRO_ID,
                 USER_ID,
                 MODULE_ID,
                 MODULE_NAME,
                 MODULE_DES,
                 MODULE_START,
                 MODULE_END,
                 CREATE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}','{}','{}','{}'
             );
             """.format(proId, userId, modId, modName, modDes, modStart,
                        modEnd, Utils.getLocalTime())
         Utils.log('打印创建项目SQL', sql)
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 7
0
 def update(self, data, currentUser):
     """
     更新任务进度
     """
     count = 0
     try:
         sql = """
             UPDATE man_pro_rate SET
                 TASK_RATE={},
                 UPDATE_BY='{}',
                 UPDATE_TIME='{}'
             WHERE TASK_RATE != {}
             AND USER_ID='{}'
             AND MODULE_ID='{}';
             """.format(data['TASK_RATE'], currentUser,
                        Utils.getLocalTime(), data['TASK_RATE'],
                        data['USER_ID'], data['MODULE_ID'])
         Utils.log('打印更新任务进度SQL', sql)
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0
Ejemplo n.º 8
0
 def insert(self, userId, modId, currentUser):
     """
     初始化任务进度
     """
     count = 0
     try:
         sql = """
             INSERT INTO man_pro_rate(
                 USER_ID,
                 MODULE_ID,
                 TASK_RATE,
                 UPDATE_BY,
                 UPDATE_TIME
             )VALUES(
                 '{}','{}','{}','{}','{}'
             );
             """.format(userId, modId, 0, currentUser, Utils.getLocalTime())
         Utils.log('打印任务进度SQL', sql)
         count = PySQL.execute(sql)
     except Exception as e:
         print('ERROR {}'.format(e))
         Utils.log('ERROR {}'.format(e))
     return count > 0