Merge remote-tracking branch 'origin/test' into test
正在显示
11 个修改的文件
包含
337 行增加
和
32 行删除
@@ -10,4 +10,5 @@ require ( | @@ -10,4 +10,5 @@ require ( | ||
10 | github.com/dgrijalva/jwt-go v3.2.0+incompatible | 10 | github.com/dgrijalva/jwt-go v3.2.0+incompatible |
11 | github.com/go-pg/pg/v10 v10.10.7 | 11 | github.com/go-pg/pg/v10 v10.10.7 |
12 | github.com/linmadan/egglib-go v0.0.0-20210827085852-177fa745932d | 12 | github.com/linmadan/egglib-go v0.0.0-20210827085852-177fa745932d |
13 | + github.com/xuri/excelize/v2 v2.6.1 | ||
13 | ) | 14 | ) |
@@ -346,6 +346,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ | @@ -346,6 +346,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ | ||
346 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | 346 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= |
347 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | 347 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= |
348 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= | 348 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= |
349 | +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= | ||
349 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= | 350 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= |
350 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | 351 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= |
351 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= | 352 | github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= |
@@ -441,7 +442,11 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 | @@ -441,7 +442,11 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 | ||
441 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= | 442 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= |
442 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= | 443 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= |
443 | github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= | 444 | github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= |
445 | +github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= | ||
446 | +github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= | ||
444 | github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= | 447 | github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= |
448 | +github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM= | ||
449 | +github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= | ||
445 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= | 450 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= |
446 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= | 451 | github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= |
447 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | 452 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= |
@@ -504,7 +509,13 @@ github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhe | @@ -504,7 +509,13 @@ github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhe | ||
504 | github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= | 509 | github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= |
505 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= | 510 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= |
506 | github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= | 511 | github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= |
512 | +github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 h1:6932x8ltq1w4utjmfMPVj09jdMlkY0aiA6+Skbtl3/c= | ||
513 | +github.com/xuri/efp v0.0.0-20220603152613-6918739fd470/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= | ||
507 | github.com/xuri/excelize/v2 v2.4.1/go.mod h1:rSu0C3papjzxQA3sdK8cU544TebhrPUoTOaGPIh0Q1A= | 514 | github.com/xuri/excelize/v2 v2.4.1/go.mod h1:rSu0C3papjzxQA3sdK8cU544TebhrPUoTOaGPIh0Q1A= |
515 | +github.com/xuri/excelize/v2 v2.6.1 h1:ICBdtw803rmhLN3zfvyEGH3cwSmZv+kde7LhTDT659k= | ||
516 | +github.com/xuri/excelize/v2 v2.6.1/go.mod h1:tL+0m6DNwSXj/sILHbQTYsLi9IF4TW59H2EF3Yrx1AU= | ||
517 | +github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 h1:OAmKAfT06//esDdpi/DZ8Qsdt4+M5+ltca05dA5bG2M= | ||
518 | +github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= | ||
508 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | 519 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= |
509 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | 520 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= |
510 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | 521 | github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= |
@@ -558,8 +569,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh | @@ -558,8 +569,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh | ||
558 | golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= | 569 | golang.org/x/crypto v0.0.0-20210218145215-b8e89b74b9df/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= |
559 | golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= | 570 | golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= |
560 | golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | 571 | golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= |
561 | -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= | ||
562 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | 572 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= |
573 | +golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8 h1:GIAS/yBem/gq2MUqgNIzUHW7cJMmx3TGZOrnyYaNQ6c= | ||
574 | +golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | ||
563 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | 575 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= |
564 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | 576 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= |
565 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | 577 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= |
@@ -573,6 +585,8 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk | @@ -573,6 +585,8 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk | ||
573 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | 585 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= |
574 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | 586 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= |
575 | golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | 587 | golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= |
588 | +golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 h1:LRtI4W37N+KFebI/qV0OFiLUv4GLOWeEW5hn/KEJvxE= | ||
589 | +golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= | ||
576 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | 590 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= |
577 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= | 591 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= |
578 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= | 592 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= |
@@ -636,8 +650,10 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY | @@ -636,8 +650,10 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY | ||
636 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | 650 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= |
637 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= | 651 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= |
638 | golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | 652 | golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= |
639 | -golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8= | ||
640 | golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | 653 | golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= |
654 | +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= | ||
655 | +golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= | ||
656 | +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= | ||
641 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= | 657 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= |
642 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | 658 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= |
643 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | 659 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= |
@@ -712,18 +728,21 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc | @@ -712,18 +728,21 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc | ||
712 | golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | 728 | golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
713 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | 729 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
714 | golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | 730 | golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
715 | -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= | ||
716 | golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | 731 | golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
732 | +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= | ||
733 | +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
717 | golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= | 734 | golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= |
718 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | 735 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= |
736 | +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||
719 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 737 | golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
720 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 738 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
721 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | 739 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
722 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= | 740 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= |
723 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | 741 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
724 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | 742 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
725 | -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= | ||
726 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | 743 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
744 | +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= | ||
745 | +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= | ||
727 | golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | 746 | golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= |
728 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | 747 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= |
729 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= | 748 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= |
@@ -909,6 +928,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= | @@ -909,6 +928,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= | ||
909 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= | 928 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= |
910 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | 929 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
911 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | 930 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
931 | +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
912 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | 932 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= |
913 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | 933 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
914 | honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= | 934 | honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= |
go_build_main_go
0 → 100755
不能预览此文件类型
@@ -6,8 +6,8 @@ type CreateStaffAssessTask struct { | @@ -6,8 +6,8 @@ type CreateStaffAssessTask struct { | ||
6 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 | 6 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 |
7 | CycleId int64 `json:"cycleId"` //对应的周期id | 7 | CycleId int64 `json:"cycleId"` //对应的周期id |
8 | CycleName string `json:"cycleName"` //对应周期的名称 | 8 | CycleName string `json:"cycleName"` //对应周期的名称 |
9 | - BeginTime string `json:"beginTime"` //绩效考核开始时间 | ||
10 | - EndTime string `json:"endTime"` //绩效考核截止时间 | 9 | + BeginTime string `json:"beginTime"` //绩效考核开始时间 2006-01-02 15:04:05 |
10 | + EndTime string `json:"endTime"` //绩效考核截止时间 2006-01-02 15:04:05 | ||
11 | StepList []AssessTaskStep `json:"steps"` //考评的流程 | 11 | StepList []AssessTaskStep `json:"steps"` //考评的流程 |
12 | ExecutorId []int `json:"executorId"` //参与此次考评的人 | 12 | ExecutorId []int `json:"executorId"` //参与此次考评的人 |
13 | } | 13 | } |
@@ -341,7 +341,9 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | @@ -341,7 +341,9 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | ||
341 | defer func() { | 341 | defer func() { |
342 | _ = transactionContext.RollbackTransaction() | 342 | _ = transactionContext.RollbackTransaction() |
343 | }() | 343 | }() |
344 | - | 344 | + assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{ |
345 | + "transactionContext": transactionContext, | ||
346 | + }) | ||
345 | taskBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local) | 347 | taskBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local) |
346 | if err != nil { | 348 | if err != nil { |
347 | return nil, application.ThrowError(application.ARG_ERROR, "任务开始时间填写错误,"+param.BeginTime) | 349 | return nil, application.ThrowError(application.ARG_ERROR, "任务开始时间填写错误,"+param.BeginTime) |
@@ -351,8 +353,22 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | @@ -351,8 +353,22 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | ||
351 | return nil, application.ThrowError(application.ARG_ERROR, "任务结束时间填写错误,"+param.EndTime) | 353 | return nil, application.ThrowError(application.ARG_ERROR, "任务结束时间填写错误,"+param.EndTime) |
352 | } | 354 | } |
353 | nowTime := time.Now() | 355 | nowTime := time.Now() |
356 | + var assessTaskData *domain.StaffAssessTask | ||
357 | + _, assassessTaskList, err := assessTaskRepo.Find(map[string]interface{}{ | ||
358 | + "evaluationProjectId": param.EvaluationProjectId, | ||
359 | + "beginDay": taskBeginTime.Local().Format("2006-01-02"), | ||
360 | + }) | ||
361 | + if err != nil { | ||
362 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "查询同日期已存在评估任务"+err.Error()) | ||
363 | + } | ||
364 | + // 获取旧数据 | ||
365 | + | ||
366 | + if len(assassessTaskList) > 0 { | ||
367 | + assessTaskData = assassessTaskList[0] | ||
368 | + assessTaskData.UpdatedAt = nowTime | ||
369 | + } else { | ||
354 | //建立评估任务 | 370 | //建立评估任务 |
355 | - assessTask := domain.StaffAssessTask{ | 371 | + assessTaskData = &domain.StaffAssessTask{ |
356 | Id: 0, | 372 | Id: 0, |
357 | CompanyId: param.CompanyId, | 373 | CompanyId: param.CompanyId, |
358 | EvaluationProjectId: param.EvaluationProjectId, | 374 | EvaluationProjectId: param.EvaluationProjectId, |
@@ -367,8 +383,15 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | @@ -367,8 +383,15 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | ||
367 | UpdatedAt: nowTime, | 383 | UpdatedAt: nowTime, |
368 | DeletedAt: nil, | 384 | DeletedAt: nil, |
369 | } | 385 | } |
386 | + } | ||
387 | + | ||
370 | //填充评估环节 | 388 | //填充评估环节 |
371 | for _, v := range param.StepList { | 389 | for _, v := range param.StepList { |
390 | + for _, vv := range assessTaskData.StepList { | ||
391 | + if vv.LinkNodeType == v.LinkNodeType { | ||
392 | + continue | ||
393 | + } | ||
394 | + } | ||
372 | stepBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local) | 395 | stepBeginTime, err := time.ParseInLocation("2006-01-02 15:04:05", param.BeginTime, time.Local) |
373 | if err != nil { | 396 | if err != nil { |
374 | return nil, application.ThrowError(application.ARG_ERROR, "评估环节开始时间填写错误,"+param.BeginTime) | 397 | return nil, application.ThrowError(application.ARG_ERROR, "评估环节开始时间填写错误,"+param.BeginTime) |
@@ -385,13 +408,10 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | @@ -385,13 +408,10 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | ||
385 | BeginTime: stepBeginTime, | 408 | BeginTime: stepBeginTime, |
386 | EndTime: stepEndTime, | 409 | EndTime: stepEndTime, |
387 | } | 410 | } |
388 | - assessTask.StepList = append(assessTask.StepList, step) | 411 | + assessTaskData.StepList = append(assessTaskData.StepList, step) |
389 | } | 412 | } |
390 | 413 | ||
391 | - assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{ | ||
392 | - "transactionContext": transactionContext, | ||
393 | - }) | ||
394 | - assessList, err := srv.createStaffAssess(transactionContext, &assessTask) | 414 | + assessList, err := srv.createStaffAssess(transactionContext, assessTaskData) |
395 | if err != nil { | 415 | if err != nil { |
396 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "生成个人评估项"+err.Error()) | 416 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "生成个人评估项"+err.Error()) |
397 | } | 417 | } |
@@ -405,27 +425,35 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | @@ -405,27 +425,35 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA | ||
405 | } | 425 | } |
406 | executorIds = append(executorIds, v) | 426 | executorIds = append(executorIds, v) |
407 | } | 427 | } |
428 | + //过滤就数据 | ||
429 | + for _, v := range assessTaskData.ExecutorId { | ||
430 | + if _, ok := executorIdMap[v]; ok { | ||
431 | + continue | ||
432 | + } | ||
433 | + executorIds = append(executorIds, v) | ||
434 | + } | ||
408 | assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{ | 435 | assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{ |
409 | "transactionContext": transactionContext, | 436 | "transactionContext": transactionContext, |
410 | }) | 437 | }) |
438 | + assessTaskData.ExecutorId = executorIds | ||
439 | + _, err = assessTaskRepo.Save(assessTaskData) | ||
440 | + if err != nil { | ||
441 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存评估任务"+err.Error()) | ||
442 | + } | ||
411 | 443 | ||
412 | for i := range assessList { | 444 | for i := range assessList { |
445 | + assessList[i].StaffAssessTaskId = assessTaskData.Id | ||
413 | _, err = assessRepo.Save(&assessList[i]) | 446 | _, err = assessRepo.Save(&assessList[i]) |
414 | if err != nil { | 447 | if err != nil { |
415 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存个人评估项"+err.Error()) | 448 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存个人评估项"+err.Error()) |
416 | } | 449 | } |
417 | } | 450 | } |
418 | - assessTask.ExecutorId = executorIds | ||
419 | - _, err = assessTaskRepo.Save(&assessTask) | ||
420 | - if err != nil { | ||
421 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存评估任务"+err.Error()) | ||
422 | - } | ||
423 | 451 | ||
424 | if err := transactionContext.CommitTransaction(); err != nil { | 452 | if err := transactionContext.CommitTransaction(); err != nil { |
425 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 453 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
426 | } | 454 | } |
427 | return map[string]interface{}{ | 455 | return map[string]interface{}{ |
428 | - "assessTaskId": assessTask.Id, | 456 | + "assessTaskId": assessTaskData.Id, |
429 | }, nil | 457 | }, nil |
430 | } | 458 | } |
431 | 459 |
pkg/domain/performance_application_form.go
0 → 100644
1 | +package domain | ||
2 | + | ||
3 | +import ( | ||
4 | + "errors" | ||
5 | + "strings" | ||
6 | +) | ||
7 | + | ||
8 | +type PerformanceApplicationForm struct { | ||
9 | + DimensionName string //维度名称 | ||
10 | + ModuleName string //模块名称 | ||
11 | + Weight string //权重 | ||
12 | + Standard string //标准 | ||
13 | + Task string //任务、指标 | ||
14 | +} | ||
15 | + | ||
16 | +type PerformanceDimension struct { | ||
17 | + Name string `json:"name"` //维度名称 | ||
18 | + PerformanceModule []*PerformanceModule `json:"performanceModule"` //模块 | ||
19 | +} | ||
20 | + | ||
21 | +type PerformanceModule struct { | ||
22 | + ModuleName string `json:"moduleName"` //模块名称 | ||
23 | + Weight string `json:"weight"` //权重 | ||
24 | + Standard string `json:"standard"` //标准(结构化的成果描述) | ||
25 | + Target []*PerformanceTarget `json:"performanceTarget"` //任务\指标 | ||
26 | +} | ||
27 | + | ||
28 | +type PerformanceTarget struct { | ||
29 | + Task string `json:"task"` | ||
30 | +} | ||
31 | + | ||
32 | +func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) { | ||
33 | + formRows := make([]*PerformanceApplicationForm, 0) | ||
34 | + var dimensionName, moduleName, taskName, weightName, standardName string | ||
35 | + for key, item := range rows { | ||
36 | + if key < 3 { | ||
37 | + continue | ||
38 | + } | ||
39 | + if len(item) >= 1 { | ||
40 | + if item[0] == "部门长审核" || strings.Contains(item[0], "审核") { | ||
41 | + break | ||
42 | + } | ||
43 | + } | ||
44 | + form := &PerformanceApplicationForm{} | ||
45 | + //维度名称 | ||
46 | + if len(item) > 1 && item[1] != "" { | ||
47 | + dimensionName = item[1] | ||
48 | + } | ||
49 | + form.DimensionName = dimensionName | ||
50 | + //模块名称 | ||
51 | + if len(item) > 3 && item[3] != "" { | ||
52 | + moduleName = item[3] | ||
53 | + } | ||
54 | + form.ModuleName = moduleName | ||
55 | + //指标任务 | ||
56 | + if len(item) > 4 && item[4] != "" { | ||
57 | + taskName = item[4] | ||
58 | + } | ||
59 | + form.Task = taskName | ||
60 | + //权重 | ||
61 | + if len(item) > 6 && item[6] != "" { | ||
62 | + weightName = item[6] | ||
63 | + } | ||
64 | + form.Weight = weightName | ||
65 | + //标准 | ||
66 | + if len(item) > 7 && item[7] != "" { | ||
67 | + standardName = item[7] | ||
68 | + } | ||
69 | + form.Standard = standardName | ||
70 | + formRows = append(formRows, form) | ||
71 | + } | ||
72 | + dimensions := make([]*PerformanceDimension, 0) | ||
73 | + //按维度分 | ||
74 | + mapData := make(map[string][]*PerformanceApplicationForm) | ||
75 | + //维度顺序 | ||
76 | + sortBy := make([]string, 0) | ||
77 | + for _, item := range formRows { | ||
78 | + if _, ok := mapData[item.DimensionName]; !ok { | ||
79 | + mapData[item.DimensionName] = make([]*PerformanceApplicationForm, 0) | ||
80 | + sortBy = append(sortBy, item.DimensionName) | ||
81 | + } | ||
82 | + mapData[item.DimensionName] = append(mapData[item.DimensionName], item) | ||
83 | + } | ||
84 | + for dimensionName, item := range mapData { | ||
85 | + dimension := &PerformanceDimension{ | ||
86 | + Name: dimensionName, | ||
87 | + } | ||
88 | + modules, err := loadPerformanceModule(item) | ||
89 | + if err != nil { | ||
90 | + return dimensions, err | ||
91 | + } | ||
92 | + dimension.PerformanceModule = modules | ||
93 | + dimensions = append(dimensions, dimension) | ||
94 | + } | ||
95 | + result := make([]*PerformanceDimension, 0) | ||
96 | + for _, name := range sortBy { | ||
97 | + for _, item := range dimensions { | ||
98 | + if name == item.Name { | ||
99 | + result = append(result, item) | ||
100 | + } | ||
101 | + } | ||
102 | + } | ||
103 | + return result, nil | ||
104 | +} | ||
105 | + | ||
106 | +// 筛选出模块 | ||
107 | +func loadPerformanceModule(forms []*PerformanceApplicationForm) ([]*PerformanceModule, error) { | ||
108 | + mapData := make(map[string][]*PerformanceApplicationForm) | ||
109 | + sortBy := make([]string, 0) | ||
110 | + for _, item := range forms { | ||
111 | + if _, ok := mapData[item.ModuleName]; !ok { | ||
112 | + mapData[item.ModuleName] = make([]*PerformanceApplicationForm, 0) | ||
113 | + sortBy = append(sortBy, item.ModuleName) | ||
114 | + } | ||
115 | + mapData[item.ModuleName] = append(mapData[item.ModuleName], item) | ||
116 | + } | ||
117 | + modules := make([]*PerformanceModule, 0) | ||
118 | + for moduleName, item := range mapData { | ||
119 | + if moduleName == "" { | ||
120 | + return modules, errors.New(item[0].DimensionName + "对应的模块不能为空") | ||
121 | + } | ||
122 | + weightName, err := getWeight(item) | ||
123 | + if err != nil { | ||
124 | + return modules, err | ||
125 | + } | ||
126 | + standardName, err := getStandard(item) | ||
127 | + if err != nil { | ||
128 | + return modules, err | ||
129 | + } | ||
130 | + tasks, err := getTasks(item) | ||
131 | + if err != nil { | ||
132 | + return modules, err | ||
133 | + } | ||
134 | + module := &PerformanceModule{ | ||
135 | + ModuleName: moduleName, | ||
136 | + Weight: weightName, | ||
137 | + Standard: standardName, | ||
138 | + Target: tasks, | ||
139 | + } | ||
140 | + modules = append(modules, module) | ||
141 | + } | ||
142 | + result := make([]*PerformanceModule, 0) | ||
143 | + | ||
144 | + for _, name := range sortBy { | ||
145 | + for _, item := range modules { | ||
146 | + if name == item.ModuleName { | ||
147 | + result = append(result, item) | ||
148 | + } | ||
149 | + } | ||
150 | + } | ||
151 | + return result, nil | ||
152 | +} | ||
153 | + | ||
154 | +// 获取权重 | ||
155 | +func getWeight(items []*PerformanceApplicationForm) (string, error) { | ||
156 | + if len(items) <= 0 { | ||
157 | + return "", nil | ||
158 | + } | ||
159 | + var name string | ||
160 | + for _, item := range items { | ||
161 | + if name == "" { | ||
162 | + name = item.Weight | ||
163 | + } | ||
164 | + if name != item.Weight { | ||
165 | + return "", errors.New(item.ModuleName + " 对应的权重值不一致") | ||
166 | + } | ||
167 | + } | ||
168 | + if name == "/" { | ||
169 | + name = "0%" | ||
170 | + } | ||
171 | + return name, nil | ||
172 | +} | ||
173 | + | ||
174 | +// 获取标准 | ||
175 | +func getStandard(items []*PerformanceApplicationForm) (string, error) { | ||
176 | + if len(items) <= 0 { | ||
177 | + return "", nil | ||
178 | + } | ||
179 | + var name string | ||
180 | + for _, item := range items { | ||
181 | + if name == "" { | ||
182 | + name = item.Standard | ||
183 | + } | ||
184 | + if name != item.Standard { | ||
185 | + return "", errors.New(item.ModuleName + " 对应的标准值不一致") | ||
186 | + } | ||
187 | + } | ||
188 | + return name, nil | ||
189 | +} | ||
190 | + | ||
191 | +// 获取任务 | ||
192 | +func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { | ||
193 | + tasks := make([]*PerformanceTarget, 0) | ||
194 | + for _, item := range items { | ||
195 | + target := &PerformanceTarget{Task: item.Task} | ||
196 | + tasks = append(tasks, target) | ||
197 | + } | ||
198 | + return tasks, nil | ||
199 | +} |
@@ -2,19 +2,6 @@ package domain | @@ -2,19 +2,6 @@ package domain | ||
2 | 2 | ||
3 | import "time" | 3 | import "time" |
4 | 4 | ||
5 | -//评估任务重复执行的方式 | ||
6 | -// type AssessTaskRepeatWay string | ||
7 | - | ||
8 | -// const ( | ||
9 | -// AssessTaskRepeatDay AssessTaskRepeatWay = "day" //按天重复 | ||
10 | -// AssessTaskRepeatWeek AssessTaskRepeatWay = "week" //按周重复 | ||
11 | -// AssessTaskRepeatMonth AssessTaskRepeatWay = "month" //按月 | ||
12 | -// AssessTaskRepeatMonthDouble AssessTaskRepeatWay = "month_double" //按双月 | ||
13 | -// AssessTaskRepeatQuarter AssessTaskRepeatWay = "quarter" //按季度 | ||
14 | -// AssessTaskRepeatYearHalf AssessTaskRepeatWay = "year_half" //按半年 | ||
15 | -// AssessTaskRepeatYear AssessTaskRepeatWay = "year" //按年 | ||
16 | -// ) | ||
17 | - | ||
18 | // 执行评估的任务列表 | 5 | // 执行评估的任务列表 |
19 | type StaffAssessTask struct { | 6 | type StaffAssessTask struct { |
20 | Id int `json:"id"` | 7 | Id int `json:"id"` |
@@ -23,6 +10,7 @@ type StaffAssessTask struct { | @@ -23,6 +10,7 @@ type StaffAssessTask struct { | ||
23 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 | 10 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 |
24 | CycleId int64 `json:"cycleId"` //对应的周期id | 11 | CycleId int64 `json:"cycleId"` //对应的周期id |
25 | CycleName string `json:"cycleName"` //对应周期的名称 | 12 | CycleName string `json:"cycleName"` //对应周期的名称 |
13 | + BeginDay string `json:"beginDay"` //绩效考核日期 | ||
26 | BeginTime time.Time `json:"beginTime"` //绩效考核开始时间 | 14 | BeginTime time.Time `json:"beginTime"` //绩效考核开始时间 |
27 | EndTime time.Time `json:"endTime"` //绩效考核截止时间 | 15 | EndTime time.Time `json:"endTime"` //绩效考核截止时间 |
28 | StepList []AssessTaskStep `json:"stepList"` //考评的流程 | 16 | StepList []AssessTaskStep `json:"stepList"` //考评的流程 |
@@ -17,6 +17,7 @@ type StaffAssessTask struct { | @@ -17,6 +17,7 @@ type StaffAssessTask struct { | ||
17 | CycleName string //对应周期的名称 | 17 | CycleName string //对应周期的名称 |
18 | ExecutorId []int //参与考评的人 | 18 | ExecutorId []int //参与考评的人 |
19 | StepList []domain.AssessTaskStep `` //考评的流程 | 19 | StepList []domain.AssessTaskStep `` //考评的流程 |
20 | + BeginDay string //日期 天 2006-01-02 | ||
20 | BeginTime time.Time //开始时间 | 21 | BeginTime time.Time //开始时间 |
21 | EndTime time.Time //截止时间 | 22 | EndTime time.Time //截止时间 |
22 | CreatedAt time.Time //数据创建时间 | 23 | CreatedAt time.Time //数据创建时间 |
@@ -29,6 +29,7 @@ func (repo *StaffAssessTaskRepository) TransformToDomain(d *models.StaffAssessTa | @@ -29,6 +29,7 @@ func (repo *StaffAssessTaskRepository) TransformToDomain(d *models.StaffAssessTa | ||
29 | EvaluationProjectName: d.EvaluationProjectName, | 29 | EvaluationProjectName: d.EvaluationProjectName, |
30 | CycleId: d.CycleId, | 30 | CycleId: d.CycleId, |
31 | CycleName: d.CycleName, | 31 | CycleName: d.CycleName, |
32 | + BeginDay: d.BeginDay, | ||
32 | BeginTime: d.BeginTime, | 33 | BeginTime: d.BeginTime, |
33 | EndTime: d.EndTime, | 34 | EndTime: d.EndTime, |
34 | StepList: d.StepList, | 35 | StepList: d.StepList, |
@@ -47,6 +48,7 @@ func (repo *StaffAssessTaskRepository) Save(d *domain.StaffAssessTask) (*domain. | @@ -47,6 +48,7 @@ func (repo *StaffAssessTaskRepository) Save(d *domain.StaffAssessTask) (*domain. | ||
47 | EvaluationProjectName: d.EvaluationProjectName, | 48 | EvaluationProjectName: d.EvaluationProjectName, |
48 | CycleId: d.CycleId, | 49 | CycleId: d.CycleId, |
49 | CycleName: d.CycleName, | 50 | CycleName: d.CycleName, |
51 | + BeginDay: d.BeginDay, | ||
50 | ExecutorId: d.ExecutorId, | 52 | ExecutorId: d.ExecutorId, |
51 | StepList: d.StepList, | 53 | StepList: d.StepList, |
52 | BeginTime: d.BeginTime, | 54 | BeginTime: d.BeginTime, |
@@ -115,9 +117,15 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{}) | @@ -115,9 +117,15 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{}) | ||
115 | if v, ok := queryOptions["offset"].(int); ok { | 117 | if v, ok := queryOptions["offset"].(int); ok { |
116 | query.Offset(v) | 118 | query.Offset(v) |
117 | } | 119 | } |
120 | + if v, ok := queryOptions["beginDay"]; ok { | ||
121 | + query.Where("begin_day=?", v) | ||
122 | + } | ||
118 | if v, ok := queryOptions["executorId"].(int); ok && v > 0 { | 123 | if v, ok := queryOptions["executorId"].(int); ok && v > 0 { |
119 | query.Where(`executor_id @>'[?]'`, v) | 124 | query.Where(`executor_id @>'[?]'`, v) |
120 | } | 125 | } |
126 | + if v, ok := queryOptions["evaluationProjectId"]; ok { | ||
127 | + query.Where("evaluation_project_id=?", v) | ||
128 | + } | ||
121 | count, err := query.SelectAndCount() | 129 | count, err := query.SelectAndCount() |
122 | if err != nil { | 130 | if err != nil { |
123 | return 0, nil, err | 131 | return 0, nil, err |
1 | +package controllers | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/linmadan/egglib-go/core/application" | ||
5 | + "github.com/linmadan/egglib-go/web/beego" | ||
6 | + "github.com/xuri/excelize/v2" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" | ||
8 | +) | ||
9 | + | ||
10 | +type ImportController struct { | ||
11 | + beego.BaseController | ||
12 | +} | ||
13 | + | ||
14 | +func (controller *ImportController) Import() { | ||
15 | + _, header, err := controller.GetFile("file") | ||
16 | + if err != nil { | ||
17 | + controller.Response(nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传错误:"+err.Error())) | ||
18 | + return | ||
19 | + } | ||
20 | + file, err := header.Open() | ||
21 | + if err != nil { | ||
22 | + controller.Response(nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传错误:"+err.Error())) | ||
23 | + return | ||
24 | + } | ||
25 | + reader, err := excelize.OpenReader(file) | ||
26 | + if err != nil { | ||
27 | + controller.Response(nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传错误:"+err.Error())) | ||
28 | + return | ||
29 | + } | ||
30 | + index := reader.GetActiveSheetIndex() | ||
31 | + rows, err := reader.GetRows(reader.GetSheetName(index)) | ||
32 | + if err != nil { | ||
33 | + controller.Response(nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "读取excel错误:"+err.Error())) | ||
34 | + return | ||
35 | + } | ||
36 | + formType := controller.GetString("type") | ||
37 | + switch formType { | ||
38 | + case "PerformanceDimension": | ||
39 | + dimensions, _ := domain.LoadPerformanceDimensions(rows) | ||
40 | + controller.Response(dimensions, nil) | ||
41 | + default: | ||
42 | + controller.Response(nil, application.ThrowError(application.ARG_ERROR, "请确认您导入的表单类型")) | ||
43 | + } | ||
44 | +} |
pkg/port/beego/routers/import_router.go
0 → 100644
1 | +package routers | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/beego/beego/v2/server/web" | ||
5 | + "github.com/linmadan/egglib-go/web/beego/filters" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares" | ||
8 | +) | ||
9 | + | ||
10 | +func init() { | ||
11 | + ns := web.NewNamespace("/v1/import", | ||
12 | + web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()), | ||
13 | + web.NSRouter("/", &controllers.ImportController{}, "Post:Import"), | ||
14 | + ) | ||
15 | + web.AddNamespace(ns) | ||
16 | +} |
-
请 注册 或 登录 后发表评论