Beispiel #1
0
 def post(self):
     try:
         result = {}
         username = self.get_argument("username")
         user_infos = mrd.select_table(table="admin",
                                       column="*",
                                       condition="username",
                                       value=username)
         if user_infos:
             result.setdefault('code', 200)
             result.setdefault('data', "该用户已存在")
             return self.write(result)
         password = self.get_argument("password")
         key = "(username,password)"
         value = f"('{username}',{password})"
         user_infos = mrd.add_table(table="admin", key=key, value=value)
         if user_infos:
             result.setdefault('code', 404)
             result.setdefault('data', "failure")
         else:
             result.setdefault('code', 200)
             result.setdefault('data', "successful")
         self.write(result)
     except:
         result.setdefault('code', 200)
         result.setdefault('data', "该用户已存在")
         self.write(result)
Beispiel #2
0
 def post(self):
     result = {}
     loudong_id = self.get_argument("loudong_id")
     louceng_id = self.get_argument("louceng_id")
     name = self.get_argument("name", 1)
     shui = self.get_argument("shui", 1)
     dian = self.get_argument("dian", 1)
     meiqi = self.get_argument("meiqi", 1)
     mensuo = self.get_argument("mensuo", 1)
     deng = self.get_argument("deng", 1)
     xiashui = self.get_argument("xiashui", 1)
     dire = self.get_argument("dire", 1)
     user_name = self.get_argument("user_name")
     phone_number = self.get_argument("phone_number")
     password = self.get_argument("password", 123456)
     status = self.get_argument("status", 1)
     key = "(loudong_id,louceng_id,name,shui,dian,meiqi,mensuo,deng,xiashui,dire,user_name,phone_number,password,status)"
     value = f"('{loudong_id}','{louceng_id}','{name}','{shui}','{dian}','{meiqi}','{mensuo}','{deng}','{xiashui}','{dire}','{user_name}','{phone_number}','{password}','{status}')"
     infos = mrd.add_table(table="fangjian", value=value, key=key)
     if infos:
         result.setdefault('code', 404)
         result.setdefault('data', "failure")
     else:
         result.setdefault('code', 200)
         result.setdefault('data', "successful")
     self.write(result)
Beispiel #3
0
 def post(self):
     result = {}
     fangjian_id = self.get_argument("fangjian_id")
     yijian = self.get_argument("yijian", "")
     key = "(fangjian_id,yijian)"
     value = f"('{fangjian_id}','{yijian}')"
     infos = mrd.add_table(table="yijian", value=value, key=key)
     if infos:
         result.setdefault('code', 404)
         result.setdefault('data', "failure")
     else:
         result.setdefault('code', 200)
         result.setdefault('data', "successful")
     self.write(result)
Beispiel #4
0
 def post(self):
     result = {}
     name = self.get_argument("name")
     key = "(name)"
     value = f"('{name}')"
     infos = mrd.add_table(table="loudong", value=value, key=key)
     user_infos = mrd.select_table(table="loudong",
                                   column="max(id)",
                                   condition="1",
                                   value="1")
     if infos:
         result.setdefault('code', 404)
         result.setdefault('data', "failure")
     else:
         result.setdefault('code', 200)
         result.setdefault('data', {'loudong_id': user_infos[0][0]})
     self.write(result)
Beispiel #5
0
    def post(self):
        result = {}
        userId = self.get_argument("userId")
        name = self.get_argument("name")
        job = self.get_argument("job")
        sex = self.get_argument("sex")
        rzsj = self.get_argument("rzsj")
        department = self.get_argument("department")
        remark = self.get_argument("remark")

        key = "(userId,name,job,sex,rzsj,department,remark)"
        value = f"({userId},'{name}','{job}','{sex}','{rzsj}','{department}','{remark}')"
        infos = mrd.add_table(table="staff", key=key, value=value)
        if infos:
            result.setdefault('code', 404)
            result.setdefault('data', "failure")
        else:
            result.setdefault('code', 200)
            result.setdefault('data', "successful")
        self.write(result)
Beispiel #6
0
 def post(self):
     result = {}
     assets = str(self.get_argument("assets"))
     type = self.get_argument("type")
     entrytime = self.get_argument("entrytime")
     deliverytime = self.get_argument("deliverytime")
     remark = self.get_argument("remark")
     personid = self.get_argument("personid", 0)
     status = self.get_argument("status", 0)
     companyid = self.get_argument("companyid")
     assetsid = self.get_argument("assetsid")
     key = "(assets,type,entrytime,deliverytime,remark,personid,status,companyid,assetsid)"
     value = f"('{assets}','{type}','{entrytime}','{deliverytime}','{remark}','{personid}','{status}','{companyid}','{assetsid}')"
     infos = mrd.add_table(table="assets", value=value, key=key)
     if infos:
         result.setdefault('code', 404)
         result.setdefault('data', "failure")
     else:
         result.setdefault('code', 200)
         result.setdefault('data', "successful")
     self.write(result)
Beispiel #7
0
 def post(self):
     result = {}
     fangjian_id = self.get_argument("fangjian_id")
     shui = self.get_argument("shui", 1)
     dian = self.get_argument("dian", 1)
     meiqi = self.get_argument("meiqi", 1)
     mensuo = self.get_argument("mensuo", 1)
     deng = self.get_argument("deng", 1)
     xiashui = self.get_argument("xiashui", 1)
     dire = self.get_argument("dire", 1)
     key = "(fangjian_id,shui,dian,meiqi,mensuo,deng,xiashui,dire)"
     value = f"('{fangjian_id}','{shui}','{dian}','{meiqi}','{mensuo}','{deng}','{xiashui}','{dire}')"
     infos = mrd.add_table(table="baoxiu", value=value, key=key)
     if infos:
         result.setdefault('code', 404)
         result.setdefault('data', "failure")
     else:
         result.setdefault('code', 200)
         result.setdefault('data', "successful")
     where = f"(id = {fangjian_id})"
     value = f"status = 0,shui={shui},dian={dian},meiqi={meiqi},mensuo={mensuo},deng={deng},xiashui={xiashui},dire={dire}"
     infos = mrd.update_table(table="fangjian", value=value, where=where)
     self.write(result)