changhaoning пре 1 година
родитељ
комит
f1c69287f8
25 измењених фајлова са 3027 додато и 3 уклоњено
  1. 7 0
      pom.xml
  2. 66 0
      src/main/java/com/dk/mdm/controller/mst/ReceiptController.java
  3. 41 0
      src/main/java/com/dk/mdm/controller/mst/ReceiptItemController.java
  4. 10 0
      src/main/java/com/dk/mdm/infrastructure/convert/mst/ReceiptConvert.java
  5. 2 0
      src/main/java/com/dk/mdm/mapper/mst/CompanyMapper.xml
  6. 7 1
      src/main/java/com/dk/mdm/mapper/mst/CpTradeMapper.java
  7. 32 2
      src/main/java/com/dk/mdm/mapper/mst/CpTradeMapper.xml
  8. 31 0
      src/main/java/com/dk/mdm/mapper/mst/ReceiptItemMapper.java
  9. 247 0
      src/main/java/com/dk/mdm/mapper/mst/ReceiptItemMapper.xml
  10. 32 0
      src/main/java/com/dk/mdm/mapper/mst/ReceiptMapper.java
  11. 395 0
      src/main/java/com/dk/mdm/mapper/mst/ReceiptMapper.xml
  12. 54 0
      src/main/java/com/dk/mdm/model/pojo/mst/CpTrade.java
  13. 292 0
      src/main/java/com/dk/mdm/model/pojo/mst/Receipt.java
  14. 167 0
      src/main/java/com/dk/mdm/model/pojo/mst/ReceiptItem.java
  15. 53 0
      src/main/java/com/dk/mdm/model/query/mst/CpTradeQuery.java
  16. 167 0
      src/main/java/com/dk/mdm/model/query/mst/ReceiptItemQuery.java
  17. 292 0
      src/main/java/com/dk/mdm/model/query/mst/ReceiptQuery.java
  18. 2 0
      src/main/java/com/dk/mdm/model/response/mst/CompanyResponse.java
  19. 54 0
      src/main/java/com/dk/mdm/model/response/mst/CpTradeResponse.java
  20. 213 0
      src/main/java/com/dk/mdm/model/response/mst/ReceiptItemResponse.java
  21. 299 0
      src/main/java/com/dk/mdm/model/response/mst/ReceiptResponse.java
  22. 292 0
      src/main/java/com/dk/mdm/model/vo/mst/ReceiptVO.java
  23. 38 0
      src/main/java/com/dk/mdm/service/mst/ReceiptItemService.java
  24. 142 0
      src/main/java/com/dk/mdm/service/mst/ReceiptService.java
  25. 92 0
      src/main/java/com/dk/mdm/shiro/mail/MailHelper.java

+ 7 - 0
pom.xml

@@ -163,6 +163,13 @@
             <artifactId>shiro-ehcache</artifactId>
             <version>${spring.shiro.version}</version>
         </dependency>
+
+        <!-- 邮件发送 -->
+        <dependency>
+            <groupId>com.sun.mail</groupId>
+            <artifactId>javax.mail</artifactId>
+            <version>1.6.2</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 66 - 0
src/main/java/com/dk/mdm/controller/mst/ReceiptController.java

@@ -0,0 +1,66 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.model.pojo.mst.Receipt;
+import com.dk.common.service.BaseService;
+import com.dk.mdm.model.query.mst.ReceiptQuery;
+import com.dk.mdm.model.response.mst.ReceiptResponse;
+import com.dk.mdm.model.vo.mst.GoodsCategoryVO;
+import com.dk.mdm.model.vo.mst.ReceiptVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.ReceiptService;
+
+import java.util.List;
+
+@Api(tags = "发票管理API接口")
+@RestController
+@RequestMapping("/mst/receipt")
+public class ReceiptController{
+
+    public BaseService<Receipt> getService() {
+        return receiptService;
+    }
+
+    @Autowired
+    private ReceiptService receiptService;
+
+    /**
+     * @desc   : 条件查询
+     * @author : 常皓宁
+     * @date   : 2024/4/12 10:19
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<ReceiptResponse>> selectByCond(@RequestBody ReceiptQuery receiptQuery) {
+        return receiptService.selectByCond(receiptQuery);
+    }
+
+    /**
+     * @desc : 查看总单加明细
+     * @author : 常皓宁
+     * @date : 2024/3/6 10:36
+     */
+    @ApiOperation(value = "条件查询", notes = "条件查询")
+    @PostMapping({"select_all_and_item"})
+    public ResponseResultVO<List<ReceiptResponse>> selectInboundAndItem(@RequestBody ReceiptQuery receiptQuery) {
+        return receiptService.selectAllAndItem(receiptQuery);
+    }
+
+    /**
+     * @desc   : 开发票
+     * @author : 常皓宁
+     * @date   : 2024/8/2 8:44
+     */
+    @ApiOperation( value = "开发票", notes = "开发票" )
+        @PostMapping({"invoicing"})
+    public ResponseResultVO<?> invoicing(@RequestBody ReceiptVO receiptVO) {
+        return receiptService.invoicing(receiptVO);
+    }
+}

+ 41 - 0
src/main/java/com/dk/mdm/controller/mst/ReceiptItemController.java

@@ -0,0 +1,41 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.model.pojo.mst.ReceiptItem;
+import com.dk.common.service.BaseService;
+import com.dk.mdm.model.query.mst.ReceiptItemQuery;
+import com.dk.mdm.model.response.mst.ReceiptItemResponse;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.ReceiptItemService;
+
+@Api(tags = "发票管理API接口")
+@RestController
+@RequestMapping("/mst/receiptItem")
+public class ReceiptItemController{
+
+    public BaseService<ReceiptItem> getService() {
+        return receiptItemService;
+    }
+
+    @Autowired
+    private ReceiptItemService receiptItemService;
+
+    /**
+     * @desc   : 条件查询
+     * @author : 常皓宁
+     * @date   : 2024/4/12 10:19
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<ReceiptItemResponse>> selectByCond(@RequestBody ReceiptItemQuery receiptItemQuery) {
+        return receiptItemService.selectByCond(receiptItemQuery);
+    }
+}
+

+ 10 - 0
src/main/java/com/dk/mdm/infrastructure/convert/mst/ReceiptConvert.java

@@ -0,0 +1,10 @@
+package com.dk.mdm.infrastructure.convert.mst;
+
+import com.dk.mdm.model.pojo.mst.Receipt;
+import com.dk.mdm.model.vo.mst.ReceiptVO;
+import org.mapstruct.Mapper;
+
+@Mapper(componentModel = "spring")
+public interface ReceiptConvert {
+    Receipt convertToPo(ReceiptVO receiptVO);
+}

+ 2 - 0
src/main/java/com/dk/mdm/mapper/mst/CompanyMapper.xml

@@ -274,6 +274,8 @@
         <include refid="Base_Column_List_list"/>
         ,tss.svc_ip
         ,tss.svc_port
+        ,case when (select count(1) from dkic_a.t_mst_receipt tmr where tmr.receipt_status = '发票状态-申请' and tmr.cp_id = tac.cp_id) > 0
+        then TRUE else false END as "invoicingFlag"
         FROM dkic_a.t_a_company tac
         left join dkic_a.t_s_service tss
         on tac.svc_code = tss.svc_code

+ 7 - 1
src/main/java/com/dk/mdm/mapper/mst/CpTradeMapper.java

@@ -27,6 +27,12 @@ public interface CpTradeMapper extends BaseMapper<CpTrade>{
      * @date : 2024/2/26 10:36
      */
     Long countByCond(CpTradeQuery cpTradeQuery);
-	
+
+    /**
+     * @desc   : 修改发票状态
+     * @author : 常皓宁
+     * @date   : 2024/8/2 14:14
+     */
+	Integer updateReciptStatus(Integer CpTradeId);
 }
 

+ 32 - 2
src/main/java/com/dk/mdm/mapper/mst/CpTradeMapper.xml

@@ -5,7 +5,7 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        trade_id, trade_no, cp_id, wx_user_id, trade_amount, trade_time, trade_type, buy_long, buy_begin_date, buy_end_date, buy_fun_id, buy_grade_code, wx_trade_no, extend_days, dk_user_id, trade_status
+        trade_id, trade_no, cp_id, wx_user_id, trade_amount, trade_time, trade_type, buy_long, buy_begin_date, buy_end_date, buy_fun_id, buy_grade_code, wx_trade_no, extend_days, dk_user_id, trade_status,activity_id,activity_item_id,activity_ids,activity_item_ids,trade_desc,receipt_status,receipt_date
     </sql>
 
     <!-- 通用查询列 -->
@@ -24,7 +24,14 @@
         tct.wx_trade_no,
         tct.extend_days,
         tct.dk_user_id,
-        tct.trade_status
+        tct.trade_status,
+        tct.activity_id,
+        tct.activity_item_id,
+        tct.activity_ids,
+        tct.activity_item_ids,
+        tct.trade_desc,
+        tct.receipt_status,
+        tct.receipt_date
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -45,6 +52,13 @@
                 <result column="extend_days" property="extendDays"/>
                 <result column="dk_user_id" property="dkUserId" typeHandler="UuidTypeHandler"/>
                 <result column="trade_status" property="tradeStatus"/>
+                <result column="activity_id" property="activityId"/>
+                <result column="activity_item_id" property="activityItemId"/>
+                <result column="activity_ids" property="activityIds" typeHandler="UuidListTypeHandler"/>
+                <result column="activity_item_ids" property="activityItemIds" typeHandler="UuidListTypeHandler"/>
+                <result column="trade_desc" property="tradeDesc"/>
+                <result column="receipt_status" property="receiptStatus"/>
+                <result column="receipt_date" property="receiptDate" typeHandler="TimestampTypeHandler"/>
     </resultMap>
 
     <!-- 通用查询映射结果 -->
@@ -66,6 +80,13 @@
         <result column="dk_user_id" property="dkUserId" typeHandler="UuidTypeHandler"/>
         <result column="trade_status" property="tradeStatus"/>
         <result column="cp_name" property="cpName"/>
+        <result column="activity_id" property="activityId"/>
+        <result column="activity_item_id" property="activityItemId"/>
+        <result column="activity_ids" property="activityIds" typeHandler="UuidListTypeHandler"/>
+        <result column="activity_item_ids" property="activityItemIds" typeHandler="UuidListTypeHandler"/>
+        <result column="trade_desc" property="tradeDesc"/>
+        <result column="receipt_status" property="receiptStatus"/>
+        <result column="receipt_date" property="receiptDate" typeHandler="TimestampTypeHandler"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -272,4 +293,13 @@
             )
         </foreach>
     </insert>
+
+    <!-- 修改发票状态-->
+    <update id="updateReciptStatus">
+    UPDATE dkic_a.t_cp_trade
+    SET
+        receipt_status = '开票状态-已开票',
+        receipt_date = now()
+    WHERE  trade_id =#{CpTradeId}
+</update>
 </mapper>

+ 31 - 0
src/main/java/com/dk/mdm/mapper/mst/ReceiptItemMapper.java

@@ -0,0 +1,31 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.ReceiptItem;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.ReceiptItemQuery;
+import com.dk.mdm.model.response.mst.ReceiptItemResponse;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+*  发票管理 Mapper
+*/
+@Repository
+public interface ReceiptItemMapper extends BaseMapper<ReceiptItem>{
+
+    /**
+     * @desc   : 根据条件进行查询
+     * @author : 常皓宁
+     * @date : 2024/2/26 10:36
+     */
+    List<ReceiptItemResponse> selectByCond(ReceiptItemQuery receiptItemQuery);
+
+    /**
+     * @desc   : 根据条件进行查询(数量)
+     * @author : 常皓宁
+     * @date : 2024/2/26 10:36
+     */
+    Long countByCond(ReceiptItemQuery receiptItemQuery);
+}
+

+ 247 - 0
src/main/java/com/dk/mdm/mapper/mst/ReceiptItemMapper.xml

@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dk.mdm.mapper.mst.ReceiptItemMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        item_id, receipt_id, cp_id, trade_id, item_amt, flg_valid, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.ReceiptItem">
+        <id column="item_id" property="itemId"/>
+                <result column="receipt_id" property="receiptId" typeHandler="UuidTypeHandler"/>
+                <result column="cp_id" property="cpId"/>
+                <result column="trade_id" property="tradeId"/>
+                <result column="item_amt" property="itemAmt"/>
+                <result column="flg_valid" property="flgValid"/>
+            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_create_user_id" property="opCreateUserId"/>
+            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_update_user_id" property="opUpdateUserId"/>
+                <result column="op_app_code" property="opAppCode"/>
+            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+                <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="receiptId != null and receiptId != ''">
+                AND receipt_id = #{receiptId}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+            <if test="tradeId != null and tradeId != ''">
+                AND trade_id = #{tradeId}
+            </if>
+            <if test="itemAmt != null">
+                AND item_amt = #{itemAmt}
+            </if>
+            <if test="flgValid != null">
+                AND flg_valid = #{flgValid}
+            </if>
+            <if test="opCreateTime != null">
+                AND op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null">
+                AND op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null">
+                AND op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+
+
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List_list">
+        tmri.item_id,
+        tmri.receipt_id,
+        tmri.cp_id,
+        tmri.trade_id,
+        tmri.item_amt,
+        tmri.flg_valid,
+        tmri.op_create_time,
+        tmri.op_create_user_id,
+        tmri.op_update_time,
+        tmri.op_update_user_id,
+        tmri.op_app_code,
+        tmri.op_timestamp,
+        tmri.op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap_list" type="com.dk.mdm.model.response.mst.ReceiptItemResponse">
+        <id column="item_id" property="itemId"/>
+        <result column="receipt_id" property="receiptId" typeHandler="UuidTypeHandler"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="trade_id" property="tradeId"/>
+        <result column="item_amt" property="itemAmt"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
+        <result column="trade_time" property="tradeTime" typeHandler="TimestampTypeHandler"/>
+        <result column="receipt_date" property="receiptDate" typeHandler="TimestampTypeHandler"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition_list">
+        <where>
+            <if test="receiptId != null and receiptId != ''">
+                AND tmri.receipt_id = #{receiptId}::uuid
+            </if>
+            <if test="cpId != null">
+                AND tmri.cp_id = #{cpId}
+            </if>
+            <if test="tradeId != null and tradeId != ''">
+                AND tmri.trade_id = #{tradeId}
+            </if>
+            <if test="itemAmt != null">
+                AND tmri.item_amt = #{itemAmt}
+            </if>
+            <if test="flgValid != null">
+                AND tmri.flg_valid = #{flgValid}
+            </if>
+            <if test="opCreateTime != null">
+                AND tmri.op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null">
+                AND tmri.op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND tmri.op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null">
+                AND tmri.op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND tmri.op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND tmri.op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND tmri.op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键itemId批量操作 -->
+        WHERE item_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表dkic_a.t_mst_receipt_item,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap_list">
+        SELECT
+        <include refid="Base_Column_List_list"/>
+        ,tct.trade_no as "tradeNo"
+        ,tct.trade_amount as "tradeAmount"
+        ,tct.trade_time
+        ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "tradeTypeName"
+        ,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "tradeStatusName"
+        ,tct.buy_long as "buyLong"
+        ,tct.buy_begin_date as "buyBeginDate"
+        ,tct.buy_end_date as "buyEndDate"
+        ,tg.grade_name as "gradeName"
+        ,tct.wx_trade_no as "wxTradeNo"
+        ,tct.extend_days as "extendDays"
+        ,tct.trade_desc as "tradeDesc"
+        ,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "receiptStatusName"
+        ,tct.receipt_date
+        FROM dkic_a.t_mst_receipt_item tmri
+        left join dkic_a.t_cp_trade as tct
+        on tmri.trade_id = tct.trade_id
+        left JOIN sys.t_data_kind as tdk1 on tct.trade_type = tdk1.kind_code
+        left JOIN sys.t_data_kind as tdk2 on tct.trade_status = tdk2.kind_code
+        left JOIN sys.t_data_kind as tdk3 on tct.receipt_status = tdk3.kind_code
+        left JOIN sys.t_grade as tg on tct.buy_grade_code = tg.grade_code
+        <include refid="Condition_list"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表dkic_a.t_mst_receipt_item,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_a.t_mst_receipt_item tmri
+        <include refid="Condition_list"/>
+    </select>
+
+    <!-- 根据主键查询表dkic_a.t_mst_receipt_item的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt_item
+        WHERE item_id = #{itemId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表dkic_a.t_mst_receipt_item的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt_item
+        WHERE item_id = #{itemId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表dkic_a.t_mst_receipt_item的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt_item
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into dkic_a.t_mst_receipt_item
+        (
+        <trim suffixOverrides=",">
+            receipt_id,
+            cp_id,
+            trade_id,
+            item_amt,
+            op_app_code,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.receiptId}::uuid,
+                #{item.cpId},
+                #{item.tradeId}::uuid,
+                #{item.itemAmt},
+                #{item.opAppCode},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 32 - 0
src/main/java/com/dk/mdm/mapper/mst/ReceiptMapper.java

@@ -0,0 +1,32 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.Receipt;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.ReceiptQuery;
+import com.dk.mdm.model.response.mst.ReceiptResponse;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+*  发票管理 Mapper
+*/
+@Repository
+public interface ReceiptMapper extends BaseMapper<Receipt>{
+
+    /**
+     * @desc   : 根据条件进行查询
+     * @author : 常皓宁
+     * @date : 2024/2/26 10:36
+     */
+    List<ReceiptResponse> selectByCond(ReceiptQuery receiptQuery);
+
+    /**
+     * @desc   : 根据条件进行查询(数量)
+     * @author : 常皓宁
+     * @date : 2024/2/26 10:36
+     */
+    Long countByCond(ReceiptQuery receiptQuery);
+
+}
+

+ 395 - 0
src/main/java/com/dk/mdm/mapper/mst/ReceiptMapper.xml

@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dk.mdm.mapper.mst.ReceiptMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        receipt_id, receipt_set_id, receipt_status, receipt_type, apply_staff, apply_date, cp_id, cp_name, tax_no, cp_email, cp_address, cp_phone, open_bank, bank_account, receipt_amt, receipt_content, receipt_date, receipt_staff, receipt_obj, tax_rate, flg_valid, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.Receipt">
+        <id column="receipt_id" property="receiptId"/>
+                <result column="receipt_set_id" property="receiptSetId" typeHandler="UuidTypeHandler"/>
+                <result column="receipt_status" property="receiptStatus"/>
+                <result column="receipt_type" property="receiptType"/>
+                <result column="apply_staff" property="applyStaff"/>
+            <result column="apply_date" property="applyDate" typeHandler="TimestampTypeHandler"/>
+                <result column="cp_id" property="cpId"/>
+                <result column="cp_name" property="cpName"/>
+                <result column="tax_no" property="taxNo"/>
+                <result column="cp_email" property="cpEmail"/>
+                <result column="cp_address" property="cpAddress"/>
+                <result column="cp_phone" property="cpPhone"/>
+                <result column="open_bank" property="openBank"/>
+                <result column="bank_account" property="bankAccount"/>
+                <result column="receipt_amt" property="receiptAmt"/>
+                <result column="receipt_content" property="receiptContent"/>
+            <result column="receipt_date" property="receiptDate" typeHandler="TimestampTypeHandler"/>
+                <result column="receipt_staff" property="receiptStaff"/>
+                <result column="receipt_obj" property="receiptObj"/>
+                <result column="tax_rate" property="taxRate"/>
+                <result column="flg_valid" property="flgValid"/>
+            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_create_user_id" property="opCreateUserId"/>
+            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_update_user_id" property="opUpdateUserId"/>
+                <result column="op_app_code" property="opAppCode"/>
+            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+                <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="receiptSetId != null and receiptSetId != ''">
+                AND receipt_set_id = #{receiptSetId}
+            </if>
+            <if test="receiptStatus != null and receiptStatus != ''">
+                AND receipt_status = #{receiptStatus}
+            </if>
+            <if test="receiptType != null and receiptType != ''">
+                AND receipt_type = #{receiptType}
+            </if>
+            <if test="applyStaff != null and applyStaff != ''">
+                AND apply_staff = #{applyStaff}
+            </if>
+            <if test="applyDate != null">
+                AND apply_date = #{applyDate}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+            <if test="cpName != null and cpName != ''">
+                AND cp_name = #{cpName}
+            </if>
+            <if test="taxNo != null and taxNo != ''">
+                AND tax_no = #{taxNo}
+            </if>
+            <if test="cpEmail != null and cpEmail != ''">
+                AND cp_email = #{cpEmail}
+            </if>
+            <if test="cpAddress != null and cpAddress != ''">
+                AND cp_address = #{cpAddress}
+            </if>
+            <if test="cpPhone != null and cpPhone != ''">
+                AND cp_phone = #{cpPhone}
+            </if>
+            <if test="openBank != null and openBank != ''">
+                AND open_bank = #{openBank}
+            </if>
+            <if test="bankAccount != null and bankAccount != ''">
+                AND bank_account = #{bankAccount}
+            </if>
+            <if test="receiptAmt != null">
+                AND receipt_amt = #{receiptAmt}
+            </if>
+            <if test="receiptContent != null and receiptContent != ''">
+                AND receipt_content = #{receiptContent}
+            </if>
+            <if test="receiptDate != null">
+                AND receipt_date = #{receiptDate}
+            </if>
+            <if test="receiptStaff != null and receiptStaff != ''">
+                AND receipt_staff = #{receiptStaff}
+            </if>
+            <if test="receiptObj != null and receiptObj != ''">
+                AND receipt_obj = #{receiptObj}
+            </if>
+            <if test="taxRate != null">
+                AND tax_rate = #{taxRate}
+            </if>
+            <if test="flgValid != null">
+                AND flg_valid = #{flgValid}
+            </if>
+            <if test="opCreateTime != null">
+                AND op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null">
+                AND op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null">
+                AND op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+
+
+
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List_list">
+        tmr.receipt_id,
+        tmr.receipt_set_id,
+        tmr.receipt_status,
+        tmr.receipt_type,
+        tmr.apply_staff,
+        tmr.apply_date,
+        tmr.cp_id,
+        tmr.cp_name,
+        tmr.tax_no,
+        tmr.cp_email,
+        tmr.cp_address,
+        tmr.cp_phone,
+        tmr.open_bank,
+        tmr.bank_account,
+        tmr.receipt_amt,
+        tmr.receipt_content,
+        tmr.receipt_date,
+        tmr.receipt_staff,
+        tmr.receipt_obj,
+        tmr.tax_rate,
+        tmr.flg_valid,
+        tmr.op_create_time,
+        tmr.op_create_user_id,
+        tmr.op_update_time,
+        tmr.op_update_user_id,
+        tmr.op_app_code,
+        tmr.op_timestamp,
+        tmr.op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap_list" type="com.dk.mdm.model.response.mst.ReceiptResponse">
+        <id column="receipt_id" property="receiptId"/>
+        <result column="receipt_set_id" property="receiptSetId" typeHandler="UuidTypeHandler"/>
+        <result column="receipt_status" property="receiptStatus"/>
+        <result column="receipt_type" property="receiptType"/>
+        <result column="apply_staff" property="applyStaff"/>
+        <result column="apply_date" property="applyDate" typeHandler="TimestampTypeHandler"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="cp_name" property="cpName"/>
+        <result column="tax_no" property="taxNo"/>
+        <result column="cp_email" property="cpEmail"/>
+        <result column="cp_address" property="cpAddress"/>
+        <result column="cp_phone" property="cpPhone"/>
+        <result column="open_bank" property="openBank"/>
+        <result column="bank_account" property="bankAccount"/>
+        <result column="receipt_amt" property="receiptAmt"/>
+        <result column="receipt_content" property="receiptContent"/>
+        <result column="receipt_date" property="receiptDate" typeHandler="TimestampTypeHandler"/>
+        <result column="receipt_staff" property="receiptStaff"/>
+        <result column="receipt_obj" property="receiptObj"/>
+        <result column="tax_rate" property="taxRate"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition_list">
+        <where>
+            <if test="receiptSetId != null and receiptSetId != ''">
+                AND tmr.receipt_set_id = #{receiptSetId}
+            </if>
+            <if test="receiptStatus != null and receiptStatus != ''">
+                AND tmr.receipt_status = #{receiptStatus}
+            </if>
+            <if test="receiptType != null and receiptType != ''">
+                AND tmr.receipt_type = #{receiptType}
+            </if>
+            <if test="applyStaff != null and applyStaff != ''">
+                AND tmr.apply_staff = #{applyStaff}
+            </if>
+            <if test="applyDate != null">
+                AND tmr.apply_date = #{applyDate}
+            </if>
+            <if test="cpId != null">
+                AND tmr.cp_id = #{cpId}
+            </if>
+            <if test="cpName != null and cpName != ''">
+                AND tmr.cp_name = #{cpName}
+            </if>
+            <if test="taxNo != null and taxNo != ''">
+                AND tmr.tax_no = #{taxNo}
+            </if>
+            <if test="cpEmail != null and cpEmail != ''">
+                AND tmr.cp_email = #{cpEmail}
+            </if>
+            <if test="cpAddress != null and cpAddress != ''">
+                AND tmr.cp_address = #{cpAddress}
+            </if>
+            <if test="cpPhone != null and cpPhone != ''">
+                AND tmr.cp_phone = #{cpPhone}
+            </if>
+            <if test="openBank != null and openBank != ''">
+                AND tmr.open_bank = #{openBank}
+            </if>
+            <if test="bankAccount != null and bankAccount != ''">
+                AND tmr.bank_account = #{bankAccount}
+            </if>
+            <if test="receiptAmt != null">
+                AND tmr.receipt_amt = #{receiptAmt}
+            </if>
+            <if test="receiptContent != null and receiptContent != ''">
+                AND tmr.receipt_content = #{receiptContent}
+            </if>
+            <if test="receiptDate != null">
+                AND tmr.receipt_date = #{receiptDate}
+            </if>
+            <if test="receiptStaff != null and receiptStaff != ''">
+                AND tmr.receipt_staff = #{receiptStaff}
+            </if>
+            <if test="receiptObj != null and receiptObj != ''">
+                AND tmr.receipt_obj = #{receiptObj}
+            </if>
+            <if test="taxRate != null">
+                AND tmr.tax_rate = #{taxRate}
+            </if>
+            <if test="flgValid != null">
+                AND tmr.flg_valid = #{flgValid}
+            </if>
+            <if test="opCreateTime != null">
+                AND tmr.op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null">
+                AND tmr.op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND tmr.op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null">
+                AND tmr.op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND tmr.op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND tmr.op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND tmr.op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键receiptId批量操作 -->
+        WHERE receipt_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表dkic_a.t_mst_receipt,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap_list">
+        SELECT
+        <include refid="Base_Column_List_list"/>
+        , sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "receiptStatusName"
+        , sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "receiptTypeName"
+        FROM dkic_a.t_mst_receipt tmr
+        left JOIN sys.t_data_kind as tdk1 on tmr.receipt_status = tdk1.kind_code
+        left JOIN sys.t_data_kind as tdk2 on tmr.receipt_type = tdk2.kind_code
+        <include refid="Condition_list"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表dkic_a.t_mst_receipt,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_a.t_mst_receipt tmr
+        <include refid="Condition_list"/>
+    </select>
+
+    <!-- 根据主键查询表dkic_a.t_mst_receipt的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt
+        WHERE receipt_id = #{receiptId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表dkic_a.t_mst_receipt的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt
+        WHERE receipt_id = #{receiptId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表dkic_a.t_mst_receipt的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM dkic_a.t_mst_receipt
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into dkic_a.t_mst_receipt
+        (
+        <trim suffixOverrides=",">
+            receipt_set_id,
+            receipt_status,
+            receipt_type,
+            apply_staff,
+            apply_date,
+            cp_id,
+            cp_name,
+            tax_no,
+            cp_email,
+            cp_address,
+            cp_phone,
+            open_bank,
+            bank_account,
+            receipt_amt,
+            receipt_content,
+            receipt_date,
+            receipt_staff,
+            receipt_obj,
+            tax_rate,
+            op_app_code,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.receiptSetId}::uuid,
+                #{item.receiptStatus},
+                #{item.receiptType},
+                #{item.applyStaff},
+                #{item.applyDate},
+                #{item.cpId},
+                #{item.cpName},
+                #{item.taxNo},
+                #{item.cpEmail},
+                #{item.cpAddress},
+                #{item.cpPhone},
+                #{item.openBank},
+                #{item.bankAccount},
+                #{item.receiptAmt},
+                #{item.receiptContent},
+                #{item.receiptDate},
+                #{item.receiptStaff},
+                #{item.receiptObj},
+                #{item.taxRate},
+                #{item.opAppCode},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 54 - 0
src/main/java/com/dk/mdm/model/pojo/mst/CpTrade.java

@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 import java.time.LocalDateTime;
 
@@ -176,6 +177,59 @@ public class CpTrade extends PageInfo<CpTrade> implements Serializable {
     private String tradeStatus;
 
 
+    /**
+     * 活动ID
+     */
+    @Excel(name = "活动ID")
+    @ApiModelProperty(value = "活动ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityId;
+
+    /**
+     * 活动明细ID
+     */
+    @Excel(name = "活动明细ID")
+    @ApiModelProperty(value = "活动明细ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityItemId;
+
+    /**
+     * 活动IDs
+     */
+    @ApiModelProperty(value = "活动IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String>  activityIds;
+
+    /**
+     * 活动明细IDs
+     */
+    @ApiModelProperty(value = "活动明细IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String>  activityItemIds;
+
+    /**
+     * 交易描述
+     */
+    @Excel(name = "交易描述")
+    @ApiModelProperty(value = "交易描述")
+    private String tradeDesc;
+
+    /**
+     * 开票标识【系统字典】未开票、开票中、已开票
+     */
+    @Excel(name = "开票标识【系统字典】未开票、开票中、已开票")
+    @ApiModelProperty(value = "开票标识【系统字典】未开票、开票中、已开票")
+    private String receiptStatus;
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 292 - 0
src/main/java/com/dk/mdm/model/pojo/mst/Receipt.java

@@ -0,0 +1,292 @@
+package com.dk.mdm.model.pojo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt")
+public class Receipt extends PageInfo<Receipt> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票ID
+     */
+    @TableId(value = "receipt_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 发票设置ID
+     */
+    @Excel(name = "发票设置ID")
+    @ApiModelProperty(value = "发票设置ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptSetId;
+
+
+    /**
+     * 发票状态 (【系统字典】申请,开具)
+     */
+    @Excel(name = "发票状态 (【系统字典】申请,开具)")
+    @ApiModelProperty(value = "发票状态 (【系统字典】申请,开具)")
+    private String receiptStatus;
+
+
+    /**
+     * 发票类型 (【系统字典】专票,普票)
+     */
+    @Excel(name = "发票类型 (【系统字典】专票,普票)")
+    @ApiModelProperty(value = "发票类型 (【系统字典】专票,普票)")
+    private String receiptType;
+
+
+    /**
+     * 申请人
+     */
+    @Excel(name = "申请人")
+    @ApiModelProperty(value = "申请人")
+    private String applyStaff;
+
+
+    /**
+     * 申请日期
+     */
+    @Excel(name = "申请日期")
+    @ApiModelProperty(value = "申请日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate applyDate;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 公司名称
+     */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String cpName;
+
+
+    /**
+     * 公司税号
+     */
+    @Excel(name = "公司税号")
+    @ApiModelProperty(value = "公司税号")
+    private String taxNo;
+
+
+    /**
+     * 电子邮箱
+     */
+    @Excel(name = "电子邮箱")
+    @ApiModelProperty(value = "电子邮箱")
+    private String cpEmail;
+
+
+    /**
+     * 注册地址
+     */
+    @Excel(name = "注册地址")
+    @ApiModelProperty(value = "注册地址")
+    private String cpAddress;
+
+
+    /**
+     * 注册电话
+     */
+    @Excel(name = "注册电话")
+    @ApiModelProperty(value = "注册电话")
+    private String cpPhone;
+
+
+    /**
+     * 开户行
+     */
+    @Excel(name = "开户行")
+    @ApiModelProperty(value = "开户行")
+    private String openBank;
+
+
+    /**
+     * 银行账户
+     */
+    @Excel(name = "银行账户")
+    @ApiModelProperty(value = "银行账户")
+    private String bankAccount;
+
+
+    /**
+     * 发票金额
+     */
+    @Excel(name = "发票金额")
+    @ApiModelProperty(value = "发票金额")
+    private BigDecimal receiptAmt;
+
+
+    /**
+     * 发票内容
+     */
+    @Excel(name = "发票内容")
+    @ApiModelProperty(value = "发票内容")
+    private String receiptContent;
+
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
+
+    /**
+     * 开票人
+     */
+    @Excel(name = "开票人")
+    @ApiModelProperty(value = "开票人")
+    private String receiptStaff;
+
+
+    /**
+     * 开票方名称
+     */
+    @Excel(name = "开票方名称")
+    @ApiModelProperty(value = "开票方名称")
+    private String receiptObj;
+
+
+    /**
+     * 税率
+     */
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private BigDecimal taxRate;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 167 - 0
src/main/java/com/dk/mdm/model/pojo/mst/ReceiptItem.java

@@ -0,0 +1,167 @@
+package com.dk.mdm.model.pojo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt_item", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt_item")
+public class ReceiptItem extends PageInfo<ReceiptItem> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票明细Id
+     */
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票明细Id")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String itemId;
+
+
+    /**
+     * 发票ID
+     */
+    @Excel(name = "发票ID")
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 交易ID
+     */
+    @Excel(name = "交易ID")
+    @ApiModelProperty(value = "交易ID")
+    private Integer tradeId;
+
+
+    /**
+     * 明细金额
+     */
+    @Excel(name = "明细金额")
+    @ApiModelProperty(value = "明细金额")
+    private BigDecimal itemAmt;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 53 - 0
src/main/java/com/dk/mdm/model/query/mst/CpTradeQuery.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -176,6 +177,58 @@ public class CpTradeQuery extends PageInfo<CpTradeQuery> implements Serializable
 
     private List<Integer> cpIds;
 
+    /**
+     * 活动ID
+     */
+    @Excel(name = "活动ID")
+    @ApiModelProperty(value = "活动ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityId;
+
+    /**
+     * 活动明细ID
+     */
+    @Excel(name = "活动明细ID")
+    @ApiModelProperty(value = "活动明细ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityItemId;
+
+    /**
+     * 活动IDs
+     */
+    @ApiModelProperty(value = "活动IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String>  activityIds;
+
+    /**
+     * 活动明细IDs
+     */
+    @ApiModelProperty(value = "活动明细IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String>  activityItemIds;
+
+    /**
+     * 交易描述
+     */
+    @Excel(name = "交易描述")
+    @ApiModelProperty(value = "交易描述")
+    private String tradeDesc;
+
+    /**
+     * 开票标识【系统字典】未开票、开票中、已开票
+     */
+    @Excel(name = "开票标识【系统字典】未开票、开票中、已开票")
+    @ApiModelProperty(value = "开票标识【系统字典】未开票、开票中、已开票")
+    private String receiptStatus;
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
 
     /*
      * 相关属性

+ 167 - 0
src/main/java/com/dk/mdm/model/query/mst/ReceiptItemQuery.java

@@ -0,0 +1,167 @@
+package com.dk.mdm.model.query.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt_item", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt_item")
+public class ReceiptItemQuery extends PageInfo<ReceiptItemQuery> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票明细Id
+     */
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票明细Id")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String itemId;
+
+
+    /**
+     * 发票ID
+     */
+    @Excel(name = "发票ID")
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 交易ID
+     */
+    @Excel(name = "交易ID")
+    @ApiModelProperty(value = "交易ID")
+    private Integer tradeId;
+
+
+    /**
+     * 明细金额
+     */
+    @Excel(name = "明细金额")
+    @ApiModelProperty(value = "明细金额")
+    private BigDecimal itemAmt;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 292 - 0
src/main/java/com/dk/mdm/model/query/mst/ReceiptQuery.java

@@ -0,0 +1,292 @@
+package com.dk.mdm.model.query.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt")
+public class ReceiptQuery extends PageInfo<ReceiptQuery> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票ID
+     */
+    @TableId(value = "receipt_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 发票设置ID
+     */
+    @Excel(name = "发票设置ID")
+    @ApiModelProperty(value = "发票设置ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptSetId;
+
+
+    /**
+     * 发票状态 (【系统字典】申请,开具)
+     */
+    @Excel(name = "发票状态 (【系统字典】申请,开具)")
+    @ApiModelProperty(value = "发票状态 (【系统字典】申请,开具)")
+    private String receiptStatus;
+
+
+    /**
+     * 发票类型 (【系统字典】专票,普票)
+     */
+    @Excel(name = "发票类型 (【系统字典】专票,普票)")
+    @ApiModelProperty(value = "发票类型 (【系统字典】专票,普票)")
+    private String receiptType;
+
+
+    /**
+     * 申请人
+     */
+    @Excel(name = "申请人")
+    @ApiModelProperty(value = "申请人")
+    private String applyStaff;
+
+
+    /**
+     * 申请日期
+     */
+    @Excel(name = "申请日期")
+    @ApiModelProperty(value = "申请日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate applyDate;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 公司名称
+     */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String cpName;
+
+
+    /**
+     * 公司税号
+     */
+    @Excel(name = "公司税号")
+    @ApiModelProperty(value = "公司税号")
+    private String taxNo;
+
+
+    /**
+     * 电子邮箱
+     */
+    @Excel(name = "电子邮箱")
+    @ApiModelProperty(value = "电子邮箱")
+    private String cpEmail;
+
+
+    /**
+     * 注册地址
+     */
+    @Excel(name = "注册地址")
+    @ApiModelProperty(value = "注册地址")
+    private String cpAddress;
+
+
+    /**
+     * 注册电话
+     */
+    @Excel(name = "注册电话")
+    @ApiModelProperty(value = "注册电话")
+    private String cpPhone;
+
+
+    /**
+     * 开户行
+     */
+    @Excel(name = "开户行")
+    @ApiModelProperty(value = "开户行")
+    private String openBank;
+
+
+    /**
+     * 银行账户
+     */
+    @Excel(name = "银行账户")
+    @ApiModelProperty(value = "银行账户")
+    private String bankAccount;
+
+
+    /**
+     * 发票金额
+     */
+    @Excel(name = "发票金额")
+    @ApiModelProperty(value = "发票金额")
+    private BigDecimal receiptAmt;
+
+
+    /**
+     * 发票内容
+     */
+    @Excel(name = "发票内容")
+    @ApiModelProperty(value = "发票内容")
+    private String receiptContent;
+
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
+
+    /**
+     * 开票人
+     */
+    @Excel(name = "开票人")
+    @ApiModelProperty(value = "开票人")
+    private String receiptStaff;
+
+
+    /**
+     * 开票方名称
+     */
+    @Excel(name = "开票方名称")
+    @ApiModelProperty(value = "开票方名称")
+    private String receiptObj;
+
+
+    /**
+     * 税率
+     */
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private BigDecimal taxRate;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 2 - 0
src/main/java/com/dk/mdm/model/response/mst/CompanyResponse.java

@@ -273,6 +273,8 @@ public class CompanyResponse extends PageInfo<CompanyResponse> implements Serial
     @TableField(exist = false)
     private Integer svcPort;
 
+    private Boolean invoicingFlag;
+
 
     /*
      * 相关属性

+ 54 - 0
src/main/java/com/dk/mdm/model/response/mst/CpTradeResponse.java

@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  *  交易记录
@@ -183,6 +184,59 @@ public class CpTradeResponse extends PageInfo<CpTradeResponse> implements Serial
 
     private String gradeName;
 
+    /**
+     * 活动ID
+     */
+    @Excel(name = "活动ID")
+    @ApiModelProperty(value = "活动ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityId;
+
+    /**
+     * 活动明细ID
+     */
+    @Excel(name = "活动明细ID")
+    @ApiModelProperty(value = "活动明细ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String activityItemId;
+
+    /**
+     * 活动IDs
+     */
+    @ApiModelProperty(value = "活动IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String> activityIds;
+
+    /**
+     * 活动明细IDs
+     */
+    @ApiModelProperty(value = "活动明细IDs")
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String>  activityItemIds;
+
+    /**
+     * 交易描述
+     */
+    @Excel(name = "交易描述")
+    @ApiModelProperty(value = "交易描述")
+    private String tradeDesc;
+
+    /**
+     * 开票标识【系统字典】未开票、开票中、已开票
+     */
+    @Excel(name = "开票标识【系统字典】未开票、开票中、已开票")
+    @ApiModelProperty(value = "开票标识【系统字典】未开票、开票中、已开票")
+    private String receiptStatus;
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 213 - 0
src/main/java/com/dk/mdm/model/response/mst/ReceiptItemResponse.java

@@ -0,0 +1,213 @@
+package com.dk.mdm.model.response.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt_item", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt_item")
+public class ReceiptItemResponse extends PageInfo<ReceiptItemResponse> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票明细Id
+     */
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票明细Id")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String itemId;
+
+
+    /**
+     * 发票ID
+     */
+    @Excel(name = "发票ID")
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 交易ID
+     */
+    @Excel(name = "交易ID")
+    @ApiModelProperty(value = "交易ID")
+    private Integer tradeId;
+
+
+    /**
+     * 明细金额
+     */
+    @Excel(name = "明细金额")
+    @ApiModelProperty(value = "明细金额")
+    private BigDecimal itemAmt;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+    private String tradeNo;
+
+    @ApiModelProperty(value = "交易金额")
+    private BigDecimal tradeAmount;
+
+    @ApiModelProperty(value = "交易时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime tradeTime;
+
+    private String tradeTypeName;
+
+    private String tradeStatusName;
+
+    @ApiModelProperty(value = "购买时长 (1天、1月、1年。。)")
+    private String buyLong;
+
+    @ApiModelProperty(value = "开始日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate buyBeginDate;
+
+    @ApiModelProperty(value = "结束日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate buyEndDate;
+
+    private String gradeName;
+
+    @ApiModelProperty(value = "微信交易单号")
+    private String wxTradeNo;
+
+    @ApiModelProperty(value = "延长日期 (单位天:按月购买时可以是28、30、31,按年时可以是365、366等)")
+    private Integer extendDays;
+
+    @ApiModelProperty(value = "交易描述")
+    private String tradeDesc;
+
+    private String receiptStatusName;
+
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 299 - 0
src/main/java/com/dk/mdm/model/response/mst/ReceiptResponse.java

@@ -0,0 +1,299 @@
+package com.dk.mdm.model.response.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt")
+public class ReceiptResponse extends PageInfo<ReceiptResponse> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票ID
+     */
+    @TableId(value = "receipt_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 发票设置ID
+     */
+    @Excel(name = "发票设置ID")
+    @ApiModelProperty(value = "发票设置ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptSetId;
+
+
+    /**
+     * 发票状态 (【系统字典】申请,开具)
+     */
+    @Excel(name = "发票状态 (【系统字典】申请,开具)")
+    @ApiModelProperty(value = "发票状态 (【系统字典】申请,开具)")
+    private String receiptStatus;
+
+
+    /**
+     * 发票类型 (【系统字典】专票,普票)
+     */
+    @Excel(name = "发票类型 (【系统字典】专票,普票)")
+    @ApiModelProperty(value = "发票类型 (【系统字典】专票,普票)")
+    private String receiptType;
+
+
+    /**
+     * 申请人
+     */
+    @Excel(name = "申请人")
+    @ApiModelProperty(value = "申请人")
+    private String applyStaff;
+
+
+    /**
+     * 申请日期
+     */
+    @Excel(name = "申请日期")
+    @ApiModelProperty(value = "申请日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate applyDate;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 公司名称
+     */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String cpName;
+
+
+    /**
+     * 公司税号
+     */
+    @Excel(name = "公司税号")
+    @ApiModelProperty(value = "公司税号")
+    private String taxNo;
+
+
+    /**
+     * 电子邮箱
+     */
+    @Excel(name = "电子邮箱")
+    @ApiModelProperty(value = "电子邮箱")
+    private String cpEmail;
+
+
+    /**
+     * 注册地址
+     */
+    @Excel(name = "注册地址")
+    @ApiModelProperty(value = "注册地址")
+    private String cpAddress;
+
+
+    /**
+     * 注册电话
+     */
+    @Excel(name = "注册电话")
+    @ApiModelProperty(value = "注册电话")
+    private String cpPhone;
+
+
+    /**
+     * 开户行
+     */
+    @Excel(name = "开户行")
+    @ApiModelProperty(value = "开户行")
+    private String openBank;
+
+
+    /**
+     * 银行账户
+     */
+    @Excel(name = "银行账户")
+    @ApiModelProperty(value = "银行账户")
+    private String bankAccount;
+
+
+    /**
+     * 发票金额
+     */
+    @Excel(name = "发票金额")
+    @ApiModelProperty(value = "发票金额")
+    private BigDecimal receiptAmt;
+
+
+    /**
+     * 发票内容
+     */
+    @Excel(name = "发票内容")
+    @ApiModelProperty(value = "发票内容")
+    private String receiptContent;
+
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
+
+    /**
+     * 开票人
+     */
+    @Excel(name = "开票人")
+    @ApiModelProperty(value = "开票人")
+    private String receiptStaff;
+
+
+    /**
+     * 开票方名称
+     */
+    @Excel(name = "开票方名称")
+    @ApiModelProperty(value = "开票方名称")
+    private String receiptObj;
+
+
+    /**
+     * 税率
+     */
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private BigDecimal taxRate;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+    @ApiModelProperty(value = "开票管理明细")
+    private List<ReceiptItemResponse> receiptItemList;
+
+    private String receiptStatusName;
+
+    private String receiptTypeName;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 292 - 0
src/main/java/com/dk/mdm/model/vo/mst/ReceiptVO.java

@@ -0,0 +1,292 @@
+package com.dk.mdm.model.vo.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+import java.time.LocalDateTime;
+
+/**
+ *  发票管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("发票管理")
+@TableName(value = "t_mst_receipt", autoResultMap = true,schema = "dkic_a")
+@ApiModel(value="实体类:发票管理", description="表名:t_mst_receipt")
+public class ReceiptVO extends PageInfo<ReceiptVO> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 发票ID
+     */
+    @TableId(value = "receipt_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "发票ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptId;
+
+
+    /**
+     * 发票设置ID
+     */
+    @Excel(name = "发票设置ID")
+    @ApiModelProperty(value = "发票设置ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String receiptSetId;
+
+
+    /**
+     * 发票状态 (【系统字典】申请,开具)
+     */
+    @Excel(name = "发票状态 (【系统字典】申请,开具)")
+    @ApiModelProperty(value = "发票状态 (【系统字典】申请,开具)")
+    private String receiptStatus;
+
+
+    /**
+     * 发票类型 (【系统字典】专票,普票)
+     */
+    @Excel(name = "发票类型 (【系统字典】专票,普票)")
+    @ApiModelProperty(value = "发票类型 (【系统字典】专票,普票)")
+    private String receiptType;
+
+
+    /**
+     * 申请人
+     */
+    @Excel(name = "申请人")
+    @ApiModelProperty(value = "申请人")
+    private String applyStaff;
+
+
+    /**
+     * 申请日期
+     */
+    @Excel(name = "申请日期")
+    @ApiModelProperty(value = "申请日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate applyDate;
+
+
+    /**
+     * 公司Id
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "公司Id")
+    @ApiModelProperty(value = "公司Id")
+    private Integer cpId;
+
+
+    /**
+     * 公司名称
+     */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String cpName;
+
+
+    /**
+     * 公司税号
+     */
+    @Excel(name = "公司税号")
+    @ApiModelProperty(value = "公司税号")
+    private String taxNo;
+
+
+    /**
+     * 电子邮箱
+     */
+    @Excel(name = "电子邮箱")
+    @ApiModelProperty(value = "电子邮箱")
+    private String cpEmail;
+
+
+    /**
+     * 注册地址
+     */
+    @Excel(name = "注册地址")
+    @ApiModelProperty(value = "注册地址")
+    private String cpAddress;
+
+
+    /**
+     * 注册电话
+     */
+    @Excel(name = "注册电话")
+    @ApiModelProperty(value = "注册电话")
+    private String cpPhone;
+
+
+    /**
+     * 开户行
+     */
+    @Excel(name = "开户行")
+    @ApiModelProperty(value = "开户行")
+    private String openBank;
+
+
+    /**
+     * 银行账户
+     */
+    @Excel(name = "银行账户")
+    @ApiModelProperty(value = "银行账户")
+    private String bankAccount;
+
+
+    /**
+     * 发票金额
+     */
+    @Excel(name = "发票金额")
+    @ApiModelProperty(value = "发票金额")
+    private BigDecimal receiptAmt;
+
+
+    /**
+     * 发票内容
+     */
+    @Excel(name = "发票内容")
+    @ApiModelProperty(value = "发票内容")
+    private String receiptContent;
+
+
+    /**
+     * 开票日期
+     */
+    @Excel(name = "开票日期")
+    @ApiModelProperty(value = "开票日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate receiptDate;
+
+
+    /**
+     * 开票人
+     */
+    @Excel(name = "开票人")
+    @ApiModelProperty(value = "开票人")
+    private String receiptStaff;
+
+
+    /**
+     * 开票方名称
+     */
+    @Excel(name = "开票方名称")
+    @ApiModelProperty(value = "开票方名称")
+    private String receiptObj;
+
+
+    /**
+     * 税率
+     */
+    @Excel(name = "税率")
+    @ApiModelProperty(value = "税率")
+    private BigDecimal taxRate;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    private Long opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private Long opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 38 - 0
src/main/java/com/dk/mdm/service/mst/ReceiptItemService.java

@@ -0,0 +1,38 @@
+package com.dk.mdm.service.mst;
+
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.model.pojo.mst.ReceiptItem;
+import com.dk.mdm.mapper.mst.ReceiptItemMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.query.mst.ReceiptItemQuery;
+import com.dk.mdm.model.response.mst.ReceiptItemResponse;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class ReceiptItemService extends BaseService<ReceiptItem> {
+
+	@Override
+	public BaseMapper<ReceiptItem> getRepository() {
+		return receiptItemMapper;
+	}
+
+	@Autowired
+	private ReceiptItemMapper receiptItemMapper;
+
+	/**
+	 * @desc : 查询
+	 * @author : 常皓宁
+	 * @date : 2023/1/5 9:39
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<ReceiptItemResponse>> selectByCond(ReceiptItemQuery receiptItemQuery) {
+		return super.mergeListWithCount(receiptItemQuery, receiptItemMapper.selectByCond(receiptItemQuery),
+				receiptItemMapper.countByCond(receiptItemQuery));
+	}
+}

+ 142 - 0
src/main/java/com/dk/mdm/service/mst/ReceiptService.java

@@ -0,0 +1,142 @@
+package com.dk.mdm.service.mst;
+
+import com.alibaba.druid.util.StringUtils;
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultUtil;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.mdm.infrastructure.convert.mst.ReceiptConvert;
+import com.dk.mdm.mapper.mst.CpTradeMapper;
+import com.dk.mdm.mapper.mst.ReceiptItemMapper;
+import com.dk.mdm.model.pojo.mst.CpTrade;
+import com.dk.mdm.model.pojo.mst.Receipt;
+import com.dk.mdm.mapper.mst.ReceiptMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.mdm.model.pojo.mst.ReceiptItem;
+import com.dk.mdm.model.query.mst.ReceiptItemQuery;
+import com.dk.mdm.model.query.mst.ReceiptQuery;
+import com.dk.mdm.model.response.mst.ReceiptItemResponse;
+import com.dk.mdm.model.response.mst.ReceiptResponse;
+import com.dk.mdm.model.vo.mst.ReceiptVO;
+import com.dk.mdm.model.vo.mst.UserVO;
+import com.dk.mdm.shiro.mail.MailHelper;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+@Transactional
+public class ReceiptService extends BaseService<Receipt> {
+
+	@Override
+	public BaseMapper<Receipt> getRepository() {
+		return receiptMapper;
+	}
+
+	@Autowired
+	private ReceiptMapper receiptMapper;
+
+	@Autowired
+	private ReceiptItemMapper receiptItemMapper;
+
+	@Autowired
+	private ReceiptConvert receiptConvert;
+
+	@Autowired
+	private CpTradeMapper cpTradeMapper;
+
+	/**
+	 * @desc : 重写主键
+	 * @author : 常皓宁
+	 * @date : 2024/2/29 20:29
+	 */
+	@Override
+	public String getPrimaryKey() {
+		return "receipt_id";
+	}
+
+	/**
+	 * @desc : 查询
+	 * @author : 常皓宁
+	 * @date : 2023/1/5 9:39
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<ReceiptResponse>> selectByCond(ReceiptQuery receiptQuery) {
+		return super.mergeListWithCount(receiptQuery, receiptMapper.selectByCond(receiptQuery),
+				receiptMapper.countByCond(receiptQuery));
+	}
+
+	/**
+	 * @desc : 查看总单加明细
+	 * @author : 常皓宁
+	 * @date : 2024/3/6 10:36
+	 */
+	public ResponseResultVO<List<ReceiptResponse>> selectAllAndItem(ReceiptQuery receiptQuery) {
+		//根据id查询
+		List<ReceiptResponse> receiptResponse = receiptMapper.selectByCond(receiptQuery);
+
+		//查询明细
+		for (ReceiptResponse receiptResponse1 : receiptResponse){
+			//查询明细
+			List<ReceiptItemResponse> receiptItemResponse =
+					receiptItemMapper.selectByCond(new ReceiptItemQuery().setReceiptId(receiptResponse1.getReceiptId()));
+			receiptResponse1.setReceiptItemList(receiptItemResponse);
+		}
+		return ResponseResultUtil.success(receiptResponse);
+	}
+
+	/**
+	 * @desc   : 开发票
+	 * @author : 常皓宁
+	 * @date   : 2024/8/2 8:44
+	 */
+	@Transactional(
+			rollbackFor = {Exception.class}
+	)
+	public ResponseResultVO<?> invoicing(ReceiptVO receiptVO) {
+		//修改总单状态和日期
+		Receipt receipt = receiptConvert.convertToPo(receiptVO);
+		Receipt receipt1 = new Receipt().setReceiptId(receipt.getReceiptId()).setReceiptStatus("发票状态-开具").setReceiptDate(LocalDate.now());
+		super.updateByUuid(receipt1);
+
+		//查询明细
+		List<ReceiptItemResponse> receiptItemResponse =
+				receiptItemMapper.selectByCond(new ReceiptItemQuery().setReceiptId(receipt.getReceiptId()));
+
+		//修改交易记录中的状态
+		for (ReceiptItemResponse receiptItemResponse1 : receiptItemResponse){
+			cpTradeMapper.updateReciptStatus(receiptItemResponse1.getTradeId());
+		}
+
+		//不用了 但是留着 没准以后会用 start
+		//发送地址
+		//String toAddress = receiptVO.getCpAddress();
+		//if(StringUtils.isEmpty(toAddress)){
+		//	return ResponseResultUtil.error(-200, "邮箱地址不能为空");
+		//}
+
+		//MailHelper mailHelper = new MailHelper();
+		////发件人邮箱
+		//mailHelper.setUserName("fapiao@dongkesoft.com");
+		////发件人密码(授权码)
+		//mailHelper.setPassName("dkfapiao");
+
+		// 填入收件人地址、邮件主题和邮件内容
+		//String toAddress = "1612940384@qq.com";
+		//String subject = "发票";
+		//String emailBody = "下面是发票图片";
+		//try {
+		//	MailHelper.sendMail(toAddress,subject ,emailBody, null);
+		//} catch (Exception e) {
+		//	e.printStackTrace();
+		//}
+		//end
+		return ResponseResultUtil.success(receiptItemResponse);
+	}
+}

+ 92 - 0
src/main/java/com/dk/mdm/shiro/mail/MailHelper.java

@@ -0,0 +1,92 @@
+package com.dk.mdm.shiro.mail;
+
+import javax.activation.DataHandler;
+import javax.mail.*;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.mail.util.ByteArrayDataSource;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+public class MailHelper {
+
+    private static final String USERNAME = "";//	邮箱发送账号
+    private static final String PASSWORD = "";//    授权码
+
+    public static Session createSession() {
+
+        //	账号信息
+
+
+        //	创建一个配置文件,并保存
+        Properties props = new Properties();
+
+        //	SMTP服务器连接信息
+        //  126——smtp.126.com
+        //  163——smtp.163.com
+        //  qq——smtp.qq.com
+        props.put("mail.smtp.host", "smtphz.qiye.163.com");//	SMTP主机名
+
+        //  126——645
+        //  163——25
+        //  qq——465或587
+        props.put("mail.smtp.port", "25");//	主机端口号
+        props.put("mail.smtp.auth", "true");//	是否需要用户认证
+        props.put("mail.smtp.starttls.enale", "true");//	启用TlS加密
+        props.put("mail.smtp.socketFactory.port", "465");
+        props.put("mail.smtp.socketFactory.fallback", "false");
+        props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
+        props.put("mail.smtp.ssl.protocols", "TLSv1.2");
+
+        Session session = Session.getInstance(props, new Authenticator() {
+            @Override
+            protected PasswordAuthentication getPasswordAuthentication() {
+                // TODO Auto-generated method stub
+                return new PasswordAuthentication(USERNAME,PASSWORD);
+            }
+        });
+        //  控制台打印调试信息
+        session.setDebug(true);
+        return session;
+
+    }
+
+    public static void sendMail(String address,String title, String content, String pathName) throws Exception {
+        Session session = createSession();
+        MimeMessage message = new MimeMessage(session);
+        //标题
+        message.setSubject(title);
+        message.setFrom(new InternetAddress(USERNAME));
+        message.setRecipients(MimeMessage.RecipientType.TO, address);
+        //正文
+        message.setText(content);
+
+        ////设置正文
+        //BodyPart textPart=new MimeBodyPart();
+        ////设置正文内容并标明含有html标签
+        //textPart.setContent("<b>附件</b>", "text/html;charset=utf-8");
+        //
+        ////设置附件
+        //BodyPart filePart=new MimeBodyPart();
+        //filePart.setFileName(pathName);
+        //filePart.setDataHandler(
+        //        new DataHandler(
+        //                new ByteArrayDataSource(
+        //                        Files.readAllBytes(Paths.get("附件文件路径")), "application/octet-stream")));
+        //
+        ////整合正文和附件
+        //Multipart part=new MimeMultipart();
+        //part.addBodyPart(textPart);
+        //part.addBodyPart(filePart);
+        //
+        ////添加正文和邮件
+        //message.setContent(part);
+
+        //	发送
+        Transport.send(message);
+    }
+
+}