@@ -39,10 +39,51 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 上报数据管理 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult IndexReport() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 上报数据管理 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormView() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
/// <summary> | /// <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 = fualityReportMainIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 判断是否可以上报 | /// 判断是否可以上报 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">项目Id</param> | /// <param name="keyValue">项目Id</param> | ||||
@@ -92,6 +133,19 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 提交 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult UpdateState(string keyValue, int Status) | |||||
{ | |||||
fualityReportChildIBLL.UpdateState(keyValue, Status); | |||||
return Success("操作成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -35,11 +35,11 @@ var bootstrap = function ($, learun) { | |||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue, function (data) { | $.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue, function (data) { | ||||
console.log(data); | |||||
$('#content').html(''); | $('#content').html(''); | ||||
for (var i = 0; i < data.length; i++) { | for (var i = 0; i < data.length; i++) { | ||||
var id = data[i].Id; | var id = data[i].Id; | ||||
arr.push({ Id: id, Value: data[i].Value, Sort: data[i].Sort }); | |||||
arr.push({ Id: id, Value: data[i].Value, Sort: data[i].Sort, ProjectId: data[i].ProjectId }); | |||||
var html = ''; | var html = ''; | ||||
html += '<div class="col-xs-6 lr-form-item">'; | html += '<div class="col-xs-6 lr-form-item">'; | ||||
html += '<div class="lr-form-item-title">计算项<font face="宋体">*</font></div>'; | html += '<div class="lr-form-item-title">计算项<font face="宋体">*</font></div>'; | ||||
@@ -0,0 +1,12 @@ | |||||
@{ | |||||
ViewBag.Title = "数据上报"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div id="content"></div> | |||||
<div class="col-xs-12 lr-form-item" style="color: red; margin-top: 20px;"> | |||||
<div class="lr-form-item-title">公式:</div> | |||||
<div id="result" style="margin-top: 5px;"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/FormView.js") |
@@ -0,0 +1,105 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2021-06-22 11:07 | |||||
* 描 述:数据上报 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
var ProjectName = request('ProjectName'); | |||||
var arr = []; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
//文本框失去焦点,计算结果 | |||||
$('#form').on('blur', | |||||
'.value', | |||||
function () { | |||||
var id = $(this)[0].id; | |||||
arr.forEach(m => { | |||||
if (m.Id == id) { | |||||
return m.Value = $('#' + id).val(); | |||||
} | |||||
}); | |||||
page.refreshRes(); | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/LR_Desktop/QualityReport/GetFormData?keyValue=' + keyValue, function (data) { | |||||
$('#content').html(''); | |||||
for (var i = 0; i < data.length; i++) { | |||||
var id = data[i].Id; | |||||
arr.push({ Id: id, Value: data[i].Value, Sort: data[i].Sort, ProjectId: data[i].ProjectId }); | |||||
var html = ''; | |||||
html += '<div class="col-xs-6 lr-form-item">'; | |||||
html += '<div class="lr-form-item-title">计算项<font face="宋体">*</font></div>'; | |||||
html += '<div id="pro' + id + '" readonly="readonly"></div>'; | |||||
html += '</div>'; | |||||
html += '<div class="col-xs-6 lr-form-item">'; | |||||
html += '<div class="lr-form-item-title">值<font face="宋体">*</font></div>'; | |||||
html += | |||||
'<input id="' + id + '" type="text" class="form-control value" isvalid="yes" checkexpession="NotNull" readonly="readonly"/>'; | |||||
//if (data[i].CalName.indexOf('文字描述') != -1) { | |||||
// html += | |||||
// '<input id="' + id + '" type="text" class="form-control value" isvalid="yes" checkexpession="NotNull" readonly="readonly"/>'; | |||||
//} else if (data[i].CalType != '变量') { | |||||
// html += | |||||
// '<input id="' + id + '" type="text" class="form-control value" isvalid="yes" checkexpession="NotNull" readonly="readonly"/>'; | |||||
//} else { | |||||
// html += | |||||
// '<input id="' + id + '" type="number" class="form-control value" isvalid="yes" checkexpession="NotNull" />'; | |||||
//} | |||||
html += '</div>'; | |||||
$('#content').append(html); | |||||
$('#' + id).val(data[i].Value); | |||||
//CalType CalName | |||||
$('#pro' + id).lrDataSourceSelect({ | |||||
code: 'CalculateProject', | |||||
value: 'id', | |||||
text: 'name' | |||||
}); | |||||
$('#pro' + id).lrselectSet(data[i].ProjectId); | |||||
} | |||||
page.refreshRes(); | |||||
}); | |||||
} | |||||
}, | |||||
refreshRes: function () { | |||||
//页面显示计算结果 | |||||
var text = ''; | |||||
arr.forEach(m => { | |||||
text += m.Value; | |||||
}); | |||||
$('#result').html(text); | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
console.log('save', arr); | |||||
//return; | |||||
var postData = { | |||||
list: arr //JSON.stringify($('body').lrGetFormData()) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/QualityReport/SaveList?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,5 +1,5 @@ | |||||
@{ | @{ | ||||
ViewBag.Title = "公式管理"; | |||||
ViewBag.Title = "数据上报"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | Layout = "~/Views/Shared/_Index.cshtml"; | ||||
} | } | ||||
<div class="lr-layout " > | <div class="lr-layout " > | ||||
@@ -11,8 +11,12 @@ | |||||
<div id="multiple_condition_query"> | <div id="multiple_condition_query"> | ||||
<div class="lr-query-formcontent"> | <div class="lr-query-formcontent"> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">名称</div> | |||||
<input id="Name" type="text" class="form-control" /> | |||||
<div class="lr-form-item-title">核心工作模块</div> | |||||
<input id="WorderModule" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">项目名称</div> | |||||
<input id="ProjectName" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -24,8 +28,8 @@ | |||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 填报</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 填报</a> | ||||
<a id="lr_view" class="btn btn-default"><i class="fa fa-plus"></i> 查看上报信息</a> | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-trash-o"></i> 提交</a> | |||||
@*<a id="lr_view" class="btn btn-default"><i class="fa fa-plus"></i> 查看上报信息</a> | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-trash-o"></i> 提交</a>*@ | |||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | <a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -2,7 +2,7 @@ | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | ||||
* 创建人:超级管理员 | * 创建人:超级管理员 | ||||
* 日 期:2021-06-22 11:07 | * 日 期:2021-06-22 11:07 | ||||
* 描 述:公式管理 | |||||
* 描 述:数据上报 | |||||
*/ | */ | ||||
var refreshGirdData; | var refreshGirdData; | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
@@ -142,7 +142,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
//param.State = 3; | |||||
param.State = 3; | |||||
//param.FillingPeople = learun.clientdata.get(['userinfo']).userId; | //param.FillingPeople = learun.clientdata.get(['userinfo']).userId; | ||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
@@ -0,0 +1,36 @@ | |||||
@{ | |||||
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-12 lr-form-item"> | |||||
<div class="lr-form-item-title">名称</div> | |||||
<input id="Name" type="text" class="form-control" /> | |||||
</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_view" class="btn btn-default"><i class="fa fa-plus"></i> 查看</a> | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-trash-o"></i> 提交</a> | |||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_Desktop/Views/QualityReport/IndexReport.js") |
@@ -0,0 +1,116 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2021-06-25 11:07 | |||||
* 描 述:上报数据管理 | |||||
*/ | |||||
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); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 查看 | |||||
$('#lr_view').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('fid'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '查看', | |||||
url: top.$.rootUrl + '/LR_Desktop/QualityReport/FormView?keyValue=' + keyValue, | |||||
width: 600, | |||||
height: 400, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
//提交 | |||||
$('#lr_submit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var Status = $('#gridtable').jfGridValue('Status'); | |||||
if (Status == 1) { | |||||
return learun.alert.warning('该项已提交!'); | |||||
} | |||||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/LR_Desktop/QualityReport/UpdateState', { keyValue: keyValue, Status: 1 }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 打印 | |||||
$('#lr_print').on('click', function () { | |||||
$('#gridtable').jqprintTable(); | |||||
}); | |||||
}, | |||||
// 初始化列表 | |||||
initGird: function () { | |||||
$('#gridtable').jfGrid({ | |||||
url: top.$.rootUrl + '/LR_Desktop/QualityReport/GetPageList', | |||||
headData: [ | |||||
{ label: "核心工作模块", name: "WorderModule", width: 300, align: "center" }, | |||||
{ label: "项目名称", name: "ProjectName", width: 300, align: "center" }, | |||||
{ | |||||
label: "填报部门", name: "FillingDept", width: 100, align: "center", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||||
key: value, | |||||
keyId: 'id', | |||||
callback: function (_data) { | |||||
callback(_data['name']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ | |||||
label: "填报人", name: "CreateUserName", width: 150, align: "center" | |||||
}, | |||||
{ | |||||
label: "公式计算结果", name: "Result", width: 150, align: "center" | |||||
}, | |||||
{ | |||||
label: "填报时间", name: "ReportTime", width: 150, align: "center" | |||||
}, | |||||
{ | |||||
label: "状态", name: "Status", width: 150, align: "center", | |||||
formatter: function (cellvalue) { | |||||
if (cellvalue === 0) { | |||||
return '<span class=\"label label-warning\">草稿</span>'; | |||||
} else if (cellvalue === 1) { | |||||
return '<span class=\"label label-success\">完成</span>'; | |||||
} | |||||
} | |||||
}, | |||||
], | |||||
mainId: 'Id', | |||||
isPage: true | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.State = 3; | |||||
//param.FillingPeople = learun.clientdata.get(['userinfo']).userId; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1295,7 +1295,9 @@ | |||||
<Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.js" /> | <Content Include="Areas\LR_Desktop\Views\DTSetting\PC\PcIndex.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.js" /> | <Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\MessageRind\Form.js" /> | <Content Include="Areas\LR_Desktop\Views\MessageRind\Form.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\FormView.js" /> | |||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\Form.js" /> | <Content Include="Areas\LR_Desktop\Views\QualityReport\Form.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\IndexReport.js" /> | |||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\Index.js" /> | <Content Include="Areas\LR_Desktop\Views\QualityReport\Index.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | <Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Form.js" /> | ||||
<Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | <Content Include="Areas\LR_Desktop\Views\WeChatDevelop\Index.js" /> | ||||
@@ -7353,6 +7355,8 @@ | |||||
<Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.cshtml" /> | <Content Include="Areas\LR_Desktop\Views\FormulaMain\FormChild.cshtml" /> | ||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\Index.cshtml" /> | <Content Include="Areas\LR_Desktop\Views\QualityReport\Index.cshtml" /> | ||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\Form.cshtml" /> | <Content Include="Areas\LR_Desktop\Views\QualityReport\Form.cshtml" /> | ||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\IndexReport.cshtml" /> | |||||
<Content Include="Areas\LR_Desktop\Views\QualityReport\FormView.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | ||||
@@ -189,6 +189,26 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
} | } | ||||
} | } | ||||
public void UpdateState(string keyValue, int Status) | |||||
{ | |||||
try | |||||
{ | |||||
qualityReportChildService.UpdateState(keyValue, Status); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } |
@@ -60,6 +60,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
/// <param name="list"></param> | /// <param name="list"></param> | ||||
void SaveList(string keyValue, List<QualityReportChildEntity> list); | void SaveList(string keyValue, List<QualityReportChildEntity> list); | ||||
/// <summary> | |||||
/// 提交 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="Status"></param> | |||||
void UpdateState(string keyValue, int Status); | |||||
#endregion | #endregion | ||||
@@ -282,9 +282,11 @@ where a.Id='{keyValue}' order by b.Sort"; | |||||
{ | { | ||||
if (!string.IsNullOrEmpty(keyValue)) | if (!string.IsNullOrEmpty(keyValue)) | ||||
{ | { | ||||
var mainId = ""; | |||||
list = list.OrderBy(x => x.Sort).ToList(); | list = list.OrderBy(x => x.Sort).ToList(); | ||||
var projectIds = list.Select(x => x.ProjectId).ToList(); | var projectIds = list.Select(x => x.ProjectId).ToList(); | ||||
var gs = ""; | var gs = ""; | ||||
var result = ""; | |||||
var calculateProjectList = db.FindList<CalculateProjectEntity>(x => projectIds.Contains(x.Id)); | var calculateProjectList = db.FindList<CalculateProjectEntity>(x => projectIds.Contains(x.Id)); | ||||
foreach (var entity in list) | foreach (var entity in list) | ||||
{ | { | ||||
@@ -292,15 +294,14 @@ where a.Id='{keyValue}' order by b.Sort"; | |||||
model = db.FindEntity<QualityReportChildEntity>(x => x.Id == entity.Id); | model = db.FindEntity<QualityReportChildEntity>(x => x.Id == entity.Id); | ||||
model.Value = entity.Value; | model.Value = entity.Value; | ||||
db.Update(model); | db.Update(model); | ||||
mainId = model.MainId; | |||||
//保存运算结果 | |||||
//计算项目 | //计算项目 | ||||
var calculateProject = calculateProjectList.Where(x => x.Id == entity.ProjectId).FirstOrDefault(); | var calculateProject = calculateProjectList.Where(x => x.Id == entity.ProjectId).FirstOrDefault(); | ||||
if (calculateProject.Name.Contains("文字描述")) | |||||
if (calculateProject.Type == "变量") | |||||
{ | { | ||||
gs += entity.Value; | |||||
}else if (calculateProject.Type == "变量") | |||||
{ | |||||
var value=ToDecimal(entity.Value); | |||||
var value = ToDecimal(entity.Value); | |||||
if (value == 0) | if (value == 0) | ||||
{ | { | ||||
gs += entity.Value; | gs += entity.Value; | ||||
@@ -309,12 +310,42 @@ where a.Id='{keyValue}' order by b.Sort"; | |||||
{ | { | ||||
gs += value; | gs += value; | ||||
} | } | ||||
//select convert(varchar,convert(decimal(18,0),(1/5)*100))+'%' as LT5 | |||||
} | } | ||||
else | |||||
{ | |||||
gs += entity.Value; | |||||
} | |||||
} | |||||
if (!string.IsNullOrEmpty(mainId)) | |||||
{ | |||||
//公式运算结果 | |||||
if (list.Count == 1) | |||||
{ | |||||
result = list.FirstOrDefault().Value; | |||||
} | |||||
else | |||||
{ | |||||
gs = gs.Replace("(", "(").Replace(")", ")"); | |||||
if (gs.Contains("%")) | |||||
{ | |||||
gs = gs.Replace("%", ""); | |||||
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}))+'%' as num "); | |||||
result = dt.Rows[0][0].ToString(); | |||||
} | |||||
else | |||||
{ | |||||
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs})) as num "); | |||||
result = dt.Rows[0][0].ToString(); | |||||
} | |||||
} | |||||
QualityReportMainEntity main = db.FindEntity<QualityReportMainEntity>(x => x.Id == mainId); | |||||
main.Result = result; | |||||
db.Update(main); | |||||
} | } | ||||
//公式运算结果 | |||||
} | } | ||||
db.Commit(); | db.Commit(); | ||||
} | } | ||||
@@ -332,6 +363,29 @@ where a.Id='{keyValue}' order by b.Sort"; | |||||
} | } | ||||
} | } | ||||
public void UpdateState(string keyValue, int Status) | |||||
{ | |||||
try | |||||
{ | |||||
string sql = $"update QualityReportMain set [Status]='{Status}' where Id='{keyValue}'"; | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
/// <summary> | /// <summary> | ||||
/// | /// | ||||
@@ -341,7 +395,7 @@ where a.Id='{keyValue}' order by b.Sort"; | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return decimal.Round(Convert.ToDecimal(value),2); | |||||
return Convert.ToDecimal(Convert.ToDecimal(value).ToString("f2")); | |||||
} | } | ||||
catch | catch | ||||
{ | { | ||||
@@ -79,6 +79,26 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
/// <summary> | |||||
/// 核心模块 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string WorderModule { get; set; } | |||||
/// <summary> | |||||
/// 项目名称 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string ProjectName { get; set; } | |||||
/// <summary> | |||||
/// 部门 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string FillingDept { get; set; } | |||||
/// <summary> | |||||
/// 项目表Id | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string fid { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |
@@ -30,12 +30,9 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||||
try | try | ||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" | |||||
t.Id, | |||||
t.FillinFromId | |||||
"); | |||||
strSql.Append(" FROM QualityReportMain t "); | |||||
strSql.Append(@"select b.WorderModule,b.ProjectName,b.FillingDept,b.Id as fid,a.Id,a.ReportTime,a.Status,a.Result,a.CreateUserName from QualityReportMain a join FillinFrom b on a.FillinFromId=b.Id | |||||
"); | |||||
strSql.Append(" WHERE 1=1 "); | strSql.Append(" WHERE 1=1 "); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
// 虚拟参数 | // 虚拟参数 | ||||