2 Commitit f231a22b84 ... f22177dfdf

Tekijä SHA1 Viesti Päivämäärä
  sangwenwei f22177dfdf Merge remote-tracking branch 'origin/master' 3 kuukautta sitten
  sangwenwei 6ed21fcd25 会计发票导入 3 kuukautta sitten
14 muutettua tiedostoa jossa 801 lisäystä ja 19 poistoa
  1. 81 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java
  2. 5 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceBaseMapper.java
  3. 9 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java
  4. 37 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml
  5. 93 3
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml
  6. 437 16
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java
  7. 63 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceImportDTO.java
  8. 2 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java
  9. 25 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml
  10. 1 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java
  11. 37 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectReportMapper.xml
  12. 2 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/CwWorkClientBillingMapper.java
  13. 9 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBillingMapper.xml
  14. BIN
      jeeplus-modules/jeeplus-finance/src/main/resources/dot/发票导入模板.xlsx

+ 81 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java

@@ -13,6 +13,7 @@ import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
 import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase;
 import com.jeeplus.finance.invoice.service.CwFinanceInvoiceService;
 import com.jeeplus.finance.invoice.service.dto.CwFinanceDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceImportDTO;
 import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
 import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO;
 import com.jeeplus.finance.invoice.util.EasyPoiUtil;
@@ -590,6 +591,86 @@ public class CwFinanceInvoiceController {
 
 
 
+    /**
+     * 下载发票导入模板
+     *
+     * @param response
+     * @return
+     */
+    @GetMapping("/importFinance/template")
+    @ApiOperation(value = "下载模板")
+    public void importFinanceTemplate(HttpServletResponse response, HttpServletRequest request) {
+        try {
+            InputStream inputStream = this.getClass().getResourceAsStream("/dot/发票导入模板.xlsx");
+            //强制下载不打开
+            response.setContentType("application/force-download");
+            OutputStream out = response.getOutputStream();
+            //使用URLEncoder来防止文件名乱码或者读取错误
+            response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("finance_invoice_template.xlsx", "UTF-8"));
+            int b = 0;
+            byte[] buffer = new byte[1000000];
+            while (b != -1) {
+                b = inputStream.read(buffer);
+                if (b != -1) out.write(buffer, 0, b);
+            }
+            inputStream.close();
+            out.close();
+            out.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+
+
+    /**
+     * 导入发票数据
+     *
+     * @return
+     */
+    @DemoMode
+    @PostMapping("/importFinance")
+    @ApiLog(value = "导入发票数据excel", type = LogTypeEnum.IMPORT)
+    public ResponseEntity importFinance(MultipartFile file, HttpServletRequest request) throws IOException {
+
+        ArrayList<CwFinanceImportDTO> arrayList = new ArrayList<>();
+        HashMap<String,String> hashMap = new HashMap<>();
+
+        List<CwFinanceImportDTO> listA = new ArrayList<>();
+        //获取sheet
+        listA = EasyPoiUtil.importExcel(file, 1, 1, CwFinanceImportDTO.class);
+        //去除excel中的空行
+        listA = getExList(listA);
+        //导入前检测数据
+        String resultA = cwFinanceInvoiceService.importFinance(listA, arrayList, hashMap);
+        if(StringUtils.isNotBlank(resultA)){
+            //有返回值,说明导入的数据不正确。向用户抛提示
+            return ResponseEntity.badRequest().body  (resultA);
+        }
+
+        return ResponseEntity.ok("导入成功");
+    }
+
+    /**
+     * 去除excel中的空行
+     * @param list
+     * @return
+     */
+    public ArrayList<CwFinanceImportDTO> getExList(List<CwFinanceImportDTO> list){
+
+        ArrayList<CwFinanceImportDTO> cwFinanceImportDTOS = new ArrayList<>();
+
+        list.stream().forEach(item->{
+            if(objectCheckIsNull(item)){
+                cwFinanceImportDTOS.add(item);
+            }
+        });
+
+        return cwFinanceImportDTOS;
+    }
+
+
 
 
 

+ 5 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceBaseMapper.java

@@ -3,10 +3,15 @@ package com.jeeplus.finance.invoice.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 @Mapper
 public interface CwFinanceInvoiceBaseMapper extends BaseMapper<CwFinanceInvoiceBase> {
 
+    //批量添加
+    void insertBatch(@Param("baseList") List<CwFinanceInvoiceBase> baseList);
 }
 
 

+ 9 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -10,9 +10,11 @@ import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
 import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase;
 import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO;
 import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.sys.service.dto.AreaDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Mapper
@@ -66,6 +68,13 @@ public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
      * @return
      */
     String getInvoiceNumberStr(String invoiceId);
+    //查询全部发票数据
+    List<CwFinanceInvoiceDTO> getList(@Param("userId")String userId);
+
+    //获取所有的区域
+    List<AreaDTO> getAllArea();
+
+    void insertBatch(@Param("invoiceArrayList") List<CwFinanceInvoice> invoiceArrayList);
 }
 
 

+ 37 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml

@@ -33,4 +33,41 @@
         fib.program_no,
         fib.contract_id
     </sql>
+
+    <insert id="insertBatch">
+        insert into cw_finance_invoice_base(
+            id,
+            create_by_id,
+            create_time,
+            update_by_id,
+            update_time,
+            del_flag,
+            invoice_id,
+            program_id,
+            program_name,
+            program_no,
+            contract_id,
+            contract_name,
+            account,
+            `type`,
+            tenant_id
+        )values
+        <foreach collection="baseList" item="item" separator=",">
+            (#{item.id},
+            #{item.createById},
+            #{item.createTime},
+            #{item.updateById},
+            #{item.updateTime},
+            #{item.delFlag},
+            #{item.invoiceId},
+            #{item.programId},
+            #{item.programName},
+            #{item.programNo},
+            #{item.contractId},
+            #{item.contractName},
+            #{item.account},
+            #{item.type},
+            #{item.tenantId})
+        </foreach>
+    </insert>
 </mapper>

+ 93 - 3
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -254,21 +254,21 @@
         select
         <include refid="FII_Column_List"></include>
         from cw_finance_invoice_invalid fii
-        where fii.del_flag = '0' and fii.invoice_id = ${id}
+        where fii.del_flag = '0' and fii.invoice_id = #{id}
     </select>
 
     <select id="getFirList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO">
         select
         <include refid="FIR_Column_List"></include>
         from cw_finance_invoice_receivables fir
-        where fir.del_flag = '0' and fir.invoice_id = ${id}
+        where fir.del_flag = '0' and fir.invoice_id = #{id}
     </select>
 
     <select id="getFidList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO">
         select
         <include refid="FID_Column_List"></include>
         from cw_finance_invoice_detail fid
-        where fid.del_flag = '0' and fid.invoice_id = ${id}
+        where fid.del_flag = '0' and fid.invoice_id = #{id}
     </select>
 
     <select id="getBaseList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO">
@@ -479,6 +479,9 @@
         <if test="null != type and type != ''">
             type = #{type},
         </if>
+        <if test="null != no and no != ''">
+            no = #{no},
+        </if>
         <if test="null != billingType and billingType != ''">
             billing_type = #{billingType},
         </if>
@@ -637,4 +640,91 @@
 		select group_concat(number) from cw_finance_invoice_detail where invoice_id = #{invoiceId}
 	</select>
 
+
+    <select id="getList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO">
+        SELECT
+        DISTINCT
+        <include refid="Base_Column_List"></include>
+        FROM
+        cw_finance_invoice_base a
+        left join cw_finance_invoice fi on a.invoice_id = fi.id
+        where a.del_flag = '0' and fi.account >= '0' AND (fi.create_by_id = #{userId})
+        order by fi.create_time desc
+    </select>
+
+    <select id="getAllArea" resultType="com.jeeplus.sys.service.dto.AreaDTO">
+        select id,parent_id as `parent.id`,parent_ids,name,sort,code,type,create_by_id,create_time,update_by_id,update_time,remarks
+        from sys_area where del_flag = '0'
+        order by sort asc,parent_id asc
+    </select>
+
+    <insert id="insertBatch">
+        insert into cw_finance_invoice(
+        id,
+        create_by_id,
+        create_time,
+        update_by_id,
+        update_time,
+        del_flag,
+        `type`,
+        billing_type,
+        billing_workplace_real,
+        taxpayer_identification_no,
+        address,
+        tel_phone,
+        open_bank,
+        bank_account,
+        `name`,
+        receivables_type,
+        billing_content,
+        account,
+        billing_content_terms,
+        billing_people_real,
+        reconciliation_people,
+        reconciliation_area,
+        status,
+        is_multiple,
+        actual_drawer_email_address,
+        red_invoice_flag,
+        red_invoice_relevancy_id,
+        red_invoice_relevancy_number,
+        receivables_status,
+        invalid_status,
+        tenant_id
+        )values
+        <foreach collection="invoiceArrayList" item="item" separator=",">
+            (#{item.id},
+            #{item.createById},
+            #{item.createTime},
+            #{item.updateById},
+            #{item.updateTime},
+            #{item.delFlag},
+            #{item.type},
+            #{item.billingType},
+            #{item.billingWorkplaceReal},
+            #{item.taxpayerIdentificationNo},
+            #{item.address},
+            #{item.telPhone},
+            #{item.openBank},
+            #{item.bankAccount},
+            #{item.name},
+            #{item.receivablesType},
+            #{item.billingContent},
+            #{item.account},
+            #{item.billingContentTerms},
+            #{item.billingPeopleReal},
+            #{item.reconciliationPeople},
+            #{item.reconciliationArea},
+            #{item.status},
+            #{item.isMultiple},
+            #{item.actualDrawerEmailAddress},
+            #{item.redInvoiceFlag},
+            #{item.redInvoiceRelevancyId},
+            #{item.redInvoiceRelevancyNumber},
+            #{item.receivablesStatus},
+            #{item.invalidStatus},
+            #{item.tenantId})
+        </foreach>
+    </insert>
+
 </mapper>

+ 437 - 16
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -1,10 +1,10 @@
 package com.jeeplus.finance.invoice.service;
 
 import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -16,30 +16,25 @@ import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.finance.invoice.domain.*;
 import com.jeeplus.finance.invoice.mapper.*;
-import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO;
-import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
-import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO;
-import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
+import com.jeeplus.finance.invoice.service.dto.*;
 import com.jeeplus.finance.invoice.service.mapstruct.*;
-import com.jeeplus.finance.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.finance.projectRecords.mapper.CwProjectRecordsMapper;
 import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.finance.projectReport.domain.CwProjectReportData;
 import com.jeeplus.finance.projectReport.mapper.CwProjectReportMapper;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBilling;
+import com.jeeplus.finance.workClientInfo.mapper.CwWorkClientBillingMapper;
 import com.jeeplus.finance.workClientInfo.service.CwWorkClientBillingService;
 import com.jeeplus.finance.workClientInfo.service.CwWorkClientService;
 //import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
 //import com.jeeplus.pubmodules.oss.service.OssService;
 //import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
+import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBillingDTO;
 import com.jeeplus.sys.domain.User;
-import com.jeeplus.sys.feign.IOfficeApi;
-import com.jeeplus.sys.feign.IRoleApi;
-import com.jeeplus.sys.feign.IUserApi;
-import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.feign.*;
 //import com.jeeplus.sys.service.UserService;
-import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.AreaDTO;
 import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.commons.collections4.CollectionUtils;
@@ -50,12 +45,10 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 @Service
@@ -76,6 +69,8 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
     private CwProjectRecordsMapper cwProjectRecordsMapper;
     @Resource
     private CwProjectReportMapper cwProjectReportMapper;
+    @Resource
+    private CwWorkClientBillingMapper cwWorkClientBillingMapper;
 
 
 //    @Resource
@@ -668,10 +663,11 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
 
     public CwFinanceInvoice saveForm(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
         CwFinanceInvoice cwFinanceInvoice = CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO);
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         if (ObjectUtil.isNotEmpty(cwFinanceInvoice)) {
             if(StringUtils.isBlank(cwFinanceInvoice.getId())){
-                //获取当前登录人信息
-                UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+
                 //发票编号生成
                 String serialNum = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), CwFinanceInvoiceDTO.BIZ_CODE,TokenProvider.getCurrentToken());
                 cwFinanceInvoice.setNo(serialNum);
@@ -686,6 +682,10 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
                 }
             }
         }
+        if (StringUtils.isBlank(cwFinanceInvoice.getNo())){
+            String serialNum = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), CwFinanceInvoiceDTO.BIZ_CODE,TokenProvider.getCurrentToken());
+            cwFinanceInvoice.setNo(serialNum);
+        }
         if(StringUtils.isNotEmpty(cwFinanceInvoiceDTO.getActualDrawerEmailAddress())){
             cwFinanceInvoice.setActualDrawerEmailAddress(cwFinanceInvoiceDTO.getActualDrawerEmailAddress());
         }
@@ -1214,4 +1214,425 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
 
         return filteredList;
     }
+
+    private static final Pattern EMAIL_PATTERN = Pattern.compile("^[A-Za-z0-9+_.-]+@(.+)$");
+
+
+    /**
+     * 导入发票数据
+     * @param listA
+     * @param arrayList
+     * @param hashMap
+     * @return
+     */
+    public String importFinance(List<CwFinanceImportDTO> listA, ArrayList<CwFinanceImportDTO> arrayList, HashMap<String, String> hashMap) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        //查询全部的项目信息
+        List<CwProjectRecordsDTO> projectRecordsList = cwProjectRecordsMapper.selectAllList(userDTO.getId());
+        //查询全部的报告信息
+        List<CwProjectReportData> projectReportList = cwProjectReportMapper.getList(userDTO.getId());
+        //查询全部的发票信息
+        List<CwFinanceInvoiceDTO> invoiceDTOList = cwFinanceInvoiceMapper.getList(userDTO.getId());
+        //查询全部的客户信息
+        List<CwWorkClientBillingDTO> clientBillingList = cwWorkClientBillingMapper.getList();
+
+        if (CollectionUtils.isNotEmpty(listA)){
+            for (CwFinanceImportDTO cwFinanceImportDTO : listA) {
+                // 1. 报告号和项目编号校验
+                if (StringUtils.isBlank(cwFinanceImportDTO.getReportNo()) && StringUtils.isBlank(cwFinanceImportDTO.getProjectNo())) {
+                    return "报告号和项目编号不能同时为空";
+                }
+
+                // 2. 项目开票金额校验
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getBaseAccount())){
+                    double amount = Double.parseDouble(cwFinanceImportDTO.getBaseAccount());
+                    if (amount < 0 && StringUtils.isBlank(cwFinanceImportDTO.getRedInvoiceRelevancyNumber())) {
+                        return "开票金额为负时,必须填写关联红字发票的发票编号";
+                    }
+                    if (amount < 0 && StringUtils.isNotBlank(cwFinanceImportDTO.getRedInvoiceRelevancyNumber())) {
+                        //将开票编号中的英文转为大写
+                        String upperCaseRedInvoice = cwFinanceImportDTO.getRedInvoiceRelevancyNumber().toUpperCase();
+                        boolean exists = invoiceDTOList.stream()
+                                .anyMatch(invoice -> upperCaseRedInvoice.equals(invoice.getNo()));
+                        if (exists) {
+                            //根据关联红字发票编号查询发票信息
+                            for (CwFinanceInvoiceDTO cwFinanceInvoiceDTO : invoiceDTOList) {
+                                if (cwFinanceInvoiceDTO.getNo().equals(upperCaseRedInvoice)){
+                                    if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getAccount())){
+                                        double parseDouble = Double.parseDouble(cwFinanceInvoiceDTO.getAccount());
+                                        if (parseDouble < 0){
+                                            return "关联红字发票编号——"+cwFinanceImportDTO.getRedInvoiceRelevancyNumber()+"的开票金额为负,请重新填写关联红字发票编号";
+                                        }
+                                    }else {
+                                        return "关联红字发票编号——"+cwFinanceImportDTO.getRedInvoiceRelevancyNumber()+"的开票金额为空,请重新填写关联红字发票编号";
+                                    }
+                                }
+                            }
+                        } else {
+                            return "关联红字发票编号——"+cwFinanceImportDTO.getRedInvoiceRelevancyNumber()+"不存在,请重新填写";
+                        }
+                    }
+                }else {
+                    return "项目开票金额不能为空";
+                }
+
+                // 4. 开票内容必填
+                if (StringUtils.isBlank(cwFinanceImportDTO.getBillingContent())) {
+                    return "开票内容不能为空";
+                }
+                // 5. 邮箱校验
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getActualDrawerEmailAddress()) &&
+                        !EMAIL_PATTERN.matcher(cwFinanceImportDTO.getActualDrawerEmailAddress()).matches()) {
+                    return "接收邮箱格式不正确";
+                }
+                // 6.单位名称校验
+                if (StringUtils.isBlank(cwFinanceImportDTO.getBillingWorkplaceReal())){
+                    return "单位名称不能为空";
+                }
+                //发票类型校验
+                if (StringUtils.isBlank(cwFinanceImportDTO.getType())){
+                    return "发票类型不能为空";
+                }
+                //开票类型校验
+                if (StringUtils.isBlank(cwFinanceImportDTO.getBillingType())){
+                    return "开票类型不能为空";
+                }
+                //发票类型校验
+                if ("专票".equals(cwFinanceImportDTO.getType()) && "企业开票".equals(cwFinanceImportDTO.getBillingType()) && StringUtils.isNotBlank(cwFinanceImportDTO.getBillingWorkplaceReal())){
+                    //根据单位查询客户信息
+                    boolean match = clientBillingList.stream().anyMatch(client -> cwFinanceImportDTO.getBillingWorkplaceReal().equals(client.getCompanyName()));
+                    if (match){
+                        for (CwWorkClientBillingDTO cwWorkClientBilling : clientBillingList) {
+                            if (cwWorkClientBilling.getCompanyName().equals(cwFinanceImportDTO.getBillingWorkplaceReal())){
+                                if (StringUtils.isBlank(cwWorkClientBilling.getTaxpayerIdentificationNo())){
+                                    return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"下的纳税人识别号在系统中不存在,请填写";
+                                }
+                                if (StringUtils.isBlank(cwWorkClientBilling.getAddress())){
+                                    return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"下的地址在系统中不存在,请填写";
+                                }
+                                if (StringUtils.isBlank(cwWorkClientBilling.getPhone())){
+                                    return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"下的电话在系统中不存在,请填写";
+                                }
+                                if (StringUtils.isBlank(cwWorkClientBilling.getAccountHolder())){
+                                    return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"下的开户银行名称在系统中不存在,请填写";
+                                }
+                                if (StringUtils.isBlank(cwWorkClientBilling.getAccount())){
+                                    return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"下的银行账号在系统中不存在,请填写";
+                                }
+                            }
+                        }
+                    }else {
+                        if (StringUtils.isBlank(cwFinanceImportDTO.getTaxpayerIdentificationNo())){
+                            return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"在系统中不存在,纳税人识别号不能为空";
+                        }
+                        if (StringUtils.isBlank(cwFinanceImportDTO.getAddress())){
+                            return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"在系统中不存在,地址不能为空";
+                        }
+                        if (StringUtils.isBlank(cwFinanceImportDTO.getTelPhone())){
+                            return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"在系统中不存在,电话不能为空";
+                        }
+                        if (StringUtils.isBlank(cwFinanceImportDTO.getOpenBank())){
+                            return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"在系统中不存在,开户银行名称不能为空";
+                        }
+                        if (StringUtils.isBlank(cwFinanceImportDTO.getBankAccount())){
+                            return "客户名称——"+cwFinanceImportDTO.getBillingWorkplaceReal()+"在系统中不存在,银行账号不能为空";
+                        }
+                    }
+
+                }
+
+                arrayList.add(cwFinanceImportDTO);
+            }
+        }
+
+        ArrayList<CwFinanceInvoice> invoiceArrayList = new ArrayList<>();
+        ArrayList<CwFinanceInvoiceBase> baseArrayList = new ArrayList<>();
+
+        //发票类型
+        String invoiceTypeDatas = SpringUtil.getBean ( IDictApi.class ).getDictValueListMapByDict ("invoice_type");
+        Map<String,Object> invoiceTypeValueDTOs = JSON.parseObject(invoiceTypeDatas, new TypeReference<Map<String,Object>>() {});
+        //开票类型
+        String invoiceBillingTypeDatas = SpringUtil.getBean ( IDictApi.class ).getDictValueListMapByDict ("invoice_billing_type");
+        Map<String,Object> invoiceBillingTypeValueDTOs = JSON.parseObject(invoiceBillingTypeDatas, new TypeReference<Map<String,Object>>() {});
+        //开票内容
+        String invoiceBillingContentDatas = SpringUtil.getBean ( IDictApi.class ).getDictValueListMapByDict ("invoice_billing_content");
+        Map<String,Object> invoiceBillingContentValueDTOs = JSON.parseObject(invoiceBillingContentDatas, new TypeReference<Map<String,Object>>() {});
+
+        //获取所有人信息
+        List<UserDTO> allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
+        //区域
+        List<AreaDTO> areaDTOList = cwFinanceInvoiceMapper.getAllArea();
+        List<AreaDTO> buildTree = buildTree(areaDTOList);
+
+        if (CollectionUtils.isNotEmpty(arrayList)){
+            for (CwFinanceImportDTO cwFinanceImportDTO : arrayList) {
+                CwFinanceInvoice cwFinanceInvoice = new CwFinanceInvoice();
+                String id = UUID.randomUUID().toString().replace("-", "");
+                cwFinanceInvoice.setId(id);
+
+                CwFinanceInvoiceBase cwFinanceInvoiceBase = new CwFinanceInvoiceBase();
+                String baseId = UUID.randomUUID().toString().replace("-", "");
+                cwFinanceInvoiceBase.setId(baseId);
+                cwFinanceInvoiceBase.setInvoiceId(id);
+
+                //保存报告或项目信息
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getProjectNo()) && StringUtils.isBlank(cwFinanceImportDTO.getReportNo())){
+                    boolean exist = projectRecordsList.stream().anyMatch(records -> records.getProjectNumber().equals(cwFinanceImportDTO.getProjectNo()));
+                    if (exist){
+                        for (CwProjectRecordsDTO cwProjectRecords : projectRecordsList) {
+                            if (cwProjectRecords.getProjectNumber().equals(cwFinanceImportDTO.getProjectNo())){
+                                cwFinanceInvoiceBase.setProgramId(cwProjectRecords.getId());
+                                cwFinanceInvoiceBase.setProgramNo(cwProjectRecords.getProjectNumber());
+                                cwFinanceInvoiceBase.setProgramName(cwProjectRecords.getProjectName());
+                                cwFinanceInvoiceBase.setType("1");
+                                cwFinanceInvoiceBase.setContractId(cwProjectRecords.getContractId());
+                                cwFinanceInvoiceBase.setContractName(cwProjectRecords.getContractName());
+                                break;
+                            }
+                        }
+                    }else {
+                        return "项目编号——"+cwFinanceImportDTO.getProjectNo()+"不是当前登录人所创建,请重新填写";
+                    }
+                }
+                if ((StringUtils.isNotBlank(cwFinanceImportDTO.getReportNo()) && StringUtils.isBlank(cwFinanceImportDTO.getProjectNo())) ||(StringUtils.isNotBlank(cwFinanceImportDTO.getReportNo()) && StringUtils.isNotBlank(cwFinanceImportDTO.getProjectNo()))){
+                    boolean exist = projectReportList.stream().anyMatch(report -> report.getReportNo().equals(cwFinanceImportDTO.getReportNo()));
+                    if (exist){
+                        for (CwProjectReportData reportData : projectReportList) {
+                            if (reportData.getReportNo().equals(cwFinanceImportDTO.getReportNo())){
+                                cwFinanceInvoiceBase.setProgramId(reportData.getId());
+                                cwFinanceInvoiceBase.setProgramNo(reportData.getProjectNumber());
+                                cwFinanceInvoiceBase.setProgramName(reportData.getProjectName());
+                                cwFinanceInvoiceBase.setType("2");
+                                cwFinanceInvoiceBase.setContractName(reportData.getContractName());
+                                break;
+                            }
+                        }
+                    }else {
+                        return "报告号——"+cwFinanceImportDTO.getReportNo()+"不是当前登录人所创建,请重新填写";
+                    }
+                }
+                //开票金额
+                cwFinanceInvoice.setAccount(cwFinanceImportDTO.getBaseAccount());
+                cwFinanceInvoiceBase.setAccount(cwFinanceImportDTO.getBaseAccount());
+                //发票类型
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getType())){
+                    for (String key : invoiceTypeValueDTOs.keySet()) {
+                        if(cwFinanceImportDTO.getType().equals(key)){
+                            cwFinanceInvoice.setType(String.valueOf(invoiceTypeValueDTOs.get(key)));
+                            break;
+                        }
+                    }
+                }
+                //开票类型
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getBillingType())){
+                    for (String key : invoiceBillingTypeValueDTOs.keySet()) {
+                        if(cwFinanceImportDTO.getBillingType().equals(key)){
+                            cwFinanceInvoice.setBillingType(String.valueOf(invoiceBillingTypeValueDTOs.get(key)));
+                            break;
+                        }
+                    }
+                }
+                //实际开票单位
+                if ("企业开票".equals(cwFinanceImportDTO.getBillingType())){
+                    for (CwWorkClientBillingDTO cwWorkClientBilling : clientBillingList) {
+                        if (cwWorkClientBilling.getCompanyName().equals(cwFinanceImportDTO.getBillingWorkplaceReal())){
+                            cwFinanceInvoice.setBillingWorkplaceRealId(cwWorkClientBilling.getClientId());
+                            cwFinanceInvoice.setBillingWorkplaceReal(cwWorkClientBilling.getCompanyName());
+                            cwFinanceInvoice.setTaxpayerIdentificationNo(cwWorkClientBilling.getTaxpayerIdentificationNo());
+                            cwFinanceInvoice.setAddress(cwWorkClientBilling.getAddress());
+                            cwFinanceInvoice.setTelPhone(cwWorkClientBilling.getPhone());
+                            cwFinanceInvoice.setOpenBank(cwWorkClientBilling.getAccountHolder());
+                            cwFinanceInvoice.setBankAccount(cwWorkClientBilling.getAccount());
+                            break;
+                        }
+                    }
+                }
+                if ("个人开票".equals(cwFinanceImportDTO.getBillingType())){
+                    cwFinanceInvoice.setName(cwFinanceImportDTO.getBillingWorkplaceReal());
+                    cwFinanceInvoice.setTaxpayerIdentificationNo(cwFinanceImportDTO.getTaxpayerIdentificationNo());
+                    cwFinanceInvoice.setAddress(cwFinanceImportDTO.getAddress());
+                    cwFinanceInvoice.setTelPhone(cwFinanceImportDTO.getTelPhone());
+                    cwFinanceInvoice.setOpenBank(cwFinanceImportDTO.getOpenBank());
+                    cwFinanceInvoice.setBankAccount(cwFinanceImportDTO.getBankAccount());
+                }
+                //开票内容
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getBillingContent())){
+                    for (String key : invoiceBillingContentValueDTOs.keySet()) {
+                        if(cwFinanceImportDTO.getBillingContent().equals(key)){
+                            cwFinanceInvoice.setBillingContent(String.valueOf(invoiceBillingContentValueDTOs.get(key)));
+                            break;
+                        }
+                    }
+                }
+                //开票内容要求
+                cwFinanceInvoice.setBillingContentTerms(cwFinanceImportDTO.getBillingContentTerms());
+                //关联红字发票编号
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getRedInvoiceRelevancyNumber())){
+                    for (CwFinanceInvoiceDTO cwFinanceInvoiceDTO : invoiceDTOList) {
+                        if (cwFinanceInvoiceDTO.getNo().equals(cwFinanceImportDTO.getRedInvoiceRelevancyNumber().toUpperCase())){
+                            cwFinanceInvoice.setRedInvoiceFlag(1);
+                            cwFinanceInvoice.setRedInvoiceRelevancyNumber(cwFinanceInvoiceDTO.getNo());
+                            cwFinanceInvoice.setRedInvoiceRelevancyId(cwFinanceInvoiceDTO.getId());
+                            break;
+                        }
+                    }
+                }
+                //邮箱
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getActualDrawerEmailAddress())){
+                    cwFinanceInvoice.setActualDrawerEmailAddress(cwFinanceImportDTO.getActualDrawerEmailAddress());
+                }
+                //实际开票人
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getBillingPeopleRealName())){
+                    boolean match = allUserInfo.stream().anyMatch(user -> user.getName().equals(cwFinanceImportDTO.getBillingPeopleRealName()));
+                    if (match){
+                        Optional<String> matchedUser = allUserInfo.stream()
+                                .filter(dto -> dto.getName().equals(cwFinanceImportDTO.getBillingPeopleRealName()))
+                                .map(UserDTO::getId)
+                                .findFirst();
+                        cwFinanceInvoice.setBillingPeopleReal(matchedUser.get());
+                    }else {
+                        return "实际开票人——"+cwFinanceImportDTO.getBillingPeopleRealName()+"不存在,请重新填写";
+                    }
+                }else {
+                    cwFinanceInvoice.setBillingPeopleReal(userDTO.getId());
+                }
+                //对账人
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getReconciliationPeopleName())){
+                    boolean match = allUserInfo.stream().anyMatch(user -> user.getName().equals(cwFinanceImportDTO.getReconciliationPeopleName()));
+                    if (match){
+                        Optional<String> matchedUser = allUserInfo.stream()
+                                .filter(dto -> dto.getName().equals(cwFinanceImportDTO.getReconciliationPeopleName()))
+                                .map(UserDTO::getId)
+                                .findFirst();
+                        cwFinanceInvoice.setReconciliationPeople(matchedUser.get());
+                    }else {
+                        return "对账人——"+cwFinanceImportDTO.getReconciliationPeopleName()+"不存在,请重新填写";
+                    }
+                }else {
+                    cwFinanceInvoice.setReconciliationPeople(userDTO.getId());
+                }
+                //对账地区
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getReconciliationArea())){
+                    String lastLevelCode = findLastLevelCode(areaDTOList, cwFinanceImportDTO.getReconciliationArea());
+                    if (StringUtils.isNotBlank(lastLevelCode)){
+                        cwFinanceInvoice.setReconciliationArea(lastLevelCode);
+                    }else {
+                        return "对账地区——"+cwFinanceImportDTO.getReconciliationArea()+"不正确,请重新填写";
+                    }
+
+                }
+                //收款类型
+                cwFinanceInvoice.setReceivablesType("1");
+                cwFinanceInvoice.setIsMultiple("0");
+                cwFinanceInvoice.setStatus("1");
+                cwFinanceInvoice.setCreateById(userDTO.getId());
+                cwFinanceInvoice.setCreateTime(new Date());
+                cwFinanceInvoice.setUpdateById(userDTO.getId());
+                cwFinanceInvoice.setUpdateTime(new Date());
+                cwFinanceInvoice.setTenantId(userDTO.getTenantDTO().getId());
+                cwFinanceInvoice.setDelFlag(0);
+                cwFinanceInvoice.setInvalidStatus("0");
+                cwFinanceInvoice.setReceivablesStatus("0");
+                invoiceArrayList.add(cwFinanceInvoice);
+
+                cwFinanceInvoiceBase.setCreateById(userDTO.getId());
+                cwFinanceInvoiceBase.setCreateTime(new Date());
+                cwFinanceInvoiceBase.setUpdateById(userDTO.getId());
+                cwFinanceInvoiceBase.setUpdateTime(new Date());
+                cwFinanceInvoiceBase.setTenantId(userDTO.getTenantDTO().getId());
+                cwFinanceInvoiceBase.setDelFlag(0);
+                baseArrayList.add(cwFinanceInvoiceBase);
+
+            }
+
+        }
+
+        //批量保存
+        if (CollectionUtils.isNotEmpty(invoiceArrayList) && CollectionUtils.isNotEmpty(baseArrayList) ){
+            // 每次最多插入 100 条数据
+            int batchSize = 100;
+            int totalSize = invoiceArrayList.size();
+            int totalSize1 = baseArrayList.size();
+
+            // 按批次处理插入
+            for (int i = 0; i < totalSize; i += batchSize) {
+                // 计算当前批次的结束位置
+                int endIndex = Math.min(i + batchSize, totalSize);
+                // 获取当前批次的子列表
+                List<CwFinanceInvoice> batchList = invoiceArrayList.subList(i, endIndex);
+
+                // 执行批量插入
+                cwFinanceInvoiceMapper.insertBatch(batchList);
+            }
+
+            for (int i = 0; i < totalSize1; i += batchSize) {
+                // 计算当前批次的结束位置
+                int endIndex = Math.min(i + batchSize, totalSize1);
+                // 获取当前批次的子列表
+                List<CwFinanceInvoiceBase> batchList = baseArrayList.subList(i, endIndex);
+
+                // 执行批量插入
+                cwFinanceInvoiceBaseMapper.insertBatch(batchList);
+            }
+
+
+        }
+
+
+
+
+
+
+    return "";
+    }
+
+
+    public String findLastLevelCode(List<AreaDTO> areaDTOList, String reconciliationArea) {
+        // 按 "-" 拆分层级
+        String[] split = reconciliationArea.split("-");
+
+
+        List<AreaDTO> currentLevelList = areaDTOList;// 当前层级的 AreaDTO 列表
+        AreaDTO matchedArea = null; // 记录最后匹配的 AreaDTO
+
+        for (String name : split) {
+            // 在当前层级查找匹配的 name
+            Optional<AreaDTO> found = currentLevelList.stream()
+                    .filter(area -> area.getName().equals(name))
+                    .findFirst();
+
+            if (found.isPresent()) {
+                matchedArea = found.get(); // 记录匹配的节点
+                currentLevelList = matchedArea.getChildren(); // 进入子节点列表
+            } else {
+                return null; // 如果找不到,直接返回 null
+            }
+        }
+        return matchedArea != null ? matchedArea.getCode() : null;
+    }
+
+    public static List<AreaDTO> buildTree(List<AreaDTO> areaList) {
+        // 创建一个 Map 来保存 id 到 AreaDTO 的映射
+        Map<String, AreaDTO> areaMap = areaList.stream()
+                .collect(Collectors.toMap(AreaDTO::getId, area -> area));
+
+        // 用来存储树形结构的根节点
+        List<AreaDTO> rootList = new ArrayList<>();
+
+        for (AreaDTO area : areaList) {
+            String parentId = area.getParent().getId();
+            if (parentId.equals("0") || StringUtils.isBlank(parentId)) {
+                // 如果 parentId 为 null 或 0,说明是根节点
+                rootList.add(area);
+            } else {
+                // 否则,把它添加到父节点的 children 列表中
+                AreaDTO parentArea = areaMap.get(parentId);
+                if (parentArea != null) {
+                    parentArea.getChildren().add(area);
+                }
+            }
+        }
+        return rootList;
+    }
 }

+ 63 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceImportDTO.java

@@ -0,0 +1,63 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+@Data
+public class CwFinanceImportDTO extends BaseDTO {
+    @Excel(name = "报告号",width = 25)
+    private String reportNo;
+
+    @Excel(name = "项目编号",width = 25)
+    private String projectNo;
+
+    @Excel(name = "*项目开票金额",width = 16)
+    private String baseAccount;
+
+    @Excel(name = "*发票类型",width = 20)
+    private String type;
+
+    @Excel(name = "*开票类型",width = 25,orderNum = "6")
+    private String billingType;
+
+    @Excel(name = "*单位名称",width = 25)
+    private String billingWorkplaceReal;
+
+    @Excel(name = "纳税人识别号",width = 25)
+    private String taxpayerIdentificationNo;
+
+    @Excel(name = "地址",width = 25)
+    private String address;
+
+    @Excel(name = "电话",width = 25)
+    private String telPhone;
+
+    @Excel(name = "*开户银行名称",width = 25)
+    private String openBank;
+
+    @Excel(name = "银行账号",width = 25)
+    private String bankAccount;
+
+    @Excel(name = "关联红字发票的发票编号",width = 25)
+    private String redInvoiceRelevancyNumber;
+
+    @Excel(name = "*开票内容",width = 30)
+    private String billingContent;
+
+    @Excel(name = "开票内容要求",width = 30)
+    private String billingContentTerms;
+
+    @Excel(name = "实际开票人",width = 30)
+    private String billingPeopleRealName;
+
+    @Excel(name = "接收邮箱",width = 30)
+    private String actualDrawerEmailAddress;
+
+    @Excel(name = "对账人",width = 30)
+    private String reconciliationPeopleName;
+
+    @Excel(name = "对账地区",width = 30)
+    private String reconciliationArea;
+
+}

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java

@@ -111,4 +111,6 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
 
 
     List<String> getByProgramName(@Param("programName") String programName);
+
+    List<CwProjectRecordsDTO> selectAllList(@Param("userId") String userId);
 }

+ 25 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectRecordsMapper.xml

@@ -723,4 +723,29 @@
         select id from cw_project_records where project_name like concat('%',#{programName},'%') and del_flag=0
     </select>
 
+    <select id="selectAllList" resultType="com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as createName,
+        cw_wci.contract_name,
+        cw_wci.contract_amount,
+        cw_wci.contract_num,
+        cw_wci.payer_subject,
+        cw_wci.payment_method,
+        cw_wcb.name as clientContactsName,
+        cw_pbt.name as business_type_name,
+        new_line.report_no as reportNo
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = a.contract_id and cw_wci.del_flag = '0'
+        left join cw_work_client_base cw_wcb on cw_wci.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join cw_project_business_type cw_pbt on cw_pbt.id = a.business_type and cw_pbt.del_flag = '0'
+        left join cw_project_report pr on a.id =pr.project_id and pr.del_flag = '0'
+        left join cw_project_report_new_line new_line on pr.id = new_line.report_id and new_line.del_flag = '0'
+        where a.del_flag = '0' and a.create_by_id = #{userId}
+        ORDER BY a.create_time DESC
+    </select>
+
+
 </mapper>

+ 1 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java

@@ -261,4 +261,5 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
     IPage<CwProjectReportData> findNotCompletedList(Page<CwProjectReportData> page, @Param("isBmzr") String isBmzr, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportData> queryWrapper);
     IPage<CwProjectReportData> findNotCompletedList2(Page<CwProjectReportData> page,@Param("isBmzr") String isBmzr, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportData> queryWrapper);
 
+    List<CwProjectReportData> getList(@Param("userId")String userId);
 }

+ 37 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProjectReportMapper.xml

@@ -1394,5 +1394,42 @@
         where rna.review_status not in ('0','1') and a.invoice_number = #{invoiceNumber} and a.del_flag = 0 and a.id != #{id}
     </select>
 
+    <select id="getList" resultType="com.jeeplus.finance.projectReport.domain.CwProjectReportData">
+        select
+            a.id,
+            a.create_by_id as createById,
+            a.create_time,
+            a.update_by_id,
+            a.update_time,
+            a.del_flag,
+            a.remarks,
+            a.status,
+            a.document_no,
+            a.project_report_number,
+            a.project_id,
+            a.office_id,
+            a.signature_type,
+            a.signature_annotator1,
+            a.signature_annotator2,
+            a.signature_contract_id,
+            a.real_create,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.signature_annotator_status,
+            cw_pro.project_number as projectNumber,
+            cw_pro.project_name as projectName,
+            cw_prnl.report_no as "reportNo",
+            cw_wci.contract_name
+        from
+            cw_project_report a
+        left join
+            cw_project_report_new_line cw_prnl on a.id=cw_prnl.report_id
+        left join cw_project_records cw_pro on cw_pro.id = a.project_id and cw_pro.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = cw_pro.contract_id and cw_wci.del_flag = '0'
+        where
+            a.del_flag = '0' and cw_prnl.del_flag = '0' and a.status = '5' and a.create_by_id = #{userId}
+        order by a.create_time desc
+    </select>
+
 
 </mapper>

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/CwWorkClientBillingMapper.java

@@ -17,6 +17,8 @@ import java.util.List;
 public interface CwWorkClientBillingMapper extends BaseMapper<CwWorkClientBilling> {
 
     List<CwWorkClientBillingDTO> getBillingListByClientId(@Param(Constants.WRAPPER) QueryWrapper<CwWorkClientBilling> queryWrapper);
+    //获取信息
+    List<CwWorkClientBillingDTO> getList();
 }
 
 

+ 9 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBillingMapper.xml

@@ -46,4 +46,13 @@
         from cw_work_client_billing cw_wcbi
         ${ew.customSqlSegment}
     </select>
+
+    <select id="getList" resultMap="BaseResultMap">
+        select
+        <include refid="Billing_Column_List"></include>
+        from cw_work_client_billing cw_wcbi
+        left join cw_work_client_base wcb on cw_wcbi.client_id = wcb.id and wcb.del_flag = '0'
+        where cw_wcbi.del_flag = '0'
+        order by cw_wcbi.create_time desc
+    </select>
 </mapper>

BIN
jeeplus-modules/jeeplus-finance/src/main/resources/dot/发票导入模板.xlsx