Pārlūkot izejas kodu

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

phoenix 1 gadu atpakaļ
vecāks
revīzija
45ff9acbd6

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

@@ -69,6 +69,17 @@ public class TextbookController {
         return RT.ok(BeanUtil.toBean(textbook, TextbookVo.class));
     }
 
+    @GetMapping(value = "/info-byissn")
+    @ApiOperation(value="根据isnn查询教材管理信息")
+    @SaCheckPermission("textbook:detail")
+    public RT<TextbookVo> infoByissn(@RequestParam String issn){
+        TextbookVo textbook = textbookService.getInfoByissn(issn);
+        if (textbook == null) {
+            return RT.error("找不到此数据!");
+        }
+        return RT.ok(textbook);
+    }
+
     @GetMapping(value = "/info-subscription-list")
     @ApiOperation(value="查看详情信息-征订记录")
     @SaCheckPermission("textbook:detail")

+ 6 - 0
src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookDto.java

@@ -117,6 +117,12 @@ public class AddTextbookDto implements Serializable {
     @ApiModelProperty("库存")
     private Integer stock;
 
+    /**
+     * 入学年级(base_grade)
+     */
+    @ApiModelProperty("入学年级(base_grade)")
+    private Long gradeId;
+
     /**
     * textbookClassRelation
     */

+ 1 - 0
src/main/java/com/xjrsoft/module/textbook/entity/Textbook.java

@@ -179,4 +179,5 @@ public class Textbook implements Serializable {
     @EntityMapping(thisField = "id", joinField = "wfTextbookSubscriptionId")
     private List<TextbookSubscriptionRecord> textbookSubscriptionRecordList;
 
+
 }

+ 18 - 0
src/main/java/com/xjrsoft/module/textbook/mapper/TextbookMapper.java

@@ -5,7 +5,9 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.textbook.dto.TextbookPageDto;
 import com.xjrsoft.module.textbook.entity.Textbook;
 import com.xjrsoft.module.textbook.vo.TextbookPageVo;
+import com.xjrsoft.module.textbook.vo.TextbookSubscriptionClassVo;
 import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
+import com.xjrsoft.module.textbook.vo.TextbookVo;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
@@ -35,4 +37,20 @@ public interface TextbookMapper extends MPJBaseMapper<Textbook> {
      */
     List<TextbookSubscriptionRecordVo> subscriptionList(Long id);
 
+
+    /**
+     * 查询征订记录中的使用班级
+     *
+     * @param ids
+     * @return
+     */
+    List<TextbookSubscriptionClassVo> getClassInfo(List<String> ids);
+    /**
+     * 根据书号查询最新一条信息
+     * @param isnn
+     * @return
+     */
+    TextbookVo getInfoByissn(String issn);
+
+
 }

+ 10 - 1
src/main/java/com/xjrsoft/module/textbook/service/ITextbookService.java

@@ -5,7 +5,9 @@ import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.textbook.dto.TextbookPageDto;
 import com.xjrsoft.module.textbook.entity.Textbook;
 import com.xjrsoft.module.textbook.vo.TextbookPageVo;
+import com.xjrsoft.module.textbook.vo.TextbookSubscriptionClassVo;
 import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
+import com.xjrsoft.module.textbook.vo.TextbookVo;
 
 import java.util.List;
 
@@ -52,10 +54,17 @@ public interface ITextbookService extends MPJBaseService<Textbook> {
     Boolean dataHandle(Long dataId);
 
     /**
-     * 验证书号是否存在
      *
      * @param id
      * @return
      */
     List<TextbookSubscriptionRecordVo> subscriptionList(Long id);
+
+    /**
+     * 根据书号查询最新一条信息
+     * @param issn
+     * @return
+     */
+    TextbookVo getInfoByissn(String issn);
+
 }

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

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.textbook.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -16,11 +17,14 @@ import com.xjrsoft.module.textbook.mapper.TextbookSubscriptionRecordMapper;
 import com.xjrsoft.module.textbook.service.ITextbookService;
 import com.xjrsoft.module.textbook.service.IWfTextbookSubscriptionService;
 import com.xjrsoft.module.textbook.vo.TextbookPageVo;
+import com.xjrsoft.module.textbook.vo.TextbookSubscriptionClassVo;
 import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
+import com.xjrsoft.module.textbook.vo.TextbookVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
@@ -202,7 +206,34 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
     @Override
     public List<TextbookSubscriptionRecordVo> subscriptionList(Long id) {
-        return textbookTextbookMapper.subscriptionList(id);
+        List<TextbookSubscriptionRecordVo> recordVos = textbookTextbookMapper.subscriptionList(id);
+        for (TextbookSubscriptionRecordVo recordVo : recordVos) {
+            if(StrUtil.isEmpty(recordVo.getClassIds())){
+                continue;
+            }
+            String[] split = recordVo.getClassIds().split(",");
+            List<String> ids = new ArrayList<>();
+            for (String classId : split) {
+                ids.add(classId.trim());
+            }
+            List<TextbookSubscriptionClassVo> classInfo = textbookTextbookMapper.getClassInfo(ids);
+            String useClass = "";
+            for (int i = 0; i < classInfo.size(); i ++){
+                if(i >= 1){
+                    useClass += ",";
+                }
+                TextbookSubscriptionClassVo classVo = classInfo.get(i);
+                useClass += classVo.getName();
+            }
+            recordVo.setUseClass(useClass);
+        }
+        return recordVos;
     }
 
+    @Override
+    public TextbookVo getInfoByissn(String issn) {
+        return textbookTextbookMapper.getInfoByissn(issn);
+    }
+
+
 }

+ 22 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionClassVo.java

@@ -0,0 +1,22 @@
+package com.xjrsoft.module.textbook.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 教材教辅征订记录表单出参
+* @Author szs
+* @Date: 2023-12-25
+* @Version 1.0
+*/
+@Data
+public class TextbookSubscriptionClassVo {
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("班级名称")
+    private String name;
+
+
+}

+ 34 - 75
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionRecordVo.java

@@ -5,10 +5,7 @@ import com.alibaba.excel.annotation.write.style.ContentStyle;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.time.LocalTime;
-import java.time.LocalDateTime;
 import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
 
 /**
@@ -59,35 +56,7 @@ public class TextbookSubscriptionRecordVo {
     @ExcelProperty("主编")
     @ApiModelProperty("主编")
     private String editorInChief;
-    /**
-     * 学科组名称
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("学科组名称")
-    @ApiModelProperty("学科组名称")
-    private String groupName;
 
-    /**
-     * 学期名称
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("学期名称")
-    @ApiModelProperty("学期名称")
-    private String semesterName;
-    /**
-     * 课程
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("课程")
-    @ApiModelProperty("课程")
-    private String courseName;
-    /**
-     * 版本
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("版本")
-    @ApiModelProperty("版本")
-    private String version;
     /**
      * 是否为规划教材
      */
@@ -96,20 +65,6 @@ public class TextbookSubscriptionRecordVo {
     @ApiModelProperty("是否为规划教材")
     private String isTextbookPlanCn;
 
-    /**
-     * 教材类型(xjr_dictionary_item[textbook_type])
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材类型")
-    @ApiModelProperty("教材类型-中文")
-    private String textbookTypeCn;
-    /**
-     * 规格型号
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("规格型号")
-    @ApiModelProperty("规格型号")
-    private String specificationsModels;
     /**
      * 估价(元)
      */
@@ -117,51 +72,55 @@ public class TextbookSubscriptionRecordVo {
     @ExcelProperty("估价(元)")
     @ApiModelProperty("估价(元)")
     private BigDecimal appraisalPrice;
+
     /**
-     * 定价(元)
+     * 使用班级
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("定价(元)")
-    @ApiModelProperty("定价(元)")
-    private BigDecimal price;
+    @ExcelProperty("使用班级")
+    @ApiModelProperty("使用班级")
+    private String useClass;
+
     /**
-     * 折扣
+     * 课程
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("折扣")
-    @ApiModelProperty("折扣")
-    private Double discount;
+    @ExcelProperty("对应课程")
+    @ApiModelProperty("对应课程")
+    private String courseName;
+
     /**
-     * 小计(元)
+     * 学科组名称
      */
     @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 isSupportResourcesCn;
+
 
-    /**
-     * 使用年级
-     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用年级")
-    @ApiModelProperty("使用年级")
-    private String useGrade;
+    @ExcelProperty("学生用书征订数量")
+    @ApiModelProperty("学生用书征订数量")
+    private Integer studentSubscriptionNumber;
 
-    /**
-     * 使用班级
-     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用班级")
-    @ApiModelProperty("使用班级")
-    private String useClass;
+    @ExcelProperty("教师教材用书征订数量")
+    @ApiModelProperty("教师教材用书征订数量")
+    private Integer teacherSubscriptionNumber;
 
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教师教参用书征订数量")
+    @ApiModelProperty("教师教参用书征订数量")
+    private Integer teacherFeferenceNumber;
 
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级id")
+    @ApiModelProperty("班级id")
+    private String classIds;
 
 }

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

@@ -106,4 +106,9 @@ public class TextbookVo {
     @ApiModelProperty("库存")
     private Integer stock;
 
+    /**
+     * 入学年级(base_grade)
+     */
+    @ApiModelProperty("入学年级(base_grade)")
+    private Long gradeId;
 }

+ 10 - 7
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -21,25 +21,28 @@
     </select>
 
     <select id="subscriptionList" resultType="com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo">
-        SELECT t4.create_date,t4.name AS applicant_user,t2.issn,t2.book_name,t2.publishing_house,
+        SELECT t2.create_date,t4.name AS applicant_user,t2.issn,t2.book_name,t2.publishing_house,
         t2.editor_in_chief,t2.appraisal_price,t5.name AS is_textbook_plan_cn,t6.name AS course_name,
         t2.student_subscription_number,t2.teacher_subscription_number,t2.teacher_reference_number,
-        t7.name AS is_support_resources_cn,t2.version FROM textbook_subscription_record t1
+        t7.name AS is_support_resources_cn,t2.version, t2.class_ids FROM textbook_subscription_record t1
         LEFT JOIN wf_textbook_subscription_item t2 ON t1.wf_textbook_subscription_id = t2.id
         LEFT JOIN wf_textbook_subscription t3 ON t2.wf_textbook_subscription_id = t3.id
-        LEFT JOIN xjr_user t4 ON t3.applicant_user_id = t1.id
+        LEFT JOIN xjr_user t4 ON t3.applicant_user_id = t4.id
         LEFT JOIN xjr_dictionary_detail t5 ON t2.is_textbook_plan = t5.code AND t5.item_id = 1737360269850038273
         LEFT JOIN base_course_subject t6 ON t2.course_subject_id = t6.id
         LEFT JOIN xjr_dictionary_detail t7 ON t2.is_support_resources = t7.code AND t7.item_id = 1737360269850038273
         WHERE t1.delete_mark = 0 AND t1.textbook_id = #{id}
     </select>
 
-    <select id="getClassInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
-
+    <select id="getClassInfo" resultType="com.xjrsoft.module.textbook.vo.TextbookSubscriptionClassVo">
+        SELECT NAME FROM base_class WHERE id IN
+        <foreach item="classId" index="index" collection="ids" open="(" close=")" separator=",">
+            #{classId}
+        </foreach>
     </select>
 
-    <select id="getInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsVo">
-
+    <select id="getInfoByissn" resultType="com.xjrsoft.module.textbook.vo.TextbookVo">
+        SELECT * FROM textbook WHERE delete_mark = 0 AND issn = #{issn} order by create_date desc limit 0,1
     </select>
     <select id="isnnExist" resultType="java.lang.Integer">