Commit 2bc0e534 authored by liudong1993's avatar liudong1993

资产管理 耗材申请时间管理

parent ccd0ff30
......@@ -30,6 +30,10 @@ namespace Property.Model.Entity
set;
}
/// <summary>
/// 启用 1是 2否
/// </summary>
public int? Enabled { get; set; }
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public int? Status
......
......@@ -12,6 +12,10 @@ namespace Property.Model.Extend
[DB(ConnectionName = "PropertyConnection")]
public class RB_Property_UseReceive_Extend : RB_Property_UseReceive
{
/// <summary>
/// 是否是申请人签名 1是 其他否
/// </summary>
public int? IsApplyForSign { get; set; }
/// <summary>
/// 数量
/// </summary>
......
......@@ -11,6 +11,9 @@ namespace Property.Model.Extend
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_ApplyforSpecial_Extend : RB_Supplies_ApplyforSpecial
{
/// <summary>
/// 设置申请ids
/// </summary>
public string ApplyforIds { get; set; }
}
}
\ No newline at end of file
......@@ -11,6 +11,9 @@ namespace Property.Model.Extend
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_ApplyforWeekday_Extend : RB_Supplies_ApplyforWeekday
{
/// <summary>
/// 设置ids
/// </summary>
public string ApplyforIds { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using Property.Model.Entity;
using REBORN.Common.AOP;
......@@ -11,6 +12,13 @@ namespace Property.Model.Extend
[DB(ConnectionName = "PropertyConnection")]
public class RB_Supplies_Applyfor_Extend : RB_Supplies_Applyfor
{
/// <summary>
/// 耗材申请工作日
/// </summary>
public List<RB_Supplies_ApplyforWeekday_Extend> WeekdayList { get; set; }
/// <summary>
/// 特殊日期
/// </summary>
public List<RB_Supplies_ApplyforSpecial_Extend> SpecialList { get; set; }
}
}
\ No newline at end of file
......@@ -985,6 +985,14 @@ namespace Property.Module.FixedAssets
bOldlist = branchRepository.GetBranchNameByIds(boldstr);
bInlist = branchRepository.GetBranchNameByIds(bnewstr);
List<Rb_Workflow_AuditRelevance_Extend> arlist = new List<Rb_Workflow_AuditRelevance_Extend>();
if (demodel.IsSelfApplication == 1)
{
//自助申请的查询
//查询所有的签名流程
arlist = workflow_AuditRelevanceRepository.GetAuditRelevanceList(0, rstr, WFRrocessStatus.NotAudit);
}
foreach (var item in list)
{
item.DetailList = urlist.Where(x => x.ReceiveId == item.Id).ToList();
......@@ -1010,6 +1018,16 @@ namespace Property.Module.FixedAssets
item.ImageList.Add(Config.GetFileUrl(img));
}
}
item.IsApplyForSign = 0;
if (demodel.IsSelfApplication == 1)
{
var arModel = arlist.Where(x => x.WorkFlowId == item.Id).OrderBy(x => x.Sort).FirstOrDefault();
if (arModel != null && arModel.SpecialNode == WFSpecialNodeEnum.Pay)
{
item.IsApplyForSign = 1;
}
}
}
}
return list;
......@@ -2342,6 +2360,12 @@ namespace Property.Module.FixedAssets
{
string rstr = string.Join(",", list.Select(x => x.Id));
urlist = useRelevanceRepository.GetList(new RB_Property_UseRelevance_Extend() { RB_Group_Id = demodel.RB_Group_Id, ReceiveIdStr = rstr });
List<Rb_Workflow_AuditRelevance_Extend> arlist = new List<Rb_Workflow_AuditRelevance_Extend>();
if (demodel.IsSelfApplication == 1) {
//自助申请的查询
//查询所有的签名流程
arlist = workflow_AuditRelevanceRepository.GetAuditRelevanceList(0, rstr, WFRrocessStatus.NotAudit);
}
foreach (var item in list)
{
......@@ -2350,6 +2374,15 @@ namespace Property.Module.FixedAssets
foreach (var item2 in item.DetailList) {
item2.CancelStockEmployeeName = CacheManager.User.UserReidsCache.GetEmployee(item2.CancelStockEmployeeId)?.EmName ?? "";
}
item.IsApplyForSign = 0;
if (demodel.IsSelfApplication == 1)
{
var arModel = arlist.Where(x => x.WorkFlowId == item.Id).OrderBy(x => x.Sort).FirstOrDefault();
if (arModel != null && arModel.SpecialNode == WFSpecialNodeEnum.Pay)
{
item.IsApplyForSign = 1;
}
}
}
}
return list;
......@@ -2525,6 +2558,15 @@ namespace Property.Module.FixedAssets
}
}
/// <summary>
/// 更新审核人
/// </summary>
/// <param name="AuditId"></param>
/// <param name="OldEmId"></param>
/// <param name="NewEmId"></param>
/// <param name="coModelList"></param>
/// <param name="trans"></param>
/// <returns></returns>
public bool UpdateAuditEmId(int AuditId, int OldEmId, int NewEmId, List<SetCareOfModel> coModelList, System.Data.IDbTransaction trans = null)
{
bool flag = true, recordflag = true;
......
......@@ -24,10 +24,13 @@ namespace Property.Repository
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_Applyfor_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.BranchId>=0)
if (dmodel.BranchId>=-1)
{
where += " and " + nameof(RB_Supplies_Applyfor_Extend.BranchId) + " =" + dmodel.BranchId;
}
if (dmodel.Enabled > 0) {
where += " and " + nameof(RB_Supplies_Applyfor_Extend.Enabled) + " =" + dmodel.Enabled;
}
string sql = $@" select * from RB_Supplies_Applyfor {where} order by Id desc";
return GetPage<RB_Supplies_Applyfor_Extend>(pageIndex, pageSize, out count, sql).ToList();
......@@ -44,10 +47,14 @@ namespace Property.Repository
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_Applyfor_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.BranchId >= 0)
if (dmodel.BranchId >= -1)
{
where += " and " + nameof(RB_Supplies_Applyfor_Extend.BranchId) + " =" + dmodel.BranchId;
}
if (dmodel.Enabled > 0)
{
where += " and " + nameof(RB_Supplies_Applyfor_Extend.Enabled) + " =" + dmodel.Enabled;
}
string sql = $@" select * from RB_Supplies_Applyfor {where} order by Id desc";
return Get<RB_Supplies_Applyfor_Extend>(sql).ToList();
......
using Property.Model.Entity;
using Property.Model.Extend;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -42,10 +43,15 @@ namespace Property.Repository
{
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_ApplyforSpecial_Extend.Status), 0);
where += $@" and {nameof(RB_Supplies_ApplyforSpecial_Extend.Date)} >='{DateTime.Now.ToString("yyyy-MM-dd")}'";//必须要大于等于当前时间
if (dmodel.ApplyforId >= 0)
{
where += " and " + nameof(RB_Supplies_ApplyforSpecial_Extend.ApplyforId) + " =" + dmodel.ApplyforId;
}
if (!string.IsNullOrEmpty(dmodel.ApplyforIds))
{
where += " and " + nameof(RB_Supplies_ApplyforSpecial_Extend.ApplyforId) + " in(" + dmodel.ApplyforIds + ")";
}
string sql = $@" select * from RB_Supplies_ApplyforSpecial {where} order by Id desc";
return Get<RB_Supplies_ApplyforSpecial_Extend>(sql).ToList();
......
......@@ -23,13 +23,13 @@ namespace Property.Repository
{
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_ApplyforWeekday_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.ApplyforId>=0)
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.ApplyforId > 0)
{
where += " and " + nameof(RB_Supplies_ApplyforWeekday_Extend.ApplyforId) + " =" + dmodel.ApplyforId;
}
string sql = $@" select * from RB_Supplies_Applyfor {where} order by Id desc";
string sql = $@" select * from RB_Supplies_ApplyforWeekday {where} order by Id desc";
return GetPage<RB_Supplies_ApplyforWeekday_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......@@ -44,12 +44,15 @@ namespace Property.Repository
string where = " where 1=1 ";
where += string.Format(" AND {0}={1}", nameof(RB_Supplies_ApplyforWeekday_Extend.Status), 0);
where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
if (dmodel.ApplyforId >= 0)
if (dmodel.ApplyforId > 0)
{
where += " and " + nameof(RB_Supplies_ApplyforWeekday_Extend.ApplyforId) + " =" + dmodel.ApplyforId;
}
if (!string.IsNullOrEmpty(dmodel.ApplyforIds)) {
where += " and " + nameof(RB_Supplies_ApplyforWeekday_Extend.ApplyforId) + " in(" + dmodel.ApplyforIds + ")";
}
string sql = $@" select * from RB_Supplies_Applyfor {where} order by Id desc";
string sql = $@" select * from RB_Supplies_ApplyforWeekday {where} order by Id desc";
return Get<RB_Supplies_ApplyforWeekday_Extend>(sql).ToList();
}
}
......
......@@ -1061,6 +1061,7 @@ namespace Property.WebApi.Controllers.User
x.BranchName,
x.DepartmentName,
TempleteId = x.TempleteId ?? 0,
x.IsApplyForSign,
DetailList = x.DetailList.Select(z => new
{
z.Id,
......@@ -1397,6 +1398,7 @@ namespace Property.WebApi.Controllers.User
x.OrderCode,
AuditStatusName = x.AuditStatus.GetEnumName(),
TempleteId = x.TempleteId ?? 0,
x.IsApplyForSign,
DetailList = x.DetailList.Select(z => new
{
z.Id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment