소스 검색

调整公式计算

金隅分支
zhangli 3 년 전
부모
커밋
28c9087199
8개의 변경된 파일35개의 추가작업 그리고 17개의 파일을 삭제
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs
  2. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js
  3. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js
  4. +11
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js
  5. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs
  6. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs
  7. +14
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs
  8. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs 파일 보기

@@ -158,9 +158,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[AjaxOnly] [AjaxOnly]
public ActionResult GetFormData(string keyValue)
public ActionResult GetFormData(string keyValue,string mainId)
{ {
var ReportData = fualityReportChildIBLL.GetListByFillId(keyValue);
var ReportData = fualityReportChildIBLL.GetListByFillId(keyValue, mainId);


return Success(ReportData); return Success(ReportData);
} }


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/Form.js 파일 보기

@@ -6,6 +6,7 @@
*/ */
var acceptClick; var acceptClick;
var keyValue = request('keyValue'); var keyValue = request('keyValue');
var mainId = request('mainId');
var ProjectName = request('ProjectName'); var ProjectName = request('ProjectName');
var arr = []; var arr = [];
var bootstrap = function ($, learun) { var bootstrap = function ($, learun) {
@@ -32,7 +33,7 @@ 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 + '&mainId=' + mainId, function (data) {


$('#content').html(''); $('#content').html('');
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/FormView.js 파일 보기

@@ -6,6 +6,7 @@
*/ */
var acceptClick; var acceptClick;
var keyValue = request('keyValue'); var keyValue = request('keyValue');
var mainId = request('mainId');
var ProjectName = request('ProjectName'); var ProjectName = request('ProjectName');
var arr = []; var arr = [];
var bootstrap = function ($, learun) { var bootstrap = function ($, learun) {
@@ -34,7 +35,7 @@ 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 + '&mainId=' + mainId, function (data) {
$('#content').html(''); $('#content').html('');
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {


+ 11
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js 파일 보기

@@ -22,15 +22,20 @@ var bootstrap = function ($, learun) {
$('#lr_refresh').on('click', function () { $('#lr_refresh').on('click', function () {
location.reload(); location.reload();
}); });
// 编辑 // 编辑
$('#lr_edit').on('click', function () { $('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('fid'); var keyValue = $('#gridtable').jfGridValue('fid');
var mainId = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) { if (learun.checkrow(keyValue)) {
var Status = $('#gridtable').jfGridValue('Status');
if (Status == 1) {
return learun.alert.warning('该项已提交,不可编辑!');
}
learun.layerForm({ learun.layerForm({
id: 'form', id: 'form',
title: '编辑', title: '编辑',
url: top.$.rootUrl + '/LR_Desktop/QualityReport/Form?keyValue=' + keyValue,
url: top.$.rootUrl + '/LR_Desktop/QualityReport/Form?keyValue=' + keyValue + '&mainId=' + mainId,
width: 600, width: 600,
height: 400, height: 400,
callBack: function (id) { callBack: function (id) {
@@ -42,11 +47,12 @@ var bootstrap = function ($, learun) {
// 查看 // 查看
$('#lr_view').on('click', function () { $('#lr_view').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('fid'); var keyValue = $('#gridtable').jfGridValue('fid');
var mainId = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) { if (learun.checkrow(keyValue)) {
learun.layerForm({ learun.layerForm({
id: 'form', id: 'form',
title: '查看', title: '查看',
url: top.$.rootUrl + '/LR_Desktop/QualityReport/FormView?keyValue=' + keyValue,
url: top.$.rootUrl + '/LR_Desktop/QualityReport/FormView?keyValue=' + keyValue + '&mainId=' + mainId,
width: 600, width: 600,
height: 400, height: 400,
btn: null btn: null
@@ -71,7 +77,7 @@ var bootstrap = function ($, learun) {
}); });
} }
}); });
//撤回 //撤回
$('#lr_nosubmit').on('click', function () { $('#lr_nosubmit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id'); var keyValue = $('#gridtable').jfGridValue('Id');
@@ -106,7 +112,7 @@ var bootstrap = function ($, learun) {
}); });
} }
}); });
// 打印 // 打印
$('#lr_print').on('click', function () { $('#lr_print').on('click', function () {
$('#gridtable').jqprintTable(); $('#gridtable').jqprintTable();


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildBLL.cs 파일 보기

@@ -49,11 +49,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// </summary> /// </summary>
/// <param name="keyValue">项目Id</param> /// <param name="keyValue">项目Id</param>
/// <returns></returns> /// <returns></returns>
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue)
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue, string mainId)
{ {
try try
{ {
return qualityReportChildService.GetListByFillId(keyValue);
return qualityReportChildService.GetListByFillId(keyValue, mainId);
} }
catch (Exception ex) catch (Exception ex)
{ {


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildIBLL.cs 파일 보기

@@ -26,7 +26,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// </summary> /// </summary>
/// <param name="keyValue"></param> /// <param name="keyValue"></param>
/// <returns></returns> /// <returns></returns>
IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue);
IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue, string mainId);
/// <summary> /// <summary>
/// 获取QualityReportChild表实体数据 /// 获取QualityReportChild表实体数据
/// </summary> /// </summary>


+ 14
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportChild/QualityReportChildService.cs 파일 보기

@@ -62,7 +62,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// </summary> /// </summary>
/// <param name="keyValue">项目Id</param> /// <param name="keyValue">项目Id</param>
/// <returns></returns> /// <returns></returns>
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue)
public IEnumerable<QualityReportChildEntity> GetListByFillId(string keyValue, string mainId)
{ {
try try
{ {
@@ -70,7 +70,17 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
var strSql = new StringBuilder(); var strSql = new StringBuilder();
strSql.Append(@" select t.*,c.[type] as CalType,c.Name as CalName from QualityReportChild t join QualityReportMain m on t.Mainid=m.id strSql.Append(@" select t.*,c.[type] as CalType,c.Name as CalName from QualityReportChild t join QualityReportMain m on t.Mainid=m.id
join QualityReportMain a on t.MainId = a.Id join CalculateProject c on t.ProjectId=c.id "); join QualityReportMain a on t.MainId = a.Id join CalculateProject c on t.ProjectId=c.id ");
strSql.Append($"  WHERE 1=1 and a.FillinFromId='{keyValue}' and year(m.ReportTime)=year(getdate()) and month(m.ReportTime)='{month}'");
strSql.Append($"  WHERE 1=1 and a.FillinFromId='{keyValue}' ");

if (!string.IsNullOrEmpty(mainId))
{
strSql.Append($" and t.MainId='{mainId}'");
}
else
{
strSql.Append($" and year(m.ReportTime)=year(getdate()) and month(m.ReportTime)='{month}'");
}

strSql.Append(" order by t.Sort "); strSql.Append(" order by t.Sort ");
// 虚拟参数 // 虚拟参数
var dp = new DynamicParameters(new { }); var dp = new DynamicParameters(new { });
@@ -341,7 +351,7 @@ where a.Id='{keyValue}' order by b.Sort";
else else
{ {
gs = gs.Replace("(", "(").Replace(")", ")"); gs = gs.Replace("(", "(").Replace(")", ")");
if (gs.Contains("%"))
if (gs.Contains("*100%"))
{ {
gs = gs.Replace("%", ""); gs = gs.Replace("%", "");
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}))+'%' as num "); var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs}))+'%' as num ");
@@ -349,7 +359,7 @@ where a.Id='{keyValue}' order by b.Sort";
} }
else else
{ {
var dt = db.FindTable($"select convert(varchar,convert(decimal(18,0),{gs})) as num ");
var dt = db.FindTable($"select convert(decimal(18,2),{gs}) as num ");
result = dt.Rows[0][0].ToString(); result = dt.Rows[0][0].ToString();
} }
} }


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs 파일 보기

@@ -33,7 +33,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
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(@"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 and b.[State]=2 and b.IsFlag=0");
var queryParam = queryJson.ToJObject(); var queryParam = queryJson.ToJObject();
// 虚拟参数 // 虚拟参数
var dp = new DynamicParameters(new { }); var dp = new DynamicParameters(new { });


불러오는 중...
취소
저장