@@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.AssetManagementSystem; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
@@ -46,7 +47,8 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult FormView() { | |||
public ActionResult FormView() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
@@ -83,6 +85,10 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
var Ass_PurchaseApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseApplyEntity(keyValue); | |||
var Ass_PurchaseItemApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseItemApplyList(Ass_PurchaseApplyData.PAId); | |||
foreach (var item in Ass_PurchaseItemApplyData) | |||
{ | |||
item.PAAllAmount = item.PAIPrice * item.PAIAmount; | |||
} | |||
var jsonData = new | |||
{ | |||
Ass_PurchaseApply = Ass_PurchaseApplyData, | |||
@@ -100,6 +106,10 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
var Ass_PurchaseApplyData = ass_PurchaseApplyIBLL.GetEntityByProcessId(processId); | |||
var Ass_PurchaseItemApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseItemApplyList(Ass_PurchaseApplyData.PAId); | |||
foreach (var item in Ass_PurchaseItemApplyData) | |||
{ | |||
item.PAAllAmount = item.PAIPrice * item.PAIAmount; | |||
} | |||
var jsonData = new | |||
{ | |||
Ass_PurchaseApply = Ass_PurchaseApplyData, | |||
@@ -157,14 +167,14 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
entity.PStatus = 0; | |||
entity.PACreateTime = DateTime.Now; | |||
List<Ass_PurchaseItemApplyEntity> ass_PurchaseItemApplyList = strass_PurchaseItemApplyList.ToObject<List<Ass_PurchaseItemApplyEntity>>(); | |||
StringBuilder nameOfCollection=new StringBuilder(); | |||
StringBuilder nameOfCollection = new StringBuilder(); | |||
//将所有名字的名字集中到一个字段中, 方便查询 | |||
foreach (var item in ass_PurchaseItemApplyList) | |||
{ | |||
nameOfCollection.Append(item.PAIName); | |||
} | |||
entity.NameOfCollection = nameOfCollection.ToString(); | |||
ass_PurchaseApplyIBLL.SaveEntity(keyValue, entity, ass_PurchaseItemApplyList); | |||
return Success("保存成功!"); | |||
@@ -180,9 +190,9 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
/// <param name="pastatus">审核状态</param> | |||
/// <param name="processId">流程Id</param> | |||
/// <returns></returns> | |||
public ActionResult ModifyPAStatus(string keyValue, int pastatus,string processId) | |||
public ActionResult ModifyPAStatus(string keyValue, int pastatus, string processId) | |||
{ | |||
ass_PurchaseApplyIBLL.ModifyPAStatus(keyValue, pastatus,processId); | |||
ass_PurchaseApplyIBLL.ModifyPAStatus(keyValue, pastatus, processId); | |||
return Success("提交成功!"); | |||
} | |||
@@ -137,12 +137,13 @@ var bootstrap = function ($, learun) { | |||
label: '数量', name: 'PAIAmount', width: 100, align: 'left' | |||
}, | |||
{ | |||
label: '总价', name: 'PAIAmount', width: 100, align: 'left', formatter: function (val, row) { | |||
console.log(val); | |||
console.log(row); | |||
} | |||
}, | |||
label: '总价', name: 'PAAllAmount', width: 100, align: 'left' ,formatter:function(val,row) { | |||
if (!val) { | |||
return row.PAIPrice * row.PAIAmount; | |||
} else { | |||
return val; | |||
} | |||
} }, | |||
{ | |||
label: '要求', name: 'PAIRequest', width: 100, align: 'left' | |||
}, | |||
@@ -132,11 +132,7 @@ var bootstrap = function ($, learun) { | |||
label: '数量', name: 'PAIAmount', width: 100, align: 'left' | |||
}, | |||
{ | |||
label: '总价', name: 'PAIAmount', width: 100, align: 'left', formatter: function (val, row) { | |||
return row.PAIPrice * row.PAIAmount; | |||
} | |||
}, | |||
label: '总价', name: 'PAAllAmount', width: 100, align: 'left'}, | |||
{ | |||
label: '要求', name: 'PAIRequest', width: 100, align: 'left' | |||
@@ -275,7 +275,7 @@ var bootstrap = function ($, learun) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
param.PACreateUserId = learun.clientdata.get(['userinfo']).userId; | |||
//param.PACreateUserId = learun.clientdata.get(['userinfo']).userId; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -357,6 +357,10 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
db.Insert(ass_PurchaseItemEntity); | |||
} | |||
} | |||
else | |||
{ | |||
pastatus = 0; | |||
} | |||
//更新采购申请表的审核状态 | |||
var strsql = new StringBuilder(); | |||
strsql.Append("update Ass_PurchaseApply set PAStatus=@PAStatus,POpinion=@POpinion where PAProcessId=@PAProcessId"); | |||
@@ -84,6 +84,14 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
[Column("PAIUSE")] | |||
public string PAIUse { get; set; } | |||
/// <summary> | |||
/// 资产用途 | |||
/// </summary> | |||
[NotMapped] | |||
[Column("PAALLAMOUNT")] | |||
public decimal? PAAllAmount { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -294,84 +294,81 @@ namespace Learun.Workflow.Engine | |||
List<NWFNodeInfo> nextNodes = new List<NWFNodeInfo>(); | |||
// 找到与当前节点相连的线条 | |||
NWFLineInfo line = null; | |||
//如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 | |||
List<NWFLineInfo> lineList1 = new List<NWFLineInfo>(); | |||
if (overFW) | |||
{ | |||
line = wfScheme.lines.Last(); | |||
} | |||
else | |||
{ | |||
List<NWFLineInfo> listLine = new List<NWFLineInfo>(); | |||
listLine = wfScheme.lines.Where(a => a.from == nodeId).ToList(); | |||
if (listLine.Count > 1) | |||
var lastLine = wfScheme.lines.FirstOrDefault(a => !String.IsNullOrEmpty(a.iocName)); | |||
if (lastLine == null) | |||
{ | |||
line = wfScheme.lines.FirstOrDefault(a => a.from == nodeId && a.agreeList == code); | |||
lineList1.Add(wfScheme.lines.Last()); | |||
} | |||
else | |||
{ | |||
line = listLine.FirstOrDefault(); | |||
lineList1.Add(lastLine); | |||
} | |||
} | |||
bool isOk = false; | |||
if (string.IsNullOrEmpty(line.strategy) || line.strategy == "1") | |||
{ | |||
isOk = true; | |||
} | |||
else | |||
{ | |||
var codeList = line.agreeList.Split(','); | |||
foreach (string _code in codeList) | |||
{ | |||
if (_code == code) | |||
{ | |||
isOk = true; | |||
break; | |||
} | |||
} | |||
lineList1 = wfScheme.lines; | |||
} | |||
if (isOk) | |||
// 找到与当前节点相连的线条 | |||
foreach (var line in lineList1) | |||
{ | |||
if (nodesMap.ContainsKey(line.to)) | |||
if (line.from == nodeId || overFW) | |||
{ | |||
//如果lastNode 不为空,直接执行最后一条线的绑定方法 并终止任务 | |||
if (overFW) | |||
bool isOk = false; | |||
if (string.IsNullOrEmpty(line.strategy) || line.strategy == "1") | |||
{ | |||
nextNodes.Add(endNode); | |||
isOk = true; | |||
} | |||
else | |||
{ | |||
nextNodes.Add(nodesMap[line.to]); | |||
} | |||
switch (line.operationType) | |||
{// 绑定的操作类型 | |||
case "sql": // sql 语句 | |||
if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSql)) | |||
{ | |||
lineList.Add(line); | |||
} | |||
break; | |||
case "interface": // interface 接口 | |||
if (!string.IsNullOrEmpty(line.strInterface)) | |||
{ | |||
lineList.Add(line); | |||
} | |||
break; | |||
case "ioc": // 依赖注入 | |||
if (!string.IsNullOrEmpty(line.iocName)) | |||
var codeList = line.agreeList.Split(','); | |||
foreach (string _code in codeList) | |||
{ | |||
if (_code == code) | |||
{ | |||
lineList.Add(line); | |||
isOk = true; | |||
break; | |||
} | |||
break; | |||
} | |||
} | |||
if (isOk) | |||
{ | |||
if (nodesMap.ContainsKey(line.to)) | |||
{ | |||
nextNodes.Add(nodesMap[line.to]); | |||
switch (line.operationType) | |||
{// 绑定的操作类型 | |||
case "sql": // sql 语句 | |||
if (!string.IsNullOrEmpty(line.dbId) && !string.IsNullOrEmpty(line.strSql)) | |||
{ | |||
lineList.Add(line); | |||
} | |||
break; | |||
case "interface": // interface 接口 | |||
if (!string.IsNullOrEmpty(line.strInterface)) | |||
{ | |||
lineList.Add(line); | |||
} | |||
break; | |||
case "ioc": // 依赖注入 | |||
if (!string.IsNullOrEmpty(line.iocName)) | |||
{ | |||
lineList.Add(line); | |||
} | |||
break; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
return nextNodes; | |||
} | |||