瀏覽代碼

会计发票导入调整

sangwenwei 1 月之前
父節點
當前提交
4cbedb1622

+ 20 - 3
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -1228,16 +1228,33 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
      * @return
      */
     public String importFinance(List<CwFinanceImportDTO> listA, ArrayList<CwFinanceImportDTO> arrayList, HashMap<String, String> hashMap) {
+        ArrayList<String> projectNoList = new ArrayList<>();
+        ArrayList<String> reportNoList = new ArrayList<>();
+        ArrayList<String> clientList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(listA)){
+            for (CwFinanceImportDTO cwFinanceImportDTO : listA) {
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getProjectNo())){
+                    projectNoList.add(cwFinanceImportDTO.getProjectNo());
+                }
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getReportNo())){
+                    reportNoList.add(cwFinanceImportDTO.getReportNo());
+                }
+                if (StringUtils.isNotBlank(cwFinanceImportDTO.getBillingWorkplaceReal())){
+                    clientList.add(cwFinanceImportDTO.getBillingWorkplaceReal());
+                }
+            }
+        }
+
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
         //查询全部的项目信息
-        List<CwProjectRecordsDTO> projectRecordsList = cwProjectRecordsMapper.selectAllList(userDTO.getId());
+        List<CwProjectRecordsDTO> projectRecordsList = cwProjectRecordsMapper.selectAllList(userDTO.getId(),projectNoList);
         //查询全部的报告信息
-        List<CwProjectReportData> projectReportList = cwProjectReportMapper.getList(userDTO.getId());
+        List<CwProjectReportData> projectReportList = cwProjectReportMapper.getList(userDTO.getId(),reportNoList);
         //查询全部的发票信息
         List<CwFinanceInvoiceDTO> invoiceDTOList = cwFinanceInvoiceMapper.getList(userDTO.getId());
         //查询全部的客户信息
-        List<CwWorkClientBaseDTO> cwWorkClientBaseDTOList = cwWorkClientBaseMapper.getList();
+        List<CwWorkClientBaseDTO> cwWorkClientBaseDTOList = cwWorkClientBaseMapper.getList(clientList);
 
         if (CollectionUtils.isNotEmpty(listA)){
             for (CwFinanceImportDTO cwFinanceImportDTO : listA) {

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

@@ -13,6 +13,7 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -112,5 +113,5 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
 
     List<String> getByProgramName(@Param("programName") String programName);
 
-    List<CwProjectRecordsDTO> selectAllList(@Param("userId") String userId);
+    List<CwProjectRecordsDTO> selectAllList(@Param("userId") String userId, @Param("projectNoList")ArrayList<String> projectNoList);
 }

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

@@ -744,6 +744,12 @@
         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}
+        <if test="projectNoList != null">
+            and a.project_number in
+            <foreach collection="projectNoList" item="item" separator="," open="(" close=")" index="index">
+                #{item}
+            </foreach>
+        </if>
         ORDER BY a.create_time DESC
     </select>
 

+ 2 - 3
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java

@@ -7,14 +7,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.finance.projectReport.domain.*;
-import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
-import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -261,5 +260,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);
+    List<CwProjectReportData> getList(@Param("userId") String userId,@Param("reportNoList") ArrayList<String> reportNoList);
 }

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

@@ -1428,6 +1428,12 @@
         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}
+            <if test="reportNoList != null">
+                and cw_prnl.report_no in
+                <foreach collection="reportNoList" item="item" separator="," open="(" close=")" index="index">
+                    #{item}
+                </foreach>
+            </if>
         order by a.create_time desc
     </select>
 

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

@@ -1,6 +1,5 @@
 package com.jeeplus.finance.workClientInfo.mapper;
 
-import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
@@ -15,6 +14,7 @@ import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientTempDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -59,7 +59,7 @@ public interface CwWorkClientBaseMapper extends BaseMapper<CwWorkClientBase> {
 
     List<CwWorkClientBillingDTO> getBilling(@Param("id") String id);
 
-    List<CwWorkClientBaseDTO> getList();
+    List<CwWorkClientBaseDTO> getList(@Param("clientList") ArrayList<String> clientList);
 }
 
 

+ 10 - 16
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml

@@ -409,22 +409,16 @@
 
     <select id="getList" resultType="com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO">
         select
-        <include refid="Base_Column_List"></include>,
-        su.name as user_name,
-        cw_wct.is_listed as is_listed,
-        cw_wct.ownership_type as ownership_type,
-        cw_wct.final_status_type as final_status_type,
-        cw_mlt.name as manage_level_type_name,
-        cw_ot.name as organization_type_name,
-        su1.name as update_user_name,
-        cw_wct.client_id AS client_id,
-        art.ID_ as task_id
+        <include refid="Base_Column_List"></include>
         from cw_work_client_base cw_wcb
-        left join sys_user su on su.id = cw_wcb.create_by_id and su.del_flag = '0'
-        left join cw_work_client_type cw_wct on cw_wct.client_id = cw_wcb.id and cw_wct.del_flag = '0'
-        left join cw_manage_level_type cw_mlt on cw_mlt.id = cw_wcb.manage_level_type and cw_mlt.del_flag = '0'
-        left join cw_organization_type cw_ot on cw_ot.id = cw_wcb.organization_type and cw_ot.del_flag = '0'
-        left join sys_user su1 on su1.id = cw_wcb.update_user and su1.del_flag = '0'
-        left join act_ru_task art on cw_wcb.proc_ins_id = art.PROC_INST_ID_
+        where cw_wcb.del_flag = '0'
+        <if test="clientList != null">
+            and cw_wcb.name in
+            <foreach collection="clientList" item="item" separator="," open="(" close=")" index="index">
+                #{item}
+            </foreach>
+        </if>
+
+
     </select>
 </mapper>