Pārlūkot izejas kodu

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

dzx 5 mēneši atpakaļ
vecāks
revīzija
922c6fdb68

+ 13 - 6
src/main/java/com/xjrsoft/module/hikvision/util/OutInRecordUtil.java

@@ -35,8 +35,10 @@ public class OutInRecordUtil {
         SqlRunnerAdapter.db().insert(sql);
 
         String updSql = "UPDATE attendance_user_relation SET " +
-                "attendance_status = '" + attendanceStatus + "', attendance_time = '" + recordTime + "' " +
-                "WHERE user_id = '" + userId + "', attendance_mode = '人脸' AND delete_mark = 0";
+                "attendance_status = '" + attendanceStatus + "', " +
+                "attendance_time = '" + recordTime + "', " +
+                "attendance_mode = '人脸' " +
+                "WHERE user_id = '" + userId + "' AND delete_mark = 0";
         SqlRunnerAdapter.db().update(updSql);
     }
 
@@ -49,8 +51,10 @@ public class OutInRecordUtil {
         SqlRunnerAdapter.db().insert(sql);
 
         String updSql = "UPDATE attendance_user_relation SET " +
-                "attendance_status = '" + attendanceStatus + "', attendance_time = '" + recordTime + "' " +
-                "WHERE user_id = '" + userId + "', attendance_mode = '人脸' AND delete_mark = 0";
+                "attendance_status = '" + attendanceStatus + "', " +
+                "attendance_time = '" + recordTime + "', " +
+                "attendance_mode = '人脸' " +
+                "WHERE user_id = '" + userId + "' AND delete_mark = 0";
         SqlRunnerAdapter.db().update(updSql);
     }
 
@@ -102,8 +106,11 @@ public class OutInRecordUtil {
             String attendanceStatus = discernTeacherStatus(recordTimeDate, status, userId);
 
             String updSql = "UPDATE attendance_user_relation SET " +
-                    "attendance_status = '" + attendanceStatus + "', attendance_time = '" + recordTime + "' " +
-                    "WHERE user_id = '" + userId + "' AND attendance_mode = '车辆' AND car_number = '" + planNo + "' AND delete_mark = 0";
+                    "attendance_status = '" + attendanceStatus + "', " +
+                    "attendance_time = '" + recordTime + "', " +
+                    "attendance_mode = '车辆', " +
+                    "car_number = '" + planNo + "' " +
+                    "WHERE user_id = '" + userId + "' AND delete_mark = 0";
             SqlRunnerAdapter.db().update(updSql);
         }
     }

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

@@ -399,12 +399,12 @@ public class TextbookController {
         return RT.fileStream(bot.toByteArray(), "TextbookSubscription" + ExcelTypeEnum.XLSX.getValue());
     }
 
-//    @PostMapping("/textbook-claim-export-query")
-//    @ApiOperation(value = "教材发放记录条件导出")
-//    public ResponseEntity<byte[]> textbookClaimExportQuery(@Valid @RequestBody TextbookClaimExportQueryDto dto) {
-    @GetMapping("/textbook-claim-export-query")
+    @PostMapping("/textbook-claim-export-query")
     @ApiOperation(value = "教材发放记录条件导出")
-    public ResponseEntity<byte[]> textbookClaimExportQuery(@Valid TextbookClaimExportQueryDto dto) {
+    public ResponseEntity<byte[]> textbookClaimExportQuery(@Valid @RequestBody TextbookClaimExportQueryDto dto) {
+//    @GetMapping("/textbook-claim-export-query")
+//    @ApiOperation(value = "教材发放记录条件导出")
+//    public ResponseEntity<byte[]> textbookClaimExportQuery(@Valid TextbookClaimExportQueryDto dto) {
         ByteArrayOutputStream bot = textbookService.listTextbookClaimExportQuery(dto);
         return RT.fileStream(bot.toByteArray(), "TextbookClaim" + ExcelTypeEnum.XLSX.getValue());
     }

+ 25 - 62
src/main/java/com/xjrsoft/module/textbook/dto/TextbookImportDto.java

@@ -13,7 +13,7 @@ public class TextbookImportDto {
      * 国际标准刊号
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("国际标准刊号")
+    @ExcelProperty("书号(ISSN)")
     @ApiModelProperty("国际标准刊号")
     private String issn;
     /**
@@ -34,100 +34,63 @@ public class TextbookImportDto {
      * 主编
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("主编")
+    @ExcelProperty("作者(主编")
     @ApiModelProperty("主编")
     private String editorInChief;
     /**
-     * 学科组名称
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("学科组名称")
-    @ApiModelProperty("学科组名称")
-    private String groupName;
-    /**
-     * 使用年级
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用年级")
-    @ApiModelProperty("使用年级")
-    private String useGrade;
-    /**
-     * 使用年级
+     * 版本
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用学期")
-    @ApiModelProperty("使用学期")
-    private String useSemester;
-
-    /**
-     * 使用班级
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用班级")
-    @ApiModelProperty("使用班级")
-    private String useClass;
-    /**
-     * 课程
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("对应课程")
-    @ApiModelProperty("对应课程")
-    private String courseName;
+    @ExcelProperty("版次")
+    @ApiModelProperty("版本")
+    private String version;
     /**
      * 是否为规划教材
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("是否为规划教材")
+    @ExcelProperty("规划教材(是或否)")
     @ApiModelProperty("是否为规划教材")
     private String isTextbookPlanCn;
-
     /**
-     * 教材类型(xjr_dictionary_item[textbook_type])
+     * 使用类型(单位:学期)
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材类型")
-    @ApiModelProperty("教材类型-中文")
-    private String textbookTypeCn;
+    @ExcelProperty("使用类型(一学期~六学期)")
+    @ApiModelProperty("使用类型(单位:学期)")
+    private Integer useType;
     /**
-     * 规格型号
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("规格型号")
-    @ApiModelProperty("规格型号")
-    private String specificationsModels;
-    /**
-     * 估价(元)
+     * 教材类型(xjr_dictionary_item[textbook_type])
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("估价(元)")
-    @ApiModelProperty("估价(元)")
-    private BigDecimal appraisalPrice;
+    @ExcelProperty("类型(教材、教辅、作业本)")
+    @ApiModelProperty("教材类型-中文")
+    private String textbookTypeCn;
     /**
      * 定价(元)
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("定价(元)")
+    @ExcelProperty("定价(元)")
     @ApiModelProperty("定价(元)")
     private BigDecimal price;
     /**
      * 折扣
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("折扣")
+    @ExcelProperty("折扣(折)")
     @ApiModelProperty("折扣")
     private Double discount;
     /**
-     * 小计(元)
+     * 学科组名称
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("小计(元)")
-    @ApiModelProperty("小计(元)")
-    private BigDecimal subtotal;
+    @ExcelProperty("学科组(必须是系统中已有的学科组名称)")
+    @ApiModelProperty("学科组名称")
+    private String groupName;
     /**
-     * 库存
+     * 课程
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("库存")
-    @ApiModelProperty("库存")
-    private Integer stock;
+    @ExcelProperty("对应课程(必须是系统中已有的课程名称)")
+    @ApiModelProperty("对应课程")
+    private String courseName;
 }

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

@@ -852,22 +852,10 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
         List<SubjectGroup> subjectGroupList = subjectGroupMapper.selectList(new LambdaQueryWrapper<>());
         Map<String, Long> subjectGroupNameAndIdMap = subjectGroupList.stream().collect(Collectors.toMap(SubjectGroup::getGroupName, SubjectGroup::getId, (k1, k2) -> k1));
 
-        //使用年级
-        List<BaseGrade> baseGradeList = baseGradeMapper.selectList(new LambdaQueryWrapper<>());
-        Map<String, Long> baseGradeNameAndIdMap = baseGradeList.stream().collect(Collectors.toMap(BaseGrade::getName, BaseGrade::getId, (k1, k2) -> k1));
-
-        //使用班级
-        List<BaseClass> baseClassList = baseClassService.list();
-        Map<String, Long> baseClassNameAndIdMap = baseClassList.stream().collect(Collectors.toMap(BaseClass::getName, BaseClass::getId, (k1, k2) -> k1));
-
         //使用课程
         List<BaseCourseSubject> baseCourseSubjectList = baseCourseSubjectMapper.selectList(new LambdaQueryWrapper<>());
         Map<String, Long> baseCourseSubjectNameAndIdMap = baseCourseSubjectList.stream().collect(Collectors.toMap(BaseCourseSubject::getName, BaseCourseSubject::getId, (k1, k2) -> k1));
 
-        //使用学期
-        List<BaseSemester> baseSemesterList = baseSemesterMapper.selectList(new LambdaQueryWrapper<>());
-        Map<String, Long> baseSemesterNameAndIdMap = baseSemesterList.stream().collect(Collectors.toMap(BaseSemester::getName, BaseSemester::getId, (k1, k2) -> k1));
-
         //批量插入或更新数据
         for (TextbookImportDto textbookImportDto : dataList) {
             TextbookCoreAttribute textbookCoreAttribute = new TextbookCoreAttribute();
@@ -890,13 +878,6 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     .orElse(null);
             textbook.setCourseSubjectId(courseSubjectId);
 
-            // 处理年级映射
-            String useGrade = textbookImportDto.getUseGrade();
-            Long gradeId = Optional.ofNullable(useGrade)
-                    .map(baseGradeNameAndIdMap::get)
-                    .orElse(null);
-            textbook.setGradeId(gradeId);
-
             // 处理是否教材计划字段
             String isTextbookPlanCn = textbookImportDto.getIsTextbookPlanCn();
             String isTextbookPlan = Optional.ofNullable(isTextbookPlanCn)
@@ -912,69 +893,25 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                     .orElse(null);
             textbook.setTextbookType(textbookTypeCode);
 
-            // 处理学期映射
-            String useSemester = textbookImportDto.getUseSemester();
-            Long baseSemesterId = Optional.ofNullable(useSemester)
-                    .map(baseSemesterNameAndIdMap::get)
-                    .orElse(null);
-            textbook.setBaseSemesterId(baseSemesterId);
-
-            // 处理班级映射
-            List<Long> classIdList = Optional.ofNullable(textbookImportDto.getUseClass())
-                    .map(classNames -> Arrays.stream(classNames.split(","))
-                            .map(String::trim)
-                            .map(baseClassNameAndIdMap::get)
-                            .filter(Objects::nonNull)
-                            .collect(Collectors.toList()))
-                    .orElse(Collections.emptyList());
-
-
             // 判断导入的教材是否已经存在,根据教材的 ISBN 码和使用的学期判断
             LambdaQueryWrapper<Textbook> textbookLambdaQueryWrapper = new LambdaQueryWrapper<>();
             textbookLambdaQueryWrapper
                     .eq(Textbook::getIssn, textbook.getIssn())
-                    .eq(Textbook::getBaseSemesterId, textbook.getBaseSemesterId())
             ;
 
             Textbook oldTextbook = this.getOne(textbookLambdaQueryWrapper);
 
-
-
             // 已经存在,更新数据
             if (oldTextbook != null) {
                 // 更新教材数据
+                textbook.setId(oldTextbook.getId());
                 textbookTextbookMapper.updateById(textbook);
-
-                // 先删除使用班级的信息,再新增
-                LambdaQueryWrapper<TextbookClassRelation> textbookClassRelationLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                textbookClassRelationLambdaQueryWrapper
-                        .eq(TextbookClassRelation::getTextbookId, textbook.getId());
-
-                textbookTextbookClassRelationMapper.delete(textbookClassRelationLambdaQueryWrapper);
-
-                // 批量插入班级关系
-                for (Long classId : classIdList) {
-                    textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
-                        setCreateDate(new Date());
-                        setTextbookId(textbook.getId());
-                        setClassId(classId);
-                    }});
-                }
             } else {
                 textbookCoreAttributeService.save(textbookCoreAttribute);
 
                 textbook.setTextbookCoreAttributeId(textbookCoreAttribute.getId());
                 // 插入教材数据
                 textbookTextbookMapper.insert(textbook);
-
-                //插入班级和教材关系
-                for (Long classId : classIdList) {
-                    textbookTextbookClassRelationMapper.insert(new TextbookClassRelation() {{
-                        setCreateDate(new Date());
-                        setTextbookId(textbook.getId());
-                        setClassId(classId);
-                    }});
-                }
             }
         }
     }

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

@@ -179,7 +179,7 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
 
 
         //点击完成征订
-        if (wfTextbookSubscription.getStatus() == 3 && dto.getStatus() == 4) {
+        if (wfTextbookSubscription.getStatus() == 2 && dto.getStatus() == 4) {
             WfTextbookSubscription newW = BeanUtil.toBean(dto, WfTextbookSubscription.class);
             return this.updateById(newW);
         }