基于百度地图实现产品销售的单位位置查看功能设计与实现

网友投稿 206 2023-07-02


基于百度地图实现产品销售的单位位置查看功能设计与实现

1.描述

本人最近参与基于MVC5+EF6+ Bootstrap3的食品安全监管系统设计、开发。先前感觉百度地图很神秘的样子、高大上的样子,设计、开发过程遇到些问题,经查看园子高手指点、示例摸索实践,终将百度地图嵌入系统。为感谢各位朋友的帮助,今有空,将基于百度地图实现产品销售的单位位置查看功能,分享给大家。不当之处,欢迎指正。

2.产品生产批次查询

查看单位产品生产批次信息,根据产品生产批次查看,产品销售单位情况。

效果图如下:

3.产品销售地图

根据选择的产品生产批次信息,查询统计产品销售到哪些省市,省市有多少家单位,根据单位地址,使用百度地图显示单位所在省市位置。

效果图如下:

4.产品销售地图View代码

@{

ViewBag.Title = "Index";

Layout = "~/Views/Shared/_TableLayout.cshtml";

}

@*工具栏*@

@section actionBar{

 

 

}

@section CustomContent

{

enctype="multipart/form-data">

产品生产信息

销售地图

省市

市区

单位家数

}

@section customScript

{

}

5.产品销售地图 Controler 代码

#region 销售地图

public ActionResult IndexMap(Guid ProductId, Guid BatchId)

{

try

{

List list = _IProductBatchs.GetEntityList(t => t.IsDelete == false && t.ProductID == ProductId);

ProductBatchViewModel mViewModel = null;

string mPrevId = string.Empty, mNextId = string.Empty;

//读取当前抽检任务及上、下抽检任务标识。

for (int index = 0; index < list.Count; index++)

{

if (list[index].Id == BatchId)

{

mViewModel = list[index];

if (list.Count > index + 1)

mNextId = list[index + 1].Id.ToString();

break;

}

mPrevId = list[index].Id.ToString();

}

if (mViewModel == null)

{

return this.ResultError("产品生产信息不能为空!");

}

//ReturnResult mReturn = _IProductBatchSup.GetBAreaStatistics(ProductId, BatchId);

//if (mReturn.State == false)

// return this.ResultError(mReturn.Message);

//mViewModel.PBatchBArea = (ICollection)mReturn.Result;

ViewBag.bCreate = 0;

ViewBag.ProductId = ProductId;

ViewBag.PrevId = mPrevId;

ViewBag.NextId = mNextId;

ViewBag.ViewModel = mViewModel.ToViewModel();

return View("_IndexMap");

}

catch (Exception e)

{

return this.ResultError(e.Message);

}

}

[Import(typeof(IProductBatchSup))]

public IProductBatchSup _IProductBatchSup;

public ActionResult GetBAreaStatistics(Guid ProductId, Guid BatchId)

{

try

{

ReturnResult mReturn = _IProductBatchSup.GetBAreaStatistics(ProductId,BatchId);

if (mReturn.State == false)

return this.ResultError(mReturn.Message);

return JsonNetResult.toDataTable(mReturn.Result);

}

catch (Exception e)

{

return this.ResultError(e.Message);

}

}

public ActionResult GetBEnterStatistics(Guid ProductId, Guid BatchId,string ProvinceName, string CityName)

{

try

{

ReturnResult mReturn = _IProductBatchSup.GetBEnterStatistics(ProductId, BatchId,ProvinceName,CityName);

if (mReturn.State == false)

return this.ResultError(mReturn.Message);

return JsonNetResult.toDataTable(mReturn.Result);

}

catch (Exception e)

{

return this.ResultError(e.Message);

}

}

#endregion

以上所述是给大家介绍的基于百度地图实现产品销售的单位位置查看功能设计与实现,希望对大家有所帮助,如果大家有任何疑问请给我留言,会及时回复大家的。在此也非常感谢大家对我们网站的支持!


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:bootstrap table小案例
下一篇:微信企业号验证/发送/接收消息
相关文章

 发表评论

暂时没有评论,来抢沙发吧~