개정판 53880c83
issue #886: Symbol legend 생성 작업 중....
KCOM_API/ServiceDeepView.svc.cs | ||
---|---|---|
508 | 508 |
} |
509 | 509 |
return null; |
510 | 510 |
} |
511 |
|
|
512 |
[OperationContract] |
|
513 |
public List<MarkupInfoItem> GetMarkupInfoItems(string ProjectNo, string DocInfoId) |
|
514 |
{ |
|
515 |
List<MarkupInfoItem> _result = new List<MarkupInfoItem>(); |
|
516 |
try |
|
517 |
{ |
|
518 |
using (CIEntities entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString())) |
|
519 |
{ |
|
520 |
var markupListData = entity.MARKUP_INFO.Where(data => data.DOCINFO_ID == DocInfoId).ToList(); |
|
521 |
|
|
522 |
var markupList = from markup in markupListData |
|
523 |
orderby markup.CREATE_TIME descending |
|
524 |
select new MarkupInfoItem |
|
525 |
{ |
|
526 |
MarkupInfoID = markup.ID, |
|
527 |
UserID = markup.USER_ID, |
|
528 |
MarkupVersionID = markup.MARKUP_INFO_VERSION.Count() == 0 ? null : markup.MARKUP_INFO_VERSION.OrderByDescending(data => data.CREATE_DATE).FirstOrDefault().ID, |
|
529 |
CreateTime = markup.CREATE_TIME, |
|
530 |
Consolidate = markup.CONSOLIDATE, |
|
531 |
Description = markup.DESCRIPTION, |
|
532 |
AvoidConsolidate = markup.AVOID_CONSOLIDATE, |
|
533 |
PartConsolidate = markup.PART_CONSOLIDATE, |
|
534 |
UpdateTime = DateTime.Parse(markup.UPDATE_TIME.ToString()), |
|
535 |
}; |
|
536 |
|
|
537 |
if (markupList.Count() > 0) |
|
538 |
{ |
|
539 |
_result = markupList.ToList(); |
|
540 |
} |
|
541 |
|
|
542 |
_result.ForEach(r => |
|
543 |
{ |
|
544 |
|
|
545 |
r.MarkupList = (from markupData in entity.MARKUP_DATA |
|
546 |
where markupData.MARKUPINFO_VERSION_ID == r.MarkupVersionID |
|
547 |
orderby markupData.PAGENUMBER |
|
548 |
select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID, Group_ID = markupData.GROUP_ID ?? 0 }).ToList(); |
|
549 |
}); |
|
550 |
|
|
551 |
Random random = new Random(); |
|
552 |
|
|
553 |
_MemberDeptColors memberDeptColors = new _MemberDeptColors(); |
|
554 |
_MemberDeptColorsInfo memberDeptColorsInfo = new _MemberDeptColorsInfo(); |
|
555 |
|
|
556 |
|
|
557 |
memberDeptColors._memberDeptColors = (from memberdeptcolor in entity.MEMBER_DEPT_COLOR |
|
558 |
//where memberdeptcolor.DEPARTMENT == "DisplayColor" |
|
559 |
select memberdeptcolor).ToList(); |
|
560 |
memberDeptColorsInfo._memberDeptColorsInfo = (from memberdeptcolorinfo in entity.MEMBER_DEPT_COLORINFO |
|
561 |
//where memberdeptcolor.DEPARTMENT == "DisplayColor" |
|
562 |
select memberdeptcolorinfo).ToList(); |
|
563 |
|
|
564 |
|
|
565 |
foreach (var item in _result) |
|
566 |
{ |
|
567 |
var _member = entity.MEMBER.Where(member => member.ID == item.UserID); |
|
568 |
|
|
569 |
if (_member.Count() > 0) |
|
570 |
{ |
|
571 |
item.UserName = _member.First().NAME; |
|
572 |
item.Depatment = _member.First().DEPARTMENT; |
|
573 |
} |
|
574 |
|
|
575 |
foreach(var dept in memberDeptColors._memberDeptColors) |
|
576 |
{//dept 지정 색상 |
|
577 |
if(dept.DEPARTMENT == item.Depatment) |
|
578 |
{ |
|
579 |
var colorlist = memberDeptColorsInfo._memberDeptColorsInfo.Where(d => d.COLORID == dept.COLORID).ToList(); |
|
580 |
|
|
581 |
int colorIdx = random.Next(1, colorlist.Count()); |
|
582 |
if(colorlist.Count > 0) |
|
583 |
{ |
|
584 |
item.DisplayColor = "#FF" + colorlist[colorIdx].DISPLAYCOLOR; |
|
585 |
memberDeptColorsInfo._memberDeptColorsInfo.Remove(colorlist[colorIdx]); |
|
586 |
break; |
|
587 |
} |
|
588 |
else |
|
589 |
{ |
|
590 |
item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000)); |
|
591 |
break; |
|
592 |
} |
|
593 |
} |
|
594 |
} |
|
595 |
|
|
596 |
|
|
597 |
if (item.DisplayColor == null) |
|
598 |
{ |
|
599 |
foreach (var dept in memberDeptColors._memberDeptColors) |
|
600 |
{ |
|
601 |
if(dept.DEPARTMENT == null) |
|
602 |
{ |
|
603 |
dept.DEPARTMENT = item.Depatment; |
|
604 |
var colorlist = memberDeptColorsInfo._memberDeptColorsInfo.Where(d => d.COLORID == dept.COLORID).ToList(); |
|
605 |
int colorIdx = random.Next(1, colorlist.Count()); |
|
606 |
if (colorlist.Count > 0) |
|
607 |
{ |
|
608 |
item.DisplayColor = "#FF" + colorlist[colorIdx].DISPLAYCOLOR; |
|
609 |
memberDeptColorsInfo._memberDeptColorsInfo.Remove(colorlist[colorIdx]); |
|
610 |
break; |
|
611 |
} |
|
612 |
else |
|
613 |
{ |
|
614 |
item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000)); |
|
615 |
break; |
|
616 |
} |
|
617 |
} |
|
618 |
} |
|
619 |
} |
|
620 |
|
|
621 |
if(item.DisplayColor == null) |
|
622 |
{ |
|
623 |
item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000)); |
|
624 |
} |
|
625 |
} |
|
626 |
} |
|
627 |
} |
|
628 |
catch (Exception EX) |
|
629 |
{ |
|
630 |
System.Diagnostics.Debug.WriteLine(this.GetType().ToString() + " " + EX); |
|
631 |
return _result; |
|
632 |
} |
|
633 |
finally |
|
634 |
{ |
|
635 |
GC.Collect(2); |
|
636 |
} |
|
637 |
|
|
638 |
return _result; |
|
639 |
} |
|
640 |
|
|
511 | 641 |
|
642 |
/* |
|
512 | 643 |
[OperationContract] |
513 | 644 |
public List<MarkupInfoItem> GetMarkupInfoItems(string ProjectNo, string DocInfoId) |
514 | 645 |
{ |
... | ... | |
556 | 687 |
r.MarkupList = (from markupData in entity.MARKUP_DATA |
557 | 688 |
where markupData.MARKUPINFO_VERSION_ID == r.MarkupVersionID |
558 | 689 |
orderby markupData.PAGENUMBER |
559 |
select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID }).ToList(); |
|
690 |
select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID, Group_ID = markupData.GROUP_ID ?? 0 }).ToList();
|
|
560 | 691 |
}); |
561 | 692 |
|
562 |
List<PROPERTIES> _ColorsProperties = new List<PROPERTIES>();
|
|
693 |
_ColorsProperties colors = new _ColorsProperties();
|
|
563 | 694 |
Random random = new Random(); |
564 | 695 |
|
565 | 696 |
using (KCOMEntities kcomEntity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
566 | 697 |
{ |
567 |
_ColorsProperties = (from property in kcomEntity.PROPERTIES
|
|
698 |
colors._colorsProperties = (from property in kcomEntity.PROPERTIES
|
|
568 | 699 |
where property.TYPE == "DisplayColor" |
569 | 700 |
select property).ToList(); |
570 | 701 |
} |
702 |
List<DeptColor> deptColor = new List<DeptColor>(); |
|
703 |
|
|
704 |
List<DeptColor> listTest = new List<DeptColor>(); |
|
705 |
//Dictionary<string, string> d = new Dictionary<string, string>(); |
|
706 |
var list = new List<KeyValuePair<string, string>>(); |
|
707 |
foreach (var test in colors._colorsProperties) |
|
708 |
{ |
|
709 |
list.Add(new KeyValuePair<string, string>(test.PROPERTY, test.VALUE)); |
|
710 |
//d.Add(test.PROPERTY, test.VALUE); |
|
711 |
listTest.Add(new DeptColor { Property = test.PROPERTY,DisplayColor = test.VALUE}); |
|
712 |
} |
|
713 |
|
|
571 | 714 |
|
572 | 715 |
foreach (var item in _result) |
573 | 716 |
{ |
... | ... | |
579 | 722 |
item.Depatment = _member.First().DEPARTMENT; |
580 | 723 |
} |
581 | 724 |
|
582 |
if (_ColorsProperties.Count > 0)
|
|
725 |
if (colors._colorsProperties.Count > 0)
|
|
583 | 726 |
{ |
584 |
int colorIdx = random.Next(1, _ColorsProperties.Count());
|
|
727 |
int colorIdx = random.Next(1, colors._colorsProperties.Count());
|
|
585 | 728 |
#region 부서별로 색상을 지정하고자 할때 |
586 |
/// 일단 의견을 들어보자구! |
|
729 |
|
|
730 |
if(deptColor.Count > 0) |
|
731 |
{ |
|
732 |
foreach (var dept in deptColor) |
|
733 |
{ |
|
734 |
if (dept.Depatment == item.Depatment) |
|
735 |
{ |
|
736 |
//list에서 deptColor.Property의 값 중 상위의 데이터를 뽑아서 지정하고 list에서 삭제 |
|
737 |
item.DisplayColor = "#FF" + list.Where(p => p.Key == dept.Property).FirstOrDefault().Value; |
|
738 |
list.Remove(new KeyValuePair<string, string>(dept.Property, dept.DisplayColor)); |
|
739 |
break; |
|
740 |
} |
|
741 |
else |
|
742 |
{ |
|
743 |
item.DisplayColor = "#FF" + colors._colorsProperties[colorIdx].VALUE; |
|
744 |
deptColor.Add(new DeptColor { DisplayColor = item.DisplayColor, Depatment = item.Depatment, Property = colors._colorsProperties[colorIdx].PROPERTY }); |
|
745 |
colors._colorsProperties.RemoveAll(p => p.PROPERTY.Equals(colors._colorsProperties[colorIdx].PROPERTY)); //같은 계열의 색상은 지운다 |
|
746 |
break; |
|
747 |
} |
|
748 |
} |
|
749 |
} |
|
750 |
else |
|
751 |
{ |
|
752 |
item.DisplayColor = "#FF" + colors._colorsProperties[colorIdx].VALUE; |
|
753 |
deptColor.Add(new DeptColor { DisplayColor = item.DisplayColor, Depatment = item.Depatment, Property = colors._colorsProperties[colorIdx].PROPERTY }); |
|
754 |
colors._colorsProperties.RemoveAll(p => p.PROPERTY.Equals(colors._colorsProperties[colorIdx].PROPERTY)); //같은 계열의 색상은 지운다 |
|
755 |
} |
|
587 | 756 |
#endregion |
588 |
item.DisplayColor = "#FF" + _ColorsProperties[colorIdx].VALUE; |
|
589 |
_ColorsProperties.Remove(_ColorsProperties[colorIdx]); |
|
590 |
//item.DisplayColor = "#FF" + _Colors.First(); |
|
591 |
//_Colors.Remove(_Colors.First()); |
|
592 | 757 |
} |
593 | 758 |
else |
594 | 759 |
{ |
... | ... | |
609 | 774 |
|
610 | 775 |
return _result; |
611 | 776 |
} |
612 |
|
|
777 |
*/ |
|
613 | 778 |
[OperationContract] |
614 | 779 |
public List<MarkupInfoItem> GetSyncMarkupInfoItems(string ProjectNo, string DocInfoId, string currentUser) |
615 | 780 |
{ |
... | ... | |
655 | 820 |
r.MarkupList = (from markupData in entity.MARKUP_DATA |
656 | 821 |
where markupData.MARKUPINFO_VERSION_ID == r.MarkupVersionID |
657 | 822 |
orderby markupData.PAGENUMBER |
658 |
select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID }).ToList(); |
|
823 |
select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID, Group_ID = markupData.GROUP_ID ?? 0 }).ToList();
|
|
659 | 824 |
}); |
660 | 825 |
|
661 | 826 |
List<PROPERTIES> _ColorsProperties = new List<PROPERTIES>(); |
... | ... | |
1041 | 1206 |
DATA_TYPE = value.DATA_TYPE, |
1042 | 1207 |
PAGENUMBER = value.PAGENUMBER, |
1043 | 1208 |
MARKUPINFO_VERSION_ID = markup_info_version.ID, |
1044 |
SYMBOL_ID = value.SYMBOL_ID |
|
1209 |
SYMBOL_ID = value.SYMBOL_ID, |
|
1210 |
GROUP_ID = value.GROUP_ID |
|
1045 | 1211 |
}); |
1046 | 1212 |
}); |
1047 | 1213 |
Entity.SaveChanges(); |
... | ... | |
1054 | 1220 |
return true; |
1055 | 1221 |
} |
1056 | 1222 |
|
1223 |
[OperationContract] |
|
1224 |
public long AddMarkupDataGroup(MARKUP_DATA_GROUP mARKUP_DATA_GROUP, string ProjectNo) |
|
1225 |
{ |
|
1226 |
try |
|
1227 |
{ |
|
1228 |
using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString())) |
|
1229 |
{ |
|
1230 |
Entity.AddToMARKUP_DATA_GROUP(mARKUP_DATA_GROUP); |
|
1231 |
//MARKUP_DATA_GROUP tt = Entity.MARKUP_DATA_GROUP.Where(info => info.ID == id).FirstOrDefault(); |
|
1232 |
Entity.SaveChanges(); |
|
1233 |
|
|
1234 |
return Entity.MARKUP_DATA_GROUP.ToList().LastOrDefault().ID; |
|
1235 |
} |
|
1236 |
} |
|
1237 |
catch (Exception) |
|
1238 |
{ |
|
1239 |
return 0; |
|
1240 |
} |
|
1241 |
} |
|
1242 |
[OperationContract] |
|
1243 |
public bool UpdateMarkupDataGroup(long Group_ID, string ProjectNo) |
|
1244 |
{ |
|
1245 |
try |
|
1246 |
{ |
|
1247 |
using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString())) |
|
1248 |
{ |
|
1249 |
var UpdateItem = Entity.MARKUP_DATA_GROUP.Where(info => info.ID == Group_ID).FirstOrDefault(); |
|
1250 |
UpdateItem.STATE = 1; |
|
1251 |
Entity.SaveChanges(); |
|
1252 |
} |
|
1253 |
} |
|
1254 |
catch (Exception) |
|
1255 |
{ |
|
1256 |
return false; |
|
1257 |
} |
|
1258 |
return true; |
|
1259 |
} |
|
1260 |
[OperationContract] |
|
1261 |
public bool UpdateMarkupData(string CommentID, long Group_ID, string ProjectNo) |
|
1262 |
{ |
|
1263 |
try |
|
1264 |
{ |
|
1265 |
using (CIEntities Entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString())) |
|
1266 |
{ |
|
1267 |
var UpdateItem = Entity.MARKUP_DATA.Where(info => info.ID == CommentID).FirstOrDefault(); |
|
1268 |
UpdateItem.GROUP_ID = Group_ID; |
|
1269 |
Entity.SaveChanges(); |
|
1270 |
} |
|
1271 |
} |
|
1272 |
catch (Exception) |
|
1273 |
{ |
|
1274 |
return false; |
|
1275 |
} |
|
1276 |
return true; |
|
1277 |
} |
|
1057 | 1278 |
|
1058 | 1279 |
[OperationContract] |
1059 | 1280 |
public bool SaveSymbol(SYMBOL_PRIVATE symbol_private) |
... | ... | |
1537 | 1758 |
DATA_TYPE = item.DATA_TYPE, |
1538 | 1759 |
PAGENUMBER = item.PAGENUMBER, |
1539 | 1760 |
MARKUP_INFO_VERSION = info2, |
1540 |
SYMBOL_ID = item.SYMBOL_ID |
|
1761 |
SYMBOL_ID = item.SYMBOL_ID, |
|
1762 |
GROUP_ID = item.GROUP_ID |
|
1541 | 1763 |
}); |
1542 | 1764 |
} |
1543 | 1765 |
Entity.SaveChanges(); |
... | ... | |
1606 | 1828 |
DATA_TYPE = item.DATA_TYPE, |
1607 | 1829 |
PAGENUMBER = item.PAGENUMBER, |
1608 | 1830 |
MARKUP_INFO_VERSION = info2, |
1609 |
SYMBOL_ID = item.SYMBOL_ID |
|
1831 |
SYMBOL_ID = item.SYMBOL_ID, |
|
1832 |
GROUP_ID = item.GROUP_ID |
|
1610 | 1833 |
}); |
1611 | 1834 |
} |
1612 | 1835 |
Entity.SaveChanges(); |
... | ... | |
1773 | 1996 |
DATA_TYPE = item.DATA_TYPE, |
1774 | 1997 |
PAGENUMBER = item.PAGENUMBER, |
1775 | 1998 |
MARKUP_INFO_VERSION = info2, |
1776 |
SYMBOL_ID = item.SYMBOL_ID |
|
1999 |
SYMBOL_ID = item.SYMBOL_ID, |
|
2000 |
GROUP_ID = item.GROUP_ID |
|
1777 | 2001 |
}); |
1778 | 2002 |
} |
1779 | 2003 |
Entity.SaveChanges(); |
... | ... | |
1902 | 2126 |
} |
1903 | 2127 |
return result; |
1904 | 2128 |
} |
1905 |
|
|
2129 |
[OperationContract] |
|
2130 |
public string GetSymbolImageURL(string id, int type) |
|
2131 |
{ |
|
2132 |
string result; |
|
2133 |
try |
|
2134 |
{ |
|
2135 |
using (KCOMEntities Entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
2136 |
{ |
|
2137 |
if (type == 0) |
|
2138 |
{ |
|
2139 |
result = Entity.SYMBOL_PRIVATE.Where(data => data.ID == id).FirstOrDefault().IMAGE_URL; |
|
2140 |
} |
|
2141 |
else |
|
2142 |
{ |
|
2143 |
result = Entity.SYMBOL_PUBLIC.Where(data => data.ID == id).FirstOrDefault().IMAGE_URL; |
|
2144 |
} |
|
2145 |
} |
|
2146 |
} |
|
2147 |
catch (Exception) |
|
2148 |
{ |
|
2149 |
return null; |
|
2150 |
} |
|
2151 |
return result; |
|
2152 |
} |
|
1906 | 2153 |
[OperationContract] |
1907 | 2154 |
public string GetSignData(string project_no, string user_id) |
1908 | 2155 |
{ |
내보내기 Unified diff