Browse Source

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

# Conflicts:
#	src/main/java/com/xjrsoft/module/textbook/service/ITextbookService.java
#	src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java
phoenix 1 year ago
parent
commit
be5503cbb7

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

@@ -14,6 +14,7 @@ import com.xjrsoft.module.textbook.dto.UpdateTextbookDto;
 import com.xjrsoft.module.textbook.entity.Textbook;
 import com.xjrsoft.module.textbook.service.ITextbookService;
 import com.xjrsoft.module.textbook.vo.TextbookPageVo;
+import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
 import com.xjrsoft.module.textbook.vo.TextbookVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -57,17 +58,28 @@ public class TextbookController {
         return RT.ok(pageOutput);
     }
 
-    @GetMapping(value = "/info")
+    @GetMapping(value = "/info-detail")
     @ApiOperation(value="根据id查询教材管理信息")
     @SaCheckPermission("textbook:detail")
     public RT<TextbookVo> info(@RequestParam Long id){
-        Textbook textbook = textbookService.getByIdDeep(id);
+        Textbook textbook = textbookService.getById(id);
         if (textbook == null) {
            return RT.error("找不到此数据!");
         }
         return RT.ok(BeanUtil.toBean(textbook, TextbookVo.class));
     }
 
+    @GetMapping(value = "/info-subscription-list")
+    @ApiOperation(value="查看详情信息-征订记录")
+    @SaCheckPermission("textbook:detail")
+    public RT<List<TextbookSubscriptionRecordVo>> subscriptionList(@RequestParam Long id){
+        List<TextbookSubscriptionRecordVo> result = textbookService.subscriptionList(id);
+        if (result == null) {
+            return RT.error("找不到此数据!");
+        }
+        return RT.ok(result);
+    }
+
 
     @PostMapping
     @ApiOperation(value = "新增教材管理")

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

@@ -5,8 +5,11 @@ 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.TextbookSubscriptionRecordVo;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
 * @title: 教材管理
 * @Author dzx
@@ -24,4 +27,12 @@ public interface TextbookMapper extends MPJBaseMapper<Textbook> {
      */
     Page<TextbookPageVo> getPage(Page<TextbookPageDto> page, TextbookPageDto dto);
 
+    /**
+     * 验证书号是否存在
+     *
+     * @param id
+     * @return
+     */
+    List<TextbookSubscriptionRecordVo> subscriptionList(Long id);
+
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/textbook/service/ITextbookService.java

@@ -5,6 +5,7 @@ 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.TextbookSubscriptionRecordVo;
 
 import java.util.List;
 
@@ -49,4 +50,12 @@ public interface ITextbookService extends MPJBaseService<Textbook> {
     Page<TextbookPageVo> getPage(Page<TextbookPageDto> page, TextbookPageDto dto);
 
     Boolean dataHandle(Long dataId);
+
+    /**
+     * 验证书号是否存在
+     *
+     * @param id
+     * @return
+     */
+    List<TextbookSubscriptionRecordVo> subscriptionList(Long id);
 }

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

@@ -13,6 +13,7 @@ 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.TextbookSubscriptionRecordVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -184,4 +185,10 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
         }
         return true;
     }
+
+    @Override
+    public List<TextbookSubscriptionRecordVo> subscriptionList(Long id) {
+        return textbookTextbookMapper.subscriptionList(id);
+    }
+
 }

+ 135 - 12
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionRecordVo.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;
 
@@ -21,23 +23,144 @@ public class TextbookSubscriptionRecordVo {
     /**
     * 主键编号
     */
-    @ApiModelProperty("主键编号")
-    private Long id;
+    @ApiModelProperty("征订时间")
+    private Date createDate;
     /**
     * 序号
     */
-    @ApiModelProperty("序号")
-    private Integer sortCode;
+    @ApiModelProperty("征订人")
+    private String applicantUser;
+
     /**
-    * 教材管理编号
-    */
-    @ApiModelProperty("教材管理编号")
-    private Long textbookId;
+     * 国际标准刊号
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("国际标准刊号")
+    @ApiModelProperty("国际标准刊号")
+    private String issn;
     /**
-    * 教材教辅征订编号
-    */
-    @ApiModelProperty("教材教辅征订编号")
-    private Long wfTextbookSubscriptionId;
+     * 书名
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("书名")
+    @ApiModelProperty("书名")
+    private String bookName;
+    /**
+     * 出版社
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("出版社")
+    @ApiModelProperty("出版社")
+    private String publishingHouse;
+    /**
+     * 主编
+     */
+    @ContentStyle(dataFormat = 49)
+    @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;
+    /**
+     * 是否为规划教材
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("是否为规划教材")
+    @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;
+    /**
+     * 估价(元)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("估价(元)")
+    @ApiModelProperty("估价(元)")
+    private BigDecimal appraisalPrice;
+    /**
+     * 定价(元)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("定价(元)")
+    @ApiModelProperty("定价(元)")
+    private BigDecimal price;
+    /**
+     * 折扣
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("折扣")
+    @ApiModelProperty("折扣")
+    private Double discount;
+    /**
+     * 小计(元)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("小计(元)")
+    @ApiModelProperty("小计(元)")
+    private BigDecimal subtotal;
+    /**
+     * 库存
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("库存")
+    @ApiModelProperty("库存")
+    private Integer stock;
+
+    /**
+     * 使用年级
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("使用年级")
+    @ApiModelProperty("使用年级")
+    private String useGrade;
+
+    /**
+     * 使用班级
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("使用班级")
+    @ApiModelProperty("使用班级")
+    private String useClass;
 
 
 

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

@@ -26,21 +26,11 @@ public class TextbookVo {
     @ApiModelProperty("主键编号")
     private Long id;
     /**
-    * 序号
-    */
-    @ApiModelProperty("序号")
-    private Integer sortCode;
-    /**
     * 国际标准刊号
     */
     @ApiModelProperty("国际标准刊号")
     private String issn;
     /**
-    * 国际标准书号
-    */
-    @ApiModelProperty("国际标准书号")
-    private String isbn;
-    /**
     * 书名
     */
     @ApiModelProperty("书名")
@@ -116,16 +106,4 @@ public class TextbookVo {
     @ApiModelProperty("库存")
     private Integer stock;
 
-
-    /**
-    * textbookClassRelation
-    */
-    @ApiModelProperty("textbookClassRelation子表")
-    private List<TextbookClassRelationVo> textbookClassRelationList;
-    /**
-    * textbookSubscriptionRecord
-    */
-    @ApiModelProperty("textbookSubscriptionRecord子表")
-    private List<TextbookSubscriptionRecordVo> textbookSubscriptionRecordList;
-
 }

+ 14 - 3
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -20,9 +20,20 @@
         WHERE t1.delete_mark = 0
     </select>
 
-    <select id="getSemesterInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
-
+    <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,
+        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
+        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_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>
@@ -30,7 +41,7 @@
     <select id="getInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsVo">
 
     </select>
-    <select id="getSortCode" resultType="java.lang.Integer">
+    <select id="isnnExist" resultType="java.lang.Integer">
 
     </select>
 </mapper>