Quellcode durchsuchen

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

phoenix vor 1 Jahr
Ursprung
Commit
08663d353a

+ 7 - 1
src/main/java/com/xjrsoft/module/form/utils/FormDataTransUtil.java

@@ -1,9 +1,11 @@
 package com.xjrsoft.module.form.utils;
 
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.db.Entity;
 import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringPool;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -80,7 +82,11 @@ public final class FormDataTransUtil {
                     }
                     Map<String, Object> detailMap = detailList.stream().filter(x -> StrUtil.equalsIgnoreCase(x.getItemId().toString(), MapUtils.getString(options, "itemId"))).collect(Collectors.toMap(DictionaryDetail::getValue, DictionaryDetail::getName, (e1, e2) -> e1));
                     fieldValuesMap.put(bindField, detailMap);
-                } else if (StrUtil.equalsIgnoreCase(datasourceType, "api") || isCascade) {
+                }else if(StrUtil.equalsIgnoreCase(ComponentTypeConstant.SELECT, type) && StrUtil.equalsIgnoreCase(datasourceType, "staticData")){ // 处理下拉静态数据
+                    List<JSONObject> staticOptions = Convert.toList(JSONObject.class, options.get("staticOptions"));
+                    Map<String, Object> dataMap = staticOptions.stream().collect(Collectors.toMap(data -> data.get("value").toString(), data -> data.get("label"), (e1, e2) -> e1));
+                    fieldValuesMap.put(bindField, dataMap);
+                }else if (StrUtil.equalsIgnoreCase(datasourceType, "api") || isCascade) {
                     String apiId = MapUtils.getString(MapUtils.getMap(options, "apiConfig"), "apiId");
                     if (apiDataMap.get(apiId) == null) {
                         Object resultApiData = magicApiService.executeApi(apiId);

+ 5 - 12
src/main/java/com/xjrsoft/module/room/dto/DistributeRoomBedPageDto.java

@@ -22,22 +22,15 @@ public class DistributeRoomBedPageDto extends PageInput {
     @ApiModelProperty("楼层")
     public Integer floorNumber;
 
-
-    @ApiModelProperty("寝室id")
-    public Long roomId;
+    @ApiModelProperty("寝室号")
+    public String roomName;
 
     @ApiModelProperty("入住性别")
     public String gender;
 
-    @ApiModelProperty("寝室id")
-    public Long gradeId;
-
-    @ApiModelProperty("年级id")
+    @ApiModelProperty("班级id")
     public Long classId;
 
-    @ApiModelProperty("寝室id")
-    public String studentName;
-
-    @ApiModelProperty("学号")
-    public String studentId;
+    @ApiModelProperty("入住身份")
+    public String checkInStatus;
 }

+ 16 - 0
src/main/java/com/xjrsoft/module/room/service/impl/RoomBedServiceImpl.java

@@ -42,6 +42,7 @@ import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseStudentMapper;
 import com.xjrsoft.module.teacher.entity.XjrUser;
+import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -64,6 +65,7 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
     private final RoomBedMapper roomBedMapper;
     private final BaseStudentMapper baseStudentMapper;
     private final BaseClassMapper baseClassMapper;
+    private final XjrUserMapper xjrUserMapper;
     private final RoomBedRecordMapper roomBedRecordMapper;
     @Override
     public Page<RoomBedPageVo> getPage(Page<RoomBedPageVo> page, RoomBedPageDto dto) {
@@ -279,6 +281,20 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
 
     @Override
     public Boolean adjustBed(AdjustStudentBedDto dto) {
+        //查询学生的性别
+        XjrUser xjrUser = xjrUserMapper.selectById(dto.getStudentUserId());
+        String studentGender = null;
+        if(1 == xjrUser.getGender()){
+            studentGender = "SB10001";
+        }else if(2 == xjrUser.getGender()){
+            studentGender = "SB10002";
+        }
+        RoomBed roomBedInfo = roomBedMapper.selectById(dto.getBedId());
+        Room room = roomMapper.selectById(roomBedInfo.getRoomId());
+        if(!room.getGender().equals(studentGender)){
+            return true;
+        }
+
         //先清空学生原来的床位
         UpdateWrapper<RoomBed> updateWrapper = new UpdateWrapper<>();
         updateWrapper.eq("student_user_id", dto.getStudentUserId());

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

@@ -8,23 +8,30 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.textbook.dto.AddTextbookDto;
 import com.xjrsoft.module.textbook.dto.AddTextbookWarehouseRecordDto;
 import com.xjrsoft.module.textbook.dto.TextbookPageDto;
+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.TextbookIssueRecordListVo;
 import com.xjrsoft.module.textbook.vo.TextbookPageVo;
 import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
 import com.xjrsoft.module.textbook.vo.TextbookVo;
-import com.xjrsoft.module.textbook.vo.WfTextbookClaimListVo;
-import com.xjrsoft.module.textbook.dto.AddTextbookDto;
-import com.xjrsoft.module.textbook.dto.UpdateTextbookDto;
-import com.xjrsoft.module.textbook.service.ITextbookService;
 import com.xjrsoft.module.textbook.vo.TextbookWarehouseRecordListVo;
-import com.xjrsoft.module.textbook.vo.TextbookIssueRecordListVo;
+import com.xjrsoft.module.textbook.vo.WfTextbookClaimListVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
@@ -61,7 +68,7 @@ public class TextbookController {
     public RT<TextbookVo> info(@RequestParam Long id){
         Textbook textbook = textbookService.getById(id);
         if (textbook == null) {
-           return RT.error("找不到此数据!");
+           return RT.ok();
         }
         textbook.setTextbookClassRelationList(textbookService.getClassRelation(textbook.getId()));
         return RT.ok(BeanUtil.toBean(textbook, TextbookVo.class));
@@ -84,7 +91,7 @@ public class TextbookController {
     public RT<List<TextbookSubscriptionRecordVo>> subscriptionList(@RequestParam Long id){
         List<TextbookSubscriptionRecordVo> result = textbookService.subscriptionList(id);
         if (result == null) {
-            return RT.error("找不到此数据!");
+            return RT.ok(new ArrayList<>());
         }
         return RT.ok(result);
     }
@@ -95,7 +102,7 @@ public class TextbookController {
     public RT<List<TextbookWarehouseRecordListVo>> warehouseList(@RequestParam Long id){
         List<TextbookWarehouseRecordListVo> result = textbookService.warehouseList(id);
         if (result == null) {
-            return RT.error("找不到此数据!");
+            return RT.ok(new ArrayList<>());
         }
         return RT.ok(result);
     }
@@ -106,7 +113,7 @@ public class TextbookController {
     public RT<List<TextbookIssueRecordListVo>> issueList(@RequestParam Long id){
         List<TextbookIssueRecordListVo> result = textbookService.issueList(id);
         if (result == null) {
-            return RT.error("找不到此数据!");
+            return RT.ok(new ArrayList<>());
         }
         return RT.ok(result);
     }
@@ -117,7 +124,7 @@ public class TextbookController {
     public RT<List<WfTextbookClaimListVo>> claimList(@RequestParam Long id){
         List<WfTextbookClaimListVo> result = textbookService.claimList(id);
         if (result == null) {
-            return RT.error("找不到此数据!");
+            return RT.ok(new ArrayList<>());
         }
         return RT.ok(result);
     }
@@ -129,7 +136,7 @@ public class TextbookController {
     public RT<Boolean> add(@Valid @RequestBody AddTextbookDto dto){
         Textbook textbook = BeanUtil.toBean(dto, Textbook.class);
         boolean isSuccess = textbookService.add(textbook);
-    return RT.ok(isSuccess);
+        return RT.ok(isSuccess);
     }
 
     @PutMapping

+ 4 - 1
src/main/java/com/xjrsoft/module/textbook/controller/TextbookIssueRecordController.java

@@ -13,6 +13,7 @@ import com.xjrsoft.module.textbook.dto.TextbookIssueRecordPageDto;
 import com.xjrsoft.module.textbook.dto.UpdateTextbookIssueRecordDto;
 import com.xjrsoft.module.textbook.entity.TextbookIssueRecord;
 import com.xjrsoft.module.textbook.service.ITextbookIssueRecordService;
+import com.xjrsoft.module.textbook.vo.TextbookIssueRecordExcelVo;
 import com.xjrsoft.module.textbook.vo.TextbookIssueRecordPageVo;
 import com.xjrsoft.module.textbook.vo.TextbookIssueRecordVo;
 import io.swagger.annotations.Api;
@@ -95,15 +96,17 @@ public class TextbookIssueRecordController {
     @ApiOperation(value = "导出")
     public ResponseEntity<byte[]> exportData(@Valid TextbookIssueRecordPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
         List<TextbookIssueRecordPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<TextbookIssueRecordPageVo>) page(dto).getData()).getList();
+        List<TextbookIssueRecordExcelVo> dataList = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
         for (TextbookIssueRecordPageVo textbookIssueRecordPageVo : customerList) {
             if(textbookIssueRecordPageVo.getCreateDate() == null){
                 continue;
             }
             textbookIssueRecordPageVo.setCreateDateStr(sdf.format(textbookIssueRecordPageVo.getCreateDate()));
+            dataList.add(BeanUtil.toBean(textbookIssueRecordPageVo, TextbookIssueRecordExcelVo.class));
         }
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, TextbookIssueRecordPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+        EasyExcel.write(bot, TextbookIssueRecordExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
 
         return RT.fileStream(bot.toByteArray(), "TextbookIssueRecord" + ExcelTypeEnum.XLSX.getValue());
     }

+ 4 - 1
src/main/java/com/xjrsoft/module/textbook/controller/TextbookWarehouseRecordController.java

@@ -9,6 +9,7 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.textbook.entity.TextbookWarehouseRecord;
+import com.xjrsoft.module.textbook.vo.TextbookWarehouseRecordExcelVo;
 import com.xjrsoft.module.textbook.vo.TextbookWarehouseRecordPageVo;
 import com.xjrsoft.module.textbook.dto.AddTextbookWarehouseRecordDto;
 import com.xjrsoft.module.textbook.dto.TextbookWarehouseRecordPageDto;
@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -100,8 +102,9 @@ public class TextbookWarehouseRecordController {
     @ApiOperation(value = "导出")
     public ResponseEntity<byte[]> exportData(@Valid TextbookWarehouseRecordPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
         List<TextbookWarehouseRecordPageVo> customerList = isTemplate != null && isTemplate ? new ArrayList<>() : ((PageOutput<TextbookWarehouseRecordPageVo>) page(dto).getData()).getList();
+        List<TextbookWarehouseRecordExcelVo> dataList = BeanUtil.copyToList(customerList, TextbookWarehouseRecordExcelVo.class);
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, TextbookWarehouseRecordPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+        EasyExcel.write(bot, TextbookWarehouseRecordExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
 
         return RT.fileStream(bot.toByteArray(), "TextbookClassWarehouse" + ExcelTypeEnum.XLSX.getValue());
     }

+ 96 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookIssueRecordExcelVo.java

@@ -0,0 +1,96 @@
+package com.xjrsoft.module.textbook.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 教材出库记录分页列表出参
+* @Author szs
+* @Date: 2023-12-27
+* @Version 1.0
+*/
+@Data
+public class TextbookIssueRecordExcelVo {
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("序号")
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("书号")
+    @ApiModelProperty("书号")
+    private String issn;
+
+    @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 gradeName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("使用班级")
+    @ApiModelProperty("使用班级")
+    private String className;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("对应课程")
+    @ApiModelProperty("对应课程")
+    private String courseName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("类型")
+    @ApiModelProperty("类型")
+    private String textbookTypeCn;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("规格型号")
+    @ApiModelProperty("规格型号")
+    private String specificationsModels;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("出库方式")
+    @ApiModelProperty("出库方式")
+    private String issueModeCn;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("出库时间")
+    @ApiModelProperty("出库时间")
+    private String createDateStr;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("领取人员")
+    @ApiModelProperty("领取人员")
+    private String claimUser;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("出库数量")
+    @ApiModelProperty("出库数量")
+    private Integer issueNumber;
+
+}

+ 87 - 0
src/main/java/com/xjrsoft/module/textbook/vo/TextbookWarehouseRecordExcelVo.java

@@ -0,0 +1,87 @@
+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;
+
+/**
+* @title: 教材入库分页列表出参
+* @Author szs
+* @Date: 2023-12-26
+* @Version 1.0
+*/
+@Data
+public class TextbookWarehouseRecordExcelVo {
+
+
+    /**
+    * 序号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("序号")
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+
+    /**
+     * 来源
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("书号")
+    @ApiModelProperty("书号")
+    private String issn;
+
+    /**
+    * 书名
+    */
+    @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 courseName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("类型")
+    @ApiModelProperty("类型")
+    private String textbookTypeCn;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("规格型号")
+    @ApiModelProperty("规格型号")
+    private String specificationsModels;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("入库人员")
+    @ApiModelProperty("入库人员")
+    private String warehouseUser;
+
+    /**
+    * 入库数量
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("入库数量")
+    @ApiModelProperty("入库数量")
+    private Integer warehouseNumber;
+
+
+
+}

+ 16 - 4
src/main/resources/mapper/room/RoomBedMapper.xml

@@ -126,6 +126,21 @@
                 WHERE delete_mark = 0 AND room_id = t1.id
                   AND student_user_id IS NOT NULL
             ) != t1.bed_count
+        <if test="dto.gender != null and dto.gender != ''">
+            and t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.officeBuildId != null">
+            and t2.id = #{dto.officeBuildId}
+        </if>
+        <if test="dto.floorNumber != null">
+            and t1.floor_number = #{dto.floorNumber}
+        </if>
+        <if test="dto.checkInStatus != null and dto.checkInStatus !=''">
+            and t1.check_in_status = #{dto.checkInStatus}
+        </if>
+        <if test="dto.roomName != null and dto.roomName !=''">
+            and t1.room_name like concat('%',#{dto.roomName},'%')
+        </if>
         ORDER BY t1.sort_code
     </select>
 
@@ -175,10 +190,7 @@
             and t4.id = #{dto.classId}
         </if>
         <if test="dto.gender != null and dto.gender != ''">
-            and t6.gender = #{dto.gender}
-        </if>
-        <if test="dto.gender != null and dto.gender != ''">
-            and t6.gender = #{dto.gender}
+            and REPLACE(REPLACE(t2.gender,1,'SB10001'),2,'SB10002') = #{dto.gender}
         </if>
         <if test="dto.isDistribute != null">
             <if test="dto.isDistribute == 1">