Browse Source

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

fanxp 1 week ago
parent
commit
e5cdb3202e
19 changed files with 322 additions and 31 deletions
  1. 35 1
      src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskAssignServiceImpl.java
  2. 3 0
      src/main/java/com/xjrsoft/module/personnel/dto/BasePersonnelLabourCapitalMonthPageDto.java
  3. 6 0
      src/main/java/com/xjrsoft/module/personnel/dto/BasePersonnelLabourCapitalYearPageDto.java
  4. 31 21
      src/main/java/com/xjrsoft/module/personnel/service/impl/BasePersonnelLabourCapitalServiceImpl.java
  5. 1 1
      src/main/java/com/xjrsoft/module/personnel/vo/BasePersonnelLabourCapitalMonthPageVo.java
  6. 3 3
      src/main/java/com/xjrsoft/module/personnel/vo/BasePersonnelLabourCapitalYearPageVo.java
  7. 76 0
      src/main/java/com/xjrsoft/module/teacher/controller/TeacherAwardController.java
  8. 22 0
      src/main/java/com/xjrsoft/module/teacher/dto/TeacherAwardFileListDto.java
  9. 9 0
      src/main/java/com/xjrsoft/module/teacher/mapper/TeacherAwardItemMapper.java
  10. 4 0
      src/main/java/com/xjrsoft/module/teacher/service/ITeacherAwardItemService.java
  11. 7 0
      src/main/java/com/xjrsoft/module/teacher/service/ITeacherAwardService.java
  12. 6 0
      src/main/java/com/xjrsoft/module/teacher/service/impl/TeacherAwardItemServiceImpl.java
  13. 7 0
      src/main/java/com/xjrsoft/module/teacher/service/impl/TeacherAwardServiceImpl.java
  14. 28 0
      src/main/java/com/xjrsoft/module/teacher/vo/TeacherAwardFileListVo.java
  15. 40 0
      src/main/java/com/xjrsoft/module/teacher/vo/TeacherAwardStatisticsExcelVo.java
  16. 4 3
      src/main/resources/mapper/personnel/BasePersonnelLabourCapitalMapper.xml
  17. 1 1
      src/main/resources/mapper/student/BaseStudentMapper.xml
  18. 38 0
      src/main/resources/mapper/teacher/TeacherAwardItemMapper.xml
  19. 1 1
      src/test/java/com/xjrsoft/module/job/JianyuekbScheduleTaskTest2.java

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

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.material.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.base.MPJBaseServiceImpl;
@@ -13,10 +14,16 @@ import com.xjrsoft.module.material.mapper.MaterialTaskAppendixMapper;
 import com.xjrsoft.module.material.mapper.MaterialTaskAssignMapper;
 import com.xjrsoft.module.material.mapper.MaterialTaskMapper;
 import com.xjrsoft.module.material.service.IMaterialTaskAssignService;
+import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.organization.service.IWeChatService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.Optional;
 
@@ -26,6 +33,8 @@ public class MaterialTaskAssignServiceImpl extends MPJBaseServiceImpl<MaterialTa
     private final MaterialTaskAssignMapper materialTaskAssignMapper;
     private final MaterialTaskMapper materialTaskMapper;
     private final MaterialTaskAppendixMapper appendixMapper;
+    private final IWeChatService weChatService;
+    private final IUserService userService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -84,6 +93,7 @@ public class MaterialTaskAssignServiceImpl extends MPJBaseServiceImpl<MaterialTa
     @Transactional(rollbackFor = Exception.class)
     public Boolean approved(List<MaterialTaskAssignApprovedDto> dtos) {
         MaterialTask materialTask = null;
+        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
         for (MaterialTaskAssignApprovedDto dto : dtos) {
             MaterialTaskAssign materialTaskAssign = materialTaskAssignMapper.selectByIdDeep(dto.getId());
             if (materialTaskAssign != null && materialTaskAssign.getStatus() == 2) {
@@ -104,12 +114,36 @@ public class MaterialTaskAssignServiceImpl extends MPJBaseServiceImpl<MaterialTa
 //                        }
                     }
                     if (dto.getStatus() == 2) {//重做
-                        materialTaskAssign.setStatus(4);
+                        materialTaskAssign.setStatus(1);
 
                         appendixMapper.delete(
                                 new QueryWrapper<MaterialTaskAppendix>().lambda()
                                         .eq(MaterialTaskAppendix::getMaterialTaskId, materialTaskAssign.getId())
                         );
+
+                        User user = userService.getById(materialTaskAssign.getUserId());
+                        if(user.getOpenId() != null){
+                            WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
+                            weChatSendMessageDto.setUserId(user.getOpenId());
+                            weChatSendMessageDto.setTemplateId("qmpXORPM1Cocqn503Qa4On6BJhR92UZ00eod2-6IcGo");
+                            //weChatSendMessageDto.setUrl(StrUtil.format("{}/pages/message/notice/detail?id={}", commonPropertiesConfig.getDomainApp(), id));
+                            weChatSendMessageDto.setMsgId(materialTask.getId().toString());
+                            JSONObject data = new JSONObject();
+
+                            JSONObject data1 = new JSONObject();
+                            data1.put("value", materialTask.getName() + "提交材料被拒绝");
+                            data.put("thing23", data1);
+
+                            JSONObject data2 = new JSONObject();
+                            data2.put("value", user.getName());
+                            data.put("thing29", data2);
+
+                            JSONObject data3 = new JSONObject();
+                            data3.put("value", time);
+                            data.put("time17", data3);
+                            weChatSendMessageDto.setContent(data);
+                            weChatService.sendTemplateMessage(weChatSendMessageDto);
+                        }
                     }
 
                     materialTaskAssignMapper.updateById(materialTaskAssign);

+ 3 - 0
src/main/java/com/xjrsoft/module/personnel/dto/BasePersonnelLabourCapitalMonthPageDto.java

@@ -19,4 +19,7 @@ public class BasePersonnelLabourCapitalMonthPageDto extends PageInput {
 
     @ApiModelProperty("月份")
     public int month;
+
+    @ApiModelProperty("工号")
+    public String jobNumber;
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/personnel/dto/BasePersonnelLabourCapitalYearPageDto.java

@@ -19,4 +19,10 @@ public class BasePersonnelLabourCapitalYearPageDto extends PageInput {
 
     @ApiModelProperty("发放项目")
     public String project;
+
+    @ApiModelProperty("工号")
+    public String jobNumber;
+
+    @ApiModelProperty("姓名")
+    public String name;
 }

+ 31 - 21
src/main/java/com/xjrsoft/module/personnel/service/impl/BasePersonnelLabourCapitalServiceImpl.java

@@ -1,10 +1,13 @@
 package com.xjrsoft.module.personnel.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.personnel.dto.BasePersonnelLabourCapitalMonthPageDto;
 import com.xjrsoft.module.personnel.dto.BasePersonnelLabourCapitalYearPageDto;
 import com.xjrsoft.module.personnel.entity.BasePersonnelLabourCapital;
@@ -35,14 +38,18 @@ import java.util.stream.Collectors;
 @Service
 @AllArgsConstructor
 public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<BasePersonnelLabourCapitalMapper, BasePersonnelLabourCapital> implements IBasePersonnelLabourCapitalService {
-    private final BasePersonnelLabourCapitalMapper basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper;
+    private final BasePersonnelLabourCapitalMapper labourCapitalMapper;
 
-    private final BasePersonnelLabourCapitalDataMapper basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper;
-    private final BasePersonnelLabourCapitalTitleMapper basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper;
+    private final BasePersonnelLabourCapitalDataMapper capitalDataMapper;
+    private final BasePersonnelLabourCapitalTitleMapper capitalTitleMapper;
+    private final IUserService userService;
 
     @Override
     public Page<BasePersonnelLabourCapitalMonthPageVo> getMonthPage(Page<BasePersonnelLabourCapitalMonthPageDto> page, BasePersonnelLabourCapitalMonthPageDto dto) {
-        Page<BasePersonnelLabourCapitalMonthPageVo> resultPage = basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper.getMonthPage(page, dto);
+        long userId = StpUtil.getLoginIdAsLong();
+        User user = userService.getById(userId);
+        dto.setJobNumber(user.getUserName());
+        Page<BasePersonnelLabourCapitalMonthPageVo> resultPage = labourCapitalMapper.getMonthPage(page, dto);
 
         for (BasePersonnelLabourCapitalMonthPageVo record : resultPage.getRecords()) {
             JSONObject extendJsonObj = JSON.parseObject(record.getPendingJson());
@@ -63,11 +70,14 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
 
     @Override
     public Page<BasePersonnelLabourCapitalYearPageVo> getYearPage(Page<BasePersonnelLabourCapitalYearPageDto> page, BasePersonnelLabourCapitalYearPageDto dto) {
-        return basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper.getYearPage(page, dto);
+        long userId = StpUtil.getLoginIdAsLong();
+        User user = userService.getById(userId);
+        dto.setJobNumber(user.getUserName());
+        return labourCapitalMapper.getYearPage(page, dto);
     }
 
     private String getBpName(String columnNumber) {
-        List<BasePersonnelLabourCapitalTitle> bpTitles = basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.selectList(Wrappers.<BasePersonnelLabourCapitalTitle>lambdaQuery().eq(BasePersonnelLabourCapitalTitle::getColumnNumber, columnNumber));
+        List<BasePersonnelLabourCapitalTitle> bpTitles = capitalTitleMapper.selectList(Wrappers.<BasePersonnelLabourCapitalTitle>lambdaQuery().eq(BasePersonnelLabourCapitalTitle::getColumnNumber, columnNumber));
         if (bpTitles != null && !bpTitles.isEmpty()) {
             return bpTitles.get(0).getName();
         } else {
@@ -78,14 +88,14 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean add(BasePersonnelLabourCapital basePersonnelLabourCapital) {
-        basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper.insert(basePersonnelLabourCapital);
+        labourCapitalMapper.insert(basePersonnelLabourCapital);
         for (BasePersonnelLabourCapitalData basePersonnelLabourCapitalData : basePersonnelLabourCapital.getBasePersonnelLabourCapitalDataList()) {
             basePersonnelLabourCapitalData.setLabourCapitalId(basePersonnelLabourCapital.getId());
-            basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.insert(basePersonnelLabourCapitalData);
+            capitalDataMapper.insert(basePersonnelLabourCapitalData);
         }
         for (BasePersonnelLabourCapitalTitle basePersonnelLabourCapitalTitle : basePersonnelLabourCapital.getBasePersonnelLabourCapitalTitleList()) {
             basePersonnelLabourCapitalTitle.setLabourCapitalId(basePersonnelLabourCapital.getId());
-            basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.insert(basePersonnelLabourCapitalTitle);
+            capitalTitleMapper.insert(basePersonnelLabourCapitalTitle);
         }
 
         return true;
@@ -94,11 +104,11 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean update(BasePersonnelLabourCapital basePersonnelLabourCapital) {
-        basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper.updateById(basePersonnelLabourCapital);
+        labourCapitalMapper.updateById(basePersonnelLabourCapital);
         //********************************* BasePersonnelLabourCapitalData  增删改  开始 *******************************************/
         {
             // 查出所有子级的id
-            List<BasePersonnelLabourCapitalData> basePersonnelLabourCapitalDataList = basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.selectList(Wrappers.lambdaQuery(BasePersonnelLabourCapitalData.class).eq(BasePersonnelLabourCapitalData::getLabourCapitalId, basePersonnelLabourCapital.getId()).select(BasePersonnelLabourCapitalData::getId));
+            List<BasePersonnelLabourCapitalData> basePersonnelLabourCapitalDataList = capitalDataMapper.selectList(Wrappers.lambdaQuery(BasePersonnelLabourCapitalData.class).eq(BasePersonnelLabourCapitalData::getLabourCapitalId, basePersonnelLabourCapital.getId()).select(BasePersonnelLabourCapitalData::getId));
             List<Long> basePersonnelLabourCapitalDataIds = basePersonnelLabourCapitalDataList.stream().map(BasePersonnelLabourCapitalData::getId).collect(Collectors.toList());
             //原有子表单 没有被删除的主键
             List<Long> basePersonnelLabourCapitalDataOldIds = basePersonnelLabourCapital.getBasePersonnelLabourCapitalDataList().stream().map(BasePersonnelLabourCapitalData::getId).filter(Objects::nonNull).collect(Collectors.toList());
@@ -108,18 +118,18 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
             for (BasePersonnelLabourCapitalData basePersonnelLabourCapitalData : basePersonnelLabourCapital.getBasePersonnelLabourCapitalDataList()) {
                 //如果不等于空则修改
                 if (basePersonnelLabourCapitalData.getId() != null) {
-                    basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.updateById(basePersonnelLabourCapitalData);
+                    capitalDataMapper.updateById(basePersonnelLabourCapitalData);
                 }
                 //如果等于空 则新增
                 else {
                     //已经不存在的id 删除
                     basePersonnelLabourCapitalData.setLabourCapitalId(basePersonnelLabourCapital.getId());
-                    basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.insert(basePersonnelLabourCapitalData);
+                    capitalDataMapper.insert(basePersonnelLabourCapitalData);
                 }
             }
             //已经不存在的id 删除
             if(basePersonnelLabourCapitalDataRemoveIds.size() > 0){
-                basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.deleteBatchIds(basePersonnelLabourCapitalDataRemoveIds);
+                capitalDataMapper.deleteBatchIds(basePersonnelLabourCapitalDataRemoveIds);
             }
         }
         //********************************* BasePersonnelLabourCapitalData  增删改  结束 *******************************************/
@@ -127,7 +137,7 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
         //********************************* BasePersonnelLabourCapitalTitle  增删改  开始 *******************************************/
         {
             // 查出所有子级的id
-            List<BasePersonnelLabourCapitalTitle> basePersonnelLabourCapitalTitleList = basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.selectList(Wrappers.lambdaQuery(BasePersonnelLabourCapitalTitle.class).eq(BasePersonnelLabourCapitalTitle::getLabourCapitalId, basePersonnelLabourCapital.getId()).select(BasePersonnelLabourCapitalTitle::getId));
+            List<BasePersonnelLabourCapitalTitle> basePersonnelLabourCapitalTitleList = capitalTitleMapper.selectList(Wrappers.lambdaQuery(BasePersonnelLabourCapitalTitle.class).eq(BasePersonnelLabourCapitalTitle::getLabourCapitalId, basePersonnelLabourCapital.getId()).select(BasePersonnelLabourCapitalTitle::getId));
             List<Long> basePersonnelLabourCapitalTitleIds = basePersonnelLabourCapitalTitleList.stream().map(BasePersonnelLabourCapitalTitle::getId).collect(Collectors.toList());
             //原有子表单 没有被删除的主键
             List<Long> basePersonnelLabourCapitalTitleOldIds = basePersonnelLabourCapital.getBasePersonnelLabourCapitalTitleList().stream().map(BasePersonnelLabourCapitalTitle::getId).filter(Objects::nonNull).collect(Collectors.toList());
@@ -137,18 +147,18 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
             for (BasePersonnelLabourCapitalTitle basePersonnelLabourCapitalTitle : basePersonnelLabourCapital.getBasePersonnelLabourCapitalTitleList()) {
                 //如果不等于空则修改
                 if (basePersonnelLabourCapitalTitle.getId() != null) {
-                    basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.updateById(basePersonnelLabourCapitalTitle);
+                    capitalTitleMapper.updateById(basePersonnelLabourCapitalTitle);
                 }
                 //如果等于空 则新增
                 else {
                     //已经不存在的id 删除
                     basePersonnelLabourCapitalTitle.setLabourCapitalId(basePersonnelLabourCapital.getId());
-                    basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.insert(basePersonnelLabourCapitalTitle);
+                    capitalTitleMapper.insert(basePersonnelLabourCapitalTitle);
                 }
             }
             //已经不存在的id 删除
             if(basePersonnelLabourCapitalTitleRemoveIds.size() > 0){
-                basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.deleteBatchIds(basePersonnelLabourCapitalTitleRemoveIds);
+                capitalTitleMapper.deleteBatchIds(basePersonnelLabourCapitalTitleRemoveIds);
             }
         }
         //********************************* BasePersonnelLabourCapitalTitle  增删改  结束 *******************************************/
@@ -159,9 +169,9 @@ public class BasePersonnelLabourCapitalServiceImpl extends MPJBaseServiceImpl<Ba
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean delete(List<Long> ids) {
-        basePersonnelLabourCapitalBasePersonnelLabourCapitalMapper.deleteBatchIds(ids);
-        basePersonnelLabourCapitalBasePersonnelLabourCapitalDataMapper.delete(Wrappers.lambdaQuery(BasePersonnelLabourCapitalData.class).in(BasePersonnelLabourCapitalData::getLabourCapitalId, ids));
-        basePersonnelLabourCapitalBasePersonnelLabourCapitalTitleMapper.delete(Wrappers.lambdaQuery(BasePersonnelLabourCapitalTitle.class).in(BasePersonnelLabourCapitalTitle::getLabourCapitalId, ids));
+        labourCapitalMapper.deleteBatchIds(ids);
+        capitalDataMapper.delete(Wrappers.lambdaQuery(BasePersonnelLabourCapitalData.class).in(BasePersonnelLabourCapitalData::getLabourCapitalId, ids));
+        capitalTitleMapper.delete(Wrappers.lambdaQuery(BasePersonnelLabourCapitalTitle.class).in(BasePersonnelLabourCapitalTitle::getLabourCapitalId, ids));
 
         return true;
     }

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/vo/BasePersonnelLabourCapitalMonthPageVo.java

@@ -33,7 +33,7 @@ public class BasePersonnelLabourCapitalMonthPageVo {
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("总计")
     @ApiModelProperty("总计")
-    private float amount;
+    private String amount;
 
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("待处理json")

+ 3 - 3
src/main/java/com/xjrsoft/module/personnel/vo/BasePersonnelLabourCapitalYearPageVo.java

@@ -41,15 +41,15 @@ public class BasePersonnelLabourCapitalYearPageVo {
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("金额")
     @ApiModelProperty("金额")
-    private float amount;
+    private String amount;
 
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("月金额")
     @ApiModelProperty("月金额")
-    private float monthAmount;
+    private String monthAmount;
 
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("年金额")
     @ApiModelProperty("年金额")
-    private float yearAmount;
+    private String yearAmount;
 }

+ 76 - 0
src/main/java/com/xjrsoft/module/teacher/controller/TeacherAwardController.java

@@ -1,14 +1,19 @@
 package com.xjrsoft.module.teacher.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.FileZipUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.system.service.IFileService;
 import com.xjrsoft.module.teacher.dto.TeacherAwardDetailPageDto;
+import com.xjrsoft.module.teacher.dto.TeacherAwardFileListDto;
 import com.xjrsoft.module.teacher.dto.TeacherAwardStatisticsPageDto;
 import com.xjrsoft.module.teacher.entity.TeacherAward;
 import com.xjrsoft.module.teacher.entity.TeacherAwardItem;
@@ -16,15 +21,31 @@ import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.service.ITeacherAwardItemService;
 import com.xjrsoft.module.teacher.service.ITeacherAwardService;
 import com.xjrsoft.module.teacher.vo.TeacherAwardDetailPageVo;
+import com.xjrsoft.module.teacher.vo.TeacherAwardFileListVo;
+import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsExcelVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
 * @title: 教师奖项
@@ -43,6 +64,8 @@ public class TeacherAwardController {
 
     private final ITeacherAwardService teacherAwardService;
 
+    private final IFileService fileService;
+
     @GetMapping(value = "/statistics-page")
     @ApiOperation(value="教师获奖统计")
     @SaCheckPermission("teacheraward:detail")
@@ -77,4 +100,57 @@ public class TeacherAwardController {
         PageOutput<TeacherAwardDetailPageVo> pageOutput = ConventPage.getPageOutput(page, TeacherAwardDetailPageVo.class);
         return RT.ok(pageOutput);
     }
+
+    @PostMapping(value = "/export-query")
+    @ApiOperation(value="导出")
+    @SaCheckPermission("teacheraward:detail")
+    public ResponseEntity<byte[]> exportQuery(@Valid @RequestBody TeacherAwardStatisticsPageDto dto){
+        List<TeacherAwardStatisticsPageVo> list = teacherAwardItemService.getStatisticsList(dto);
+        Map<Long, String> userMap = list.stream().collect(Collectors.toMap(TeacherAwardStatisticsPageVo::getId, TeacherAwardStatisticsPageVo::getName));
+
+
+        List<Long> userIds = list.stream().map(TeacherAwardStatisticsPageVo::getId).collect(Collectors.toList());
+        TeacherAwardFileListDto listDto = new TeacherAwardFileListDto();
+        listDto.setApplicantUserIds(userIds);
+        List<TeacherAwardFileListVo> awardList = teacherAwardService.getAwardFileList(listDto);
+        Map<Long, List<TeacherAwardFileListVo>> filesMap = awardList.stream().collect(Collectors.groupingBy(TeacherAwardFileListVo::getApplicantUserId));
+
+        //声明一个Map,将所有文件装进去,map的key是完整的文件名
+        Map<String, byte[]> byteAryMap = new HashMap<>();
+
+        for (TeacherAwardStatisticsPageVo el : list) {
+            List<TeacherAwardFileListVo> fileList = filesMap.get(el.getId());
+
+            for (int i = 0; i < fileList.size(); i++) {
+                try {
+                    URL url = new URL(fileList.get(i).getFileUrl());
+                    URLConnection conn = url.openConnection();
+                    InputStream in = conn.getInputStream();
+                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+                    byte[] buffer = new byte[1024];
+                    int bytesRead;
+                    while ((bytesRead = in.read(buffer)) != -1) {
+                        outputStream.write(buffer, 0, bytesRead);
+                    }
+                    byte[] byteArray = outputStream.toByteArray();
+                    byteAryMap.put(el.getName() + "\\佐证材料" + (i + 1) + fileList.get(i).getFileType(), byteArray);
+                    in.close();
+                    outputStream.close();
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+
+
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, TeacherAwardStatisticsExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(list);
+        byteAryMap.put("教师获奖登记" + ExcelTypeEnum.XLSX.getValue(), bot.toByteArray());
+
+        byte[] bytes = FileZipUtil.byteAryMap2Zip(byteAryMap);
+        LocalDateTime now = LocalDateTime.now();
+        String timeStr = now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
+
+        return RT.fileStream(bytes, "教师获奖登记" + timeStr + ".zip");
+    }
 }

+ 22 - 0
src/main/java/com/xjrsoft/module/teacher/dto/TeacherAwardFileListDto.java

@@ -0,0 +1,22 @@
+package com.xjrsoft.module.teacher.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+
+/**
+* @title: 教师奖项分页查询入参
+* @Author dzx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class TeacherAwardFileListDto {
+
+    @ApiModelProperty("申请人ids")
+    private List<Long> applicantUserIds;
+}

+ 9 - 0
src/main/java/com/xjrsoft/module/teacher/mapper/TeacherAwardItemMapper.java

@@ -2,12 +2,17 @@ package com.xjrsoft.module.teacher.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.teacher.dto.TeacherAwardFileListDto;
 import com.xjrsoft.module.teacher.dto.TeacherAwardStatisticsPageDto;
 import com.xjrsoft.module.teacher.entity.TeacherAwardItem;
+import com.xjrsoft.module.teacher.vo.TeacherAwardFileListVo;
+import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsExcelVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
 * @title: 教师奖项
 * @Author dzx
@@ -18,4 +23,8 @@ import org.apache.ibatis.annotations.Param;
 public interface TeacherAwardItemMapper extends MPJBaseMapper<TeacherAwardItem> {
 
     Page<TeacherAwardStatisticsPageVo> getStatisticsPage(Page<TeacherAwardStatisticsPageVo> page, @Param("dto") TeacherAwardStatisticsPageDto dto);
+
+    List<TeacherAwardStatisticsPageVo> getStatisticsList(@Param("dto") TeacherAwardStatisticsPageDto dto);
+
+    List<TeacherAwardFileListVo> getAwardFileList(@Param("dto") TeacherAwardFileListDto dto);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/teacher/service/ITeacherAwardItemService.java

@@ -5,7 +5,9 @@ import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.teacher.dto.TeacherAwardStatisticsPageDto;
 import com.xjrsoft.module.teacher.entity.TeacherAwardItem;
 import com.xjrsoft.module.teacher.vo.TeacherAwardItemVo;
+import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsExcelVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -22,4 +24,6 @@ public interface ITeacherAwardItemService extends MPJBaseService<TeacherAwardIte
 
     List<TeacherAwardItemVo> getTeacherAwardItemTree(Integer isThesis);
 
+    List<TeacherAwardStatisticsPageVo> getStatisticsList(@Param("dto") TeacherAwardStatisticsPageDto dto);
+
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/teacher/service/ITeacherAwardService.java

@@ -1,7 +1,12 @@
 package com.xjrsoft.module.teacher.service;
 
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.teacher.dto.TeacherAwardFileListDto;
 import com.xjrsoft.module.teacher.entity.TeacherAward;
+import com.xjrsoft.module.teacher.vo.TeacherAwardFileListVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
 * @title: 教师获奖登记
@@ -18,4 +23,6 @@ public interface ITeacherAwardService extends MPJBaseService<TeacherAward> {
      * @return
      */
     Boolean dataHandleAddTeacherAwardNode(Long dataId);
+
+    List<TeacherAwardFileListVo> getAwardFileList(TeacherAwardFileListDto dto);
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/teacher/service/impl/TeacherAwardItemServiceImpl.java

@@ -12,6 +12,7 @@ import com.xjrsoft.module.teacher.mapper.TeacherAwardItemMapper;
 import com.xjrsoft.module.teacher.service.ITeacherAwardItemService;
 import com.xjrsoft.module.teacher.vo.TeacherAwardItemPageVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardItemVo;
+import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsExcelVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
@@ -48,4 +49,9 @@ public class TeacherAwardItemServiceImpl extends MPJBaseServiceImpl<TeacherAward
         return TreeUtil.build(itemVos);
     }
 
+    @Override
+    public List<TeacherAwardStatisticsPageVo> getStatisticsList(TeacherAwardStatisticsPageDto dto) {
+        return this.baseMapper.getStatisticsList(dto);
+    }
+
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/teacher/service/impl/TeacherAwardServiceImpl.java

@@ -4,11 +4,13 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.teacher.dto.TeacherAwardFileListDto;
 import com.xjrsoft.module.teacher.entity.TeacherAward;
 import com.xjrsoft.module.teacher.entity.TeacherAwardItem;
 import com.xjrsoft.module.teacher.mapper.TeacherAwardItemMapper;
 import com.xjrsoft.module.teacher.mapper.TeacherAwardMapper;
 import com.xjrsoft.module.teacher.service.ITeacherAwardService;
+import com.xjrsoft.module.teacher.vo.TeacherAwardFileListVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardItemPageVo;
 import com.xjrsoft.module.teacher.vo.TeacherAwardItemVo;
 import lombok.AllArgsConstructor;
@@ -68,6 +70,11 @@ public class TeacherAwardServiceImpl extends MPJBaseServiceImpl<TeacherAwardMapp
         return this.updateById(updateTeacherAward);
     }
 
+    @Override
+    public List<TeacherAwardFileListVo> getAwardFileList(TeacherAwardFileListDto dto) {
+        return teacherAwardItemMapper.getAwardFileList(dto);
+    }
+
     private List<TeacherAwardItemVo> findAncestors(List<TeacherAwardItemVo> itemVos, Long targetId) {
         List<TeacherAwardItemVo> ancestors = new ArrayList<>();
         Map<Long, TeacherAwardItemVo> itemMap = itemVos.stream()

+ 28 - 0
src/main/java/com/xjrsoft/module/teacher/vo/TeacherAwardFileListVo.java

@@ -0,0 +1,28 @@
+package com.xjrsoft.module.teacher.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 教师奖项分页列表出参
+* @Author dzx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class TeacherAwardFileListVo {
+
+    @ApiModelProperty("用户id")
+    private Long applicantUserId;
+
+    @ApiModelProperty("文件名字")
+    private String fileName;
+
+    @ApiModelProperty("文件类型")
+    private String fileType;
+
+    @ApiModelProperty("文件路径")
+    private String fileUrl;
+
+}

+ 40 - 0
src/main/java/com/xjrsoft/module/teacher/vo/TeacherAwardStatisticsExcelVo.java

@@ -0,0 +1,40 @@
+package com.xjrsoft.module.teacher.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 教师奖项分页列表出参
+* @Author dzx
+* @Date: 2024-06-04
+* @Version 1.0
+*/
+@Data
+public class TeacherAwardStatisticsExcelVo {
+
+    @ExcelProperty("用户名")
+    @ApiModelProperty("用户名")
+    private String userName;
+
+    @ExcelProperty("姓名")
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ExcelProperty("编号")
+    @ApiModelProperty("编号")
+    private String code;
+
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别")
+    private String genderCn;
+
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ExcelProperty("分数")
+    @ApiModelProperty("分数")
+    private Double score;
+
+}

+ 4 - 3
src/main/resources/mapper/personnel/BasePersonnelLabourCapitalMapper.xml

@@ -22,6 +22,7 @@
         <if test="dto.year != null and dto.month != null">
             and YEAR(t.date_of_issue) = #{dto.year}
             and MONTH(t.date_of_issue) = #{dto.month}
+            and t1.job_number = #{dto.jobNumber}
         </if>
     </select>
 
@@ -33,8 +34,8 @@
             d.name as dept,
             month(t1.date_of_issue) as month,
             t.amount_to as amount,
-            SUM(t.amount_to) OVER (PARTITION BY t.create_user_id, MONTH(t1.date_of_issue)) as monthAmount,
-            (SELECT SUM(amount_to) FROM base_personnel_labour_capital_data WHERE name = t.name) as yearAmount
+            SUM(replace(t.amount_to,',','')) OVER (PARTITION BY t.create_user_id, MONTH(t1.date_of_issue)) as monthAmount,
+            (SELECT SUM(replace(amount_to,',','')) FROM base_personnel_labour_capital_data WHERE name = t.name) as yearAmount
         from base_personnel_labour_capital_data t
                  LEFT JOIN base_personnel_labour_capital t1 ON t.labour_capital_id = t1.id
                  LEFT JOIN xjr_user u ON t.job_number = u.user_name
@@ -44,7 +45,7 @@
         WHERE
             t.delete_mark = 0
         and YEAR(t1.date_of_issue) = #{dto.year}
-        and t1.name = #{dto.project}
+        and t.job_number = #{dto.jobNumber}
     </select>
 </mapper>
         <!--    SELECT-->

+ 1 - 1
src/main/resources/mapper/student/BaseStudentMapper.xml

@@ -93,7 +93,7 @@
                 and t4.id = #{dto.queryId}
             </if>
         </if>
-        <if test="dto.gradeId == null">
+        <if test="dto.gradeId != null">
             and t4.grade_id = #{dto.gradeId}
         </if>
         <if test="dto.order == null">

+ 38 - 0
src/main/resources/mapper/teacher/TeacherAwardItemMapper.xml

@@ -28,4 +28,42 @@
         </if>
 
     </select>
+
+    <select id="getStatisticsList" parameterType="com.xjrsoft.module.teacher.dto.TeacherAwardStatisticsPageDto" resultType="com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo">
+        SELECT t1.id, t1.user_name, t1.name,t1.code,t3.name AS gender_cn,t1.mobile,
+        (SELECT SUM(a2.score) FROM teacher_award a1
+        INNER JOIN teacher_award_item a2 ON a1.teacher_award_item_id = a2.id
+        WHERE a1.status = 1 AND a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a1.applicant_user_id = t1.id
+        <if test="dto.awardDateStart != null and dto.awardDateEnd != null">
+            and a1.award_date between #{dto.awardDateStart} and #{dto.awardDateEnd}
+        </if>
+        ) AS score FROM xjr_user t1
+        INNER JOIN base_teacher t2 ON t1.id = t2.user_id
+        left join xjr_user_dept_relation t4 on t4.user_id = t1.id
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.gender = t3.code
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
+        <if test="dto.userName != null and dto.userName != '' ">
+            and t1.user_name like concat('%', #{dto.userName}, '%')
+        </if>
+        <if test="dto.name != null and dto.name != '' ">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.deptId != null">
+            and t4.dept_id = #{dto.deptId}
+        </if>
+    </select>
+
+    <select id="getAwardFileList" parameterType="com.xjrsoft.module.teacher.dto.TeacherAwardFileListDto" resultType="com.xjrsoft.module.teacher.vo.TeacherAwardFileListVo">
+        SELECT t1.applicant_user_id,t3.file_name,t3.filt_type,t3.file_url FROM teacher_award t1
+        INNER JOIN xjr_workflow_form_relation t2 ON t1.id = t2.form_key_value
+        INNER JOIN xjr_file t3 ON t1.file_id = t3.folder_id
+        WHERE t1.delete_mark = 0 AND t2.current_state = 'COMPLETED'
+        <if test="dto.applicantUserIds != null and dto.applicantUserIds.size() > 0">
+            and t1.applicant_user_id in
+            <foreach item="userId" index="index" collection="dto.applicantUserIds" open="(" separator="," close=")">
+                #{userId}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 1 - 1
src/test/java/com/xjrsoft/module/job/JianyuekbScheduleTaskTest2.java

@@ -137,7 +137,7 @@ class JianyuekbScheduleTaskTest2 {
         doExecute();
     }
     public void doExecute() {
-        String sql = "SELECT * FROM course_receive_msg WHERE delete_mark = 0 AND is_callback = -1";
+        String sql = "SELECT * FROM course_receive_msg WHERE delete_mark = 0 AND is_callback = null";
         List<Map<String, Object>> receiveMsgs = SqlRunnerAdapter.db().selectList(sql);
         if(receiveMsgs.isEmpty()){
             return;