Ver código fonte

Merge branch 'pre'

dzx 6 meses atrás
pai
commit
006196af3e

+ 100 - 94
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -11,6 +11,7 @@ import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
+import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.utils.LocalDateUtil;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
@@ -116,6 +117,11 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                         .in(BaseNewStudent::getId, dto.getNewStudentIds())
         );
 
+        List<BaseNewStudent> notPaymnyList = list.stream().filter(x -> "未交费".equals(x.getPaymnystate())).collect(Collectors.toList());
+        if(!notPaymnyList.isEmpty() && dto.getIsHandle() == 1){
+            throw new MyException("选择的学生中存在未交费情况,无法手动分班");
+        }
+
         List<BandingTaskClassStudent> dataList = new ArrayList<>();
         long createUserId = StpUtil.getLoginIdAsLong();
 
@@ -176,100 +182,100 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
             if(!updateList.isEmpty()){
                 newStudentService.updateBatchById(updateList);
             }
-            {
-                /**
-                 * 新增学生数据
-                 * 1、新增用户xjr_user,需要先查询用户信息是否已经存在
-                 * 2、新增用户与角色的关系xjr_user_role_relation
-                 * 3、新增学生基本信息base_student
-                 * 4、新增学籍信息表base_student_school_roll
-                 * 5、新增家庭信息表base_student_family
-                 */
-                LocalDateTime now = LocalDateTime.now();
-                List<String> idNumbers = updateList.stream().map(BaseNewStudent::getCredentialNumber).collect(Collectors.toList());
-                List<User> students = userService.list(
-                        new MPJLambdaWrapper<User>()
-                                .disableLogicDel()
-                                .in(User::getCredentialNumber, idNumbers)
-                                .orderByAsc(User::getCreateDate)
-                );
-                Map<String, Long> userSet = new HashMap<>();
-                Map<String, Integer> userDeleteMarkMap = new HashMap<>();
-                for (User student : students) {
-                    userSet.put(student.getCredentialNumber(), student.getId());
-                    userDeleteMarkMap.put(student.getCredentialNumber(), student.getDeleteMark());
-                }
-                for (BaseNewStudent student : updateList) {
-                    if(userSet.containsKey(student.getCredentialNumber())){
-                        schoolRollService.updateStudentClass(dto.getBandingTaskClassId(), userSet.get(student.getCredentialNumber()));
-                        Integer deleteMark = userDeleteMarkMap.get(student.getCredentialNumber());
-                        if(deleteMark != null && deleteMark == 1){
-                            userService.recoveryStudentInfo(userSet.get(student.getCredentialNumber()));
-                        }
-                        continue;
-                    }
-                    LocalDate birthDate = LocalDateUtil.getBirthDate(student.getCredentialNumber());
-                    User xjrUser = new User() {{
-                        setCreateDate(now);
-                        setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
-                        setName(student.getName());
-                        setUserName(student.getCredentialNumber());
-                        setCredentialNumber(student.getCredentialNumber());
-                        setCredentialType("ZZLS10007");
-                        setMobile(student.getMobile());
-                        setEnabledMark(EnabledMark.DISABLED.getCode());
-                        setGender(student.getGender());
-                        setIsChangePassword(1);
-                        setBirthDate(birthDate.atStartOfDay());
-                    }};
-                    userService.save(xjrUser);
-
-                    UserRoleRelation userRoleRelation = new UserRoleRelation() {{
-                        setRoleId(RoleEnum.STUDENT.getCode());
-                        setUserId(xjrUser.getId());
-                    }};
-                    roleRelationService.save(userRoleRelation);
-
-                    BaseStudent baseStudent = new BaseStudent() {{
-                        setUserId(xjrUser.getId());
-                        setCreateDate(now);
-                        setStudentId(student.getCredentialNumber());
-                        if(student.getHeight() != null){
-                            setHeight(student.getHeight().doubleValue());
-                        }
-                        if(student.getWeight() != null){
-                            setWeight(student.getWeight().doubleValue());
-                        }
-                    }};
-                    studentService.save(baseStudent);
-
-                    BaseStudentSchoolRoll schoolRoll = new BaseStudentSchoolRoll() {{
-                        setUserId(xjrUser.getId());
-                        if(student.getScore() != null){
-                            setGraduatedScore(student.getScore().doubleValue());
-                        }
-
-                        setGraduatedUniversity(student.getGraduateSchool());
-                        setClassId(dto.getBandingTaskClassId());
-                        setMajorSetId(aClass.getMajorSetId());
-                        setStduyStatus(student.getStduyStatus());
-                        setEnrollType(aClass.getEnrollType());
-                        setStudentSource(student.getSource());
-                        setGradeId(aClass.getGradeId());
-                        setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
-                        setCreateDate(now);
-                    }};
-                    schoolRollService.save(schoolRoll);
-
-                    BaseStudentFamily studentFamily = new BaseStudentFamily() {{
-                        setCreateDate(now);
-                        setUserId(xjrUser.getId());
-                        setTelephone(student.getFamilyMobile());
-                        setAddress(student.getFamilyAddress());
-                    }};
-                    familyService.save(studentFamily);
-                }
-            }
+//            {
+//                /**
+//                 * 新增学生数据
+//                 * 1、新增用户xjr_user,需要先查询用户信息是否已经存在
+//                 * 2、新增用户与角色的关系xjr_user_role_relation
+//                 * 3、新增学生基本信息base_student
+//                 * 4、新增学籍信息表base_student_school_roll
+//                 * 5、新增家庭信息表base_student_family
+//                 */
+//                LocalDateTime now = LocalDateTime.now();
+//                List<String> idNumbers = updateList.stream().map(BaseNewStudent::getCredentialNumber).collect(Collectors.toList());
+//                List<User> students = userService.list(
+//                        new MPJLambdaWrapper<User>()
+//                                .disableLogicDel()
+//                                .in(User::getCredentialNumber, idNumbers)
+//                                .orderByAsc(User::getCreateDate)
+//                );
+//                Map<String, Long> userSet = new HashMap<>();
+//                Map<String, Integer> userDeleteMarkMap = new HashMap<>();
+//                for (User student : students) {
+//                    userSet.put(student.getCredentialNumber(), student.getId());
+//                    userDeleteMarkMap.put(student.getCredentialNumber(), student.getDeleteMark());
+//                }
+//                for (BaseNewStudent student : updateList) {
+//                    if(userSet.containsKey(student.getCredentialNumber())){
+//                        schoolRollService.updateStudentClass(dto.getBandingTaskClassId(), userSet.get(student.getCredentialNumber()));
+//                        Integer deleteMark = userDeleteMarkMap.get(student.getCredentialNumber());
+//                        if(deleteMark != null && deleteMark == 1){
+//                            userService.recoveryStudentInfo(userSet.get(student.getCredentialNumber()));
+//                        }
+//                        continue;
+//                    }
+//                    LocalDate birthDate = LocalDateUtil.getBirthDate(student.getCredentialNumber());
+//                    User xjrUser = new User() {{
+//                        setCreateDate(now);
+//                        setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
+//                        setName(student.getName());
+//                        setUserName(student.getCredentialNumber());
+//                        setCredentialNumber(student.getCredentialNumber());
+//                        setCredentialType("ZZLS10007");
+//                        setMobile(student.getMobile());
+//                        setEnabledMark(EnabledMark.DISABLED.getCode());
+//                        setGender(student.getGender());
+//                        setIsChangePassword(1);
+//                        setBirthDate(birthDate.atStartOfDay());
+//                    }};
+//                    userService.save(xjrUser);
+//
+//                    UserRoleRelation userRoleRelation = new UserRoleRelation() {{
+//                        setRoleId(RoleEnum.STUDENT.getCode());
+//                        setUserId(xjrUser.getId());
+//                    }};
+//                    roleRelationService.save(userRoleRelation);
+//
+//                    BaseStudent baseStudent = new BaseStudent() {{
+//                        setUserId(xjrUser.getId());
+//                        setCreateDate(now);
+//                        setStudentId(student.getCredentialNumber());
+//                        if(student.getHeight() != null){
+//                            setHeight(student.getHeight().doubleValue());
+//                        }
+//                        if(student.getWeight() != null){
+//                            setWeight(student.getWeight().doubleValue());
+//                        }
+//                    }};
+//                    studentService.save(baseStudent);
+//
+//                    BaseStudentSchoolRoll schoolRoll = new BaseStudentSchoolRoll() {{
+//                        setUserId(xjrUser.getId());
+//                        if(student.getScore() != null){
+//                            setGraduatedScore(student.getScore().doubleValue());
+//                        }
+//
+//                        setGraduatedUniversity(student.getGraduateSchool());
+//                        setClassId(dto.getBandingTaskClassId());
+//                        setMajorSetId(aClass.getMajorSetId());
+//                        setStduyStatus(student.getStduyStatus());
+//                        setEnrollType(aClass.getEnrollType());
+//                        setStudentSource(student.getSource());
+//                        setGradeId(aClass.getGradeId());
+//                        setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
+//                        setCreateDate(now);
+//                    }};
+//                    schoolRollService.save(schoolRoll);
+//
+//                    BaseStudentFamily studentFamily = new BaseStudentFamily() {{
+//                        setCreateDate(now);
+//                        setUserId(xjrUser.getId());
+//                        setTelephone(student.getFamilyMobile());
+//                        setAddress(student.getFamilyAddress());
+//                    }};
+//                    familyService.save(studentFamily);
+//                }
+//            }
             CompletableFuture.runAsync(() -> {
                 List<User> userList = userService.list();
                 redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);

+ 27 - 5
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -281,7 +281,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
         Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
         if(ruleCodes.contains("BR0002")){
-            classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
+            classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList, ruleCodes));
         }
 
         //存班级和学生的关系
@@ -344,7 +344,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                     continue;
                 }
                 //专业不匹配,直接跳过
-                if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
+                if(
+                        !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
+                        (
+                                !ruleCodes.contains("BR0006") &&
+                                !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
+                        )
+                )
+                {
                     continue;
                 }
                 //判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
@@ -419,7 +426,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                     continue;
                 }
                 //专业不匹配,直接跳过
-                if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
+                //专业不匹配,直接跳过
+                if(
+                        !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
+                                (
+                                        !ruleCodes.contains("BR0006") &&
+                                                !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
+                                )
+                ){
                     continue;
                 }
                 //判断该班性别是否已满
@@ -477,7 +491,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
      * @return 班级id和学生
      */
     Map<Long, List<BaseNewStudent>> divideStudentByScore(Map<Long, BandingTaskMajorCondition> classConditionMap, List<BaseNewStudent> baseNewStudents,
-                                                         List<BandingTaskClass> classList){
+                                                         List<BandingTaskClass> classList, List<String> ruleCodes){
         Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
         for (Long majorSetId : classConditionMap.keySet()) {
             //查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
@@ -493,7 +507,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
             List<BaseNewStudent> stuList = new ArrayList<>();
 
             for (BaseNewStudent newStudent : baseNewStudents) {
-                if(!Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) && !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())){
+                //专业不匹配,直接跳过
+                if(
+                        !Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) &&
+                                (
+                                        !ruleCodes.contains("BR0006") &&
+                                                !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())
+                                )
+                )
+                {
                     continue;
                 }
 

+ 6 - 6
src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java

@@ -222,14 +222,14 @@ public class FormExecuteController {
         return R.ok(formExecuteService.workFlowInfo(dto));
     }
 
-    @GetMapping(value = "/export")
-    @ApiOperation(value = "导出")
-    @XjrLog(value = "导出表单数据")
-    public ResponseEntity<byte[]> export(@Valid FormExecuteListDto dto) throws IOException {
-//    @PostMapping(value = "/export")
+//    @GetMapping(value = "/export")
 //    @ApiOperation(value = "导出")
 //    @XjrLog(value = "导出表单数据")
-//    public ResponseEntity<byte[]> export(@Valid @RequestBody FormExecuteListDto dto) throws IOException {
+//    public ResponseEntity<byte[]> export(@Valid FormExecuteListDto dto) throws IOException {
+    @PostMapping(value = "/export")
+    @ApiOperation(value = "导出")
+    @XjrLog(value = "导出表单数据")
+    public ResponseEntity<byte[]> export(@Valid @RequestBody FormExecuteListDto dto) throws IOException {
         FormRelease formRelease = formReleaseService.getById(dto.getReleaseId());
         FormReleaseConfig formReleaseConfig = JSONUtil.toBean(formRelease.getConfigJson(), FormReleaseConfig.class);
         // 配置excel第一行字段名

+ 5 - 0
src/main/java/com/xjrsoft/module/generator/entity/ListConfig.java

@@ -29,6 +29,11 @@ public class ListConfig {
      */
     private Integer pageSize;
 
+    /**
+     * 导入模版url
+     */
+    private String importTemplateUrl;
+
     /**
      * 导入模版名称
      */

+ 16 - 2
src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java

@@ -117,6 +117,8 @@ public class BaseNewStudentTask {
         );
         Map<String, Long> majorSetNameMap = majorSetList.stream().collect(Collectors.toMap(BaseMajorSet::getName, BaseMajorSet::getId));
 
+        Set<String> insCredentialNumber = new HashSet<>();
+
         //循环攀宝的数据,准备更新到新生表中
         List<BaseNewStudent> updateList = new ArrayList<>();
         List<BaseNewStudent> insertList = new ArrayList<>();
@@ -126,6 +128,11 @@ public class BaseNewStudentTask {
             if (existsNewStudent != null) {
                 existsNewStudent.setName(feeobjupdate.getFeeobjname());
                 existsNewStudent.setPaymnystate(feeobjupdate.getPaymnystate());
+                if("未交费".equals(feeobjupdate.getPaymnystate())){
+                    existsNewStudent.setIsCanBanding(0);
+                }else{
+                    existsNewStudent.setIsCanBanding(1);
+                }
                 existsNewStudent.setPrevious(feeobjupdate.getPrevious());
                 existsNewStudent.setProvince(feeobjupdate.getProvince());
                 existsNewStudent.setCity(feeobjupdate.getCity());
@@ -160,7 +167,9 @@ public class BaseNewStudentTask {
                 updateList.add(existsNewStudent);
                 continue;
             }
-
+            if(insCredentialNumber.contains(feeobjupdate.getPersonalid())){
+                continue;
+            }
             insertList.add(
                     new BaseNewStudent() {{
                         setCredentialNumber(feeobjupdate.getPersonalid());
@@ -195,9 +204,14 @@ public class BaseNewStudentTask {
                         setEnrollmentPlanId(planId);
                         setCreateDate(new Date());
                         setStatus(0);
-                        setIsCanBanding(1);
+                        if("未交费".equals(feeobjupdate.getPaymnystate())){
+                            setIsCanBanding(0);
+                        }else{
+                            setIsCanBanding(1);
+                        }
                     }}
             );
+            insCredentialNumber.add(feeobjupdate.getPersonalid());
         }
 
         if (!updateList.isEmpty()) {

+ 60 - 2
src/main/java/com/xjrsoft/module/oa/controller/OfficialDocumentReceivedController.java

@@ -1,9 +1,12 @@
 package com.xjrsoft.module.oa.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
@@ -13,9 +16,17 @@ import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedDto;
 import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedPageDto;
 import com.xjrsoft.module.oa.dto.UpdateOfficialDocumentReceivedDto;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedPageVo;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedVo;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.system.entity.DictionaryDetail;
+import com.xjrsoft.module.system.entity.DictionaryItem;
+import com.xjrsoft.module.system.service.IDictionarydetailService;
+import com.xjrsoft.module.teacher.entity.XjrUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -30,6 +41,8 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @title: 公文收文
@@ -43,8 +56,10 @@ import java.util.List;
 @AllArgsConstructor
 public class OfficialDocumentReceivedController {
 
-
+    private final IDictionarydetailService dictionarydetailService;
     private final IOfficialDocumentReceivedService officialDocumentReceivedService;
+    private final IOfficialDocumentReceivedHandleService officialDocumentReceivedHandleService;
+    private final IUserService userService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value = "公文收文列表(分页)")
@@ -70,7 +85,50 @@ public class OfficialDocumentReceivedController {
         if (officialDocumentReceived == null) {
             return RT.error("找不到此数据!");
         }
-        return RT.ok(BeanUtil.toBean(officialDocumentReceived, OfficialDocumentReceivedVo.class));
+        List<DictionaryDetail> dictionaryDetails = dictionarydetailService.list(
+                new MPJLambdaWrapper<DictionaryDetail>()
+                        .select(DictionaryDetail::getId)
+                        .select(DictionaryDetail.class, x -> VoToColumnUtil.fieldsToColumns(DictionaryDetail.class).contains(x.getProperty()))
+                        .innerJoin(DictionaryItem.class, DictionaryItem::getId, DictionaryDetail::getItemId)
+                        .eq(DictionaryItem::getCode, "received_type")
+        );
+        Map<String, String> dictionaryMaps = dictionaryDetails.stream().collect(Collectors.toMap(DictionaryDetail::getCode, DictionaryDetail::getName));
+        OfficialDocumentReceivedVo bean = BeanUtil.toBean(officialDocumentReceived, OfficialDocumentReceivedVo.class);
+        bean.setReceivedTypeCn(dictionaryMaps.get(officialDocumentReceived.getReceivedType()));
+
+        if(officialDocumentReceived.getHandleDutyUserId() != null){
+            User handleDutyUser = userService.getById(officialDocumentReceived.getHandleDutyUserId());
+            if(handleDutyUser != null){
+                bean.setHandleDutyUserName(handleDutyUser.getName());
+            }
+
+        }
+
+        List<User> userList = userService.list(
+                new MPJLambdaWrapper<User>()
+                        .select(User::getId)
+                        .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
+                        .innerJoin(OfficialDocumentReceivedHandle.class, OfficialDocumentReceivedHandle::getReceiveUserId, User::getId)
+                        .eq(OfficialDocumentReceivedHandle::getOfficialDocumentReceivedId, officialDocumentReceived.getId())
+                        .orderByAsc(OfficialDocumentReceivedHandle::getCreateDate)
+        );
+        if(!userList.isEmpty()){
+            List<String> collect = userList.stream().map(User::getName).collect(Collectors.toList());
+            bean.setReceiveUserNames(collect.toString().replace("[", "").replace("]", "").replace(", ", ">"));
+        }
+
+        long count = officialDocumentReceivedHandleService.count(
+                new QueryWrapper<OfficialDocumentReceivedHandle>().lambda()
+                        .eq(OfficialDocumentReceivedHandle::getOfficialDocumentReceivedId, officialDocumentReceived.getId())
+                        .eq(OfficialDocumentReceivedHandle::getCreateUserId, StpUtil.getLoginIdAsLong())
+        );
+        if(count > 0){
+            bean.setIsTransfer(1);
+        }else{
+            bean.setIsTransfer(0);
+        }
+
+        return RT.ok(bean);
     }
 
 

+ 25 - 0
src/main/java/com/xjrsoft/module/oa/vo/OfficialDocumentReceivedVo.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.oa.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.time.LocalDateTime;
 import java.util.Date;
 
 /**
@@ -75,5 +76,29 @@ public class OfficialDocumentReceivedVo {
     @ApiModelProperty("附件文件id")
     private Long fileId;
 
+    @ApiModelProperty("是否已落实")
+    private Integer isHandle;
+
+    @ApiModelProperty("落实时间")
+    private LocalDateTime handleTime;
+
+    @ApiModelProperty("落实人")
+    private Long handleUserId;
+
+    @ApiModelProperty("落实负责人")
+    private Long handleDutyUserId;
+
+    @ApiModelProperty("收文类型-中文")
+    private String receivedTypeCn;
+
+    @ApiModelProperty("落实负责人")
+    private String handleDutyUserName;
+
+    @ApiModelProperty("转办人")
+    private String receiveUserNames;
+
+    @ApiModelProperty("是否转办(0:否 1:是)")
+    private Integer isTransfer;
+
 
 }

+ 34 - 17
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -55,9 +55,12 @@ import com.xjrsoft.module.teacher.entity.BaseTeacherRegular;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.workflow.constant.WorkflowConstant;
 import com.xjrsoft.module.workflow.entity.WorkflowCirculated;
+import com.xjrsoft.module.workflow.entity.WorkflowExtra;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import com.xjrsoft.module.workflow.entity.WorkflowSchema;
 import com.xjrsoft.module.workflow.service.IWorkflowCirculatedService;
 import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
+import com.xjrsoft.module.workflow.service.IWorkflowExtraService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -72,6 +75,7 @@ import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
+import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
@@ -120,6 +124,8 @@ public class UserController {
     private final IWorkflowCirculatedService circulatedService;
     private final IBaseNewStudentService baseNewStudentService;
 
+    private final IWorkflowExtraService workflowExtraService;
+
     @GetMapping(value = "/list")
     @ApiOperation(value = "用户列表(不分页)")
     @XjrLog(value = "用户列表(不分页)")
@@ -417,24 +423,35 @@ public class UserController {
         PendingCountDto pendingCountDto = new PendingCountDto();
         pendingCountDto.setWfPendingCount(workflowExecuteService.pendingCount());
 
-        HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
-                .variableValueEquals(WorkflowConstant.PROCESS_START_USER_ID_KEY, StpUtil.getLoginIdAsLong())
-                .variableValueEquals(WorkflowConstant.PROCESS_ISRECYCLE_FLAG_KEY, WorkflowIsRecycleType.NO.getCode());
-        List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.orderByProcessInstanceStartTime().desc().list();
-
-        //获取到所有流程id
-        int myApplicationCount = 0;
-        for (HistoricProcessInstance historicProcessInstance : historicProcessInstances) {
-            Long countByProcessId = workflowExecuteService.getCountByProcessId(historicProcessInstance.getId());
-            if (countByProcessId == 0L) {
-                continue;
+        List<WorkflowExtra> extraList = workflowExtraService.list(
+                new MPJLambdaWrapper<WorkflowExtra>()
+                        .select(WorkflowExtra::getId)
+                        .select(WorkflowExtra.class, x -> VoToColumnUtil.fieldsToColumns(WorkflowExtra.class).contains(x.getProperty()))
+                        .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getProcessId, WorkflowExtra::getProcessId)
+                        .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_ACTIVE)
+                        .eq(WorkflowExtra::getStartUserId, StpUtil.getLoginIdAsLong())
+                        .isNull(WorkflowFormRelation::getEndTime)
+        );
+        Set<String> processIdSet = extraList.stream().map(WorkflowExtra::getProcessId).collect(Collectors.toSet());
 
-            }
-            if (!ObjectUtil.isNotNull(historicProcessInstance.getEndTime())) {
-                myApplicationCount++;
-            }
-        }
-        pendingCountDto.setMyApplicationCount(myApplicationCount);
+//        HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
+//                .variableValueEquals(WorkflowConstant.PROCESS_START_USER_ID_KEY, StpUtil.getLoginIdAsLong())
+//                .variableValueEquals(WorkflowConstant.PROCESS_ISRECYCLE_FLAG_KEY, WorkflowIsRecycleType.NO.getCode());
+//        List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.orderByProcessInstanceStartTime().desc().list();
+//
+//        //获取到所有流程id
+//        int myApplicationCount = 0;
+//        for (HistoricProcessInstance historicProcessInstance : historicProcessInstances) {
+//            Long countByProcessId = workflowExecuteService.getCountByProcessId(historicProcessInstance.getId());
+//            if (countByProcessId == 0L) {
+//                continue;
+//
+//            }
+//            if (!ObjectUtil.isNotNull(historicProcessInstance.getEndTime())) {
+//                myApplicationCount++;
+//            }
+//        }
+        pendingCountDto.setMyApplicationCount(processIdSet.size());
 
         long circulatedCount = circulatedService.count(
                 MPJWrappers.<WorkflowCirculated>lambdaJoin()

+ 11 - 16
src/main/java/com/xjrsoft/module/personnel/service/impl/CarMessageApplyServiceImpl.java

@@ -4,16 +4,13 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.module.hikvision.entity.HikvisionData;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.ApiUtil;
 import com.xjrsoft.module.personnel.dto.AddCarMessageApplyDto;
-import com.xjrsoft.module.personnel.dto.UpdateCarMessageApplyDto;
 import com.xjrsoft.module.personnel.entity.CarMessageApply;
 import com.xjrsoft.module.personnel.mapper.CarMessageApplyMapper;
 import com.xjrsoft.module.personnel.service.ICarMessageApplyService;
@@ -21,8 +18,6 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.time.LocalDateTime;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -59,17 +54,17 @@ public class CarMessageApplyServiceImpl extends MPJBaseServiceImpl<CarMessageApp
         String apiUrl = "/api/resource/v1/vehicle/batch/delete";
         String result = apiUtil.doPost(apiUrl, paramJson.toString(), null);
 
-        JsonParser parser = new JsonParser();
-        JsonObject resultJson = parser.parse(result).getAsJsonObject();
-        if (resultJson.get("code").getAsInt() == 0 && !resultJson.get("data").isJsonNull()) {
-            JsonArray data = resultJson.get("data").getAsJsonArray();
-            for (JsonElement datum : data) {
-                JsonObject object = datum.getAsJsonObject();
-                idsMap.remove(object.get("vehicleId").getAsString());
-            }
-            Collection<String> values = idsMap.values();
-//            this.removeBatchByIds(values); 远程没有数据
-        }
+//        JsonParser parser = new JsonParser();
+//        JsonObject resultJson = parser.parse(result).getAsJsonObject();
+//        if ("0".equals(resultJson.get("code").getAsString()) && !resultJson.get("data").isJsonNull()) {
+//            JsonArray data = resultJson.get("data").getAsJsonArray();
+//            for (JsonElement datum : data) {
+//                JsonObject object = datum.getAsJsonObject();
+//                idsMap.remove(object.get("vehicleId").getAsString());
+//            }
+//            Collection<String> values = idsMap.values();
+////            this.removeBatchByIds(values); 远程没有数据
+//        }
 //        else{
         this.removeBatchByIds(ids);
 //        }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentSchoolRollMapper.java

@@ -68,5 +68,8 @@ public interface BaseStudentSchoolRollMapper extends MPJBaseMapper<BaseStudentSc
 
     List<BaseStudentInfoPageVo> getStudyingList(BaseStudentInfoPageDto dto);
 
+    @Update("UPDATE base_student_school_roll SET archives_status = 'FB2901', delete_mark = 0, enabled_mark = 1, modify_user_id = #{modifyUserId}, modify_date = now() where id = #{id}")
+    Boolean activateStudentSchoolRoll(@Param("id") Long id, @Param("modifyUserId") Long modifyUserId);
+
 }
 

+ 1 - 6
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -318,12 +318,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                         .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
                         .eq(BaseStudentSchoolRoll::getUserId, userId)
         );
-        schoolRoll.setDeleteMark(DeleteMark.NODELETE.getCode());
-        schoolRoll.setEnabledMark(EnabledMark.ENABLED.getCode());
-        schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
-        schoolRoll.setModifyUserId(modifyUserId);
-        schoolRoll.setModifyDate(LocalDateTime.now());
-        this.updateById(schoolRoll);
+        this.baseMapper.activateStudentSchoolRoll(schoolRoll.getId(), modifyUserId);
 
         //将学生基本信息中状态改为正常
         BaseStudent baseStudent = baseStudentMapper.selectOne(

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -440,7 +440,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
                 if(student.getScore() != null){
                     schoolRoll.setGraduatedScore(student.getScore().doubleValue());
                 }
-
+                schoolRoll.setInternshipState("IT_0001");
                 schoolRoll.setGraduatedUniversity(student.getGraduateSchool());
                 schoolRoll.setClassId(baseClass.getId());
                 schoolRoll.setMajorSetId(baseClass.getMajorSetId());

+ 4 - 0
src/test/java/com/xjrsoft/module/job/BaseNewStudentTaskTest.java

@@ -35,8 +35,10 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 import static org.junit.jupiter.api.Assertions.*;
@@ -141,6 +143,8 @@ class BaseNewStudentTaskTest {
         );
         Map<String, Long> majorSetNameMap = majorSetList.stream().collect(Collectors.toMap(BaseMajorSet::getName, BaseMajorSet::getId));
 
+        Set<String> insCredentialNumber = new HashSet<>();
+
         //循环攀宝的数据,准备更新到新生表中
         List<BaseNewStudent> updateList = new ArrayList<>();
         List<BaseNewStudent> insertList = new ArrayList<>();

+ 73 - 8
src/test/java/com/xjrsoft/module/job/HikvisionBaseDataTaskTest.java

@@ -166,16 +166,16 @@ class HikvisionBaseDataTaskTest {
 
 
         tableName = "base_class";
-        Map<String, String> baseClass = dataMap.get(tableName);
-        Map<String, String> classes = dataUtil.insertClass(tableName, baseClass);
+//        Map<String, String> baseClass = dataMap.get(tableName);
+//        Map<String, String> classes = dataUtil.insertClass(tableName, baseClass);
 
 
-//        tableName = "base_student";
-//        List<HikvisionData> studentList = hikvisionDataMapper.selectList(
-//                new QueryWrapper<HikvisionData>().lambda().eq(HikvisionData::getTableName, tableName)
-//        );
-//        Map<String, String> baseStudent = dataMap.get(tableName);
-//        insertStudentOne(tableName, baseStudent, studentList);
+        tableName = "base_student";
+        List<HikvisionData> studentList = hikvisionDataMapper.selectList(
+                new QueryWrapper<HikvisionData>().lambda().eq(HikvisionData::getTableName, tableName)
+        );
+        Map<String, String> baseStudent = dataMap.get(tableName);
+        insertStudentOne(tableName, baseStudent, studentList);
 //        sql = "SELECT * FROM wf_room_applicant WHERE delete_mark = 0 AND STATUS = 1";
 //        List<Map<String, Object>> wfRoomApplicantList = SqlRunnerAdapter.db().selectList(sql);
 //
@@ -686,4 +686,69 @@ class HikvisionBaseDataTaskTest {
         }
     }
 
+
+    @Test
+    void selecAllStudent() throws SQLException {
+        ApiUtil apiUtil = new ApiUtil();
+        String apiPath = "/api/resource/v2/person/orgIndexCode/personList";
+        String sql = "SELECT CONCAT(t1.id, '-', REPLACE(t2.title,'年',''), '-', t1.class_type,'-FB3001') as id FROM base_class t1" +
+                " INNER JOIN base_grade t2 ON t1.grade_id = t2.id" +
+                " WHERE t1.delete_mark = 0 AND t1.is_graduate = 1 and t2.id = 1868532405673439232";
+        List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
+        for (Map<String, Object> objectMap : list) {
+            JsonObject jsonObject = new JsonObject();
+            jsonObject.addProperty("pageNo", 1);
+            jsonObject.addProperty("pageSize", 500);
+            jsonObject.addProperty("orgIndexCode", objectMap.get("id").toString());
+
+            String result = apiUtil.doPost(apiPath, jsonObject.toString(), null, null);
+
+            JsonParser jsonParser = new JsonParser();
+            JsonObject resultJson = jsonParser.parse(result).getAsJsonObject();
+            JsonArray array = resultJson.get("data").getAsJsonObject().get("list").getAsJsonArray();
+            Map<Long, String> idMap = new HashMap<>();
+            for (JsonElement jsonElement : array) {
+                JsonObject element = jsonElement.getAsJsonObject();
+                if(!element.has("phoneNo") || element.get("phoneNo").isJsonNull()){
+                    System.out.println(element.toString());
+                    continue;
+                }
+                String personId = element.get("personId").getAsString();
+                String insSql = "INSERT INTO hikvision_data(create_date,TABLE_NAME,source_id,hikvision_id) " +
+                        "SELECT NOW(),'base_student', '" + personId + "','" + personId + "' WHERE NOT EXISTS (SELECT 1 FROM hikvision_data WHERE hikvision_id = '" + personId + "')";
+                SqlRunnerAdapter.db().insert(insSql);
+            }
+        }
+
+        sql = "SELECT CONCAT(t1.id, '-', REPLACE(t2.title,'年',''), '-', t1.class_type,'-FB3003') as id FROM base_class t1" +
+                " INNER JOIN base_grade t2 ON t1.grade_id = t2.id" +
+                " WHERE t1.delete_mark = 0 AND t1.is_graduate = 1 and t2.id = 1868532405673439232";
+        list = SqlRunnerAdapter.db().selectList(sql);
+        for (Map<String, Object> objectMap : list) {
+            JsonObject jsonObject = new JsonObject();
+            jsonObject.addProperty("pageNo", 1);
+            jsonObject.addProperty("pageSize", 500);
+            jsonObject.addProperty("orgIndexCode", objectMap.get("id").toString());
+
+            String result = apiUtil.doPost(apiPath, jsonObject.toString(), null, null);
+
+            JsonParser jsonParser = new JsonParser();
+            JsonObject resultJson = jsonParser.parse(result).getAsJsonObject();
+            JsonArray array = resultJson.get("data").getAsJsonObject().get("list").getAsJsonArray();
+            Map<Long, String> idMap = new HashMap<>();
+            for (JsonElement jsonElement : array) {
+                JsonObject element = jsonElement.getAsJsonObject();
+                if(!element.has("phoneNo") || element.get("phoneNo").isJsonNull()){
+                    System.out.println(element.toString());
+                    continue;
+                }
+                String personId = element.get("personId").getAsString();
+                String insSql = "INSERT INTO hikvision_data(create_date,TABLE_NAME,source_id,hikvision_id) " +
+                        "SELECT NOW(),'base_student', '" + personId + "','" + personId + "' WHERE NOT EXISTS (SELECT 1 FROM teacher_out_in_record WHERE hikvision_id = '" + personId + "')";
+                SqlRunnerAdapter.db().insert(insSql);
+            }
+        }
+
+    }
+
 }

+ 5 - 23
src/test/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNodeTest.java

@@ -43,28 +43,10 @@ class ImportStudentFaceNodeTest {
     void test(){
         String sql = "SELECT t1.* FROM xjr_user t1\n" +
                 "WHERE t1.delete_mark = 0 \n" +
-                "AND t1.credential_number IN (\n" +
-                "\tSELECT t3.credential_number\n" +
-                "        FROM student_report_record t1\n" +
-                "        INNER JOIN base_new_student t3 ON t3.id = t1.user_id\n" +
-                "        LEFT JOIN banding_task_class_student t2 ON t1.user_id = t2.new_student_id AND t2.delete_mark = 0\n" +
-                "        LEFT JOIN banding_task_class t5 ON t2.banding_task_class_id = t5.id\n" +
-                "        LEFT JOIN xjr_user t6 ON t5.teacher_id = t6.id\n" +
-                "        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code AND t7.delete_mark = 0\n" +
-                "        LEFT JOIN xjr_dictionary_detail t8 ON t3.source = t8.code AND t8.delete_mark = 0\n" +
-                "        LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code AND t9.delete_mark = 0\n" +
-                "        LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id\n" +
-                "        LEFT JOIN enrollment_plan t11 ON t11.id = t3.enrollment_plan_id\n" +
-                "        LEFT JOIN base_grade t4 ON t11.grade_id = t4.id\n" +
-                "        LEFT JOIN student_report_plan t12 ON t12.id = t1.student_report_plan_id\n" +
-                "        LEFT JOIN base_major_set t13 ON t13.id = t5.major_set_id\n" +
-                "        LEFT JOIN xjr_dictionary_detail t14 ON t5.class_type = t14.code AND t14.delete_mark = 0\n" +
-                "        LEFT JOIN xjr_department t15 ON t15.id = t13.department_id\n" +
-                "        WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1\n" +
-                "        AND t12.status IN(1,2)\n" +
-                "        AND t3.enrollment_plan_id = 1897950348853186562\n" +
-                "        AND t12.category = 2\n" +
-                "        AND t1.report_time IS NOT NULL\n" +
+                "AND t1.id IN (" +
+                " SELECT user_id FROM stundent_face_process WHERE create_date > '2025-05-05 0:00:00'\n" +
+                "AND hikvision_result LIKE '%{\"code\":\"0x%'\n" +
+                "AND exam_status = 1" +
                 ")";
         List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
 
@@ -107,7 +89,7 @@ class ImportStudentFaceNodeTest {
                 if(dataJson.get("total").getAsInt() > 0){
                     JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
                             .getAsJsonObject().get("personPhoto").getAsJsonArray();
-                    if(personPhoto.size() != 0){
+                    if(personPhoto.size() == 0){
                         dataObj.setStatus(1);
                         dataObj.setExamStatus(1);
                         String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());