Commit 708de2ef authored by solho's avatar solho

feat:主管加入強制取回功能

fix:結算前一步紀錄
parent 7579c526
...@@ -407,15 +407,6 @@ namespace WebAPI.Controllers ...@@ -407,15 +407,6 @@ namespace WebAPI.Controllers
else //update else //update
{ {
String Map_Class = dsr["Map_Class"].ToString(); String Map_Class = dsr["Map_Class"].ToString();
#region 驗證
//if (Map_Class != JtSn["validclass"].ToString())
//{
// return_msg_error.Add(dsr["esn_todos_sn"] + ":該流程已異動, 不可變更");
//}
SettleisClosed = dsr["SettleisClosed"].ToString() == "1" ? true : false;
if (SettleisClosed)
return_msg_error.Add(dsr["esn_todos_sn"] + ":該流程 " + Convert.ToDateTime(dsr["Settle_Date"]).ToString(" yyyy年MM月 ") + "已關帳, 不可變更");
#endregion
//String Step_Value_previous = dsr["Step_Value_previous"].ToString(), Step_Value_Next = dsr["Step_Value_Next"].ToString(); //String Step_Value_previous = dsr["Step_Value_previous"].ToString(), Step_Value_Next = dsr["Step_Value_Next"].ToString();
Tsql = Tsql + "update esn_todos_Flow set "; Tsql = Tsql + "update esn_todos_Flow set ";
...@@ -423,9 +414,15 @@ namespace WebAPI.Controllers ...@@ -423,9 +414,15 @@ namespace WebAPI.Controllers
CStepTypeCur = AllStepType.Where(p => p.id == StepType_id).FirstOrDefault(); CStepTypeCur = AllStepType.Where(p => p.id == StepType_id).FirstOrDefault();
StepType_idHis = CStepTypeCur.id; StepType_idHis = CStepTypeCur.id;
#region 確認是否有審核資格 #region 驗證
//if (Map_Class != JtSn["validclass"].ToString())
//2021-08-20限制全取消 //{
// return_msg_error.Add(dsr["esn_todos_sn"] + ":該流程已異動, 不可變更");
//}
SettleisClosed = dsr["SettleisClosed"].ToString() == "1" ? true : false;
if (SettleisClosed)
return_msg_error.Add(dsr["esn_todos_sn"] + ":該流程 " + Convert.ToDateTime(dsr["Settle_Date"]).ToString(" yyyy年MM月 ") + "已關帳, 不可變更");
//確認是否有審核資格 2021-08-20限制全取消
if (!Confirm_Class.Contains(Map_Class)) if (!Confirm_Class.Contains(Map_Class))
{ {
//return_msg_error.Add(dsr["esn_todos_sn"] + ":無可審核該筆身分"); //return_msg_error.Add(dsr["esn_todos_sn"] + ":無可審核該筆身分");
...@@ -455,11 +452,14 @@ namespace WebAPI.Controllers ...@@ -455,11 +452,14 @@ namespace WebAPI.Controllers
//CStepTypeCur.id = CStepTypeNext.id; //回復與下一步 同ID //CStepTypeCur.id = CStepTypeNext.id; //回復與下一步 同ID
//Tsql = Tsql + CStepTypeNext.Map_Class + "_IsConfirm =" + IsConfirm + ","; //Tsql = Tsql + CStepTypeNext.Map_Class + "_IsConfirm =" + IsConfirm + ",";
CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault(); CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault();
if (JtSn["validclass"].ToString() == "PG") #region 重置結算日期,是否已解算
if (JtSn["validclass"].ToString() == "PG" || JtSn["validclass"].ToString() == "Leader")
{ {
RJTOp += String.Format(@"update esn_todos_points set date_points_settlement=null where sn=" + dsr["sn"] + ";"); RJTOp += String.Format(@"update esn_todos_points set date_points_settlement=null where sn=" + dsr["sn"] + ";");
RJTOp += String.Format(@"update esn_todos_Flow set Is_Settlement=0 where esn_todos_sn=" + dsr["sn"] + ";"); RJTOp += String.Format(@"update esn_todos_Flow set Is_Settlement=0 where esn_todos_sn=" + dsr["sn"] + ";");
} }
#endregion
} }
else if (Confirm_Method == "RJTOp") else if (Confirm_Method == "RJTOp")
{ {
......
...@@ -231,7 +231,7 @@ namespace WebAPI.Controllers ...@@ -231,7 +231,7 @@ namespace WebAPI.Controllers
,StepType_id =(select id from esn_todos_Flow_StepType a where a.Map_Class='HR') output INSERTED.id INTO @TempTable where esn_todos_sn =@SN{0}; ,StepType_id =(select id from esn_todos_Flow_StepType a where a.Map_Class='HR') output INSERTED.id INTO @TempTable where esn_todos_sn =@SN{0};
select @FlowId=id from @TempTable; select @FlowId=id from @TempTable;
insert into esn_todos_Flow_his(Flow_id,ConfirmTime,FromType_id,ToType_id,ConfirmUserId,ConfirmUserClass,ConfirmMethod,Description,Create_User_id,Create_time) insert into esn_todos_Flow_his(Flow_id,ConfirmTime,FromType_id,ToType_id,ConfirmUserId,ConfirmUserClass,ConfirmMethod,Description,Create_User_id,Create_time)
select id as Flow_id,GETDATE(),a.StepType_id,StepType_id,@gWadeID,'HR','SL','結算日期:' + @value,@gWadeID,GETDATE() from esn_todos_Flow a where a.id=@FlowId; select id as Flow_id,GETDATE(),a.StepType_id_Previous,StepType_id,@gWadeID,'HR','SL','結算日期:' + @value,@gWadeID,GETDATE() from esn_todos_Flow a where a.id=@FlowId;
", i); ", i);
return_sn.Add(dr["SN"].ToString()); return_sn.Add(dr["SN"].ToString());
} }
......
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