chengf
2026-03-25 1e0e62187e2b7ff3e1fef23b182a710dc8cd76f8
采购导入需求
7个文件已修改
13个文件已添加
1767 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyAudit.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyDetailPo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyItem.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyPo.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyStock.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchasePayment.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseReceive.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseReturnRecord.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyAuditServiceDaoImplMapper.xml 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyItemServiceDaoImplMapper.xml 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseApplyStockServiceDaoImplMapper.xml 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchasePaymentServiceDaoImplMapper.xml 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/store/PurchaseReceiveServiceDaoImplMapper.xml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/importData/adapt/ImportPurchaseApplyCleaningAdapt.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/smo/assetImport/impl/ImportResourceStoreV2SMOImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/smo/assetImport/impl/ImportResourceStoreV3SMOImpl.java 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/importData/adapt/ImportPurchaseApplyQueueDataAdapt.java 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceStore/ImportResourceStoreCmd.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/cmd/resourceStore/ListResourceStoresCmd.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-store/src/main/java/com/java110/store/smo/impl/ResourceStoreInnerServiceSMOImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyAudit.java
New file
@@ -0,0 +1,72 @@
package com.java110.po.purchase;
import lombok.Data;
/**
 * 采购申请审核
 */
@Data
public class PurchaseApplyAudit {
    /**
     * 主键ID
     */
    private String id;
    /**
     * 申请单ID
     */
    private String applyOrderId;
    /**
     * 审批类型
     */
    private String auditType;
    /**
     * 日期
     */
    private String auditDate;
    private String auditEndTime;  // 审批结束时间
    /**
     * 经办人
     */
    private String operator;
    /**
     * 数量
     */
    private String quantity;
    /**
     * 单价
     */
    private String price;
    /**
     * 型号
     */
    private String model;
    /**
     * 审批部门
     */
    private String auditDept;
    /**
     * 审批人
     */
    private String auditor;
    /**
     * 意见(同意/不同意)
     */
    private String auditOpinion;
    /**
     * 备注
     */
    private String remark;
}
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyDetailPo.java
@@ -44,6 +44,9 @@
     * 采购日期二(适配非标准日期)
     */
    private String purchaseDate2;
    private String contactPerson; // 联系人
    private String phone;         // 手机号
    private String wechat;        // 微信号
    /**
     * 采购数量二(适配非数值脏数据)
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyItem.java
New file
@@ -0,0 +1,56 @@
package com.java110.po.purchase;
import lombok.Data;
/**
 * 采购申请明细
 */
@Data
public class PurchaseApplyItem {
    /**
     * 主键ID
     */
    private String id;
    /**
     * 申请单ID
     */
    private String applyOrderId;
    /**
     * 是否签报单
     */
    private String isSignReport;
    /**
     * 签报单日期
     */
    private String signReportDate;
    /**
     * No.
     */
    private String itemNo;
    /**
     * 种类
     */
    private String type;
    /**
     * 采购名称
     */
    private String purchaseName;
    /**
     * 型号
     */
    private String model;
    /**
     * 单位
     */
    private String unit;
}
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyPo.java
@@ -37,6 +37,18 @@
    private String applyDate;  // 申请日期
    private String approver; // 审批人
    private String applyQuantity;
    private String year;        // 年度
    private String month;       // 月份
    private String company;     // 公司
    private String department;  // 部门
    private String communityName; // 小区名称
    private String serialNo;    // 流水编号
    private String tripleNo;    // 三联单编号
    private String budgetQuantity;  // 预算数量
    private String budgetPrice;    // 预算单价
    private String budgetAmount;   // 预算金额
    private String receiver;     // 收货人
    private String receiveAddr;  // 收货地址
    private String statusCd = "0";
java110-bean/src/main/java/com/java110/po/purchase/PurchaseApplyStock.java
New file
@@ -0,0 +1,101 @@
package com.java110.po.purchase;
import lombok.Data;
/**
 * 采购执行库存统计
 */
@Data
public class PurchaseApplyStock {
    /**
     * 主键ID
     */
    private String id;
    /**
     * 申请单ID
     */
    private String applyOrderId;
    /**
     * 采购次数
     */
    private String purchaseTimes;
    /**
     * 采购数量
     */
    private String purchaseQuantity;
    /**
     * 采购单价
     */
    private String purchasePrice;
    /**
     * 采购总金额
     */
    private String purchaseAmount;
    /**
     * 累计数量_John
     */
    private String totalQuantityJohn;
    /**
     * 应付金额_John
     */
    private String payableAmountJohn;
    /**
     * 付款次数
     */
    private String paymentTimes;
    /**
     * 付款总金额
     */
    private String paymentTotalAmount;
    /**
     * 未付金额_John
     */
    private String unpaidAmountJohn;
    /**
     * 未发生_John
     */
    private String unhappenJohn;
    /**
     * 入库数量
     */
    private String stockQuantity;
    /**
     * 领用数量
     */
    private String useQuantity;
    /**
     * 剩余数量
     */
    private String surplusQuantity;
    /**
     * 单价_John
     */
    private String priceJohn;
    /**
     * 剩余金额
     */
    private String surplusAmount;
    /**
     * 保管人_John
     */
    private String keeperJohn;
}
java110-bean/src/main/java/com/java110/po/purchase/PurchasePayment.java
New file
@@ -0,0 +1,23 @@
package com.java110.po.purchase;
import lombok.Data;
@Data
public class PurchasePayment {
    private String id;
    private String applyOrderId;
    private String payableAmount;
    private String paidAmount;
    private String unpaidAmount;
    private String paymentAmount;
    private String paymentCompany;
    private String payType;
    private String paymentNo;
    private String invoiceStatus;
    private String taxRate;
    private String paymentCompanyAgent; // 代付付款单位
    private String plannedPayDate;
    private String payDate;
}
java110-bean/src/main/java/com/java110/po/purchase/PurchaseReceive.java
New file
@@ -0,0 +1,19 @@
package com.java110.po.purchase;
import lombok.Data;
@Data
public class PurchaseReceive {
    private String id;
    private String applyOrderId;
    private String receiveQuantity;
    private String receiveDate;
    private String receiveAddress;
    private String signer;
    private String stockInNo;
    private String stockInDate;
    private String stockOutNo;
    private String stockOutDate;
}
java110-bean/src/main/java/com/java110/po/purchase/PurchaseReturnRecord.java
@@ -21,6 +21,9 @@
        this.orderId = orderId;
    }
    public PurchaseReturnRecord() {
    }
    private static final long serialVersionUID = 1L;
    /**
@@ -73,6 +76,14 @@
     */
    private String updateTime;
    private String returnPrice;          // 退库单价
    private String returnTotalPrice;      // 退库总价
    private String supplierName;          // 供货商名称
    private String returnStockInNo;       // 退库入库单号
    private String returnStockInDate;     // 退库入库日期
    private String returnStockOutNo;      // 退库出库单号
    private String returnDirection;       // 退库方向
    // 可选:退库数量清洗方法(提取纯数字)
    public String cleanReturnQuantity() {
        if (returnQuantity == null || returnQuantity.trim().isEmpty()) {
java110-db/src/main/resources/mapper/store/PurchaseApplyAuditServiceDaoImplMapper.xml
New file
@@ -0,0 +1,174 @@
<?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="purchaseApplyAuditServiceDaoImpl">
    <!-- 保存采购申请审核信息 add by system 2026-03-25 -->
    <insert id="savePurchaseApplyAuditInfo" parameterType="Map">
        insert into purchase_apply_audit(id, apply_order_id, audit_type, audit_date, operator, quantity, price, model, audit_dept, auditor, audit_opinion, remark, audit_end_time)
        values (#{id}, #{applyOrderId}, #{auditType}, #{auditDate}, #{operator}, #{quantity}, #{price}, #{model}, #{auditDept}, #{auditor}, #{auditOpinion}, #{remark}, #{auditEndTime})
    </insert>
    <!-- 查询采购申请审核信息 add by system 2026-03-25 -->
    <select id="getPurchaseApplyAuditInfo" parameterType="Map" resultType="Map">
        select t.id,
        t.apply_order_id,
        t.apply_order_id applyOrderId,
        t.audit_type,
        t.audit_type auditType,
        t.audit_date,
        t.audit_date auditDate,
        t.operator,
        t.quantity,
        t.price,
        t.model,
        t.audit_dept,
        t.audit_dept auditDept,
        t.auditor,
        t.audit_opinion,
        t.audit_opinion auditOpinion,
        t.remark,
        t.audit_end_time,
        t.audit_end_time auditEndTime
        from purchase_apply_audit t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="auditType !=null and auditType != ''">
            and t.audit_type= #{auditType}
        </if>
        <if test="auditDate !=null and auditDate != ''">
            and t.audit_date= #{auditDate}
        </if>
        <if test="operator !=null and operator != ''">
            and t.operator= #{operator}
        </if>
        <if test="quantity !=null and quantity != ''">
            and t.quantity= #{quantity}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="model !=null and model != ''">
            and t.model= #{model}
        </if>
        <if test="auditDept !=null and auditDept != ''">
            and t.audit_dept= #{auditDept}
        </if>
        <if test="auditor !=null and auditor != ''">
            and t.auditor= #{auditor}
        </if>
        <if test="auditOpinion !=null and auditOpinion != ''">
            and t.audit_opinion= #{auditOpinion}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="auditEndTime !=null and auditEndTime != ''">
            and t.audit_end_time= #{auditEndTime}
        </if>
        order by t.id desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购申请审核信息 add by system 2026-03-25 -->
    <update id="updatePurchaseApplyAuditInfo" parameterType="Map">
        update purchase_apply_audit t set
        <if test="applyOrderId !=null and applyOrderId != ''">
            t.apply_order_id= #{applyOrderId},
        </if>
        <if test="auditType !=null and auditType != ''">
            t.audit_type= #{auditType},
        </if>
        <if test="auditDate !=null and auditDate != ''">
            t.audit_date= #{auditDate},
        </if>
        <if test="operator !=null and operator != ''">
            t.operator= #{operator},
        </if>
        <if test="quantity !=null and quantity != ''">
            t.quantity= #{quantity},
        </if>
        <if test="price !=null and price != ''">
            t.price= #{price},
        </if>
        <if test="model !=null and model != ''">
            t.model= #{model},
        </if>
        <if test="auditDept !=null and auditDept != ''">
            t.audit_dept= #{auditDept},
        </if>
        <if test="auditor !=null and auditor != ''">
            t.auditor= #{auditor},
        </if>
        <if test="auditOpinion !=null and auditOpinion != ''">
            t.audit_opinion= #{auditOpinion},
        </if>
        <if test="remark !=null and remark != ''">
            t.remark= #{remark},
        </if>
        <if test="auditEndTime !=null and auditEndTime != ''">
            t.audit_end_time= #{auditEndTime}
        </if>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购申请审核数量 add by system 2026-03-25 -->
    <select id="queryPurchaseApplyAuditsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_apply_audit t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="auditType !=null and auditType != ''">
            and t.audit_type= #{auditType}
        </if>
        <if test="auditDate !=null and auditDate != ''">
            and t.audit_date= #{auditDate}
        </if>
        <if test="operator !=null and operator != ''">
            and t.operator= #{operator}
        </if>
        <if test="quantity !=null and quantity != ''">
            and t.quantity= #{quantity}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="model !=null and model != ''">
            and t.model= #{model}
        </if>
        <if test="auditDept !=null and auditDept != ''">
            and t.audit_dept= #{auditDept}
        </if>
        <if test="auditor !=null and auditor != ''">
            and t.auditor= #{auditor}
        </if>
        <if test="auditOpinion !=null and auditOpinion != ''">
            and t.audit_opinion= #{auditOpinion}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="auditEndTime !=null and auditEndTime != ''">
            and t.audit_end_time= #{auditEndTime}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchaseApplyItemServiceDaoImplMapper.xml
New file
@@ -0,0 +1,135 @@
<?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="purchaseApplyItemServiceDaoImpl">
    <!-- 保存采购申请明细项信息 add by system 2026-03-25 -->
    <insert id="savePurchaseApplyItemInfo" parameterType="Map">
        insert into purchase_apply_item(id, apply_order_id, is_sign_report, sign_report_date,
        item_no, type, purchase_name, model, unit)
        values (#{id}, #{applyOrderId}, #{isSignReport}, #{signReportDate},
        #{itemNo}, #{type}, #{purchaseName}, #{model}, #{unit})
    </insert>
    <!-- 查询采购申请明细项信息 add by system 2026-03-25 -->
    <select id="getPurchaseApplyItemInfo" parameterType="Map" resultType="Map">
        select t.id,
        t.apply_order_id,
        t.apply_order_id applyOrderId,
        t.is_sign_report,
        t.is_sign_report isSignReport,
        t.sign_report_date,
        t.sign_report_date signReportDate,
        t.item_no,
        t.item_no itemNo,
        t.type,
        t.purchase_name,
        t.purchase_name purchaseName,
        t.model,
        t.unit
        from purchase_apply_item t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="isSignReport !=null and isSignReport != ''">
            and t.is_sign_report= #{isSignReport}
        </if>
        <if test="signReportDate !=null and signReportDate != ''">
            and t.sign_report_date= #{signReportDate}
        </if>
        <if test="itemNo !=null and itemNo != ''">
            and t.item_no= #{itemNo}
        </if>
        <if test="type !=null and type != ''">
            and t.type= #{type}
        </if>
        <if test="purchaseName !=null and purchaseName != ''">
            and t.purchase_name= #{purchaseName}
        </if>
        <if test="model !=null and model != ''">
            and t.model= #{model}
        </if>
        <if test="unit !=null and unit != ''">
            and t.unit= #{unit}
        </if>
        order by t.id desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购申请明细项信息 add by system 2026-03-25 -->
    <update id="updatePurchaseApplyItemInfo" parameterType="Map">
        update purchase_apply_item t set
        <if test="applyOrderId !=null and applyOrderId != ''">
            t.apply_order_id= #{applyOrderId},
        </if>
        <if test="isSignReport !=null and isSignReport != ''">
            t.is_sign_report= #{isSignReport},
        </if>
        <if test="signReportDate !=null and signReportDate != ''">
            t.sign_report_date= #{signReportDate},
        </if>
        <if test="itemNo !=null and itemNo != ''">
            t.item_no= #{itemNo},
        </if>
        <if test="type !=null and type != ''">
            t.type= #{type},
        </if>
        <if test="purchaseName !=null and purchaseName != ''">
            t.purchase_name= #{purchaseName},
        </if>
        <if test="model !=null and model != ''">
            t.model= #{model},
        </if>
        <if test="unit !=null and unit != ''">
            t.unit= #{unit}
        </if>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购申请明细项数量 add by system 2026-03-25 -->
    <select id="queryPurchaseApplyItemsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_apply_item t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="isSignReport !=null and isSignReport != ''">
            and t.is_sign_report= #{isSignReport}
        </if>
        <if test="signReportDate !=null and signReportDate != ''">
            and t.sign_report_date= #{signReportDate}
        </if>
        <if test="itemNo !=null and itemNo != ''">
            and t.item_no= #{itemNo}
        </if>
        <if test="type !=null and type != ''">
            and t.type= #{type}
        </if>
        <if test="purchaseName !=null and purchaseName != ''">
            and t.purchase_name= #{purchaseName}
        </if>
        <if test="model !=null and model != ''">
            and t.model= #{model}
        </if>
        <if test="unit !=null and unit != ''">
            and t.unit= #{unit}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchaseApplyStockServiceDaoImplMapper.xml
New file
@@ -0,0 +1,241 @@
<?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="purchaseApplyStockServiceDaoImpl">
    <!-- 保存采购执行库存统计信息 add by system 2026-03-25 -->
    <insert id="savePurchaseApplyStockInfo" parameterType="Map">
        insert into purchase_apply_stock(id, apply_order_id, purchase_times, purchase_quantity,
        purchase_price, purchase_amount, total_quantity_john, payable_amount_john,
        payment_times, payment_total_amount, unpaid_amount_john, unhappen_john,
        stock_quantity, use_quantity, surplus_quantity, price_john, surplus_amount, keeper_john)
        values (#{id}, #{applyOrderId}, #{purchaseTimes}, #{purchaseQuantity},
        #{purchasePrice}, #{purchaseAmount}, #{totalQuantityJohn}, #{payableAmountJohn},
        #{paymentTimes}, #{paymentTotalAmount}, #{unpaidAmountJohn}, #{unhappenJohn},
        #{stockQuantity}, #{useQuantity}, #{surplusQuantity}, #{priceJohn}, #{surplusAmount}, #{keeperJohn})
    </insert>
    <!-- 查询采购执行库存统计信息 add by system 2026-03-25 -->
    <select id="getPurchaseApplyStockInfo" parameterType="Map" resultType="Map">
        select t.id,
        t.apply_order_id,
        t.apply_order_id applyOrderId,
        t.purchase_times,
        t.purchase_times purchaseTimes,
        t.purchase_quantity,
        t.purchase_quantity purchaseQuantity,
        t.purchase_price,
        t.purchase_price purchasePrice,
        t.purchase_amount,
        t.purchase_amount purchaseAmount,
        t.total_quantity_john,
        t.total_quantity_john totalQuantityJohn,
        t.payable_amount_john,
        t.payable_amount_john payableAmountJohn,
        t.payment_times,
        t.payment_times paymentTimes,
        t.payment_total_amount,
        t.payment_total_amount paymentTotalAmount,
        t.unpaid_amount_john,
        t.unpaid_amount_john unpaidAmountJohn,
        t.unhappen_john,
        t.unhappen_john unhappenJohn,
        t.stock_quantity,
        t.stock_quantity stockQuantity,
        t.use_quantity,
        t.use_quantity useQuantity,
        t.surplus_quantity,
        t.surplus_quantity surplusQuantity,
        t.price_john,
        t.price_john priceJohn,
        t.surplus_amount,
        t.surplus_amount surplusAmount,
        t.keeper_john,
        t.keeper_john keeperJohn
        from purchase_apply_stock t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="purchaseTimes !=null and purchaseTimes != ''">
            and t.purchase_times= #{purchaseTimes}
        </if>
        <if test="purchaseQuantity !=null and purchaseQuantity != ''">
            and t.purchase_quantity= #{purchaseQuantity}
        </if>
        <if test="purchasePrice !=null and purchasePrice != ''">
            and t.purchase_price= #{purchasePrice}
        </if>
        <if test="purchaseAmount !=null and purchaseAmount != ''">
            and t.purchase_amount= #{purchaseAmount}
        </if>
        <if test="totalQuantityJohn !=null and totalQuantityJohn != ''">
            and t.total_quantity_john= #{totalQuantityJohn}
        </if>
        <if test="payableAmountJohn !=null and payableAmountJohn != ''">
            and t.payable_amount_john= #{payableAmountJohn}
        </if>
        <if test="paymentTimes !=null and paymentTimes != ''">
            and t.payment_times= #{paymentTimes}
        </if>
        <if test="paymentTotalAmount !=null and paymentTotalAmount != ''">
            and t.payment_total_amount= #{paymentTotalAmount}
        </if>
        <if test="unpaidAmountJohn !=null and unpaidAmountJohn != ''">
            and t.unpaid_amount_john= #{unpaidAmountJohn}
        </if>
        <if test="unhappenJohn !=null and unhappenJohn != ''">
            and t.unhappen_john= #{unhappenJohn}
        </if>
        <if test="stockQuantity !=null and stockQuantity != ''">
            and t.stock_quantity= #{stockQuantity}
        </if>
        <if test="useQuantity !=null and useQuantity != ''">
            and t.use_quantity= #{useQuantity}
        </if>
        <if test="surplusQuantity !=null and surplusQuantity != ''">
            and t.surplus_quantity= #{surplusQuantity}
        </if>
        <if test="priceJohn !=null and priceJohn != ''">
            and t.price_john= #{priceJohn}
        </if>
        <if test="surplusAmount !=null and surplusAmount != ''">
            and t.surplus_amount= #{surplusAmount}
        </if>
        <if test="keeperJohn !=null and keeperJohn != ''">
            and t.keeper_john= #{keeperJohn}
        </if>
        order by t.id desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购执行库存统计信息 add by system 2026-03-25 -->
    <update id="updatePurchaseApplyStockInfo" parameterType="Map">
        update purchase_apply_stock t set
        <if test="applyOrderId !=null and applyOrderId != ''">
            t.apply_order_id= #{applyOrderId},
        </if>
        <if test="purchaseTimes !=null and purchaseTimes != ''">
            t.purchase_times= #{purchaseTimes},
        </if>
        <if test="purchaseQuantity !=null and purchaseQuantity != ''">
            t.purchase_quantity= #{purchaseQuantity},
        </if>
        <if test="purchasePrice !=null and purchasePrice != ''">
            t.purchase_price= #{purchasePrice},
        </if>
        <if test="purchaseAmount !=null and purchaseAmount != ''">
            t.purchase_amount= #{purchaseAmount},
        </if>
        <if test="totalQuantityJohn !=null and totalQuantityJohn != ''">
            t.total_quantity_john= #{totalQuantityJohn},
        </if>
        <if test="payableAmountJohn !=null and payableAmountJohn != ''">
            t.payable_amount_john= #{payableAmountJohn},
        </if>
        <if test="paymentTimes !=null and paymentTimes != ''">
            t.payment_times= #{paymentTimes},
        </if>
        <if test="paymentTotalAmount !=null and paymentTotalAmount != ''">
            t.payment_total_amount= #{paymentTotalAmount},
        </if>
        <if test="unpaidAmountJohn !=null and unpaidAmountJohn != ''">
            t.unpaid_amount_john= #{unpaidAmountJohn},
        </if>
        <if test="unhappenJohn !=null and unhappenJohn != ''">
            t.unhappen_john= #{unhappenJohn},
        </if>
        <if test="stockQuantity !=null and stockQuantity != ''">
            t.stock_quantity= #{stockQuantity},
        </if>
        <if test="useQuantity !=null and useQuantity != ''">
            t.use_quantity= #{useQuantity},
        </if>
        <if test="surplusQuantity !=null and surplusQuantity != ''">
            t.surplus_quantity= #{surplusQuantity},
        </if>
        <if test="priceJohn !=null and priceJohn != ''">
            t.price_john= #{priceJohn},
        </if>
        <if test="surplusAmount !=null and surplusAmount != ''">
            t.surplus_amount= #{surplusAmount},
        </if>
        <if test="keeperJohn !=null and keeperJohn != ''">
            t.keeper_john= #{keeperJohn}
        </if>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购执行库存统计数量 add by system 2026-03-25 -->
    <select id="queryPurchaseApplyStocksCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_apply_stock t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="purchaseTimes !=null and purchaseTimes != ''">
            and t.purchase_times= #{purchaseTimes}
        </if>
        <if test="purchaseQuantity !=null and purchaseQuantity != ''">
            and t.purchase_quantity= #{purchaseQuantity}
        </if>
        <if test="purchasePrice !=null and purchasePrice != ''">
            and t.purchase_price= #{purchasePrice}
        </if>
        <if test="purchaseAmount !=null and purchaseAmount != ''">
            and t.purchase_amount= #{purchaseAmount}
        </if>
        <if test="totalQuantityJohn !=null and totalQuantityJohn != ''">
            and t.total_quantity_john= #{totalQuantityJohn}
        </if>
        <if test="payableAmountJohn !=null and payableAmountJohn != ''">
            and t.payable_amount_john= #{payableAmountJohn}
        </if>
        <if test="paymentTimes !=null and paymentTimes != ''">
            and t.payment_times= #{paymentTimes}
        </if>
        <if test="paymentTotalAmount !=null and paymentTotalAmount != ''">
            and t.payment_total_amount= #{paymentTotalAmount}
        </if>
        <if test="unpaidAmountJohn !=null and unpaidAmountJohn != ''">
            and t.unpaid_amount_john= #{unpaidAmountJohn}
        </if>
        <if test="unhappenJohn !=null and unhappenJohn != ''">
            and t.unhappen_john= #{unhappenJohn}
        </if>
        <if test="stockQuantity !=null and stockQuantity != ''">
            and t.stock_quantity= #{stockQuantity}
        </if>
        <if test="useQuantity !=null and useQuantity != ''">
            and t.use_quantity= #{useQuantity}
        </if>
        <if test="surplusQuantity !=null and surplusQuantity != ''">
            and t.surplus_quantity= #{surplusQuantity}
        </if>
        <if test="priceJohn !=null and priceJohn != ''">
            and t.price_john= #{priceJohn}
        </if>
        <if test="surplusAmount !=null and surplusAmount != ''">
            and t.surplus_amount= #{surplusAmount}
        </if>
        <if test="keeperJohn !=null and keeperJohn != ''">
            and t.keeper_john= #{keeperJohn}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchasePaymentServiceDaoImplMapper.xml
New file
@@ -0,0 +1,182 @@
<?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="purchasePaymentServiceDaoImpl">
    <!-- 保存采购支付信息 add by system 2026-03-25 -->
    <insert id="savePurchasePaymentInfo" parameterType="Map">
        insert into purchase_payment(id, apply_order_id, payable_amount, paid_amount, unpaid_amount,
        payment_amount, payment_company, pay_type, payment_no, invoice_status, tax_rate, planned_pay_date, pay_date)
        values (#{id}, #{applyOrderId}, #{payableAmount}, #{paidAmount}, #{unpaidAmount},
        #{paymentAmount}, #{paymentCompany}, #{payType}, #{paymentNo}, #{invoiceStatus}, #{taxRate}, #{plannedPayDate}, #{payDate})
    </insert>
    <!-- 查询采购支付信息 add by system 2026-03-25 -->
    <select id="getPurchasePaymentInfo" parameterType="Map" resultType="Map">
        select t.id,
        t.apply_order_id,
        t.apply_order_id applyOrderId,
        t.payable_amount,
        t.payable_amount payableAmount,
        t.paid_amount,
        t.paid_amount paidAmount,
        t.unpaid_amount,
        t.unpaid_amount unpaidAmount,
        t.payment_amount,
        t.payment_amount paymentAmount,
        t.payment_company,
        t.payment_company paymentCompany,
        t.pay_type,
        t.pay_type payType,
        t.payment_no,
        t.payment_no paymentNo,
        t.invoice_status,
        t.invoice_status invoiceStatus,
        t.tax_rate,
        t.tax_rate taxRate,
        t.planned_pay_date,
        t.planned_pay_date plannedPayDate,
        t.pay_date,
        t.pay_date payDate
        from purchase_payment t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="payableAmount !=null and payableAmount != ''">
            and t.payable_amount= #{payableAmount}
        </if>
        <if test="paidAmount !=null and paidAmount != ''">
            and t.paid_amount= #{paidAmount}
        </if>
        <if test="unpaidAmount !=null and unpaidAmount != ''">
            and t.unpaid_amount= #{unpaidAmount}
        </if>
        <if test="paymentAmount !=null and paymentAmount != ''">
            and t.payment_amount= #{paymentAmount}
        </if>
        <if test="paymentCompany !=null and paymentCompany != ''">
            and t.payment_company= #{paymentCompany}
        </if>
        <if test="payType !=null and payType != ''">
            and t.pay_type= #{payType}
        </if>
        <if test="paymentNo !=null and paymentNo != ''">
            and t.payment_no= #{paymentNo}
        </if>
        <if test="invoiceStatus !=null and invoiceStatus != ''">
            and t.invoice_status= #{invoiceStatus}
        </if>
        <if test="taxRate !=null and taxRate != ''">
            and t.tax_rate= #{taxRate}
        </if>
        <if test="plannedPayDate !=null and plannedPayDate != ''">
            and t.planned_pay_date= #{plannedPayDate}
        </if>
        <if test="payDate !=null and payDate != ''">
            and t.pay_date= #{payDate}
        </if>
        order by t.id desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购支付信息 add by system 2026-03-25 -->
    <update id="updatePurchasePaymentInfo" parameterType="Map">
        update purchase_payment t set
        <if test="applyOrderId !=null and applyOrderId != ''">
            t.apply_order_id= #{applyOrderId},
        </if>
        <if test="payableAmount !=null and payableAmount != ''">
            t.payable_amount= #{payableAmount},
        </if>
        <if test="paidAmount !=null and paidAmount != ''">
            t.paid_amount= #{paidAmount},
        </if>
        <if test="unpaidAmount !=null and unpaidAmount != ''">
            t.unpaid_amount= #{unpaidAmount},
        </if>
        <if test="paymentAmount !=null and paymentAmount != ''">
            t.payment_amount= #{paymentAmount},
        </if>
        <if test="paymentCompany !=null and paymentCompany != ''">
            t.payment_company= #{paymentCompany},
        </if>
        <if test="payType !=null and payType != ''">
            t.pay_type= #{payType},
        </if>
        <if test="paymentNo !=null and paymentNo != ''">
            t.payment_no= #{paymentNo},
        </if>
        <if test="invoiceStatus !=null and invoiceStatus != ''">
            t.invoice_status= #{invoiceStatus},
        </if>
        <if test="taxRate !=null and taxRate != ''">
            t.tax_rate= #{taxRate},
        </if>
        <if test="plannedPayDate !=null and plannedPayDate != ''">
            t.planned_pay_date= #{plannedPayDate},
        </if>
        <if test="payDate !=null and payDate != ''">
            t.pay_date= #{payDate}
        </if>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购支付数量 add by system 2026-03-25 -->
    <select id="queryPurchasePaymentsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_payment t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="payableAmount !=null and payableAmount != ''">
            and t.payable_amount= #{payableAmount}
        </if>
        <if test="paidAmount !=null and paidAmount != ''">
            and t.paid_amount= #{paidAmount}
        </if>
        <if test="unpaidAmount !=null and unpaidAmount != ''">
            and t.unpaid_amount= #{unpaidAmount}
        </if>
        <if test="paymentAmount !=null and paymentAmount != ''">
            and t.payment_amount= #{paymentAmount}
        </if>
        <if test="paymentCompany !=null and paymentCompany != ''">
            and t.payment_company= #{paymentCompany}
        </if>
        <if test="payType !=null and payType != ''">
            and t.pay_type= #{payType}
        </if>
        <if test="paymentNo !=null and paymentNo != ''">
            and t.payment_no= #{paymentNo}
        </if>
        <if test="invoiceStatus !=null and invoiceStatus != ''">
            and t.invoice_status= #{invoiceStatus}
        </if>
        <if test="taxRate !=null and taxRate != ''">
            and t.tax_rate= #{taxRate}
        </if>
        <if test="plannedPayDate !=null and plannedPayDate != ''">
            and t.planned_pay_date= #{plannedPayDate}
        </if>
        <if test="payDate !=null and payDate != ''">
            and t.pay_date= #{payDate}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/store/PurchaseReceiveServiceDaoImplMapper.xml
New file
@@ -0,0 +1,148 @@
<?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="purchaseReceiveServiceDaoImpl">
    <!-- 保存采购收货信息 add by system 2026-03-25 -->
    <insert id="savePurchaseReceiveInfo" parameterType="Map">
        insert into purchase_receive(id, apply_order_id, receive_quantity, receive_date, receive_address,
        signer, stock_in_no, stock_in_date, stock_out_no, stock_out_date)
        values (#{id}, #{applyOrderId}, #{receiveQuantity}, #{receiveDate}, #{receiveAddress},
        #{signer}, #{stockInNo}, #{stockInDate}, #{stockOutNo}, #{stockOutDate})
    </insert>
    <!-- 查询采购收货信息 add by system 2026-03-25 -->
    <select id="getPurchaseReceiveInfo" parameterType="Map" resultType="Map">
        select t.id,
        t.apply_order_id,
        t.apply_order_id applyOrderId,
        t.receive_quantity,
        t.receive_quantity receiveQuantity,
        t.receive_date,
        t.receive_date receiveDate,
        t.receive_address,
        t.receive_address receiveAddress,
        t.signer,
        t.stock_in_no,
        t.stock_in_no stockInNo,
        t.stock_in_date,
        t.stock_in_date stockInDate,
        t.stock_out_no,
        t.stock_out_no stockOutNo,
        t.stock_out_date,
        t.stock_out_date stockOutDate
        from purchase_receive t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="receiveQuantity !=null and receiveQuantity != ''">
            and t.receive_quantity= #{receiveQuantity}
        </if>
        <if test="receiveDate !=null and receiveDate != ''">
            and t.receive_date= #{receiveDate}
        </if>
        <if test="receiveAddress !=null and receiveAddress != ''">
            and t.receive_address= #{receiveAddress}
        </if>
        <if test="signer !=null and signer != ''">
            and t.signer= #{signer}
        </if>
        <if test="stockInNo !=null and stockInNo != ''">
            and t.stock_in_no= #{stockInNo}
        </if>
        <if test="stockInDate !=null and stockInDate != ''">
            and t.stock_in_date= #{stockInDate}
        </if>
        <if test="stockOutNo !=null and stockOutNo != ''">
            and t.stock_out_no= #{stockOutNo}
        </if>
        <if test="stockOutDate !=null and stockOutDate != ''">
            and t.stock_out_date= #{stockOutDate}
        </if>
        order by t.id desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改采购收货信息 add by system 2026-03-25 -->
    <update id="updatePurchaseReceiveInfo" parameterType="Map">
        update purchase_receive t set
        <if test="applyOrderId !=null and applyOrderId != ''">
            t.apply_order_id= #{applyOrderId},
        </if>
        <if test="receiveQuantity !=null and receiveQuantity != ''">
            t.receive_quantity= #{receiveQuantity},
        </if>
        <if test="receiveDate !=null and receiveDate != ''">
            t.receive_date= #{receiveDate},
        </if>
        <if test="receiveAddress !=null and receiveAddress != ''">
            t.receive_address= #{receiveAddress},
        </if>
        <if test="signer !=null and signer != ''">
            t.signer= #{signer},
        </if>
        <if test="stockInNo !=null and stockInNo != ''">
            t.stock_in_no= #{stockInNo},
        </if>
        <if test="stockInDate !=null and stockInDate != ''">
            t.stock_in_date= #{stockInDate},
        </if>
        <if test="stockOutNo !=null and stockOutNo != ''">
            t.stock_out_no= #{stockOutNo},
        </if>
        <if test="stockOutDate !=null and stockOutDate != ''">
            t.stock_out_date= #{stockOutDate}
        </if>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
    </update>
    <!-- 查询采购收货数量 add by system 2026-03-25 -->
    <select id="queryPurchaseReceivesCount" parameterType="Map" resultType="Map">
        select count(1) count
        from purchase_receive t
        where 1 =1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="applyOrderId !=null and applyOrderId != ''">
            and t.apply_order_id= #{applyOrderId}
        </if>
        <if test="receiveQuantity !=null and receiveQuantity != ''">
            and t.receive_quantity= #{receiveQuantity}
        </if>
        <if test="receiveDate !=null and receiveDate != ''">
            and t.receive_date= #{receiveDate}
        </if>
        <if test="receiveAddress !=null and receiveAddress != ''">
            and t.receive_address= #{receiveAddress}
        </if>
        <if test="signer !=null and signer != ''">
            and t.signer= #{signer}
        </if>
        <if test="stockInNo !=null and stockInNo != ''">
            and t.stock_in_no= #{stockInNo}
        </if>
        <if test="stockInDate !=null and stockInDate != ''">
            and t.stock_in_date= #{stockInDate}
        </if>
        <if test="stockOutNo !=null and stockOutNo != ''">
            and t.stock_out_no= #{stockOutNo}
        </if>
        <if test="stockOutDate !=null and stockOutDate != ''">
            and t.stock_out_date= #{stockOutDate}
        </if>
    </select>
</mapper>
service-api/src/main/java/com/java110/api/importData/adapt/ImportPurchaseApplyCleaningAdapt.java
New file
@@ -0,0 +1,66 @@
package com.java110.api.importData.adapt;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.importData.DefaultImportDataAdapt;
import com.java110.api.importData.IImportDataCleaningAdapt;
import com.java110.dto.importData.ImportOwnerRoomDto;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.utils.util.Assert;
import com.java110.utils.util.ImportExcelUtils;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
 * 房产数据导入处理类
 *
 * 导入请求参数中必须包含
 * param.append('importAdapt', "importRoomOwner");
 */
@Service("importPurchaseApplyDataCleaning")
public class ImportPurchaseApplyCleaningAdapt extends DefaultImportDataAdapt implements IImportDataCleaningAdapt {
    @Override
    public List analysisExcel(Workbook workbook, JSONObject paramIn, ComponentValidateResult result) throws Exception{
        List<Object[]> ownerRooms = new ArrayList<Object[]>();
        //封装对象
        getOwnerRooms(workbook, ownerRooms, result);
        return ownerRooms;
    }
    /**
     * 获取业主车辆信息
     *
     * @param workbook
     * @param purchaseApply
     */
    private void getOwnerRooms(Workbook workbook, List<Object[]> purchaseApply, ComponentValidateResult result) throws ParseException {
        Sheet sheet = null;
        sheet = ImportExcelUtils.getSheet(workbook, "登记表");
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            if (osIndex < 7) {
                continue;
            }
            if (oList.get(osIndex)[1] == null) {
                break;
            }
            Object[] os = new Object[190];
            System.arraycopy(oList.get(osIndex), 0, os, 0, Math.min(oList.get(osIndex).length, 178));
            os[179] = result.getStoreId();
            os[180] = result.getUserId();
            os[181] = result.getUserName();
            os[182] = result.getCommunityId();
            purchaseApply.add(os);
        }
    }
}
service-api/src/main/java/com/java110/api/smo/assetImport/impl/ImportResourceStoreV2SMOImpl.java
@@ -43,7 +43,7 @@
import java.text.ParseException;
import java.util.*;
@Service("importResourceStoreSMOImpl")
//@Service("importResourceStoreSMOImpl")
public class ImportResourceStoreV2SMOImpl extends DefaultAbstractComponentSMO implements IImportResourceStoreSMO {
    private final static Logger logger = LoggerFactory.getLogger(ImportResourceStoreV2SMOImpl.class);
@@ -360,7 +360,7 @@
//            resourceStoreDto.setOutHighPrice(os[7].toString());
            resourceStoreDtos.add(resourceStoreDto);
            try {
                Thread.sleep(200);
                Thread.sleep(500);
            } catch (InterruptedException e) {
            }
service-api/src/main/java/com/java110/api/smo/assetImport/impl/ImportResourceStoreV3SMOImpl.java
New file
@@ -0,0 +1,180 @@
package com.java110.api.smo.assetImport.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.smo.DefaultAbstractComponentSMO;
import com.java110.api.smo.assetImport.IImportResourceStoreSMO;
import com.java110.core.context.IPageData;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.importData.ImportResourceStoreDto;
import com.java110.dto.importData.Vtil;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.intf.community.IImportOwnerRoomInnerServiceSMO;
import com.java110.intf.store.IPurchaseApplyInnerServiceSMO;
import com.java110.intf.store.IResourceStoreTypeInnerServiceSMO;
import com.java110.intf.store.IStorehouseV1InnerServiceSMO;
import com.java110.po.purchase.*;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.ImportExcelUtils;
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException;
import java.util.*;
@Service("importResourceStoreSMOImpl")
public class ImportResourceStoreV3SMOImpl extends DefaultAbstractComponentSMO implements IImportResourceStoreSMO {
    private final static Logger logger = LoggerFactory.getLogger(ImportResourceStoreV3SMOImpl.class);
    public static final int DEFAULT_ROWS = 500;
    @Autowired
    private RestTemplate restTemplate;
    @Autowired
    private IImportOwnerRoomInnerServiceSMO importOwnerRoomInnerServiceSMOImpl;
    @Autowired
    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
    @Autowired
    private IResourceStoreTypeInnerServiceSMO resourceStoreTypeInnerServiceSMOImpl;
    @Autowired
    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
    public static final String CODE_PREFIX_ID = "10";
    @Override
    public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception {
        try {
            ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate);
            //InputStream is = uploadFile.getInputStream();
            Workbook workbook = ImportExcelUtils.createWorkbook(uploadFile);  //工作簿
            List<Object[]> resourceStoreDtos = new ArrayList<Object[]>();
            //封装对象
            getResourceStores(workbook, resourceStoreDtos, result);
            // 保存数据
            return dealExcelData(pd, resourceStoreDtos, result);
        } catch (Exception e) {
            logger.error("导入失败 ", e);
            return new ResponseEntity<String>("非常抱歉,您填写的模板数据有误:" + e.getMessage(), HttpStatus.BAD_REQUEST);
        }
    }
    /**
     * 获取业主车辆信息
     *
     * @param workbook
     * @param resourceStoreDtos
     */
    private void getResourceStores(Workbook workbook, List<Object[]> resourceStoreDtos, ComponentValidateResult result) throws ParseException {
        Sheet sheet = null;
        sheet = ImportExcelUtils.getSheet(workbook, "登记表");
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        ImportResourceStoreDto resourceStoreDto = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            Object[] os = oList.get(osIndex);
            resourceStoreDtos.add(os);
        }
    }
    /**
     * 处理房产信息
     */
    private ResponseEntity<String> dealExcelData(IPageData pd, List<Object[]> resourceStoreDtos, ComponentValidateResult result) {
        ResponseEntity<String> responseEntity = null;
        List<ImportResourceStoreDto> tmpImportResourceStoreDtos = new ArrayList<>();
        int flag = 0;
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        int successCount = 0;
        JSONObject data = new JSONObject();
        data.put("userId", result.getUserId());
        data.put("userName", result.getUserName());
        data.put("storeId", result.getStoreId());
        data.put("communityId", result.getCommunityId());
        data.put("shId", paramIn.getString("shId"));
//        data.put("shName", "系统仓库");
//        Map<String, String> com = new HashMap<>();
//        Map<String, String> rst = new HashMap<>();
        try {
            for (int roomIndex = 0; roomIndex < resourceStoreDtos.size(); roomIndex++) {
            }
            if (tmpImportResourceStoreDtos.size() > 0) {
                flag = saveResourceStore(pd, tmpImportResourceStoreDtos, data);
                successCount += flag;
            }
        } catch (Exception e) {
            logger.error("导入失败", e);
            //按批次做撤销功能
            throw e;
        }
        return ResultVo.createResponseEntity("总共导入:" + tmpImportResourceStoreDtos.size() + ";成功导入:" + successCount + ";导入失败:" + (tmpImportResourceStoreDtos.size() - successCount));
    }
    /**
     * 创建费用
     *
     * @param pd
     * @param tmpImportResourceStoreDtos
     */
    private int saveResourceStore(IPageData pd, List<ImportResourceStoreDto> tmpImportResourceStoreDtos, JSONObject data) {
        JSONArray importRoomFees = JSONArray.parseArray(JSONObject.toJSONString(tmpImportResourceStoreDtos));
        data.put("importResourceStoreDtos", importRoomFees);
        String apiUrl = "resourceStore.importResourceStore";
        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, data.toJSONString(), apiUrl, HttpMethod.POST);
        if (responseEntity.getStatusCode() != HttpStatus.OK) {
            throw new IllegalArgumentException(responseEntity.getBody());
        }
        JSONObject paramOut = JSONObject.parseObject(responseEntity.getBody());
        if (ResultVo.CODE_OK != paramOut.getInteger("code")) {
            throw new IllegalArgumentException(paramOut.getString("msg"));
        }
        return paramOut.getIntValue("data");
    }
    //解析Excel日期格式
    public static Date DoubleToDate(Double dVal) {
        Date tDate = new Date();
        long localOffset = tDate.getTimezoneOffset() * 60000; //系统时区偏移 1900/1/1 到 1970/1/1 的 25569 天
        tDate.setTime((long) ((dVal - 25569) * 24 * 3600 * 1000 + localOffset));
        return tDate;
    }
}
service-job/src/main/java/com/java110/job/importData/adapt/ImportPurchaseApplyQueueDataAdapt.java
New file
@@ -0,0 +1,320 @@
package com.java110.job.importData.adapt;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.dict.DictDto;
import com.java110.dto.fee.FeeConfigDto;
import com.java110.dto.importData.*;
import com.java110.dto.log.AssetImportLogDetailDto;
import com.java110.dto.oweFeeCallable.OweFeeCallableDto;
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.room.RoomDto;
import com.java110.fee.dao.IApplyRoomDiscountServiceDao;
import com.java110.intf.community.ICommunityInnerServiceSMO;
import com.java110.intf.community.IImportOwnerRoomInnerServiceSMO;
import com.java110.intf.dev.IDictV1InnerServiceSMO;
import com.java110.intf.fee.IFeeAttrInnerServiceSMO;
import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
import com.java110.intf.fee.IOweFeeCallableV1InnerServiceSMO;
import com.java110.intf.fee.IPayFeeV1InnerServiceSMO;
import com.java110.intf.store.IPurchaseApplyInnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IOwnerV1InnerServiceSMO;
import com.java110.job.importData.DefaultImportData;
import com.java110.job.importData.IImportDataAdapt;
import com.java110.po.dict.DictPo;
import com.java110.po.fee.FeeAttrPo;
import com.java110.po.fee.PayFeePo;
import com.java110.po.oweFeeCallable.OweFeeCallablePo;
import com.java110.po.owner.OwnerPo;
import com.java110.po.purchase.*;
import com.java110.po.room.ApplyRoomDiscountPo;
import com.java110.po.room.LitigationInfoPo;
import com.java110.po.room.PayeeReceiveInfoPo;
import com.java110.utils.util.BeanConvertUtil;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 房产信息导入 适配器
 * 前端请求 时 必须传入
 *   param.append('importAdapt', "importRoomOwner");
 */
@Service("importPurchaseApplyQueueData")
public class ImportPurchaseApplyQueueDataAdapt extends DefaultImportData implements IImportDataAdapt {
    @Autowired
    protected SqlSessionTemplate sqlSessionTemplate;
    @Autowired
    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;
    @Override
    public void importData(List<AssetImportLogDetailDto> assetImportLogDetailDtos) {
        importDatas(assetImportLogDetailDtos);
    }
    private void importDatas(List<AssetImportLogDetailDto> infos) {
        for (AssetImportLogDetailDto assetImportLogDetailDto : infos) {
            try {
                doImportData(assetImportLogDetailDto);
                updateImportLogDetailState(assetImportLogDetailDto.getDetailId());
                try {
                    Thread.sleep(200);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            } catch (Exception e) {
                e.printStackTrace();
                String errorMsg = e.getMessage();
                // 先判空,再判断包含关系
                if (errorMsg != null && errorMsg.contains("### Error updating database")) {
                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(),
                            "未知错误,请联系管理员" + errorMsg);
                } else {
                    // 补充:这里也建议对 e 做兜底处理,避免传递空的异常信息
                    String finalMsg = errorMsg != null ? errorMsg : e.toString();
                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), finalMsg);
                    // 如果原方法 updateImportLogDetailState 接收 Exception 类型参数,可保留:
                    // updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
                }
            }
        }
    }
    /**
     * 导入数据
     *
     * @param assetImportLogDetailDto
     */
    private void doImportData(AssetImportLogDetailDto assetImportLogDetailDto) {
        JSONArray os = JSONObject.parseArray(assetImportLogDetailDto.getContent());
        PurchaseApplyPo purchaseApplyPo = new PurchaseApplyPo();
        purchaseApplyPo.setApplyDate(Vtil.defaultValue(os.get(2)));
        purchaseApplyPo.setBId("-1");
        purchaseApplyPo.setStoreId(os.getString(179));
        purchaseApplyPo.setCreateUserId(os.getString(180));
        purchaseApplyPo.setCreateUserName(os.getString(181));
        purchaseApplyPo.setCommunityId(os.getString(182));
        purchaseApplyPo.setDescription("");
        purchaseApplyPo.setResOrderType("10000");
        purchaseApplyPo.setWarehousingWay("20000");
        purchaseApplyPo.setYear(os.getString(2));
        purchaseApplyPo.setMonth(os.getString(3));
        purchaseApplyPo.setCompany(os.getString(5));
        purchaseApplyPo.setDepartment(os.getString(6));
        purchaseApplyPo.setCommunityName(os.getString(7));
        purchaseApplyPo.setUserName(os.getString(8));
        purchaseApplyPo.setSerialNo(os.getString(9));
        purchaseApplyPo.setTripleNo(os.getString(10));
        purchaseApplyPo.setApplyOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseApplyPo.setBudgetQuantity(os.getString(18));
        purchaseApplyPo.setBudgetPrice(os.getString(19));
        purchaseApplyPo.setBudgetAmount(os.getString(20));
        purchaseApplyPo.setReceiver(os.getString(21));
        purchaseApplyPo.setReceiveAddr(os.getString(22));
        PurchaseApplyItem purchaseApplyItem = new PurchaseApplyItem();
        purchaseApplyItem.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseApplyItem.setApplyOrderId(purchaseApplyPo.getApplyOrderId());
        purchaseApplyItem.setIsSignReport(os.getString(11));
        purchaseApplyItem.setSignReportDate(os.getString(12));
        purchaseApplyItem.setItemNo(os.getString(13));
        purchaseApplyItem.setType(os.getString(14));
        purchaseApplyItem.setPurchaseName(os.getString(15));
        purchaseApplyItem.setModel(os.getString(16));
        purchaseApplyItem.setUnit(os.getString(17));
        sqlSessionTemplate.insert("purchaseApplyItemServiceDaoImpl.savePurchaseApplyItemInfo", BeanConvertUtil.beanCovertMap(purchaseApplyItem));
        List<PurchaseApplyAudit> purchaseApplyAudits = new ArrayList<>();
        builderPurchaseApplyAudits(purchaseApplyAudits, purchaseApplyPo.getApplyOrderId(), os);
        for(PurchaseApplyAudit purchaseApplyAudit : purchaseApplyAudits){
            sqlSessionTemplate.insert("purchaseApplyAuditServiceDaoImpl.savePurchaseApplyAuditInfo", BeanConvertUtil.beanCovertMap(purchaseApplyAudit));
        }
        PurchaseApplyStock purchaseApplyStock = new PurchaseApplyStock();
        purchaseApplyStock.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseApplyStock.setApplyOrderId(purchaseApplyPo.getApplyOrderId());
        purchaseApplyStock.setPurchaseTimes(os.getString(44));
        purchaseApplyStock.setPurchaseQuantity(os.getString(45));
        purchaseApplyStock.setPurchasePrice(os.getString(46));
        purchaseApplyStock.setPurchaseAmount(os.getString(47));
        purchaseApplyStock.setTotalQuantityJohn(os.getString(48));
        purchaseApplyStock.setPayableAmountJohn(os.getString(49));
        purchaseApplyStock.setPaymentTimes(os.getString(51));
        purchaseApplyStock.setPaymentTotalAmount(os.getString(52));
        purchaseApplyStock.setUnpaidAmountJohn(os.getString(53));
        purchaseApplyStock.setUnhappenJohn(os.getString(54));
        purchaseApplyStock.setStockQuantity(os.getString(55));
        purchaseApplyStock.setUseQuantity(os.getString(56));
        purchaseApplyStock.setStockQuantity(os.getString(57));
        purchaseApplyStock.setPriceJohn(os.getString(58));
        purchaseApplyStock.setSurplusAmount(os.getString(59));
        purchaseApplyStock.setKeeperJohn(os.getString(60));
        sqlSessionTemplate.insert("purchaseApplyStockServiceDaoImpl.savePurchaseApplyStockInfo", BeanConvertUtil.beanCovertMap(purchaseApplyStock));
        ResourceStorePo resourceStorePo = new ResourceStorePo();
//        resourceStorePo.setResId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_resId));
//        resourceStorePo.setStoreId(os.getString(179));
//        resourceStorePo.set
//        resourceStorePo.setCommunityId(os.getString(182));
        List<PurchaseApplyDetailPo> purchaseApplyDetailPos = new ArrayList<>();
        builderPurchaseApplyDetailPos(purchaseApplyDetailPos, purchaseApplyPo.getApplyOrderId(), os);
        purchaseApplyPo.setPurchaseApplyDetailPos(purchaseApplyDetailPos);
        purchaseApplyInnerServiceSMOImpl.savePurchaseApply(purchaseApplyPo);
        List<PurchasePayment> purchasePayments = new ArrayList<>();
        builderPurchasePayment(purchasePayments, purchaseApplyPo.getApplyOrderId(), os);
        for (PurchasePayment purchasePayment : purchasePayments) {
            sqlSessionTemplate.insert("purchasePaymentServiceDaoImpl.savePurchasePaymentInfo", BeanConvertUtil.beanCovertMap(purchasePayment));
        }
        PurchaseReceive purchaseReceive = new PurchaseReceive();
        purchaseReceive.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseReceive.setApplyOrderId(purchaseApplyPo.getApplyOrderId());
        purchaseReceive.setReceiveQuantity(os.getString(157));
        purchaseReceive.setReceiveDate(os.getString(158));
        purchaseReceive.setReceiveAddress(os.getString(159));
        purchaseReceive.setSigner(os.getString(160));
        purchaseReceive.setStockInNo(os.getString(161));
        purchaseReceive.setStockInDate(os.getString(162));
        purchaseReceive.setStockOutNo(os.getString(163));
        purchaseReceive.setStockOutDate(os.getString(164));
        sqlSessionTemplate.insert("purchaseReceiveServiceDaoImpl.savePurchaseReceiveInfo",  BeanConvertUtil.beanCovertMap(purchaseReceive));
        PurchaseReturnRecord purchaseReturnRecord = new PurchaseReturnRecord();
        purchaseReturnRecord.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseReturnRecord.setOrderId(purchaseApplyPo.getApplyOrderId());
        purchaseReturnRecord.setReturnDate(os.getString(165));
        purchaseReturnRecord.setReturnQuantity(os.getString(166));
        purchaseReturnRecord.setReturnPerson(os.getString(167));
        purchaseReturnRecord.setApprover(os.getString(168));
        purchaseReturnRecord.setReturnPrice(os.getString(169));
        purchaseReturnRecord.setReturnTotalPrice(os.getString(170));
        purchaseReturnRecord.setSupplierName(os.getString(171));
        purchaseReturnRecord.setReturnStockInNo(os.getString(172));
        purchaseReturnRecord.setReturnStockInDate(os.getString(173));
        purchaseReturnRecord.setReturnStockOutNo(os.getString(174));
        purchaseReturnRecord.setReturnDirection(os.getString(175));
        sqlSessionTemplate.insert("purchaseReturnRecordServiceDaoImpl.insertPurchaseReturnRecord",  BeanConvertUtil.beanCovertMap(purchaseReturnRecord));
    }
    private void builderPurchasePayment(List<PurchasePayment> purchasePayments, String applyOrderId, JSONArray os) {
        for (int i = 97; i <= 97 + 12 * 4; i += 12) {
            PurchasePayment purchasePayment = new PurchasePayment();
            purchasePayment.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
            purchasePayment.setApplyOrderId(applyOrderId);
            purchasePayment.setPayableAmount(os.getString(i));
            purchasePayment.setPaidAmount(os.getString(i+1));
            purchasePayment.setUnpaidAmount(os.getString(i+2));
            purchasePayment.setPaymentAmount(os.getString(i+3));
            purchasePayment.setPaymentCompany(os.getString(i+4));
            purchasePayment.setPayType(os.getString(i+5));
            purchasePayment.setPaymentNo(os.getString(i+6));
            purchasePayment.setInvoiceStatus(os.getString(i+7));
            purchasePayment.setTaxRate(os.getString(i+8));
            purchasePayment.setPaymentCompanyAgent(os.getString(i+9));
            purchasePayment.setPlannedPayDate(os.getString(i+10));
            purchasePayment.setPayDate(os.getString(i+11));
            purchasePayments.add(purchasePayment);
        }
    }
    private void builderPurchaseApplyDetailPos(List<PurchaseApplyDetailPo> purchaseApplyAudits, String applyOrderId, JSONArray os) {
        for (int i = 61; i <= 61 + 9 * 4; i += 9) {
            PurchaseApplyDetailPo purchaseApplyDetailPo = new PurchaseApplyDetailPo();
            purchaseApplyDetailPo.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
            purchaseApplyDetailPo.setApplyOrderId(applyOrderId);
            purchaseApplyDetailPo.setResId(os.getString(15));//TODO 添加物品
            purchaseApplyDetailPo.setPurchaseDate(os.getString(i));
            purchaseApplyDetailPo.setQuantity(os.getString(i + 1));
            purchaseApplyDetailPo.setPrice(os.getString(i + 2));
            purchaseApplyDetailPo.setPurchaseAmount(os.getString(i + 3));
            purchaseApplyDetailPo.setPurchaser(os.getString(i + 4));
            purchaseApplyDetailPo.setSupplier(os.getString(i + 5));
            purchaseApplyDetailPo.setContactPerson(os.getString(i + 6));
            purchaseApplyDetailPo.setPhone(os.getString(i + 7));
            purchaseApplyDetailPo.setWechat(os.getString(i + 8));
            purchaseApplyAudits.add(purchaseApplyDetailPo);
        }
    }
    private void builderPurchaseApplyAudits(List<PurchaseApplyAudit> purchaseApplyAudits, String applyOrderId, JSONArray os) {
        {
            PurchaseApplyAudit purchaseApplyAudit = new PurchaseApplyAudit();
            purchaseApplyAudit.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
            purchaseApplyAudit.setAuditType("审核部门");
            purchaseApplyAudit.setApplyOrderId(applyOrderId);
            purchaseApplyAudit.setAuditDate(os.getString(26));
            purchaseApplyAudit.setOperator(os.getString(27));
            purchaseApplyAudit.setQuantity(os.getString(28));
            purchaseApplyAudit.setPrice(os.getString(29));
            purchaseApplyAudit.setModel(os.getString(30));
            purchaseApplyAudit.setAuditDept(os.getString(31));
            purchaseApplyAudit.setAuditor(os.getString(32));
            purchaseApplyAudits.add(purchaseApplyAudit);
        }
        {
            PurchaseApplyAudit purchaseApplyAudit = new PurchaseApplyAudit();
            purchaseApplyAudit.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
            purchaseApplyAudit.setAuditType("财务部审核");
            purchaseApplyAudit.setApplyOrderId(applyOrderId);
            purchaseApplyAudit.setAuditDate(os.getString(33));
            purchaseApplyAudit.setOperator(os.getString(34));
            purchaseApplyAudit.setAuditDate(os.getString(35));
            purchaseApplyAudit.setAuditDept(os.getString(36));
            purchaseApplyAudit.setAuditor(os.getString(37));
            purchaseApplyAudit.setAuditOpinion(os.getString(38));
            purchaseApplyAudit.setRemark(os.getString(39));
            purchaseApplyAudits.add(purchaseApplyAudit);
        }
        PurchaseApplyAudit purchaseApplyAudit = new PurchaseApplyAudit();
        purchaseApplyAudit.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId));
        purchaseApplyAudit.setAuditType("领导审核");
        purchaseApplyAudit.setApplyOrderId(applyOrderId);
        purchaseApplyAudit.setAuditDate(os.getString(40));
        purchaseApplyAudit.setOperator(os.getString(41));
        purchaseApplyAudit.setAuditor(os.getString(42));
        purchaseApplyAudit.setRemark(os.getString(43));
        purchaseApplyAudits.add(purchaseApplyAudit);
    }
}
service-store/src/main/java/com/java110/store/cmd/resourceStore/ImportResourceStoreCmd.java
@@ -25,6 +25,7 @@
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.dict.DictDto;
import com.java110.dto.dict.DictQueryDto;
import com.java110.dto.importData.Vtil;
import com.java110.dto.purchase.PurchaseApplyDto;
import com.java110.dto.resource.ResourceStoreDto;
import com.java110.dto.resource.ResourceStoreTypeDto;
@@ -189,6 +190,7 @@
            resourceStorePo.setSupplier1(importResourceStoreDto.getSupplier1());
            resourceStorePo.setSupplier2(importResourceStoreDto.getSupplier2());
            resourceStorePo.setSupplier3(importResourceStoreDto.getSupplier3());
            resourceStorePo.setPrice(Vtil.defaultValue(resourceStorePo.getPrice(), null));
            int flag = 0;
            if (ListUtil.isNull(resourceStoreDtos)) {
                resourceStorePo.setResId(resourceStoreDto.getResId() == null ? GenerateCodeFactory.getResId(GenerateCodeFactory.CODE_PREFIX_resId) : resourceStoreDto.getResId());
service-store/src/main/java/com/java110/store/cmd/resourceStore/ListResourceStoresCmd.java
@@ -197,13 +197,13 @@
                resourceStoreTimesDto.setResCode(resourceStore.getResCode());
                resourceStoreTimesDto.setShId(resourceStore.getShId());
                //查询批次表
                List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
                for (ResourceStoreTimesDto resourceStoreTimes : resourceStoreTimesDtos) {
                    BigDecimal stock = new BigDecimal(resourceStoreTimes.getStock());
                    BigDecimal price = new BigDecimal(resourceStoreTimes.getPrice());
                    BigDecimal multiply = stock.multiply(price).setScale(2, BigDecimal.ROUND_HALF_UP);
                    number = number.add(multiply);
                }
//                List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
//                for (ResourceStoreTimesDto resourceStoreTimes : resourceStoreTimesDtos) {
//                    BigDecimal stock = new BigDecimal(resourceStoreTimes.getStock());
//                    BigDecimal price = new BigDecimal(resourceStoreTimes.getPrice());
//                    BigDecimal multiply = stock.multiply(price).setScale(2, BigDecimal.ROUND_HALF_UP);
//                    number = number.add(multiply);
//                }
            }
            subTotalPrice = number;
            resourceStoreDto.setPage(PageDto.DEFAULT_PAGE);
service-store/src/main/java/com/java110/store/smo/impl/ResourceStoreInnerServiceSMOImpl.java
@@ -83,8 +83,8 @@
            resourceStoreTimesDto.setStoreId(resourceResourceStoreDto.getStoreId());
            resourceStoreTimesDto.setResCode(resourceStoreDto.getResCode());
            resourceStoreTimesDto.setShId(resourceStoreDto.getShId());
            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
            resourceStoreDto.setTimes(resourceStoreTimesDtos);
//            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
//            resourceStoreDto.setTimes(resourceStoreTimesDtos);
        }
        return resourceStoreDtos;
    }