Commit 4a321273 authored by 温志超's avatar 温志超

Merge remote-tracking branch 'origin/master'

parents d4434d96 cfa6dfbb
...@@ -111,6 +111,13 @@ cal.error.error18=\u521B\u5EFA\u6570\u636E\u72B6\u6001\u5F02\u5E38 ...@@ -111,6 +111,13 @@ cal.error.error18=\u521B\u5EFA\u6570\u636E\u72B6\u6001\u5F02\u5E38
cal.error.error19=\u5DE5\u4F5C\u5355\u5143\u4E3A\u7A7A,\u65E0\u6CD5\u6392\u73ED cal.error.error19=\u5DE5\u4F5C\u5355\u5143\u4E3A\u7A7A,\u65E0\u6CD5\u6392\u73ED
cal.error.error20=\u6CA1\u6709\u6307\u5B9A\u653E\u5047\u5BF9\u8C61 cal.error.error20=\u6CA1\u6709\u6307\u5B9A\u653E\u5047\u5BF9\u8C61
cal.error.error21=\u975E\u6CD5\u7684\u66F4\u65B0\u6570\u636E cal.error.error21=\u975E\u6CD5\u7684\u66F4\u65B0\u6570\u636E
cal.error.error22=\u73ED\u6B21\u5F00\u59CB\u65F6\u95F4\u65E9\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error23=\u73ED\u6B21\u7ED3\u675F\u65F6\u95F4\u665A\u4E8E\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u7ED3\u675F\u65F6\u95F4
cal.error.error24=\u73ED\u6B21\u7ED3\u675F\u65F6\u95F4\u65E9\u4E8E\u73ED\u6B21\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error25=\u4F11\u606F\u5F00\u59CB\u7ED3\u675F\u65F6\u95F4\u914D\u7F6E\u76F8\u7B49,\u4E0D\u53EF\u63D0\u4EA4
cal.error.error26=\u4F11\u606F\u5F00\u59CB\u65F6\u95F4\u65E9\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u5F00\u59CB\u65F6\u95F4
cal.error.error27=\u4F11\u606F\u7ED3\u675F\u65F6\u95F4\u665A\u4E8E\u4E8E\u8BA1\u5212\u5DE5\u4F5C\u7ED3\u675F\u65F6\u95F4
cal.error.error28=\u73ED\u6B21\u6DFB\u52A0\u4F11\u606F\u65F6\u95F4\u98A0\u5012,\u9700\u8981\u6309\u7167\u65F6\u95F4\u987A\u5E8F\u5F55\u5165
#pro.tool #pro.tool
pro.tool.error.error_1=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A pro.tool.error.error_1=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A
pro.tool.error.error_4=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A pro.tool.error.error_4=\u5200\u6A21\u7248\u5177\u5E76\u672A\u5168\u90E8\u4E0A\u673A
...@@ -216,5 +223,5 @@ qc.error.error7=\u68C0\u6D4B\u9879\u540D\u79F0\u5DF2\u5B58\u5728 ...@@ -216,5 +223,5 @@ qc.error.error7=\u68C0\u6D4B\u9879\u540D\u79F0\u5DF2\u5B58\u5728
#system.printer #system.printer
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86 system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
rule.currentSerial.error= \u8BE5\u4EA7\u54C1\u5E8F\u5217\u53F7\u5269\u4F59:{0}\u4E0D\u6EE1\u8DB3\u5DE5\u5355\u6570\u91CF:{1} rule.currentSerial.error= \u8BE5\u4EA7\u54C1\u5E8F\u5217\u53F7\u5269\u4F59:{0}\u4E0D\u6EE1\u8DB3\u5DE5\u5355\u6570\u91CF:{1}
#工作单元编不唯一 #\u5DE5\u4F5C\u5355\u5143\u7F16\u4E0D\u552F\u4E00
md.workUnit.error.workunitCode.unique = \u5de5\u5355\u5355\u5143\u7f16\u7801\u5df2\u5b58\u5728 md.workUnit.error.workunitCode.unique = \u5DE5\u5355\u5355\u5143\u7F16\u7801\u5DF2\u5B58\u5728
\ No newline at end of file \ No newline at end of file
...@@ -108,6 +108,13 @@ cal.error.error18=\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E22\u0E01\u ...@@ -108,6 +108,13 @@ cal.error.error18=\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E22\u0E01\u
cal.error.error19=\u0E2B\u0E19\u0E48\u0E27\u0E22\u0E07\u0E32\u0E19\u0E27\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E08\u0E31\u0E14\u0E15\u0E32\u0E23\u0E32\u0E07\u0E07\u0E32\u0E19\u0E44\u0E14\u0E49 cal.error.error19=\u0E2B\u0E19\u0E48\u0E27\u0E22\u0E07\u0E32\u0E19\u0E27\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E08\u0E31\u0E14\u0E15\u0E32\u0E23\u0E32\u0E07\u0E07\u0E32\u0E19\u0E44\u0E14\u0E49
cal.error.error20=\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E30\u0E1A\u0E38\u0E27\u0E31\u0E15\u0E16\u0E38\u0E27\u0E31\u0E19\u0E2B\u0E22\u0E38\u0E14 cal.error.error20=\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E30\u0E1A\u0E38\u0E27\u0E31\u0E15\u0E16\u0E38\u0E27\u0E31\u0E19\u0E2B\u0E22\u0E38\u0E14
cal.error.error21=\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E01\u0E32\u0E23\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07 cal.error.error21=\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E01\u0E32\u0E23\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07
cal.error.error22=\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E02\u0E2D\u0E07\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E27\u0E32\u0E07\u0E41\u0E1C\u0E19\u0E44\u0E27\u0E49
cal.error.error23=\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E07\u0E32\u0E19\u0E15\u0E32\u0E21\u0E41\u0E1C\u0E19
cal.error.error24=\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E02\u0E2D\u0E07\u0E01\u0E30\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E02\u0E2D\u0E07\u0E01\u0E30
cal.error.error25=\u0E01\u0E32\u0E23\u0E01\u0E4D\u0E32\u0E2B\u0E19\u0E14\u0E04\u0E48\u0E32\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E41\u0E25\u0E30\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E02\u0E2D\u0E07\u0E2A\u0E48\u0E27\u0E19\u0E17\u0E35\u0E48\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E08\u0E30\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E19\u0E41\u0E25\u0E30\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E2A\u0E48\u0E07\u0E44\u0E14\u0E49
cal.error.error26=\u0E40\u0E27\u0E25\u0E32\u0E1E\u0E31\u0E01\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E27\u0E32\u0E07\u0E41\u0E1C\u0E19\u0E44\u0E27\u0E49
cal.error.error27=\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E40\u0E27\u0E25\u0E32\u0E1E\u0E31\u0E01\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E07\u0E32\u0E19\u0E15\u0E32\u0E21\u0E41\u0E1C\u0E19
cal.error.error28=\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E27\u0E25\u0E32\u0E1E\u0E31\u0E01\u0E1C\u0E48\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E49\u0E2D\u0E19\u0E15\u0E32\u0E21\u0E25\u0E4D\u0E32\u0E14\u0E31\u0E1A\u0E40\u0E27\u0E25\u0E32
#pro.tool #pro.tool
pro.tool.error.error_1=\u0E41\u0E21\u0E48\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E21\u0E35\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E02\u0E36\u0E49\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 pro.tool.error.error_1=\u0E41\u0E21\u0E48\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E21\u0E35\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E02\u0E36\u0E49\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14
pro.tool.error.error_4=\u0E41\u0E21\u0E48\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E21\u0E35\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E02\u0E36\u0E49\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 pro.tool.error.error_4=\u0E41\u0E21\u0E48\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E21\u0E35\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E02\u0E36\u0E49\u0E19\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14
...@@ -159,7 +166,7 @@ pro.workOrder.error.error2=\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E23\u0E30\u0E1 ...@@ -159,7 +166,7 @@ pro.workOrder.error.error2=\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E23\u0E30\u0E1
pro.workOrder.error.error3=\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E01\u0E23\u0E30\u0E1A\u0E27\u0E19\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E14\u0E04\u0E25\u0E49\u0E2D\u0E07\u0E01\u0E31\u0E1A\u0E07\u0E32\u0E19\u0E01\u0E32\u0E23\u0E1C\u0E25\u0E34\u0E15\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07 pro.workOrder.error.error3=\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E01\u0E23\u0E30\u0E1A\u0E27\u0E19\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E14\u0E04\u0E25\u0E49\u0E2D\u0E07\u0E01\u0E31\u0E1A\u0E07\u0E32\u0E19\u0E01\u0E32\u0E23\u0E1C\u0E25\u0E34\u0E15\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07
pro.workOrder.error.error4=\u0E15\u0E32\u0E23\u0E32\u0E07\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E34\u0E14\u0E1B\u0E34\u0E14\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19\u0E41\u0E25\u0E49\u0E27 pro.workOrder.error.error4=\u0E15\u0E32\u0E23\u0E32\u0E07\u0E07\u0E32\u0E19\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E34\u0E14\u0E1B\u0E34\u0E14\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19\u0E41\u0E25\u0E49\u0E27
pro.workOrder.error.error5=\u0E2A\u0E16\u0E32\u0E19\u0E30\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E07\u0E32\u0E19\u0E16\u0E39\u0E01\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19\u0E41\u0E25\u0E30\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1B\u0E34\u0E14\u0E44\u0E14\u0E49\u0E0B\u0E49\u0E4D\u0E32 pro.workOrder.error.error5=\u0E2A\u0E16\u0E32\u0E19\u0E30\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E07\u0E32\u0E19\u0E16\u0E39\u0E01\u0E1B\u0E34\u0E14\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19\u0E41\u0E25\u0E30\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E1B\u0E34\u0E14\u0E44\u0E14\u0E49\u0E0B\u0E49\u0E4D\u0E32
pro.workOrder.status.published.error = \u0e44\u0e21\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e41\u0e01\u0e49\u0e44\u0e02\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e43\u0e19\u0e2a\u0e16\u0e32\u0e19\u0e30\u0e43\u0e1a\u0e2a\u0e31\u0e48\u0e07\u0e07\u0e32\u0e19\u0e19\u0e35\u0e49 pro.workOrder.status.published.error = \u0E44\u0E21\u0E48\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E43\u0E2B\u0E49\u0E41\u0E01\u0E49\u0E44\u0E02\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21\u0E43\u0E19\u0E2A\u0E16\u0E32\u0E19\u0E30\u0E43\u0E1A\u0E2A\u0E31\u0E48\u0E07\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49
#pro.material #pro.material
pro.material.error.not.exist=\u0E27\u0E31\u0E2A\u0E14\u0E38\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48 pro.material.error.not.exist=\u0E27\u0E31\u0E2A\u0E14\u0E38\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48
pro.material.error.error1=\u0E23\u0E2B\u0E31\u0E2A\u0E1A\u0E34\u0E25:{0},\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E1C\u0E25\u0E34\u0E15\u0E02\u0E2D\u0E07\u0E1A\u0E34\u0E25 pro.material.error.error1=\u0E23\u0E2B\u0E31\u0E2A\u0E1A\u0E34\u0E25:{0},\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E1C\u0E25\u0E34\u0E15\u0E02\u0E2D\u0E07\u0E1A\u0E34\u0E25
...@@ -183,16 +190,14 @@ pro.schedule.limit.min.duration=\u0E23\u0E30\u0E22\u0E30\u0E40\u0E27\u0E25\u0E32 ...@@ -183,16 +190,14 @@ pro.schedule.limit.min.duration=\u0E23\u0E30\u0E22\u0E30\u0E40\u0E27\u0E25\u0E32
pro.schedule.error.not.null.vendor=\u0E15\u0E31\u0E27\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E1C\u0E25\u0E20\u0E32\u0E22\u0E19\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E27\u0E48\u0E32\u0E07\u0E44\u0E14\u0E49 pro.schedule.error.not.null.vendor=\u0E15\u0E31\u0E27\u0E1B\u0E23\u0E30\u0E21\u0E27\u0E25\u0E1C\u0E25\u0E20\u0E32\u0E22\u0E19\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E27\u0E48\u0E32\u0E07\u0E44\u0E14\u0E49
pro.schedule.error.cannot.use.standardtime=\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E2B\u0E19\u0E48\u0E27\u0E22\u0E07\u0E32\u0E19\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07{0} pro.schedule.error.cannot.use.standardtime=\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E2B\u0E19\u0E48\u0E27\u0E22\u0E07\u0E32\u0E19\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07{0}
pro.schedule.error.cal.error1=\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E02\u0E2D\u0E07\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19 pro.schedule.error.cal.error1=\u0E40\u0E27\u0E25\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14\u0E02\u0E2D\u0E07\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E40\u0E27\u0E25\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19
pro.schedule.error.not.exist.solution=\u0e43\u0e1a\u0e2a\u0e31\u0e48\u0e07\u0e07\u0e32\u0e19\u0e02\u0e32\u0e14\u0e40\u0e2a\u0e49\u0e19\u0e17\u0e32\u0e07\u0e01\u0e23\u0e30\u0e1a\u0e27\u0e19\u0e01\u0e32\u0e23 pro.schedule.error.not.exist.solution=\u0E43\u0E1A\u0E2A\u0E31\u0E48\u0E07\u0E07\u0E32\u0E19\u0E02\u0E32\u0E14\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E01\u0E23\u0E30\u0E1A\u0E27\u0E19\u0E01\u0E32\u0E23
pro.schedule.error.not.exist.process = \u0e43\u0e1a\u0e2a\u0e31\u0e48\u0e07\u0e07\u0e32\u0e19\u003a{0}\u0e44\u0e21\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e2a\u0e16\u0e32\u0e19\u0e30\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e14\u0e49 pro.schedule.error.not.exist.process = \u0E43\u0E1A\u0E2A\u0E31\u0E48\u0E07\u0E07\u0E32\u0E19:{0}\u0E44\u0E21\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E2A\u0E16\u0E32\u0E19\u0E30\u0E17\u0E35\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E41\u0E01\u0E49\u0E44\u0E02\u0E44\u0E14\u0E49
pro.schedule.error.fail=\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07\u0E25\u0E4D\u0E32\u0E14\u0E31\u0E1A\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27{0},{1},{2} pro.schedule.error.fail=\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07\u0E25\u0E4D\u0E32\u0E14\u0E31\u0E1A\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27{0},{1},{2}
pro.schedule.error.not.exist.main.task=\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E20\u0E32\u0E23\u0E01\u0E34\u0E08\u0E01\u0E32\u0E23\u0E16\u0E48\u0E32\u0E22\u0E42\u0E2D\u0E19\u0E2B\u0E25\u0E31\u0E01 pro.schedule.error.not.exist.main.task=\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E20\u0E32\u0E23\u0E01\u0E34\u0E08\u0E01\u0E32\u0E23\u0E16\u0E48\u0E32\u0E22\u0E42\u0E2D\u0E19\u0E2B\u0E25\u0E31\u0E01
pro.schedule.error.split.quantity.black=\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E48\u0E07\u0E08\u0E30\u0E15\u0E49\u0E2D\u0E07\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E2D\u0E2D\u0E01\u0E21\u0E32 pro.schedule.error.split.quantity.black=\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E48\u0E07\u0E08\u0E30\u0E15\u0E49\u0E2D\u0E07\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E2D\u0E2D\u0E01\u0E21\u0E32
#pro.feedback #pro.feedback
pro.feedback.error.not.data=\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19 pro.feedback.error.not.data=\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19
pro.feedback.error.notTheLatest = \u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e14\u0e49 pro.feedback.error.notTheLatest = \u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E25\u0E48\u0E32\u0E2A\u0E38\u0E14\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E41\u0E01\u0E49\u0E44\u0E02\u0E44\u0E14\u0E49
pro.feedback.error.repeat.serialno.report=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E0B\u0E35\u0E40\u0E23\u0E35\u0E22\u0E25\u0E19\u0E35\u0E49\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E41\u0E25\u0E49\u0E27 pro.feedback.error.repeat.serialno.report=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E0B\u0E35\u0E40\u0E23\u0E35\u0E22\u0E25\u0E19\u0E35\u0E49\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E41\u0E25\u0E49\u0E27
pro.feedback.error.serialno.not.bind.workOrder=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E0B\u0E35\u0E40\u0E23\u0E35\u0E22\u0E25\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E2A\u0E4D\u0E32\u0E2B\u0E23\u0E31\u0E1A\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49 pro.feedback.error.serialno.not.bind.workOrder=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E0B\u0E35\u0E40\u0E23\u0E35\u0E22\u0E25\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E38\u0E13\u0E2A\u0E21\u0E1A\u0E31\u0E15\u0E34\u0E2A\u0E4D\u0E32\u0E2B\u0E23\u0E31\u0E1A\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49
pro.feedback.error.min.quantity=\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E07\u0E32\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A0 pro.feedback.error.min.quantity=\u0E08\u0E4D\u0E32\u0E19\u0E27\u0E19\u0E07\u0E32\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A0
...@@ -214,9 +219,9 @@ qc.error.error6=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E01\u0E32\u0E23\u0E ...@@ -214,9 +219,9 @@ qc.error.error6=\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E01\u0E32\u0E23\u0E
qc.error.error7=\u0E21\u0E35\u0E0A\u0E37\u0E48\u0E2D\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E2D\u0E22\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27 qc.error.error7=\u0E21\u0E35\u0E0A\u0E37\u0E48\u0E2D\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E2D\u0E22\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27
#system.printer #system.printer
system.printer.error.repeat.bind=\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E16\u0E39\u0E01\u0E1C\u0E39\u0E01\u0E44\u0E27\u0E49 system.printer.error.repeat.bind=\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E16\u0E39\u0E01\u0E1C\u0E39\u0E01\u0E44\u0E27\u0E49
md.workStation.error.not.productionSolutionCode = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u0020\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e01\u0e23\u0e2d\u0e01 md.workStation.error.not.productionSolutionCode = ProductionSolutionCode\u0020\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E01\u0E23\u0E2D\u0E01
md.workStation.error.productionSolutionCode.unique = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u003a\u0020\u0e44\u0e21\u0e48\u0e40\u0e09\u0e1e\u0e32\u0e30 md.workStation.error.productionSolutionCode.unique = ProductionSolutionCode:\u0020\u0E44\u0E21\u0E48\u0E40\u0E09\u0E1E\u0E32\u0E30
md.workStation.error.productionSolutionCode.size = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u003a\u0020\u0e21\u0e35\u0e04\u0e48\u0e32\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27 md.workStation.error.productionSolutionCode.size = ProductionSolutionCode:\u0020\u0E21\u0E35\u0E04\u0E48\u0E32\u0E21\u0E32\u0E01\u0E02\u0E36\u0E49\u0E19\u0E2D\u0E22\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27
rule.currentSerial.error= \u0e2b\u0e21\u0e32\u0e22\u0e40\u0e25\u0e02\u0e1c\u0e25\u0e34\u0e15\u0e20\u0e31\u0e13\u0e11\u0e4c\u0020\u0e40\u0e2b\u0e25\u0e37\u0e2d {0},\u0e44\u0e21\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1b\u0e15\u0e32\u0e21\u0e08\u0e33\u0e19\u0e27\u0e19\u0e43\u0e1a\u0e2a\u0e31\u0e48\u0e07\u0e07\u0e32\u0e19{1} rule.currentSerial.error= \u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1C\u0E25\u0E34\u0E15\u0E20\u0E31\u0E13\u0E11\u0E4C\u0020\u0E40\u0E2B\u0E25\u0E37\u0E2D {0},\u0E44\u0E21\u0E48\u0E40\u0E1B\u0E47\u0E19\u0E44\u0E1B\u0E15\u0E32\u0E21\u0E08\u0E33\u0E19\u0E27\u0E19\u0E43\u0E1A\u0E2A\u0E31\u0E48\u0E07\u0E07\u0E32\u0E19{1}
#工作单元编不唯一 #\u5DE5\u4F5C\u5355\u5143\u7F16\u4E0D\u552F\u4E00
md.workUnit.error.workunitCode.unique = \u0e2b\u0e21\u0e32\u0e22\u0e40\u0e25\u0e02\u0e17\u0e35\u0e48\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27 md.workUnit.error.workunitCode.unique = \u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E17\u0E35\u0E48\u0E21\u0E35\u0E2D\u0E22\u0E39\u0E48\u0E41\u0E25\u0E49\u0E27
\ No newline at end of file \ No newline at end of file
...@@ -66,6 +66,13 @@ public class BaseEntity implements Serializable { ...@@ -66,6 +66,13 @@ public class BaseEntity implements Serializable {
return (T) o; return (T) o;
} }
public <T extends BaseEntity> T deepSetObjParameter(T t) {
Object o = t.deepCopyObj();
DataUtil.copyFieldsAndSetValues(this, o);
return (T) o;
}
public <T> T deepSetObj(Class<T> tClass) { public <T> T deepSetObj(Class<T> tClass) {
T target = this.deepCopyObj(tClass); T target = this.deepCopyObj(tClass);
DataUtil.copyFieldsAndSetValues(this, target); DataUtil.copyFieldsAndSetValues(this, target);
......
...@@ -22,7 +22,6 @@ import com.ximai.mes.cal.service.ICalPlanService; ...@@ -22,7 +22,6 @@ import com.ximai.mes.cal.service.ICalPlanService;
import com.ximai.mes.cal.service.ICalPlanTeamService; import com.ximai.mes.cal.service.ICalPlanTeamService;
import com.ximai.mes.cal.service.ICalShiftService; import com.ximai.mes.cal.service.ICalShiftService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.aspectj.bridge.Message;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -32,10 +31,7 @@ import javax.annotation.Resource; ...@@ -32,10 +31,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.ximai.common.utils.data.DateUtils.formatShiftDate; import static com.ximai.common.utils.data.DateUtils.formatShiftDate;
...@@ -88,12 +84,10 @@ public class CalPlanController extends BaseController { ...@@ -88,12 +84,10 @@ public class CalPlanController extends BaseController {
@PostMapping @PostMapping
@ApiOperation("排班计划新增") @ApiOperation("排班计划新增")
public AjaxResult add(@RequestBody CalPlan calPlan) { public AjaxResult add(@RequestBody CalPlan calPlan) {
checkPlan(calPlan);
List<CalPlan> calPlans = calPlanMapper.selectListByQw(new QueryWrapper<CalPlan>().eq("plan_code", calPlan.getPlanCode())); List<CalPlan> calPlans = calPlanMapper.selectListByQw(new QueryWrapper<CalPlan>().eq("plan_code", calPlan.getPlanCode()));
ExceptionUtil.checkTrueThrowException(CollectionUtil.isNotEmpty(calPlans), MessageUtils.message("cal.error.error1")); ExceptionUtil.checkTrueThrowException(CollectionUtil.isNotEmpty(calPlans), MessageUtils.message("cal.error.error1"));
checkPlan(calPlan);
// 插入方案 // 插入方案
calPlanService.insertCalPlan(calPlan); calPlanService.insertCalPlan(calPlan);
...@@ -123,104 +117,168 @@ public class CalPlanController extends BaseController { ...@@ -123,104 +117,168 @@ public class CalPlanController extends BaseController {
private static void checkPlan(CalPlan calPlan) { private static void checkPlan(CalPlan calPlan) {
List<CalShift> calShifts = calPlan.getCalShifts(); List<CalShift> calShifts = calPlan.getCalShifts();
ExceptionUtil.checkTrueThrowException(calShifts == null || CollectionUtil.isEmpty(calShifts), MessageUtils.message("cal.error.error2")); ExceptionUtil.checkTrueThrowException(calShifts == null || CollectionUtil.isEmpty(calShifts), MessageUtils.message("cal.error.error2"));
ExceptionUtil.checkTrueThrowException(calPlan.getStartDate() == null || calPlan.getEndDate() == null, MessageUtils.message("cal.error.error3")); Date planStartDate = calPlan.getStartDate();
ExceptionUtil.checkTrueThrowException(calPlan.getStartDate().getTime() > calPlan.getEndDate().getTime(), MessageUtils.message("cal.error.error4")); Date planEndDate = calPlan.getEndDate();
ExceptionUtil.checkTrueThrowException(planStartDate == null || planEndDate == null, MessageUtils.message("cal.error.error3"));
ExceptionUtil.checkTrueThrowException(planStartDate.getTime() > planEndDate.getTime(), MessageUtils.message("cal.error.error4"));
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calShifts), MessageUtils.message("cal.error.error5"));
ExceptionUtil.checkTrueThrowException(calShifts.stream().filter(x -> long count = calShifts.stream().filter(x ->
(x.getEndTime() == null && x.getEndTime() == "") || (x.getEndTime() == null && x.getEndTime() == "") ||
(x.getStartTime() == null && x.getStartTime() == "") (x.getStartTime() == null && x.getStartTime() == "")
).count() > 0, MessageUtils.message("cal.error.error5")); ).count();
ExceptionUtil.checkTrueThrowException(count > 0, MessageUtils.message("cal.error.error5"));
String shiftType = calPlan.getShiftType(); String shiftType = calPlan.getShiftType();
int size = calShifts.size(); int size = calShifts.size();
ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_SINGLE.equals(shiftType) && size != 1, MessageUtils.message("cal.error.error6")); ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_SINGLE.equals(shiftType) && size != 1, MessageUtils.message("cal.error.error7"));
ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_TWO.equals(shiftType) && size != 2, MessageUtils.message("cal.error.error7")); ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_TWO.equals(shiftType) && size != 2, MessageUtils.message("cal.error.error7"));
ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_THREE.equals(shiftType) && size != 3, MessageUtils.message("cal.error.error8")); ExceptionUtil.checkTrueThrowException(UserConstants.CAL_SHIFT_TYPE_THREE.equals(shiftType) && size != 3, MessageUtils.message("cal.error.error8"));
Date startDate = calPlan.getStartDate(); Date shiftStartDate = null;
Date endDate = null; Date shiftEndDate = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String startDateFormat = sdf.format(startDate); String nowDateFormat = sdf.format(planStartDate);
String endDateFormat = sdf.format(startDate);
Set<Integer> collect2 = calShifts.stream().map(CalShift::getOrderNum).filter(Objects::nonNull).collect(Collectors.toSet()); Set<Integer> collect2 = calShifts.stream().map(CalShift::getOrderNum).filter(Objects::nonNull).collect(Collectors.toSet());
ExceptionUtil.checkTrueThrowException(collect2.size() != calShifts.size(), MessageUtils.message("cal.error.error9")); ExceptionUtil.checkTrueThrowException(collect2.size() != calShifts.size(), MessageUtils.message("cal.error.error9"));
for (CalShift calShift : calShifts) { for (CalShift calShift : calShifts) {
String shiftName = calShift.getShiftName(); String shiftName = calShift.getShiftName();
endDate = formatShiftDate(endDateFormat, calShift.getEndTime()); String nextDateFormat = null;
startDate = formatShiftDate(startDateFormat, calShift.getStartTime()); String endTime = calShift.getEndTime();
shiftStartDate = formatShiftDate(nowDateFormat, calShift.getStartTime());
shiftEndDate = formatShiftDate(nowDateFormat, endTime);
if (Objects.equals(shiftName, "夜班")) { if (Objects.equals(shiftName, "夜班")) {
if (shiftStartDate.getTime() > shiftEndDate.getTime()) {
Date nextDay = DateUtils.getNextDay(planStartDate);
if (startDate.getTime() > endDate.getTime()) {
startDate = calPlan.getStartDate();
Date nextDay = DateUtils.getNextDay(startDate);
//今天日期 //今天日期
sdf = new SimpleDateFormat("yyyy-MM-dd"); sdf = new SimpleDateFormat("yyyy-MM-dd");
endDateFormat = sdf.format(nextDay); nextDateFormat = sdf.format(nextDay);
endDate = formatShiftDate(endDateFormat, calShift.getEndTime()); shiftEndDate = formatShiftDate(nextDateFormat, endTime);
} }
} }
ExceptionUtil.checkTrueThrowException(planStartDate.getTime() >= shiftStartDate.getTime(), shiftName + MessageUtils.message("cal.error.error22"));
ExceptionUtil.checkTrueThrowException(planEndDate.getTime() <= shiftEndDate.getTime(), shiftName + MessageUtils.message("cal.error.error23"));
calShift.setExecEndTime(shiftEndDate);
calShift.setExecStartTime(shiftStartDate);
ExceptionUtil.checkTrueThrowException(shiftEndDate.getTime() < shiftStartDate.getTime(),shiftName+ MessageUtils.message("cal.error.error24", shiftName));
List<CalShift> breakTimeList = calShift.getBreakTimeList(); List<CalShift> breakTimeList = calShift.getBreakTimeList();
if (CollectionUtil.isNotEmpty(breakTimeList)) { if (CollectionUtil.isNotEmpty(breakTimeList)) {
Set<Integer> collect = breakTimeList.stream().map(CalShift::getOrderNum).filter(Objects::nonNull).collect(Collectors.toSet()); Set<Integer> collect = breakTimeList.stream().map(CalShift::getOrderNum).filter(Objects::nonNull).collect(Collectors.toSet());
ExceptionUtil.checkTrueThrowException(collect.size() != breakTimeList.size(), MessageUtils.message("cal.error.error10")); ExceptionUtil.checkTrueThrowException(collect.size() != breakTimeList.size(), MessageUtils.message("cal.error.error10"));
ExceptionUtil.checkTrueThrowException(endDate.getTime() <= startDate.getTime(),
MessageUtils.message("cal.error.error11", shiftName));
ExceptionUtil.checkTrueThrowException(shiftEndDate.getTime() <= shiftStartDate.getTime(), shiftName + MessageUtils.message("cal.error.error24", shiftName));
breakTimeList.sort(Comparator.comparing(CalShift::getOrderNum));
if (breakTimeList.size() == 2) { if (breakTimeList.size() == 2) {
CalShift calShift1 = breakTimeList.get(0); CalShift calShift1 = breakTimeList.get(0);
Date breakStartDate1 = formatShiftDate(startDateFormat, calShift1.getBreakStartTime());
Date breakEndDate1 = formatShiftDate(endDateFormat, calShift1.getBreakEndTime());
CalShift calShift2 = breakTimeList.get(1); CalShift calShift2 = breakTimeList.get(1);
Date breakStartDate2 = formatShiftDate(startDateFormat, calShift2.getBreakStartTime()); String breakStartTime1 = calShift1.getBreakStartTime();
Date breakEndDate2 = formatShiftDate(endDateFormat, calShift2.getBreakEndTime()); String breakEndTime1 = calShift1.getBreakEndTime();
ExceptionUtil.checkTrueThrowException(Objects.equals(breakStartTime1, breakEndTime1), MessageUtils.message("cal.error.error25"));
String breakStartTime2 = calShift2.getBreakStartTime();
String breakEndTime2 = calShift2.getBreakEndTime();
ExceptionUtil.checkTrueThrowException(Objects.equals(breakStartTime2, breakEndTime2), MessageUtils.message("cal.error.error25"));
Date breakStartDate1 = formatShiftDate(nowDateFormat, breakStartTime1);
Date breakEndDate1 = formatShiftDate(nowDateFormat, breakEndTime1);
Date breakStartDate2 = formatShiftDate(nowDateFormat, breakStartTime2);
Date breakEndDate2 = formatShiftDate(nowDateFormat, breakEndTime2);
Integer nextDay1 = calShift1.getNextDay();
if (nextDay1 != null && nextDay1 == 1) {
if (breakEndDate1.after(breakStartDate1)) {
breakStartDate1 = formatShiftDate(nextDateFormat, breakStartTime1);
breakEndDate1 = formatShiftDate(nextDateFormat, breakEndTime1);
} else {
breakEndDate1 = formatShiftDate(nextDateFormat, breakEndTime1);
}
}
Integer nextDay2 = calShift2.getNextDay();
if (nextDay2 != null && nextDay2 == 1) {
if (breakEndDate2.after(breakStartDate2)) {
breakStartDate2 = formatShiftDate(nextDateFormat, breakStartTime2);
breakEndDate2 = formatShiftDate(nextDateFormat, breakEndTime2);
} else {
breakEndDate2 = formatShiftDate(nextDateFormat, breakEndTime2);
}
}
ExceptionUtil.checkTrueThrowException( ExceptionUtil.checkTrueThrowException(
(breakEndDate1.getTime() <= breakStartDate1.getTime()) || !breakEndDate2.after(breakStartDate1),
(breakEndDate2.getTime() <= breakStartDate2.getTime()), shiftName + MessageUtils.message("cal.error.error28"));
MessageUtils.message("cal.error.error12", shiftName));
ExceptionUtil.checkTrueThrowException(shiftStartDate.after(breakStartDate1), shiftName + MessageUtils.message("cal.error.error26"));
ExceptionUtil.checkTrueThrowException(breakStartDate2.after(shiftEndDate), shiftName + MessageUtils.message("cal.error.error27"));
boolean afterA = breakEndDate1.after(breakStartDate1);
boolean afterB = breakStartDate2.after(breakEndDate1);
boolean afterC = breakEndDate2.after(breakStartDate2);
ExceptionUtil.checkTrueThrowException( ExceptionUtil.checkTrueThrowException(
(breakEndDate1.getTime() > breakEndDate2.getTime() || breakStartDate1 !(afterA && afterB && afterC),
.getTime() > breakStartDate2.getTime()) || MessageUtils.message("cal.error.error13", shiftName));
!DateUtils.isTimePeriodOverlapping(breakStartDate1, breakEndDate1, breakStartDate2, breakEndDate2) ||
DateUtils.hasTimeOverlap(breakStartDate1, breakEndDate1, breakStartDate2, breakEndDate2),
MessageUtils.message("cal.error.error13", shiftName)); CalShift o1 = calShift1.deepCopyObj();
o1.setExecStartTime(breakStartDate1);
ExceptionUtil.checkTrueThrowException( o1.setExecEndTime(breakEndDate1);
(breakStartDate1.getTime() < startDate.getTime()) || o1.setRestFlag(1);
(breakStartDate2.getTime() < startDate.getTime()), o1.setOperType(1);
MessageUtils.message("cal.error.error14", shiftName)); o1.setShiftName(shiftName);
CalShift o2 = calShift2.deepCopyObj();
o2.setExecStartTime(breakStartDate2);
ExceptionUtil.checkTrueThrowException( o2.setExecEndTime(breakEndDate2);
(breakEndDate1.getTime() > endDate.getTime()) || o2.setRestFlag(1);
(breakEndDate2.getTime() > endDate.getTime()), o2.setOperType(1);
MessageUtils.message("cal.error.error15", shiftName)); o2.setShiftName(shiftName);
calShift.setBreakTimeList(Arrays.asList(o1, o2));
continue;
} }
if (breakTimeList.size() == 1) { if (breakTimeList.size() == 1) {
CalShift calShift1 = breakTimeList.get(0); CalShift calShift1 = breakTimeList.get(0);
Date breakStartDate1 = formatShiftDate(startDateFormat, calShift1.getBreakStartTime()); String breakStartTime1 = calShift1.getBreakStartTime();
Date breakEndDate1 = formatShiftDate(endDateFormat, calShift1.getBreakEndTime()); String breakEndTime1 = calShift1.getBreakEndTime();
ExceptionUtil.checkTrueThrowException(breakEndDate1.getTime() <= breakStartDate1.getTime(), MessageUtils.message("cal.error.error16", shiftName)); Date breakStartDate1 = formatShiftDate(nowDateFormat, breakStartTime1);
Date breakEndDate1 = formatShiftDate(nowDateFormat, breakEndTime1);
ExceptionUtil.checkTrueThrowException(breakStartDate1.getTime() < startDate.getTime(), MessageUtils.message("cal.error.error14", shiftName));
ExceptionUtil.checkTrueThrowException(breakEndDate1.getTime() > endDate.getTime(), MessageUtils.message("cal.error.error15", shiftName));
Integer nextDay = calShift1.getNextDay();
if (nextDay != null && nextDay == 1) {
if (breakEndDate1.after(breakStartDate1)) {
breakStartDate1 = formatShiftDate(nextDateFormat, breakStartTime1);
breakEndDate1 = formatShiftDate(nextDateFormat, breakEndTime1);
} else {
breakEndDate1 = formatShiftDate(nextDateFormat, breakEndTime1);
}
}
ExceptionUtil.checkTrueThrowException(shiftStartDate.after(breakStartDate1), shiftName + MessageUtils.message("cal.error.error26"));
ExceptionUtil.checkTrueThrowException(breakEndDate1.after(shiftEndDate), shiftName + MessageUtils.message("cal.error.error27"));
ExceptionUtil.checkTrueThrowException(!breakEndDate1.after(breakStartDate1), MessageUtils.message("cal.error.error13"));
CalShift o = calShift1.deepCopyObj();
o.setExecEndTime(breakEndDate1);
o.setExecStartTime(breakStartDate1);
o.setRestFlag(1);
o.setOperType(1);
o.setShiftName(shiftName);
calShift.setBreakTimeList(Collections.singletonList(o));
continue;
} }
} }
...@@ -236,11 +294,13 @@ public class CalPlanController extends BaseController { ...@@ -236,11 +294,13 @@ public class CalPlanController extends BaseController {
@Log(title = "排班计划修改完成", businessType = BusinessType.UPDATE) @Log(title = "排班计划修改完成", businessType = BusinessType.UPDATE)
@PutMapping("/releasePlan") @PutMapping("/releasePlan")
public AjaxResult releasePlan(@RequestBody CalPlan calPlan) { public AjaxResult releasePlan(@RequestBody CalPlan calPlan) {
checkPlan(calPlan);
ExceptionUtil.checkTrueThrowException(!UserConstants.ORDER_STATUS_CONFIRMED.equals(calPlan.getStatus()), MessageUtils.message("cal.error.error17")); ExceptionUtil.checkTrueThrowException(!UserConstants.ORDER_STATUS_CONFIRMED.equals(calPlan.getStatus()), MessageUtils.message("cal.error.error17"));
checkPlan(calPlan);
calPlan.setUpdateBy(SecurityUtils.getUsername()); calPlan.setUpdateBy(SecurityUtils.getUsername());
calPlan.setUpdateTime(DateUtils.getNowDate()); calPlan.setUpdateTime(DateUtils.getNowDate());
calPlan.setCreateTime(DateUtils.getNowDate());
calPlan.setCreateBy(SecurityUtils.getUsername());
calPlanService.releasePlan(calPlan); calPlanService.releasePlan(calPlan);
return AjaxResult.success(); return AjaxResult.success();
} }
......
...@@ -7,13 +7,11 @@ import com.ximai.common.core.controller.BaseController; ...@@ -7,13 +7,11 @@ import com.ximai.common.core.controller.BaseController;
import com.ximai.common.core.domain.AjaxResult; import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.core.page.TableDataInfo; import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType; import com.ximai.common.enums.BusinessType;
import com.ximai.common.utils.MessageUtils;
import com.ximai.common.utils.data.ExceptionUtil; import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.mes.cal.domain.CalPlanWorkunit; import com.ximai.mes.cal.domain.CalPlanWorkunit;
import com.ximai.mes.cal.service.ICalPlanWorkunitService; import com.ximai.mes.cal.service.ICalPlanWorkunitService;
import com.ximai.mes.constant.CalPlanWorkunitEnum; import com.ximai.mes.constant.CalPlanWorkunitEnum;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.aspectj.bridge.Message;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -97,14 +95,14 @@ public class CalPlanWorkunitController extends BaseController { ...@@ -97,14 +95,14 @@ public class CalPlanWorkunitController extends BaseController {
@Log(title = "计划工作单元", businessType = BusinessType.UPDATE) @Log(title = "计划工作单元", businessType = BusinessType.UPDATE)
@PutMapping(value = "/editList") @PutMapping(value = "/editList")
public AjaxResult editList(@RequestBody List<CalPlanWorkunit> calPlanWorkunits) { public AjaxResult editList(@RequestBody List<CalPlanWorkunit> calPlanWorkunits) {
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calPlanWorkunits), MessageUtils.message("cal.error.error20")); ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calPlanWorkunits), "没有指定放假对象");
long count = calPlanWorkunits.stream().filter( long count = calPlanWorkunits.stream().filter(
x -> x.getWorkunitId() == null || x -> x.getWorkunitId() == null ||
x.getTheDay() == null || x.getTheDay() == null ||
x.getShiftName() == null || x.getShiftName() == null ||
x.getIsWork() == null).count(); x.getIsWork() == null).count();
ExceptionUtil.checkTrueThrowException(count > 0, MessageUtils.message("cal.error.error21")); ExceptionUtil.checkTrueThrowException(count > 0, "非法的更新数据");
// workunit_id,the_day,shift_name // workunit_id,the_day,shift_name
for (CalPlanWorkunit calPlanWorkunit : calPlanWorkunits) { for (CalPlanWorkunit calPlanWorkunit : calPlanWorkunits) {
...@@ -132,6 +130,6 @@ public class CalPlanWorkunitController extends BaseController { ...@@ -132,6 +130,6 @@ public class CalPlanWorkunitController extends BaseController {
@Log(title = "计划工作单元删除", businessType = BusinessType.DELETE) @Log(title = "计划工作单元删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{planWorkunitIds}") @DeleteMapping("/{planWorkunitIds}")
public AjaxResult remove(@PathVariable Long[] planWorkunitIds) { public AjaxResult remove(@PathVariable Long[] planWorkunitIds) {
return toAjax(calPlanWorkunitService.deleteCalPlanWorkunitByPlanWorkunitIds(planWorkunitIds)); return toAjax(calPlanWorkunitService.deleteListByIds(planWorkunitIds));
} }
} }
...@@ -82,10 +82,10 @@ public class CalShiftController extends BaseController { ...@@ -82,10 +82,10 @@ public class CalShiftController extends BaseController {
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getWorkunitId()), "cpw.workunit_id", calPlanWorkunit.getWorkunitId()); calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getWorkunitId()), "cpw.workunit_id", calPlanWorkunit.getWorkunitId());
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getTheDay()), "cpw.the_day", calPlanWorkunit.getTheDay()); calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getTheDay()), "cpw.the_day", calPlanWorkunit.getTheDay());
calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getShiftName()), "ash.shift_name", calPlanWorkunit.getShiftName()); calShiftVoQueryWrapper.eq(StringUtils.isNotEmpty(calPlanWorkunit.getShiftName()), "ash.shift_name", calPlanWorkunit.getShiftName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkunitCode()), "cpw.workunit_code", calPlanWorkunit.getWorkunitCode());
calShiftVoQueryWrapper.apply(StringUtils.isNotEmpty(calPlanWorkunit.getWorkstationName()), "LOWER(mws.workstation_name) like CONCAT('%',LOWER({0}),'%')", calPlanWorkunit.getWorkstationName());
calShiftVoQueryWrapper.apply(StringUtils.isNotEmpty(calPlanWorkunit.getWorkshopName()), "LOWER(mws.workshop_name) like CONCAT('%',LOWER({0}),'%')", calPlanWorkunit.getWorkshopName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkstationName()), "mws.workstation_name", calPlanWorkunit.getWorkstationName());
calShiftVoQueryWrapper.like(StringUtils.isNotEmpty(calPlanWorkunit.getWorkshopName()), "mws.workshop_name", calPlanWorkunit.getWorkshopName());
return getDataTable(calShiftMapper.selectOnWorkShiftByQw(calShiftVoQueryWrapper)); return getDataTable(calShiftMapper.selectOnWorkShiftByQw(calShiftVoQueryWrapper));
} }
......
...@@ -8,7 +8,6 @@ import com.ximai.common.enums.BusinessType; ...@@ -8,7 +8,6 @@ import com.ximai.common.enums.BusinessType;
import com.ximai.mes.cal.domain.CalWorkunit; import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.cal.service.ICalWorkunitService; import com.ximai.mes.cal.service.ICalWorkunitService;
import com.ximai.mes.md.domain.MdWorkunit; import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.service.IMdWorkunitService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -33,8 +32,6 @@ public class CalWorkunitController extends BaseController { ...@@ -33,8 +32,6 @@ public class CalWorkunitController extends BaseController {
@Autowired @Autowired
private ICalWorkunitService calWorkunitService; private ICalWorkunitService calWorkunitService;
@Autowired
private IMdWorkunitService mdWorkunitService;
/** /**
* 查询计划工作单元列表 * 查询计划工作单元列表
...@@ -58,6 +55,26 @@ public class CalWorkunitController extends BaseController { ...@@ -58,6 +55,26 @@ public class CalWorkunitController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询计划勾选的工作单元之外的所有工作的单元
*/
// @PreAuthorize("@ss.hasPermi('md:workunit:list')")
@GetMapping("/getWorkunitByPlanId")
public TableDataInfo getWorkunitByPlanId(CalWorkunit calWorkunit) {
List<CalWorkunit> calWorkunits = new ArrayList<>();
if (calWorkunit.getPlanId() != null) {
CalWorkunit checkAll = new CalWorkunit();
checkAll.setPlanId(calWorkunit.getPlanId());
calWorkunits = calWorkunitService.selectCalWorkunitList(checkAll);
}
startPage();
List<MdWorkunit> mdWorkunits = calWorkunitService.getWorkunitByPlanId(calWorkunit,calWorkunits);
return getDataTable(mdWorkunits);
}
@GetMapping("/calWorkunitList") @GetMapping("/calWorkunitList")
public AjaxResult calWorkunitList() { public AjaxResult calWorkunitList() {
List<CalWorkunit> list = calWorkunitService.selectCalWorkunitList(new CalWorkunit()); List<CalWorkunit> list = calWorkunitService.selectCalWorkunitList(new CalWorkunit());
...@@ -85,7 +102,7 @@ public class CalWorkunitController extends BaseController { ...@@ -85,7 +102,7 @@ public class CalWorkunitController extends BaseController {
@PreAuthorize("@ss.hasPermi('md:workunit:query')") @PreAuthorize("@ss.hasPermi('md:workunit:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(calWorkunitService.selectCalWorkunitById(id)); return AjaxResult.success(calWorkunitService.getObjById(id));
} }
/** /**
......
...@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; ...@@ -6,6 +6,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ximai.common.annotation.Excel; import com.ximai.common.annotation.Excel;
import com.ximai.common.core.domain.BaseEntity; import com.ximai.common.core.domain.BaseEntity;
......
...@@ -106,7 +106,6 @@ public class CalPlan extends BaseEntity { ...@@ -106,7 +106,6 @@ public class CalPlan extends BaseEntity {
* 预留字段4 * 预留字段4
*/ */
private Long attr4; private Long attr4;
@ApiModelProperty(value = "轮班班次列表") @ApiModelProperty(value = "轮班班次列表")
private List<CalShift> calShifts; private List<CalShift> calShifts;
......
...@@ -35,7 +35,20 @@ public class CalPlanWorkunit extends BaseEntity { ...@@ -35,7 +35,20 @@ public class CalPlanWorkunit extends BaseEntity {
@ApiModelProperty(value = "计划id") @ApiModelProperty(value = "计划id")
@Excel(name = "计划ID") @Excel(name = "计划ID")
private Long planId; private Long planId;
/**
* 计划ID
*/
@ApiModelProperty(value = "计划id")
@Excel(name = "计划ID")
private String planCode;
/**
* 计划ID
*/
@ApiModelProperty(value = "计划id")
@Excel(name = "计划ID")
private String planName;
@ApiModelProperty(value = "班次类型") @ApiModelProperty(value = "班次类型")
private String shiftType; private String shiftType;
...@@ -121,6 +134,12 @@ public class CalPlanWorkunit extends BaseEntity { ...@@ -121,6 +134,12 @@ public class CalPlanWorkunit extends BaseEntity {
@Excel(name = "结束时间") @Excel(name = "结束时间")
private Date endDate; private Date endDate;
/**
* 开始数据和结束时间
*/
@TableField(exist = false)
private String workDate;
// /** // /**
// * 开始时间 // * 开始时间
......
...@@ -26,6 +26,8 @@ public class CalShift extends BaseEntity { ...@@ -26,6 +26,8 @@ public class CalShift extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private int restFlag = 0; private int restFlag = 0;
@TableField(exist = false)
private Integer nextDay;
/** /**
...@@ -43,6 +45,7 @@ public class CalShift extends BaseEntity { ...@@ -43,6 +45,7 @@ public class CalShift extends BaseEntity {
private Long planId; private Long planId;
private String planCode; private String planCode;
private String planName;
@ApiModelProperty(value = "排列顺序") @ApiModelProperty(value = "排列顺序")
/** /**
...@@ -76,20 +79,20 @@ public class CalShift extends BaseEntity { ...@@ -76,20 +79,20 @@ public class CalShift extends BaseEntity {
@Excel(name = "结束时间") @Excel(name = "结束时间")
private String endTime; private String endTime;
//
/** // /**
* 开始时间 // * 开始时间
*/ // */
@ApiModelProperty(value = "开始时间") // @ApiModelProperty(value = "开始时间")
@Excel(name = "开始时间") // @Excel(name = "开始时间")
private Date startDate; // private Date startDate;
//
/** // /**
* 结束时间 // * 结束时间
*/ // */
@ApiModelProperty(value = "结束时间") // @ApiModelProperty(value = "结束时间")
@Excel(name = "结束时间") // @Excel(name = "结束时间")
private Date endDate; // private Date endDate;
@ApiModelProperty(value = "休息开始时间") @ApiModelProperty(value = "休息开始时间")
private String breakStartTime; private String breakStartTime;
...@@ -121,4 +124,7 @@ public class CalShift extends BaseEntity { ...@@ -121,4 +124,7 @@ public class CalShift extends BaseEntity {
private List<CalShift> breakTimeList = new ArrayList<>(); private List<CalShift> breakTimeList = new ArrayList<>();
private Date execStartTime;
private Date execEndTime;
} }
...@@ -66,7 +66,7 @@ public class CalWorkunit extends BaseEntity { ...@@ -66,7 +66,7 @@ public class CalWorkunit extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String workstationCode; private String workstationCode;
@TableField(exist = false) @TableField(exist = false)
private String workstationName; private String workstationName;
......
...@@ -40,6 +40,7 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> { ...@@ -40,6 +40,7 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> {
*/ */
private Long planId; private Long planId;
private String planCode; private String planCode;
private String planName;
/** /**
* 序号 * 序号
...@@ -116,5 +117,6 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> { ...@@ -116,5 +117,6 @@ public class CalShiftVo extends BaseEntity implements Comparable<CalShiftVo> {
private String workstationName; private String workstationName;
private String workshopName; private String workshopName;
private Integer nextDay;
private List<CalShiftVo> breakTimeList = new ArrayList<>(); private List<CalShiftVo> breakTimeList = new ArrayList<>();
} }
...@@ -3,6 +3,7 @@ package com.ximai.mes.cal.mapper; ...@@ -3,6 +3,7 @@ package com.ximai.mes.cal.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.cal.domain.CalPlanWorkunit; import com.ximai.mes.cal.domain.CalPlanWorkunit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
...@@ -53,6 +54,11 @@ public interface CalPlanWorkunitMapper extends BaseMapper<CalPlanWorkunit> { ...@@ -53,6 +54,11 @@ public interface CalPlanWorkunitMapper extends BaseMapper<CalPlanWorkunit> {
*/ */
int deleteCalPlanWorkunitByid(Long planWorkunitId); int deleteCalPlanWorkunitByid(Long planWorkunitId);
@Delete("delete from cal_plan_workunit where plan_code = #{planCode}")
int deleteByPlanCode(@Param("planCode") String planCode);
/** /**
* 批量删除计划工作单元 * 批量删除计划工作单元
* *
......
...@@ -3,8 +3,10 @@ package com.ximai.mes.cal.mapper; ...@@ -3,8 +3,10 @@ package com.ximai.mes.cal.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.cal.domain.CalWorkunit; import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.md.domain.MdWorkunit;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
import java.util.List; import java.util.List;
...@@ -41,6 +43,17 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> { ...@@ -41,6 +43,17 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> {
@Select("select t1.*,t2.workstation_id,t2.workstation_code,t3.workstation_name,t4.workshop_id,t4.workshop_code,t4.workshop_name,t5.factory_id,t5.factory_code,t5.factory_name from cal_workunit t1 inner join md_workunit t2 on t1.workunit_id = t2.workunit_id inner join md_workstation t3 on t2.workstation_id = t3.workstation_id inner join md_workshop t4 on t4.workshop_id = t3.workshop_id inner join md_factory t5 on t5.factory_id = t4.factory_id ${ew.customSqlSegment}") @Select("select t1.*,t2.workstation_id,t2.workstation_code,t3.workstation_name,t4.workshop_id,t4.workshop_code,t4.workshop_name,t5.factory_id,t5.factory_code,t5.factory_name from cal_workunit t1 inner join md_workunit t2 on t1.workunit_id = t2.workunit_id inner join md_workstation t3 on t2.workstation_id = t3.workstation_id inner join md_workshop t4 on t4.workshop_id = t3.workshop_id inner join md_factory t5 on t5.factory_id = t4.factory_id ${ew.customSqlSegment}")
List<CalWorkunit> selectListByQw(@Param("ew") QueryWrapper<CalWorkunit> query); List<CalWorkunit> selectListByQw(@Param("ew") QueryWrapper<CalWorkunit> query);
/**
* 关联工作中心查询作业单元列表
*
* @param query
* @return
*/
@Select("select distinct t1.*,t2.workstation_id,t2.workstation_code,t3.workstation_name,t4.workshop_id,t4.workshop_code,t4.workshop_name,t5.factory_id,t5.factory_code,t5.factory_name from cal_workunit t1 inner join md_workunit t2 on t1.workunit_id = t2.workunit_id inner join md_workstation t3 on t2.workstation_id = t3.workstation_id inner join md_workshop t4 on t4.workshop_id = t3.workshop_id inner join md_factory t5 on t5.factory_id = t4.factory_id ${ew.customSqlSegment}")
List<MdWorkunit> selectListByQwV2(@Param("ew") QueryWrapper<CalWorkunit> query);
/** /**
* 新增计划工作单元 * 新增计划工作单元
* *
...@@ -76,4 +89,10 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> { ...@@ -76,4 +89,10 @@ public interface CalWorkunitMapper extends BaseMapper<CalWorkunit> {
int deleteCalWorkunitByPlanId(Long planId); int deleteCalWorkunitByPlanId(Long planId);
int deleteCalWorkunitByPlanCode(String planCode); int deleteCalWorkunitByPlanCode(String planCode);
List<MdWorkunit> selectMdworkunitList(@Param("workunitCode") String workunitCode,
@Param("workunitName") String workunitName,
@Param("workstationName")String workstationName,
@Param("workshopName")String workshopName,
@Param("workunitCodes")List<String> workunitCodes);
} }
...@@ -70,7 +70,7 @@ public interface ICalPlanWorkunitService { ...@@ -70,7 +70,7 @@ public interface ICalPlanWorkunitService {
* @param planWorkunitIds 需要删除的计划工作单元主键集合 * @param planWorkunitIds 需要删除的计划工作单元主键集合
* @return 结果 * @return 结果
*/ */
int deleteCalPlanWorkunitByPlanWorkunitIds(Long[] planWorkunitIds); int deleteListByIds(Long[] planWorkunitIds);
/** /**
* 删除计划工作单元信息 * 删除计划工作单元信息
......
...@@ -2,6 +2,7 @@ package com.ximai.mes.cal.service; ...@@ -2,6 +2,7 @@ package com.ximai.mes.cal.service;
import java.util.List; import java.util.List;
import com.ximai.mes.cal.domain.CalPlan;
import com.ximai.mes.cal.domain.CalTeamshift; import com.ximai.mes.cal.domain.CalTeamshift;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
......
package com.ximai.mes.cal.service; package com.ximai.mes.cal.service;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.mes.cal.domain.CalWorkunit; import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.md.domain.MdWorkunit; import com.ximai.mes.md.domain.MdWorkunit;
...@@ -18,7 +19,7 @@ public interface ICalWorkunitService { ...@@ -18,7 +19,7 @@ public interface ICalWorkunitService {
* @param id 计划工作单元主键 * @param id 计划工作单元主键
* @return 计划工作单元 * @return 计划工作单元
*/ */
CalWorkunit selectCalWorkunitById(Long id); CalWorkunit getObjById(Long id);
/** /**
* 查询计划工作单元列表 * 查询计划工作单元列表
...@@ -66,4 +67,6 @@ public interface ICalWorkunitService { ...@@ -66,4 +67,6 @@ public interface ICalWorkunitService {
void deleteCalWorkunitByPlanCode(String planCode); void deleteCalWorkunitByPlanCode(String planCode);
List<MdWorkunit> getWorkunitByPlanId(CalWorkunit calWorkunit,List<CalWorkunit> calWorkunits);
} }
...@@ -14,10 +14,13 @@ import com.ximai.mes.cal.mapper.CalTeamMemberMapper; ...@@ -14,10 +14,13 @@ import com.ximai.mes.cal.mapper.CalTeamMemberMapper;
import com.ximai.mes.cal.mapper.CalTeamshiftMapper; import com.ximai.mes.cal.mapper.CalTeamshiftMapper;
import com.ximai.mes.cal.service.ICalCalendarService; import com.ximai.mes.cal.service.ICalCalendarService;
import com.ximai.mes.cal.utils.MesCalendarUtil; import com.ximai.mes.cal.utils.MesCalendarUtil;
import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.mapper.MdWorkunitMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -34,6 +37,9 @@ public class CalCalendarServiceImpl implements ICalCalendarService { ...@@ -34,6 +37,9 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
@Autowired @Autowired
private CalTeamMemberMapper calTeamMemberMapper; private CalTeamMemberMapper calTeamMemberMapper;
@Autowired
private MdWorkunitMapper mdWorkunitMapper;
@Autowired @Autowired
private CalPlanWorkunitMapper calPlanWorkunitMapper; private CalPlanWorkunitMapper calPlanWorkunitMapper;
...@@ -123,6 +129,23 @@ public class CalCalendarServiceImpl implements ICalCalendarService { ...@@ -123,6 +129,23 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>(); List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>();
for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) { for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) {
//获取当天的时间
switch ( entry.getValue().get(0).getShiftName()){
case "白班":
String s = CalPlanWorkunitUp(entry);
entry.getValue().get(0).setWorkDate(s);
break;
case "中班":
String s1 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s1);
break;
case "夜班":
String s2 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s2);
break;
default:
break;
}
resultCalPlanWorkunits.add(entry.getValue().get(0)); resultCalPlanWorkunits.add(entry.getValue().get(0));
} }
if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) { if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) {
...@@ -167,11 +190,15 @@ public class CalCalendarServiceImpl implements ICalCalendarService { ...@@ -167,11 +190,15 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
public List<CalCalendar> getCalendarByWorkunit(Date day, CalCalendar calCalendar) { public List<CalCalendar> getCalendarByWorkunit(Date day, CalCalendar calCalendar) {
List<CalCalendar> calendars = MesCalendarUtil.getDays(day); List<CalCalendar> calendars = MesCalendarUtil.getDays(day);
for (CalCalendar cal : calendars) { for (CalCalendar cal : calendars) {
MdWorkunit mdWorkunit1 = new MdWorkunit();
mdWorkunit1.setWorkunitId(calCalendar.getWorkunitId());
mdWorkunitMapper.selectMdWorkunitLists(mdWorkunit1);
CalPlanWorkunit param = new CalPlanWorkunit(); CalPlanWorkunit param = new CalPlanWorkunit();
param.setIsWork(calCalendar.getIsWork()); param.setIsWork(calCalendar.getIsWork());
param.setTheDay(cal.getTheDay()); param.setTheDay(cal.getTheDay());
if (calCalendar.getWorkunitName() != null) { if (calCalendar.getWorkunitName() != null && calCalendar.getWorkunitId() != null) {
param.setWorkunitName(calCalendar.getWorkunitName()); param.setWorkunitName(calCalendar.getWorkunitName());
param.setWorkunitId(calCalendar.getWorkunitId());
} }
List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(param); List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(param);
...@@ -179,7 +206,25 @@ public class CalCalendarServiceImpl implements ICalCalendarService { ...@@ -179,7 +206,25 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>(); List<CalPlanWorkunit> resultCalPlanWorkunits = new ArrayList<>();
for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) { for (Map.Entry<String, List<CalPlanWorkunit>> entry : groupBy.entrySet()) {
resultCalPlanWorkunits.add(entry.getValue().get(0)); //获取当天的时间
switch ( entry.getValue().get(0).getShiftName()){
case "白班":
String s = CalPlanWorkunitUp(entry);
entry.getValue().get(0).setWorkDate(s);
break;
case "中班":
String s1 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s1);
break;
case "夜班":
String s2 = CalPlanWorkunitCentre(entry);
entry.getValue().get(0).setWorkDate(s2);
break;
default:
break;
}
resultCalPlanWorkunits.add(entry.getValue().get(0));
} }
if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) { if (CollUtil.isNotEmpty(resultCalPlanWorkunits)) {
...@@ -194,6 +239,38 @@ public class CalCalendarServiceImpl implements ICalCalendarService { ...@@ -194,6 +239,38 @@ public class CalCalendarServiceImpl implements ICalCalendarService {
} }
//白天的时间拼接
public String CalPlanWorkunitUp(Map.Entry<String, List<CalPlanWorkunit>> entry){
Date startDate = entry.getValue().get(0).getStartDate();
Date endDate = entry.getValue().get(0).getEndDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startDates= formatter.format(startDate);
String endDates = formatter.format(endDate);
String a=startDates+"--"+endDates+"\n";
Date startDate1 = entry.getValue().get(1).getStartDate();
Date endDate1 = entry.getValue().get(1).getEndDate();
String startDates1= formatter.format(startDate1);
String endDates1 = formatter.format(endDate1);
String b=startDates1+"--"+endDates1+"\n";
Date startDate2 = entry.getValue().get(2).getStartDate();
Date endDate2 = entry.getValue().get(2).getEndDate();
String startDates2= formatter.format(startDate2);
String endDates2 = formatter.format(endDate2);
String c=startDates2+"--"+endDates2;
return a+b+c;
}
//中班和中班
public String CalPlanWorkunitCentre(Map.Entry<String, List<CalPlanWorkunit>> entry){
Date startDate = entry.getValue().get(0).getStartDate();
Date endDate = entry.getValue().get(0).getEndDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startDates= formatter.format(startDate);
String endDates = formatter.format(endDate);
String a=startDates+"--"+endDates;
return a;
}
private List<CalPlanWorkunit> queryCalendarMountData(CalPlanWorkunit calPlanWorkunit) { private List<CalPlanWorkunit> queryCalendarMountData(CalPlanWorkunit calPlanWorkunit) {
List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(calPlanWorkunit); List<CalPlanWorkunit> calPlanWorkunits = calPlanWorkunitMapper.selectCalPlanWorkunitListV2(calPlanWorkunit);
Map<String, List<CalPlanWorkunit>> groupBy = calPlanWorkunits.stream().collect(Collectors.groupingBy(x -> x.getWorkunitId() + ":" + x.getShiftName())); Map<String, List<CalPlanWorkunit>> groupBy = calPlanWorkunits.stream().collect(Collectors.groupingBy(x -> x.getWorkunitId() + ":" + x.getShiftName()));
......
...@@ -2,7 +2,6 @@ package com.ximai.mes.cal.service.impl; ...@@ -2,7 +2,6 @@ package com.ximai.mes.cal.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.common.utils.MessageUtils;
import com.ximai.common.utils.data.DateUtils; import com.ximai.common.utils.data.DateUtils;
import com.ximai.common.utils.data.ExceptionUtil; import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.mes.cal.domain.CalPlan; import com.ximai.mes.cal.domain.CalPlan;
...@@ -33,7 +32,6 @@ import java.util.concurrent.ExecutorService; ...@@ -33,7 +32,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.ximai.common.utils.data.DateUtils.formatShiftDate;
import static com.ximai.common.utils.data.DateUtils.getWeekendByMonth; import static com.ximai.common.utils.data.DateUtils.getWeekendByMonth;
import static com.ximai.mes.cal.utils.MesCalendarUtil.addDays; import static com.ximai.mes.cal.utils.MesCalendarUtil.addDays;
...@@ -100,23 +98,38 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -100,23 +98,38 @@ public class CalPlanServiceImpl implements ICalPlanService {
@Override @Override
public void updateRelationship(CalPlan calPlan) { public void updateRelationship(CalPlan calPlan) {
String planCode = calPlan.getPlanCode(); // String planCode = calPlan.getPlanCode();
CalPlan calPlan1 = this.selectCalPlanByPlanId(calPlan.getPlanId());
String planCode = calPlan1.getPlanCode();
String planName = calPlan1.getPlanName();
calPlan.setPlanCode(planCode);
calPlan.setPlanName(planName);
List<CalShift> calShifts2 = new ArrayList<>(); List<CalShift> calShifts2 = new ArrayList<>();
List<CalShift> calShifts = calPlan.getCalShifts(); List<CalShift> calShifts = calPlan.getCalShifts();
calShiftMapper.deleteByPlanCode(planCode); calShiftMapper.deleteByPlanCode(planCode);
for (CalShift calShift : calShifts) { for (CalShift calShift : calShifts) {
calShift = calPlan.deepSetObj(calShift); calShift = calPlan.deepSetObjParameter(calShift);
calShift.setShiftId(null); calShift.setShiftId(null);
calShift.setCreateTime(calPlan.getCreateTime());
calShift.setCreateBy(calPlan.getCreateBy());
calShift.setUpdateBy(calPlan.getUpdateBy());
calShift.setUpdateTime(calPlan.getUpdateTime());
calShift.setManualUpdate(true); calShift.setManualUpdate(true);
calShiftService.insertCalShift(calShift); calShiftService.insertCalShift(calShift);
if (CollectionUtil.isNotEmpty(calShift.getBreakTimeList())) { List<CalShift> breakTimeList = calShift.getBreakTimeList();
for (CalShift shift : calShift.getBreakTimeList()) { if (CollectionUtil.isNotEmpty(breakTimeList)) {
shift = calPlan.deepSetObj(shift); for (CalShift shift : breakTimeList) {
shift = calPlan.deepSetObjParameter(shift);
shift.setShiftId(null); shift.setShiftId(null);
shift.setOrderNum(calShift.getOrderNum()); shift.setOrderNum(calShift.getOrderNum());
shift.setOperType(1);
shift.setShiftName(calShift.getShiftName()); shift.setShiftName(calShift.getShiftName());
shift.setCreateTime(calPlan.getCreateTime());
shift.setCreateBy(calPlan.getCreateBy());
shift.setUpdateBy(calPlan.getUpdateBy());
shift.setUpdateTime(calPlan.getUpdateTime());
shift.setManualUpdate(true); shift.setManualUpdate(true);
calShiftService.insertCalShift(shift); calShiftService.insertCalShift(shift);
} }
...@@ -187,13 +200,16 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -187,13 +200,16 @@ public class CalPlanServiceImpl implements ICalPlanService {
* @param calWorkunits * @param calWorkunits
*/ */
private static List<CalPlanWorkunit> generateShiftRecords(List<CalShift> shifts, CalPlan plan, List<String> list, List<CalWorkunit> calWorkunits) { private static List<CalPlanWorkunit> generateShiftRecords(List<CalShift> shifts, CalPlan plan, List<String> list, List<CalWorkunit> calWorkunits) {
List<CalPlanWorkunit> saveList = new ArrayList<>(); List<CalPlanWorkunit> saveList = new ArrayList<>();
for (String nowDate : list) { for (String nowDate : list) {
for (CalWorkunit calWorkunit : calWorkunits) { for (CalWorkunit calWorkunit : calWorkunits) {
for (CalShift shift : shifts) { for (CalShift shift : shifts) {
CalPlanWorkunit calPlanWorkunit = new CalPlanWorkunit(); CalPlanWorkunit calPlanWorkunit = new CalPlanWorkunit();
calPlanWorkunit.setPlanId(plan.getPlanId()); calPlanWorkunit.setPlanId(plan.getPlanId());
calPlanWorkunit.setShiftType(plan.getShiftType()); calPlanWorkunit.setPlanCode(plan.getPlanCode());
calPlanWorkunit.setPlanName(plan.getPlanName());
calPlanWorkunit.setShiftType(shift.getShiftType());
calPlanWorkunit.setShiftId(shift.getShiftId()); calPlanWorkunit.setShiftId(shift.getShiftId());
calPlanWorkunit.setShiftName(shift.getShiftName()); calPlanWorkunit.setShiftName(shift.getShiftName());
calPlanWorkunit.setIsWork(CalPlanWorkunitEnum.YES.getType()); calPlanWorkunit.setIsWork(CalPlanWorkunitEnum.YES.getType());
...@@ -201,14 +217,17 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -201,14 +217,17 @@ public class CalPlanServiceImpl implements ICalPlanService {
calPlanWorkunit.setWorkunitId(calWorkunit.getWorkunitId()); calPlanWorkunit.setWorkunitId(calWorkunit.getWorkunitId());
calPlanWorkunit.setWorkunitCode(calWorkunit.getWorkunitCode()); calPlanWorkunit.setWorkunitCode(calWorkunit.getWorkunitCode());
calPlanWorkunit.setWorkunitName(calWorkunit.getWorkunitName()); calPlanWorkunit.setWorkunitName(calWorkunit.getWorkunitName());
Date date1 = MesCalendarUtil.dateStrToDate(nowDate + " " + MesCalendarUtil.getDateHourStr(shift.getStartDate())); Date startDate = shift.getExecStartTime();
calPlanWorkunit.setStartDate(date1); Date endDate = shift.getExecEndTime();
Date date = MesCalendarUtil.dateStrToDate(nowDate + " " + MesCalendarUtil.getDateHourStr(shift.getEndDate()));
if (date1.getTime() > date.getTime()) { // Date Sdate = MesCalendarUtil.dateStrToDate(nowDate + " " + MesCalendarUtil.getDateHourStr(startDate));
calPlanWorkunit.setEndDate(addDays(date, 1)); // Date Edate = MesCalendarUtil.dateStrToDate(nowDate + " " + MesCalendarUtil.getDateHourStr(endDate));
if (startDate.getTime() > endDate.getTime()) {
calPlanWorkunit.setEndDate(addDays(endDate, 1));
} else { } else {
calPlanWorkunit.setEndDate(date); calPlanWorkunit.setEndDate(endDate);
} }
calPlanWorkunit.setStartDate(startDate);
calPlanWorkunit.setRestFlag(shift.getRestFlag()); calPlanWorkunit.setRestFlag(shift.getRestFlag());
saveList.add(calPlanWorkunit); saveList.add(calPlanWorkunit);
} }
...@@ -258,54 +277,55 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -258,54 +277,55 @@ public class CalPlanServiceImpl implements ICalPlanService {
@Override @Override
public void genRecords(CalPlan calPlan) { public void genRecords(CalPlan calPlan) {
List<CalShift> shifts = calPlan.getCalShifts(); List<CalShift> shifts = calPlan.getCalShifts();
List<CalShift> shiftList = new ArrayList<>(); List<CalShift> execShiftList = new ArrayList<>();
Date startDate = calPlan.getStartDate(); Date startDate = calPlan.getStartDate();
Date endDate = calPlan.getEndDate(); Date endDate = calPlan.getEndDate();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String startDateFormat = sdf.format(startDate);
for (CalShift shift : shifts) { for (CalShift shift : shifts) {
List<CalShift> breakTimeList = shift.getBreakTimeList(); List<CalShift> breakTimeList = shift.getBreakTimeList();
if (CollectionUtil.isNotEmpty(breakTimeList)) { if (CollectionUtil.isNotEmpty(breakTimeList)) {
breakTimeList = breakTimeList.stream().sorted(Comparator.comparing(CalShift::getOrderNum)).collect(Collectors.toList()); breakTimeList.sort(Comparator.comparing(CalShift::getOrderNum));
Date shift1StartDate = formatShiftDate(startDateFormat, shift.getStartTime()); CalShift calShift1 = breakTimeList.get(0);
Date shift1EndDate = formatShiftDate(startDateFormat, breakTimeList.get(0).getBreakStartTime()); if (breakTimeList.size() == 2) {
CalShift shift1 = shift.deepCopyObj(); CalShift startCalShift = shift.deepCopyObj();
shift1.setStartDate(shift1StartDate); startCalShift.setExecEndTime(calShift1.getExecStartTime());
shift1.setEndDate(shift1EndDate); execShiftList.add(startCalShift);
shiftList.add(shift1); for (CalShift calShift : breakTimeList) {
CalShift o = calShift.deepCopyObj();
for (CalShift calShift : breakTimeList) { o.setShiftName(shift.getShiftName());
shift1StartDate = formatShiftDate(startDateFormat, calShift.getBreakStartTime()); execShiftList.add(o);
shift1EndDate = formatShiftDate(startDateFormat, calShift.getBreakEndTime()); }
shift1 = new CalShift();
shift1.setStartDate(shift1StartDate);
shift1.setEndDate(shift1EndDate);
shift1.setOperType(1);
shift1.setShiftName(calShift.getShiftName());
shift1.setShiftId(calShift.getShiftId());
shiftList.add(shift1);
}
Date shift3EndDate = formatShiftDate(startDateFormat, shift.getEndTime());
CalShift shift3 = shift.deepCopyObj();
shift3.setStartDate(shift1EndDate);
shift3.setEndDate(shift3EndDate);
shiftList.add(shift3);
CalShift calShift2 = breakTimeList.get(1);
if (breakTimeList.size() == 2) {
CalShift calShift = calShift1.deepCopyObj();
calShift.setExecStartTime(calShift1.getExecEndTime());
calShift.setExecEndTime(calShift2.getExecStartTime());
calShift.setRestFlag(0);
execShiftList.add(calShift);
}
CalShift endCalShift = shift.deepCopyObj();
endCalShift.setExecStartTime(calShift2.getExecEndTime());
execShiftList.add(endCalShift);
} else {
CalShift startCalShift = shift.deepCopyObj();
startCalShift.setExecEndTime(calShift1.getExecStartTime());
execShiftList.add(startCalShift);
for (CalShift calShift : breakTimeList) {
execShiftList.add(calShift.deepCopyObj());
}
CalShift endCalShift = shift.deepCopyObj();
endCalShift.setExecStartTime(calShift1.getExecEndTime());
execShiftList.add(endCalShift);
}
} else { } else {
Date shift1StartDate = formatShiftDate(startDateFormat, shift.getStartTime()); execShiftList.add(shift.deepCopyObj());
Date shift1EndDate = formatShiftDate(startDateFormat, shift.getEndTime());
CalShift shift1 = shift.deepCopyObj();
shift1.setStartDate(shift1StartDate);
shift1.setEndDate(shift1EndDate);
shiftList.add(shift1);
} }
} }
List<CalWorkunit> calWorkunits = calWorkunitMapper.selectListByQw(new QueryWrapper<CalWorkunit>().eq("plan_id", calPlan.getPlanId()));
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calWorkunits), MessageUtils.message("cal.error.error19")); List<CalWorkunit> calWorkunits = calWorkunitMapper.selectListByQw(new QueryWrapper<CalWorkunit>().eq("t1.plan_id", calPlan.getPlanId()));
ExceptionUtil.checkTrueThrowException(CollectionUtil.isEmpty(calWorkunits), "工作单元为空,无法排班");
List<Integer> weekList = new ArrayList<>(); List<Integer> weekList = new ArrayList<>();
if (Objects.equals(calPlan.getSaturday(), CalPlanWorkDayEnum.WEEKEND.getType())) { if (Objects.equals(calPlan.getSaturday(), CalPlanWorkDayEnum.WEEKEND.getType())) {
...@@ -320,18 +340,21 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -320,18 +340,21 @@ public class CalPlanServiceImpl implements ICalPlanService {
List<String> weekendMonthStrList = weekendByMonth.stream().filter(Objects::nonNull).map(MesCalendarUtil::getDateDayStr).collect(Collectors.toList()); List<String> weekendMonthStrList = weekendByMonth.stream().filter(Objects::nonNull).map(MesCalendarUtil::getDateDayStr).collect(Collectors.toList());
List<Long> taskWorkunitIds = calWorkunits.stream().map(CalWorkunit::getWorkunitId).collect(Collectors.toList()); List<Long> taskWorkunitIds = calWorkunits.stream().map(CalWorkunit::getWorkunitId).collect(Collectors.toList());
List<String> shiftNames = shifts.stream().map(CalShift::getShiftName).collect(Collectors.toList()); List<String> shiftNames = shifts.stream().map(CalShift::getShiftName).collect(Collectors.toList());
calPlanWorkunitMapper.deleteByPlanCode(calPlan.getPlanCode());
// 删除同一天在同一个工作单元已经粗在上的旧数据 // 删除同一天在同一个工作单元已经粗在上的旧数据
QueryWrapper<CalPlanWorkunit> calPlanWorkunitQueryWrapper = new QueryWrapper<>(); QueryWrapper<CalPlanWorkunit> qw = new QueryWrapper<>();
calPlanWorkunitQueryWrapper.in("t1.the_day", weekendMonthStrList); qw.in("t1.the_day", weekendMonthStrList);
calPlanWorkunitQueryWrapper.in("t1.shift_name", shiftNames); qw.in("t1.shift_name", shiftNames);
calPlanWorkunitQueryWrapper.in("t1.workunit_id", taskWorkunitIds); qw.in("t1.workunit_id", taskWorkunitIds);
List<Long> ids = calPlanWorkunitService.selectListByQw(calPlanWorkunitQueryWrapper).stream().map(CalPlanWorkunit::getId).collect(Collectors.toList()); List<Long> ids = calPlanWorkunitService.selectListByQw(qw).stream().map(CalPlanWorkunit::getId).collect(Collectors.toList());
List<List<Long>> deletelists = chunkList(ids, 500); List<List<Long>> deletelists = chunkList(ids, 500);
for (List<Long> list : deletelists) { for (List<Long> list : deletelists) {
EXECUTOR.execute(() -> calPlanWorkunitService.deleteCalPlanWorkunitByPlanWorkunitIds(list.toArray(new Long[]{}))); EXECUTOR.execute(() -> calPlanWorkunitService.deleteListByIds(list.toArray(new Long[]{})));
} }
List<CalPlanWorkunit> calPlanWorkunits = generateShiftRecords(shiftList, calPlan, weekendMonthStrList, calWorkunits); List<CalPlanWorkunit> calPlanWorkunits = generateShiftRecords(execShiftList, calPlan, weekendMonthStrList, calWorkunits);
calPlanWorkunits.forEach(x -> { calPlanWorkunits.forEach(x -> {
String updateBy = calPlan.getUpdateBy(); String updateBy = calPlan.getUpdateBy();
x.setCreateBy(updateBy); x.setCreateBy(updateBy);
...@@ -366,7 +389,7 @@ public class CalPlanServiceImpl implements ICalPlanService { ...@@ -366,7 +389,7 @@ public class CalPlanServiceImpl implements ICalPlanService {
calWorkunitService.deleteCalWorkunitByPlanCode(calPlan.getPlanCode()); calWorkunitService.deleteCalWorkunitByPlanCode(calPlan.getPlanCode());
List<CalWorkunit> calWorkunits = calPlan.getCalWorkunits(); List<CalWorkunit> calWorkunits = calPlan.getCalWorkunits();
for (CalWorkunit calWorkunit : calWorkunits) { for (CalWorkunit calWorkunit : calWorkunits) {
calWorkunit = calPlan.deepSetObj(calWorkunit); calWorkunit = calPlan.deepSetObjParameter(calWorkunit);
calWorkunit.setManualUpdate(true); calWorkunit.setManualUpdate(true);
calWorkunit.setId(null); calWorkunit.setId(null);
calWorkunitService.insertCalWorkunit(calWorkunit); calWorkunitService.insertCalWorkunit(calWorkunit);
......
...@@ -111,7 +111,7 @@ public class CalPlanWorkunitServiceImpl implements ICalPlanWorkunitService { ...@@ -111,7 +111,7 @@ public class CalPlanWorkunitServiceImpl implements ICalPlanWorkunitService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteCalPlanWorkunitByPlanWorkunitIds(Long[] planWorkunitIds) { public int deleteListByIds(Long[] planWorkunitIds) {
return calPlanWorkunitMapper.deleteCalPlanWorkunitByids(planWorkunitIds); return calPlanWorkunitMapper.deleteCalPlanWorkunitByids(planWorkunitIds);
} }
......
...@@ -8,9 +8,9 @@ import com.ximai.mes.cal.domain.CalShift; ...@@ -8,9 +8,9 @@ import com.ximai.mes.cal.domain.CalShift;
import com.ximai.mes.cal.domain.vo.CalShiftVo; import com.ximai.mes.cal.domain.vo.CalShiftVo;
import com.ximai.mes.cal.mapper.CalShiftMapper; import com.ximai.mes.cal.mapper.CalShiftMapper;
import com.ximai.mes.cal.service.ICalShiftService; import com.ximai.mes.cal.service.ICalShiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -24,7 +24,7 @@ import java.util.stream.Collectors; ...@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class CalShiftServiceImpl implements ICalShiftService { public class CalShiftServiceImpl implements ICalShiftService {
@Autowired @Resource
private CalShiftMapper calShiftMapper; private CalShiftMapper calShiftMapper;
/** /**
...@@ -188,6 +188,7 @@ public class CalShiftServiceImpl implements ICalShiftService { ...@@ -188,6 +188,7 @@ public class CalShiftServiceImpl implements ICalShiftService {
breakShift2.setStartTime(null); breakShift2.setStartTime(null);
breakShift2.setEndTime(null); breakShift2.setEndTime(null);
breakShift2.setOrderNum(1); breakShift2.setOrderNum(1);
breakShift2.setNextDay(1);
list2.add(breakShift2); list2.add(breakShift2);
shiftNight.setBreakTimeList(list2); shiftNight.setBreakTimeList(list2);
...@@ -228,9 +229,9 @@ public class CalShiftServiceImpl implements ICalShiftService { ...@@ -228,9 +229,9 @@ public class CalShiftServiceImpl implements ICalShiftService {
List<CalShiftVo> list3 = new ArrayList<>(); List<CalShiftVo> list3 = new ArrayList<>();
CalShiftVo breakShift3 = new CalShiftVo(); CalShiftVo breakShift3 = new CalShiftVo();
breakShift3.setBreakStartTime("00:00"); breakShift3.setBreakStartTime("00:00");
breakShift3.setBreakEndTime("1:00"); breakShift3.setBreakEndTime("1:00");
breakShift3.setNextDay(1);
breakShift3.setStartTime(null); breakShift3.setStartTime(null);
breakShift3.setEndTime(null); breakShift3.setEndTime(null);
breakShift3.setOrderNum(1); breakShift3.setOrderNum(1);
......
...@@ -7,6 +7,7 @@ import com.ximai.mes.cal.domain.CalWorkunit; ...@@ -7,6 +7,7 @@ import com.ximai.mes.cal.domain.CalWorkunit;
import com.ximai.mes.cal.mapper.CalWorkunitMapper; import com.ximai.mes.cal.mapper.CalWorkunitMapper;
import com.ximai.mes.cal.service.ICalWorkunitService; import com.ximai.mes.cal.service.ICalWorkunitService;
import com.ximai.mes.md.domain.MdWorkunit; import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.mapper.MdWorkunitMapper;
import com.ximai.mes.md.service.IMdWorkunitService; import com.ximai.mes.md.service.IMdWorkunitService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -27,10 +28,12 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService { ...@@ -27,10 +28,12 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
@Resource @Resource
private CalWorkunitMapper calWorkunitMapper; private CalWorkunitMapper calWorkunitMapper;
@Resource
private MdWorkunitMapper mdWorkunitMapper;
@Autowired @Autowired
private IMdWorkunitService mdWorkunitService; private IMdWorkunitService mdWorkunitService;
/** /**
* 查询计划工作单元 * 查询计划工作单元
* *
...@@ -38,7 +41,7 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService { ...@@ -38,7 +41,7 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
* @return 计划工作单元 * @return 计划工作单元
*/ */
@Override @Override
public CalWorkunit selectCalWorkunitById(Long id) { public CalWorkunit getObjById(Long id) {
return calWorkunitMapper.selectCalWorkunitById(id); return calWorkunitMapper.selectCalWorkunitById(id);
} }
...@@ -162,14 +165,34 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService { ...@@ -162,14 +165,34 @@ public class CalWorkunitServiceImpl implements ICalWorkunitService {
@Override @Override
public List<MdWorkunit> selectUnSelectList(CalWorkunit calWorkunit) { public List<MdWorkunit> selectUnSelectList(CalWorkunit calWorkunit) {
QueryWrapper<MdWorkunit> qw = new QueryWrapper<>(); Long planId = calWorkunit.getPlanId();
qw.eq(StringUtils.isNotEmpty(calWorkunit.getWorkunitCode()), "t1.workunit_code", calWorkunit.getWorkunitCode()); String workunitCode = calWorkunit.getWorkunitCode();
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkunitName()), "t1.workunit_name", calWorkunit.getWorkunitName()); String workunitName = calWorkunit.getWorkunitName();
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkstationName()), "mws.workstation_name", calWorkunit.getWorkstationName()); String workstationName = calWorkunit.getWorkstationName();
qw.like(StringUtils.isNotEmpty(calWorkunit.getWorkshopName()), "mws.workshop_name", calWorkunit.getWorkshopName()); String workshopName = calWorkunit.getWorkshopName();
List<MdWorkunit> mdWorkunits = mdWorkunitService.selectListByQw(qw);
QueryWrapper<CalWorkunit> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.isNotEmpty(planId), "t1.plan_id", planId);
queryWrapper.eq(StringUtils.isNotEmpty(workunitCode), "t2.workunit_code", workunitCode);
queryWrapper.like(StringUtils.isNotEmpty(workunitName), "t2.workunit_name", workunitName);
queryWrapper.like(StringUtils.isNotEmpty(workstationName), "t3.workstation_name", workstationName);
queryWrapper.like(StringUtils.isNotEmpty(workshopName), "t4.workshop_name", workshopName);
queryWrapper.isNotNull("t2.workunit_name");
List<MdWorkunit> calWorkunits = calWorkunitMapper.selectListByQwV2(queryWrapper);
return calWorkunits;
}
@Override
public List<MdWorkunit> getWorkunitByPlanId(CalWorkunit calWorkunit,List<CalWorkunit> calWorkunits) {
String workunitCode = calWorkunit.getWorkunitCode();
String workunitName = calWorkunit.getWorkunitName();
String workstationName = calWorkunit.getWorkstationName();
String workshopName = calWorkunit.getWorkshopName();
List<String> workunitCodes = calWorkunits.stream().map(calWorkunit1 -> calWorkunit1.getWorkunitCode()).collect(Collectors.toList());
List<MdWorkunit> mdWorkunits = calWorkunitMapper.selectMdworkunitList(workunitCode,workunitName,workstationName,workshopName,workunitCodes.size() > 0 ? workunitCodes : null);
return mdWorkunits; return mdWorkunits;
} }
} }
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