diff --git a/admin-console/src/main/java/com/ibeetl/admin/console/service/FunctionConsoleService.java b/admin-console/src/main/java/com/ibeetl/admin/console/service/FunctionConsoleService.java index 7184df1d..54d9406e 100644 --- a/admin-console/src/main/java/com/ibeetl/admin/console/service/FunctionConsoleService.java +++ b/admin-console/src/main/java/com/ibeetl/admin/console/service/FunctionConsoleService.java @@ -124,7 +124,7 @@ public class FunctionConsoleService extends CoreBaseService { * @param userId * @return */ - @Cacheable(value=USER_FUNCTION_TREE_CACHE, key="#userId", unless = "#result == null || #result.size() == 0", cacheManager = "cacheManager1Day") + @Cacheable(value=USER_FUNCTION_TREE_CACHE, key="#userId", unless = "#result == null || #result.length() == 0", cacheManager = "cacheManager1Day") public String getFunctionIdByUser(Long userId){ return this.roleFunctionConsoleDao.getFunctionIdByUser(userId); } diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/conf/CustomErrorController.java b/admin-core/src/main/java/com/ibeetl/admin/core/conf/CustomErrorController.java index 0d41ddcf..35118954 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/conf/CustomErrorController.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/conf/CustomErrorController.java @@ -7,6 +7,7 @@ import com.ibeetl.admin.core.util.PlatformException; import com.ibeetl.admin.core.web.JsonResult; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.beetl.sql.clazz.kit.BeetlSQLException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController; import org.springframework.boot.web.error.ErrorAttributeOptions; @@ -172,10 +173,10 @@ public class CustomErrorController extends AbstractErrorController { } protected String getErrorMessage(Throwable ex) { - if(ex instanceof PlatformException || ex instanceof IllegalArgumentException + if(ex instanceof PlatformException || ex instanceof IllegalArgumentException || ex instanceof BeetlSQLException || ex instanceof ConstraintViolationException) { - return ex.getMessage(); - }else{ + return ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(); + } else{ return "服务器错误,请联系管理员"; } diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java index ce18eaed..a87166f5 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java @@ -27,14 +27,14 @@ public interface CoreDictDao extends BaseMapper { List findAllList(String type); //根据表名、字段名查询 主键名和注释 和 字段名和注释 - @Cacheable(value = "core.coreDict.findPkAndValue", key = "#tableName+#columnName") + @Cacheable(value = "coreDictDao.findPkAndValue", key = "#tableName+#columnNames") List> findPkAndValue (String tableName, String columnNames); //根据表名、字段名查询 注释 List> findComment (String tableName,String columnNames); //动态表名、字段名查询并包装成coreDict实体 - @Cacheable(value = "core.coreDict:findALlListByTable", key = "#idName+#filedName+#tableCode+#tableName+#params") + @Cacheable(value = "coreDictDao:findALlListByTable", key = "#idName+#filedName+#tableCode+#tableName+#params") List findALlListByTable (String idName,String filedName,String tableCode,String tableName,String[] params); /** diff --git a/data_base_design/天泽数据大平台.pdb b/data_base_design/天泽数据大平台.pdb index 99f145ee..4a50eaf4 100644 --- a/data_base_design/天泽数据大平台.pdb +++ b/data_base_design/天泽数据大平台.pdb @@ -1,5 +1,5 @@ - + @@ -17135,13 +17135,13 @@ COLLATE = utf8_general_ci 7CC923C5-15FB-416F-9848-3A6074318CB7 -course_info_id -course_info_id +teacher_open_course_merge_course_info_id +teacher_open_course_merge_course_info_id 1623836619 lx -1663937886 -lx -课程ID +1667746197 +87966 +开课课程ID bigint diff --git a/data_base_design/天泽数据大平台.pdm b/data_base_design/天泽数据大平台.pdm index 4a50eaf4..5e1341dd 100644 --- a/data_base_design/天泽数据大平台.pdm +++ b/data_base_design/天泽数据大平台.pdm @@ -1,5 +1,5 @@ - + @@ -4245,8 +4245,8 @@ Shadow=0 1661955336 1665583780 -((256786,18784), (282577,22948)) -((256786,18784),(256786,22648),(282577,22648)) +((256786,18784), (283349,23359)) +((256786,18784),(256786,23059),(283349,23059)) 1 8 16744576 @@ -4287,8 +4287,8 @@ Shadow=0 1661960819 1665721097 -((307224,27523), (308081,41925)) -((308081,41925),(308081,34338),(307524,34338),(307524,27523)) +((306535,27557), (308088,41939)) +((308088,41939),(308088,34338),(306835,34338),(306835,27557)) 1 8 16744576 @@ -4349,8 +4349,8 @@ Shadow=0 1662020600 1665583741 -((299542,8474), (327394,23653)) -((327394,8474),(327394,23353),(299542,23353)) +((299320,8474), (327394,24009)) +((327394,8474),(327394,23709),(299320,23709)) 1 8 16744576 @@ -4370,8 +4370,8 @@ Shadow=0 1662046228 1665583791 -((307520,17357), (308120,27563)) -((307820,17357),(307820,27563)) +((307166,17357), (307766,27594)) +((307466,17357),(307466,27594)) 1 8 16744576 @@ -4391,8 +4391,8 @@ Shadow=0 1662047541 1664863137 -((250779,30932), (296963,32209)) -((250779,32209),(278057,32209),(278057,31232),(296963,31232)) +((250779,30679), (296892,32209)) +((250779,32209),(278057,32209),(278057,30979),(296892,30979)) 1 8 16744576 @@ -4412,8 +4412,8 @@ Shadow=0 1662048005 1662048061 -((230014,25476), (295754,28276)) -((230014,28276),(230014,25776),(295754,25776)) +((230014,25645), (295754,28276)) +((230014,28276),(230014,25945),(295754,25945)) 1 8 16744576 @@ -4433,8 +4433,8 @@ Shadow=0 1662647833 1665821828 -((276450,14759), (285141,27599)) -((276450,14759),(276450,20457),(284841,20457),(284841,27599)) +((276450,14759), (285780,27627)) +((276450,14759),(276450,20457),(285480,20457),(285480,27627)) 1 8 16744576 @@ -4472,8 +4472,8 @@ Shadow=0 1662810688 1665583748 -((296402,29450), (338850,30050)) -((338850,29545),(319044,29545),(319044,29750),(296402,29750)) +((296364,29311), (338850,29911)) +((338850,29545),(319044,29545),(319044,29611),(296364,29611)) 1 8 16744576 @@ -4493,8 +4493,8 @@ Shadow=0 1662865795 1665583789 -((291944,17344), (293972,23291)) -((291944,17344),(291944,20313),(293672,20313),(293672,23291)) +((291944,17344), (294094,23652)) +((291944,17344),(291944,20313),(293794,20313),(293794,23652)) 1 8 16744576 @@ -4514,8 +4514,8 @@ Shadow=0 1664451291 1664451291 -((242130,17940), (285080,26840)) -((242130,17940),(242130,26540),(285080,26540)) +((241793,17863), (285705,26950)) +((241793,17863),(241793,26650),(285705,26650)) 1 8 16744576 @@ -4534,8 +4534,8 @@ Shadow=0 1664451372 1664451372 -((206635,6900), (234040,18540)) -((206635,6900),(206635,18240),(234040,18240)) +((206554,6793), (234167,18440)) +((206554,6793),(206554,18140),(234167,18140)) 1 8 16744576 @@ -4554,8 +4554,8 @@ Shadow=0 1664453932 1664453932 -((234394,-16131), (248070,15668)) -((248070,-16131),(234694,-16131),(234694,15668)) +((234483,-16351), (248094,15764)) +((248094,-16351),(234783,-16351),(234783,15764)) 1 8 16744576 @@ -4574,8 +4574,8 @@ Shadow=0 1664461421 1665583791 -((309993,-15930), (310593,7879)) -((310224,-15930),(310224,560),(310293,560),(310293,7879)) +((309993,-15970), (310731,7879)) +((310731,-15970),(310731,560),(310293,560),(310293,7879)) 1 8 16744576 @@ -4615,8 +4615,8 @@ Shadow=0 1664952224 1665501316 -((270308,33106), (286859,44757)) -((270308,44757),(286559,44757),(286559,33106)) +((270308,32708), (287397,44757)) +((270308,44757),(287097,44757),(287097,32708)) 1 8 16744576 @@ -4636,8 +4636,8 @@ Shadow=0 1666620846 1666620846 -((204778,-10560), (205378,120)) -((205078,-10560),(205078,120)) +((204740,-10592), (205340,542)) +((205040,-10592),(205040,542)) 1 8 16744576 @@ -4655,9 +4655,9 @@ Shadow=0 1623769194 -1667577198 +1668347473 -1 -((-9119,50726), (6123,66922)) +((-8695,51363), (5699,66285)) 12615680 16570034 12632256 @@ -4682,7 +4682,7 @@ LABL 0 新宋体,8,N 1623769937 1662650462 -1 -((-8991,10954), (6251,26250)) +((-8567,11553), (5827,25651)) 12615680 16570034 12632256 @@ -4734,7 +4734,7 @@ LABL 0 新宋体,8,N 1623770338 1662650462 -1 -((-8943,-14307), (6299,89)) +((-8519,-13745), (5875,-473)) 12615680 16570034 12632256 @@ -4811,9 +4811,9 @@ LABL 0 新宋体,8,N 1623826338 -1667577198 +1668347473 -1 -((41316,49404), (68094,57500)) +((42101,49703), (67309,57201)) 12615680 16570034 12632256 @@ -4838,7 +4838,7 @@ LABL 0 新宋体,8,N 1623828456 1661907266 -1 -((9127,1660), (34257,17856)) +((9860,2297), (33524,17219)) 12615680 16570034 12632256 @@ -4863,7 +4863,7 @@ LABL 0 新宋体,8,N 1623828633 1661907266 -1 -((11359,-10357), (31133,-461)) +((11925,-9983), (30567,-835)) 12615680 16570034 12632256 @@ -4888,7 +4888,7 @@ LABL 0 新宋体,8,N 1623828682 1661907266 -1 -((11126,-24326), (30900,-14430)) +((11692,-23952), (30334,-14804)) 12615680 16570034 12632256 @@ -4913,7 +4913,7 @@ LABL 0 新宋体,8,N 1623828725 1666620820 -1 -((8745,-37956), (33875,-27160)) +((9478,-37544), (33142,-27572)) 12615680 16570034 12632256 @@ -4938,7 +4938,7 @@ LABL 0 新宋体,8,N 1623828770 1666098792 -1 -((14955,18471), (33493,35567)) +((15482,19145), (32966,34893)) 12615680 16570034 12632256 @@ -4963,7 +4963,7 @@ LABL 0 新宋体,8,N 1623840859 1661907266 -1 -((32811,-12234), (49289,2162)) +((33274,-11672), (48826,1600)) 12615680 16570034 12632256 @@ -4988,7 +4988,7 @@ LABL 0 新宋体,8,N 1623841366 1661907266 -1 -((32688,-26863), (49166,-12467)) +((33151,-26301), (48703,-13029)) 12615680 16570034 12632256 @@ -5013,7 +5013,7 @@ LABL 0 新宋体,8,N 1623842834 1667577198 -1 -((72859,32956), (95517,73452)) +((73515,34605), (94861,71803)) 12615680 16570034 12632256 @@ -5036,9 +5036,9 @@ LABL 0 新宋体,8,N 1623845173 -1667577198 +1668347473 -1 -((96916,49454), (124106,66550)) +((97714,50128), (123308,65876)) 12615680 16570034 12632256 @@ -5063,7 +5063,7 @@ LABL 0 新宋体,8,N 1623845296 1667577198 -1 -((96498,38154), (114624,48050)) +((97012,38528), (114110,47676)) 12615680 16570034 12632256 @@ -5086,9 +5086,9 @@ LABL 0 新宋体,8,N 1623859429 -1667577198 +1668347473 -1 -((125618,49262), (150748,67258)) +((126351,49974), (150015,66546)) 12615680 16570034 12632256 @@ -5111,9 +5111,9 @@ LABL 0 新宋体,8,N 1623859834 -1667577198 +1668347473 -1 -((125882,37287), (145656,48083)) +((126448,37699), (145090,47671)) 12615680 16570034 12632256 @@ -5165,7 +5165,7 @@ LABL 0 新宋体,8,N 1623860248 1666098792 -1 -((74033,-8788), (94219,8308)) +((74612,-8114), (93640,7634)) 12615680 16570034 12632256 @@ -5190,7 +5190,7 @@ LABL 0 新宋体,8,N 1623860509 1667577198 -1 -((95068,-8538), (111134,7658)) +((95518,-7901), (110684,7021)) 12615680 16570034 12632256 @@ -5213,9 +5213,9 @@ LABL 0 新宋体,8,N 1623861067 -1667577198 +1668347473 -1 -((114086,8387), (139216,26383)) +((114819,9099), (138483,25671)) 12615680 16570034 12632256 @@ -5238,9 +5238,9 @@ LABL 0 新宋体,8,N 1623861149 -1667577198 +1668347473 -1 -((117064,-4663), (136838,6133)) +((117630,-4251), (136272,5721)) 12615680 16570034 12632256 @@ -5265,7 +5265,7 @@ LABL 0 新宋体,8,N 1623861203 1667577198 -1 -((140686,-5055), (155516,8441)) +((141097,-4531), (155105,7917)) 12615680 16570034 12632256 @@ -5288,9 +5288,9 @@ LABL 0 新宋体,8,N 1623861290 -1667577198 +1668347473 -1 -((116764,-17563), (136538,-6767)) +((117330,-17151), (135972,-7179)) 12615680 16570034 12632256 @@ -5342,7 +5342,7 @@ LABL 0 新宋体,8,N 1623862594 1666098792 -1 -((57665,-26488), (70023,-14792)) +((57999,-26039), (69689,-15241)) 12615680 16570034 12632256 @@ -5367,7 +5367,7 @@ LABL 0 新宋体,8,N 1623862978 1662650462 -1 -((-36384,-12538), (-10018,958)) +((-35612,-12014), (-10790,434)) 12615680 16570034 12632256 @@ -5392,7 +5392,7 @@ LABL 0 新宋体,8,N 1623863676 1662650462 -1 -((-43301,-23338), (-30943,-14342)) +((-42967,-23001), (-31277,-14679)) 12615680 16570034 12632256 @@ -5417,7 +5417,7 @@ LABL 0 新宋体,8,N 1623864141 1662650462 -1 -((-29240,-23338), (-10290,-14342)) +((-28700,-23001), (-10830,-14679)) 12615680 16570034 12632256 @@ -5442,7 +5442,7 @@ LABL 0 新宋体,8,N 1623895431 1666098792 -1 -((-57115,-23188), (-44757,-14192)) +((-56781,-22851), (-45091,-14529)) 12615680 16570034 12632256 @@ -5467,7 +5467,7 @@ LABL 0 新宋体,8,N 1625926250 1666620820 -1 -((42885,28637), (66367,46633)) +((43567,29349), (65685,45921)) 12615680 16570034 12632256 @@ -5490,9 +5490,9 @@ LABL 0 新宋体,8,N 1627129933 -1667577198 +1668347473 -1 -((97742,67314), (113808,74510)) +((98192,67576), (113358,74248)) 12615680 16570034 12632256 @@ -5517,7 +5517,7 @@ LABL 0 新宋体,8,N 1628307450 1666620820 -1 -((-42551,-32668), (-31841,-25472)) +((-42268,-32406), (-32124,-25734)) 12615680 16570034 12632256 @@ -5542,7 +5542,7 @@ LABL 0 新宋体,8,N 1628307767 1666620820 -1 -((-29652,-35818), (-10290,-24122)) +((-29099,-35369), (-10843,-24571)) 12615680 16570034 12632256 @@ -5567,7 +5567,7 @@ LABL 0 新宋体,8,N 1628340137 1666098792 -1 -((37876,20648), (49674,26044)) +((38226,20835), (49324,25857)) 12615680 16570034 12632256 @@ -5592,7 +5592,7 @@ LABL 0 新宋体,8,N 1631242896 1666620820 -1 -((-7443,-35277), (4091,-26281)) +((-7135,-34940), (3783,-26618)) 12615680 16570034 12632256 @@ -5617,7 +5617,7 @@ LABL 0 新宋体,8,N 1631243538 1662650462 -1 -((-7368,-23577), (4166,-15481)) +((-7060,-23278), (3858,-15780)) 12615680 16570034 12632256 @@ -5642,7 +5642,7 @@ LABL 0 新宋体,8,N 1661850632 1667577198 -1 -((295843,49645), (320561,64041)) +((296563,50207), (319841,63479)) 12615680 16570034 12632256 @@ -5694,7 +5694,7 @@ LABL 0 新宋体,8,N 1661949359 1667577198 -1 -((282571,21660), (308937,34256)) +((283343,22147), (308165,33769)) 12615680 16570034 12632256 @@ -5854,7 +5854,7 @@ LABL 0 新宋体,8,N 1661960474 1667577198 -1 -((288839,34908), (327565,49304)) +((289997,35470), (326407,48742)) 12615680 16570034 12632256 @@ -6284,7 +6284,7 @@ LABL 0 新宋体,8,N 1663937886 1666098792 -1 -((37035,3002), (62165,20098)) +((37768,3264), (61432,19836)) 12615680 16570034 12632256 @@ -6309,7 +6309,7 @@ LABL 0 新宋体,8,N 1664366421 1667577198 -1 -((226157,11532), (246343,22329)) +((226736,11944), (245764,21917)) 12615680 16570034 12632256 @@ -6334,7 +6334,7 @@ LABL 0 新宋体,8,N 1664367261 1667577198 -1 -((240876,-26579), (256118,-11282)) +((241300,-25979), (255694,-11882)) 12615680 16570034 12632256 @@ -6359,7 +6359,7 @@ LABL 0 新宋体,8,N 1664368015 1667577198 -1 -((195328,-1671), (215102,12726)) +((195894,-1109), (214536,12164)) 12615680 16570034 12632256 @@ -6384,7 +6384,7 @@ LABL 0 新宋体,8,N 1664460832 1667577198 -1 -((306999,-31720), (330893,-1123)) +((307694,-30483), (330198,-2360)) 12615680 16570034 12632256 @@ -6436,7 +6436,7 @@ LABL 0 新宋体,8,N 1666620383 1667577198 -1 -((196578,-16829), (210584,-5132)) +((196964,-16379), (210198,-5582)) 12615680 16570034 12632256 @@ -6461,7 +6461,7 @@ LABL 0 新宋体,8,N 1666665914 1667577198 -1 -((415656,31232), (440786,48328)) +((416389,31906), (440053,47654)) 12615680 16570034 12632256 @@ -6486,7 +6486,7 @@ LABL 0 新宋体,8,N 1666667664 1667577198 -1 -((415341,12091), (438823,30987)) +((416023,12840), (438141,30238)) 12615680 16570034 12632256 @@ -6565,7 +6565,7 @@ LABL 0 新宋体,8,N 1667489810 1667577912 -1 -((414966,-771), (440096,10925)) +((415699,-322), (439363,10476)) 12615680 16570034 12632256 @@ -6590,7 +6590,7 @@ LABL 0 新宋体,8,N 1667535250 1667535414 -1 -((57385,-41413), (71803,-27017)) +((57784,-40851), (71404,-27579)) 12615680 16570034 12632256 @@ -17095,8 +17095,8 @@ COLLATE = utf8_general_ci resources_question_snapshot 1563157584 lx -1664941739 -87966 +1668347473 +lx 资源管理 - 题库管理-快照-关联来源 auto_increment = 1 ENGINE = InnoDB @@ -17145,6 +17145,17 @@ COLLATE = utf8_general_ci bigint +3F418A6F-8484-4A58-97BD-E7FAD481A050 +teacher_open_course_merge_resources_question_id +teacher_open_course_merge_resources_question_id +1668347431 +lx +1668347473 +lx +开课题目ID +bigint + + C2F9DA27-4C8F-4E1C-8FC7-097B5D5E2112 question_type question_type @@ -17156,7 +17167,7 @@ COLLATE = utf8_general_ci int(2) 2 - + D0F029A5-D1D5-41C6-A45A-8C02F71554D4 question_score question_score @@ -17169,7 +17180,7 @@ COLLATE = utf8_general_ci 3 1 - + 0ECC9C70-B0C6-4B6A-AA55-900348999E97 question_stem question_stem @@ -17181,7 +17192,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + 3A2CD667-596E-4179-A1C3-C84574CC2D35 question_option_a question_option_a @@ -17193,7 +17204,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 904C4226-FB16-49BB-BD20-7D4B75F9F84D question_option_b question_option_b @@ -17205,7 +17216,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 65D90F75-0EE9-4B45-9ABA-E0134A1861B6 question_option_c question_option_c @@ -17217,7 +17228,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 5372673F-EFA4-43E1-A307-9015247C3F08 question_option_d question_option_d @@ -17229,7 +17240,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 73EBF1AA-5D7F-49B4-BDDD-F43924A73C10 question_option_e question_option_e @@ -17241,7 +17252,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 7AF50FDC-012A-42EB-A0EA-ADE08E1C234B question_answer question_answer @@ -17253,7 +17264,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + C73F0E11-433D-4331-98DF-1BFDFDBC7071 question_analysis question_analysis @@ -17265,7 +17276,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + ECFF01FA-E7F1-4AC3-A90C-02D6558F5528 question_status question_status @@ -17277,7 +17288,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 97AAC8D6-13BD-4D2E-9C79-FF779394577C user_id user_id @@ -17288,7 +17299,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + 81D26B2E-3769-4C43-A6F5-CBCD440252BC org_id org_id @@ -17301,7 +17312,7 @@ COLLATE = utf8_general_ci - + 7392447A-2744-4FA6-A36F-A826153E895A Key_1 Key_1 @@ -17315,7 +17326,7 @@ COLLATE = utf8_general_ci - + @@ -17333,7 +17344,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 850B706C-D0E7-4BA7-8DBA-45679F09F6A7 hands_on_id hands_on_id @@ -17345,7 +17356,7 @@ COLLATE = utf8_general_ci bigint 1 - + FC177EB5-5A4D-40AB-97A8-6F8F90F0833D course_info_id course_info_id @@ -17356,7 +17367,7 @@ COLLATE = utf8_general_ci 归属课程 bigint - + 878DC971-55C1-463E-9B26-AA5A8D2A6050 course_child_node course_child_node @@ -17368,7 +17379,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 2F28A477-32CC-451F-BAAD-1EA1A14C5271 hands_on_name hands_on_name @@ -17380,7 +17391,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 6F0D6BD8-C583-4A83-BE65-B8F2F27EC7C1 hands_on_recommend hands_on_recommend @@ -17391,7 +17402,7 @@ COLLATE = utf8_general_ci 实操介绍 longtext - + 900E7743-FD29-4D18-AF9C-E38F12F067EE add_time add_time @@ -17402,7 +17413,7 @@ COLLATE = utf8_general_ci 添加时间 datetime - + FF48976C-19DE-4ED8-AE62-308A3D0355FE org_id org_id @@ -17413,7 +17424,7 @@ COLLATE = utf8_general_ci 组织机构ID bigint - + 09E4FCF8-5CCA-472E-B826-A31078151170 user_id user_id @@ -17424,7 +17435,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + E2A56A69-06E3-445F-ADB3-2BA8683D294D training_data training_data @@ -17438,7 +17449,7 @@ COLLATE = utf8_general_ci - + 44B83783-0E55-4E35-B885-A52DAB0B18B0 Key_1 Key_1 @@ -17447,12 +17458,12 @@ COLLATE = utf8_general_ci 1664366818 Administrator - + - + @@ -17470,7 +17481,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 6E23109A-B188-4800-9E35-D53C2562D140 hand_on_achievement_id hand_on_achievement_id @@ -17482,7 +17493,7 @@ COLLATE = utf8_general_ci bigint 1 - + 214C36F6-EA87-498C-BD45-A4F43A0AA247 class_id class_id @@ -17493,7 +17504,7 @@ COLLATE = utf8_general_ci 班级ID bigint - + 682C5C35-211B-489D-A5B1-A9AECD68E45B student_id student_id @@ -17504,7 +17515,7 @@ COLLATE = utf8_general_ci 学生ID bigint - + F753E259-F4E6-4C10-9C5F-3A8CD7FC589D video_score video_score @@ -17516,7 +17527,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 8017FDDE-1F2A-40AF-8856-2FAB3D262154 ppt_score ppt_score @@ -17528,7 +17539,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 831FB9AD-A1CE-4FE4-A35C-FC54B31BB3DF theory_score theory_score @@ -17540,7 +17551,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 75BCDC91-A7EE-4930-9384-742365C90532 practical_training_score practical_training_score @@ -17552,7 +17563,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 2A13F551-9C16-41EE-9330-4C6B4A69F72B report_writing_score report_writing_score @@ -17564,7 +17575,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 8EBDCB38-6C9F-4244-8D7A-5920D5D4571F total_score total_score @@ -17576,7 +17587,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 1E375EFE-4340-4C25-AAC7-193E13AA4375 hand_on_achievement_status hand_on_achievement_status @@ -17587,7 +17598,7 @@ COLLATE = utf8_general_ci 状态(1正常 2删除) int - + 086CE073-9210-40B5-8AD4-18DFC203FD6C add_time add_time @@ -17598,7 +17609,7 @@ COLLATE = utf8_general_ci 添加时间 datetime - + 645D29AA-55BC-4623-AB2F-A4B1ABC3D399 org_id org_id @@ -17609,7 +17620,7 @@ COLLATE = utf8_general_ci 组织机构ID bigint - + C123A2F4-2387-41B1-A58A-D734CE19A303 user_id user_id @@ -17620,7 +17631,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + D2900200-BE80-4E44-AB2F-C8D09BDB5C1C hands_on_id hands_on_id @@ -17633,7 +17644,7 @@ COLLATE = utf8_general_ci - + B0D8AA2C-134B-4F29-812C-2CF297E1B3BD Key_1 Key_1 @@ -17642,12 +17653,12 @@ COLLATE = utf8_general_ci 1664367809 Administrator - + - + @@ -17665,7 +17676,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + E4671207-5040-4904-92DB-023C20F53A20 task_id task_id @@ -17677,7 +17688,7 @@ COLLATE = utf8_general_ci bigint 1 - + D27475BA-317D-429A-8302-035F5AE2F464 hands_on_id hands_on_id @@ -17688,7 +17699,7 @@ COLLATE = utf8_general_ci 实操id(关联主表) bigint - + 79862F57-3C99-4B45-BE67-89F2D6E70AA8 task_type task_type @@ -17700,7 +17711,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + F612F8D7-69D5-4184-B1A7-5FF727951A4E task_title task_title @@ -17712,7 +17723,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 9DDD41EC-E8F1-41A3-8BC5-EDE0EC8EF8BB task_score task_score @@ -17724,7 +17735,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 3EA12D0C-E5A9-4BDB-B90A-72CD444DA363 task_order task_order @@ -17736,7 +17747,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + CEB4FDDE-4A46-4CDB-B3A5-701F9EF71F51 task_status task_status @@ -17748,7 +17759,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 15B60626-9307-47D6-866B-C0C49B97D328 assessment_requirements assessment_requirements @@ -17760,7 +17771,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 6253C10F-C6E0-44B4-B511-224D2600DEAF assessment_time assessment_time @@ -17772,7 +17783,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + BB99237E-C183-42EC-A44A-CA5A2C6DE9B0 assessment_content assessment_content @@ -17784,7 +17795,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 93639249-3FAE-4109-B6AE-B081FBD6667C org_id org_id @@ -17795,7 +17806,7 @@ COLLATE = utf8_general_ci 组织机构ID bigint - + B4C974E1-008C-4B9B-B999-F8AF83C6BDFB user_id user_id @@ -17806,7 +17817,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + 732E682D-30EB-4D1C-930C-E73F70116602 add_time add_time @@ -17819,7 +17830,7 @@ COLLATE = utf8_general_ci - + FC848634-7ABC-4D3E-A654-7B830AE00782 Key_1 Key_1 @@ -17828,12 +17839,12 @@ COLLATE = utf8_general_ci 1664368579 Administrator - + - + @@ -17851,7 +17862,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 9C17F6BF-95BF-42D1-B5B5-8C6ABC516FFD teacher_open_course_id teacher_open_course_id @@ -17863,7 +17874,7 @@ COLLATE = utf8_general_ci bigint 1 - + 3D47D3BA-1264-459E-AF87-1C726C786BDC teacher_id teacher_id @@ -17874,7 +17885,7 @@ COLLATE = utf8_general_ci 老师id bigint - + E6215401-EAF0-4627-AA91-227B95F365F3 sign_in_result sign_in_result @@ -17886,7 +17897,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + F166C282-3B67-4799-8841-1BFCF5047E99 chapter_contact_result chapter_contact_result @@ -17898,7 +17909,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + D4534894-264B-4534-A385-A597B1D619C0 course_practice_result course_practice_result @@ -17910,7 +17921,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 64FBDD1F-DCEA-462E-A414-4790C4B0A3F0 homework_result homework_result @@ -17922,7 +17933,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 95AC08BF-BABB-49E1-B7F6-D89F6FE0A9CC examination_result examination_result @@ -17934,7 +17945,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + F4679810-6841-4556-B446-8C392699E9AF interaction_result interaction_result @@ -17946,7 +17957,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + F0FC6274-C0E0-46FF-94D0-3ABA23450E7B sign_in_result_setting sign_in_result_setting @@ -17958,7 +17969,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 47D547E0-206E-4CFA-A4DD-6E643980CBAD sign_in_score sign_in_score @@ -17970,7 +17981,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 80A68554-A8D6-4EE8-955B-CC23AA84DF58 chapter_contact_result_setting chapter_contact_result_setting @@ -17982,7 +17993,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 3666BFF0-14E9-4A40-BEFB-FDB87A85F6B6 course_practice_result_setting course_practice_result_setting @@ -17994,7 +18005,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 9C9AA393-C6CD-4844-B6E6-0C36E640FDCF homework_result_setting homework_result_setting @@ -18006,7 +18017,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 3C9E0B7D-A966-4D2B-85B2-6F1147995BC8 examination_result_setting examination_result_setting @@ -18018,7 +18029,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 0B1E196A-184B-44D7-8C8E-C3E8D457A42F interaction_result_setting interaction_result_setting @@ -18030,7 +18041,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + CF61016D-C5CD-45B2-B6E2-3D80F9AF9166 interaction_result_message_score interaction_result_message_score @@ -18042,7 +18053,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 8E4A77B4-5D7B-4BED-AE69-5191B07C3561 interaction_result_question_score interaction_result_question_score @@ -18054,7 +18065,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 1A63ACE6-0FD8-4AC7-BAC6-9705E8684175 interaction_result_answer_score interaction_result_answer_score @@ -18066,7 +18077,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + D81E94EE-4A64-439E-BF70-9BB9933DA892 result_status_setting result_status_setting @@ -18078,7 +18089,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + D836FF9C-B353-47D5-B905-66B8DE0A3D4E dichotomy_score dichotomy_score @@ -18090,7 +18101,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + FF4EA24B-63DA-47CF-808A-E75628DA37F9 excellent_score excellent_score @@ -18102,7 +18113,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 9CC3EB0B-4D81-4A09-8D6F-7F5B6077C072 good_score good_score @@ -18114,7 +18125,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 4E504659-B165-48FA-AD3A-1F81C848C7A5 secondary_score secondary_score @@ -18126,7 +18137,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 191B02EB-C641-4307-807F-838BF23EC129 pass_score pass_score @@ -18138,7 +18149,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + E227AB1F-8F7E-4BD5-A3A8-CF5E9267F347 lettera_score lettera_score @@ -18150,7 +18161,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 95E50617-56D2-4562-B5D0-C0C14E4E9CAA letterb_score letterb_score @@ -18162,7 +18173,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + AFCD9651-BCEA-4E6C-8E28-B1908E1040FD letterc_score letterc_score @@ -18174,7 +18185,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 37FBFA1E-B4B1-419E-BE85-53D30EE7958F letterd_score letterd_score @@ -18186,7 +18197,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + CF9E0665-4D43-452C-A37A-CAC3411DC42D org_id org_id @@ -18197,7 +18208,7 @@ COLLATE = utf8_general_ci 组织ID bigint - + 59E94496-E5C0-4C16-94FC-074EDDC9D424 user_id user_id @@ -18208,7 +18219,7 @@ COLLATE = utf8_general_ci 用户ID bigint - + 3B3195F1-1DF8-4A04-92B9-F39CF289FD05 create_time create_time @@ -18221,7 +18232,7 @@ COLLATE = utf8_general_ci - + C4F24042-E7B0-4724-B345-C947B1A83B27 Key_1 Key_1 @@ -18230,12 +18241,12 @@ COLLATE = utf8_general_ci 1664461293 Administrator - + - + @@ -18253,7 +18264,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 5785DCE9-BE19-4529-8696-E98385D36578 teacher_open_course_question_log_wrong_id teacher_open_course_question_log_wrong_id @@ -18265,7 +18276,7 @@ COLLATE = utf8_general_ci bigint 1 - + D460EE44-6D5F-4B23-9FA4-0FFDA3538B0B teacher_open_course_question_setting_id teacher_open_course_question_setting_id @@ -18276,7 +18287,7 @@ COLLATE = utf8_general_ci 开课题目配置ID bigint - + D62428B5-1797-458C-B61F-13CED3753CFC resources_question_snapshot_id resources_question_snapshot_id @@ -18287,7 +18298,7 @@ COLLATE = utf8_general_ci 题目快照ID bigint - + D4EBF4E8-F0C6-4294-91C1-A490037E9228 teacher_open_course_question_log_answer teacher_open_course_question_log_answer @@ -18299,7 +18310,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 4CED0619-93D8-4507-B22B-635CC76C5B01 teacher_open_course_question_log_upload_file teacher_open_course_question_log_upload_file @@ -18311,7 +18322,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + FB8B6328-8F36-41B9-AEE9-51FAFC0FA83A teacher_open_course_question_log_add_time teacher_open_course_question_log_add_time @@ -18322,7 +18333,7 @@ COLLATE = utf8_general_ci 创建时间 datetime - + 1DC47F9A-6945-4254-B993-36A257051154 teacher_open_course_question_log_status teacher_open_course_question_log_status @@ -18333,7 +18344,7 @@ COLLATE = utf8_general_ci 状态(1正常 2删除) int - + 7FD7AA3E-0CF2-4308-8A38-1D288A65EEAC student_id student_id @@ -18344,7 +18355,7 @@ COLLATE = utf8_general_ci 学生ID bigint - + C4465E59-0246-4EC3-905D-6608481991F3 question_type question_type @@ -18356,7 +18367,7 @@ COLLATE = utf8_general_ci int(2) 2 - + A9445E3D-10F5-419E-90D3-A52275AB88B1 question_score question_score @@ -18369,7 +18380,7 @@ COLLATE = utf8_general_ci 3 1 - + 7654D7A1-80B5-412F-BAA2-5F2AC3A2462D question_stem question_stem @@ -18381,7 +18392,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + 31F8605E-EFE7-41E9-B79B-7E25F03F0F11 question_option_a question_option_a @@ -18393,7 +18404,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 06C6C203-21FF-4B53-B7C3-138F9EFBD866 question_option_b question_option_b @@ -18405,7 +18416,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 5D31463D-DCC5-45A6-A28D-968A83E806DA question_option_c question_option_c @@ -18417,7 +18428,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 609BCD20-1CD5-452C-9630-8435F9591C4B question_option_d question_option_d @@ -18429,7 +18440,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + C29737A2-23B1-49B6-80EF-2EC0EAEB1B79 question_option_e question_option_e @@ -18441,7 +18452,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + C369FBF4-33E0-4715-9B7B-6FE0276A467E question_answer question_answer @@ -18453,7 +18464,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + DC0EFE2B-49F5-47EF-B8B7-3F532BBBCBDE org_id org_id @@ -18464,7 +18475,7 @@ COLLATE = utf8_general_ci 组织ID bigint - + C230DFA1-F095-4AD0-9AAA-7147F8B7D58A user_id user_id @@ -18477,7 +18488,7 @@ COLLATE = utf8_general_ci - + FB46278B-3F47-4622-A24B-162EDEDD820C Key_1 Key_1 @@ -18486,12 +18497,12 @@ COLLATE = utf8_general_ci 1665199901 lx - + - + @@ -18509,7 +18520,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 5B0F6F18-59B0-4108-AB9F-2CD4264AD414 task_file_id task_file_id @@ -18521,7 +18532,7 @@ COLLATE = utf8_general_ci bigint 1 - + 4D01B040-6879-4E30-93C3-80AD29008B4E hands_on_id hands_on_id @@ -18532,7 +18543,7 @@ COLLATE = utf8_general_ci 实操ID bigint - + F7E6E96C-27B9-4914-896F-C42500B75E48 task_id task_id @@ -18543,7 +18554,7 @@ COLLATE = utf8_general_ci 任务ID bigint - + 2F1AAEC4-246C-492C-9935-CFB43B46F7BF file_url file_url @@ -18555,7 +18566,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + B392E466-47BF-467C-8236-4DE3014B6822 file_type file_type @@ -18567,7 +18578,7 @@ COLLATE = utf8_general_ci varchar(32) 32 - + 09707645-7A92-4289-9DDB-8339F65EC608 file_time file_time @@ -18579,7 +18590,7 @@ COLLATE = utf8_general_ci varchar(32) 32 - + 4A74D4C3-E005-4884-9B48-056F3602A7E4 file_name file_name @@ -18591,7 +18602,7 @@ COLLATE = utf8_general_ci varchar(64) 64 - + A45D22C4-383A-4C69-8B0E-4CC01AA8C200 add_time add_time @@ -18602,7 +18613,7 @@ COLLATE = utf8_general_ci 添加时间 datetime - + AD66C2EA-4F0C-47A6-96D3-794193D2BF31 user_id user_id @@ -18613,7 +18624,7 @@ COLLATE = utf8_general_ci 用户ID bigint - + 243FAA4D-F629-4856-A1C7-C0B786BB7FB6 org_id org_id @@ -18626,7 +18637,7 @@ COLLATE = utf8_general_ci - + F7B8FA88-217D-4D89-B553-6A32E8889DB2 Key_1 Key_1 @@ -18635,12 +18646,12 @@ COLLATE = utf8_general_ci 1666620820 Administrator - + - + @@ -18658,7 +18669,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + A7F56FF8-3828-4BA1-8FF2-3AEA177A3862 teacher_open_course_merge_resources_question_id teacher_open_course_merge_resources_question_id @@ -18673,7 +18684,7 @@ COLLATE = utf8_general_ci - + CBCCDEC5-F766-4440-A37B-BF11860AAE88 teacher_open_course_id teacher_open_course_id @@ -18684,7 +18695,7 @@ COLLATE = utf8_general_ci 开课ID bigint - + 0DD959C7-FA19-44D6-BC67-F640AF0BA2D6 teacher_open_course_merge_course_info_id teacher_open_course_merge_course_info_id @@ -18695,7 +18706,7 @@ COLLATE = utf8_general_ci 课程ID bigint - + EDDCE801-3B88-40A9-8311-6711C7B57317 question_type question_type @@ -18707,7 +18718,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 3E9DC56A-FFC0-4963-914B-FF2E343C479C question_score question_score @@ -18720,7 +18731,7 @@ COLLATE = utf8_general_ci 3 1 - + BCB89136-B2B6-442E-BAA4-3EB20EBFD5A9 question_stem question_stem @@ -18732,7 +18743,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + 6F1EBF7E-8CFB-497C-8011-F499E2DF52F3 question_option_a question_option_a @@ -18744,7 +18755,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + CF7456B1-1515-4A0A-B2DD-74E6EB0889FE question_option_b question_option_b @@ -18756,7 +18767,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 70945929-457A-45C3-AB79-3DA734B83C86 question_option_c question_option_c @@ -18768,7 +18779,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + EB1D617C-C883-425A-968C-7CA3C3280CB9 question_option_d question_option_d @@ -18780,7 +18791,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + BA701774-8C7F-4B54-91B3-1CCB2E0EBC57 question_option_e question_option_e @@ -18792,7 +18803,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + CEFCA8C2-8AB4-4817-A8B7-B998AFE27C38 question_answer question_answer @@ -18804,7 +18815,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 3683EE8D-7600-45A7-AAC4-26CF0E3961CA question_analysis question_analysis @@ -18816,7 +18827,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + EC60F7DF-05A9-4993-89E9-E89D4E937B82 question_status question_status @@ -18828,7 +18839,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 83D8DFAE-177D-4DC5-AAC9-008A46DBB4E0 user_id user_id @@ -18839,7 +18850,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + D420ED9B-06FA-441B-9B4D-1E562E3C8A0A org_id org_id @@ -18852,7 +18863,7 @@ COLLATE = utf8_general_ci - + 8179B9A7-5EF4-4FD3-8171-218578989756 Key_1 Key_1 @@ -18861,12 +18872,12 @@ COLLATE = utf8_general_ci 1666665914 lx - + - + @@ -18884,7 +18895,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 72ABAAF5-E9CC-4443-B554-8FD0D5026959 teacher_open_course_merge_course_info_id teacher_open_course_merge_course_info_id @@ -18900,7 +18911,7 @@ COLLATE = utf8_general_ci - + 05999421-8B53-4DC3-8401-E013D7AB3222 teacher_open_course_id teacher_open_course_id @@ -18911,7 +18922,7 @@ COLLATE = utf8_general_ci 开课ID bigint - + 4094852A-D94F-4155-BAED-44F8C03F2765 course_info_name course_info_name @@ -18923,7 +18934,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 9A0456AD-52C1-47E9-8337-6D537FA3EEE4 course_info_thumbnail course_info_thumbnail @@ -18935,7 +18946,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 928F96A5-78AD-4CC4-B7E0-60171A69BCE2 course_label_id course_label_id @@ -18946,7 +18957,7 @@ COLLATE = utf8_general_ci 课程标签ID bigint - + 8B193D14-7EB4-4826-BEB1-8C552C442AFF course_info_basics_count course_info_basics_count @@ -18957,7 +18968,7 @@ COLLATE = utf8_general_ci 课程学习人数基数 integer - + E36F981C-6222-490B-9A0A-E5BA6337FDC4 course_info_content course_info_content @@ -18969,7 +18980,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + E8D0F5EB-F77C-4F83-B857-9B94CFA835C9 course_info_status course_info_status @@ -18981,7 +18992,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 21AE8D74-6366-41E0-BED1-9C99D29BB466 course_info_type course_info_type @@ -18993,7 +19004,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 97C8D9A6-5FDD-4BE5-9A78-162F89BEA472 course_info_parent_id course_info_parent_id @@ -19004,7 +19015,7 @@ COLLATE = utf8_general_ci 父节点ID bigint - + 3E179F3A-809B-47F5-B944-97A4EDE407B6 course_video_id course_video_id @@ -19015,7 +19026,7 @@ COLLATE = utf8_general_ci 视频ID(resources_info_id,和节对应) bigint - + CA2E4B57-D0F8-42BC-8DAF-D44809BD53AC course_courseware_id course_courseware_id @@ -19026,7 +19037,7 @@ COLLATE = utf8_general_ci 课件ID(resources_info_id,和节对应) bigint - + A9F57DB7-CC64-4A10-8958-7E49B3849DED course_enclosure_ids course_enclosure_ids @@ -19038,7 +19049,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + D4073EFA-8140-456B-8A91-64B5F9A2B39A resources_question_ids resources_question_ids @@ -19050,7 +19061,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + A145377E-B5F9-483E-A8B3-566DA0A929F1 resources_competition_ids resources_competition_ids @@ -19062,7 +19073,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + 0539CE61-851C-4BC2-9708-02825EEC9197 resources_training_ids resources_training_ids @@ -19074,7 +19085,7 @@ COLLATE = utf8_general_ci varchar(3000) 3000 - + C40461E0-8795-4145-9C4F-BD6D923AC797 org_id org_id @@ -19085,7 +19096,7 @@ COLLATE = utf8_general_ci 组织机构ID bigint - + 2E3F56D7-1A9D-4C0F-AE79-3CA8ABA4D781 user_id user_id @@ -19098,7 +19109,7 @@ COLLATE = utf8_general_ci - + 487E7680-2D62-4E90-BC92-343BA7FED8CC Key_1 Key_1 @@ -19107,12 +19118,12 @@ COLLATE = utf8_general_ci 1666667664 lx - + - + @@ -19130,7 +19141,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + CF326123-713F-44BF-973A-31FF1E67CEE2 teacher_open_course_merge_schedule_session_id teacher_open_course_merge_schedule_session_id @@ -19142,7 +19153,7 @@ COLLATE = utf8_general_ci bigint 1 - + A945D376-9B17-4F26-A066-D98134B9F0EA teacher_open_course_id teacher_open_course_id @@ -19153,7 +19164,7 @@ COLLATE = utf8_general_ci 开课ID bigint - + 0087F0C6-5B8C-450C-98E8-DF374D761940 teacher_open_course_schedule_session_id teacher_open_course_schedule_session_id @@ -19164,7 +19175,7 @@ COLLATE = utf8_general_ci 课程排课配置ID bigint - + 8470113F-8098-441D-8CF3-D5D00AC57046 teacher_open_course_merge_schedule_session_add_time teacher_open_course_merge_schedule_session_add_time @@ -19175,7 +19186,7 @@ COLLATE = utf8_general_ci 添加时间 datetime - + 05AC4F75-E876-4096-A167-AE2940919C9D teacher_open_course_merge_schedule_session_status teacher_open_course_merge_schedule_session_status @@ -19187,7 +19198,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 349525C2-A661-4039-8660-866FF54BD9F3 org_id org_id @@ -19198,7 +19209,7 @@ COLLATE = utf8_general_ci 组织ID bigint - + BB5D0B8E-7AEA-4E6B-A665-DD5FB2A0B750 user_id user_id @@ -19211,7 +19222,7 @@ COLLATE = utf8_general_ci - + EC034412-CC70-4F6E-906D-CDAC7D42753A Key_1 Key_1 @@ -19220,12 +19231,12 @@ COLLATE = utf8_general_ci 1667058643 lx - + - + @@ -19243,7 +19254,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 16A15F23-B976-4E21-A4D8-F21D5E752306 student_merge_application_id student_merge_application_id @@ -19255,7 +19266,7 @@ COLLATE = utf8_general_ci bigint 1 - + 215485E7-DC30-4DB4-9EA2-7DBABA768262 student_id student_id @@ -19266,7 +19277,7 @@ COLLATE = utf8_general_ci 学生ID bigint - + 8E0018D4-51E4-481D-9045-3EF277598C53 resources_application_id resources_application_id @@ -19277,7 +19288,7 @@ COLLATE = utf8_general_ci 应用ID bigint - + 39089E78-6A7C-4B6A-9109-D9814D57A455 student_merge_application_order_index student_merge_application_order_index @@ -19289,7 +19300,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 1ACBEF32-B05D-4AF7-B418-5B8DD8852B27 student_merge_application_add_time student_merge_application_add_time @@ -19300,7 +19311,7 @@ COLLATE = utf8_general_ci 创建时间 datetime - + 5DCB218D-1693-4CB5-B977-47ED030AA81F org_id org_id @@ -19311,7 +19322,7 @@ COLLATE = utf8_general_ci 组织ID bigint - + E929D829-C14F-40E2-A0A7-4BE1EEC0B905 user_id user_id @@ -19324,7 +19335,7 @@ COLLATE = utf8_general_ci - + 9A2FF246-D6C2-44BA-9632-0D498E55D49C Key_1 Key_1 @@ -19333,12 +19344,12 @@ COLLATE = utf8_general_ci 1667146861 87966 - + - + @@ -19356,7 +19367,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + CDAAB448-1707-4BE2-8CAE-469C454FDDBE teacher_open_course_merge_resources_info_id teacher_open_course_merge_resources_info_id @@ -19372,7 +19383,7 @@ COLLATE = utf8_general_ci - + 5AAF2FCF-A045-49C3-961F-9F8886D7DAD4 teacher_open_course_merge_course_info_id teacher_open_course_merge_course_info_id @@ -19383,7 +19394,7 @@ COLLATE = utf8_general_ci 开课课程ID bigint - + 824383E6-463A-4BA9-A979-26F2080166C6 teacher_open_course_id teacher_open_course_id @@ -19394,7 +19405,7 @@ COLLATE = utf8_general_ci 教师开课ID bigint - + A4BB12CC-1C25-4FC7-8C13-1FD3E9042B76 resources_info_name resources_info_name @@ -19406,7 +19417,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 633CC9F7-C3F4-4347-BEF7-BB371126424C resources_info_type resources_info_type @@ -19418,7 +19429,7 @@ COLLATE = utf8_general_ci int(2) 2 - + 62CD72AC-8FB3-4E38-8498-68A2205F2850 resources_info_content resources_info_content @@ -19430,7 +19441,7 @@ COLLATE = utf8_general_ci varchar(4000) 4000 - + 62640640-6A94-460E-B784-074E5A40B789 resources_info_files resources_info_files @@ -19442,7 +19453,7 @@ COLLATE = utf8_general_ci varchar(4000) 4000 - + 21F5F058-AF92-4F55-B666-3DF75CF77936 order_index order_index @@ -19453,7 +19464,7 @@ COLLATE = utf8_general_ci 资源排序 bigint - + DF0255D5-A8C9-43E8-9D9E-0DDFA19DFE5E user_id user_id @@ -19464,7 +19475,7 @@ COLLATE = utf8_general_ci 后台用户ID bigint - + F6ACE349-86F0-4A59-90C0-5D89F9C43777 org_id org_id @@ -19477,7 +19488,7 @@ COLLATE = utf8_general_ci - + C2FA3921-165F-4542-BF1B-D74C6C833D9B Key_1 Key_1 @@ -19486,12 +19497,12 @@ COLLATE = utf8_general_ci 1667489810 lx - + - + @@ -19509,7 +19520,7 @@ DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci - + 56465247-51F8-416A-AEFD-714542E9B63D id id @@ -19525,7 +19536,7 @@ COLLATE = utf8_general_ci - + DF818B83-40D4-4080-9E3F-98491EA22EB2 method method @@ -19537,7 +19548,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + 7C08961B-D182-4228-AEC8-2AEBEFEF71C4 request_url request_url @@ -19549,7 +19560,7 @@ COLLATE = utf8_general_ci varchar(1000) 1000 - + F0F132B4-57B4-479B-9CD1-9F5905CD2601 params params @@ -19561,7 +19572,7 @@ COLLATE = utf8_general_ci varchar(5000) 5000 - + 66D52CA7-15B6-4DCA-AA5B-219B0CEADDEB result result @@ -19575,7 +19586,7 @@ COLLATE = utf8_general_ci - + 37390514-F792-4EBB-A521-C2658EBA5347 ip ip @@ -19587,7 +19598,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + 9D42C096-6C91-443C-A5F4-40A28415C755 create_time create_time @@ -19598,7 +19609,7 @@ COLLATE = utf8_general_ci 创建时间 datetime - + 574D853B-7D8A-4423-99E1-906478E34CB2 result_time result_time @@ -19609,7 +19620,7 @@ COLLATE = utf8_general_ci 响应时间 datetime - + ACF5FB8B-B673-49F3-AE69-29688243F55D token token @@ -19621,7 +19632,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + D25040D0-B768-4E68-BFA8-FFCFE2CED70D student_id student_id @@ -19632,7 +19643,7 @@ COLLATE = utf8_general_ci 学生ID bigint - + 7869AAF1-7013-450F-86E1-5AA5E0E07A81 session session @@ -19644,7 +19655,7 @@ COLLATE = utf8_general_ci varchar(255) 255 - + D776ED49-FA3F-472A-BDDC-FA294ED32EB9 user_id user_id @@ -19655,7 +19666,7 @@ COLLATE = utf8_general_ci 管理员或教师ID bigint - + DC875B01-3F9E-4C9D-B253-30457968AD50 open_id open_id @@ -19669,7 +19680,7 @@ COLLATE = utf8_general_ci - + 7D6196D6-D9F5-4F30-886C-8F0F2D1AA50B Key_1 Key_1 @@ -19678,17 +19689,17 @@ COLLATE = utf8_general_ci 1667535250 lx - + - + - + BFEA4109-96F9-4074-AF58-B84D6574A7FC PUBLIC PUBLIC @@ -19699,7 +19710,7 @@ COLLATE = utf8_general_ci - + ABEFC813-1056-4507-A9A7-809C149B4ABE 1661954753 lx @@ -19974,7 +19985,7 @@ COLLATE = utf8_general_ci - + 5963E417-B2CE-431D-988A-B3493AAE5EE4 MySQL 5.0 MYSQL50 diff --git a/doc/sql/mysql/tianze-pro-update.sql b/doc/sql/mysql/tianze-pro-update.sql index 7021bfca..c04b6385 100644 --- a/doc/sql/mysql/tianze-pro-update.sql +++ b/doc/sql/mysql/tianze-pro-update.sql @@ -358,4 +358,7 @@ ALTER TABLE teacher_open_course_merge_resources_info ADD COLUMN resources_info_f ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_course_schedule_session_open_on_holidays tinyint(1) COMMENT '节假日是否排课'; -ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_course_schedule_session_class_list varchar(4000) COMMENT '开课节次和班级的组合,JSON格式'; \ No newline at end of file +ALTER TABLE teacher_open_course_merge_schedule_session ADD COLUMN teacher_open_course_schedule_session_class_list varchar(4000) COMMENT '开课节次和班级的组合,JSON格式'; + +-- 回显用 +ALTER TABLE resources_question_snapshot ADD COLUMN teacher_open_course_merge_resources_question_id bigint COMMENT '开课题目ID'; \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseMergeCourseInfoDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseMergeCourseInfoDao.java index 46a2a105..4529a9d7 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseMergeCourseInfoDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseMergeCourseInfoDao.java @@ -8,6 +8,7 @@ import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.Update; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; import javax.validation.constraints.NotNull; @@ -29,6 +30,8 @@ public interface TeacherOpenCourseMergeCourseInfoDao extends BaseMapper getByIds(String ids); + + @Cacheable(value = "teacherOpenCourseMergeCourseInfoDao.getById", key="#id", unless = "#result == null") default TeacherOpenCourseMergeCourseInfo getById(Long id) { List list = getByIds(id.toString()); return ObjectUtil.isNotEmpty(list) ? list.get(0) : null; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/ResourcesQuestionSnapshot.java b/web/src/main/java/com/ibeetl/jlw/entity/ResourcesQuestionSnapshot.java index 948349bd..11cf6ab9 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/ResourcesQuestionSnapshot.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/ResourcesQuestionSnapshot.java @@ -29,7 +29,10 @@ public class ResourcesQuestionSnapshot extends BaseEntity{ //开课课程ID @Dict(type = "teacher_open_course_merge_course_info.course_info_name.course_info_status=1") private Long teacherOpenCourseMergeCourseInfoId ; - + + //开课题目ID 回显用 + private Long teacherOpenCourseMergeResourcesQuestionId ; + //题型(1单选 2多选 3判断) private Integer questionType ; @@ -296,4 +299,12 @@ public class ResourcesQuestionSnapshot extends BaseEntity{ public void setTeacherOpenCourseMergeCourseInfoId(Long teacherOpenCourseMergeCourseInfoId) { this.teacherOpenCourseMergeCourseInfoId = teacherOpenCourseMergeCourseInfoId; } + + public Long getTeacherOpenCourseMergeResourcesQuestionId() { + return teacherOpenCourseMergeResourcesQuestionId; + } + + public void setTeacherOpenCourseMergeResourcesQuestionId(Long teacherOpenCourseMergeResourcesQuestionId) { + this.teacherOpenCourseMergeResourcesQuestionId = teacherOpenCourseMergeResourcesQuestionId; + } } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java index 94a75faa..7282fe89 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseQuestionSetting.java @@ -6,6 +6,7 @@ import com.ibeetl.admin.core.annotation.Dict; import com.ibeetl.admin.core.annotation.DictEnum; import com.ibeetl.admin.core.entity.BaseEntity; import com.ibeetl.admin.core.util.ValidateConfig; +import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionSettingDTO; import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum; import lombok.Data; import lombok.EqualsAndHashCode; @@ -179,6 +180,43 @@ public class TeacherOpenCourseQuestionSetting extends BaseEntity { @InsertIgnore private List resourcesQuestionSnapshotList; + /** + * 根据题目类型动态配置题目。 + * + */ + @FetchSql("SELECT " + + " t.question_type AS question_type, " + + " ( SELECT count( 1 ) FROM teacher_open_course_merge_resources_question ta WHERE ta.question_type = t.question_type AND ta.question_status = 1 ) AS total_count, " + + " count( 1 ) AS select_count, " + + " min( t.question_score ) single_score, " + + " min( t.question_score ) * count( 1 ) AS single_type_total_score, " + + " GROUP_CONCAT( t.teacher_open_course_merge_resources_question_id ) AS resources_question_id_plural " + + "FROM " + + " resources_question_snapshot t " + + "WHERE " + + " 1 = 1 " + + " AND t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# " + + " " + + " AND t.question_status = 1 " + + "GROUP BY " + + " t.question_type " + ) + @UpdateIgnore + @InsertIgnore + private List questionSettingOptions; + + /** + * 其他表的字段,回显用 + */ + @UpdateIgnore + @InsertIgnore + // 题目ID集合 + @FetchSql("select group_concat(t.teacher_open_course_merge_resources_question_id) " + + "from resources_question_snapshot t where t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# \n" + + "and t.question_status = 1 \n" + ) + private String resourcesQuestionIdPlural; + public void setAvgSuccessCount(Integer avgSuccessCount) { this.avgSuccessCount = avgSuccessCount; tryToUpdateAvgSuccessRate(); diff --git a/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseQuestionSettingDTO.java b/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseQuestionSettingDTO.java index 18be64bb..4c65099f 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseQuestionSettingDTO.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseQuestionSettingDTO.java @@ -1,12 +1,14 @@ package com.ibeetl.jlw.entity.dto; import cn.jlw.validate.ValidateConfig; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import org.beetl.sql.annotation.entity.AutoID; import javax.validation.constraints.NotNull; import java.math.BigDecimal; @@ -22,12 +24,16 @@ import java.math.BigDecimal; @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) +@JsonIgnoreProperties(ignoreUnknown = true) public class TeacherOpenCourseQuestionSettingDTO { /** * 题型 */ @NotNull(message = "题型不能为空!", groups = ValidateConfig.ADD.class) + // 用于主键缓存 + + @AutoID private ResourcesQuestionTypeEnum questionType; /** diff --git a/web/src/main/java/com/ibeetl/jlw/enums/CopyFromEnum.java b/web/src/main/java/com/ibeetl/jlw/enums/CopyFromEnum.java new file mode 100644 index 00000000..c8e0b31a --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/enums/CopyFromEnum.java @@ -0,0 +1,24 @@ +package com.ibeetl.jlw.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.beetl.sql.annotation.entity.EnumMapping; + +/** + * 资源题目课程等信息的抽取来源 + * + * @author mlx + */ +@Getter +@EnumMapping("name") +@AllArgsConstructor +public enum CopyFromEnum { + + // 从系统配置的课程中获取 + FROM_SYSTEM("系统端"), + + // 从教师开课中获取 + FROM_OPEN_COURSE("开课端"); + + private String text; +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/CourseInfoService.java b/web/src/main/java/com/ibeetl/jlw/service/CourseInfoService.java index 8dd43f84..22b327b5 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/CourseInfoService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/CourseInfoService.java @@ -186,7 +186,7 @@ public class CourseInfoService extends CoreBaseService{ return courseInfoDao.getCourseInfoValues(courseInfoQuery); } - @Cacheable(value = "courseInfoService.getById", key = "#courseInfoId", unless = "#courseInfoId == null") + @Cacheable(value = "courseInfoService.getById", key = "#courseInfoId", unless = "#result == null") public CourseInfo getById(Long courseInfoId){ CourseInfo courseInfo = courseInfoDao.getById(courseInfoId); diff --git a/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionService.java b/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionService.java index b5a3ab76..7ec92cc6 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionService.java @@ -1,6 +1,8 @@ package com.ibeetl.jlw.service; +import cn.hutool.core.util.EnumUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.jlw.util.ToolUtils; import com.ibeetl.admin.core.service.CoreBaseService; @@ -14,6 +16,8 @@ import com.ibeetl.jlw.entity.CourseInfo; import com.ibeetl.jlw.entity.FileEntity; import com.ibeetl.jlw.entity.ResourcesQuestion; import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionExperimentalSystem; +import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionSettingDTO; +import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum; import com.ibeetl.jlw.web.query.CourseInfoQuery; import com.ibeetl.jlw.web.query.ResourcesQuestionQuery; import org.apache.commons.lang3.StringUtils; @@ -23,12 +27,14 @@ import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.assertj.core.util.Lists; import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.*; import java.math.BigDecimal; @@ -36,10 +42,13 @@ import java.text.DateFormat; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; import static cn.hutool.core.util.ArrayUtil.join; import static com.ibeetl.jlw.entity.ResourcesQuestionOptionEntity.shuffleOrderOptions; import static java.util.stream.Collectors.groupingBy; +import static java.util.stream.Collectors.joining; /** @@ -57,6 +66,7 @@ public class ResourcesQuestionService extends CoreBaseService @Autowired private CourseInfoDao courseInfoDao; @Autowired private CorePlatformService platformService; + @Autowired private ResourcesQuestionService resourcesQuestionService; public PageQuery queryByCondition(PageQuery query){ PageQuery ret = resourcesQuestionDao.queryByCondition(query); @@ -659,4 +669,89 @@ public class ResourcesQuestionService extends CoreBaseService resourcesQuestionQuery.setQuestionStatus(1); return getValuesByQuery(resourcesQuestionQuery); } + + /** + * 通过无类别区分的题目ID,对题目进行分组。并构建需要的数据 + * 只适用于手动出题这块。 + * + * @param noDiffResourcesQuestionIdPlural 题目ID来自ResourcesQuestion表。 + * @return + */ + public Map buildSettingDtoListByNoDiffQuestionIds( + @NotEmpty(message = "系统题目ID不能为空!") String noDiffResourcesQuestionIdPlural) { + + // 只查询正常状态的题目列表 + ResourcesQuestionQuery resourcesQuestionQuery = new ResourcesQuestionQuery(); + resourcesQuestionQuery.setQuestionStatus(1); + resourcesQuestionQuery.setResourcesQuestionIds(noDiffResourcesQuestionIdPlural); + List valuesByQuery = resourcesQuestionService.getValuesByQuery(resourcesQuestionQuery); + + return buildSettingDtoListByNoDiffQuestionList(valuesByQuery); + } + + /** + * 通过无类别区分的题目列表,对题目进行分组。并构建需要的数据 + * 只适用于手动出题这块。 + * + * @param resourcesQuestionList + * @return + */ + public Map buildSettingDtoListByNoDiffQuestionList( + List resourcesQuestionList) { + return buildSettingDtoListByNoDiffQuestionList(resourcesQuestionList, ResourcesQuestion::getResourcesQuestionId); + } + + /** + * 通过无类别区分的题目列表,对题目进行分组。并构建需要的数据 + * 只适用于手动出题这块。 + * + * @param resourcesQuestionList + * @return + */ + public Map buildSettingDtoListByNoDiffQuestionList( + List resourcesQuestionList, Function function) { + + if (ObjectUtil.isEmpty(resourcesQuestionList)) { + return null; + } + + // 先构建初始的属性 + Function buildFunc = + item -> TeacherOpenCourseQuestionSettingDTO.builder() + .questionType(EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, item.getQuestionType())) + .resourcesQuestionIdPlural(function.apply(item).toString()) + .singleScore(item.getQuestionScore()) + .build(); + + // 根据类型分组 + Map> groupMap = + resourcesQuestionList.stream().map(buildFunc).collect(groupingBy(TeacherOpenCourseQuestionSettingDTO::getQuestionType)); + + Map result = new ConcurrentHashMap<>(5); + + // 分组后的数据,再处理 + groupMap.forEach((key, value) -> { + + // resourcesQuestionIdPlural 上面暂存的是单个题目ID,这里将所有的题目ID处理成逗号隔开的字符 + String questionIds = value.stream() + .map(TeacherOpenCourseQuestionSettingDTO::getResourcesQuestionIdPlural).collect(joining(",")); + + // 查询到的题目的数量 + Integer selectCount = ObjectUtil.defaultIfNull(value, Lists.emptyList()).size(); + + // 设置其他属性,如果集合长度不为空的话 + if (selectCount > 0) { + TeacherOpenCourseQuestionSettingDTO teacherOpenCourseQuestionSettingDTO = value.get(0); + // 该类型下,单个题目的分数 + BigDecimal singleScore = teacherOpenCourseQuestionSettingDTO.getSingleScore(); + teacherOpenCourseQuestionSettingDTO.setResourcesQuestionIdPlural(questionIds) + .setSingleTypeTotalScore(NumberUtil.mul(singleScore, selectCount)) + .setSelectCount(selectCount); + + // 放入结果集中 + result.put(key, teacherOpenCourseQuestionSettingDTO); + } + }); + return result; + } } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionSnapshotService.java b/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionSnapshotService.java index e7b5f411..266d4b61 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionSnapshotService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/ResourcesQuestionSnapshotService.java @@ -190,14 +190,13 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService questionSettingOptions, Map courseInfoIdPair) { - - // 在插入之前,先清空列表。这种情况下,支持题目配置还在,重置题目列表的操作。 - deleteByTeacherOpenCourseQuestionSettingIds(teacherOpenCourseQuestionSettingId.toString()); - + public void insertBatchByOpenResourcesQuestion(@NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId, + @Nullable Collection questionSettingOptions, Map courseInfoIdPair) { // 题目设置,来动态获取题目 if(ObjectUtil.isNotEmpty(questionSettingOptions)) { + // 在插入之前,先清空列表。这种情况下,支持题目配置还在,重置题目列表的操作。 + deleteByTeacherOpenCourseQuestionSettingIds(teacherOpenCourseQuestionSettingId.toString()); + // 数据库动态设置分数,并获取题目列表 List insertList = getOpenResourcesQuestionSnapListBySettingOptions( teacherOpenCourseQuestionSettingId, questionSettingOptions, courseInfoIdPair); @@ -215,7 +214,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService questionSettingOptions, Map courseInfoIdPair) { + @Nullable Collection questionSettingOptions, Map courseInfoIdPair) { // 在插入之前,先清空列表。这种情况下,支持题目配置还在,重置题目列表的操作。 deleteByTeacherOpenCourseQuestionSettingIds(teacherOpenCourseQuestionSettingId.toString()); @@ -242,7 +241,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService getByOpenCourseResourcesQuestion(@NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId, - @Nullable List questionSettingOptions, Map courseInfoIdPair) { + @Nullable Collection questionSettingOptions, Map courseInfoIdPair) { // 题目设置,来动态获取题目 if(ObjectUtil.isNotEmpty(questionSettingOptions)) { // 数据库动态设置分数,并获取题目列表 @@ -263,7 +262,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService getBySystemResourcesQuestion(@NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId, - @Nullable List questionSettingOptions, Map courseInfoIdPair) { + @Nullable Collection questionSettingOptions, Map courseInfoIdPair) { // 题目设置,来动态获取题目 if(ObjectUtil.isNotEmpty(questionSettingOptions)) { // 数据库动态设置分数,并获取题目列表 @@ -283,7 +282,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService insertList, @NotNull Map courseInfoIdPair) { + public void setNewCourseInfoId(@NotNull Collection insertList, @NotNull Map courseInfoIdPair) { insertList.forEach(item -> { Long courseMergeCourseInfoId = item.getTeacherOpenCourseMergeCourseInfoId(); item.setTeacherOpenCourseMergeCourseInfoId(courseInfoIdPair.getOrDefault(courseMergeCourseInfoId, courseMergeCourseInfoId)); @@ -296,7 +295,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService insertList, @NotNull Map courseInfoIdPair) { + public void setRQNewCourseInfoId(@NotNull Collection insertList, @NotNull Map courseInfoIdPair) { insertList.forEach(item -> { Long courseMergeCourseInfoId = item.getTeacherOpenCourseMergeCourseInfoId(); item.setTeacherOpenCourseMergeCourseInfoId(courseInfoIdPair.getOrDefault(courseMergeCourseInfoId, courseMergeCourseInfoId)); @@ -336,7 +335,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService getResourcesQuestionSnapshotList ( - @NotEmpty(message = "开课题库列表不能为空!") final List questionList, + @NotEmpty(message = "开课题库列表不能为空!") final Collection questionList, @NotBlank(message = "题目配置ID不能为空!") Long teacherOpenCourseQuestionSettingId, Consumer otherConsumer) { // 批量插入快照表 List snapshotList = BeanUtil.copyToList(questionList, ResourcesQuestionSnapshot.class); @@ -382,7 +381,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService getOpenResourcesQuestionSnapListBySettingOptions ( @NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId, - @NotBlank(message = "题目设置不能为空!") List questionSettingOptions, Map courseInfoIdPair) { + @NotBlank(message = "题目设置不能为空!") Collection questionSettingOptions, Map courseInfoIdPair) { List result = new ArrayList<>(); @@ -410,7 +409,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService getMergeResourcesQuestionSnapListByQuestionSettingOptionsBySystem ( @NotNull(message = "开课题目配置ID不能为空!") final Long teacherOpenCourseQuestionSettingId, - @NotBlank(message = "题目设置不能为空!") List questionSettingOptions, Map courseInfoIdPair) { + @NotBlank(message = "题目设置不能为空!") Collection questionSettingOptions, Map courseInfoIdPair) { List result = new ArrayList<>(); diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeCourseInfoService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeCourseInfoService.java index 6c7edaa1..ffc6b9d0 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeCourseInfoService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeCourseInfoService.java @@ -54,6 +54,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import static cn.hutool.core.util.ArrayUtil.join; import static cn.hutool.core.util.ObjectUtil.defaultIfNull; import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; +import static com.ibeetl.jlw.enums.CopyFromEnum.FROM_OPEN_COURSE; import static java.util.stream.Collectors.toSet; /** @@ -224,7 +225,7 @@ public class TeacherOpenCourseMergeCourseInfoService extends CoreBaseService courseInfoList, + @NotNull Long filterTeacherOpenCourseMergeCourseInfoId, + Collection result){ + for (TeacherOpenCourseMergeCourseInfo courseInfo : courseInfoList) { + if(courseInfo.getCourseInfoParentId() != null && courseInfo.getCourseInfoParentId().equals(filterTeacherOpenCourseMergeCourseInfoId)) { + result.add(courseInfo); + getCourseResourcesByList(courseInfoList, courseInfo.getTeacherOpenCourseMergeCourseInfoId(), result); + } + } + } + /** * 获取Tree树型结果集。根据开课课程ID。可以是课程,章节、小节等 * 不包含本身。 diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesInfoService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesInfoService.java index 92b8f485..a45a7dab 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesInfoService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesInfoService.java @@ -329,8 +329,8 @@ public class TeacherOpenCourseMergeResourcesInfoService extends CoreBaseService< * @param allCourseInfo 指定的所有课程章节 * @param courseInfoIdPair 拷贝过来的ID段,旧ID和新ID的一个映射关系(非必填) */ - public void copyFromQuestionByCourseChapterInfoIds(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, - Collection allCourseInfo, @Nullable Map courseInfoIdPair) { + public void copySystemResourcesInfoToOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + Collection allCourseInfo, @Nullable Map courseInfoIdPair) { ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery(); // 取出所有的课程章节ID String courseInfoIds = allCourseInfo.stream().map(item -> item.getCourseInfoId().toString()).collect(joining(",")); @@ -350,8 +350,8 @@ public class TeacherOpenCourseMergeResourcesInfoService extends CoreBaseService< * @param allCourseInfoIdsJoin 指定的所有课程章节ID * @param courseInfoIdPair 拷贝过来的ID段,旧ID和新ID的一个映射关系(非必填) */ - public void copyFromQuestionByCourseChapterInfoIds(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, - String allCourseInfoIdsJoin, @Nullable Map courseInfoIdPair) { + public void copySystemResourcesInfoToOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + String allCourseInfoIdsJoin, @Nullable Map courseInfoIdPair) { ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery(); resourcesInfoQuery.setCourseInfoIds(allCourseInfoIdsJoin); List resourcesInfoList = resourcesInfoService.getValuesByQuery(resourcesInfoQuery); diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesQuestionService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesQuestionService.java index 28b6ee21..80effaa0 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesQuestionService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseMergeResourcesQuestionService.java @@ -3,6 +3,8 @@ package com.ibeetl.jlw.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.EnumUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.jlw.util.ToolUtils; import com.alibaba.fastjson.JSON; @@ -18,7 +20,9 @@ import com.ibeetl.jlw.entity.CourseInfo; import com.ibeetl.jlw.entity.FileEntity; import com.ibeetl.jlw.entity.ResourcesQuestion; import com.ibeetl.jlw.entity.TeacherOpenCourseMergeResourcesQuestion; +import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionSettingDTO; import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionSettingVO; +import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum; import com.ibeetl.jlw.web.query.ResourcesQuestionQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeResourcesQuestionQuery; import lombok.extern.slf4j.Slf4j; @@ -28,6 +32,7 @@ import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.assertj.core.util.Lists; import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; import org.springframework.beans.factory.annotation.Autowired; @@ -39,11 +44,12 @@ import javax.validation.constraints.NotNull; import java.io.*; import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; import static cn.hutool.core.util.ArrayUtil.join; import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toSet; +import static java.util.stream.Collectors.*; /** * 开课题目拉取 Service @@ -379,8 +385,8 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ * @param allCourseInfo 指定的所有课程章节信息 * @param courseInfoIdPair 拷贝过来的ID段,旧ID和新ID的一个映射关系(非必填) */ - public void copyFromQuestionByCourseChapterInfoIds(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, - Collection allCourseInfo, @NotNull Map courseInfoIdPair) { + public void copySystemQuestionToOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + Collection allCourseInfo, @NotNull Map courseInfoIdPair) { // 待拷贝的系统课程ID不能为空.才会执行 if (ObjectUtil.isNotEmpty(allCourseInfo)) { @@ -394,7 +400,7 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ // 系统题目库ID集合 Set resourcesQuestionIds = resourcesQuestionList.stream().map(ResourcesQuestion::getResourcesQuestionId).collect(toSet()); // 拷贝系统题目库到教师开课 - copyFromQuestion(resourcesQuestionIds, teacherOpenCourseId, courseInfoIdPair); + copyFromSystemQuestion(resourcesQuestionIds, teacherOpenCourseId, courseInfoIdPair); } } @@ -405,8 +411,8 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ * @param allCourseInfoIdsJoin 指定的所有课程章节ID * @param courseInfoIdPair 拷贝过来的ID段,旧ID和新ID的一个映射关系(非必填) */ - public void copyFromQuestionByCourseChapterInfoIds(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, - String allCourseInfoIdsJoin, @NotNull Map courseInfoIdPair) { + public void copySystemQuestionToOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + String allCourseInfoIdsJoin, @NotNull Map courseInfoIdPair) { // 待拷贝的系统课程ID不能为空.才会执行 if (ObjectUtil.isNotEmpty(allCourseInfoIdsJoin)) { @@ -418,7 +424,7 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ // 系统题目库ID集合 Set resourcesQuestionIds = resourcesQuestionList.stream().map(ResourcesQuestion::getResourcesQuestionId).collect(toSet()); // 拷贝系统题目库到教师开课 - copyFromQuestion(resourcesQuestionIds, teacherOpenCourseId, courseInfoIdPair); + copyFromSystemQuestion(resourcesQuestionIds, teacherOpenCourseId, courseInfoIdPair); } } @@ -428,17 +434,17 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ * 教师端-导入题目操作,逻辑拆分 * 从系统题目库拉取题目到教师开课的题目中。 * - * @param resourcesQuestionIds + * @param systemResourcesQuestionIds * @param teacherOpenCourseId * @param courseInfoIdPair * @return */ - public void copyFromQuestion(Set resourcesQuestionIds, - @NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, Map courseInfoIdPair) { + public void copyFromSystemQuestion(Set systemResourcesQuestionIds, + @NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, Map courseInfoIdPair) { - if (ObjectUtil.isEmpty(resourcesQuestionIds)) { return; } + if (ObjectUtil.isEmpty(systemResourcesQuestionIds)) { return; } // 题目ID集合 - String ids = join(resourcesQuestionIds.toArray(), ","); + String ids = join(systemResourcesQuestionIds.toArray(), ","); ResourcesQuestionQuery resourcesQuestionQuery = new ResourcesQuestionQuery(); resourcesQuestionQuery.setResourcesQuestionIds(ids); // 已上架的 @@ -519,4 +525,70 @@ public class TeacherOpenCourseMergeResourcesQuestionService extends CoreBaseServ dictParser(g); return g; } + + /** + * 通过无类别区分的题目列表,对题目进行分组。并构建需要的数据 + * 只适用于手动出题这块。 + * + * @param resourcesQuestionList + * @return + */ + public Map buildSettingDtoListByNoDiffQuestionList( + List resourcesQuestionList) { + return buildSettingDtoListByNoDiffQuestionList(resourcesQuestionList, TeacherOpenCourseMergeResourcesQuestion::getTeacherOpenCourseMergeResourcesQuestionId); + } + + /** + * 通过无类别区分的题目列表,对题目进行分组。并构建需要的数据 + * 只适用于手动出题这块。 + * + * @param resourcesQuestionList + * @return + */ + public Map buildSettingDtoListByNoDiffQuestionList( + List resourcesQuestionList, Function function) { + + if (ObjectUtil.isEmpty(resourcesQuestionList)) { + return null; + } + + // 先构建初始的属性 + Function buildFunc = + item -> TeacherOpenCourseQuestionSettingDTO.builder() + .questionType(EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, item.getQuestionType())) + .resourcesQuestionIdPlural(function.apply(item).toString()) + .singleScore(item.getQuestionScore()) + .build(); + + // 根据类型分组 + Map> groupMap = + resourcesQuestionList.stream().map(buildFunc).collect(groupingBy(TeacherOpenCourseQuestionSettingDTO::getQuestionType)); + + Map result = new ConcurrentHashMap<>(5); + + // 分组后的数据,再处理 + groupMap.forEach((key, value) -> { + + // resourcesQuestionIdPlural 上面暂存的是单个题目ID,这里将所有的题目ID处理成逗号隔开的字符 + String questionIds = value.stream() + .map(TeacherOpenCourseQuestionSettingDTO::getResourcesQuestionIdPlural).collect(joining(",")); + + // 查询到的题目的数量 + Integer selectCount = ObjectUtil.defaultIfNull(value, Lists.emptyList()).size(); + + // 设置其他属性,如果集合长度不为空的话 + if (selectCount > 0) { + TeacherOpenCourseQuestionSettingDTO teacherOpenCourseQuestionSettingDTO = value.get(0); + // 该类型下,单个题目的分数 + BigDecimal singleScore = teacherOpenCourseQuestionSettingDTO.getSingleScore(); + teacherOpenCourseQuestionSettingDTO.setResourcesQuestionIdPlural(questionIds) + .setSingleTypeTotalScore(NumberUtil.mul(singleScore, selectCount)) + .setSelectCount(selectCount); + + // 放入结果集中 + result.put(key, teacherOpenCourseQuestionSettingDTO); + } + }); + return result; + } } diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionSettingService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionSettingService.java index 118d0253..43468548 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionSettingService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseQuestionSettingService.java @@ -1,8 +1,7 @@ package com.ibeetl.jlw.service; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.func.Func1; -import cn.hutool.core.util.EnumUtil; -import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.jlw.util.ToolUtils; import cn.jlw.validate.ValidateConfig; @@ -13,18 +12,15 @@ import com.ibeetl.admin.core.util.PlatformException; import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.jlw.dao.TeacherOpenCourseQuestionSettingDao; -import com.ibeetl.jlw.entity.CourseInfo; -import com.ibeetl.jlw.entity.ResourcesQuestion; -import com.ibeetl.jlw.entity.TeacherOpenCourseMergeCourseInfo; -import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionSetting; +import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionSettingDTO; +import com.ibeetl.jlw.enums.CopyFromEnum; import com.ibeetl.jlw.enums.ResourcesQuestionTypeEnum; -import com.ibeetl.jlw.web.query.ResourcesQuestionQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeCourseInfoQuery; +import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeResourcesQuestionQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionSettingQuery; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.assertj.core.util.Lists; import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; import org.springframework.beans.factory.annotation.Autowired; @@ -35,14 +31,10 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Nullable; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -import java.math.BigDecimal; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; import java.util.stream.Collectors; import static cn.hutool.core.text.CharSequenceUtil.join; -import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.joining; /** @@ -61,6 +53,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseServicequeryByCondition(PageQuery query){ PageQuery ret = teacherOpenCourseQuestionSettingDao.queryByCondition(query); @@ -214,14 +208,44 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService questionSettingOptions, CopyFromEnum copyFrom, Map courseInfoIdPair) { + + Long teacherOpenCourseId = teacherOpenCourseMergeCourseInfoQuery.getTeacherOpenCourseId(); + TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery(); + + // 设置章节练习的默认配置,并设置开课ID + settingQuery.setCourseTestDefault().setTeacherOpenCourseId(teacherOpenCourseId); + settingQuery.setTeacherOpenCourseQuestionSettingName(teacherOpenCourseMergeCourseInfoQuery.getCourseInfoName()); + settingQuery.setQuestionSettingOptions(new ArrayList<>(questionSettingOptions)); + + switch (copyFrom) { + case FROM_OPEN_COURSE: + addSettingByOpenCourse(settingQuery, courseInfoIdPair); + case FROM_SYSTEM: + addSettingBySystemCourse(settingQuery, courseInfoIdPair); + break; + } + } + + /** + * 增加题目类型的数据 从开课端拉取 * * 任务一;添加题目配置主表 * 任务二:添加题目快照表 * @param settingQuery * @return */ - public void addByMergeQuestion(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseQuestionSettingQuery settingQuery, Map courseInfoIdPair ) { + public void addSettingByOpenCourse(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseQuestionSettingQuery settingQuery, Map courseInfoIdPair ) { if (null == settingQuery.getTeacherOpenCourseQuestionSettingStatus()) { settingQuery.setTeacherOpenCourseQuestionSettingStatus(1); @@ -233,10 +257,38 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService questionSettingOptions = settingQuery.getQuestionSettingOptions(); - resourcesQuestionSnapshotService.insertBatchByMergeResourcesQuestion(teacherOpenCourseQuestionSettingId, questionSettingOptions, courseInfoIdPair); + // 传入的开课题目IDS + String resourcesQuestionIdPlural = settingQuery.getResourcesQuestionIdPlural(); + // 题目类型区分 + Collection settingDTOList = null; + + if(ObjectUtil.isNotEmpty(resourcesQuestionIdPlural)) { + TeacherOpenCourseMergeResourcesQuestionQuery questionQuery = new TeacherOpenCourseMergeResourcesQuestionQuery(); + questionQuery.setQuestionStatus(1); + questionQuery.setTeacherOpenCourseMergeResourcesQuestionIdPlural(resourcesQuestionIdPlural); + List list = + teacherOpenCourseMergeResourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery); + + // 无差别题目IDS转换成类型区分的集合 + Map map = + teacherOpenCourseMergeResourcesQuestionService.buildSettingDtoListByNoDiffQuestionList(list); + + // 设置分值 + settingQuery.getQuestionSettingOptions().forEach(item -> { + TeacherOpenCourseQuestionSettingDTO settingDTO = map.get(item.getQuestionType()); + if(ObjectUtil.isAllNotEmpty(settingDTO, item.getSingleScore())) { + settingDTO.setSingleScore(item.getSingleScore()); + } + }); + + if (ObjectUtil.isNotEmpty(map)) { settingDTOList = map.values(); } + } else { + settingDTOList = settingQuery.getQuestionSettingOptions(); + } + + resourcesQuestionSnapshotService.insertBatchByOpenResourcesQuestion(teacherOpenCourseQuestionSettingId, settingDTOList, courseInfoIdPair); } @@ -250,7 +302,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService courseInfoIdPair ) { + public void addSettingBySystemCourse(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseQuestionSettingQuery settingQuery, Map courseInfoIdPair ) { if (null == settingQuery.getTeacherOpenCourseQuestionSettingStatus()) { settingQuery.setTeacherOpenCourseQuestionSettingStatus(1); @@ -269,81 +321,6 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService buildSettingDtoListByNoDiffQuestionIds( - @NotEmpty(message = "系统题目ID不能为空!") String noDiffResourcesQuestionIdPlural) { - - // 只查询正常状态的题目列表 - ResourcesQuestionQuery resourcesQuestionQuery = new ResourcesQuestionQuery(); - resourcesQuestionQuery.setQuestionStatus(1); - resourcesQuestionQuery.setResourcesQuestionIds(noDiffResourcesQuestionIdPlural); - List valuesByQuery = resourcesQuestionService.getValuesByQuery(resourcesQuestionQuery); - - return buildSettingDtoListByNoDiffQuestionList(valuesByQuery); - } - - - /** - * 处理章节节点,下面所有的题目 - * 并保存到题目配置和题目快照表 - * 从系统题库表拷贝!!! - * - * @param teacherOpenCourseId 开课ID - * @param courseInfos 当前课程下的子节点 - * @param courseInfoIdPair 课程的新旧ID片段集合 - */ - public void processGroupChapterListToQuestionSetting(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, - Collection courseInfos, Map courseInfoIdPair) { - - // 章节对应下面的所有子集 - Map> courseChapterInfoIdsWithChildren = courseInfoService.getCourseChapterInfoIdsWithChildren(courseInfos); - - courseChapterInfoIdsWithChildren.forEach((courseInfo, chapterInfoList) -> { - // 该列表下的所有ID合并 - String allCourseInfoIds = chapterInfoList.stream().map(item -> item.getCourseInfoId().toString()).collect(joining(",")); - List questionList = resourcesQuestionService.getByCourseInfoIds(allCourseInfoIds); - - // 有题目才继续执行 - if(ObjectUtil.isNotEmpty(questionList)) { - Map map = buildSettingDtoListByNoDiffQuestionList(questionList); - Map> courseInfoIdWithQuestionSettingOptions = new HashMap<>(1); - courseInfoIdWithQuestionSettingOptions.put(courseInfo, map.values()); - addTeacherOpenCourseQuestionBySystemCourseInfo(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, courseInfoIdPair); - } - }); - } - - /** - * 根据开课的课程信息,添加题目配置和题目 - * 这里不区分节点是什么类型的。 - * 严格要求: - * - * 添加主表 - * 任务一:添加主表 - * 任务二:添加到题目配置主表; - * 任务二:也可以添加题目快照(非必选) - */ - public void addTeacherOpenCourseQuestionByCourseInfo(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseMergeCourseInfoQuery teacherOpenCourseMergeCourseInfoQuery, - @Nullable Collection questionSettingOptions, Map courseInfoIdPair) { - - Long teacherOpenCourseId = teacherOpenCourseMergeCourseInfoQuery.getTeacherOpenCourseId(); - TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery(); - - // 设置章节练习的默认配置,并设置开课ID - settingQuery.setCourseTestDefault().setTeacherOpenCourseId(teacherOpenCourseId); - settingQuery.setTeacherOpenCourseQuestionSettingName(teacherOpenCourseMergeCourseInfoQuery.getCourseInfoName()); - settingQuery.setQuestionSettingOptions(new ArrayList<>(questionSettingOptions)); - addQuestionByTypeFromSystem(settingQuery, courseInfoIdPair); - } - - /** * 根据开课的课程信息,添加题目配置和题目 * @@ -354,10 +331,10 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService> courseInfoIdWithQuestionSettingOptions, - @NotNull Map courseInfoIdPair) { - addTeacherOpenCourseQuestionByCourseInfo(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, Integer.valueOf(2), TeacherOpenCourseMergeCourseInfo::getCourseInfoType, courseInfoIdPair); + public void addSettingByOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + @Nullable Map> courseInfoIdWithQuestionSettingOptions, + @NotNull Map courseInfoIdPair) { + addSettingByOpenCourse(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, Integer.valueOf(2), TeacherOpenCourseMergeCourseInfo::getCourseInfoType, courseInfoIdPair); } @@ -375,9 +352,9 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService> courseInfoIdWithQuestionSettingOptions, - @NotNull Object eq, @NotNull Func1 func1, @NotNull Map courseInfoIdPair) { + public void addSettingByOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + @Nullable Map> courseInfoIdWithQuestionSettingOptions, + @NotNull Object eq, @NotNull Func1 func1, @NotNull Map courseInfoIdPair) { TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery(); // 设置章节练习的默认配置,并设置开课ID settingQuery.setCourseTestDefault().setTeacherOpenCourseId(teacherOpenCourseId); @@ -388,7 +365,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService(settingDtoList)); settingQuery.setTeacherOpenCourseQuestionSettingName(courseInfo.getCourseInfoName()); - addByMergeQuestion(settingQuery, courseInfoIdPair); + addSettingByOpenCourse(settingQuery, courseInfoIdPair); } } catch (Exception e) { } }); @@ -405,10 +382,10 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService> courseInfoIdWithQuestionSettingOptions, - @NotNull Map courseInfoIdPair) { - addTeacherOpenCourseQuestionBySystemCourseInfo(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, Integer.valueOf(2), CourseInfo::getCourseInfoType, courseInfoIdPair); + public void addSettingBySystemCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + @Nullable Map> courseInfoIdWithQuestionSettingOptions, + @NotNull Map courseInfoIdPair) { + addSettingBySystemCourse(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, Integer.valueOf(2), CourseInfo::getCourseInfoType, courseInfoIdPair); } /** @@ -425,9 +402,9 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService> courseInfoIdWithQuestionSettingOptions, - @NotNull Object eq, @NotNull Func1 func1, @NotNull Map courseInfoIdPair) { + public void addSettingBySystemCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, + @Nullable Map> courseInfoIdWithQuestionSettingOptions, + @NotNull Object eq, @NotNull Func1 func1, @NotNull Map courseInfoIdPair) { TeacherOpenCourseQuestionSettingQuery settingQuery = new TeacherOpenCourseQuestionSettingQuery(); // 设置章节练习的默认配置,并设置开课ID settingQuery.setCourseTestDefault().setTeacherOpenCourseId(teacherOpenCourseId); @@ -438,67 +415,12 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService(settingDtoList)); settingQuery.setTeacherOpenCourseQuestionSettingName(courseInfo.getCourseInfoName()); - addQuestionByTypeFromSystem(settingQuery, courseInfoIdPair); + addSettingBySystemCourse(settingQuery, courseInfoIdPair); } } catch (Exception e) { } }); } - - /** - * 通过无类别区分的题目列表,对题目进行分组。并构建需要的数据 - * 只适用于手动出题这块。 - * - * @param resourcesQuestionList - * @return - */ - public Map buildSettingDtoListByNoDiffQuestionList( - List resourcesQuestionList) { - - if (ObjectUtil.isEmpty(resourcesQuestionList)) { - return null; - } - - // 先构建初始的属性 - Function buildFunc = - item -> TeacherOpenCourseQuestionSettingDTO.builder() - .questionType(EnumUtil.likeValueOf(ResourcesQuestionTypeEnum.class, item.getQuestionType())) - .resourcesQuestionIdPlural(item.getResourcesQuestionId().toString()) - .singleScore(item.getQuestionScore()) - .build(); - - // 根据类型分组 - Map> groupMap = - resourcesQuestionList.stream().map(buildFunc).collect(groupingBy(TeacherOpenCourseQuestionSettingDTO::getQuestionType)); - - Map result = new ConcurrentHashMap<>(5); - - // 分组后的数据,再处理 - groupMap.forEach((key, value) -> { - - // resourcesQuestionIdPlural 上面暂存的是单个题目ID,这里将所有的题目ID处理成逗号隔开的字符 - String questionIds = value.stream() - .map(TeacherOpenCourseQuestionSettingDTO::getResourcesQuestionIdPlural).collect(joining(",")); - - // 查询到的题目的数量 - Integer selectCount = ObjectUtil.defaultIfNull(value, Lists.emptyList()).size(); - - // 设置其他属性,如果集合长度不为空的话 - if (selectCount > 0) { - TeacherOpenCourseQuestionSettingDTO teacherOpenCourseQuestionSettingDTO = value.get(0); - // 该类型下,单个题目的分数 - BigDecimal singleScore = teacherOpenCourseQuestionSettingDTO.getSingleScore(); - teacherOpenCourseQuestionSettingDTO.setResourcesQuestionIdPlural(questionIds) - .setSingleTypeTotalScore(NumberUtil.mul(singleScore, selectCount)) - .setSelectCount(selectCount); - - // 放入结果集中 - result.put(key, teacherOpenCourseQuestionSettingDTO); - } - }); - return result; - } - @Override public void resetOperationByTeacherOpenCourseId(Long teacherOpenCourseId) { log.info("重置开课题目配置"); @@ -550,4 +472,89 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService courseInfos, Map courseInfoIdPair) { + + // 章节对应下面的所有子集 + Map> courseChapterInfoIdsWithChildren = courseInfoService.getCourseChapterInfoIdsWithChildren(courseInfos); + + courseChapterInfoIdsWithChildren.forEach((courseInfo, chapterInfoList) -> { + // 该列表下的所有ID合并 + String allCourseInfoIds = chapterInfoList.stream().map(item -> item.getCourseInfoId().toString()).collect(joining(",")); + List questionList = resourcesQuestionService.getByCourseInfoIds(allCourseInfoIds); + + // 有题目才继续执行 + if(ObjectUtil.isNotEmpty(questionList)) { + Map map = resourcesQuestionService.buildSettingDtoListByNoDiffQuestionList(questionList); + Map> courseInfoIdWithQuestionSettingOptions = new HashMap<>(1); + courseInfoIdWithQuestionSettingOptions.put(courseInfo, map.values()); + addSettingBySystemCourse(teacherOpenCourseId, courseInfoIdWithQuestionSettingOptions, courseInfoIdPair); + } + }); + } + + /** + * 复制开课题库中的章节节点题目,到章节练习中 + * + * @param teacherOpenCourseId + * @param courseInfoIdPair + */ + public void copyOpenQuestionChapterTestQuestionToOpenCourse(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId, Map courseInfoIdPair) { + TeacherOpenCourseMergeCourseInfoQuery query = new TeacherOpenCourseMergeCourseInfoQuery(); + query.setTeacherOpenCourseId(teacherOpenCourseId); + query.setCourseInfoStatus(1); + + // 获取这个开课下的所有的课程章节信息 + List list = + teacherOpenCourseMergeCourseInfoService.getValuesByQueryNotWithPermission(query); + + if (ObjectUtil.isEmpty(list)) { + return; + } + + // 章节点 + Set chapterSet = list.stream() + .filter(item -> Integer.valueOf(2).equals(item.getCourseInfoType())).collect(Collectors.toSet()); + + // 章下面所有小节,包含章节点 + Set result = new HashSet<>(12); + for (TeacherOpenCourseMergeCourseInfo chapter : chapterSet) { + result.clear(); + Long teacherOpenCourseMergeCourseInfoId = chapter.getTeacherOpenCourseMergeCourseInfoId(); + teacherOpenCourseMergeCourseInfoService.getCourseResourcesByList(list, teacherOpenCourseMergeCourseInfoId, result); + result.add(chapter); + // 单个章节下的所有小节的ID。包含章节 + String ids = result.stream().map(item -> item.getTeacherOpenCourseMergeCourseInfoId().toString()).collect(joining(",")); + TeacherOpenCourseMergeResourcesQuestionQuery questionQuery = new TeacherOpenCourseMergeResourcesQuestionQuery(); + questionQuery.setTeacherOpenCourseMergeCourseInfoIdPlural(ids); + // 获取章下面的所有题目 + List resourcesQuestionList = + teacherOpenCourseMergeResourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery); + + TeacherOpenCourseQuestionSettingQuery questionSettingQuery = new TeacherOpenCourseQuestionSettingQuery(); + questionSettingQuery.setCourseTestDefault() + .setTeacherOpenCourseQuestionSettingName(chapter.getCourseInfoName()) + .setTeacherOpenCourseId(teacherOpenCourseId); + // 添加到章节练习题目配置主表 + add(questionSettingQuery); + + // 如果有关联的题目,则添加到题目快照表 + if(ObjectUtil.isNotEmpty(resourcesQuestionList)) { + // 构造章节练习的题目快照 + List resourcesQuestionSnapshots = BeanUtil.copyToList(resourcesQuestionList, ResourcesQuestionSnapshot.class); + resourcesQuestionSnapshots.forEach(item -> item.setTeacherOpenCourseQuestionSettingId(questionSettingQuery.getTeacherOpenCourseQuestionSettingId())); + // 批量添加题目快照 + resourcesQuestionSnapshotService.insertBatch(resourcesQuestionSnapshots); + } + } + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseMergeResourcesQuestionController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseMergeResourcesQuestionController.java index a85d24f8..5404e51f 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseMergeResourcesQuestionController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseMergeResourcesQuestionController.java @@ -429,7 +429,7 @@ public class TeacherOpenCourseMergeResourcesQuestionController{ */ @PostMapping(API + "/copyFromQuestion.do") public JsonResult copyFromQuestion(Long[] resourcesQuestionIds, Long teacherOpenCourseId) { - teacherOpenCourseMergeResourcesQuestionService.copyFromQuestion(CollectionUtil.newHashSet(resourcesQuestionIds), teacherOpenCourseId, null); + teacherOpenCourseMergeResourcesQuestionService.copyFromSystemQuestion(CollectionUtil.newHashSet(resourcesQuestionIds), teacherOpenCourseId, null); return JsonResult.success(); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionSettingController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionSettingController.java index 4febbe0a..3f98afc0 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionSettingController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionSettingController.java @@ -91,7 +91,7 @@ public class TeacherOpenCourseQuestionSettingController{ Assert.notNull(coreUser, "请登录后再操作"); teacherOpenCourseQuestionSettingQuery.setUserId(coreUser.getId()); teacherOpenCourseQuestionSettingQuery.setOrgId(coreUser.getOrgId()); - teacherOpenCourseQuestionSettingService.addByMergeQuestion(teacherOpenCourseQuestionSettingQuery, new HashMap<>(1)); + teacherOpenCourseQuestionSettingService.addSettingByOpenCourse(teacherOpenCourseQuestionSettingQuery, new HashMap<>(1)); return JsonResult.success(); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/ResourcesQuestionSnapshotQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/ResourcesQuestionSnapshotQuery.java index f99852f5..a7d11280 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/ResourcesQuestionSnapshotQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/ResourcesQuestionSnapshotQuery.java @@ -23,6 +23,8 @@ public class ResourcesQuestionSnapshotQuery extends PageParam { private Long teacherOpenCourseQuestionSettingId; @Query(name = "开课课程ID", display = false) private Long teacherOpenCourseMergeCourseInfoId; + @Query(name = "开课题目ID", display = false) + private Long teacherOpenCourseMergeResourcesQuestionId; @Query(name = "题型(1单选 2多选 3判断)", display = false) private Integer questionType; @Query(name = "分值", display = false) @@ -53,6 +55,7 @@ public class ResourcesQuestionSnapshotQuery extends PageParam { private String resourcesQuestionSnapshotIdPlural; private String teacherOpenCourseQuestionSettingIdPlural; private String teacherOpenCourseMergeCourseInfoIdPlural; + private String teacherOpenCourseMergeResourcesQuestionIdPlural; private String questionTypePlural; private String questionStatusPlural; private String userIdPlural; @@ -70,6 +73,7 @@ public class ResourcesQuestionSnapshotQuery extends PageParam { pojo.setResourcesQuestionSnapshotId(this.getResourcesQuestionSnapshotId()); pojo.setTeacherOpenCourseQuestionSettingId(this.getTeacherOpenCourseQuestionSettingId()); pojo.setTeacherOpenCourseMergeCourseInfoId(this.getTeacherOpenCourseMergeCourseInfoId()); + pojo.setTeacherOpenCourseMergeResourcesQuestionId(this.getTeacherOpenCourseMergeResourcesQuestionId()); pojo.setQuestionType(this.getQuestionType()); pojo.setQuestionScore(this.getQuestionScore()); pojo.setQuestionStem(this.getQuestionStem()); diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionSettingQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionSettingQuery.java index 468e3faa..1c56263c 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionSettingQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseQuestionSettingQuery.java @@ -10,6 +10,7 @@ import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionSettingDTO; import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; import javax.validation.constraints.NotNull; import java.util.Date; @@ -21,6 +22,7 @@ import static cn.hutool.core.date.DateUtil.offset; *题目配置查询 */ @Data +@Accessors(chain = true) @EqualsAndHashCode(callSuper=false) public class TeacherOpenCourseQuestionSettingQuery extends PageParam { @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) @@ -80,7 +82,7 @@ public class TeacherOpenCourseQuestionSettingQuery extends PageParam { * 对应{@link TeacherOpenCourseMergeResourcesQuestion#getTeacherOpenCourseMergeCourseInfoId()} 集合 * */ -// private String resourcesQuestionIdPlural; + private String resourcesQuestionIdPlural; private String teacherOpenCourseQuestionSettingIdPlural; private String teacherOpenCourseIdPlural; diff --git a/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md b/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md index dfea990e..df4cdc2b 100644 --- a/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md +++ b/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md @@ -23,10 +23,16 @@ queryByCondition and find_in_set(t.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ - and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# + and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ - and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) + and find_in_set(t.teacher_open_course_merge_course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ + and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# + @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ + and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(questionType)){ and t.question_type =#questionType# @@ -104,11 +110,18 @@ queryByConditionQuery and find_in_set(t.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ - and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# + and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ - and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) + and find_in_set(t.teacher_open_course_merge_course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ + and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ + and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) + @} + @if(!isEmpty(questionType)){ and t.question_type =#questionType# @} @@ -203,9 +216,16 @@ updateGivenByIds @} @if(contain("teacherOpenCourseMergeCourseInfoId",_given)){ @if(isEmpty(teacherOpenCourseMergeCourseInfoId)){ - course_info_id = null , + teacher_open_course_merge_course_info_id = null , + @}else{ + teacher_open_course_merge_course_info_id = #teacherOpenCourseMergeCourseInfoId# , + @} + @} + @if(contain("teacherOpenCourseMergeResourcesQuestionId",_given)){ + @if(isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ + teacher_open_course_merge_resources_question_id = null , @}else{ - course_info_id = #teacherOpenCourseMergeCourseInfoId# , + teacher_open_course_merge_resources_question_id = #teacherOpenCourseMergeResourcesQuestionId# , @} @} @if(contain("questionType",_given)){ @@ -319,7 +339,10 @@ getResourcesQuestionSnapshotValues and t.teacher_open_course_question_setting_id =#teacherOpenCourseQuestionSettingId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ - and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# + and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# + @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ + and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(questionType)){ and t.question_type =#questionType# @@ -383,11 +406,18 @@ getValuesByQuery and find_in_set(t.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ - and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# + and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ - and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) + and find_in_set(t.teacher_open_course_merge_course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ + and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# + @} + @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ + and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) + @} + @if(!isEmpty(questionType)){ and t.question_type =#questionType# @} @@ -479,5 +509,5 @@ questionTestResults AND CONCAT( td.student_sn, td.student_name ) LIKE #'%' + studentSnOrStudentName + '%'# @} @if(!isEmpty(chapterId)) { - AND t.course_info_id = #chapterId# + AND t.teacher_open_course_merge_course_info_id = #chapterId# @} \ No newline at end of file