diff --git a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java index ce8467a..e849544 100644 --- a/cweb/src/main/java/com/cweb/notify/LaKaLaController.java +++ b/cweb/src/main/java/com/cweb/notify/LaKaLaController.java @@ -77,6 +77,10 @@ public class LaKaLaController { other.put("log_no", body.getString("log_no")); other.put("acc_trade_no", body.getString("acc_trade_no")); other.put("card_type", body.getString("card_type")); + + if (body.getString("acc_settle_amount") != null) { + other.put("acc_settle_amount", body.getBigDecimal("acc_settle_amount").divide(new BigDecimal("100"))); + } if (body.getString("acc_discount_amount") != null) { other.put("acc_discount_amount", body.getBigDecimal("acc_discount_amount").divide(new BigDecimal("100"))); } @@ -89,7 +93,7 @@ public class LaKaLaController { body.getString("trade_no"), PlatformTypeEnum.type1, TradeOrderPayModeEnum.getNameByCode(body.getString("account_type")), - body.getBigDecimal("payer_amount").divide(new BigDecimal("100")), + body.getBigDecimal("total_amount").divide(new BigDecimal("100")), body.getString("merchant_no"), other ); diff --git a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java index 258c8f2..925a673 100644 --- a/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java +++ b/schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java @@ -272,6 +272,7 @@ public class TradeOrderSchedule { tradeOrder.setShdFeeAmt(queryTrans.getBigDecimal("fee_amount")); tradeOrder.setSettleAmount(queryTrans.getBigDecimal("settle_amount")); tradeOrder.setSettleDate(queryTrans.getDate("clear_date")); + tradeOrder.setFeeRate(new BigDecimal(queryTrans.getString("fee_rate").split(",")[0])); tradeOrderService.editOrder(tradeOrder); } } catch (Exception e) { diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java index 3fc20a2..9553546 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java @@ -60,19 +60,19 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "user_discount_name, user_discount_type, ", "user_discount_price, user_discount_actual_price, ", "trade_actual_amount, income_amount, ", - "acc_trade_no, acc_mdiscount_amount, ", - "acc_discount_amount, shd_fee_amt, ", - "fee_rate, settle_amount, ", - "settle_date, acc_payment_code, ", - "card_type, `status`, ", - "profit_sharing_status, pay_time, ", - "timeout_express, subject, ", - "pay_notify_url, attach, ", - "special_field, refund_type, ", - "refund_price, create_type, ", - "create_time, cancel_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "acc_trade_no, acc_settle_amount, ", + "acc_mdiscount_amount, acc_discount_amount, ", + "shd_fee_amt, fee_rate, ", + "settle_amount, settle_date, ", + "acc_payment_code, card_type, ", + "`status`, profit_sharing_status, ", + "pay_time, timeout_express, ", + "subject, pay_notify_url, ", + "attach, special_field, ", + "refund_type, refund_price, ", + "create_type, create_time, ", + "cancel_time, update_time, ", + "ext_1, ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ", "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merNo,jdbcType=VARCHAR}, ", @@ -94,19 +94,19 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "#{userDiscountName,jdbcType=VARCHAR}, #{userDiscountType,jdbcType=INTEGER}, ", "#{userDiscountPrice,jdbcType=DECIMAL}, #{userDiscountActualPrice,jdbcType=DECIMAL}, ", "#{tradeActualAmount,jdbcType=DECIMAL}, #{incomeAmount,jdbcType=DECIMAL}, ", - "#{accTradeNo,jdbcType=VARCHAR}, #{accMdiscountAmount,jdbcType=DECIMAL}, ", - "#{accDiscountAmount,jdbcType=DECIMAL}, #{shdFeeAmt,jdbcType=DECIMAL}, ", - "#{feeRate,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ", - "#{settleDate,jdbcType=DATE}, #{accPaymentCode,jdbcType=VARCHAR}, ", - "#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", - "#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ", - "#{timeoutExpress,jdbcType=INTEGER}, #{subject,jdbcType=VARCHAR}, ", - "#{payNotifyUrl,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, ", - "#{specialField,jdbcType=VARCHAR}, #{refundType,jdbcType=INTEGER}, ", - "#{refundPrice,jdbcType=DECIMAL}, #{createType,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{accTradeNo,jdbcType=VARCHAR}, #{accSettleAmount,jdbcType=DECIMAL}, ", + "#{accMdiscountAmount,jdbcType=DECIMAL}, #{accDiscountAmount,jdbcType=DECIMAL}, ", + "#{shdFeeAmt,jdbcType=DECIMAL}, #{feeRate,jdbcType=DECIMAL}, ", + "#{settleAmount,jdbcType=DECIMAL}, #{settleDate,jdbcType=DATE}, ", + "#{accPaymentCode,jdbcType=VARCHAR}, #{cardType,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{profitSharingStatus,jdbcType=BIT}, ", + "#{payTime,jdbcType=TIMESTAMP}, #{timeoutExpress,jdbcType=INTEGER}, ", + "#{subject,jdbcType=VARCHAR}, #{payNotifyUrl,jdbcType=VARCHAR}, ", + "#{attach,jdbcType=VARCHAR}, #{specialField,jdbcType=VARCHAR}, ", + "#{refundType,jdbcType=INTEGER}, #{refundPrice,jdbcType=DECIMAL}, ", + "#{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{cancelTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsTradeOrder record); @@ -162,6 +162,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { @Result(column="trade_actual_amount", property="tradeActualAmount", jdbcType=JdbcType.DECIMAL), @Result(column="income_amount", property="incomeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR), + @Result(column="acc_settle_amount", property="accSettleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_discount_amount", property="accDiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), @@ -201,9 +202,9 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "store_discount_actual_price, store_discount_profit_price, user_id, user_phone, ", "user_discount_id, user_discount_name, user_discount_type, user_discount_price, ", "user_discount_actual_price, trade_actual_amount, income_amount, acc_trade_no, ", - "acc_mdiscount_amount, acc_discount_amount, shd_fee_amt, fee_rate, settle_amount, ", - "settle_date, acc_payment_code, card_type, `status`, profit_sharing_status, pay_time, ", - "timeout_express, subject, pay_notify_url, attach, special_field, refund_type, ", + "acc_settle_amount, acc_mdiscount_amount, acc_discount_amount, shd_fee_amt, fee_rate, ", + "settle_amount, settle_date, acc_payment_code, card_type, `status`, profit_sharing_status, ", + "pay_time, timeout_express, subject, pay_notify_url, attach, special_field, refund_type, ", "refund_price, create_type, create_time, cancel_time, update_time, ext_1, ext_2, ", "ext_3", "from bs_trade_order", @@ -255,6 +256,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { @Result(column="trade_actual_amount", property="tradeActualAmount", jdbcType=JdbcType.DECIMAL), @Result(column="income_amount", property="incomeAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR), + @Result(column="acc_settle_amount", property="accSettleAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_mdiscount_amount", property="accMdiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="acc_discount_amount", property="accDiscountAmount", jdbcType=JdbcType.DECIMAL), @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL), @@ -338,6 +340,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt { "trade_actual_amount = #{tradeActualAmount,jdbcType=DECIMAL},", "income_amount = #{incomeAmount,jdbcType=DECIMAL},", "acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},", + "acc_settle_amount = #{accSettleAmount,jdbcType=DECIMAL},", "acc_mdiscount_amount = #{accMdiscountAmount,jdbcType=DECIMAL},", "acc_discount_amount = #{accDiscountAmount,jdbcType=DECIMAL},", "shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},", diff --git a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java index 971a0a2..56bc075 100644 --- a/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java @@ -204,6 +204,10 @@ public class BsTradeOrderSqlProvider { sql.VALUES("acc_trade_no", "#{accTradeNo,jdbcType=VARCHAR}"); } + if (record.getAccSettleAmount() != null) { + sql.VALUES("acc_settle_amount", "#{accSettleAmount,jdbcType=DECIMAL}"); + } + if (record.getAccMdiscountAmount() != null) { sql.VALUES("acc_mdiscount_amount", "#{accMdiscountAmount,jdbcType=DECIMAL}"); } @@ -358,6 +362,7 @@ public class BsTradeOrderSqlProvider { sql.SELECT("trade_actual_amount"); sql.SELECT("income_amount"); sql.SELECT("acc_trade_no"); + sql.SELECT("acc_settle_amount"); sql.SELECT("acc_mdiscount_amount"); sql.SELECT("acc_discount_amount"); sql.SELECT("shd_fee_amt"); @@ -580,6 +585,10 @@ public class BsTradeOrderSqlProvider { sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}"); } + if (record.getAccSettleAmount() != null) { + sql.SET("acc_settle_amount = #{record.accSettleAmount,jdbcType=DECIMAL}"); + } + if (record.getAccMdiscountAmount() != null) { sql.SET("acc_mdiscount_amount = #{record.accMdiscountAmount,jdbcType=DECIMAL}"); } @@ -733,6 +742,7 @@ public class BsTradeOrderSqlProvider { sql.SET("trade_actual_amount = #{record.tradeActualAmount,jdbcType=DECIMAL}"); sql.SET("income_amount = #{record.incomeAmount,jdbcType=DECIMAL}"); sql.SET("acc_trade_no = #{record.accTradeNo,jdbcType=VARCHAR}"); + sql.SET("acc_settle_amount = #{record.accSettleAmount,jdbcType=DECIMAL}"); sql.SET("acc_mdiscount_amount = #{record.accMdiscountAmount,jdbcType=DECIMAL}"); sql.SET("acc_discount_amount = #{record.accDiscountAmount,jdbcType=DECIMAL}"); sql.SET("shd_fee_amt = #{record.shdFeeAmt,jdbcType=DECIMAL}"); @@ -944,6 +954,10 @@ public class BsTradeOrderSqlProvider { sql.SET("acc_trade_no = #{accTradeNo,jdbcType=VARCHAR}"); } + if (record.getAccSettleAmount() != null) { + sql.SET("acc_settle_amount = #{accSettleAmount,jdbcType=DECIMAL}"); + } + if (record.getAccMdiscountAmount() != null) { sql.SET("acc_mdiscount_amount = #{accMdiscountAmount,jdbcType=DECIMAL}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java index 1d6390d..c25fb62 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrder.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrder.java @@ -243,6 +243,11 @@ public class BsTradeOrder implements Serializable { */ private String accTradeNo; + /** + * 账户端应结订单金额 + */ + private BigDecimal accSettleAmount; + /** * 账户端商户优惠金额,单位分 */ @@ -721,6 +726,14 @@ public class BsTradeOrder implements Serializable { this.accTradeNo = accTradeNo; } + public BigDecimal getAccSettleAmount() { + return accSettleAmount; + } + + public void setAccSettleAmount(BigDecimal accSettleAmount) { + this.accSettleAmount = accSettleAmount; + } + public BigDecimal getAccMdiscountAmount() { return accMdiscountAmount; } @@ -978,6 +991,7 @@ public class BsTradeOrder implements Serializable { && (this.getTradeActualAmount() == null ? other.getTradeActualAmount() == null : this.getTradeActualAmount().equals(other.getTradeActualAmount())) && (this.getIncomeAmount() == null ? other.getIncomeAmount() == null : this.getIncomeAmount().equals(other.getIncomeAmount())) && (this.getAccTradeNo() == null ? other.getAccTradeNo() == null : this.getAccTradeNo().equals(other.getAccTradeNo())) + && (this.getAccSettleAmount() == null ? other.getAccSettleAmount() == null : this.getAccSettleAmount().equals(other.getAccSettleAmount())) && (this.getAccMdiscountAmount() == null ? other.getAccMdiscountAmount() == null : this.getAccMdiscountAmount().equals(other.getAccMdiscountAmount())) && (this.getAccDiscountAmount() == null ? other.getAccDiscountAmount() == null : this.getAccDiscountAmount().equals(other.getAccDiscountAmount())) && (this.getShdFeeAmt() == null ? other.getShdFeeAmt() == null : this.getShdFeeAmt().equals(other.getShdFeeAmt())) @@ -1054,6 +1068,7 @@ public class BsTradeOrder implements Serializable { result = prime * result + ((getTradeActualAmount() == null) ? 0 : getTradeActualAmount().hashCode()); result = prime * result + ((getIncomeAmount() == null) ? 0 : getIncomeAmount().hashCode()); result = prime * result + ((getAccTradeNo() == null) ? 0 : getAccTradeNo().hashCode()); + result = prime * result + ((getAccSettleAmount() == null) ? 0 : getAccSettleAmount().hashCode()); result = prime * result + ((getAccMdiscountAmount() == null) ? 0 : getAccMdiscountAmount().hashCode()); result = prime * result + ((getAccDiscountAmount() == null) ? 0 : getAccDiscountAmount().hashCode()); result = prime * result + ((getShdFeeAmt() == null) ? 0 : getShdFeeAmt().hashCode()); @@ -1133,6 +1148,7 @@ public class BsTradeOrder implements Serializable { sb.append(", tradeActualAmount=").append(tradeActualAmount); sb.append(", incomeAmount=").append(incomeAmount); sb.append(", accTradeNo=").append(accTradeNo); + sb.append(", accSettleAmount=").append(accSettleAmount); sb.append(", accMdiscountAmount=").append(accMdiscountAmount); sb.append(", accDiscountAmount=").append(accDiscountAmount); sb.append(", shdFeeAmt=").append(shdFeeAmt); diff --git a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java index 55db984..77bfbfc 100644 --- a/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java +++ b/service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java @@ -3033,6 +3033,66 @@ public class BsTradeOrderExample { return (Criteria) this; } + public Criteria andAccSettleAmountIsNull() { + addCriterion("acc_settle_amount is null"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountIsNotNull() { + addCriterion("acc_settle_amount is not null"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountEqualTo(BigDecimal value) { + addCriterion("acc_settle_amount =", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountNotEqualTo(BigDecimal value) { + addCriterion("acc_settle_amount <>", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountGreaterThan(BigDecimal value) { + addCriterion("acc_settle_amount >", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("acc_settle_amount >=", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountLessThan(BigDecimal value) { + addCriterion("acc_settle_amount <", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("acc_settle_amount <=", value, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountIn(List values) { + addCriterion("acc_settle_amount in", values, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountNotIn(List values) { + addCriterion("acc_settle_amount not in", values, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("acc_settle_amount between", value1, value2, "accSettleAmount"); + return (Criteria) this; + } + + public Criteria andAccSettleAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("acc_settle_amount not between", value1, value2, "accSettleAmount"); + return (Criteria) this; + } + public Criteria andAccMdiscountAmountIsNull() { addCriterion("acc_mdiscount_amount is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java index 9b162e5..efdc23d 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java @@ -97,11 +97,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { tradeOrder.setCompanyId(mer.getCompanyId()); tradeOrder.setAgentId(mer.getAgentId()); tradeOrder.setSalesmanId(mer.getSalesmanId()); - // 业务人员 - BsSalesman salesman = salesmanService.getSalesman(mer.getSalesmanId()); - if (salesman != null) { - tradeOrder.setSalesmanName(salesman.getName()); - } + tradeOrder.setSalesmanName(mer.getSalesmanName()); tradeOrder.setMerId(store.getMerId()); tradeOrder.setMerNo(mer.getMerNo()); tradeOrder.setMerName(mer.getMerAbbreviate()); @@ -225,19 +221,6 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { tradeOrder.setStatus(TradeOrderStatusEnum.status3.getNumber()); tradeOrder.setPayTime(new Date()); - // WECHAT ALIPAY - if (tradeOrder.getPayMode().equals(TradeOrderPayModeEnum.WECHAT.getCode())) { - BsMerRate rate = merRateService.getDetail(tradeOrder.getMerId(), 302); - if (rate != null) { - tradeOrder.setFeeRate(rate.getRatePct()); - } - } else if (tradeOrder.getPayMode().equals(TradeOrderPayModeEnum.ALIPAY.getCode())) { - BsMerRate rate = merRateService.getDetail(tradeOrder.getMerId(),303); - if (rate != null) { - tradeOrder.setFeeRate(rate.getRatePct()); - } - } - if (StringUtils.isNotBlank(MapUtils.getString(other, "log_no"))) { tradeOrder.setPlatformLogNo(MapUtils.getString(other, "log_no")); } @@ -247,6 +230,20 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { if (StringUtils.isNotBlank(MapUtils.getString(other, "card_type"))) { tradeOrder.setCardType(MapUtils.getString(other, "card_type")); } + tradeOrder.setAccSettleAmount( + StringUtils.isNotBlank(MapUtils.getString(other, "acc_settle_amount")) + ?new BigDecimal(MapUtils.getString(other, "acc_settle_amount")) + :new BigDecimal("0")); + + tradeOrder.setAccDiscountAmount( + StringUtils.isNotBlank(MapUtils.getString(other, "acc_discount_amount")) + ?new BigDecimal(MapUtils.getString(other, "acc_discount_amount")) + :new BigDecimal("0")); + + tradeOrder.setAccMdiscountAmount(StringUtils.isNotBlank(MapUtils.getString(other, "acc_mdiscount_amount")) + ?new BigDecimal(MapUtils.getString(other, "acc_mdiscount_amount")) + :new BigDecimal("0")); + editOrder(tradeOrder); if (tradeOrder.getCreateType() != null && !tradeOrder.getCreateType().equals(TradeOrderCreateTypeEnum.type3.getCode())) {