浏览代码

固定资产登记管理

和田中职
ndbs 2 个月前
父节点
当前提交
fc94e7c633
共有 10 个文件被更改,包括 973 次插入0 次删除
  1. +117
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FixedAssetsController.cs
  2. +55
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Form.cshtml
  3. +55
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Form.js
  4. +65
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Index.cshtml
  5. +163
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Index.js
  6. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FixedAssetsMap.cs
  7. +125
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsBLL.cs
  8. +134
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsEntity.cs
  9. +48
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsIBLL.cs
  10. +182
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsService.cs

+ 117
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FixedAssetsController.cs 查看文件

@@ -0,0 +1,117 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public class FixedAssetsController : MvcControllerBase
{
private FixedAssetsIBLL fixedAssetsIBLL = new FixedAssetsBLL();

#region 视图功能

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Form()
{
return View();
}
#endregion

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = fixedAssetsIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var FixedAssetsData = fixedAssetsIBLL.GetFixedAssetsEntity( keyValue );
var jsonData = new {
FixedAssets = FixedAssetsData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
fixedAssetsIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="strEntity">实体</param>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
FixedAssetsEntity entity = strEntity.ToObject<FixedAssetsEntity>();
fixedAssetsIBLL.SaveEntity(keyValue,entity);
if (string.IsNullOrEmpty(keyValue))
{
}
return Success("保存成功!");
}
#endregion

}
}

+ 55
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Form.cshtml 查看文件

@@ -0,0 +1,55 @@
@{
ViewBag.Title = "固定资产登记管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">资产名称<font face="宋体">*</font></div>
<input id="AssetsName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">生产厂家<font face="宋体">*</font></div>
<input id="Manufacturer" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">品牌</div>
<input id="Brand" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">单位<font face="宋体">*</font></div>
<div id="Unit" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">数量<font face="宋体">*</font></div>
<input id="Nuantity" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">价值(元)</div>
<input id="Cost" type="text" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">存放地址</div>
<input id="Address" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">验收人<font face="宋体">*</font></div>
<div id="Acceptor" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">使用管理人<font face="宋体">*</font></div>
<div id="UsePeople" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">登记人<font face="宋体">*</font></div>
<div id="Registrant" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">使用状态</div>
<div id="Status"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="FixedAssets">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height:100px;"></textarea>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FixedAssets/Form.js")

+ 55
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Form.js 查看文件

@@ -0,0 +1,55 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2024-09-11 10:51
* 描 述:固定资产登记管理
*/
var acceptClick;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#Unit').lrDataItemSelect({ code: 'sldw', allowSearch: true });
$('#Acceptor').lrDataSourceSelect({ code: 'EmpInfo',value: 'empno',text: 'empname' });
$('#UsePeople').lrDataSourceSelect({ code: 'EmpInfo',value: 'empno',text: 'empname' });
$('#Registrant').lrDataSourceSelect({ code: 'EmpInfo',value: 'empno',text: 'empname' });
$('#Status').lrDataItemSelect({ code: 'NewAssState' });
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FixedAssets/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id ).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
}
});
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FixedAssets/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 65
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Index.cshtml 查看文件

@@ -0,0 +1,65 @@
@{
ViewBag.Title = "固定资产登记管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout " >
<div class="lr-layout-center">
<div class="lr-layout-wrap lr-layout-wrap-notitle ">
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<div id="multiple_condition_query">
<div class="lr-query-formcontent">
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">资产名称</div>
<input id="AssetsName" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">生产厂家</div>
<input id="Manufacturer" type="text" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">存放地址</div>
<input id="Address" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">品牌</div>
<input id="Brand" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">验收人</div>
<div id="Acceptor"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">使用管理人</div>
<div id="UsePeople"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">登记人</div>
<div id="Registrant"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">使用状态</div>
<div id="Status"></div>
</div>
</div>
</div>
</div>
</div>
<div class="lr-layout-tool-right">
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/FixedAssets/Index.js")

+ 163
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FixedAssets/Index.js 查看文件

@@ -0,0 +1,163 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2024-09-11 10:51
* 描 述:固定资产登记管理
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
$('#Acceptor').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
$('#UsePeople').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
$('#Status').lrDataItemSelect({ code: 'NewAssState' });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/Form',
width: 600,
height: 500,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/Form?keyValue=' + keyValue,
width: 600,
height: 500,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FixedAssets/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/FixedAssets/GetPageList',
headData: [
{ label: "资产名称", name: "AssetsName", width: 200, align: "left" },
{ label: "生产厂家", name: "Manufacturer", width: 120, align: "left" },
{ label: "品牌", name: "Brand", width: 120, align: "left" },
{
label: "单位", name: "Unit", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'sldw',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "数量", name: "Nuantity", width: 100, align: "left" },
{ label: "价值(元)", name: "Cost", width: 100, align: "left" },
{ label: "存放地址", name: "Address", width: 300, align: "left" },
{
label: "验收人", name: "Acceptor", width: 120, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
key: value,
keyId: 'empno',
callback: function (_data) {
callback(_data['empname']);
}
});
}
},
{
label: "使用管理人", name: "UsePeople", width: 120, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
key: value,
keyId: 'empno',
callback: function (_data) {
callback(_data['empname']);
}
});
}
},
{
label: "登记人", name: "Registrant", width: 120, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
key: value,
keyId: 'empno',
callback: function (_data) {
callback(_data['empname']);
}
});
}
},
{
label: "使用状态", name: "Status", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'NewAssState',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "备注", name: "Remark", width: 200, align: "left" },
],
mainId: 'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/FixedAssetsMap.cs 查看文件

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public class FixedAssetsMap : EntityTypeConfiguration<FixedAssetsEntity>
{
public FixedAssetsMap()
{
#region 表、主键
//表
this.ToTable("FIXEDASSETS");
//主键
this.HasKey(t => t.ID);
#endregion

#region 配置关系
#endregion
}
}
}


+ 125
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsBLL.cs 查看文件

@@ -0,0 +1,125 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public class FixedAssetsBLL : FixedAssetsIBLL
{
private FixedAssetsService fixedAssetsService = new FixedAssetsService();

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<FixedAssetsEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return fixedAssetsService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取FixedAssets表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public FixedAssetsEntity GetFixedAssetsEntity(string keyValue)
{
try
{
return fixedAssetsService.GetFixedAssetsEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
try
{
fixedAssetsService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
/// <returns></returns>
public void SaveEntity(string keyValue, FixedAssetsEntity entity)
{
try
{
fixedAssetsService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 134
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsEntity.cs 查看文件

@@ -0,0 +1,134 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public class FixedAssetsEntity
{
#region 实体成员
/// <summary>
/// ID
/// </summary>
[Column("ID")]
public string ID { get; set; }
/// <summary>
/// 资产名称
/// </summary>
[Column("ASSETSNAME")]
public string AssetsName { get; set; }
/// <summary>
/// 生产厂家
/// </summary>
[Column("MANUFACTURER")]
public string Manufacturer { get; set; }
/// <summary>
/// 品牌
/// </summary>
[Column("BRAND")]
public string Brand { get; set; }
/// <summary>
/// 单位
/// </summary>
[Column("UNIT")]
public string Unit { get; set; }
/// <summary>
/// 数量
/// </summary>
[Column("NUANTITY")]
public decimal? Nuantity { get; set; }
/// <summary>
/// 单价
/// </summary>
[Column("PRICE")]
public decimal? Price { get; set; }
/// <summary>
/// 价值(元)
/// </summary>
[Column("COST")]
public decimal? Cost { get; set; }
/// <summary>
/// 存放地址
/// </summary>
[Column("ADDRESS")]
public string Address { get; set; }
/// <summary>
/// 验收人
/// </summary>
[Column("ACCEPTOR")]
public string Acceptor { get; set; }
/// <summary>
/// 使用管理人
/// </summary>
[Column("USEPEOPLE")]
public string UsePeople { get; set; }
/// <summary>
/// 登记人
/// </summary>
[Column("REGISTRANT")]
public string Registrant { get; set; }
/// <summary>
/// 状态
/// </summary>
[Column("STATUS")]
public int? Status { get; set; }
/// <summary>
/// 备注
/// </summary>
[Column("REMARK")]
public string Remark { get; set; }
/// <summary>
/// 创建用户
/// </summary>
[Column("CREATEUSER")]
public string CreateUser { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 编辑时间
/// </summary>
[Column("MODIFYDATE")]
public DateTime? ModifyDate { get; set; }
/// <summary>
/// 编辑用户
/// </summary>
[Column("MODIFYUSER")]
public string ModifyUser { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.ID = Guid.NewGuid().ToString();
this.CreateTime = DateTime.Now;
this.CreateUser = LoginUserInfo.Get().userId;
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.ID = keyValue;
this.ModifyDate = DateTime.Now;
this.ModifyUser = LoginUserInfo.Get().userId;
}
#endregion
#region 扩展字段
#endregion
}
}


+ 48
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsIBLL.cs 查看文件

@@ -0,0 +1,48 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public interface FixedAssetsIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<FixedAssetsEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取FixedAssets表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
FixedAssetsEntity GetFixedAssetsEntity(string keyValue);
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
void DeleteEntity(string keyValue);
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, FixedAssetsEntity entity);
#endregion

}
}

+ 182
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FixedAssets/FixedAssetsService.cs 查看文件

@@ -0,0 +1,182 @@
using Dapper;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2024-09-11 10:51
/// 描 述:固定资产登记管理
/// </summary>
public class FixedAssetsService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<FixedAssetsEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT t.*");
strSql.Append(" FROM FixedAssets t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["AssetsName"].IsEmpty())
{
dp.Add("AssetsName", "%" + queryParam["AssetsName"].ToString() + "%", DbType.String);
strSql.Append(" AND t.AssetsName Like @AssetsName ");
}
if (!queryParam["Manufacturer"].IsEmpty())
{
dp.Add("Manufacturer", "%" + queryParam["Manufacturer"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Manufacturer Like @Manufacturer ");
}
if (!queryParam["Address"].IsEmpty())
{
dp.Add("Address", "%" + queryParam["Address"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Address Like @Address ");
}
if (!queryParam["Brand"].IsEmpty())
{
dp.Add("Brand", "%" + queryParam["Brand"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Brand Like @Brand ");
}
if (!queryParam["Acceptor"].IsEmpty())
{
dp.Add("Acceptor",queryParam["Acceptor"].ToString(), DbType.String);
strSql.Append(" AND t.Acceptor = @Acceptor ");
}
if (!queryParam["UsePeople"].IsEmpty())
{
dp.Add("UsePeople",queryParam["UsePeople"].ToString(), DbType.String);
strSql.Append(" AND t.UsePeople = @UsePeople ");
}
if (!queryParam["Registrant"].IsEmpty())
{
dp.Add("Registrant", queryParam["Registrant"].ToString(), DbType.String);
strSql.Append(" AND t.Registrant = @Registrant ");
}
if (!queryParam["Status"].IsEmpty())
{
dp.Add("Status",queryParam["Status"].ToString(), DbType.String);
strSql.Append(" AND t.Status = @Status ");
}
return this.BaseRepository("CollegeMIS").FindList<FixedAssetsEntity>(strSql.ToString(),dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取FixedAssets表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public FixedAssetsEntity GetFixedAssetsEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<FixedAssetsEntity>(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
try
{
this.BaseRepository("CollegeMIS").Delete<FixedAssetsEntity>(t=>t.ID == keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
public void SaveEntity(string keyValue, FixedAssetsEntity entity)
{
try
{
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
this.BaseRepository("CollegeMIS").Update(entity);
}
else
{
entity.Create();
this.BaseRepository("CollegeMIS").Insert(entity);
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}
}

正在加载...
取消
保存