Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dzx 1 year ago
parent
commit
bce0f5a2e9

+ 1 - 1
src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java

@@ -41,7 +41,7 @@ public class ConcatController {
     @ApiOperation(value="教师通讯录")
     @SaCheckPermission("room:detail")
     public RT<List<ConcatTreeVo>> list(ConcatTreeDto dto) throws Exception {
-        Long parentId = 0L;
+        Long parentId = 1684107782861680000L;
         if(dto.getDeptId() != null){
             parentId = dto.getDeptId();
         }

+ 3 - 3
src/main/java/com/xjrsoft/module/hikvision/controller/EventController.java

@@ -182,9 +182,9 @@ public class EventController {
         ApiUtil apiUtil = new ApiUtil();
         JsonArray eventList = new JsonArray();
 //*******手动更改****************************************************
-        eventList.add(196893);
-//        eventList.add(771760131); //正常过车
-//        eventList.add(771760134);
+//        eventList.add(196893);
+        eventList.add(771760130);
+        eventList.add(771760133);
 //******************************************************************
         JsonObject paramJson = new JsonObject();
         paramJson.add("eventTypes", eventList);

+ 12 - 5
src/main/java/com/xjrsoft/module/student/service/impl/PbCseFeeobjupdateServiceImpl.java

@@ -56,6 +56,7 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
 //                .selectAs(PbCseFeeobjupdate::getResourcename, PbCseFeeobjupdate::getResourcename)
                 .selectAs(PbCseFeeobjupdate::getQuartername, PbCseFeeobjupdate::getQuartername)
                 .selectAs(PbCseFeeobjupdate::getSex, PbCseFeeobjupdate::getSex)
+                .selectAs(PbCseFeeobjupdate::getGraduations, PbCseFeeobjupdate::getGraduations)
                 .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
         ;
 
@@ -111,10 +112,16 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
             }
 
             //学生类型
-            Map<String, Long> studentSource = pbCseFeeobjupdateList.stream().filter(x -> x.getResourcename() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getResourcename, Collectors.counting()));
-            List<EnrollmentStatisticsInfoKeyValue> studentSourceRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : studentSource.entrySet()) {
-                studentSourceRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+//            Map<String, Long> studentSource = pbCseFeeobjupdateList.stream().filter(x -> x.getResourcename() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getResourcename, Collectors.counting()));
+//            List<EnrollmentStatisticsInfoKeyValue> studentSourceRes = new ArrayList<>();
+//            for (Map.Entry<String, Long> entry : studentSource.entrySet()) {
+//                studentSourceRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+//            }
+
+            Map<String, Long> graduations = pbCseFeeobjupdateList.stream().filter(x -> x.getGraduations() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
+            List<EnrollmentStatisticsInfoKeyValue> graduationsRes = new ArrayList<>();
+            for (Map.Entry<String, Long> entry : graduations.entrySet()) {
+                graduationsRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
             }
 
             //住宿类型
@@ -133,7 +140,7 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
 
             result.setRegistrationPopulation(pbCseFeeobjupdateList.size());
             result.setProfessionalHeadCount(professionalHeadCountRes);
-            result.setStudentSource(studentSourceRes);
+            result.setStudentSource(graduationsRes);
             result.setAccommodationType(accommodationTypeRes);
             result.setGender(genderRes);
 

+ 1 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentStatisticsInfoVo.java

@@ -33,6 +33,7 @@ public class EnrollmentStatisticsInfoVo {
      */
     @ApiModelProperty("学生来源")
     private List<EnrollmentStatisticsInfoKeyValue> studentSource;
+
     /**
      * 住宿类型
      */

+ 1 - 0
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -93,6 +93,7 @@ public class TextbookController {
         ;
         IPage<TextbookSubscriptionListVo> page = textbookService.selectJoinListPage(ConventPage.getPage(dto),TextbookSubscriptionListVo.class,textbookMPJLambdaWrapper);
         for(TextbookSubscriptionListVo t : page.getRecords()){
+            t.setClassIds(dto.getClassIds());
             if(t.getTextbookType() != null && !t.getTextbookType().equals("")){
                 t.setTextbookTypeCn(TextbookTypeEnum.getValue(t.getTextbookType()));
             }

+ 6 - 8
src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionController.java

@@ -125,7 +125,7 @@ public class WfTextbookSubscriptionController {
         queryWrapper
                 .select(WfTextbookSubscription::getId)
                 .selectAs(BaseSemester::getName, WfTextbookSubscriptionPageVo::getBaseSemesterIdCn)
-                .select("(select sum(student_subscription_number) + sum(teacher_subscription_number) from wf_textbook_subscription_item a where a.wf_textbook_subscription_id = t.id) as sum")
+                .select("(select ifnull(sum(student_subscription_number),0) + ifnull(sum(teacher_subscription_number),0) from wf_textbook_subscription_item a where a.wf_textbook_subscription_id = t.id) as sum")
                 .select(WfTextbookSubscription.class,x -> VoToColumnUtil.fieldsToColumns(WfTextbookSubscriptionPageVo.class).contains(x.getProperty()))
                 .leftJoin(BaseSemester.class, BaseSemester::getId, WfTextbookSubscription::getBaseSemesterId)
                 .eq(dto.getBaseSemesterId() != null && dto.getBaseSemesterId() > 0, WfTextbookSubscription::getBaseSemesterId, dto.getBaseSemesterId())
@@ -238,14 +238,12 @@ public class WfTextbookSubscriptionController {
         return RT.fileStream(bot.toByteArray(), "WfTextbookSubscription" + ExcelTypeEnum.XLSX.getValue());
     }
 
-//    @PostMapping("/textbook-subscription-export-query")
-//    @ApiOperation(value = "教材征订条件导出")
-//    public ResponseEntity<byte[]> textbookSubscriptionExportQuery(@Valid @RequestBody TextbookSubscriptionExportQueryListDto dto) {
-    @GetMapping("/textbook-subscription-export-query")
+    @PostMapping("/textbook-subscription-export-query")
     @ApiOperation(value = "教材征订条件导出")
-    public ResponseEntity<byte[]> textbookSubscriptionExportQuery(@Valid TextbookSubscriptionExportQueryListDto dto) {
-
-
+    public ResponseEntity<byte[]> textbookSubscriptionExportQuery(@Valid @RequestBody TextbookSubscriptionExportQueryListDto dto) {
+//    @GetMapping("/textbook-subscription-export-query")
+//    @ApiOperation(value = "教材征订条件导出")
+//    public ResponseEntity<byte[]> textbookSubscriptionExportQuery(@Valid TextbookSubscriptionExportQueryListDto dto) {
         List<TextbookSubscriptionExportQueryListVo> customerList = wfTextbookSubscriptionService.textbookSubscriptionExportQuery(dto);
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
         EasyExcel.write(bot, TextbookSubscriptionExportQueryListVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);

+ 6 - 0
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -87,10 +87,16 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
     private final ITextbookCoreAttributeService textbookCoreAttributeService;
 
+    private final TextbookCoreAttributeMapper textbookCoreAttributeMapper;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean add(Textbook textbook) {
         textbook.setCreateDate(new Date());
+        TextbookCoreAttribute textbookCoreAttribute = new TextbookCoreAttribute();
+        BeanUtils.copyProperties(textbook, textbookCoreAttribute);
+        textbookCoreAttributeMapper.insert(textbookCoreAttribute);
+        textbook.setTextbookCoreAttributeId(textbookCoreAttribute.getId());
         textbookTextbookMapper.insert(textbook);
         for (TextbookClassRelation textbookClassRelation : textbook.getTextbookClassRelationList()) {
             textbookClassRelation.setTextbookId(textbook.getId());

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookSubscriptionServiceImpl.java

@@ -150,7 +150,7 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
             for (WfTextbookSubscriptionItem w : wfTextbookSubscriptionItemList){
                 textbookService.deliverWarehouse(new AddTextbookWarehouseRecordDto(){{
                     setTextbookId(w.getTextbookId());
-                    setWarehouseNumber((w.getStudentSubscriptionNumber() != null ? w.getStudentSubscriptionNumber() : 0) + (w.getStudentSubscriptionNumber() != null ? w.getTeacherSubscriptionNumber() : 0));
+                    setWarehouseNumber((w.getStudentSubscriptionNumber() != null ? w.getStudentSubscriptionNumber() : 0) + (w.getTeacherSubscriptionNumber() != null ? w.getTeacherSubscriptionNumber() : 0));
                     setSource("wm_manual");
                 }});
             }

+ 10 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionListVo.java

@@ -1,5 +1,7 @@
 package com.xjrsoft.module.textbook.vo;
 
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -65,4 +67,12 @@ public class TextbookSubscriptionListVo {
      */
     @ApiModelProperty("学生用书征订数量")
     private Integer studentSubscriptionNumber;
+
+    /**
+     * 使用班级
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("使用班级")
+    @ApiModelProperty("使用班级")
+    private String classIds;
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/textbook/vo/WfTextbookSubscriptionPageVo.java

@@ -77,6 +77,11 @@ public class WfTextbookSubscriptionPageVo {
      */
     @ApiModelProperty("征订方式(1:按班级征订 2:按教材征订)")
     private Integer subscriptionMethod;
+    /**
+     * 备注
+     */
+    @ApiModelProperty("备注")
+    private String remark;
 
     private Integer sum;
 }

+ 18 - 15
src/main/resources/mapper/base/BaseClassCourse.xml

@@ -5,32 +5,35 @@
 <mapper namespace="com.xjrsoft.module.base.mapper.BaseClassCourseMapper">
     <select id="getPage" parameterType="com.xjrsoft.module.base.dto.BaseClassCoursePageDto" resultType="com.xjrsoft.module.base.vo.BaseClassCoursePageVo">
         SELECT t.id AS class_id, t.name AS class_name, t1.name AS teacher_name, t3.name AS major_name, t4.name AS dept_name,
-        GROUP_CONCAT(DISTINCT t6.name SEPARATOR '、') AS course_name,
-        GROUP_CONCAT(DISTINCT t7.book_name SEPARATOR '、') AS textbook_name
+        (SELECT GROUP_CONCAT(DISTINCT t6.name SEPARATOR '、')
+            FROM base_class_course t5
+            LEFT JOIN base_course_subject t6 ON t6.id = t5.course_id
+            WHERE t5.class_id = t.id AND t5.delete_mark = 0) AS course_name,
+        (SELECT GROUP_CONCAT(DISTINCT t7.book_name SEPARATOR '、')
+            FROM base_class_course t5
+            LEFT JOIN textbook t7 ON t7.id = t5.textbook_id
+            WHERE t5.class_id = t.id AND t5.delete_mark = 0) AS textbook_name
         FROM base_class t
         LEFT JOIN xjr_user t1 ON t1.id = t.teacher_id
         LEFT JOIN base_class_major_set t2 ON t2.class_id = t.id
         LEFT JOIN base_major_set t3 ON t3.id = t2.major_set_id
         LEFT JOIN xjr_department t4 ON t4.id = t.org_id
-        LEFT JOIN base_class_course t5 ON t5.class_id = t.id
-        LEFT JOIN base_course_subject t6 ON t6.id = t5.course_id
-        LEFT JOIN textbook t7 ON t7.id = t5.textbook_id
-        WHERE t5.delete_mark = 0
+        WHERE t.delete_mark = 0
         <if test="dto.className != null">
             and t.name = #{dto.className}
         </if>
         <if test="dto.deptId != null">
             and t4.id = #{dto.deptId}
         </if>
-        <if test="dto.semester != null">
-            and (
-            SELECT base_semester_id
-            FROM textbook
-            WHERE t5.textbook_id = id
-            GROUP BY base_semester_id
-            HAVING COUNT(DISTINCT base_semester_id) = 1
-            ) = #{dto.semester}
-        </if>
+<!--  关联学期      <if test="dto.semester != null">-->
+<!--            AND EXISTS (-->
+<!--            SELECT 1-->
+<!--            FROM base_class_course bcc-->
+<!--            JOIN textbook tb ON bcc.textbook_id = tb.id-->
+<!--            WHERE bcc.class_id = t.id-->
+<!--            AND tb.base_semester_id = #{dto.semester}-->
+<!--            )-->
+<!--        </if>-->
         GROUP BY t.id, t.name, t1.name, t3.name, t4.name
         <if test="dto.courseSet == 1">
             HAVING LENGTH(course_name) > 0