Browse Source

Merge branch 'pre'

dzx 1 year ago
parent
commit
940d368acd
53 changed files with 1744 additions and 369 deletions
  1. 11 0
      src/main/java/com/xjrsoft/common/constant/GlobalConstant.java
  2. 0 4
      src/main/java/com/xjrsoft/common/interceptor/MagicApiWebLoginInterceptor.java
  3. 45 0
      src/main/java/com/xjrsoft/common/interceptor/RateLimitInterceptor.java
  4. 7 14
      src/main/java/com/xjrsoft/common/runner/OrganizationCacheRunner.java
  5. 4 6
      src/main/java/com/xjrsoft/common/xss/XssFilter.java
  6. 7 0
      src/main/java/com/xjrsoft/config/SaTokenConfig.java
  7. 6 3
      src/main/java/com/xjrsoft/module/base/service/IWhitelistManagementService.java
  8. 22 1
      src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java
  9. 32 2
      src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java
  10. 29 26
      src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java
  11. 6 4
      src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java
  12. 1 1
      src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java
  13. 1 1
      src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java
  14. 4 0
      src/main/java/com/xjrsoft/module/organization/controller/UserController.java
  15. 142 0
      src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java
  16. 4 0
      src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java
  17. 103 0
      src/main/java/com/xjrsoft/module/student/dto/AddBaseNewStudentDto.java
  18. 63 0
      src/main/java/com/xjrsoft/module/student/dto/BaseNewStudentPageDto.java
  19. 24 0
      src/main/java/com/xjrsoft/module/student/dto/UpdateBaseNewStudentDto.java
  20. 161 0
      src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java
  21. 28 0
      src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java
  22. 28 0
      src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java
  23. 40 0
      src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java
  24. 144 0
      src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentPageVo.java
  25. 32 0
      src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentTreeVo.java
  26. 101 0
      src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentVo.java
  27. 15 0
      src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanGradeVo.java
  28. 27 0
      src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanTreeVo.java
  29. 3 0
      src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java
  30. 4 0
      src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java
  31. 1 86
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java
  32. 2 14
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookIssueRecordController.java
  33. 5 10
      src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionController.java
  34. 2 0
      src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionItemHistoryController.java
  35. 5 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomDto.java
  36. 26 0
      src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomImportDto.java
  37. 46 0
      src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookSubscriptionDto.java
  38. 10 0
      src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookSubscriptionItemHistoryPageDto.java
  39. 1 1
      src/main/java/com/xjrsoft/module/textbook/service/ITextbookService.java
  40. 2 2
      src/main/java/com/xjrsoft/module/textbook/service/IWfTextbookSubscriptionService.java
  41. 100 52
      src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java
  42. 71 89
      src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookSubscriptionServiceImpl.java
  43. 21 5
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimExportQueryVo.java
  44. 40 4
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionExportQueryListVo.java
  45. 36 27
      src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionExportQueryVo.java
  46. 4 4
      src/main/resources/application.yml
  47. 5 5
      src/main/resources/mapper/base/WhitelistManagement.xml
  48. 70 0
      src/main/resources/mapper/student/BaseNewStudentMapper.xml
  49. 23 8
      src/main/resources/mapper/textbook/TextbookMapper.xml
  50. 16 0
      src/main/resources/sqlScript/20240531_sql.sql
  51. 123 0
      src/main/resources/sqlScript/20240604_sql.sql
  52. 16 0
      src/main/resources/sqlScript/20240618_sql.sql
  53. 25 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 11 - 0
src/main/java/com/xjrsoft/common/constant/GlobalConstant.java

@@ -59,6 +59,12 @@ public interface GlobalConstant {
      * */
     String LOGIN_USER_INFO_KEY = "LOGIN_USER_INFO_KEY";
 
+    /**
+     * @des sa-token 登录人用户类型
+     *
+     * */
+    String LOGIN_USER_TYPE = "LOGIN_USER_TYPE";
+
     /**
      * @des sa-token 登陆人权限Code key
      * */
@@ -408,6 +414,11 @@ public interface GlobalConstant {
      */
     String  DIC_ITEM_CACHE_KEY  = "ALL_DIC_ITEM";
 
+    /**
+     * 学生电信开卡用户
+     */
+    String WHITE_MANAGEMENT_CACHE_KEY = "ALL_WHITE_MANAGEMENT";
+
 
     /**
      * 数据字典详情

+ 0 - 4
src/main/java/com/xjrsoft/common/interceptor/MagicApiWebLoginInterceptor.java

@@ -21,7 +21,6 @@ import javax.servlet.http.HttpServletResponse;
 public class MagicApiWebLoginInterceptor implements HandlerInterceptor {
 
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
-
         // 根据parameter 判断是否有权限
         String parameter = request.getParameter(StpUtil.getTokenName());
 
@@ -47,8 +46,5 @@ public class MagicApiWebLoginInterceptor implements HandlerInterceptor {
             Object loginIdByToken = StpUtil.getLoginIdByToken(parameter);
             return !ObjectUtil.isNull(loginIdByToken);
         }
-
-
-
     }
 }

+ 45 - 0
src/main/java/com/xjrsoft/common/interceptor/RateLimitInterceptor.java

@@ -0,0 +1,45 @@
+package com.xjrsoft.common.interceptor;
+
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.convert.Convert;
+import com.xjrsoft.common.constant.GlobalConstant;
+import com.xjrsoft.common.enums.RoleEnum;
+import com.xjrsoft.common.utils.RedisUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+@Component
+public class RateLimitInterceptor implements HandlerInterceptor {
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        if (isLimiting()) {
+            // 暂停5秒
+            Thread.sleep(5000);
+            System.out.println("触发限流");
+        }
+        return true;
+    }
+
+    /**
+     * 是否满足限流条件
+     */
+    public boolean isLimiting() {
+        if (!StpUtil.isLogin()) return false;
+        Long userId = StpUtil.getLoginIdAsLong();
+        Long userType = Convert.toLong(StpUtil.getTokenSession().get(GlobalConstant.LOGIN_USER_TYPE), 0L);
+        if (userType.equals(RoleEnum.STUDENT.getCode())) {
+            Map map = redisUtil.get(GlobalConstant.WHITE_MANAGEMENT_CACHE_KEY, Map.class);
+            return map.get(userId.toString()) == null;
+        }
+        return false;
+    }
+}

+ 7 - 14
src/main/java/com/xjrsoft/common/runner/OrganizationCacheRunner.java

@@ -2,20 +2,9 @@ package com.xjrsoft.common.runner;
 
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.utils.RedisUtil;
-import com.xjrsoft.module.organization.entity.Department;
-import com.xjrsoft.module.organization.entity.Post;
-import com.xjrsoft.module.organization.entity.Role;
-import com.xjrsoft.module.organization.entity.User;
-import com.xjrsoft.module.organization.entity.UserDeptRelation;
-import com.xjrsoft.module.organization.entity.UserPostRelation;
-import com.xjrsoft.module.organization.entity.UserRoleRelation;
-import com.xjrsoft.module.organization.service.IDepartmentService;
-import com.xjrsoft.module.organization.service.IPostService;
-import com.xjrsoft.module.organization.service.IRoleService;
-import com.xjrsoft.module.organization.service.IUserDeptRelationService;
-import com.xjrsoft.module.organization.service.IUserPostRelationService;
-import com.xjrsoft.module.organization.service.IUserRoleRelationService;
-import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.base.service.IWhitelistManagementService;
+import com.xjrsoft.module.organization.entity.*;
+import com.xjrsoft.module.organization.service.*;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.CommandLineRunner;
@@ -50,6 +39,8 @@ public class OrganizationCacheRunner implements CommandLineRunner {
 
     private IUserPostRelationService userPostRelationService;
 
+    private IWhitelistManagementService whitelistManagementService;
+
     @Override
     public void run(String... args) {
         loadUserCache();
@@ -59,6 +50,8 @@ public class OrganizationCacheRunner implements CommandLineRunner {
         loadUserRoleRelationCache();
         loadUserDepartmentRelationCache();
         loadUserPostRelationCache();
+
+        whitelistManagementService.loadCaches();
     }
 
     @Async

+ 4 - 6
src/main/java/com/xjrsoft/common/xss/XssFilter.java

@@ -1,21 +1,18 @@
 
 package com.xjrsoft.common.xss;
 
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import javax.servlet.*;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 
+
 /**
  * XSS过滤
  *
  * @author tzx
  */
 public class XssFilter implements Filter {
+
     @Override
     public void init(FilterConfig config) {
     }
@@ -32,4 +29,5 @@ public class XssFilter implements Filter {
     public void destroy() {
     }
 
+
 }

+ 7 - 0
src/main/java/com/xjrsoft/config/SaTokenConfig.java

@@ -16,6 +16,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.ResponseCode;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.interceptor.MagicApiWebLoginInterceptor;
+import com.xjrsoft.common.interceptor.RateLimitInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -42,10 +43,16 @@ public class SaTokenConfig implements WebMvcConfigurer {
     public void addInterceptors(InterceptorRegistry registry) {
         // 注册MagicApi登录判断拦截器
         registry.addInterceptor(new MagicApiWebLoginInterceptor()).addPathPatterns(magicApiConfig.getWeb() + "/**");
+        // 注册拦截器
+        registry.addInterceptor(getRateLimitInterceptor()).addPathPatterns("/**");
         //satoken 注解鉴权拦截器
 //        registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
     }
 
+    @Bean
+    public RateLimitInterceptor getRateLimitInterceptor(){
+        return new RateLimitInterceptor();
+    }
 
     /**
      * 注册 [Sa-Token全局过滤器]

+ 6 - 3
src/main/java/com/xjrsoft/module/base/service/IWhitelistManagementService.java

@@ -1,15 +1,13 @@
 package com.xjrsoft.module.base.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.base.dto.WhitelistManagementPageDto;
 import com.xjrsoft.module.base.entity.TreeNode;
 import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.vo.WhitelistManagementPageVo;
-import lombok.Data;
+
 import java.util.List;
-import java.util.Objects;
 
 /**
 * @title: 白名单管理
@@ -32,4 +30,9 @@ public interface IWhitelistManagementService extends MPJBaseService<WhitelistMan
     boolean checkExist(String credentialNumber);
 
     List<TreeNode> getTreeStructure();
+
+    /**
+     * 所有学生电信开卡用户缓存
+     */
+    void loadCaches();
 }

+ 22 - 1
src/main/java/com/xjrsoft/module/base/service/impl/WhitelistManagementServiceImpl.java

@@ -1,7 +1,10 @@
 package com.xjrsoft.module.base.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.constant.GlobalConstant;
+import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.module.base.dto.WhitelistManagementPageDto;
 import com.xjrsoft.module.base.entity.TreeNode;
 import com.xjrsoft.module.base.entity.WhiteBaseClass;
@@ -11,11 +14,14 @@ import com.xjrsoft.module.base.mapper.WhitelistManagementMapper;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import com.xjrsoft.module.base.vo.WhitelistManagementPageVo;
 import lombok.AllArgsConstructor;
-import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
 * @title: 白名单管理
@@ -23,11 +29,14 @@ import java.util.List;
 * @Date: 2024-06-24
 * @Version 1.0
 */
+@Slf4j
 @Service
 @AllArgsConstructor
 public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<WhitelistManagementMapper, WhitelistManagement> implements IWhitelistManagementService {
     private final WhitelistManagementMapper whitelistManagementMapper;
 
+    private RedisUtil redisUtil;
+
     @Override
     public Page<WhitelistManagementPageVo> getPage(Page<Object> objectPage, WhitelistManagementPageDto dto) {
         return whitelistManagementMapper.getPage(objectPage, dto);
@@ -84,4 +93,16 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
 
         return treeNodes;
     }
+
+    /**
+     * 所有学生电信开卡用户缓存
+     */
+    @Async
+    public void loadCaches() {
+        log.info("XJRSOFT: 加载所有学生电信开卡用户缓存开始");
+        List<WhitelistManagement> list = whitelistManagementMapper.selectList(Wrappers.<WhitelistManagement>query().lambda().select(WhitelistManagement::getUserId));
+        Map<Long, Long> map = list.stream().collect(Collectors.toMap(WhitelistManagement::getUserId, WhitelistManagement::getUserId));
+        redisUtil.set(GlobalConstant.WHITE_MANAGEMENT_CACHE_KEY, map);
+        log.info("XJRSOFT: 加载所有学生电信开卡用户缓存结束");
+    }
 }

+ 32 - 2
src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.hikvision.util;
 
+import cn.hutool.db.Entity;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
@@ -12,10 +13,10 @@ import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.personnel.entity.CarMessageApply;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
-import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.var;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -422,7 +423,8 @@ public class DataUtil {
             paramJson.addProperty("personType", 1);
 
             int gender;
-            switch (objectMap.get("gender").toString()) {
+            String genderData = objectMap.get("gender") == null ? "" : objectMap.get("gender").toString();
+            switch (genderData) {
                 case "SB10001":
                     gender = 1;
                     break;
@@ -574,4 +576,32 @@ public class DataUtil {
 //        }
 //        db.executeBatch(sqls);
 //    };
+
+    /**
+     * 根据用用户id,删除海康人员信息
+     * @param userIds
+     */
+    public void deletePerson(List<Long> userIds){
+        String tableName = "hikvision_data";
+        JsonArray personIds = new JsonArray();
+        for (Long userId : userIds) {
+            String sql = "select * from hikvision_data where source_id = '" + userId + "'";
+            List<Map<String, Object>> maps = SqlRunnerAdapter.db().selectList(sql);
+            if(maps.isEmpty()){
+                continue;
+            }
+            for (Map<String, Object> map : maps) {
+                personIds.add(map.get("hikvision_id").toString());
+            }
+        }
+
+        String apiPath = "/api/resource/v1/person/batch/delete";
+
+        ApiUtil apiUtil = new ApiUtil();
+
+        JsonObject param = new JsonObject();
+        param.add("personIds", personIds);
+        String result = apiUtil.doPost(apiPath, param.toString(), null);
+        log.info("海康人员删除:param:" + param + ",result:" + result);
+    }
 }

+ 29 - 26
src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java

@@ -1,10 +1,11 @@
 package com.xjrsoft.module.job;
 
 import cn.hutool.core.util.IdUtil;
+import cn.hutool.db.Entity;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import com.xjrsoft.common.utils.WeChatUtil;
 import com.xjrsoft.module.attendance.entity.AttendanceRuleDetails;
 import com.xjrsoft.module.attendance.entity.AttendanceUserRelation;
@@ -13,8 +14,6 @@ import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
 import com.xjrsoft.module.organization.service.IWeChatService;
-import com.xjrsoft.module.system.entity.WechatMessageLog;
-import com.xjrsoft.module.system.service.IWechatMessageLogService;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,9 +55,6 @@ public class AttenDanceWarnNoticeTask {
     @Autowired
     private WeChatUtil weChatUtil;
 
-    @Autowired
-    private IWechatMessageLogService wechatMessageLogService;
-
     @Scheduled(cron = "0 */1 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();
@@ -101,17 +97,18 @@ public class AttenDanceWarnNoticeTask {
 
         //获取最近的时间
         LocalDateTime recentlyTime = getRecentlyTime(ruleDetailsList, now);
-        if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
+        long minute = Math.abs(ChronoUnit.MINUTES.between(now, recentlyTime));
+        if(minute >= 1){
             log.info("未到时间,不进行推送");
             return;
         }
         String wechatTemplate = weChatUtil.getAttenDanceWarnTemplate();
-        List<WechatMessageLog> list = wechatMessageLogService.list(
-                new QueryWrapper<WechatMessageLog>().lambda()
-                        .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
-                        .eq(WechatMessageLog::getSendTime, recentlyTime)
-                        .eq(WechatMessageLog::getTemplateId, wechatTemplate)
-        );
+//        List<WechatMessageLog> list = wechatMessageLogService.list(
+//                new QueryWrapper<WechatMessageLog>().lambda()
+//                        .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
+//                        .eq(WechatMessageLog::getSendTime, recentlyTime)
+//                        .eq(WechatMessageLog::getTemplateId, wechatTemplate)
+//        );
 //        if(!list.isEmpty()){//已经推送过,不再进行推送
 //            return;
 //        }
@@ -121,10 +118,6 @@ public class AttenDanceWarnNoticeTask {
         //判断所有当前时间下,哪几条规则需要进行提醒
         Map<Long, Integer> ruleDetailsJudgeMap = judgeExecuteNotice(now, ruleDetailsList, recentlyTime);
 
-        WechatMessageLog messageLog = new WechatMessageLog();
-        messageLog.setTemplateId(wechatTemplate);
-        messageLog.setSendTime(recentlyTime);
-
         List<XjrUser> userList = getUserList(allTodyRule.keySet());
         for (XjrUser xjrUser : userList) {
             AttendanceRuleDetails ruleDetails = allTodyRule.get(xjrUser.getId());
@@ -173,9 +166,13 @@ public class AttenDanceWarnNoticeTask {
 
         }
 
-        messageLog.setCreateDate(new Date());
-        messageLog.setContent("消息推送人数:" + userList.size());
-        wechatMessageLogService.save(messageLog);
+        String table = "wechat_message_log";
+        Entity entity = Entity.create(table);
+        entity.set("content", "消息推送人数:" + userList.size());
+        entity.set("create_date", new Date());
+        entity.set("template_id", wechatTemplate);
+        entity.set("send_time", recentlyTime);
+        SqlRunnerAdapter.db().dynamicInsert(table, entity);
 
     }
 
@@ -193,18 +190,22 @@ public class AttenDanceWarnNoticeTask {
                 if(ruleDetails.getAmStartTime() != null){
                     LocalDateTime amStartTime = judgeTime.with(ruleDetails.getAmStartTime().toLocalTime());
                     Long amBetween = Math.abs(ChronoUnit.MINUTES.between(judgeTime, amStartTime));
-                    if(recentlyTime.isEqual(amStartTime.plusMinutes(- ruleDetails.getAgoMinutes())) && amBetween >= ruleDetails.getAgoMinutes() - 1 && amBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
+                    if(ruleDetails.getAgoMinutes() != null && recentlyTime.isEqual(amStartTime.plusMinutes(- ruleDetails.getAgoMinutes()))
+                            && amBetween >= ruleDetails.getAgoMinutes() - 1 && amBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
                         result.put(ruleDetails.getId(), 1);
-                    }else if(recentlyTime.isEqual(amStartTime.plusMinutes(ruleDetails.getOverMinutes())) && amBetween >= ruleDetails.getOverMinutes() - 1 && amBetween <= ruleDetails.getOverMinutes() + 1){
+                    }else if(ruleDetails.getOverMinutes() != null && recentlyTime.isEqual(amStartTime.plusMinutes(ruleDetails.getOverMinutes()))
+                            && amBetween >= ruleDetails.getOverMinutes() - 1 && amBetween <= ruleDetails.getOverMinutes() + 1){
                         result.put(ruleDetails.getId(), 2);
                     }
                 }
                 if(ruleDetails.getPmStartTime() != null){
                     LocalDateTime pmStartTime = judgeTime.with(ruleDetails.getPmStartTime().toLocalTime());
                     Long pmBetween = Math.abs(ChronoUnit.MINUTES.between(judgeTime, pmStartTime));
-                    if(recentlyTime.isEqual(pmStartTime.plusMinutes(- ruleDetails.getAgoMinutes())) && pmBetween >= ruleDetails.getAgoMinutes() - 1 && pmBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
+                    if(ruleDetails.getAgoMinutes() != null && recentlyTime.isEqual(pmStartTime.plusMinutes(- ruleDetails.getAgoMinutes()))
+                            && pmBetween >= ruleDetails.getAgoMinutes() - 1 && pmBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
                         result.put(ruleDetails.getId(), 1);
-                    }else if(recentlyTime.isEqual(pmStartTime.plusMinutes(ruleDetails.getOverMinutes())) && pmBetween >= ruleDetails.getOverMinutes() - 1 && pmBetween <= ruleDetails.getOverMinutes() + 1){
+                    }else if(ruleDetails.getOverMinutes() != null && recentlyTime.isEqual(pmStartTime.plusMinutes(ruleDetails.getOverMinutes()))
+                            && pmBetween >= ruleDetails.getOverMinutes() - 1 && pmBetween <= ruleDetails.getOverMinutes() + 1){
                         result.put(ruleDetails.getId(), 2);
                     }
                 }
@@ -212,9 +213,11 @@ public class AttenDanceWarnNoticeTask {
                 if(ruleDetails.getEveningStartTime() != null){
                     LocalDateTime eveningStartTime = judgeTime.with(ruleDetails.getEveningStartTime().toLocalTime());
                     Long eveningBetween = Math.abs(ChronoUnit.MINUTES.between(judgeTime, eveningStartTime));
-                    if(recentlyTime.isEqual(eveningStartTime.plusMinutes(- ruleDetails.getAgoMinutes())) && eveningBetween >= ruleDetails.getAgoMinutes() - 1 && eveningBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
+                    if(ruleDetails.getAgoMinutes() != null && recentlyTime.isEqual(eveningStartTime.plusMinutes(- ruleDetails.getAgoMinutes()))
+                            && eveningBetween >= ruleDetails.getAgoMinutes() - 1 && eveningBetween <= ruleDetails.getAgoMinutes() + 1){//相差分钟数小于0
                         result.put(ruleDetails.getId(), 1);
-                    }else if(recentlyTime.isEqual(eveningStartTime.plusMinutes(ruleDetails.getOverMinutes())) && eveningBetween >= ruleDetails.getOverMinutes() - 1 && eveningBetween <= ruleDetails.getOverMinutes() + 1){
+                    }else if(ruleDetails.getOverMinutes() != null && recentlyTime.isEqual(eveningStartTime.plusMinutes(ruleDetails.getOverMinutes()))
+                            && eveningBetween >= ruleDetails.getOverMinutes() - 1 && eveningBetween <= ruleDetails.getOverMinutes() + 1){
                         result.put(ruleDetails.getId(), 2);
                     }
                 }

+ 6 - 4
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -137,7 +137,8 @@ public class AttendanceMessageTask {
                 characterKey = "character_string18";
                 //获取最近的时间
                 recentlyTime = getRecentlyTime(ruleDetails, now);
-                if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
+                long seconds = Math.abs(ChronoUnit.SECONDS.between(now, recentlyTime));
+                if(seconds >= 60){
                     log.info("未到时间,不进行推送");
                     continue;
                 }
@@ -154,7 +155,8 @@ public class AttendanceMessageTask {
                 wechatTemplate = weChatUtil.getAttendanceMsgAbsenceTemplate();
                 recentlyTime = getRecentlyOverTime(ruleDetails, now);
                 characterKey = "character_string36";
-                if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
+                long seconds = Math.abs(ChronoUnit.SECONDS.between(now, recentlyTime));
+                if(seconds >= 60){
                     log.info("未到时间,不进行推送");
                     continue;
                 }
@@ -240,7 +242,7 @@ public class AttendanceMessageTask {
                 for (XjrUser xjrUser : userList) {
                     weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
-//                    weChatService.sendTemplateMessage(weChatSendMessageDto);
+                    weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }
             }else if(messageSet.getRoleType() != null && messageSet.getRoleType() == 2){
                 //教师总人数
@@ -285,7 +287,7 @@ public class AttendanceMessageTask {
                 for (XjrUser xjrUser : userList) {
                     weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
-//                    weChatService.sendTemplateMessage(weChatSendMessageDto);
+                    weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }
             }
 

+ 1 - 1
src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java

@@ -129,7 +129,7 @@ public class MaterialTaskController {
                 .selectAs(MaterialTaskAssign::getTransferSubmitedPerson, MaterialTaskWaitPageVo::getTransferSubmitedPerson)
                 .selectAs(MaterialTaskAssign::getStatus, MaterialTaskWaitPageVo::getProcessStatus)
                 .leftJoin(XjrUser.class, XjrUser::getId, MaterialTask::getCreateUserId, ext -> ext.selectAs(XjrUser::getName, MaterialTaskWaitPageVo::getCreateUserName))
-                .leftJoin(MaterialTaskAppendix.class, MaterialTaskAppendix::getMaterialTaskId, MaterialTaskAssign::getId, ext -> ext.selectAs(MaterialTaskAppendix::getFileId, MaterialTaskWaitPageVo::getMaterialId))
+//                .leftJoin(MaterialTaskAppendix.class, MaterialTaskAppendix::getMaterialTaskId, MaterialTaskAssign::getId, ext -> ext.selectAs(MaterialTaskAppendix::getFileId, MaterialTaskWaitPageVo::getMaterialId))
         ;
 
 //        if (ObjectUtil.isNotNull(dto.getRequiredCompleteStareTime()) && ObjectUtil.isNotNull(dto.getRequiredCompleteEndTime())) {

+ 1 - 1
src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java

@@ -81,7 +81,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
         MaterialTask materialTask = BeanUtil.toBean(dto, MaterialTask.class);
         //新增任务
         materialTask.setStatus(2);
-        if(dto.getUserList() == null && !dto.getUserList().isEmpty()){
+        if(dto.getUserList() != null && !dto.getUserList().isEmpty()){
             materialTask.setAssignPerson(dto.getUserList().size());
         }
         materialTaskMaterialTaskMapper.insert(materialTask);

+ 4 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -33,6 +33,7 @@ import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.dto.AddUserDto;
 import com.xjrsoft.module.organization.dto.BindOpenidDto;
 import com.xjrsoft.module.organization.dto.LoginResetPasswordDto;
@@ -596,6 +597,9 @@ public class UserController {
         if (ids.contains(StpUtil.getLoginIdAsLong())) {
             R.error("当前登录账户不能删除!");
         }
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         //删除时需要同时删除用户部门关联表和用户角色关联表和用户岗位关系表数据。
         return R.ok(userService.deleteBatch(ids));
     }

+ 142 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -0,0 +1,142 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.EasyExcel;
+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.student.dto.AddBaseNewStudentDto;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseNewStudentDto;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
+import com.xjrsoft.module.student.vo.BaseNewStudentVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+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 org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/baseNewStudent")
+@Api(value = "/student"  + "/baseNewStudent",tags = "新生维护信息代码")
+@AllArgsConstructor
+public class BaseNewStudentController {
+
+
+    private final IBaseNewStudentService baseNewStudentService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="新生维护信息列表(分页)")
+    @SaCheckPermission("basenewstudent:detail")
+    public RT<PageOutput<BaseNewStudentPageVo>> page(@Valid BaseNewStudentPageDto dto){
+
+        Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/tree")
+    @ApiOperation(value="新生维护信息树")
+    @SaCheckPermission("basenewstudent:detail")
+    public RT<List<BaseNewStudentTreeVo>> tree(){
+
+        List<EnrollmentPlanGradeVo> gradeList = baseNewStudentService.getGradeList();
+        List<EnrollmentPlanTreeVo> list = baseNewStudentService.getEnrollmentPlanList();
+
+        List<BaseNewStudentTreeVo> result = new ArrayList<>();
+        for (EnrollmentPlanGradeVo gradeVo : gradeList) {
+            BaseNewStudentTreeVo treeVo = new BaseNewStudentTreeVo() {{
+                setId(gradeVo.getId());
+                setName(gradeVo.getName());
+                setTreeType(1);
+            }};
+            List<BaseNewStudentTreeVo> children = new ArrayList<>();
+            for (EnrollmentPlanTreeVo planTreeVo : list) {
+                if(planTreeVo.getGradeId().equals(gradeVo.getId())){
+                    children.add(new BaseNewStudentTreeVo() {{
+                        setId(planTreeVo.getId());
+                        setName(planTreeVo.getEnrollTypeCn());
+                        setTreeType(2);
+                    }});
+                }
+            }
+
+            treeVo.setChildren(children);
+            result.add(treeVo);
+        }
+
+        return RT.ok(result);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询新生维护信息信息")
+    @SaCheckPermission("basenewstudent:detail")
+    public RT<BaseNewStudentVo> info(@RequestParam Long id){
+        BaseNewStudent baseNewStudent = baseNewStudentService.getById(id);
+        if (baseNewStudent == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(baseNewStudent, BaseNewStudentVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增新生维护信息")
+    @SaCheckPermission("basenewstudent:add")
+    public RT<Boolean> add(@Valid @RequestBody AddBaseNewStudentDto dto){
+        BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
+        boolean isSuccess = baseNewStudentService.save(baseNewStudent);
+        return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改新生维护信息")
+    @SaCheckPermission("basenewstudent:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseNewStudentDto dto){
+
+        BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
+        return RT.ok(baseNewStudentService.updateById(baseNewStudent));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除新生维护信息")
+    @SaCheckPermission("basenewstudent:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(baseNewStudentService.removeBatchByIds(ids));
+
+    }
+    @PostMapping("/import")
+    @ApiOperation(value = "导入")
+    public RT<Boolean> importData(@RequestParam MultipartFile file) throws IOException {
+        List<BaseNewStudentPageVo> savedDataList = EasyExcel.read(file.getInputStream()).head(BaseNewStudentPageVo.class).sheet().doReadSync();
+        Boolean result = baseNewStudentService.saveBatch(BeanUtil.copyToList(savedDataList, BaseNewStudent.class));
+        return RT.ok(result);
+    }
+
+}

+ 4 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -26,6 +26,7 @@ import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.room.service.IRoomBedService;
@@ -217,6 +218,9 @@ public class StudentManagerController {
     @ApiOperation(value = "删除")
     @SaCheckPermission("studentmanager:delete")
     public R delete(@Valid @RequestBody List<Long> ids) {
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         return R.ok(studentManagerService.delete(ids));
     }
 

+ 103 - 0
src/main/java/com/xjrsoft/module/student/dto/AddBaseNewStudentDto.java

@@ -0,0 +1,103 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+public class AddBaseNewStudentDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 毕业学校
+    */
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+    /**
+    * 学生姓名
+    */
+    @ApiModelProperty("学生姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 身份证号
+    */
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+    /**
+    * 身高
+    */
+    @ApiModelProperty("身高")
+    private BigDecimal height;
+    /**
+    * 体重
+    */
+    @ApiModelProperty("体重")
+    private BigDecimal weight;
+    /**
+    * 成绩
+    */
+    @ApiModelProperty("成绩")
+    private BigDecimal score;
+    /**
+    * 毕业班级
+    */
+    @ApiModelProperty("毕业班级")
+    private String graduateClass;
+    /**
+    * 学生来源
+    */
+    @ApiModelProperty("学生来源")
+    private String source;
+    /**
+    * 住宿类型
+    */
+    @ApiModelProperty("住宿类型")
+    private String stduyStatus;
+    /**
+    * 手机号
+    */
+    @ApiModelProperty("手机号")
+    private String mobile;
+    /**
+    * 第一志愿
+    */
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+    /**
+    * 第二志愿
+    */
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+    /**
+    * 班级状态(0:未分配, 1:已分配)
+    */
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
+}

+ 63 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseNewStudentPageDto.java

@@ -0,0 +1,63 @@
+package com.xjrsoft.module.student.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+
+/**
+* @title: 新生维护信息分页查询入参
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseNewStudentPageDto extends PageInput {
+
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("身份证")
+    private String credentialNumber;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+    @ApiModelProperty("是否导入成绩(0:否,1:是)")
+    private Integer isImportScore;
+
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+
+
+    @ApiModelProperty("添加时间-开始")
+    private Date startDate;
+
+    @ApiModelProperty("添加时间-结束")
+    private Date endDate;
+
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+
+    @ApiModelProperty("性别")
+    private String gender;
+
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
+
+    @ApiModelProperty("树类型(1:年级,2:春秋季)")
+    private Integer treeType;
+
+    @ApiModelProperty("树id")
+    private Long treeId;
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateBaseNewStudentDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+public class UpdateBaseNewStudentDto extends AddBaseNewStudentDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 161 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java

@@ -0,0 +1,161 @@
+package com.xjrsoft.module.student.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+@TableName("base_new_student")
+@ApiModel(value = "base_new_student", description = "新生维护信息")
+public class BaseNewStudent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 毕业学校
+    */
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+    /**
+    * 学生姓名
+    */
+    @ApiModelProperty("学生姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 身份证号
+    */
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+    /**
+    * 身高
+    */
+    @ApiModelProperty("身高")
+    private BigDecimal height;
+    /**
+    * 体重
+    */
+    @ApiModelProperty("体重")
+    private BigDecimal weight;
+    /**
+    * 成绩
+    */
+    @ApiModelProperty("成绩")
+    private BigDecimal score;
+    /**
+    * 毕业班级
+    */
+    @ApiModelProperty("毕业班级")
+    private String graduateClass;
+    /**
+    * 学生来源
+    */
+    @ApiModelProperty("学生来源")
+    private String source;
+    /**
+    * 住宿类型
+    */
+    @ApiModelProperty("住宿类型")
+    private String stduyStatus;
+    /**
+    * 手机号
+    */
+    @ApiModelProperty("手机号")
+    private String mobile;
+    /**
+    * 第一志愿
+    */
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+    /**
+    * 第二志愿
+    */
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+    /**
+    * 班级状态(0:未分配, 1:已分配)
+    */
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
+
+
+    @ApiModelProperty("家庭电话")
+    private String familyMobile;
+
+    @ApiModelProperty("家庭地址")
+    private String familyAddress;
+}

+ 28 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Mapper
+public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
+
+    Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
+
+    List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
+
+    List<EnrollmentPlanGradeVo> getGradeList();
+}

+ 28 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.student.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
+
+import java.util.List;
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+
+public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
+
+    Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
+
+
+    List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
+
+    List<EnrollmentPlanGradeVo> getGradeList();
+}

+ 40 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java

@@ -0,0 +1,40 @@
+package com.xjrsoft.module.student.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @title: 新生维护信息
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudentMapper, BaseNewStudent> implements IBaseNewStudentService {
+    @Override
+    public Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto) {
+        return this.baseMapper.getPage(page, dto);
+    }
+
+    @Override
+    public List<EnrollmentPlanTreeVo> getEnrollmentPlanList() {
+        return this.baseMapper.getEnrollmentPlanList();
+    }
+
+    @Override
+    public List<EnrollmentPlanGradeVo> getGradeList() {
+        return this.baseMapper.getGradeList();
+    }
+}

+ 144 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentPageVo.java

@@ -0,0 +1,144 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 新生维护信息分页列表出参
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+public class BaseNewStudentPageVo {
+
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private Date createDate;
+    /**
+    * 毕业学校
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("毕业学校")
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+    /**
+    * 学生姓名
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别")
+    private String gender;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别中文")
+    private String genderCn;
+    /**
+    * 身份证号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("身份证号")
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+    /**
+    * 身高
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("身高")
+    @ApiModelProperty("身高")
+    private BigDecimal height;
+    /**
+    * 体重
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("体重")
+    @ApiModelProperty("体重")
+    private BigDecimal weight;
+    /**
+    * 成绩
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("成绩")
+    @ApiModelProperty("成绩")
+    private BigDecimal score;
+    /**
+    * 毕业班级
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("毕业班级")
+    @ApiModelProperty("毕业班级")
+    private String graduateClass;
+    /**
+    * 学生来源
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生来源")
+    @ApiModelProperty("学生来源")
+    private String source;
+    /**
+    * 住宿类型
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("住宿类型")
+    @ApiModelProperty("住宿类型")
+    private String stduyStatus;
+
+    @ApiModelProperty("住宿类型中文")
+    private String stduyStatusCn;
+    /**
+    * 手机号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+    /**
+    * 第一志愿
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("第一志愿")
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+    /**
+    * 第二志愿
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("第二志愿")
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+    /**
+    * 班级状态(0:未分配, 1:已分配)
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("班级状态(0:未分配, 1:已分配)")
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentTreeVo.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class BaseNewStudentTreeVo implements ITreeNode<BaseNewStudentTreeVo, Long>, Serializable {
+
+    @ApiModelProperty("id")
+    private Long id;
+
+    @ApiModelProperty("name")
+    private String name;
+
+    @ApiModelProperty("disabled")
+    private Long parentId;
+
+    @ApiModelProperty("children")
+    private List<BaseNewStudentTreeVo> children;
+
+    @ApiModelProperty("类型(1:年级,2:春秋季)")
+    private Integer treeType;
+
+}

+ 101 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentVo.java

@@ -0,0 +1,101 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+* @title: 新生维护信息表单出参
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+public class BaseNewStudentVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 毕业学校
+    */
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+    /**
+    * 学生姓名
+    */
+    @ApiModelProperty("学生姓名")
+    private String name;
+    /**
+    * 性别
+    */
+    @ApiModelProperty("性别")
+    private String gender;
+    /**
+    * 身份证号
+    */
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+    /**
+    * 身高
+    */
+    @ApiModelProperty("身高")
+    private BigDecimal height;
+    /**
+    * 体重
+    */
+    @ApiModelProperty("体重")
+    private BigDecimal weight;
+    /**
+    * 成绩
+    */
+    @ApiModelProperty("成绩")
+    private BigDecimal score;
+    /**
+    * 毕业班级
+    */
+    @ApiModelProperty("毕业班级")
+    private String graduateClass;
+    /**
+    * 学生来源
+    */
+    @ApiModelProperty("学生来源")
+    private String source;
+    /**
+    * 住宿类型
+    */
+    @ApiModelProperty("住宿类型")
+    private String stduyStatus;
+    /**
+    * 手机号
+    */
+    @ApiModelProperty("手机号")
+    private String mobile;
+    /**
+    * 第一志愿
+    */
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+    /**
+    * 第二志愿
+    */
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+    /**
+    * 班级状态(0:未分配, 1:已分配)
+    */
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+}

+ 15 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanGradeVo.java

@@ -0,0 +1,15 @@
+package com.xjrsoft.module.student.vo;
+
+import lombok.Data;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class EnrollmentPlanGradeVo {
+    private Long id;
+
+    private String name;
+
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanTreeVo.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class EnrollmentPlanTreeVo{
+    private Long id;
+
+    private String name;
+
+    private String enrollType;
+
+    private String enrollTypeCn;
+
+    private String gradeName;
+
+    private Long gradeId;
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java

@@ -375,6 +375,9 @@ public class LoginServiceImpl implements ILoginService {
         //根据登录信息  将post  和 department 信息存入用户信息中
         tokenSession.set(GlobalConstant.LOGIN_USER_INFO_KEY, loginUser);
 
+        // 存入用户类型
+        tokenSession.set(GlobalConstant.LOGIN_USER_TYPE, result.getUserType());
+
         result.setToken(StpUtil.getTokenValue());
 
         // 判断是不是OAuth2

+ 4 - 0
src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java

@@ -14,6 +14,7 @@ import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
@@ -140,6 +141,9 @@ public class TeacherbaseManagerController {
     @ApiOperation(value = "删除")
     @SaCheckPermission("teacherbasemanager:delete")
     public R delete(@Valid @RequestBody List<Long> ids){
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         return R.ok(teacherbaseManagerService.delete(ids));
 
     }

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

@@ -309,93 +309,8 @@ public class TextbookController {
 //    @GetMapping("/textbook-subscription-export-query")
 //    @ApiOperation(value = "教材征订记录条件导出")
 //    public ResponseEntity<byte[]> textbookSubscriptionExportQuery(@Valid TextbookSubscriptionExportQueryDto dto) {
-        List<TextbookSubscriptionExportQueryVo> customerList = textbookService.listTextbookSubscriptionExportQuery(dto);
-        ByteArrayOutputStream bot = new ByteArrayOutputStream();
-
-        // 设置动态头
-        String baseSemesterCn = "";
-        if(dto.getBaseSemesterId() != null){
-            LambdaQueryWrapper<BaseSemester> baseSemesterLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            baseSemesterLambdaQueryWrapper
-                    .eq(BaseSemester::getId, dto.getBaseSemesterId());
-            BaseSemester baseSemester = baseSemesterService.getOne(baseSemesterLambdaQueryWrapper);
-            if(baseSemester != null){
-                baseSemesterCn = baseSemester.getName();
-            }
-        }
-        String headTitle = "重庆市铜梁职业教育中心" + baseSemesterCn + "教材征订表";
-        List<List<String>> headList = new ArrayList<>();
-//        List<String> head0 = new ArrayList<>();
-//        head0.add("个人信息");
-//        head0.add("用户名");
-//        List<String> head1 = new ArrayList<>();
-//        head1.add("个人信息");
-//        head1.add("年龄");
-//        List<String> head2 = new ArrayList<>();
-//        head2.add("个人信息");
-//        head2.add("地址");
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("国际标准刊号");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("书名");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("出版社");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("主编");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("估价(元)");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("是否为规划教材");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("对应课程");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("使用年级");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("使用班级");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("学生用书征订数量");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("教师教材用书征订数量");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("教师教参用书征订数量");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("学科组名称");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("有无配套教学资源");
-        }});
-        headList.add(new ArrayList<String>(){{
-            add(headTitle);
-            add("备注");
-        }});
-        EasyExcel.write(bot, TextbookSubscriptionExportQueryVo.class).automaticMergeHead(true).excelType(ExcelTypeEnum.XLSX).head(headList).sheet().doWrite(customerList);
 
+        ByteArrayOutputStream bot = textbookService.listTextbookSubscriptionExportQuery(dto);
         return RT.fileStream(bot.toByteArray(), "TextbookSubscription" + ExcelTypeEnum.XLSX.getValue());
     }
 

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

@@ -20,18 +20,9 @@ import com.xjrsoft.module.textbook.vo.TextbookIssueRecordVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
-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.servlet.ServletContext;
+import org.springframework.web.bind.annotation.*;
+
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
@@ -53,9 +44,6 @@ public class TextbookIssueRecordController {
 
     private final ITextbookIssueRecordService textbookIssueRecordService;
 
-    @Autowired
-    private ServletContext servletContext;
-
     @GetMapping(value = "/page")
     @ApiOperation(value="教材出库记录列表(分页)")
     @SaCheckPermission("textbookissuerecord:detail")

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

@@ -6,7 +6,6 @@ import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
@@ -19,7 +18,6 @@ import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.student.entity.BaseClassMajorSet;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.textbook.dto.*;
-import com.xjrsoft.module.textbook.entity.Textbook;
 import com.xjrsoft.module.textbook.entity.WfTextbookSubscription;
 import com.xjrsoft.module.textbook.entity.WfTextbookSubscriptionItem;
 import com.xjrsoft.module.textbook.service.IWfTextbookSubscriptionService;
@@ -186,8 +184,8 @@ public class WfTextbookSubscriptionController {
     @GetMapping(value = "/info")
     @ApiOperation(value="根据id查询教材教辅征订信息")
     @SaCheckPermission("wftextbooksubscription:detail")
-    public RT<WfTextbookSubscriptionVo> info(@RequestParam Long id){
-        WfTextbookSubscriptionVo wfTextbookSubscriptionVo = wfTextbookSubscriptionService.getInfo(id);
+    public RT<WfTextbookSubscriptionVo> info(@Valid WfTextbookSubscriptionDto dto){
+        WfTextbookSubscriptionVo wfTextbookSubscriptionVo = wfTextbookSubscriptionService.getInfo(dto);
         if (wfTextbookSubscriptionVo == null) {
            return RT.error("找不到此数据!");
         }
@@ -246,9 +244,7 @@ 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) {
@@ -264,9 +260,8 @@ public class WfTextbookSubscriptionController {
 
     @PostMapping("/instockroom-excel-import")
     @ApiOperation(value = "教材征订入库数量导入")
-    @SaCheckPermission("coursetable:excelimport")
-    public R excelImport(@RequestParam("file") MultipartFile file) throws IOException {
+    public RT<String> excelImport(@RequestParam("file") MultipartFile file,  @RequestParam(value = "wfTextbookSubscriptionId") Long wfTextbookSubscriptionId) throws IOException {
         InputStream inputStream = file.getInputStream();
-        return R.ok(wfTextbookSubscriptionService.excelImport(inputStream));
+        return RT.ok(wfTextbookSubscriptionService.excelImport(inputStream, wfTextbookSubscriptionId));
     }
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/textbook/controller/WfTextbookSubscriptionItemHistoryController.java

@@ -60,6 +60,8 @@ public class WfTextbookSubscriptionItemHistoryController {
                 .leftJoin(XjrUser.class, XjrUser::getId, WfTextbookSubscriptionItemHistory::getCreateUserId)
                 .eq(dto.getWfTextbookSubscriptionItemId() != null && dto.getWfTextbookSubscriptionItemId() > 0, WfTextbookSubscriptionItemHistory::getWfTextbookSubscriptionItemId, dto.getWfTextbookSubscriptionItemId())
                 .eq(dto.getWfTextbookSubscriptionId() != null && dto.getWfTextbookSubscriptionId() > 0, WfTextbookSubscriptionItemHistory::getWfTextbookSubscriptionId, dto.getWfTextbookSubscriptionId())
+                .like(dto.getBookName() != null && !dto.getBookName().isEmpty(), Textbook::getBookName, dto.getBookName())
+                .like(dto.getCourseSubjectIdCn() != null && !dto.getCourseSubjectIdCn().isEmpty(), BaseCourseSubject::getName, dto.getCourseSubjectIdCn())
                 .orderByAsc("t.wf_textbook_subscription_item_id, t.history_version")
                 ;
         IPage<WfTextbookSubscriptionItemHistoryPageVo> page = wfTextbookSubscriptionItemHistoryService.selectJoinListPage(ConventPage.getPage(dto), WfTextbookSubscriptionItemHistoryPageVo.class, mpjLambdaWrapper);

+ 5 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomDto.java

@@ -22,6 +22,11 @@ public class TextbookInstockroomDto {
      */
     @ApiModelProperty("教材教辅征订项编号")
     private Long id;
+    /**
+     * 国际标准刊号
+     */
+    @ApiModelProperty(value = "国际标准刊号",hidden = true)
+    private String issn;
     /**
      * 本次入库数量
      */

+ 26 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TextbookInstockroomImportDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.textbook.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class TextbookInstockroomImportDto {
+    /**
+     * 国际标准刊号
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("书号(ISSN)")
+    @ApiModelProperty("国际标准刊号")
+    private String issn;
+    /**
+     * 本次入库数量
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("本次入库数量")
+    @ApiModelProperty("本次入库数量")
+    private Integer inNum;
+}

+ 46 - 0
src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookSubscriptionDto.java

@@ -0,0 +1,46 @@
+package com.xjrsoft.module.textbook.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.module.textbook.vo.WfTextbookSubscriptionItemVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+* @title: 教材教辅征订表单入参
+* @Author szs
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class WfTextbookSubscriptionDto {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+     * 主键编号
+     */
+    @ApiModelProperty("主键编号")
+    private Long wfTextbookSubscriptionItemId;
+    /**
+     * 教材类型(xjr_dictionary_item[textbook_type])
+     */
+    @ApiModelProperty("教材类型(xjr_dictionary_item[textbook_type])")
+    private String textbookType;
+    /**
+     * 书名
+     */
+    @ApiModelProperty("书名")
+    private String bookName;
+    /**
+     * 课程编号(base_course_subject)
+     */
+    @ApiModelProperty("课程编号(base_course_subject)")
+    private String courseSubjectIdCn;
+
+}

+ 10 - 0
src/main/java/com/xjrsoft/module/textbook/dto/WfTextbookSubscriptionItemHistoryPageDto.java

@@ -31,4 +31,14 @@ public class WfTextbookSubscriptionItemHistoryPageDto extends PageInput {
      */
     @ApiModelProperty("教材教辅征订编号")
     private Long wfTextbookSubscriptionId;
+    /**
+     * 书名
+     */
+    @ApiModelProperty("书名")
+    private String bookName;
+    /**
+     * 课程编号(base_course_subject)
+     */
+    @ApiModelProperty("课程编号(base_course_subject)")
+    private String courseSubjectIdCn;
 }

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

@@ -133,7 +133,7 @@ public interface ITextbookService extends MPJBaseService<Textbook> {
      * @param dto
      * @return
      */
-    List<TextbookSubscriptionExportQueryVo> listTextbookSubscriptionExportQuery(TextbookSubscriptionExportQueryDto dto);
+    ByteArrayOutputStream listTextbookSubscriptionExportQuery(TextbookSubscriptionExportQueryDto dto);
 
     ByteArrayOutputStream listTextbookClaimExportQuery(TextbookClaimExportQueryDto dto);
 

+ 2 - 2
src/main/java/com/xjrsoft/module/textbook/service/IWfTextbookSubscriptionService.java

@@ -47,7 +47,7 @@ public interface IWfTextbookSubscriptionService extends MPJBaseService<WfTextboo
 
     Boolean changeStatus(UpdateWfTextbookSubscriptionDto dto);
 
-    WfTextbookSubscriptionVo getInfo(Long id);
+    WfTextbookSubscriptionVo getInfo(WfTextbookSubscriptionDto dto);
 
     List<TextbookSubscriptionExportQueryListVo> textbookSubscriptionExportQuery(TextbookSubscriptionExportQueryListDto dto);
 
@@ -56,5 +56,5 @@ public interface IWfTextbookSubscriptionService extends MPJBaseService<WfTextboo
     Boolean instockroom(List<TextbookInstockroomDto> dtos);
 
 
-    Boolean excelImport(InputStream inputStream);
+    String excelImport(InputStream inputStream, Long wfTextbookSubscriptionId);
 }

+ 100 - 52
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.read.listener.PageReadListener;
+import com.alibaba.excel.support.ExcelTypeEnum;
 import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.metadata.WriteTable;
 import com.alibaba.excel.write.metadata.style.WriteCellStyle;
@@ -28,53 +29,19 @@ import com.xjrsoft.common.utils.excel.ExcelFillCellMergePrevColUtil;
 import com.xjrsoft.common.utils.excel.ExcelMergeUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseCourseSubject;
-import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.mapper.BaseCourseSubjectMapper;
-import com.xjrsoft.module.base.mapper.BaseGradeMapper;
 import com.xjrsoft.module.base.mapper.BaseSemesterMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
-import com.xjrsoft.module.base.vo.BaseClassCoursePageVo;
 import com.xjrsoft.module.teacher.entity.XjrUser;
-import com.xjrsoft.module.textbook.dto.AddTextbookWarehouseRecordDto;
-import com.xjrsoft.module.textbook.dto.TextbookClaimExportQueryDto;
-import com.xjrsoft.module.textbook.dto.TextbookImportDto;
-import com.xjrsoft.module.textbook.dto.TextbookPageDto;
-import com.xjrsoft.module.textbook.dto.TextbookStandingExportQuerytDto;
-import com.xjrsoft.module.textbook.dto.TextbookSubscriptionExportQueryDto;
-import com.xjrsoft.module.textbook.entity.SubjectGroup;
-import com.xjrsoft.module.textbook.entity.Textbook;
-import com.xjrsoft.module.textbook.entity.TextbookClassRelation;
-import com.xjrsoft.module.textbook.entity.TextbookCoreAttribute;
-import com.xjrsoft.module.textbook.entity.TextbookIssueRecord;
-import com.xjrsoft.module.textbook.entity.TextbookStudentClaim;
-import com.xjrsoft.module.textbook.entity.TextbookSubscriptionRecord;
-import com.xjrsoft.module.textbook.entity.TextbookWarehouseRecord;
-import com.xjrsoft.module.textbook.entity.WfExerciseBook;
-import com.xjrsoft.module.textbook.entity.WfExerciseBookItem;
-import com.xjrsoft.module.textbook.entity.WfTextbookClaim;
-import com.xjrsoft.module.textbook.mapper.SubjectGroupMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookClassRelationMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookCoreAttributeMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookIssueRecordMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookStudentClaimMapper;
-import com.xjrsoft.module.textbook.mapper.TextbookSubscriptionRecordMapper;
+import com.xjrsoft.module.textbook.dto.*;
+import com.xjrsoft.module.textbook.entity.*;
+import com.xjrsoft.module.textbook.mapper.*;
 import com.xjrsoft.module.textbook.service.ITextbookCoreAttributeService;
 import com.xjrsoft.module.textbook.service.ITextbookService;
 import com.xjrsoft.module.textbook.service.ITextbookWarehouseRecordService;
 import com.xjrsoft.module.textbook.service.IWfExerciseBookService;
-import com.xjrsoft.module.textbook.vo.TextbookClaimExportQueryVo;
-import com.xjrsoft.module.textbook.vo.TextbookClassRelationVo;
-import com.xjrsoft.module.textbook.vo.TextbookIssueRecordListVo;
-import com.xjrsoft.module.textbook.vo.TextbookPageVo;
-import com.xjrsoft.module.textbook.vo.TextbookStandingExportQueryVo;
-import com.xjrsoft.module.textbook.vo.TextbookSubscriptionClassVo;
-import com.xjrsoft.module.textbook.vo.TextbookSubscriptionExportQueryVo;
-import com.xjrsoft.module.textbook.vo.TextbookSubscriptionRecordVo;
-import com.xjrsoft.module.textbook.vo.TextbookVo;
-import com.xjrsoft.module.textbook.vo.TextbookWarehouseRecordListVo;
-import com.xjrsoft.module.textbook.vo.WfTextbookClaimListVo;
+import com.xjrsoft.module.textbook.vo.*;
 import lombok.AllArgsConstructor;
 import org.apache.poi.ss.usermodel.BorderStyle;
 import org.apache.poi.ss.usermodel.HorizontalAlignment;
@@ -86,15 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -124,12 +83,10 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
 
     private final SubjectGroupMapper subjectGroupMapper;
 
-    private final BaseGradeMapper baseGradeMapper;
+    private final BaseSemesterMapper baseSemesterMapper;
 
     private final BaseCourseSubjectMapper baseCourseSubjectMapper;
 
-    private final BaseSemesterMapper baseSemesterMapper;
-
     private final ITextbookCoreAttributeService textbookCoreAttributeService;
 
     private final TextbookCoreAttributeMapper textbookCoreAttributeMapper;
@@ -615,7 +572,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
     }
 
     @Override
-    public List<TextbookSubscriptionExportQueryVo> listTextbookSubscriptionExportQuery(TextbookSubscriptionExportQueryDto dto) {
+    public ByteArrayOutputStream listTextbookSubscriptionExportQuery(TextbookSubscriptionExportQueryDto dto) {
         List<TextbookSubscriptionExportQueryVo> result = textbookTextbookMapper.listTextbookSubscriptionExportQuery(dto);
         //将班级转换为中文
         for (TextbookSubscriptionExportQueryVo to : result) {
@@ -641,7 +598,97 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
                 }
             }
         }
-        return result;
+
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+
+        // 设置动态头
+        String baseSemesterCn = "";
+        if(dto.getBaseSemesterId() != null){
+            LambdaQueryWrapper<BaseSemester> baseSemesterLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            baseSemesterLambdaQueryWrapper
+                    .eq(BaseSemester::getId, dto.getBaseSemesterId());
+            BaseSemester baseSemester = baseSemesterMapper.selectOne(baseSemesterLambdaQueryWrapper);
+            if(baseSemester != null){
+                baseSemesterCn = baseSemester.getName();
+            }
+        }
+        String headTitle = "重庆市铜梁职业教育中心" + baseSemesterCn + "教材征订表";
+        List<List<String>> headList = new ArrayList<>();
+//        List<String> head0 = new ArrayList<>();
+//        head0.add("个人信息");
+//        head0.add("用户名");
+//        List<String> head1 = new ArrayList<>();
+//        head1.add("个人信息");
+//        head1.add("年龄");
+//        List<String> head2 = new ArrayList<>();
+//        head2.add("个人信息");
+//        head2.add("地址");
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("国际标准刊号");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("书名");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("出版社");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("主编");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("估价(元)");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("是否为规划教材");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("对应课程");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("使用年级");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("使用班级");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("学生用书征订数量");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("教师教材用书征订数量");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("教师教参用书征订数量");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("学科组名称");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("有无配套教学资源");
+        }});
+        headList.add(new ArrayList<String>(){{
+            add(headTitle);
+            add("备注");
+        }});
+
+
+
+        EasyExcel.write(bot, TextbookSubscriptionExportQueryVo.class).automaticMergeHead(true).excelType(ExcelTypeEnum.XLSX).head(headList).sheet().doWrite(result);
+
+        return bot;
     }
 
     @Override
@@ -703,6 +750,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
         // 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
         HorizontalCellStyleStrategy horizontalCellStyleStrategy =
                 new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
+
         try (ExcelWriter excelWriter = EasyExcel.write(bot, TextbookClaimExportQueryVo.class).registerWriteHandler(horizontalCellStyleStrategy).build()) {
             //已经写入的行
             int rowIndex = 0;

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

@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
-import com.xjrsoft.common.enums.TextbookTypeEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
@@ -35,6 +34,8 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.io.InputStream;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
 /**
@@ -192,8 +193,8 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
     }
 
     @Override
-    public WfTextbookSubscriptionVo getInfo(Long id) {
-        WfTextbookSubscription wfTextbookSubscription = this.getById(id);
+    public WfTextbookSubscriptionVo getInfo(WfTextbookSubscriptionDto dto) {
+        WfTextbookSubscription wfTextbookSubscription = this.getById(dto.getId());
         if (wfTextbookSubscription == null) {
             return null;
         }
@@ -210,6 +211,10 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
                         ext -> ext.selectAs(DictionaryDetail::getName, WfTextbookSubscriptionItemVo::getTextbookTypeCn))
                 .leftJoin(BaseCourseSubject.class, BaseCourseSubject::getId, Textbook::getCourseSubjectId)
                 .eq(WfTextbookSubscriptionItem::getWfTextbookSubscriptionId, wfTextbookSubscription.getId())
+                .eq(dto.getWfTextbookSubscriptionItemId() != null && dto.getWfTextbookSubscriptionItemId() > 0, WfTextbookSubscriptionItem::getId, dto.getWfTextbookSubscriptionItemId())
+                .eq(dto.getTextbookType() != null && !dto.getTextbookType().isEmpty(), Textbook::getTextbookType, dto.getTextbookType())
+                .like(dto.getBookName() != null && !dto.getBookName().isEmpty(), Textbook::getBookName, dto.getBookName())
+                .like(dto.getCourseSubjectIdCn() != null && !dto.getCourseSubjectIdCn().isEmpty(), BaseCourseSubject::getName, dto.getCourseSubjectIdCn())
         ;
         List<WfTextbookSubscriptionItemVo> itemList = wfTextbookSubscriptionWfTextbookSubscriptionItemMapper.selectJoinList(WfTextbookSubscriptionItemVo.class, mpjLambdaWrapper);
 
@@ -339,30 +344,83 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
         if (dtos.isEmpty()) {
             return false;
         }
+        Map<String, Object> result = saveData(dtos);
+        return result != null && (int) result.get("successNum") > 0;
+    }
 
+    @Override
+    public String excelImport(InputStream inputStream, Long wfTextbookSubscriptionId) {
+        AtomicReference<Map<String, Object>> atomicMap = new AtomicReference<>(new HashMap<>());
+        EasyExcel.read(inputStream, TextbookInstockroomImportDto.class, new PageReadListener<TextbookInstockroomImportDto>(dataList -> {
+            if (dataList.isEmpty()) {
+                throw new MyException("导入数据为空");
+            }
+
+            List<TextbookInstockroomDto> textbookInstockroomDtoList = new ArrayList<>();
+            for (TextbookInstockroomImportDto item : dataList){
+                textbookInstockroomDtoList.add(new TextbookInstockroomDto(){{
+                    setWfTextbookSubscriptionId(wfTextbookSubscriptionId);
+                    setIssn(item.getIssn());
+                    setInNum(item.getInNum());
+                }});
+            }
+            atomicMap.set(saveData(textbookInstockroomDtoList));
+        })).sheet().doRead();
+
+        if(atomicMap.get() != null){
+            return "计划入库教材" + atomicMap.get().get("allNum") + "样,成功入库" + atomicMap.get().get("successNum") + "样,成功入库" + atomicMap.get().get("instockroomNum") + "本";
+        }
+        return "计划入库教材0样,成功入库0样,成功入库0本";
+    }
+
+    private Map<String, Object> saveData(List<TextbookInstockroomDto> dtos) {
+        Map<String, Object> result = new HashMap<>();
+        int successNum = 0;
+        int instockroomNum = 0;
         //获取需要修改的list
-        LambdaQueryWrapper<WfTextbookSubscriptionItem> queryWrapper = new LambdaQueryWrapper<>();
+        MPJLambdaWrapper<WfTextbookSubscriptionItem> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
+                .select(WfTextbookSubscriptionItem::getId)
+                .selectAs(Textbook::getIssn, WfTextbookSubscriptionItem::getIssn)
+                .select(WfTextbookSubscriptionItem.class, x -> VoToColumnUtil.fieldsToColumns(WfTextbookSubscriptionItem.class).contains(x.getProperty()))
+                .leftJoin(Textbook.class, Textbook::getId, WfTextbookSubscriptionItem::getTextbookId)
                 .eq(WfTextbookSubscriptionItem::getWfTextbookSubscriptionId, dtos.get(0).getWfTextbookSubscriptionId())
                 .eq(WfTextbookSubscriptionItem::getDeleteMark, DeleteMark.NODELETE.getCode())
         ;
         List<WfTextbookSubscriptionItem> wfTextbookSubscriptionItemList = wfTextbookSubscriptionWfTextbookSubscriptionItemMapper.selectList(queryWrapper);
 
         if (wfTextbookSubscriptionItemList.isEmpty()) {
-            return false;
+            return null;
         }
 
-        Map<Long, WfTextbookSubscriptionItem> itemMap = wfTextbookSubscriptionItemList
+        Map<Long, WfTextbookSubscriptionItem> itemByIdMap = wfTextbookSubscriptionItemList
                 .stream()
                 .collect(Collectors.toMap(
                         WfTextbookSubscriptionItem::getId,
                         item -> item
                 ));
 
+        Map<String, WfTextbookSubscriptionItem> itemByIssnMap = wfTextbookSubscriptionItemList
+                .stream()
+                .collect(Collectors.toMap(
+                        WfTextbookSubscriptionItem::getIssn,
+                        item -> item
+                ));
+
         Date now = new Date();
         Long loginId = StpUtil.getLoginIdAsLong();
         for (TextbookInstockroomDto dto : dtos) {
-            WfTextbookSubscriptionItem old = itemMap.get(dto.getId());
+            WfTextbookSubscriptionItem old;
+            if(dto.getId() != null && dto.getId() > 0){
+                old = itemByIdMap.get(dto.getId());
+            } else {
+                old = itemByIssnMap.get(dto.getIssn());
+            }
+
+            if(old == null){
+                continue;
+            }
+
             WfTextbookSubscriptionItem updateItem = new WfTextbookSubscriptionItem();
             updateItem.setId(old.getId());
             updateItem.setInStockroomNum(old.getInStockroomNum() + dto.getInNum());
@@ -376,89 +434,13 @@ public class WfTextbookSubscriptionServiceImpl extends MPJBaseServiceImpl<WfText
                 setWarehouseNumber(dto.getInNum());
                 setSource("wm_manual");
             }});
+            successNum++;
+            instockroomNum += dto.getInNum();
         }
-        return true;
-    }
-
-    @Override
-    public Boolean excelImport(InputStream inputStream) {
-        EasyExcel.read(inputStream, TextbookImportDto.class, new PageReadListener<TextbookImportDto>(dataList -> {
-            if (dataList.isEmpty()) {
-                throw new MyException("导入数据为空");
-            }
-            saveData(dataList);
-        })).sheet().headRowNumber(3).doRead();
-
-        return true;
-    }
+        result.put("allNum", dtos.size());
+        result.put("successNum", successNum);
+        result.put("instockroomNum", instockroomNum);
 
-    private void saveData(List<TextbookImportDto> dataList) {
-        /*//查询所有需要的数据
-        //学科组
-        List<SubjectGroup> subjectGroupList = subjectGroupMapper.selectList(new LambdaQueryWrapper<>());
-        Map<String, Long> subjectGroupNameAndIdMap = subjectGroupList.stream().collect(Collectors.toMap(SubjectGroup::getGroupName, SubjectGroup::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));
-
-        //批量插入或更新数据
-        for (TextbookImportDto textbookImportDto : dataList) {
-            TextbookCoreAttribute textbookCoreAttribute = new TextbookCoreAttribute();
-            BeanUtils.copyProperties(textbookImportDto, textbookCoreAttribute);
-
-            Textbook textbook = new Textbook();
-            BeanUtils.copyProperties(textbookImportDto, textbook);
-
-            // 处理学科组映射
-            String groupName = textbookImportDto.getGroupName();
-            Long subjectGroupId = Optional.ofNullable(groupName)
-                    .map(subjectGroupNameAndIdMap::get)
-                    .orElse(null);
-            textbook.setSubjectGroupId(subjectGroupId);
-
-            // 处理课程映射
-            String courseName = textbookImportDto.getCourseName();
-            Long courseSubjectId = Optional.ofNullable(courseName)
-                    .map(baseCourseSubjectNameAndIdMap::get)
-                    .orElse(null);
-            textbook.setCourseSubjectId(courseSubjectId);
-
-            // 处理是否教材计划字段
-            String isTextbookPlanCn = textbookImportDto.getIsTextbookPlanCn();
-            String isTextbookPlan = Optional.ofNullable(isTextbookPlanCn)
-                    .filter("是"::equals)
-                    .map(s -> "yes")
-                    .orElse("no");
-            textbook.setIsTextbookPlan(isTextbookPlan);
-
-            // 处理教材类型映射
-            String textbookTypeCn = textbookImportDto.getTextbookTypeCn();
-            String textbookTypeCode = Optional.ofNullable(textbookTypeCn)
-                    .map(TextbookTypeEnum::getCode)
-                    .orElse(null);
-            textbook.setTextbookType(textbookTypeCode);
-
-            // 判断导入的教材是否已经存在,根据教材的 ISBN 码和使用的学期判断
-            LambdaQueryWrapper<Textbook> textbookLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            textbookLambdaQueryWrapper
-                    .eq(Textbook::getIssn, textbook.getIssn())
-            ;
-
-            Textbook oldTextbook = this.getOne(textbookLambdaQueryWrapper);
-
-            // 已经存在,更新数据
-            if (oldTextbook != null) {
-                // 更新教材数据
-                textbook.setId(oldTextbook.getId());
-                textbookTextbookMapper.updateById(textbook);
-            } else {
-                textbookCoreAttributeService.save(textbookCoreAttribute);
-
-                textbook.setTextbookCoreAttributeId(textbookCoreAttribute.getId());
-                // 插入教材数据
-                textbookTextbookMapper.insert(textbook);
-            }
-        }*/
+        return result;
     }
 }

+ 21 - 5
src/main/java/com/xjrsoft/module/textbook/vo/TextbookClaimExportQueryVo.java

@@ -80,12 +80,12 @@ public class TextbookClaimExportQueryVo {
     @ApiModelProperty("国际标准刊号")
     private String issn;
     /**
-     * 价(元)
+     * 价(元)
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("价(元)")
-    @ApiModelProperty("价(元)")
-    private BigDecimal appraisalPrice;
+    @ExcelProperty("价(元)")
+    @ApiModelProperty("价(元)")
+    private BigDecimal price;
     /**
      * 小计(元)
      */
@@ -100,10 +100,26 @@ public class TextbookClaimExportQueryVo {
     private Integer num;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("发放情况")
+    @ExcelProperty("发放数量")
     @ApiModelProperty("发放情况")
     private Integer claimNum;
 
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("增领数量")
+    @ApiModelProperty("增领数量")
+    private Integer addClaimNum;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("退书数量")
+    @ApiModelProperty("退书数量")
+    private Integer recedeNum;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("实发数量")
+    @ApiModelProperty("实发数量")
+    private Integer studentClaimNum;
+
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("备注")
     @ApiModelProperty("备注")

+ 40 - 4
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionExportQueryListVo.java

@@ -19,16 +19,23 @@ public class TextbookSubscriptionExportQueryListVo {
      * 课程
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("课程")
+    @ExcelProperty("课程名称")
     @ApiModelProperty("课程")
     private String courseName;
     /**
      * 书名
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("书名")
+    @ExcelProperty("教材书名")
     @ApiModelProperty("书名")
     private String bookName;
+    /**
+     * 国际标准刊号
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("书号(ISSN)")
+    @ApiModelProperty("国际标准刊号")
+    private String issn;
     /**
      * 出版社
      */
@@ -36,13 +43,21 @@ public class TextbookSubscriptionExportQueryListVo {
     @ExcelProperty("出版社")
     @ApiModelProperty("出版社")
     private String publishingHouse;
+    /**
+     * 主编
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("作者(主编)")
+    @ApiModelProperty("主编")
+    private String editorInChief;
     /**
      * 教材类型(xjr_dictionary_item[textbook_type])
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材类型")
+    @ExcelProperty("类型")
     @ApiModelProperty("教材类型")
     private String textbookTypeCn;
+
     /**
      * 学生用书征订数量
      */
@@ -68,7 +83,28 @@ public class TextbookSubscriptionExportQueryListVo {
      * 使用班级数
      */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("使用班级数")
+    @ExcelProperty("使用班级数")
     @ApiModelProperty("使用班级数")
     private Integer classNum;
+    /**
+     * 教师教材征订数量
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("征订总数量")
+    @ApiModelProperty("征订总数量")
+    private Integer subscriptionSum;
+    /**
+     * 已入库数量
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("已入库数量")
+    @ApiModelProperty("已入库数量")
+    private Integer inStockroomNum;
+    /**
+     * 本次入库数量
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("本次入库数量")
+    @ApiModelProperty("本次入库数量")
+    private Integer inNum;
 }

+ 36 - 27
src/main/java/com/xjrsoft/module/textbook/vo/TextbookSubscriptionExportQueryVo.java

@@ -16,21 +16,34 @@ import java.math.BigDecimal;
 */
 @Data
 public class TextbookSubscriptionExportQueryVo {
-
+    /**
+     * 课程
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("对应课程")
+    @ApiModelProperty("对应课程")
+    private String courseName;
+    /**
+     * 书名
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教材书名")
+    @ApiModelProperty("书名")
+    private String bookName;
     /**
     * 国际标准刊号
     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("国际标准刊号")
+    @ExcelProperty("书号(ISSN)")
     @ApiModelProperty("国际标准刊号")
     private String issn;
     /**
-    * 书名
-    */
+     * 主编
+     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("书名")
-    @ApiModelProperty("书名")
-    private String bookName;
+    @ExcelProperty("作者(主编)")
+    @ApiModelProperty("主编")
+    private String editorInChief;
     /**
     * 出版社
     */
@@ -39,12 +52,22 @@ public class TextbookSubscriptionExportQueryVo {
     @ApiModelProperty("出版社")
     private String publishingHouse;
     /**
-    * 主编
-    */
+     * 教材类型(xjr_dictionary_item[textbook_type])
+     */
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("主编")
-    @ApiModelProperty("主编")
-    private String editorInChief;
+    @ExcelProperty("教材类型")
+    @ApiModelProperty("教材类型(xjr_dictionary_item[textbook_type])")
+    private String textbookTypeCn;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生用书征订数量")
+    @ApiModelProperty("学生用书征订数量")
+    private Integer studentSubscriptionNumber;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("教师教材用书征订数量")
+    @ApiModelProperty("教师教材用书征订数量")
+    private Integer teacherSubscriptionNumber;
     /**
      * 估价(元)
      */
@@ -59,13 +82,7 @@ public class TextbookSubscriptionExportQueryVo {
     @ExcelProperty("是否为规划教材")
     @ApiModelProperty("是否为规划教材")
     private String isTextbookPlanCn;
-    /**
-     * 课程
-     */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("对应课程")
-    @ApiModelProperty("对应课程")
-    private String courseName;
+
     /**
      * 使用年级
      */
@@ -89,15 +106,7 @@ public class TextbookSubscriptionExportQueryVo {
     @ApiModelProperty("使用班级")
     private String useClass;
 
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("学生用书征订数量")
-    @ApiModelProperty("学生用书征订数量")
-    private Integer studentSubscriptionNumber;
 
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教师教材用书征订数量")
-    @ApiModelProperty("教师教材用书征订数量")
-    private Integer teacherSubscriptionNumber;
 
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("教师教参用书征订数量")

+ 4 - 4
src/main/resources/application.yml

@@ -3,9 +3,9 @@ server:
 
 
 spring:
-  # 环境 dev|pre|prod
+  # 环 io境 dev|pre|prod
   profiles:
-    active: prod
+    active: dev
   # jackson时间格式化
   jackson:
     time-zone: GMT+8
@@ -126,8 +126,8 @@ mybatis-plus:
     cache-enabled: false
     call-setters-on-nulls: true
     jdbc-type-for-null: 'null'
-#    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
 camunda:
   bpm:

+ 5 - 5
src/main/resources/mapper/base/WhitelistManagement.xml

@@ -17,17 +17,17 @@
         left join xjr_dictionary_detail t4 on t4.code = t2.stduy_status
         left join xjr_user t5 ON t5.id = t3.teacher_id
         WHERE t.delete_mark = 0
-        <if test="dto.credentialNumber != null">
-            AND t.credential_number = #{dto.credentialNumber}
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            AND t.credential_number like concat('%', #{dto.credentialNumber}, '%')
         </if>
-        <if test="dto.name != null">
-            AND t.name = #{dto.name}
+        <if test="dto.name != null and dto.name != ''">
+            AND t.name like concat('%', #{dto.name}, '%')
         </if>
         <if test="dto.phone != null">
             AND t.phone = #{dto.phone}
         </if>
         <if test="dto.readWay != null">
-            AND t4.code = #{dto.readWay}
+            AND t4.code like concat('%', #{dto.readWay}, '%')
         </if>
         <if test="dto.classId != null">
             AND t3.id = #{dto.classId}

+ 70 - 0
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.student.mapper.BaseNewStudentMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+        SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
+        t1.score,t1.graduate_class,t1.source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t1.first_ambition,
+        t1.second_ambition,t1.is_adjust,t1.status FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.isImportScore != null">
+            <if test="dto.isImportScore == 1">
+                and t1.score is not null
+            </if>
+            <if test="dto.isImportScore == 0">
+                and t1.score is null
+            </if>
+        </if>
+        <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
+            and t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
+            and t1.second_ambition = #{dto.secondAmbition}
+        </if>
+
+        <if test="dto.startDate != null and dto.endDate != null">
+            AND t1.create_date between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.status != null">
+            AND t1.status = #{dto.status}
+        </if>
+        <if test="dto.enrollmentPlanId != null">
+            AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
+        </if>
+        <if test="dto.treeId != null and dto.treeType != null">
+            <if test="dto.treeType == 1">
+                AND t4.grade_id = #{dto.treeId}
+            </if>
+            <if test="dto.treeType == 2">
+                AND t4.enroll_type = #{dto.treeId}
+            </if>
+        </if>
+    </select>
+    <select id="getEnrollmentPlanList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo">
+        SELECT t1.enroll_type, t2.name AS enroll_type_cn,t3.name AS grade_name, t3.id as grade_id,t1.id FROM enrollment_plan t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
+        LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
+        WHERE t1.delete_mark = 0
+    </select>
+
+    <select id="getGradeList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo">
+        SELECT DISTINCT t3.id, t3.name FROM enrollment_plan t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
+        LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
+        WHERE t1.delete_mark = 0
+    </select>
+
+</mapper>

+ 23 - 8
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -255,9 +255,8 @@
     <select id="listTextbookClaimExportQuery"
             parameterType="com.xjrsoft.module.textbook.dto.TextbookClaimExportQueryDto"
             resultType="com.xjrsoft.module.textbook.vo.TextbookClaimExportQueryVo">
-        with textbook_class as (
-        select
-        t.base_semester_id,
+        with textbook_class as
+        (select t.base_semester_id,
         t.class_id,
         t1.textbook_id,
         sum(t2.stock) as num,
@@ -278,9 +277,21 @@
             and t1.textbook_id = #{dto.textbookId}
         </if>
         group by t.base_semester_id, t.class_id, t1.textbook_id
-        )
-        select
-        t.base_semester_id,
+        ),
+        textbook_recode as
+        (select t.base_semester_id,
+        t.class_id,
+        t1.textbook_id,
+        sum(t1.number) as recedeNum
+        from wf_textbook_recede t
+        inner join wf_textbook_recede_item t1 on t1.wf_textbook_recede_id = t.id
+        left join textbook_class t2
+        on t2.base_semester_id = t.base_semester_id and t2.class_id = t.class_id and
+        t2.textbook_id = t1.textbook_id
+        where t.recede_type = 'recede_deans_office'
+        AND t.status = 1
+        group by t.base_semester_id, t.class_id, t1.textbook_id)
+        select t.base_semester_id,
         t3.name as baseSemesterIdCn,
         t.class_id,
         t4.name as classIdCn,
@@ -292,10 +303,12 @@
         t1.editor_in_chief,
         t1.publishing_house,
         t1.issn,
-        t1.appraisal_price,
+        t1.price,
         t1.subtotal,
         t.num,
-        t.claimNum
+        t.claimNum,
+        ifnull(t7.recedeNum, 0) as recedeNum,
+        (t.claimNum - ifnull(t7.recedeNum, 0)) as studentClaimNum
         from textbook_class t
         left join textbook t1 on t1.id = t.textbook_id
         left join xjr_dictionary_detail t2 on t2.code = t1.textbook_type
@@ -303,6 +316,8 @@
         left join base_class t4 on t4.id = t.class_id
         left join xjr_user t5 on t5.id = t4.teacher_id
         left join base_classroom t6 on t6.id = t4.classroom_id
+        left join textbook_recode t7 on t7.base_semester_id = t.base_semester_id and t7.class_id = t.class_id and
+        t7.textbook_id = t.textbook_id
         where t1.delete_mark = 0
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t1.textbook_type = #{dto.textbookType}

+ 16 - 0
src/main/resources/sqlScript/20240531_sql.sql

@@ -0,0 +1,16 @@
+-- ----------------------------------------------
+-- 节假日
+-- ----------------------------------------------
+DROP TABLE IF EXISTS holiday_date;
+CREATE TABLE `holiday_date` (
+  `id` BIGINT NOT NULL COMMENT '主键编号',
+  `date` VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '日期yyyy-MM-dd',
+  `year` INT NOT NULL,
+  `month` INT NOT NULL,
+  `day` INT NOT NULL,
+  `status` INT DEFAULT '0' COMMENT '0=普通工作日 1=周末 2=需要补班的工作日 3=法定节假日',
+  `way` INT NOT NULL DEFAULT '1' COMMENT '方式 1=系统数据 2=用户数据',
+  `delete_status` INT NOT NULL DEFAULT '0' COMMENT '删除状态 0=正常 1=删除',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE KEY `only` (`date`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb3;

+ 123 - 0
src/main/resources/sqlScript/20240604_sql.sql

@@ -0,0 +1,123 @@
+-- ------------------------------------------------
+-- 班级课程
+-- ------------------------------------------------
+DROP TABLE IF EXISTS base_class_course;
+CREATE TABLE `base_class_course` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id(base_class)',
+  `course_id` BIGINT DEFAULT NULL COMMENT '课程id(base_course_subject)',
+  `textbook_id` BIGINT DEFAULT NULL COMMENT '教材id(textbook)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='班级课程';
+
+-- ------------------------------------------------
+-- 教师奖项
+-- ------------------------------------------------
+DROP TABLE IF EXISTS teacher_award_item;
+CREATE TABLE `teacher_award_item` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(200) DEFAULT NULL COMMENT '奖项名称',
+  `is_thesis` INT DEFAULT NULL COMMENT '是否论文(1:是 0:否)',
+  `is_standard` INT DEFAULT NULL COMMENT '是否频分标准(1:是 0:否)',
+  `score` DECIMAL(6,2) DEFAULT NULL COMMENT '分数',
+  `parent_id` BIGINT DEFAULT NULL COMMENT '父级id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='教师奖项';
+
+
+ALTER TABLE `teacher_award`   
+  ADD COLUMN `teacher_award_item_id` BIGINT NULL   COMMENT '奖项id(teacher_award_item)' AFTER `status`;
+  
+ALTER TABLE `xjr_user`   
+  CHANGE `avatar` `avatar` MEDIUMBLOB NULL   COMMENT '头像';
+  
+ALTER TABLE textbook
+    ADD use_type INT NULL COMMENT '使用类型(单位:学期)';
+
+ALTER TABLE `base_student_school_roll`   
+  ADD INDEX (`learn_status`);
+ALTER TABLE `xjr_dictionary_detail`   
+  ADD INDEX (`name`, `code`);
+
+DROP TABLE IF EXISTS `base_system_config`;
+CREATE TABLE `base_system_config`  (
+  `id` BIGINT NOT NULL,
+  `code` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编号',
+  `value` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '值',
+  `remark` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '说明',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统参数配置' ROW_FORMAT = DYNAMIC;
+
+DROP TABLE IF EXISTS `base_user_student`;
+CREATE TABLE `base_user_student` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改时间',
+  `user_id` BIGINT NOT NULL COMMENT '家长ID(xjr_user)',
+  `user_phone` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '家长手机号',
+  `student_id` BIGINT NOT NULL COMMENT '学生ID(xjr_user)',
+  `student_nane` VARCHAR(255) DEFAULT NULL COMMENT '学生姓名',
+  `student_identity` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学生身份证号',
+  `class_id` BIGINT DEFAULT NULL COMMENT '学生班级id(base_class)',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '学生班主任id(xjr_user)',
+  `status` INT DEFAULT NULL COMMENT '流程状态(0:审核中,1:通过,2:拒绝)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='家长学生关联表';
+
+ALTER TABLE wf_textbook_subscription_item
+    ADD textbook_id BIGINT NULL COMMENT '教材id';
+ALTER TABLE wf_textbook_subscription
+    ADD subscription_method INT NULL COMMENT '征订方式(1:按班级征订 2:按教材征订)';
+
+ALTER TABLE `jianyue_data`   
+  CHANGE `source_id` `source_id` VARCHAR(100) NULL COMMENT '数据id';
+
+
+DROP TABLE IF EXISTS `teacher_award`;
+CREATE TABLE `teacher_award` (
+  `id` BIGINT NOT NULL COMMENT '主键编号',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATETIME DEFAULT NULL COMMENT '修改时间',
+  `delete_mark` INT NOT NULL COMMENT '删除标记',
+  `enabled_mark` INT NOT NULL COMMENT '有效标志',
+  `sort_code` INT DEFAULT NULL COMMENT '序号',
+  `applicant_user_id` BIGINT DEFAULT NULL COMMENT '申请人',
+  `award_type` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '获奖类型',
+  `award_level` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '奖项级别',
+  `competition_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '奖项名称',
+  `award_grade` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '获奖等级',
+  `award_score` DECIMAL(6,2) DEFAULT NULL COMMENT '奖项分数',
+  `paper_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '作品名称',
+  `issn` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国际标准刊号字',
+  `media_type` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '媒体类型(期刊、图书、报纸、音像、论文集)',
+  `journal_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '媒体名称',
+  `journal_number` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国内统一刊号CN',
+  `journal_level` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '期刊级别(核心期刊、一般期刊、(校级、内部论文))',
+  `issue_date` DATE DEFAULT NULL COMMENT '发表时间',
+  `approval_user_id` BIGINT DEFAULT NULL COMMENT '审核人',
+  `remark` VARCHAR(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
+  `file_id` BIGINT DEFAULT NULL COMMENT '附件文件id',
+  `status` INT NOT NULL DEFAULT '0' COMMENT '状态(1:结束 0:未结束)',
+  `teacher_award_item_id` BIGINT DEFAULT NULL COMMENT '奖项id(teacher_award_item)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='教师获奖登记';
+
+
+ALTER TABLE teacher_award
+    ADD whole_competition_name VARCHAR(256) NULL COMMENT '奖项名称全称';

+ 16 - 0
src/main/resources/sqlScript/20240618_sql.sql

@@ -0,0 +1,16 @@
+-- 给每个绑定考勤规则的用户增加考勤相关状态
+ALTER TABLE `attendance_user_relation`   
+  ADD COLUMN `attendance_status` VARCHAR(20) DEFAULT 0  NULL COMMENT '考勤状态' AFTER `attendance_rule_category_id`,
+  ADD COLUMN `attendance_time` DATETIME NULL   COMMENT '最新考勤时间' AFTER `attendance_status`;
+
+ALTER TABLE `attendance_user_relation`   
+  ADD COLUMN `attendance_mode` VARCHAR(20) DEFAULT 0  NULL COMMENT '考勤方式',
+  ADD COLUMN `car_number` VARCHAR(20) NULL COMMENT '车牌号' AFTER `attendance_mode`;
+
+
+ALTER TABLE wf_textbook_subscription_item
+    ADD instockroom_num INT DEFAULT 0 NULL COMMENT '当前征订任务征订项已经入库数量';
+ALTER TABLE wf_textbook_subscription_item
+    ADD alteration_type INT DEFAULT 0 NULL COMMENT '变更类型(0:未变更,1:变更征订数量,2:变更课程)';
+ALTER TABLE wf_textbook_subscription_item
+    CHANGE instockroom_num in_stockroom_num INT DEFAULT 0 NULL COMMENT '当前征订任务征订项已经入库数量';

+ 25 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -3337,4 +3337,29 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+    @Test
+    public void gcBaseNewStudent() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("base_new_student");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("student");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(true);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
 }