yf_yzl před 2 roky
rodič
revize
fb9f89acf3

+ 1 - 1
smartfarming/views/counts_views.py

@@ -154,7 +154,7 @@ class PlanAreaAPIView(APIView):
                 )
                 plans.append(plantname) if plantname not in plans else None 
                 plan_area += round(float(landarea), 2)
-            return Response({"code": 0, "msg": "success", "data": {"lands_area": round(plan_area, 2), "plans_count": len(plans), "p_list": plan_land}})
+            return Response({"code": 0, "msg": "success", "data": {"lands_area": int(plan_area), "plans_count": len(plans), "p_list": plan_land}})
         except Exception as e:
             logger.error(e)
             return Response({"code": 0, "msg": "请检查数据"})

+ 1 - 0
smartfarming/views/home_land.py

@@ -325,6 +325,7 @@ class MongoGrowOperateAPIView(APIView):
             LandPlanInfo.objects.filter(id=pl_id).update(
                 plan_id=plan_id,
                 plan_time=plan_time,
+                recovery_kg=0,
                 status="采收"
             )
             return Response({"code": 0, "msg": "地块操作成功"})