liusheng
2024-07-25 517ecf9879052b2f3fbad25c0469935cc45553a7
变更
已添加1个文件
已修改11个文件
226 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/Test.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatebaseinfoServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatecompletioninfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonationwitnessServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceEthicalreviewopinionsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceMedicalevaluationServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceRelativesconfirmationServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceDonatecompletioninfoMapper.xml 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceMedicalevaluationMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceRelativesconfirmationMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/Test.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
package com.ruoyi.web.core.config;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.project.domain.BaseFinancesubject;
import com.ruoyi.project.domain.TestExcelVo;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class Test {
    public static void main(String[] args) throws Exception {
//        mergeExcel("E:\\OPO\\WEB\\Upload\\download\\3683d6af-c2c6-4225-821c-e54f6b0cda3f_VIEW数据.xlsx", "E:\\OPO\\WEB\\Upload\\download\\18ae2e71-730a-4948-929c-549df35104e3_VIEW数据.xlsx", "E:\\OPO\\WEB\\Upload\\download\\数据测试.xlsx");
//
//        ArrayList list=new ArrayList();
//        list.add("3683d6af-c2c6-4225-821c-e54f6b0cda3f_VIEW数据.xlsx");
//        list.add("bcfc7779-d7f1-416b-9c60-61315a59699e_VIEW数据.xlsx");
//
//        mergeExcel2(list,"E:\\OPO\\WEB\\Upload\\download\\数据测试.xlsx");
    }
    private static void createTableWithBorders(Sheet sheet, int startRow, int startCol, int numRows, int numCols, List<String> list, Workbook workbook) {
        for (int i = startRow; i < startRow + numRows; i++) {
            Row row = sheet.createRow(i);
            if (i == 4) {
                CellStyle cellStyle = workbook.createCellStyle();
                cellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); // è®¾ç½®å‰æ™¯å¡«å……颜色为黄色
                cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); // è®¾ç½®å¡«å……模式
                // åº”用样式到行
                row.setRowStyle(cellStyle);
            }
            for (int j = startCol; j <= startCol + numCols; j++) {
                sheet.setColumnWidth(j, (j + 1) * 256);
                Cell cell = row.createCell(j);
//                cell.setCellValue("Table" + (i - startRow) + (j - startCol));
                cell.setCellValue(list.get(j - startCol));
                // Apply borders to the cell
                CellStyle cellStyle = sheet.getWorkbook().createCellStyle();
                cellStyle.setBorderTop(BorderStyle.THIN);
                cellStyle.setBorderBottom(BorderStyle.THIN);
                cellStyle.setBorderLeft(BorderStyle.THIN);
                cellStyle.setBorderRight(BorderStyle.THIN);
                cell.setCellStyle(cellStyle);
            }
        }
    }
    public static void mergeExcel(String file1, String file2, String outputFile) throws IOException {
        try {
            InputStream is1 = new FileInputStream(file1);
            InputStream is2 = new FileInputStream(file2);
            Workbook workbook1 = new XSSFWorkbook(is1);
            Workbook workbook2 = new XSSFWorkbook(is2);
            Workbook resultWorkbook = new XSSFWorkbook();
            Sheet sheet1 = workbook1.getSheetAt(0);
            Sheet sheet2 = workbook2.getSheetAt(0);
            // å¤åˆ¶ç¬¬ä¸€ä¸ªæ–‡ä»¶çš„Sheet
            Sheet newSheet1 = resultWorkbook.createSheet("Sheet1");
            for (Row row : sheet1) {
                Row newRow = newSheet1.createRow(row.getRowNum());
                int columns = row.getLastCellNum();
                for (int i = 0; i < columns; i++) {
                    newSheet1.setColumnWidth(i, 6000);
                    Cell cell = row.getCell(i);
                    Cell newCell = newRow.createCell(cell.getColumnIndex());
                    newCell.setCellValue(cell.getStringCellValue());
                }
            }
            // å¤åˆ¶ç¬¬äºŒä¸ªæ–‡ä»¶çš„Sheet
            Sheet newSheet2 = resultWorkbook.createSheet("Sheet2");
            for (Row row : sheet2) {
                Row newRow = newSheet2.createRow(row.getRowNum());
                for (Cell cell : row) {
                    Cell newCell = newRow.createCell(cell.getColumnIndex());
                    newCell.setCellValue(cell.getStringCellValue());
                }
            }
            // å†™å…¥åˆ°æ–°çš„Excel文件
            FileOutputStream out = new FileOutputStream(outputFile);
            resultWorkbook.write(out);
        } catch (Exception e) {
           e.printStackTrace();
        }
    }
    public static void mergeExcel2(List<String> files, String outputFile) {
        try {
            Workbook resultWorkbook = new XSSFWorkbook();
            for (String file : files) {
                InputStream is1 = new FileInputStream("E:\\OPO\\WEB\\Upload\\download\\" + file);
                Workbook workbook1 = new XSSFWorkbook(is1);
                Sheet sheet1 = workbook1.getSheetAt(0);
                // å¤åˆ¶ç¬¬ä¸€ä¸ªæ–‡ä»¶çš„Sheet
                Sheet newSheet1 = resultWorkbook.createSheet(file.substring(0, file.indexOf(".")));
                for (Row row : sheet1) {
                    Row newRow = newSheet1.createRow(row.getRowNum());
                    int columns = row.getLastCellNum();
                    for (int i = 0; i < columns; i++) {
                        newSheet1.setColumnWidth(i, 6000);
                        Cell cell = row.getCell(i);
                        Cell newCell = newRow.createCell(cell.getColumnIndex());
                        newCell.setCellValue(cell.getStringCellValue());
                    }
                }
            }
            FileOutputStream out = new FileOutputStream(outputFile);
            resultWorkbook.write(out);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatebaseinfoServiceImpl.java
@@ -223,7 +223,9 @@
            }
        }
        if (b == 1) {
            serviceDonatebaseinfo.setCreateBy(user.getUserName());
//            serviceDonatebaseinfo.setCreateBy(user.getUserName());
            log.info("user.getUserName()的值为 ---- ï¼š{}", user.getUserName());
            serviceDonatebaseinfo.setReporterno(user.getUserName());
        }
        if (b == 2) {
            serviceDonatebaseinfo.setDeptid(user.getDeptId());
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatecompletioninfoServiceImpl.java
@@ -120,7 +120,7 @@
            }
        }
        if (b) {
            donationCompletionVO.setBasecreateby(user.getUserName());
            donationCompletionVO.setReporterno(user.getUserName());
        }
        return serviceDonatecompletioninfoMapper.selectVOList(donationCompletionVO);
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonationwitnessServiceImpl.java
@@ -80,7 +80,7 @@
            }
        }
        if (b) {
            donationWitnessVO.setBasecreateby(user.getUserName());
            donationWitnessVO.setReporterno(user.getUserName());
        }
        List<DonationWitnessVO> donationWitnessVOS = serviceDonationwitnessMapper.selectVOList(donationWitnessVO);
        return donationWitnessVOS;
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceEthicalreviewopinionsServiceImpl.java
@@ -81,7 +81,7 @@
            }
        }
        if(b){
            ethicalReviewVO.setBasecreateby(user.getUserName());
            ethicalReviewVO.setReporterno(user.getUserName());
        }
        return serviceEthicalreviewopinionsMapper.selectVOList(ethicalReviewVO);
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceMedicalevaluationServiceImpl.java
@@ -70,7 +70,8 @@
            }
        }
        if (b) {
            medicalEvaluationVO.setBasecreateby(user.getUserName());
//            medicalEvaluationVO.setBasecreateby(user.getUserName());
            medicalEvaluationVO.setReporterno(user.getUserName());
        }
        log.info("selectVOList的入参是:{}", medicalEvaluationVO);
        return serviceMedicalevaluationMapper.selectVOList(medicalEvaluationVO);
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceRelativesconfirmationServiceImpl.java
@@ -204,7 +204,7 @@
            }
        }
        if(b){
            relativeConfirmationVO.setBasecreateby(user.getUserName());
            relativeConfirmationVO.setReporterno(user.getUserName());
        }
        return serviceRelativesconfirmationMapper.selectVOList(relativeConfirmationVO);
ruoyi-project/src/main/resources/mapper/project/ServiceDonatecompletioninfoMapper.xml
@@ -28,10 +28,32 @@
    </resultMap>
    <sql id="selectServiceDonatecompletioninfoVo">
        select ID, InfoID, DonorNo, del_flag, create_by, create_time, update_by, update_time, IsBodyDonation, ReceivingUnit, ReceivingUnitName, CompleteTime, ResponsibleUserID, ResponsibleUserName, CoordinatedUserIDO, CoordinatedUserNameO, CoordinatedUserIDT, CoordinatedUserNameT, AssessAnnex, DonateOrgan from service_donatecompletioninfo
        select ID,
               InfoID,
               DonorNo,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               IsBodyDonation,
               ReceivingUnit,
               ReceivingUnitName,
               CompleteTime,
               ResponsibleUserID,
               ResponsibleUserName,
               CoordinatedUserIDO,
               CoordinatedUserNameO,
               CoordinatedUserIDT,
               CoordinatedUserNameT,
               AssessAnnex,
               DonateOrgan
        from service_donatecompletioninfo
    </sql>
    <select id="selectServiceDonatecompletioninfoList" parameterType="com.ruoyi.project.domain.ServiceDonatecompletioninfo" resultMap="ServiceDonatecompletioninfoResult">
    <select id="selectServiceDonatecompletioninfoList"
            parameterType="com.ruoyi.project.domain.ServiceDonatecompletioninfo"
            resultMap="ServiceDonatecompletioninfoResult">
        <include refid="selectServiceDonatecompletioninfoVo"/>
        <where>
            <if test="donorno != null  and donorno != ''"> and DonorNo = #{donorno}</if>
@@ -97,27 +119,32 @@
        `service_donatecompletioninfo`.`update_by` AS `updateby`,
        `service_donatecompletioninfo`.`update_time` AS `updatetime`
    FROM
              `service_donatebaseinfo`
            LEFT JOIN  (    select * from `service_donatecompletioninfo`  where `del_flag`='0' and  id in (
                select min(id) from `service_donatecompletioninfo` where `del_flag`='0' group by `InfoID`
                )  )`service_donatecompletioninfo` ON
        LEFT JOIN `service_donatecompletioninfo` ON
                `service_donatebaseinfo`.`ID` = `service_donatecompletioninfo`.`InfoID`
        LEFT JOIN `base_organization` ON
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            `service_donatebaseinfo`.`del_flag` = 0
            and service_donatecompletioninfo.del_flag = 0
            <if test="donorno != null  and donorno != ''"> and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''"> and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')</if>
            <if test="name != null  and name != ''">and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')
            </if>
            <if test="idcardno != null  and idcardno != ''"> and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''"> and `service_donatebaseinfo`.`TreatmentHospitalNo` = #{treatmenthospitalno}</if>
            <if test="recordstate != null  and recordstate != ''"> and `service_donatebaseinfo`.`RecordState` = #{recordstate}</if>
            <if test="basecreateby != null  and basecreateby != ''"> and `service_donatebaseinfo`.`create_by` = #{basecreateby}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''">and
                `service_donatebaseinfo`.`TreatmentHospitalNo` = #{treatmenthospitalno}
            </if>
            <if test="recordstate != null  and recordstate != ''">and `service_donatebaseinfo`.`RecordState` =
                #{recordstate}
            </if>
            <if test="basecreateby != null  and basecreateby != ''">and `service_donatebaseinfo`.`create_by` =
                #{basecreateby}
            </if>
            <if test="starttime != null "> and `service_donatecompletioninfo`.CompleteTime >= #{starttime} </if>
            <if test="endtime != null ">  and `service_donatecompletioninfo`.CompleteTime &lt;= #{endtime}</if>
            <if test="reporterno != null  and reporterno != ''"> and `service_donatebaseinfo`.ReporterNo = #{reporterno}</if>
            <if test="reporterno != null  and reporterno != ''">and `service_donatebaseinfo`.ReporterNo =
                #{reporterno}
            </if>
            <if test="city != null and city != ''"> and `base_organization`.`City` = #{city}</if>
            <if test="id != null "> and `service_donatebaseinfo`.`ID` = #{id}</if>
            <if test="workflow != null "> and `service_donatebaseinfo`.`workflow` = #{workflow}</if>
@@ -128,16 +155,22 @@
    </select>
    <select id="countNumber" resultType="java.lang.Integer">
        select count(*) from service_donatecompletioninfo
        where CompleteTime >= #{starttime} and CompleteTime &lt;= #{endtime}  AND del_flag=0
        select count(*)
        from service_donatecompletioninfo
        where CompleteTime >= #{starttime}
          and CompleteTime &lt;= #{endtime}
          AND del_flag = 0
    </select>
    <select id="getByInfoId" resultType="com.ruoyi.project.domain.ServiceDonatecompletioninfo">
        <include refid="selectServiceDonatecompletioninfoVo"/>
        where InfoID = #{id}  AND del_flag=0
    </select>
    <select id="count" resultType="java.lang.Integer">
        select count(*) from service_donatecompletioninfo
        where del_flag=0 and CompleteTime >= #{starttime} and CompleteTime &lt;= #{endtime}
        select count(*)
        from service_donatecompletioninfo
        where del_flag = 0
          and CompleteTime >= #{starttime}
          and CompleteTime &lt;= #{endtime}
    </select>
    <select id="getCompletionDonatePeopleByTime" resultType="com.ruoyi.project.domain.ServiceDonatecompletioninfo">
        <include refid="selectServiceDonatecompletioninfoVo"/>
@@ -147,7 +180,9 @@
    <update id="delDuplicateDonateCompletioninfo">
        update service_donatecompletioninfo
        set del_flag = 1,create_by= #{createby},update_time=now()
        set del_flag   = 1,
            create_by= #{createby},
            update_time=now()
        where InfoID = #{infoid}
    </update>
ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml
@@ -170,6 +170,7 @@
        <where>
            service_donationwitness.del_flag=0
            and service_donatebaseinfo.del_flag=0
            <if test="donorno != null  and donorno != ''">and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''">and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')
            </if>
ruoyi-project/src/main/resources/mapper/project/ServiceEthicalreviewopinionsMapper.xml
@@ -119,6 +119,8 @@
        base_organization.OrganizationID = service_donatebaseinfo.TreatmentHospitalNo
        <where>
            service_donatebaseinfo.del_flag=0
            and service_ethicalreviewopinions.del_flag=0
            <if test="donorno != null  and donorno != ''">and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''">and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')
            </if>
ruoyi-project/src/main/resources/mapper/project/ServiceMedicalevaluationMapper.xml
@@ -95,16 +95,14 @@
        `service_medicalevaluation`.`update_by` AS `updateby`,
        `service_medicalevaluation`.`update_time` AS `updatetime`
        FROM
            `service_donatebaseinfo`
            LEFT JOIN `service_medicalevaluation` ON
            `service_donatebaseinfo`.`ID` = `service_medicalevaluation`.`InfoID`
        LEFT JOIN `base_organization` ON
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            service_medicalevaluation.del_flag != 1
            service_medicalevaluation.del_flag = 0
            and service_donatebaseinfo.del_flag = 0
            <if test="name != null  and name != ''"> and `service_donatebaseinfo`.Name like concat('%', #{name}, '%')</if>
            <if test="donorno != null  and donorno != ''"> and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="idcardno != null  and idcardno != ''"> and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>
ruoyi-project/src/main/resources/mapper/project/ServiceRelativesconfirmationMapper.xml
@@ -158,6 +158,8 @@
        `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
        <where>
            service_donatebaseinfo.del_flag=0
            and service_relativesconfirmation.del_flag=0
            <if test="donorno != null  and donorno != ''"> and `service_donatebaseinfo`.`DonorNo` = #{donorno}</if>
            <if test="name != null  and name != ''"> and `service_donatebaseinfo`.`Name` like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''"> and `service_donatebaseinfo`.`IDCardNo` = #{idcardno}</if>