|
@@ -24,7 +24,7 @@ from apps.AppInfo.models import (
|
|
|
Hotel_Info, Hotel_Photo, JKdata, MyUser, Pick_Pub, Product, QXZdata,
|
|
Hotel_Info, Hotel_Photo, JKdata, MyUser, Pick_Pub, Product, QXZdata,
|
|
|
QXZdata_New, QXZstatus, QXZstatus_New, QXZswitchdata, QXZswitchstatus,
|
|
QXZdata_New, QXZstatus, QXZstatus_New, QXZswitchdata, QXZswitchstatus,
|
|
|
Video_data,GardenArea,Store_Manage,Areacrop,Sell_Manage,Person_Pick,QXZAutoswitch,Sightsee_Info,Pic_Info,
|
|
Video_data,GardenArea,Store_Manage,Areacrop,Sell_Manage,Person_Pick,QXZAutoswitch,Sightsee_Info,Pic_Info,
|
|
|
- QXZ_Alarm_Log,Experts,Relations,QXZ_Alarm,QXZ_Conf,QXZ_Base_Info,QXZ_Default_Conf,QXZ_Info_Record)
|
|
|
|
|
|
|
+ QXZ_Alarm_Log,Experts,Relations,QXZ_Alarm,QXZ_Conf,QXZ_Base_Info,QXZ_Default_Conf,QXZ_Info_Record,SystemPhoto)
|
|
|
from apps.Equipment.all_dict import qxz_dict
|
|
from apps.Equipment.all_dict import qxz_dict
|
|
|
import xlwt
|
|
import xlwt
|
|
|
from io import BytesIO
|
|
from io import BytesIO
|
|
@@ -269,8 +269,9 @@ class Equip_Show_List(ListView):
|
|
|
class Equip_Show_Detail(ListView):
|
|
class Equip_Show_Detail(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
e_id = request.GET.get("id")
|
|
e_id = request.GET.get("id")
|
|
|
- product = Product.objects.get(id=e_id)
|
|
|
|
|
e_name = request.GET.get("name")
|
|
e_name = request.GET.get("name")
|
|
|
|
|
+ if e_id:
|
|
|
|
|
+ product = Product.objects.get(id=e_id)
|
|
|
if e_name:
|
|
if e_name:
|
|
|
product = Product.objects.get(title=e_name)
|
|
product = Product.objects.get(title=e_name)
|
|
|
return render(request, 'outerNet/exhibitionDetail.html', context={"product":product})
|
|
return render(request, 'outerNet/exhibitionDetail.html', context={"product":product})
|
|
@@ -306,8 +307,9 @@ class Garden_View(ListView):
|
|
|
class Garden_Intro(ListView):
|
|
class Garden_Intro(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
pid = request.GET.get("id")
|
|
pid = request.GET.get("id")
|
|
|
- pick = Pick_Pub.objects.get(id=pid)
|
|
|
|
|
pname = request.GET.get("name")
|
|
pname = request.GET.get("name")
|
|
|
|
|
+ if pid:
|
|
|
|
|
+ pick = Pick_Pub.objects.get(id=pid)
|
|
|
if pname:
|
|
if pname:
|
|
|
pick = Pick_Pub.objects.get(name=pname)
|
|
pick = Pick_Pub.objects.get(name=pname)
|
|
|
return render(request, 'outerNet/pickIntro.html', context={"pick":pick})
|
|
return render(request, 'outerNet/pickIntro.html', context={"pick":pick})
|
|
@@ -337,8 +339,9 @@ class Garden_Detail(ListView):
|
|
|
class Tourist(ListView):
|
|
class Tourist(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
sid = request.GET.get("id")
|
|
sid = request.GET.get("id")
|
|
|
- sightsee = Sightsee_Info.objects.get(id=sid)
|
|
|
|
|
sname = request.GET.get("name")
|
|
sname = request.GET.get("name")
|
|
|
|
|
+ if sid:
|
|
|
|
|
+ sightsee = Sightsee_Info.objects.get(id=sid)
|
|
|
if sname:
|
|
if sname:
|
|
|
sightsee = Sightsee_Info.objects.get(name=sname)
|
|
sightsee = Sightsee_Info.objects.get(name=sname)
|
|
|
return render(request, 'outerNet/tourist.html', context={"sightsee":sightsee})
|
|
return render(request, 'outerNet/tourist.html', context={"sightsee":sightsee})
|
|
@@ -380,11 +383,12 @@ class Dorm_List(ListView):
|
|
|
class Dorm_Detail(ListView):
|
|
class Dorm_Detail(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
hotel_id = request.GET.get("id")
|
|
hotel_id = request.GET.get("id")
|
|
|
- hotel = Hotel_Info.objects.get(id=hotel_id)
|
|
|
|
|
- photos = Hotel_Photo.objects.filter(hotel=hotel)
|
|
|
|
|
hotel_name = request.GET.get("name")
|
|
hotel_name = request.GET.get("name")
|
|
|
|
|
+ if hotel_id:
|
|
|
|
|
+ hotel = Hotel_Info.objects.get(id=hotel_id)
|
|
|
if hotel_name:
|
|
if hotel_name:
|
|
|
hotel = Hotel_Info.objects.get(name=hotel_name)
|
|
hotel = Hotel_Info.objects.get(name=hotel_name)
|
|
|
|
|
+ photos = Hotel_Photo.objects.filter(hotel=hotel)
|
|
|
return render(request, 'outerNet/hotelDetail.html', context={"hotel":hotel,"photos":photos})
|
|
return render(request, 'outerNet/hotelDetail.html', context={"hotel":hotel,"photos":photos})
|
|
|
def post(self,request):
|
|
def post(self,request):
|
|
|
pass
|
|
pass
|
|
@@ -395,12 +399,12 @@ class Farm_list(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
page = int(request.GET.get("page"))
|
|
page = int(request.GET.get("page"))
|
|
|
con = request.GET.get("condition")
|
|
con = request.GET.get("condition")
|
|
|
- hotel_list = Hotel_Info.objects.all()
|
|
|
|
|
|
|
+ garden_list = GardenArea.objects.filter(hidden=True)
|
|
|
if con:
|
|
if con:
|
|
|
- hotel_list = Hotel_Info.objects.filter(name__contains=con)
|
|
|
|
|
- nums = hotel_list.count()
|
|
|
|
|
- hotel = hotel_list[(10*(page-1)):(page*10)]
|
|
|
|
|
- return render(request, 'outerNet/farmList.html', context={"nums":nums,"hotel":hotel,"page":page,"con":con})
|
|
|
|
|
|
|
+ garden_list = GardenArea.objects.filter(hidden=True,name__contains=con)
|
|
|
|
|
+ nums = garden_list.count()
|
|
|
|
|
+ garden_list = garden_list[(9*(page-1)):(page*9)]
|
|
|
|
|
+ return render(request, 'outerNet/farmList.html', context={"nums":nums,"garden_list":garden_list,"page":page,"con":con})
|
|
|
def post(self,request):
|
|
def post(self,request):
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
@@ -424,9 +428,11 @@ class Video_List(ListView):
|
|
|
class Video_Detail(ListView):
|
|
class Video_Detail(ListView):
|
|
|
def get(self,request):
|
|
def get(self,request):
|
|
|
v_id = request.GET.get("id")
|
|
v_id = request.GET.get("id")
|
|
|
- video = Video_data.objects.get(id=v_id)
|
|
|
|
|
v_name = request.GET.get("name")
|
|
v_name = request.GET.get("name")
|
|
|
|
|
+ if v_id:
|
|
|
|
|
+ video = Video_data.objects.get(id=v_id)
|
|
|
if v_name:
|
|
if v_name:
|
|
|
|
|
+ print("name",v_name)
|
|
|
video = Video_data.objects.get(title=v_name)
|
|
video = Video_data.objects.get(title=v_name)
|
|
|
return render(request, 'outerNet/videoDetail.html', context={"video":video})
|
|
return render(request, 'outerNet/videoDetail.html', context={"video":video})
|
|
|
def post(self,request):
|
|
def post(self,request):
|
|
@@ -1904,16 +1910,16 @@ class Farm_Check_List(ListView):
|
|
|
#删除
|
|
#删除
|
|
|
if req == "del":
|
|
if req == "del":
|
|
|
i = GardenArea.objects.get(id=art_id)
|
|
i = GardenArea.objects.get(id=art_id)
|
|
|
- ckobj = CKArticle.objects.get(title=i.name)
|
|
|
|
|
- ckobj.delete()
|
|
|
|
|
|
|
+ # ckobj = CKArticle.objects.get(title=i.name)
|
|
|
|
|
+ # ckobj.delete()
|
|
|
art_obj.delete()
|
|
art_obj.delete()
|
|
|
data = "1"
|
|
data = "1"
|
|
|
#审核通过
|
|
#审核通过
|
|
|
elif req == "check1":
|
|
elif req == "check1":
|
|
|
art_obj = GardenArea.objects.get(id=art_id)
|
|
art_obj = GardenArea.objects.get(id=art_id)
|
|
|
- ckobj = CKArticle.objects.get(title=art_obj.name)
|
|
|
|
|
- ckobj.hidden = True
|
|
|
|
|
- ckobj.save()
|
|
|
|
|
|
|
+ # ckobj = CKArticle.objects.get(title=art_obj.name)
|
|
|
|
|
+ # ckobj.hidden = True
|
|
|
|
|
+ # ckobj.save()
|
|
|
art_obj.hidden = True
|
|
art_obj.hidden = True
|
|
|
art_obj.save()
|
|
art_obj.save()
|
|
|
data = "1"
|
|
data = "1"
|
|
@@ -2073,6 +2079,19 @@ class CKArticle_View(ListView):
|
|
|
title = request.POST.get('title')
|
|
title = request.POST.get('title')
|
|
|
art_type = request.POST.get('art_type')
|
|
art_type = request.POST.get('art_type')
|
|
|
content = request.POST.get('content')
|
|
content = request.POST.get('content')
|
|
|
|
|
+ edit = request.POST.get('edit')
|
|
|
|
|
+ if edit == "1":
|
|
|
|
|
+ CKArticle.objects.filter(title=title).update(
|
|
|
|
|
+ art_type=art_type,
|
|
|
|
|
+ writer=writer,
|
|
|
|
|
+ intro=intro,
|
|
|
|
|
+ title=title,
|
|
|
|
|
+ content=content,
|
|
|
|
|
+ head_img=news_photo
|
|
|
|
|
+ )
|
|
|
|
|
+ return HttpResponse("1")
|
|
|
|
|
+ if CKArticle.objects.filter(title=title).exists():
|
|
|
|
|
+ return HttpResponse("2")
|
|
|
try:
|
|
try:
|
|
|
# CKArticle.objects.create(auther=current_user.username,art_type=art_type,writer=writer,intro=intro,title=title,content=content,head_img=news_photo)
|
|
# CKArticle.objects.create(auther=current_user.username,art_type=art_type,writer=writer,intro=intro,title=title,content=content,head_img=news_photo)
|
|
|
if art_type == "5":
|
|
if art_type == "5":
|
|
@@ -2219,7 +2238,7 @@ class Garden_Manage_View(ListView):
|
|
|
else:
|
|
else:
|
|
|
try:
|
|
try:
|
|
|
gardens=GardenArea.objects.get(id=gardenid)
|
|
gardens=GardenArea.objects.get(id=gardenid)
|
|
|
- if FarmList.objects.filter(name=name,user=current_user) :
|
|
|
|
|
|
|
+ if FarmList.objects.filter(name=name,user=current_user):
|
|
|
data = "0"
|
|
data = "0"
|
|
|
else:
|
|
else:
|
|
|
FarmList.objects.create(
|
|
FarmList.objects.create(
|
|
@@ -2757,7 +2776,7 @@ class CropCount_View(ListView):
|
|
|
time_now = int(timezone.now().strftime("%Y%m%d"))
|
|
time_now = int(timezone.now().strftime("%Y%m%d"))
|
|
|
data = time_now-time
|
|
data = time_now-time
|
|
|
print(data)
|
|
print(data)
|
|
|
- curro = ""
|
|
|
|
|
|
|
+ curro = ""
|
|
|
h2 = {"cropname":x.cropname,
|
|
h2 = {"cropname":x.cropname,
|
|
|
"area":x.area.name,
|
|
"area":x.area.name,
|
|
|
"crop_count":x.crop_count,
|
|
"crop_count":x.crop_count,
|
|
@@ -2766,7 +2785,7 @@ class CropCount_View(ListView):
|
|
|
"id":x.id,
|
|
"id":x.id,
|
|
|
"upl_time":x.upl_time.strftime('%Y-%m-%d'),
|
|
"upl_time":x.upl_time.strftime('%Y-%m-%d'),
|
|
|
"crop_img":x.crop_img,
|
|
"crop_img":x.crop_img,
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
dat.append({"data":h2,"curro":curro})
|
|
dat.append({"data":h2,"curro":curro})
|
|
|
nums = len(dat)
|
|
nums = len(dat)
|
|
|
dat = dat[(9*(page-1)):(page*9)]
|
|
dat = dat[(9*(page-1)):(page*9)]
|
|
@@ -3311,14 +3330,14 @@ class Person_Farm_Edit(ListView):
|
|
|
current_user = MyUser.objects.get(username=username)
|
|
current_user = MyUser.objects.get(username=username)
|
|
|
try:
|
|
try:
|
|
|
gar_area = GardenArea.objects.get(user=current_user)
|
|
gar_area = GardenArea.objects.get(user=current_user)
|
|
|
- data = {"name":gar_area.name,"manage":gar_area.manage,"mobile":gar_area.mobile,
|
|
|
|
|
- "area":gar_area.area,"location":gar_area.location,"addr":gar_area.addr,
|
|
|
|
|
|
|
+ data = {"id":current_user.id,"name":gar_area.name,"manage":gar_area.manage,"mobile":gar_area.mobile,
|
|
|
|
|
+ "area":gar_area.area,"location":gar_area.location,"location_2":gar_area.location_2,"addr":gar_area.addr,
|
|
|
"desc":gar_area.desc,"img":gar_area.img,"guide_img":gar_area.guide_img
|
|
"desc":gar_area.desc,"img":gar_area.img,"guide_img":gar_area.guide_img
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
print(e)
|
|
print(e)
|
|
|
- data = {"name":"","manage":"","mobile":"",
|
|
|
|
|
|
|
+ data = {"id":"","name":"","manage":"","mobile":"",
|
|
|
"area":"","location":"","addr":"",
|
|
"area":"","location":"","addr":"",
|
|
|
"desc":"","img":"","guide_img":""
|
|
"desc":"","img":"","guide_img":""
|
|
|
}
|
|
}
|
|
@@ -3348,7 +3367,9 @@ class Person_Area_Pub(ListView):
|
|
|
desc = request.POST.get('desc')
|
|
desc = request.POST.get('desc')
|
|
|
# 图片
|
|
# 图片
|
|
|
img = request.POST.get('img')
|
|
img = request.POST.get('img')
|
|
|
|
|
+ img_1 = request.POST.get('img_1')
|
|
|
location = request.POST.get('location')
|
|
location = request.POST.get('location')
|
|
|
|
|
+ location_2 = request.POST.get('location_2')
|
|
|
addr = request.POST.get('addr')
|
|
addr = request.POST.get('addr')
|
|
|
guide_img = request.POST.get('guide_img')
|
|
guide_img = request.POST.get('guide_img')
|
|
|
if GardenArea.objects.filter(user=user).exists():
|
|
if GardenArea.objects.filter(user=user).exists():
|
|
@@ -3361,8 +3382,10 @@ class Person_Area_Pub(ListView):
|
|
|
gar_obj.desc = desc
|
|
gar_obj.desc = desc
|
|
|
gar_obj.img = img
|
|
gar_obj.img = img
|
|
|
gar_obj.location = location
|
|
gar_obj.location = location
|
|
|
|
|
+ gar_obj.location_2 = location_2
|
|
|
gar_obj.addr = addr
|
|
gar_obj.addr = addr
|
|
|
gar_obj.guide_img = guide_img
|
|
gar_obj.guide_img = guide_img
|
|
|
|
|
+ gar_obj.img_1 = img_1
|
|
|
gar_obj.save()
|
|
gar_obj.save()
|
|
|
data = "1"
|
|
data = "1"
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
@@ -3371,7 +3394,7 @@ class Person_Area_Pub(ListView):
|
|
|
else:
|
|
else:
|
|
|
try:
|
|
try:
|
|
|
GardenArea.objects.create(user=user,name=name,manage=manage,mobile=mobile,
|
|
GardenArea.objects.create(user=user,name=name,manage=manage,mobile=mobile,
|
|
|
- area=area,desc=desc,img=img,guide_img=guide_img,
|
|
|
|
|
|
|
+ area=area,desc=desc,img=img,guide_img=guide_img,img_1=img_1,location_2=location_2,
|
|
|
location=location,addr=addr)
|
|
location=location,addr=addr)
|
|
|
data = "1"
|
|
data = "1"
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
@@ -3484,6 +3507,7 @@ class Area_Create(ListView):
|
|
|
currpage = request.GET.get('currpage')
|
|
currpage = request.GET.get('currpage')
|
|
|
uname = request.GET.get("uname")
|
|
uname = request.GET.get("uname")
|
|
|
f_name = request.GET.get("f_name")
|
|
f_name = request.GET.get("f_name")
|
|
|
|
|
+ c_id = request.GET.get("id")
|
|
|
user_obj = MyUser.objects.get(username=uname)
|
|
user_obj = MyUser.objects.get(username=uname)
|
|
|
try:
|
|
try:
|
|
|
curr_area = GardenArea.objects.get(user=user_obj)
|
|
curr_area = GardenArea.objects.get(user=user_obj)
|
|
@@ -3492,12 +3516,13 @@ class Area_Create(ListView):
|
|
|
print(e)
|
|
print(e)
|
|
|
curr_area = ""
|
|
curr_area = ""
|
|
|
# user_area = {"name":"","location":""}
|
|
# user_area = {"name":"","location":""}
|
|
|
- return render(request, 'backstageNet/systemSet/onlineSplit.html', context={"currpage":currpage,"uname":uname,"f_name":f_name,"curr_area":curr_area})
|
|
|
|
|
|
|
+ return render(request, 'backstageNet/systemSet/onlineSplit.html', context={"currpage":currpage,"uname":uname,"f_name":f_name,"curr_area":curr_area,"id":c_id})
|
|
|
def post(self,request):
|
|
def post(self,request):
|
|
|
uname = request.POST.get("uname")
|
|
uname = request.POST.get("uname")
|
|
|
name = request.POST.get("name")
|
|
name = request.POST.get("name")
|
|
|
area = request.POST.get("area")
|
|
area = request.POST.get("area")
|
|
|
location = request.POST.get("location")
|
|
location = request.POST.get("location")
|
|
|
|
|
+ location_2 = request.POST.get("location_2")
|
|
|
user_obj = MyUser.objects.get(username=uname)
|
|
user_obj = MyUser.objects.get(username=uname)
|
|
|
if GardenArea.objects.filter(user=user_obj).exists():
|
|
if GardenArea.objects.filter(user=user_obj).exists():
|
|
|
try:
|
|
try:
|
|
@@ -3505,6 +3530,7 @@ class Area_Create(ListView):
|
|
|
area_obj.name = name
|
|
area_obj.name = name
|
|
|
area_obj.area = area
|
|
area_obj.area = area
|
|
|
area_obj.location = location
|
|
area_obj.location = location
|
|
|
|
|
+ area_obj.location_2 = location_2
|
|
|
area_obj.upl_time = datetime.datetime.now()
|
|
area_obj.upl_time = datetime.datetime.now()
|
|
|
area_obj.save()
|
|
area_obj.save()
|
|
|
data = "1"
|
|
data = "1"
|
|
@@ -3513,7 +3539,7 @@ class Area_Create(ListView):
|
|
|
data = "0"
|
|
data = "0"
|
|
|
else:
|
|
else:
|
|
|
try:
|
|
try:
|
|
|
- GardenArea.objects.create(user=user_obj,name=name,area=area,location=location,upl_time=datetime.datetime.now())
|
|
|
|
|
|
|
+ GardenArea.objects.create(user=user_obj,name=name,area=area,location=location,location_2=location_2,upl_time=datetime.datetime.now())
|
|
|
data = "1"
|
|
data = "1"
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
print(e)
|
|
print(e)
|
|
@@ -3531,13 +3557,13 @@ class Area_Map(ListView):
|
|
|
all_area = []
|
|
all_area = []
|
|
|
area_list = GardenArea.objects.all().exclude(user=user_obj)
|
|
area_list = GardenArea.objects.all().exclude(user=user_obj)
|
|
|
for i in area_list:
|
|
for i in area_list:
|
|
|
- all_area.append({"name":i.name,"location":i.location})
|
|
|
|
|
|
|
+ all_area.append({"name":i.name,"location_2":i.location_2})
|
|
|
try:
|
|
try:
|
|
|
curr_area = GardenArea.objects.get(user=user_obj)
|
|
curr_area = GardenArea.objects.get(user=user_obj)
|
|
|
- user_area = {"name":curr_area.name,"location":curr_area.location}
|
|
|
|
|
|
|
+ user_area = {"name":curr_area.name,"location_2":curr_area.location_2}
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
print(e)
|
|
print(e)
|
|
|
- user_area = {"name":"","location":""}
|
|
|
|
|
|
|
+ user_area = {"name":"","location_2":""}
|
|
|
data = json.dumps({"all_area":all_area,"user_area":user_area})
|
|
data = json.dumps({"all_area":all_area,"user_area":user_area})
|
|
|
return HttpResponse(data)
|
|
return HttpResponse(data)
|
|
|
|
|
|
|
@@ -4573,4 +4599,65 @@ class QXZ_Data_Export(ListView):
|
|
|
|
|
|
|
|
|
|
|
|
|
def post(self,request):
|
|
def post(self,request):
|
|
|
- pass
|
|
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+# 系统管理上传图片
|
|
|
|
|
+class System_Photo(ListView):
|
|
|
|
|
+ def get(self,request):
|
|
|
|
|
+ return render(request, 'backstageNet/systemSet/imageUpload.html', context={})
|
|
|
|
|
+ def post(self,request):
|
|
|
|
|
+ upl_time = timezone.now()
|
|
|
|
|
+ basestr = request.FILES.get("upload")
|
|
|
|
|
+ basestr1 = request.FILES.get("upload1")
|
|
|
|
|
+ now_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
|
|
|
|
|
+ if basestr:
|
|
|
|
|
+ base_dir = 'media/uploads/'
|
|
|
|
|
+ img = Image.open(basestr)
|
|
|
|
|
+ code = 1
|
|
|
|
|
+ else:
|
|
|
|
|
+ base_dir = 'media/uploads1/'
|
|
|
|
|
+ code = 2
|
|
|
|
|
+ img = Image.open(basestr1)
|
|
|
|
|
+ if os.path.exists(base_dir) == False:
|
|
|
|
|
+ os.makedirs(base_dir)
|
|
|
|
|
+ img.save(base_dir + now_time +".png")
|
|
|
|
|
+ pic_list = SystemPhoto.objects.filter(code=code).order_by("upl_time")
|
|
|
|
|
+ if code == 1:
|
|
|
|
|
+ if len(pic_list) <= 2:
|
|
|
|
|
+ SystemPhoto.objects.create(code=code,pic_img=base_dir +now_time +".png")
|
|
|
|
|
+ else:
|
|
|
|
|
+ for i in pic_list[:1]:
|
|
|
|
|
+ i.pic_img=base_dir +now_time +".png"
|
|
|
|
|
+ i.upl_time=upl_time
|
|
|
|
|
+ i.save()
|
|
|
|
|
+ else:
|
|
|
|
|
+ if len(pic_list) <=3:
|
|
|
|
|
+ SystemPhoto.objects.create(code=code,pic_img=base_dir +now_time +".png")
|
|
|
|
|
+ else:
|
|
|
|
|
+ for i in pic_list[:1]:
|
|
|
|
|
+ i.pic_img=base_dir +now_time +".png"
|
|
|
|
|
+ i.upl_time=upl_time
|
|
|
|
|
+ i.save()
|
|
|
|
|
+ return HttpResponse("1")
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+# 系统管理上传图片
|
|
|
|
|
+class System_Photo_Save(ListView):
|
|
|
|
|
+ def post(self,request):
|
|
|
|
|
+ code = request.POST.get("code")
|
|
|
|
|
+ data = []
|
|
|
|
|
+ if code != "1" and code != "2":
|
|
|
|
|
+ return HttpResponse("0")
|
|
|
|
|
+ else:
|
|
|
|
|
+ pic_list = SystemPhoto.objects.filter(code=code)
|
|
|
|
|
+ for i in pic_list:
|
|
|
|
|
+ data.append({
|
|
|
|
|
+ "pic_img":i.pic_img
|
|
|
|
|
+ })
|
|
|
|
|
+ data = json.dumps(data)
|
|
|
|
|
+ return HttpResponse(data)
|
|
|
|
|
+
|