当前位置: 首页>>代码示例>>Python>>正文


Python MethodUtil.getReqVal方法代码示例

本文整理汇总了Python中base.utils.MethodUtil.getReqVal方法的典型用法代码示例。如果您正苦于以下问题:Python MethodUtil.getReqVal方法的具体用法?Python MethodUtil.getReqVal怎么用?Python MethodUtil.getReqVal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在base.utils.MethodUtil的用法示例。


在下文中一共展示了MethodUtil.getReqVal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: save

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def save(request):
    ordercode = MethodUtil.getReqVal(request,"ordercode","")
    yyshdate = MethodUtil.getReqVal(request,"yyshdate","")
    grpcode = request.session.get("s_grpcode")

    response_data = {}
    try:
        if ordercode:
            #1.更新订单明细
            # detailList = OrdD.objects \
            #                  .filter(ordercode=ordercode,grpcode=grpcode) \
            #                  .values("ordercode","procode","barcode","grpcode")

            # for row in detailList:  procode=str(row["procode"])
            OrdD.objects.filter(ordercode=ordercode,grpcode=grpcode).update(sjshsum="-1",sjprnum="-1")

            #2.保存预约送货日期 更新订单状态
            rs = OrdStatus.objects.all().filter(ordercode=ordercode)
            if not rs:
                OrdStatus.objects.create(ordercode=ordercode, yyshdate=yyshdate, status="Y")
            else:
                OrdStatus.objects.filter(ordercode=ordercode).update(yyshdate=yyshdate,status="Y")

            response_data['result'] = 'success'
        else:
             response_data['result'] = 'failure'
    except Exception as e:
        print(e)
        response_data['result'] = 'failure'
        transaction.rollback()
    else:
        transaction.commit()

    return HttpResponse(json.dumps(response_data), content_type="application/json")
开发者ID:KGPython,项目名称:scm,代码行数:36,代码来源:views.py

示例2: index

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def index(request):
    exceltype = mtu.getReqVal(request, "exceltype", "2")
    # 操作日志
    if exceltype=='2':
        qtype = "1"
    else:
        qtype = "2"
    key_state = mtu.getReqVal(request, "key_state", '')
    if exceltype == '1' and (not key_state or key_state != '2'):
        exceltype = '2'

    path = request.path
    today = datetime.datetime.today()
    ucode = request.session.get("s_ucode")
    uname = request.session.get("s_uname")
    BasPurLog.objects.create(name="顾客退货率", url=path, qtype=qtype, ucode=ucode,uname=uname, createtime=today)

    # 昨天
    yesterday = DateUtil.get_day_of_day(-1)
    if exceltype == '1':
        fname = yesterday.strftime("%m.%d") + "_daily_customer_returns.xls"
        return export(fname,str(yesterday))
    else:
        data = query(str(yesterday))
        return render(request, "report/daily/customer_returns.html", data)
开发者ID:KGPython,项目名称:scm,代码行数:27,代码来源:customer_returns.py

示例3: purlog

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def purlog(request):
    pageNum = mtu.getReqVal(request,"pageNum","1")
    start = mtu.getReqVal(request,"start")
    end = mtu.getReqVal(request,"end")
    ucode = mtu.getReqVal(request,"ucode","")
    pname = mtu.getReqVal(request,"pname","")

    try:
        karrs = {}
        if not start:
            start = (datetime.date.today().replace(day=1)).strftime("%Y-%m-%d")
        if not end:
            end = datetime.datetime.today().strftime("%Y-%m-%d")

        karrs.setdefault("createtime__gte", "{start} 00:00:00".format(start=start))
        karrs.setdefault("createtime__lte", "{end} 23:59:59".format(end=end))
        karrs.setdefault("ucode__contains", "{ucode}".format(ucode=ucode))
        karrs.setdefault("name__contains", "{pname}".format(pname=pname))

        rlist = BasPurLog.objects.all().filter(**karrs).order_by("-createtime")
    except Exception as e:
        rlist = []
        print(e)

    page = Paginator(rlist, __EACH_PAGE_SHOW_NUMBER, allow_empty_first_page=True).page(int(pageNum))
    result = {"page": page, "pageNum": str(pageNum), "start": start,"end":end,"ucode":ucode,"pname":pname,"qtype_dict":{"1":"查询","2":"下载"}}
    return render(request, "admin/sysConf_retail_purlog.html", result)
开发者ID:KGPython,项目名称:scm,代码行数:29,代码来源:views.py

示例4: index

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def index(request):
    date = DateUtil.get_day_of_day(-1)
    start = (date.replace(day=1)).strftime("%Y-%m-%d")
    yesterday = date.strftime("%Y-%m-%d")
    lastDay = calendar.monthrange(date.year, date.month)[1]
    end = "{year}-{month}-{day}".format(year=date.year, month=date.month, day=lastDay)

    qtype = mtu.getReqVal(request, "qtype", "1")
    # 操作日志
    if not qtype:
        qtype = "1"
    key_state = mtu.getReqVal(request, "key_state", '')
    if qtype == '2' and (not key_state or key_state != '2'):
        qtype = '1'
    path = request.path
    today = datetime.datetime.today()
    ucode = request.session.get("s_ucode")
    uname = request.session.get("s_uname")
    BasPurLog.objects.create(name="超市运营日分解", url=path, qtype=qtype, ucode=ucode, uname=uname, createtime=today)

    if qtype == "1":
        data = query(date,start,end,yesterday,lastDay)
        return render(request, "report/daily/group_opt_decompt.html",data)
    else:
        name = '_daily_group_operate_decompt'
        fname = date.strftime('%m.%d')+name+".xls"
        return export(fname,date,start,end,yesterday,lastDay)
开发者ID:KGPython,项目名称:scm,代码行数:29,代码来源:group_operate_decompt.py

示例5: beforeBackBill

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def beforeBackBill(request):
    """
    预退货单列表
    :param request:
    :return:
    """
    sperCode = request.session.get('s_suppcode')   #用户所属单位
    grpCode = request.session.get('s_grpcode')   #用户所属单位
    grpName = request.session.get('s_grpname')

    shopCodeList = []

    start = (datetime.date.today().replace(day=1)).strftime("%Y-%m-%d")
    end = datetime.datetime.today().strftime("%Y-%m-%d")
    page = mtu.getReqVal(request,'page',1)

    sheetId =  mtu.getReqVal(request,'sheetId','')
    shopCode =  mtu.getReqVal(request,'shopCode','')
    start =  mtu.getReqVal(request,'start',start)
    end =  mtu.getReqVal(request,'end',end)

    kwargs = {}
    if sheetId:
        kwargs.setdefault("sheetid__contains",sheetId)
    if len(shopCode):
        shopCodeStr = shopCode[0:len(shopCode)-1]
        shopCodeList = shopCodeStr.split(',')
        kwargs.setdefault("shopid__in",shopCodeList)

    kwargs.setdefault("checkdate__gte",start)
    kwargs.setdefault("checkdate__lte","{end} 23:59:59".format(end=end))

    kwargs.setdefault("venderid",sperCode)
    kwargs.setdefault("flag",2)

    billList = Ret0.objects.values("sheetid","shopid","venderid","retdate","editdate","paymoney","kxsummoney","acceptflag","badflag","checkdate","notes")\
                             .filter(**kwargs).order_by("sheetid")
    #分页函数
    paginator=Paginator(billList,20)
    try:
        billList=paginator.page(page)
    except Exception as e:
        print(e)

    ACCEPT_FLAG = {"0":"同意","1":"不同意"}
    BAD_FLAG = {"0":"坏货","1":"好货"}

    return render(request,'user_bill_beforeback.html',locals())
开发者ID:KGPython,项目名称:scm,代码行数:50,代码来源:views.py

示例6: findKxlist

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def findKxlist(request):
    venderid = request.session.get("s_suppcode")
    pend = mtu.getReqVal(request,"pend")

    rlist = findKxListData(venderid,pend,1)
    sum = decimal.Decimal(0.0)
    for row in rlist:
        sum += row["kmoney"]
    return render(request,"user_settle_kx.html",{"rlist":rlist,"sum":sum})
开发者ID:KGPython,项目名称:scm,代码行数:11,代码来源:views.py

示例7: findrole

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def findrole(request):
    grpcode = request.session.get("s_grpcode")
    utype = request.session.get("s_utype")
    ucode = mtu.getReqVal(request,"ucode")

    urlist = BasUserRole.objects.filter(ucode=ucode).values("rcode")
    rlist = BasRole.objects.filter(grpcode__in=[utype,grpcode]).values()

    rs = {}
    rs["rlist"]=[dict(row) for row in rlist]
    rs["urlist"]=[row["rcode"] for row in urlist]
    return HttpResponse(json.dumps(rs))
开发者ID:KGPython,项目名称:scm,代码行数:14,代码来源:views.py

示例8: uppwd

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def uppwd(request):
    data = {}
    flag = mtu.getReqVal(request,"flag")
    #修改
    if flag=="1":
        user = request.session.get("s_user",None)
        ucode = user["ucode"]
    elif flag=="2":
        ucode = mtu.getReqVal(request,"ucode")

    data["result"] = "1"
    try:
        newPwd = mtu.getReqVal(request,"newPwd","")
        pwd = mtu.md5(newPwd)
        BasUser.objects.filter(ucode=ucode).update(password=pwd)

        data["result"] = "0"
    except Exception as e:
        print(e)

    return HttpResponse(json.dumps(data))
开发者ID:KGPython,项目名称:scm,代码行数:23,代码来源:views.py

示例9: report

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def report(request):
    pageNum = mtu.getReqVal(request, "pageNum", "1")
    start = mtu.getReqVal(request, "start")
    end = mtu.getReqVal(request, "end")
    ucode = mtu.getReqVal(request, "ucode", "")
    pname = mtu.getReqVal(request, "pname", "")
    try:
        if not start:
            start = (datetime.date.today().replace(day=1)).strftime("%Y-%m-%d")
        if not end:
            end = datetime.datetime.today().strftime("%Y-%m-%d")

        conn = mtu.getMysqlConn()
        cur = conn.cursor()

        condition = " where 1=1 "
        condition += " and createtime BETWEEN '{start} 00:00:00' AND '{end} 23:59:59'"\
                     .format(start=start,end=end)
        if ucode:
             condition += " and ucode like '%{ucode}%'".format(ucode=ucode)
        if pname:
            condition += " and name like '%{pname}%'".format(pname=pname)

        sql = "SELECT DATE_FORMAT(createtime,'%Y-%m-%d') createtime,`name`,url," \
              "SUM(CASE WHEN qtype = 1 THEN 1 ELSE 0 END) views," \
              "SUM(CASE WHEN qtype = 2 THEN 1 ELSE 0 END) downs " \
              "FROM bas_pur_log {condition} GROUP BY DATE_FORMAT(createtime,'%Y-%m-%d'),`name` "\
              "order by DATE_FORMAT(createtime,'%Y-%m-%d') DESC "\
              .format(condition=condition)

        cur.execute(sql)
        rlist = cur.fetchall()
        mtu.close(conn,cur)
    except Exception as e:
        rlist = []
        print(e)

    page = Paginator(rlist, __EACH_PAGE_SHOW_NUMBER, allow_empty_first_page=True).page(int(pageNum))
    result = {"page": page, "pageNum": str(pageNum),"start": start,"end":end,"ucode":ucode,"pname":pname,}
    return render(request, "admin/sysConf_retail_purlog_report.html", result)
开发者ID:KGPython,项目名称:scm,代码行数:42,代码来源:views.py

示例10: index

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def index(request):
    qtype = mtu.getReqVal(request,"qtype","1")
    # 操作日志
    if not qtype:
        qtype = "1"
    key_state = mtu.getReqVal(request, "key_state", '')
    if qtype == '2' and (not key_state or key_state != '2'):
        qtype = '1'

    path = request.path
    today = datetime.datetime.today()
    ucode = request.session.get("s_ucode")
    uname = request.session.get("s_uname")
    BasPurLog.objects.create(name="超市零库存日报", url=path, qtype=qtype, ucode=ucode,uname=uname, createtime=today)

    yesterday = datetime.date.today() - datetime.timedelta(days=1)
    if qtype== "1":
        data = query()
        return render(request,"report/daily/zero_stock_top.html",data)
    else:
        fname = yesterday.strftime("%m.%d") + "_daily_zero_stock.xls"
        return export(fname)
开发者ID:KGPython,项目名称:scm,代码行数:24,代码来源:zerostocktop.py

示例11: index

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def index(request):
     qtype = mtu.getReqVal(request,"qtype","1")

     #操作日志
     if not qtype:
         qtype = "1"
     key_state = mtu.getReqVal(request, "key_state", '')
     if qtype=='2' and (not key_state or key_state!='2'):
         qtype = '1'

     path = request.path
     today = datetime.datetime.today()
     ucode = request.session.get("s_ucode")
     uname = request.session.get("s_uname")
     BasPurLog.objects.create(name="超市销售日报",url=path,qtype=qtype,ucode=ucode,uname=uname,createtime=today)

     date = DateUtil.get_day_of_day(-1)
     if qtype == "1":
         data = query(date)
         return render(request,"report/daily/group_sale.html",data)
     else:
         fname = date.strftime("%m.%d") + "_daily_group_sale.xls"
         return export(fname,date)
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:group_sale.py

示例12: menu

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def menu(request):
    mtype = mtu.getReqVal(request,"mtype","1")
    request.session["menu_type"] = mtype

    user = request.session.get("s_user",None)
    if user:
         pubList = findPubInfoAllByCon(user)
    else:
         pubList = []

    pageNum = int(request.GET.get("pageNum",1))

    page =  Paginator(pubList,__EACH_PAGE_SHOW_NUMBER,allow_empty_first_page=True).page(pageNum)

    return render(request,"admin/index.html",{"page":page,"pageNum":pageNum})
开发者ID:KGPython,项目名称:scm,代码行数:17,代码来源:views.py

示例13: index

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def index(request):
    exceltype = mtu.getReqVal(request, "exceltype", "2")
    if exceltype=='2':
        qtype = "1"
    else:
        qtype = "2"
    key_state = mtu.getReqVal(request, "key_state", '')
    if exceltype == '1' and (not key_state or key_state != '2'):
        exceltype = '2'

    # 操作日志
    path = request.path
    today = datetime.datetime.today()
    ucode = request.session.get("s_ucode")
    uname = request.session.get("s_uname")
    BasPurLog.objects.create(name="超市课组销售前十", url=path, qtype=qtype, ucode=ucode,uname=uname, createtime=today)

    yesterday = DateUtil.get_day_of_day(-1)
    if exceltype == '1':
        fname = yesterday.strftime("%m.%d") + "_daily_saletop10_operate.xls"
        return export(fname,yesterday)
    else:
        data = query(yesterday)
        return render(request, "report/daily/saletop10.html", data)
开发者ID:KGPython,项目名称:scm,代码行数:26,代码来源:saletop10.py

示例14: saverole

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def saverole(request):
    ucode = mtu.getReqVal(request,"ucode")
    rlist = request.POST.getlist("rcode")
    rs = {}
    try:
        cursor = connection.cursor()
        sql = "delete from bas_user_role where ucode=" + ucode
        cursor.execute(sql)
        for row in rlist:
            sql = "insert into bas_user_role(ucode, rcode, status,brdate) values ('" + ucode + "','" + row + "', 0, curdate())"
            cursor.execute(sql)
        rs["status"] = '0'
    except Exception as e:
        print(e)
        rs["status"] = '1'
    return HttpResponse(json.dumps(rs))
开发者ID:KGPython,项目名称:scm,代码行数:18,代码来源:views.py

示例15: query_supp

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getReqVal [as 别名]
def query_supp(request):
    posts = []
    grpcode = mtu.getReqVal(request,"grpcode","")
    if grpcode:
        sql = "select u.ucode, u.nm, u.grpcode, g.chnm as gnm from bas_user as u,"
        sql += "bas_supplier as g where u.grpcode = g.suppcode and u.utype = '2' "
        sql += "and u.grpcode like '%" + grpcode.strip() + "%'"
        cursor = connection.cursor()
        cursor.execute(sql)
        rsobj = cursor.fetchall()
        for row in rsobj:
            post_dict = {}
            post_dict['ucode'] = row[0]
            post_dict['nm'] = row[1]
            post_dict['grpcode'] = row[2]
            post_dict['gnm'] = row[3]
            posts.append(post_dict)
    form = ChangeGrpPass()
    return render(request, 'admin/sysConf_supply_admin.html', {'form': form, 'posts': posts,"grpcode":grpcode})
开发者ID:KGPython,项目名称:scm,代码行数:21,代码来源:views.py


注:本文中的base.utils.MethodUtil.getReqVal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。