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


Python utils.MethodUtil类代码示例

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


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

示例1: save

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,代码行数:34,代码来源:views.py

示例2: index

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,代码行数:25,代码来源:customer_returns.py

示例3: export

def export(rslist, sum1, sum2, sum3):
    sname = "门店-大类销售汇总"

    titles = [
        ("门店名称", "1000", "shopid"),
        ("销售数量", "1000", "promflag"),
        ("实际销售", "1000", "startdate"),
        ("销售成本", "1000", "enddate"),
    ]

    fmtlist = [None, "0.00", "0.000", "0.000"]

    shopDict = findShop()

    dictlist = [shopDict, None, None, None]

    sumList = ["合计", sum1, sum2, sum3]

    book = mtu.exportXls(sname, titles, rslist, sumList, dictlist, fmtlist)

    outtype = "application/vnd.ms-excel"
    fname = "sale_counter.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:counter.py

示例4: writeDataToSheet2

def writeDataToSheet2(wb,listShops,listShopTotal,listDept):
    date = DateUtil.get_day_of_day(-1)
    year = date.year
    month = date.month

    titlesSheetShop = [[("(%s月)零库存课组明细日报" % month,0,1,7)],
              [("报表日期",3,1,1),("%s年-%s月-%s日"%(year,month,date.day),4,1,3)],
              [("门店编号",0,1,1),("门店名称",1,1,1),("课组编码",2,1,1),("课组名称",3,1,1),("课组汇总",4,1,1),("零库存数",3,1,1),("占比",3,1,1)]
              ]
    titlesSheetLast = [[("(%s月)零库存课组汇总日报" % month,0,1,5)],
              [("报表日期",2,1,1),("%s年-%s月-%s日"%(year,month,date.day),3,1,2)],
              [("课组编码",0,1,1),("课组名称",1,1,1),("课组汇总",2,1,1),("零库存数",3,1,1),("占比",4,1,1)]
              ]
    keylistSheet2 = ['ShopID','shopname','deptid','deptidname','qtyz','qtyl','zhonbi']
    keylistSheet3 = ['deptid','deptidname','qtyz','qtyl','zhonbi']
    widthList = [600,1100,600,600,600,600]
    sheets = []
    for i in range(0,len(listShops)):
        sheets.append(wb.add_sheet(listShops[i][0]['shopname'],cell_overwrite_ok=True))
    sheets.append(wb.add_sheet("(月)零库存课组汇总日报",cell_overwrite_ok=True))
    for j in range(0,len(sheets)-1):
        mtu.insertTitle2(sheets[j],titlesSheetShop,keylistSheet2,widthList)
        mtu.insertCell2(sheets[j],3,listShops[j-2],keylistSheet2,None)
        titlesLen = len(titlesSheetShop)
        listShopsLen = len(listShops)
        totalDict = {'dict':listShopTotal[j-2]}
        mtu.insertSum2(sheets[j],keylistSheet2,titlesLen+listShopsLen,totalDict,2)

    mtu.insertTitle2(sheets[len(sheets)-1],titlesSheetLast,keylistSheet3,widthList)
    mtu.insertCell2(sheets[len(sheets)-1],3,listDept,keylistSheet3,None)
开发者ID:KGPython,项目名称:scm,代码行数:30,代码来源:zerostocktop.py

示例5: writeDataToSheet2

def writeDataToSheet2(wb, retdetail):
    date = DateUtil.get_day_of_day(-1)
    year = date.year
    month = date.month
    lastDay = calendar.monthrange(year, month)[1]

    sheet2 = wb.add_sheet("退货明细", cell_overwrite_ok=True)

    titles = [
        [("(%s月%s日)门店顾客退货明细" % (month, date.day), 0, 1, 12)],
        [("门店编码", 0, 2, 1), ("门店名称", 1, 2, 1), ("销售日期", 2, 2, 1), ("销售时间", 3, 2, 1), ("退货小票", 4, 2, 1),
         ("posid", 5, 2, 1), ("收银员工号", 6, 2, 1), ("商品编码", 7, 2, 1), ("商品名称", 8, 2, 1), ("类别编码", 9, 2, 1),
         ("退货数量", 10, 2, 1), ("退货金额", 11, 2, 1)],
    ]

    keylist = ['shopid', 'shopname', 'sdate', 'stime', 'listno', 'posid', 'cashierid', 'goodsid', 'goodsname', 'deptid', 'amount',
               'sale']

    widthList = [600, 300, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600]

    # 日销售报表
    mtu.insertTitle2(sheet2, titles, keylist, widthList)
    mtu.insertCell2(sheet2, 3, retdetail, keylist, None)
    titlesLen = len(titles)
    listTopLen = len(retdetail)
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:customer_returns.py

示例6: index

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,代码行数:27,代码来源:group_operate_decompt.py

示例7: writeDataToSheet11

def writeDataToSheet11(wb, lis4):
    date = DateUtil.get_day_of_day(-1)
    year = date.year
    month = date.month
    lastDay = calendar.monthrange(year, month)[1]

    sheet4 = wb.add_sheet("4家电", cell_overwrite_ok=True)

    titles = [
        [("(%s月%s日)各店日销售排名日报(家电)" % (month, date.day), 0, 1, 13)],
        [("门店", 0, 2, 1), ("排名", 1, 2, 1), ("商品编码", 2, 2, 1), ("商品名称", 3, 2, 1), ("销售数量", 4, 2, 1),
         ("销售金额", 5, 2, 1), ("成本金额", 6, 2, 1), ("毛利", 7, 2, 1), ("毛利率%", 8, 2, 1), ("当前库存数量", 9, 2, 1),
         ("当前库存金额", 10, 2, 1), ("成本价", 11, 2, 1), ("平均售价", 12, 2, 1)],
    ]

    keylist = ['shopid', 'paiming', 'goodsid', 'goodsname', 'SaleQty', 'SaleValue', 'SaleCost', 'gpvalue', 'gprate', \
               'qty', 'costvalue', 'cprice', 'price']

    widthList = [600, 300, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600]

    # 日销售报表
    mtu.insertTitle2(sheet4, titles, keylist, widthList)
    mtu.insertCell2(sheet4, 3, lis4, keylist, None)
    titlesLen = len(titles)
    listTopLen = len(lis4)
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:saletop10.py

示例8: purlog

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,代码行数:27,代码来源:views.py

示例9: exportDetail

def exportDetail(rslist, sum1, sum2, sum3):
    sname = "门店销售列表"

    titles = [
        ("大类编码", "1000", "shopid"),
        ("大类名称", "1000", "shopid"),
        ("日期", "1000", "shopid"),
        ("销售数量", "1000", "promflag"),
        ("实际销售", "1000", "startdate"),
        ("销售成本", "1000", "enddate"),
        ("占比", "500", "enddate"),
        ("累计占比", "1000", "enddate"),
    ]

    fmtlist = [None, None, "%Y-%m-%d", "0.00", "0.000", "0.000", "0.00", "0.0"]

    sumList = ["合计", None, None, sum1, sum2, sum3, "100.00", "100.00"]

    book = mtu.exportXls(sname, titles, rslist, sumList, None, fmtlist)

    outtype = "application/vnd.ms-excel"
    fname = "sale_counter_detail.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:counter.py

示例10: writeDataToSheet1

def writeDataToSheet1(wb, rlist):
    sheet = wb.add_sheet("单张小票退货超300", cell_overwrite_ok=True)

    titles = [[("单张小票退货超300", 0, 1, 10)],
              [("门店编码", 0, 1, 1), ("销售日期", 1, 1, 1), ("时间", 2, 1, 1), ("小票单号", 3, 1, 1), ("pos机号", 4, 1, 1),
               ("收银员号", 5, 1, 1), ("收银员名", 6, 1, 1), ("支付原因", 7, 1, 1), ("支付类型", 8, 1, 1), ("支付金额", 9, 1, 1)],
              ]

    keylist = ['shopid', 'sdate', 'stime', 'listno', 'posid', 'cashierid', 'name', 'payreson', 'paytype', 'payvalue']
    widthlist = [800, 800, 800, 800, 800, 800, 800, 800, 800, 800]

    mtu.insertTitle2(sheet, titles, keylist, widthlist)
    mtu.insertCell2(sheet, 2, rlist, keylist, None)
开发者ID:KGPython,项目名称:scm,代码行数:13,代码来源:ret_shopping_rec_300.py

示例11: getshopid

def getshopid():
    '''
    获取门店编码
    :return list:
    '''
    conn = mtu.getMysqlConn()
    cur = conn.cursor()
    sql = "select ShopID, ShopName from bas_shop_region"
    cur.execute(sql)
    res = cur.fetchall()
    # 释放
    mtu.close(conn, cur)
    return res
开发者ID:KGPython,项目名称:scm,代码行数:13,代码来源:customer_returns.py

示例12: writeDataToSheet2

def writeDataToSheet2(wb,listDeptDetail,listDept):
    date = DateUtil.get_day_of_day(-1)
    year = date.year
    month = date.month

    sheet2 = wb.add_sheet("(月)负库存课组明细日报",cell_overwrite_ok=True)
    sheet3 = wb.add_sheet("(月)负库存课组汇总日报",cell_overwrite_ok=True)

    titlesSheet2 = [[("(%s月)负库存课组明细日报" % month,0,1,7)],
              [("报表日期",3,1,1),("%s年-%s月-%s日"%(year,month,date.day),4,1,3)],
              [("门店编号",0,1,1),("门店名称",1,1,1),("课组编码",2,1,1),("课组名称",3,1,1),("课组汇总",4,1,1),("负库存数",3,1,1),("占比",3,1,1)]
              ]
    titlesSheet3 = [[("(%s月)负库存课组汇总日报" % month,0,1,5)],
              [("报表日期",2,1,1),("%s年-%s月-%s日"%(year,month,date.day),3,1,2)],
              [("课组编码",0,1,1),("课组名称",1,1,1),("课组汇总",2,1,1),("负库存数",3,1,1),("占比",4,1,1)]
              ]
    keylistSheet2 = ['shopid','shopname','deptid','deptidname','qtyz','qtyl','zhonbi']
    keylistSheet3 = ['deptid','deptidname','qtyz','qtyl','zhonbi']
    widthList = [600,1100,600,600,600,600]

    mtu.insertTitle2(sheet2,titlesSheet2,keylistSheet2,widthList)
    mtu.insertTitle2(sheet3,titlesSheet3,keylistSheet3,widthList)

    mtu.insertCell2(sheet2,3,listDeptDetail,keylistSheet2,None)
    mtu.insertCell2(sheet3,3,listDept,keylistSheet3,None)
开发者ID:KGPython,项目名称:scm,代码行数:25,代码来源:negativestocktop.py

示例13: export

def export(outlist,sum1,sum2,sum3):
    sname = "日销售汇总列表"
    titles = [("日期","1000"),("门店明细","1000"),("单品明细","1000"),("大类明细","1000"),("销售数量","1000"),("实际销售","1000"),
              ("销售成本","1000"),("销售成本占比(%)","2000"),("销售成本累计占比(%)","3000")]

    sumlist = ["合计","门店合计","单品合计","大类合计",sum1,sum2,sum3,"100.00","100.00"]
    fmtlist = [None,None,None,None,"0.00","0.00","0.00","0.00","0.0"]

    book = mtu.exportXls(sname,titles,outlist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
开发者ID:KGPython,项目名称:scm,代码行数:15,代码来源:analysis.py

示例14: writeDataToSheet1

def writeDataToSheet1(wb,data):
    sheet = wb.add_sheet("负毛利大于200",cell_overwrite_ok=True)

    titles = [[("负毛利大于200" ,0,1,15)],
              [("机构编码",0,1,1),("机构名称",1,1,1),("销售日期",2,1,1),("商品编码",3,1,1),("商品名称",4,1,1),
               ("管理类别编码",5,1,1),("管理类别名称",6,1,1),("销售金额",7,1,1),("销售数量",8,1,1),("成本金额",9,1,1),
               ("亏损金额",10,1,1),("库存数量",11,1,1),("解释原因",12,1,1),("解决方案",13,1,1),("解决时间",14,1,1)],
              ]

    keylist = ['shopid','shopname','sdate','goodsid','goodsname','deptid','deptname','truevalue','qty',
               'costvalue','profit','stockqty','solvereason','solvesolution','solvetime']
    widthlist = [800,1000,800,800,2000,800,800,800,800,800,800,800,800,800,800]

    mtu.insertTitle2(sheet,titles,keylist,widthlist)
    mtu.insertCell2(sheet,2,data,keylist,None)
开发者ID:KGPython,项目名称:scm,代码行数:15,代码来源:negprofit_lte200.py

示例15: beforeBackBill

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,代码行数:48,代码来源:views.py


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