ly před 1 rokem
rodič
revize
386d55fed1

+ 2 - 1
src/main/java/cn/ezhizao/project/business/receiveTicket/controller/BizFinancialReceiveTicketController.java

@@ -140,7 +140,8 @@ public class BizFinancialReceiveTicketController extends BaseController {
         setTenantId(bizFinancialReceiveTicket);
         startOrderBy();
         bizFinancialReceiveTicket.setIsZero(0);
-        List<BizFinancialReceiveTicket> list = bizFinancialReceiveTicketService.getList(bizFinancialReceiveTicket);
+//        List<BizFinancialReceiveTicket> list = bizFinancialReceiveTicketService.getList(bizFinancialReceiveTicket);
+        List<BizFinancialReceiveTicket> list = bizFinancialReceiveTicketService.getList2(bizFinancialReceiveTicket);
         for (BizFinancialReceiveTicket l : list) {
             l.setCurrentPeriod(bizFinancialReceiveTicket.getYear() + "-" + bizFinancialReceiveTicket.getMonth());
             BizFinancialReceiveTicketDetail detail = new BizFinancialReceiveTicketDetail();

+ 1 - 1
src/main/java/cn/ezhizao/project/business/receiveTicket/domain/BizFinancialReceiveTicket.java

@@ -181,7 +181,7 @@ public class BizFinancialReceiveTicket extends BaseEntity {
     @TableField(exist = false)
     private Long finishUserId;
     @TableField(exist = false)
-    @Excel(name = "上传人", sort = 8)
+//    @Excel(name = "上传人", sort = 10)
     private String finishUserName;
     @TableField(exist = false)
     private List<String> dateFilter;

+ 2 - 0
src/main/java/cn/ezhizao/project/business/receiveTicket/mapper/BizFinancialReceiveTicketMapper.java

@@ -26,4 +26,6 @@ public interface BizFinancialReceiveTicketMapper extends BaseMapper<BizFinancial
      * @return 删除结果
     */
     public int physicalDelete(BizFinancialReceiveTicket bizFinancialReceiveTicket);
+
+    List<BizFinancialReceiveTicket> getList2(BizFinancialReceiveTicket bizFinancialReceiveTicket);
 }

+ 1 - 0
src/main/java/cn/ezhizao/project/business/receiveTicket/service/IBizFinancialReceiveTicketService.java

@@ -27,4 +27,5 @@ public interface IBizFinancialReceiveTicketService extends IService<BizFinancial
      */
     public int physicalDelete(BizFinancialReceiveTicket bizFinancialReceiveTicket);
 
+    List<BizFinancialReceiveTicket> getList2(BizFinancialReceiveTicket bizFinancialReceiveTicket);
 }

+ 7 - 1
src/main/java/cn/ezhizao/project/business/receiveTicket/service/impl/BizFinancialReceiveTicketServiceImpl.java

@@ -38,6 +38,12 @@ public class BizFinancialReceiveTicketServiceImpl  extends ServiceImpl<BizFinanc
      * @return 删除结果
      */
     @Override
-    public int physicalDelete(BizFinancialReceiveTicket bizFinancialReceiveTicket){ return bizFinancialReceiveTicketMapper.physicalDelete(bizFinancialReceiveTicket); };
+    public int physicalDelete(BizFinancialReceiveTicket bizFinancialReceiveTicket){ return bizFinancialReceiveTicketMapper.physicalDelete(bizFinancialReceiveTicket); }
+
+    @Override
+    public List<BizFinancialReceiveTicket> getList2(BizFinancialReceiveTicket bizFinancialReceiveTicket) {
+        return bizFinancialReceiveTicketMapper.getList2(bizFinancialReceiveTicket);
+    }
+
 
 }

+ 1 - 0
src/main/resources/application.yml

@@ -31,6 +31,7 @@ server:
       max: 800
       # Tomcat启动初始化的线程数,默认值10
       min-spare: 100
+  timeout: 300000
 
 # 日志配置
 logging:

+ 77 - 0
src/main/resources/mybatis/business/BizFinancialReceiveTicketMapper.xml

@@ -10,6 +10,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <association property="serviceName" select="getServiceName" column="company_id" />
         <association property="socialCreditCode" select="getSocialCreditCode" column="company_id"/>
     </resultMap>
+    <resultMap type="cn.ezhizao.project.business.receiveTicket.domain.BizFinancialReceiveTicket" id="BizFinancialReceiveTicketResult2">
+        <id column="id" property="id"/>
+        <result column="company_id" jdbcType="BIGINT" property="companyId" />
+    </resultMap>
 
     <select id="getList" parameterType="BizFinancialReceiveTicket" resultMap="BizFinancialReceiveTicketResult">
         SELECT
@@ -93,6 +97,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT c.social_credit_code FROM biz_company c
         WHERE c.id =#{company_id}
     </select>
+    <select id="getList2"
+            parameterType="BizFinancialReceiveTicket" resultMap="BizFinancialReceiveTicketResult2">
+            SELECT
+            t1.*, t2.name as company_name,t2.customer_label_id, t4.lable as customerLabelName,
+            <!--        (select concat(frtd.year, '-', frtd.month) from biz_financial_receive_ticket_detail frtd where frtd.financial_receive_ticket_id = t1.id order by year desc, month desc limit 1) currentDate,-->
+            (select concat(bwor.year, '年', bwor.month, '月') from biz_work_order_record bwor where bwor.work_order_id = t1.work_order_id order by year desc, month desc limit 1) currentDate,
+            t3.account_name as from_company_name, t2.tax_type,
+            t5.verifier_id,
+            t6.nick_name as verifierName,
+            t5.verifier_time,
+            (t5.income_ticket+t5.cost_ticket+t5.fee_ticket_number+t5.ssaf_ticket+t5.salary_ticket+t5.bank_copy_number+t5.bank_slips_number+t5.other_ticket) as sumNumber
+            from biz_financial_receive_ticket t1
+            left join biz_company t2 on t2.id = t1.company_id
+            left join biz_tenant t3 on t3.id = t1.tenant_id
+            left join biz_lable t4 on t4.id = t2.customer_label_id
+            left join biz_financial_receive_ticket_detail t5 on t5.financial_receive_ticket_id = t1.id
+            and t5.deleted = 0 and t5.month = #{month} and t5.year = #{year} and t5.financial_receive_ticket_id = t1.id
+            left join sys_user t6 on t6.user_id = t5.verifier_id
+            WHERE
+            t1.deleted = 0
+            <if test="id != null">
+                AND t1.id = #{id}
+            </if>
+            <if test="principal != null and principal != ''">
+                AND (t2.leader_id=#{principal} OR t2.adviser_id=#{principal})
+            </if>
+            <if test="isZero != null">
+                AND t2.is_zero = #{isZero}
+            </if>
+            <if test="verifierName != null">
+                AND  t6.nick_name like concat('%', #{verifierName}, '%')
+            </if>
+            <if test="dateFilter != null and dateFilter.size()>0 ">
+                AND  (
+                DATE_FORMAT(t5.verifier_time,'%Y-%m-%d') &gt;= #{dateFilter[0]}
+                AND
+                DATE_FORMAT(t5.verifier_time,'%Y-%m-%d') &lt;= #{dateFilter[1]}
+                )
+            </if>
+            <if test="customerLabelId != null">
+                AND t2.customer_label_id = #{customerLabelId}
+            </if>
+            <if test="companyName != null and companyName != ''">
+                AND (t2.name like concat('%', #{companyName}, '%'))
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND (t2.name like concat('%', #{keyword}, '%') or t2.code like concat('%', #{keyword}, '%'))
+            </if>
+            <if test="taxType != null and taxType != ''">
+                AND t2.tax_type = #{taxType}
+            </if>
+            <if test="fromCompanyName != null and fromCompanyName != ''">
+                AND (t3.account_name like concat('%', #{fromCompanyName}, '%'))
+            </if>
+            <if test="month != null and year != null">
+                <if test="tenantId != null">
+                    AND exists (select 1 from biz_entrust eb
+                    where eb.deleted = 0
+                    and (eb.to_tenant_id = #{tenantId} or eb.from_tenant_id = #{tenantId})
+                    and date_format(eb.current_month, '%Y%m') = concat(#{year}, #{month})
+                    and eb.work_order_id = t1.work_order_id
+                    )
+                </if>
+                <if test="status != null and status != 0">
+                    AND exists (select 1 from biz_financial_receive_ticket_detail fsd where fsd.financial_receive_ticket_id = t1.id and
+                    fsd.month = #{month} and fsd.year = #{year} and fsd.status = #{status} <include refid="detailConditionSql" />)
+                </if>
+                <if test="status != null and status == 0">
+                    AND not exists (select 1 from biz_financial_receive_ticket_detail fsd where fsd.financial_receive_ticket_id = t1.id and
+                    fsd.month = #{month} and fsd.year = #{year})
+                </if>
+            </if>
+    </select>
 
     <delete id="physicalDelete">
         DELETE FROM biz_financial_receive_ticket