|
|
@@ -1348,11 +1348,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1348
|
1348
|
bool n = true;
|
|
1349
|
1349
|
if (model.F_State==10)
|
|
1350
|
1350
|
{
|
|
1351
|
|
- n = new WorkTypeController().SendReminderSMS("完善工单提醒:", user.F_Mobile, count);
|
|
|
1351
|
+ n = new WorkTypeController().SendReminderSMS("完善工单提醒:", user.F_Mobile, count);
|
|
1352
|
1352
|
}
|
|
1353
|
1353
|
else
|
|
1354
|
1354
|
{
|
|
1355
|
|
- n = new WorkTypeController().SendReminderSMS("工单催单提醒:", user.F_Mobile, count);
|
|
|
1355
|
+ n = new WorkTypeController().SendReminderSMS("工单催单提醒:", user.F_Mobile, count);
|
|
1356
|
1356
|
}
|
|
1357
|
1357
|
|
|
1358
|
1358
|
// string msg = new PushMessageController().Push(Title, count, user.F_UserCode);
|
|
|
@@ -1658,164 +1658,179 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1658
|
1658
|
}
|
|
1659
|
1659
|
|
|
1660
|
1660
|
}
|
|
|
1661
|
+ private readonly static object _MyLock = new object();
|
|
1661
|
1662
|
/// 添加工单信息
|
|
1662
|
1663
|
/// </summary>
|
|
1663
|
1664
|
/// <returns></returns>
|
|
|
1665
|
+ [Authority]
|
|
1664
|
1666
|
public ActionResult AddWorkOrder(WorkOrderInput input,int isover=0, int IsAssign = 0, int clid = 0, string cont = "")
|
|
1665
|
1667
|
{
|
|
1666
|
1668
|
if (Request.IsAuthenticated)
|
|
1667
|
1669
|
{
|
|
1668
|
|
- int userId = CurrentUser.UserData.F_UserId;
|
|
1669
|
|
- Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
1670
|
|
- Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
|
|
1671
|
|
- if (!(input.F_Type > 0 && input.F_Type < 5))
|
|
1672
|
|
- return Error("工单类型错误!");
|
|
1673
|
|
-
|
|
1674
|
|
- if (IsAssign > 0)
|
|
|
1670
|
+ lock (_MyLock)
|
|
1675
|
1671
|
{
|
|
1676
|
|
- if (clid == 0)
|
|
1677
|
|
- return Error("请选择提交人!");
|
|
1678
|
|
- }
|
|
1679
|
|
- if (input.F_Type == 4)
|
|
1680
|
|
- {
|
|
1681
|
|
- if (ro .F_RoleCode != "CJZY"&& ro.F_RoleCode != "XTGLY")
|
|
|
1672
|
+ #region
|
|
|
1673
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
1674
|
+ Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
|
1675
|
+ if (userModel == null)
|
|
|
1676
|
+ return Error("未知错误,请重新登录");
|
|
|
1677
|
+ Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
|
|
|
1678
|
+ if (ro == null)
|
|
|
1679
|
+ return Error("获取权限失败,请重新登录");
|
|
|
1680
|
+ if (input .F_Type==null )
|
|
|
1681
|
+ return Error("工单类型错误!");
|
|
|
1682
|
+ if (!(input.F_Type > 0 && input.F_Type < 5))
|
|
|
1683
|
+ return Error("工单类型错误!");
|
|
|
1684
|
+
|
|
|
1685
|
+ if (IsAssign > 0)
|
|
1682
|
1686
|
{
|
|
1683
|
|
- return Error("非抽检人员不可添加抽检工单!");
|
|
|
1687
|
+ if (clid == 0)
|
|
|
1688
|
+ return Error("请选择提交人!");
|
|
1684
|
1689
|
}
|
|
1685
|
|
- if (string.IsNullOrEmpty(input.F_Company))
|
|
1686
|
|
- return Error("抽检单位不能为空!");
|
|
1687
|
|
- if (string.IsNullOrEmpty(input.F_Samplingtype))
|
|
1688
|
|
- return Error("抽检类型不能为空!");
|
|
1689
|
|
- if (string.IsNullOrEmpty(input.F_Salesroom))
|
|
1690
|
|
- return Error("抽样客户/门店不能为空!");
|
|
1691
|
|
- if (string.IsNullOrEmpty(input.F_Samplingproducts))
|
|
1692
|
|
- return Error("抽检产品不能为空!");
|
|
1693
|
|
- if (string.IsNullOrEmpty(input.F_ProductDate))
|
|
1694
|
|
- return Error("生产日期不能为空!");
|
|
1695
|
|
- if (string.IsNullOrEmpty(input.F_Factories))
|
|
1696
|
|
- return Error("涉及工厂不能为空!");
|
|
1697
|
|
- if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
1698
|
|
- return Error("电话不能为空!");
|
|
1699
|
|
- if (string.IsNullOrEmpty(input.F_Remark ))
|
|
1700
|
|
- return Error("备注不能为空!");
|
|
1701
|
|
- if (string.IsNullOrEmpty(input.F_Datecheck))
|
|
1702
|
|
- return Error("抽检日期不能为空!");
|
|
1703
|
|
-
|
|
1704
|
|
- }
|
|
1705
|
|
- else
|
|
1706
|
|
- {
|
|
1707
|
|
- if (string.IsNullOrEmpty(input.F_CusName))
|
|
1708
|
|
- return Error("请输入来电人姓名!");
|
|
1709
|
|
- if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
1710
|
|
- return Error("请输入来电人电话!");
|
|
1711
|
|
- if (input.F_Type == 2)
|
|
|
1690
|
+ if (input.F_Type == 4)
|
|
1712
|
1691
|
{
|
|
1713
|
|
-
|
|
|
1692
|
+ if (ro.F_RoleCode != "CJZY" && ro.F_RoleCode != "XTGLY")
|
|
|
1693
|
+ {
|
|
|
1694
|
+ return Error("非抽检人员不可添加抽检工单!");
|
|
|
1695
|
+ }
|
|
|
1696
|
+ if (string.IsNullOrEmpty(input.F_Company))
|
|
|
1697
|
+ return Error("抽检单位不能为空!");
|
|
|
1698
|
+ if (string.IsNullOrEmpty(input.F_Samplingtype))
|
|
|
1699
|
+ return Error("抽检类型不能为空!");
|
|
|
1700
|
+ if (string.IsNullOrEmpty(input.F_Salesroom))
|
|
|
1701
|
+ return Error("抽样客户/门店不能为空!");
|
|
|
1702
|
+ if (string.IsNullOrEmpty(input.F_Samplingproducts))
|
|
|
1703
|
+ return Error("抽检产品不能为空!");
|
|
1714
|
1704
|
if (string.IsNullOrEmpty(input.F_ProductDate))
|
|
1715
|
|
- return Error("请输入生产日期!");
|
|
1716
|
|
- if (string.IsNullOrEmpty(input.F_ProductType))
|
|
1717
|
|
- return Error("产品代码不能为空!");
|
|
1718
|
|
- if (string.IsNullOrEmpty(input.F_ProductName))
|
|
1719
|
|
- return Error("产品名称不能为空!");
|
|
1720
|
|
- if (string.IsNullOrEmpty(input.F_Specifications))
|
|
1721
|
|
- return Error("规格不能为空!");
|
|
1722
|
|
- if (string.IsNullOrEmpty(input.F_Manufacturer))
|
|
1723
|
|
- return Error("生产厂家不能为空!");
|
|
1724
|
|
- if (string.IsNullOrEmpty(input.F_ProblemCode))
|
|
1725
|
|
- return Error("问题代码不能为空!");
|
|
1726
|
|
- if (string.IsNullOrEmpty(input.F_QualityProblem))
|
|
1727
|
|
- return Error("质量问题不能为空!");
|
|
|
1705
|
+ return Error("生产日期不能为空!");
|
|
|
1706
|
+ if (string.IsNullOrEmpty(input.F_Factories))
|
|
|
1707
|
+ return Error("涉及工厂不能为空!");
|
|
|
1708
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
1709
|
+ return Error("电话不能为空!");
|
|
|
1710
|
+ if (string.IsNullOrEmpty(input.F_Remark))
|
|
|
1711
|
+ return Error("备注不能为空!");
|
|
|
1712
|
+ if (string.IsNullOrEmpty(input.F_Datecheck))
|
|
|
1713
|
+ return Error("抽检日期不能为空!");
|
|
|
1714
|
+
|
|
1728
|
1715
|
}
|
|
1729
|
|
-
|
|
1730
|
|
- }
|
|
1731
|
|
-
|
|
1732
|
|
- if (!string.IsNullOrEmpty(input.F_ProductDate))
|
|
1733
|
|
- {
|
|
1734
|
|
- if (input.F_ProductDate!="不清")
|
|
|
1716
|
+ else
|
|
1735
|
1717
|
{
|
|
1736
|
|
- try
|
|
|
1718
|
+ if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
1719
|
+ return Error("请输入来电人姓名!");
|
|
|
1720
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
1721
|
+ return Error("请输入来电人电话!");
|
|
|
1722
|
+ if (input.F_Type == 2)
|
|
1737
|
1723
|
{
|
|
1738
|
|
- string result = input.F_ProductDate.Replace(".", "");
|
|
1739
|
|
- var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
|
|
1740
|
|
- var protime = Convert.ToDateTime(pronos);
|
|
1741
|
|
- if (DateTime.Parse(pronos) > DateTime.Now)
|
|
1742
|
|
- {
|
|
1743
|
|
- return Error("生产日期不能大于当前时间!");
|
|
1744
|
|
- }
|
|
1745
|
|
- }
|
|
1746
|
|
- catch
|
|
1747
|
|
- {
|
|
1748
|
|
- return Error("生产日期格式错误!");
|
|
|
1724
|
+
|
|
|
1725
|
+ if (string.IsNullOrEmpty(input.F_ProductDate))
|
|
|
1726
|
+ return Error("请输入生产日期!");
|
|
|
1727
|
+ if (string.IsNullOrEmpty(input.F_ProductType))
|
|
|
1728
|
+ return Error("产品代码不能为空!");
|
|
|
1729
|
+ if (string.IsNullOrEmpty(input.F_ProductName))
|
|
|
1730
|
+ return Error("产品名称不能为空!");
|
|
|
1731
|
+ if (string.IsNullOrEmpty(input.F_Specifications))
|
|
|
1732
|
+ return Error("规格不能为空!");
|
|
|
1733
|
+ if (string.IsNullOrEmpty(input.F_Manufacturer))
|
|
|
1734
|
+ return Error("生产厂家不能为空!");
|
|
|
1735
|
+ if (string.IsNullOrEmpty(input.F_ProblemCode))
|
|
|
1736
|
+ return Error("问题代码不能为空!");
|
|
|
1737
|
+ if (string.IsNullOrEmpty(input.F_QualityProblem))
|
|
|
1738
|
+ return Error("质量问题不能为空!");
|
|
1749
|
1739
|
}
|
|
|
1740
|
+
|
|
1750
|
1741
|
}
|
|
1751
|
|
-
|
|
1752
|
|
- }
|
|
1753
|
|
- if (!string.IsNullOrEmpty(input.F_Datecheck))
|
|
1754
|
|
- {
|
|
1755
|
|
- if (input.F_Datecheck != "不清")
|
|
|
1742
|
+
|
|
|
1743
|
+ if (!string.IsNullOrEmpty(input.F_ProductDate))
|
|
1756
|
1744
|
{
|
|
1757
|
|
- try
|
|
|
1745
|
+ if (input.F_ProductDate != "不清")
|
|
1758
|
1746
|
{
|
|
1759
|
|
- string result = input.F_Datecheck.Replace(".", "");
|
|
1760
|
|
- var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1747
|
+ try
|
|
|
1748
|
+ {
|
|
|
1749
|
+ string result = input.F_ProductDate.Replace(".", "");
|
|
|
1750
|
+ var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1751
|
+ var protime = Convert.ToDateTime(pronos);
|
|
|
1752
|
+ if (DateTime.Parse(pronos) > DateTime.Now)
|
|
|
1753
|
+ {
|
|
|
1754
|
+ return Error("生产日期不能大于当前时间!");
|
|
|
1755
|
+ }
|
|
|
1756
|
+ }
|
|
|
1757
|
+ catch
|
|
|
1758
|
+ {
|
|
|
1759
|
+ return Error("生产日期格式错误!");
|
|
|
1760
|
+ }
|
|
1761
|
1761
|
}
|
|
1762
|
|
- catch
|
|
|
1762
|
+
|
|
|
1763
|
+ }
|
|
|
1764
|
+ if (!string.IsNullOrEmpty(input.F_Datecheck))
|
|
|
1765
|
+ {
|
|
|
1766
|
+ if (input.F_Datecheck != "不清")
|
|
1763
|
1767
|
{
|
|
1764
|
|
- return Error("抽检日期格式错误!");
|
|
|
1768
|
+ try
|
|
|
1769
|
+ {
|
|
|
1770
|
+ string result = input.F_Datecheck.Replace(".", "");
|
|
|
1771
|
+ var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1772
|
+ }
|
|
|
1773
|
+ catch
|
|
|
1774
|
+ {
|
|
|
1775
|
+ return Error("抽检日期格式错误!");
|
|
|
1776
|
+ }
|
|
1765
|
1777
|
}
|
|
|
1778
|
+
|
|
1766
|
1779
|
}
|
|
|
1780
|
+ var model = new Model.T_Bus_WorkOrder();
|
|
|
1781
|
+ model = inputtoobj(model, input, 0);
|
|
1767
|
1782
|
|
|
1768
|
|
- }
|
|
1769
|
|
- var model = new Model.T_Bus_WorkOrder();
|
|
1770
|
|
- model = inputtoobj(model, input, 0);
|
|
1771
|
|
-
|
|
1772
|
|
- int n = workorderBLL.Add(model);
|
|
1773
|
|
- if (n > 0)
|
|
1774
|
|
- {
|
|
1775
|
|
- Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
|
|
1776
|
|
- var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
|
|
1777
|
|
- string deptname = "";
|
|
1778
|
|
- if (deptmodel != null)
|
|
1779
|
|
- deptname = deptmodel.F_DeptName;
|
|
1780
|
|
- AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
|
|
1781
|
|
- if (isover >0)
|
|
|
1783
|
+ int n = workorderBLL.Add(model);
|
|
|
1784
|
+ if (n > 0)
|
|
1782
|
1785
|
{
|
|
|
1786
|
+ Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
|
|
1783
|
1787
|
|
|
1784
|
|
- if (userModel != null)
|
|
|
1788
|
+ var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
|
|
|
1789
|
+ string deptname = "";
|
|
|
1790
|
+ if (deptmodel != null)
|
|
|
1791
|
+ deptname = deptmodel.F_DeptName;
|
|
|
1792
|
+ AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
|
|
|
1793
|
+ if (isover > 0)
|
|
1785
|
1794
|
{
|
|
1786
|
|
-
|
|
1787
|
|
- if (model != null)
|
|
|
1795
|
+
|
|
|
1796
|
+ if (userModel != null)
|
|
1788
|
1797
|
{
|
|
1789
|
|
- var res = DealWO(userModel, modlelist, cont, "", isover);
|
|
1790
|
|
- if (res)
|
|
1791
|
|
- return Success("处理成功");
|
|
|
1798
|
+
|
|
|
1799
|
+ if (model != null)
|
|
|
1800
|
+ {
|
|
|
1801
|
+ var res = DealWO(userModel, modlelist, cont, "", isover);
|
|
|
1802
|
+ if (res)
|
|
|
1803
|
+ return Success("处理成功");
|
|
|
1804
|
+ else
|
|
|
1805
|
+ return Error("处理失败!");
|
|
|
1806
|
+ }
|
|
1792
|
1807
|
else
|
|
1793
|
|
- return Error("处理失败!");
|
|
|
1808
|
+ return Error("工单不存在!");
|
|
1794
|
1809
|
}
|
|
1795
|
|
- else
|
|
1796
|
|
- return Error("工单不存在!");
|
|
1797
|
1810
|
}
|
|
1798
|
|
- }
|
|
1799
|
|
- else if (IsAssign > 0)
|
|
1800
|
|
- {
|
|
1801
|
|
- if (clid == 0)
|
|
1802
|
|
- return Error("请选择提交人!");
|
|
1803
|
|
- bool t = AssignWO(userModel, modlelist, cont, 1, clid);
|
|
1804
|
|
- if (t)
|
|
|
1811
|
+ else if (IsAssign > 0)
|
|
1805
|
1812
|
{
|
|
1806
|
|
-
|
|
1807
|
|
- return Success("提交成功!");
|
|
|
1813
|
+ if (clid == 0)
|
|
|
1814
|
+ return Error("请选择提交人!");
|
|
|
1815
|
+ bool t = AssignWO(userModel, modlelist, cont, 1, clid);
|
|
|
1816
|
+ if (t)
|
|
|
1817
|
+ {
|
|
|
1818
|
+
|
|
|
1819
|
+ return Success("提交成功!");
|
|
|
1820
|
+ }
|
|
|
1821
|
+
|
|
|
1822
|
+ else
|
|
|
1823
|
+ return Error("提交失败!");
|
|
1808
|
1824
|
}
|
|
1809
|
|
-
|
|
1810
|
|
- else
|
|
1811
|
|
- return Error("提交失败!");
|
|
1812
|
|
- }
|
|
1813
|
|
- return Success("添加成功!");
|
|
|
1825
|
+ return Success("添加成功!");
|
|
1814
|
1826
|
|
|
|
1827
|
+ }
|
|
|
1828
|
+ else
|
|
|
1829
|
+ return Error("添加失败!");
|
|
1815
|
1830
|
}
|
|
1816
|
|
- else
|
|
1817
|
|
- return Error("添加失败!");
|
|
|
1831
|
+ #endregion
|
|
1818
|
1832
|
}
|
|
|
1833
|
+
|
|
1819
|
1834
|
return NoToken("未知错误,请重新登录");
|
|
1820
|
1835
|
}
|
|
1821
|
1836
|
|
|
|
@@ -2410,6 +2425,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2410
|
2425
|
if (ua != null)
|
|
2411
|
2426
|
{
|
|
2412
|
2427
|
Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
|
|
|
2428
|
+ if (model.F_State == 0)
|
|
|
2429
|
+ {
|
|
|
2430
|
+ return Error("工单未提交");
|
|
|
2431
|
+ }
|
|
|
2432
|
+ else if (model.F_State == 6)
|
|
|
2433
|
+ {
|
|
|
2434
|
+ return Error("工单已退回,请勿重复提交");
|
|
|
2435
|
+ }
|
|
2413
|
2436
|
//验证信息
|
|
2414
|
2437
|
if (model != null)
|
|
2415
|
2438
|
{
|
|
|
@@ -2433,37 +2456,61 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2433
|
2456
|
{
|
|
2434
|
2457
|
#region 工单处理
|
|
2435
|
2458
|
int sms = 0;
|
|
2436
|
|
- var itemlasts = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + " ");
|
|
2437
|
|
- var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + " ").FirstOrDefault(); ;
|
|
2438
|
2459
|
string creatuser = "";
|
|
2439
|
2460
|
int wostate = 5;
|
|
2440
|
|
- if (itemlasts.Count > 0)
|
|
|
2461
|
+ if (model.F_State == 1)
|
|
2441
|
2462
|
{
|
|
2442
|
|
- foreach (var it in itemlasts)
|
|
|
2463
|
+ wostate = 6;
|
|
|
2464
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=1 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2465
|
+ if (itemlast != null)
|
|
2443
|
2466
|
{
|
|
2444
|
|
- if (itemlast.F_WoState > 1)
|
|
2445
|
|
- {
|
|
2446
|
|
- if (it.F_WoState == 3)
|
|
2447
|
|
- {
|
|
2448
|
|
- creatuser = it.F_CreateUser;
|
|
2449
|
|
- wostate = 5;
|
|
2450
|
|
- }
|
|
2451
|
|
- else if (it.F_WoState == 5)
|
|
2452
|
|
- {
|
|
2453
|
|
- creatuser = it.F_CreateUser;
|
|
2454
|
|
- wostate = 6;
|
|
2455
|
|
- }
|
|
2456
|
|
-
|
|
2457
|
|
-
|
|
2458
|
|
- }
|
|
2459
|
|
- else
|
|
2460
|
|
- {
|
|
2461
|
|
- if (it.F_WoState == 1 )
|
|
2462
|
|
- {
|
|
2463
|
|
- creatuser = it.F_CreateUser;
|
|
2464
|
|
- wostate = 6;
|
|
2465
|
|
- }
|
|
2466
|
|
- }
|
|
|
2467
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2468
|
+ }
|
|
|
2469
|
+ }
|
|
|
2470
|
+ else if (model.F_State == 2)
|
|
|
2471
|
+ {
|
|
|
2472
|
+ wostate = 5;
|
|
|
2473
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=2 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2474
|
+ if (itemlast != null)
|
|
|
2475
|
+ {
|
|
|
2476
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2477
|
+ }
|
|
|
2478
|
+ }
|
|
|
2479
|
+ else if (model.F_State == 3)
|
|
|
2480
|
+ {
|
|
|
2481
|
+ wostate = 5;
|
|
|
2482
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=3 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2483
|
+ if (itemlast != null)
|
|
|
2484
|
+ {
|
|
|
2485
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2486
|
+ }
|
|
|
2487
|
+ }
|
|
|
2488
|
+ else if (model.F_State == 4)
|
|
|
2489
|
+ {
|
|
|
2490
|
+ wostate = 5;
|
|
|
2491
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=3 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2492
|
+ if (itemlast != null)
|
|
|
2493
|
+ {
|
|
|
2494
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2495
|
+ }
|
|
|
2496
|
+ }
|
|
|
2497
|
+ else if (model.F_State == 5)
|
|
|
2498
|
+ {
|
|
|
2499
|
+ wostate = 6;
|
|
|
2500
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=3 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2501
|
+ if (itemlast != null)
|
|
|
2502
|
+ {
|
|
|
2503
|
+ creatuser = itemlast.F_CreateUser;
|
|
|
2504
|
+ }
|
|
|
2505
|
+
|
|
|
2506
|
+ }
|
|
|
2507
|
+ else if (model.F_State == 10)
|
|
|
2508
|
+ {
|
|
|
2509
|
+ wostate = 5;
|
|
|
2510
|
+ var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and F_WoID=" + model.F_Id + "and F_WoState=3 order by F_ID desc ").FirstOrDefault(); ;
|
|
|
2511
|
+ if (itemlast != null)
|
|
|
2512
|
+ {
|
|
|
2513
|
+ creatuser = itemlast.F_CreateUser;
|
|
2467
|
2514
|
}
|
|
2468
|
2515
|
}
|
|
2469
|
2516
|
var opt = "退回";
|
|
|
@@ -2479,21 +2526,25 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2479
|
2526
|
var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单,退回说明:" + cont;
|
|
2480
|
2527
|
//获取上一级处理人员
|
|
2481
|
2528
|
int deptid = 0;
|
|
2482
|
|
- var touser = new BLL.T_Sys_UserAccount().GetModel(creatuser);
|
|
2483
|
|
- if (touser != null)
|
|
|
2529
|
+ if (creatuser!="")
|
|
2484
|
2530
|
{
|
|
2485
|
|
- deptid = touser.F_DeptId;
|
|
2486
|
|
- var deptm = departmentBLL.GetModel(touser.F_DeptId);
|
|
2487
|
|
- if (deptm != null)
|
|
|
2531
|
+ var touser = new BLL.T_Sys_UserAccount().GetModel(creatuser);
|
|
|
2532
|
+ if (touser != null)
|
|
2488
|
2533
|
{
|
|
2489
|
|
- if (deptm.F_Layer == 2)
|
|
|
2534
|
+ deptid = touser.F_DeptId;
|
|
|
2535
|
+ var deptm = departmentBLL.GetModel(touser.F_DeptId);
|
|
|
2536
|
+ if (deptm != null)
|
|
2490
|
2537
|
{
|
|
2491
|
|
- F_Officeid = deptm.F_DeptId;
|
|
2492
|
|
- F_Largeareaid = deptm.F_ParentId;
|
|
|
2538
|
+ if (deptm.F_Layer == 2)
|
|
|
2539
|
+ {
|
|
|
2540
|
+ F_Officeid = deptm.F_DeptId;
|
|
|
2541
|
+ F_Largeareaid = deptm.F_ParentId;
|
|
|
2542
|
+ }
|
|
2493
|
2543
|
}
|
|
2494
|
|
- }
|
|
2495
|
2544
|
|
|
|
2545
|
+ }
|
|
2496
|
2546
|
}
|
|
|
2547
|
+
|
|
2497
|
2548
|
var itemid = AddLog(model.F_Id, wostate, content, 1, wostate, creatuser, deptid, nowUser);
|
|
2498
|
2549
|
if (itemid > 0)
|
|
2499
|
2550
|
{
|