专业技术开发,收藏关注不迷路
一、项目介绍
随着科技与人民生活水平的不断提高,电子商务改变了人们的传统经济活动中的交易方式和流通技术,这也间接带动了物流快递行业的高速发展。复杂的物流快递信息需要有效的进行处理,构建一个快递管理服务系统可以确保物流信息的一致性、提升业务处理能力、提升客户的体验效果。构建管理系统可以使原先独立的各个物流环节能有效的整合在一起,满足了不断发展的物流服务要求,使物流管理的自动化高效化得以实现。现代物流只有在信息系统的支持下,才能实现物流网络四通八达规模效益日益显现,物流成本下降。
二、开发环境
开发软件:VS 2017 (版本2017以上即可,不能低于2017)
数据库:SqlServer2008r2(数据库版本无限制,都可以导入)
开发模式:mvc
浏览器:谷歌浏览器
三、功能介绍
基于B/S架构开发使用INTELLIJ IDEA软件和MySQL数据库 服务器Tomcat构建一个管理系统。
具体实现5个功能:
(1)员工登录:通过用户名和密码登录。
(2)员工管理:添加、删除、修改用户。
(3)业务管理:物流订单查询、物流状态管理。
(4)服务管理:快件派送、退改。
(5)注销用户、退出系统。
四、核心代码
部分代码:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
using Newtonsoft.Json;
using Xiezn.Core.Business.Services;
using Xiezn.Core.Common.Helpers;
using Xiezn.Core.Models.ViewModel;
namespace Xiezn.Core.Controllers
{
/// <summary>
/// 公共接口
/// </summary>
[Route("[action]")]
public class CommonController : Controller
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly string _savePath;
private readonly CommonService _bll;
private readonly ConfigService _configBLL;
/// <summary>
/// 构造函数
/// </summary>
public CommonController(IHostingEnvironment hostingEnvironment)
{
_hostingEnvironment = hostingEnvironment;
_savePath = _hostingEnvironment.WebRootPath + Path.DirectorySeparatorChar + ConfigHelper.GetConfig("SchemaName") + Path.DirectorySeparatorChar + "upload" + Path.DirectorySeparatorChar;
_bll = new CommonService();
_configBLL = new ConfigService();
}
/// <summary>
/// 获取某表的某个字段列表接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Option(string tableName, string columnName)
{
try
{
int level = Convert.ToInt32(HttpContext.Request.Query["level"]);
string parent = HttpContext.Request.Query["parent"];
string conditionColumn = HttpContext.Request.Query["conditionColumn"];
string conditionValue = HttpContext.Request.Query["conditionValue"];
if (!string.IsNullOrEmpty(conditionColumn) && !string.IsNullOrEmpty(conditionValue))
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "option", 0, 0, " AND " + conditionColumn + " = '" + conditionValue + "' ") });
}
if (level == 0)
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, parent, level) });
}
else
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName) });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 根据option字段值获取某表的单行记录接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <param name="columnValue">列值</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Follow(string tableName, string columnName, string columnValue)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, columnValue, 0, "follow") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 根据主键id修改table表的sfsh状态接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="id">主键id</param>
/// <param name="sfsh">当前审核状态(是/否)</param>
/// <returns></returns>
[HttpPost("{tableName}")]
[Authorize(Roles = "Admin,Client")]
public JsonResult Sh(string tableName, int id, string sfsh)
{
try
{
if (_bll.Common(tableName, id.ToString(), sfsh, 0, "sh") > 0)
{
return Json(new { Code = 0, Msg = "更新成功!" });
}
return Json(new { Code = -1, Msg = "更新失败!" });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 获取需要提醒的记录数接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <param name="type">类型(1表示数字比较提醒,2表示日期比较提醒)</param>
/// <param name="remindStart">remindStart小于等于columnName满足条件提醒,当比较日期时,该值表示天数</param>
/// <param name="remindEnd">columnName小于等于remindEnd 满足条件提醒,当比较日期时,该值表示天数</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}/{type}")]
public JsonResult Remind(string tableName, string columnName, int type, int remindStart, int remindEnd)
{
try
{
return Json(new { Code = 0, Count = _bll.Common(tableName, columnName, "", type, "remind", remindStart, remindEnd) });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 计算规则接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Cal(string tableName, string columnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "cal") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 人脸比较
/// </summary>
/// <param name="face1">图片1名称</param>
/// <param name="face2">图片2名称</param>
/// <returns></returns>
[HttpGet]
public JsonResult MatchFace(string face1, string face2)
{
try
{
BaiduAiHelper.clientId = _configBLL.GetValueByName("APIKey");
BaiduAiHelper.clientSecret = _configBLL.GetValueByName("SecretKey");
BaiduAiHelper.GetAccessToken();
List<FaceMatchViewModel> matchInfo = new List<FaceMatchViewModel>
{
new FaceMatchViewModel { image = FuncHelper.ImageToBase64(_savePath + face1) },
new FaceMatchViewModel { image = FuncHelper.ImageToBase64(_savePath + face2) }
};
string result = BaiduAiHelper.FaceMatch(JsonConvert.SerializeObject(matchInfo));
dynamic resObj = JsonConvert.DeserializeObject(result);
if (resObj.error_code == 0)
{
return Json(new { Code = 0, Score = resObj.result.score, Msg = "匹配成功!" });
}
else
{
return Json(new { Code = -1, Score = 0, Msg = "匹配失败!" });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 定位接口(根据经纬度坐标获取到省市县(区)信息)
/// </summary>
/// <param name="lat">经度</param>
/// <param name="lng">纬度</param>
/// <returns></returns>
[HttpGet]
public JsonResult Location(double lat, double lng)
{
try
{
AddressViewModel addressViewModel = BaiduAiHelper.GetAddress(_configBLL.GetValueByName("baidu_ditu_ak"), lng, lat);
if (addressViewModel == null)
{
return Json(new { Code = -1, Msg = "位置信息获取失败!" });
}
else
{
return Json(new { Code = 0, Data = addressViewModel });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 类别统计接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Group(string tableName, string columnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "group") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 按值统计接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="xColumnName">列名</param>
/// <param name="yColumnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{xColumnName}/{yColumnName}")]
public JsonResult Value(string tableName, string xColumnName, string yColumnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, xColumnName, yColumnName, 0, "value") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 按时间统计类型接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="xColumnName">列名</param>
/// <param name="yColumnName">列名</param>
/// <param name="timeStatType">类型</param>
/// <returns></returns>
[HttpGet("{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")]
public JsonResult Value(string tableName, string xColumnName, string yColumnName, string timeStatType)
{
try
{
return Json(new { Code = 0, Data = _bll.StatDate(tableName, xColumnName, yColumnName, timeStatType) });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
}
}
五、效果图
六、文章目录
目 录
第一章 绪 论 1
1.1背景及意义 1
1.2国内外研究概况 2
1.3 研究的内容 2
第二章 关键技术的研究 3
2.1 相关技术 3
2.2 net技术 3
2.3 vs 开发环境 4
2.5 mvc框架 5
第三章 系统分析 5
3.1 系统设计目标 6
3.2 系统可行性分析 6
3.3 系统功能分析和描述 7
3.4系统UML用例分析 8
3.4.1管理员用例 9
3.4.2用户用例 9
3.5系统流程分析 10
3.5.1添加信息流程 11
3.5.2操作流程 12
3.5.3删除信息流程 13
第四章 系统设计 14
4.1 系统体系结构 15
4.2 数据库设计原则 16
4.3 数据表 17
第五章 系统实现 18
5.1用户功能模块 18
5.2管理员功能模块 19
5.3商家用户功能模块 19
5.4前台系统首页功能模块 19
第六章 系统测试 20
6.1测试定义及目的 21
6.2性能测试 22
6.3测试模块 23
6.4测试结果 24
总 结 25
致 谢 27
参考文献 53