فهرست منبع

选择其他类进行开票,则在发票信息中添加选择项“报备类型”(项目中的报备类型)。用于对其他类开票数据的展示

lijt 1 سال پیش
والد
کامیت
9723e07893

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoice.java

@@ -184,6 +184,11 @@ public class CwFinanceInvoice extends BaseEntity {
      * 实际开票单位的开票信息id
      */
     private String billingId;
+    /**
+     * 报备类型
+     */
+    private String reportType;
+
 
     private static final long serialVersionUID = 1L;
 }

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.test.cw.invoice.domain.CwFinanceInvoice;
+import com.jeeplus.test.cw.invoice.domain.CwFinanceInvoiceBase;
 import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -32,6 +33,14 @@ public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
      * @param id
      */
     void setReceivablesDateNull(@Param("id") String id);
+
+    /**
+     *查询对应的发票信息
+     * @param invoiceId
+     * @return
+     */
+    List<CwFinanceInvoiceBase> selectProgramName(String invoiceId);
+
 }
 
 

+ 85 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -47,6 +47,7 @@
             <result property="isMultiple" column="is_multiple" jdbcType="VARCHAR"/>
             <result property="billingId" column="billing_id" jdbcType="VARCHAR"/>
             <result property="billingId" column="billing_id" jdbcType="VARCHAR"/>
+            <result property="reportType" column="report_type" jdbcType="VARCHAR"/>
             <association property="financeInvoiceInvalidDTO" column="id" select="getFii" javaType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceInvalidDTO"></association>
             <collection property="financeInvoiceReceivablesDTOList" column="id" select="getFirList" ofType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO"></collection>
             <collection property="financeInvoiceBaseDTOList" column="id" select="getBaseList" ofType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceBaseDTO"></collection>
@@ -151,7 +152,8 @@
         fi.invalid_status,
         fi.receivables_date,
         fi.is_multiple,
-        fi.billing_id
+        fi.billing_id,
+        fi.report_type
     </sql>
 
     <sql id="File_Column_List">
@@ -229,6 +231,7 @@
 
         where fib.del_flag = '0' and fib.invoice_id = ${id}
     </select>
+<!--
     <select id="findList" resultMap="BaseResultMap">
         select
         DISTINCT
@@ -255,8 +258,65 @@
         ${ew.customSqlSegment}
         ORDER BY
         fi.create_date DESC, cfid.number asc
+    </select>-->
+    <select id="findList" resultMap="BaseResultMap">
+        SELECT
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.NAME AS operator,
+        so.NAME AS operator_office,
+        wipr1.program_id,
+        (case when (wipr1.program_id IS NULL or wipr1.program_id = '') then
+        concat( '其他:', wipr1.program_name ) else (select rpr1.project_name from cw_project_records rpr1 where wipr1.program_id = rpr1.id ) end) as 'programName',
+
+        cfid.number AS "number",
+        cfid.account AS "accountDetail"
+        from cw_finance_invoice_base wipr1
+        left join cw_finance_invoice fi on fi.id = wipr1.invoice_id
+        LEFT JOIN cw_finance_invoice_detail cfid ON cfid.invoice_id = fi.id
+        AND cfid.del_flag = '0'
+        LEFT JOIN sys_user su ON fi.create_by = su.id
+        AND su.del_flag = '0'
+        LEFT JOIN sys_user_manage_office sumo ON sumo.office_id = su.office_id
+        LEFT JOIN sys_office so ON su.office_id = so.id
+        AND so.del_flag = '0'
+        ${ew.customSqlSegment}
+        ORDER BY
+        fi.create_date DESC,
+        cfid.number ASC
     </select>
 
+
+<!--    <select id="findList" resultMap="BaseResultMap">-->
+<!--        select-->
+<!--        DISTINCT-->
+<!--        <include refid="Base_Column_List"></include>,-->
+<!--            su.name AS operator,-->
+<!--            so.name AS operator_office,-->
+<!--            d.ID_ AS task_id,-->
+<!--            rpr1.project_name AS programName,-->
+<!--            cfid.number AS "number",-->
+<!--            cfid.account AS "accountDetail"-->
+<!--        FROM cw_finance_invoice_base wipr1-->
+<!--                 LEFT JOIN cw_finance_invoice fi ON fi.id = wipr1.invoice_id-->
+<!--                 LEFT JOIN cw_finance_invoice_detail cfid ON cfid.invoice_id = fi.id AND cfid.del_flag = '0'-->
+<!--                 LEFT JOIN sys_user su ON fi.create_by = su.id AND su.del_flag = '0'-->
+<!--                 LEFT JOIN sys_user_manage_office sumo ON sumo.office_id = su.office_id-->
+<!--                 LEFT JOIN sys_office so ON su.office_id = so.id AND so.del_flag = '0'-->
+<!--                 LEFT JOIN act_ru_task d ON fi.proc_ins_id = d.PROC_INST_ID_-->
+<!--                 LEFT JOIN cw_project_records rpr1 ON wipr1.program_id = rpr1.id-->
+<!--        WHERE fi.no IN (-->
+<!--            SELECT fi2.no-->
+<!--            FROM cw_finance_invoice_base wipr2-->
+<!--                     LEFT JOIN cw_finance_invoice fi2 ON fi2.id = wipr2.invoice_id-->
+<!--                     LEFT JOIN cw_project_records rpr2 ON wipr2.program_id = rpr2.id-->
+<!--            GROUP BY fi2.no-->
+<!--            HAVING COUNT(rpr2.project_name) > 1-->
+<!--        )-->
+<!--        ORDER BY fi.create_date DESC, cfid.number ASC;-->
+<!--    </select>-->
+
+
     <select id="queryById" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"></include>
@@ -264,6 +324,7 @@
         where fi.del_flag = '0' and fi.id = #{id}
     </select>
 
+
     <select id="getIdByProjectId" resultType="string">
         select
             invoice_id
@@ -304,8 +365,31 @@
         from cw_finance_invoice cw_fi
         where cw_fi.del_flag = '0' and cw_fi.billing_workplace_real_id = #{id}
     </select>
+    <select id="selectProgramName" resultType="com.jeeplus.test.cw.invoice.domain.CwFinanceInvoiceBase">
+        select
+            id,
+            create_by,
+            create_date,
+            update_by,
+            update_date,
+            del_flag,
+            invoice_id,
+            program_id,
+            program_name,
+            contract_name,
+            program_no,
+            contract_id,
+            account
+            from  cw_finance_invoice_base where invoice_id = #{invoiceId}
+    </select>
 
     <update id="setReceivablesDateNull" parameterType="string">
         update cw_finance_invoice set receivables_date = null where id = #{id}
     </update>
+
+
+
 </mapper>
+
+
+

+ 11 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/CwFinanceInvoiceService.java

@@ -87,7 +87,9 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
     }
 
     public IPage<CwFinanceInvoiceDTO> findList(Page<CwFinanceInvoiceDTO> page, CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
-        QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
+        QueryWrapper<CwFinanceInvoice> queryWrapper =
+                QueryWrapperGenerator.buildQueryCondition
+                        ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
         queryWrapper.eq("fi.del_flag","0");
         ArrayList<String> searchIdList = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -95,8 +97,11 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
         if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO)) {
             // 发票号查询
             if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getNumber())) {
-                List<CwFinanceInvoiceDetail> cwFinanceInvoiceDetails = cwFinanceInvoiceDetailMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoiceDetail>().like(CwFinanceInvoiceDetail::getNumber, cwFinanceInvoiceDTO.getNumber()));
-                List<String> ids = cwFinanceInvoiceDetails.stream().distinct().map(CwFinanceInvoiceDetail::getInvoiceId).collect(Collectors.toList());
+                List<CwFinanceInvoiceDetail> cwFinanceInvoiceDetails =
+                        cwFinanceInvoiceDetailMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoiceDetail>()
+                                .like(CwFinanceInvoiceDetail::getNumber, cwFinanceInvoiceDTO.getNumber()));
+                List<String> ids = cwFinanceInvoiceDetails.stream().distinct()
+                        .map(CwFinanceInvoiceDetail::getInvoiceId).collect(Collectors.toList());
                 if(CollectionUtil.isEmpty(ids)) {
                     return new Page<CwFinanceInvoiceDTO>();
                 }else{
@@ -196,6 +201,7 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
                     checkNum.getAndIncrement();
                 }
             }
+            boolean notBlank = StringUtils.isNotBlank(cwFinanceInvoiceDTO.getProgramId());
             // 项目名称
             if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getProgramId())){
                     List<CwFinanceInvoiceBase> cwFinanceInvoiceBaseList = cwFinanceInvoiceBaseMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoiceBase>()
@@ -279,13 +285,12 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
                 }
             }
         }*/
-        return cwFinanceInvoiceMapper.findList(page,queryWrapper,officeIds.toString());
+        return cwFinanceInvoiceMapper.findList(page, queryWrapper, officeIds.toString());
     }
 
     public CwFinanceInvoiceDTO queryById(String id) {
 
         CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceMapper.queryById(id);
-
         // 电话号获取
         if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO) && StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingId())) {
             CwWorkClientBilling cwWorkClientBilling = cwWorkClientBillingService.getById(cwFinanceInvoiceDTO.getBillingId());
@@ -316,6 +321,7 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
 
     public CwFinanceInvoice saveForm(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
         CwFinanceInvoice cwFinanceInvoice = CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO);
+        cwFinanceInvoice.setReportType(cwFinanceInvoiceDTO.getReportType());
         if (ObjectUtil.isNotEmpty(cwFinanceInvoice)) {
             if(StringUtils.isBlank(cwFinanceInvoice.getId())){
                 //获取当前登录人信息

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceDTO.java

@@ -321,5 +321,10 @@ public class CwFinanceInvoiceDTO extends BaseDTO {
      * */
     private String reportNo;
 
+    /**
+     * 报备类型
+     */
+    private String reportType;
+
     private static final long serialVersionUID = 1L;
 }

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml

@@ -228,7 +228,7 @@
         where wa.del_flag = '0' and wa.attachment_id = #{id}
     </select>
 
-    <select id="findList" resultMap="BaseResultMap">
+        <select id="findList" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"></include>,
         su.name as user_name,