Переглянути джерело

//activity v.2

release_toaliyun_real
xiaohu 1 рік тому
джерело
коміт
ade8004f81
7 змінених файлів з 19 додано та 17 видалено
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxVtwoCashBackActivityController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantAwardServiceImpl.java
  3. +3
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantExportServiceImpl.java
  4. +4
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantSettlementServiceImpl.java
  5. +7
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxVtwoCashBackGrantAwardServiceImpl.java
  6. +1
    -1
      mallinkService/src/main/resources/mapper/WxVtwoActivityGrantExportMapper.xml
  7. +2
    -2
      mallinkService/src/main/resources/mapper/WxVtwoActivityGrantOrderMapper.xml

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/market/WxVtwoCashBackActivityController.java Переглянути файл

@@ -263,7 +263,7 @@ public class WxVtwoCashBackActivityController extends BaseController {
if(activityGrant.getOrderIdList() == null || activityGrant.getOrderIdList().isEmpty()){ if(activityGrant.getOrderIdList() == null || activityGrant.getOrderIdList().isEmpty()){
return new ResultData(Result.ERROR,"请选择订单"); return new ResultData(Result.ERROR,"请选择订单");
} }
WxVtwoCashBackActivity cashBackActivity = wxVtwoCashBackActivityService.getById(activityGrant.getActivityId(), activityGrant.getTenantId());
WxVtwoCashBackActivity cashBackActivity = wxVtwoCashBackActivityService.getInfoById(activityGrant.getActivityId(), activityGrant.getTenantId());
if(cashBackActivity == null){ if(cashBackActivity == null){
return new ResultData(Result.ERROR,"查询不到活动"); return new ResultData(Result.ERROR,"查询不到活动");
} }


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantAwardServiceImpl.java Переглянути файл

@@ -65,7 +65,7 @@ public class WxVtwoActivityGrantAwardServiceImpl extends ServiceImpl<WxVtwoActiv


final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
for(WxVtwoActivityGrantAward grantAward : grantAwardList){ for(WxVtwoActivityGrantAward grantAward : grantAwardList){
grantAward.setAwardId(idWorker.nextId());
grantAward.setId(idWorker.nextId());
grantAward.updateTenantInfo(activityGrant); grantAward.updateTenantInfo(activityGrant);
grantAward.setActivityId(activityGrant.getActivityId()); grantAward.setActivityId(activityGrant.getActivityId());
grantAward.setActivityName(activityGrant.getActivityName()); grantAward.setActivityName(activityGrant.getActivityName());


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantExportServiceImpl.java Переглянути файл

@@ -61,7 +61,7 @@ public class WxVtwoActivityGrantExportServiceImpl extends ServiceImpl<WxVtwoActi
grantExport.setGrantRemark(activityGrant.getRemark()); grantExport.setGrantRemark(activityGrant.getRemark());
grantExport.setSignImg(activityGrant.getSignImg()); grantExport.setSignImg(activityGrant.getSignImg());


grantExportList.add(grantExport);
}); });
wxVtwoActivityGrantExportMapper.insertList(grantExportList); wxVtwoActivityGrantExportMapper.insertList(grantExportList);
} }
@@ -137,6 +137,8 @@ public class WxVtwoActivityGrantExportServiceImpl extends ServiceImpl<WxVtwoActi
grantExport.setGrantTime(activityGrant.getCreateDate()); grantExport.setGrantTime(activityGrant.getCreateDate());
grantExport.setGrantRemark(activityGrant.getRemark()); grantExport.setGrantRemark(activityGrant.getRemark());
grantExport.setSignImg(activityGrant.getSignImg()); grantExport.setSignImg(activityGrant.getSignImg());

grantExportList.add(grantExport);
}); });
wxVtwoActivityGrantExportMapper.insertList(grantExportList); wxVtwoActivityGrantExportMapper.insertList(grantExportList);
} }


+ 4
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxVtwoActivityGrantSettlementServiceImpl.java Переглянути файл

@@ -106,6 +106,7 @@ public class WxVtwoActivityGrantSettlementServiceImpl extends ServiceImpl<WxVtwo
.multiply(settlement.getMallShareRate().divide(new BigDecimal(100))) .multiply(settlement.getMallShareRate().divide(new BigDecimal(100)))
.setScale(2, RoundingMode.HALF_UP)); .setScale(2, RoundingMode.HALF_UP));
settlement.setOrderMerchantSharePrice(settlement.getOrderGrantPrice().subtract(settlement.getOrderMallSharePrice())); settlement.setOrderMerchantSharePrice(settlement.getOrderGrantPrice().subtract(settlement.getOrderMallSharePrice()));
settlement.setTaxAmount(BigDecimal.ZERO);
settlement.setCreateDate(grant.getUpdateDate()); settlement.setCreateDate(grant.getUpdateDate());
settlement.setUpdateDate(grant.getUpdateDate()); settlement.setUpdateDate(grant.getUpdateDate());
return settlement; return settlement;
@@ -199,11 +200,9 @@ public class WxVtwoActivityGrantSettlementServiceImpl extends ServiceImpl<WxVtwo
.multiply(settlement.getMallShareRate().divide(new BigDecimal(100))) .multiply(settlement.getMallShareRate().divide(new BigDecimal(100)))
.setScale(2, RoundingMode.HALF_UP)); .setScale(2, RoundingMode.HALF_UP));
settlement.setOrderMerchantSharePrice(settlement.getOrderGrantPrice().subtract(settlement.getOrderMallSharePrice())); settlement.setOrderMerchantSharePrice(settlement.getOrderGrantPrice().subtract(settlement.getOrderMallSharePrice()));
if(grant.getTaxAmount() != null){
settlement.setTaxAmount(grant.getTaxAmount()
.multiply(settlement.getOrderRatio().divide(new BigDecimal(100)))
.setScale(2, RoundingMode.HALF_UP));
}
settlement.setTaxAmount(grant.getTaxAmount()
.multiply(settlement.getOrderRatio().divide(new BigDecimal(100)))
.setScale(2, RoundingMode.HALF_UP));
settlement.setCreateDate(grant.getUpdateDate()); settlement.setCreateDate(grant.getUpdateDate());
settlement.setUpdateDate(grant.getUpdateDate()); settlement.setUpdateDate(grant.getUpdateDate());
return settlement; return settlement;


+ 7
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxVtwoCashBackGrantAwardServiceImpl.java Переглянути файл

@@ -146,6 +146,7 @@ public class WxVtwoCashBackGrantAwardServiceImpl extends ServiceImpl<WxVtwoCashB
BigDecimal taxAmount = BigDecimal.ZERO; BigDecimal taxAmount = BigDecimal.ZERO;
for (WxVtwoCashBackGrantAward grantAward:grantAwardList){ for (WxVtwoCashBackGrantAward grantAward:grantAwardList){
grantAward.setTaxDeductionRules(cashBackActivity.getTaxDeductionRules()); grantAward.setTaxDeductionRules(cashBackActivity.getTaxDeductionRules());
grantAward.setTaxAmount(BigDecimal.ZERO);
WxVtwoActivityTaxDeductionRule taxDeductionRulesObject = cashBackActivity.getTaxDeductionRulesObject(); WxVtwoActivityTaxDeductionRule taxDeductionRulesObject = cashBackActivity.getTaxDeductionRulesObject();
if(taxDeductionRulesObject.getStartingTax() != null && grantAward.getCashBack().compareTo(taxDeductionRulesObject.getStartingTax()) > 0 if(taxDeductionRulesObject.getStartingTax() != null && grantAward.getCashBack().compareTo(taxDeductionRulesObject.getStartingTax()) > 0
&& taxDeductionRulesObject.getTaxPoints() != null){ && taxDeductionRulesObject.getTaxPoints() != null){
@@ -157,17 +158,17 @@ public class WxVtwoCashBackGrantAwardServiceImpl extends ServiceImpl<WxVtwoCashB
activityGrant.setTaxAmount(taxAmount); activityGrant.setTaxAmount(taxAmount);
}else{ }else{
activityGrant.setTaxDeductionRules(cashBackActivity.getTaxDeductionRules()); activityGrant.setTaxDeductionRules(cashBackActivity.getTaxDeductionRules());
activityGrant.setTaxAmount(BigDecimal.ZERO);
WxVtwoActivityTaxDeductionRule taxDeductionRulesObject = cashBackActivity.getTaxDeductionRulesObject(); WxVtwoActivityTaxDeductionRule taxDeductionRulesObject = cashBackActivity.getTaxDeductionRulesObject();
if(taxDeductionRulesObject.getStartingTax() != null && activityGrant.getCashBack().compareTo(taxDeductionRulesObject.getStartingTax()) > 0 if(taxDeductionRulesObject.getStartingTax() != null && activityGrant.getCashBack().compareTo(taxDeductionRulesObject.getStartingTax()) > 0
&& taxDeductionRulesObject.getTaxPoints() != null){ && taxDeductionRulesObject.getTaxPoints() != null){
activityGrant.setTaxAmount(activityGrant.getCashBack().multiply(taxDeductionRulesObject.getTaxPoints()) activityGrant.setTaxAmount(activityGrant.getCashBack().multiply(taxDeductionRulesObject.getTaxPoints())
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)); .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP));

//税点分摊到发奖上面
for (WxVtwoCashBackGrantAward grantAward:grantAwardList){
BigDecimal taxAmountProp = grantAward.getCashBack().divide(activityGrant.getCashBack(),4,RoundingMode.HALF_UP);;
grantAward.setTaxAmount(activityGrant.getTaxAmount().multiply(taxAmountProp).setScale(2, RoundingMode.HALF_UP));
}
}
//税点分摊到发奖上面
for (WxVtwoCashBackGrantAward grantAward:grantAwardList){
BigDecimal taxAmountProp = grantAward.getCashBack().divide(activityGrant.getCashBack(),4,RoundingMode.HALF_UP);;
grantAward.setTaxAmount(activityGrant.getTaxAmount().multiply(taxAmountProp).setScale(2, RoundingMode.HALF_UP));
} }
} }
activityGrant.setGrantAwardList(grantAwardList); activityGrant.setGrantAwardList(grantAwardList);


+ 1
- 1
mallinkService/src/main/resources/mapper/WxVtwoActivityGrantExportMapper.xml Переглянути файл

@@ -136,7 +136,7 @@
#{item.lotteryNum,jdbcType=VARCHAR},#{item.lotteryCount,jdbcType=INTEGER},#{item.anniversaryLotteryNum,jdbcType=VARCHAR}, #{item.lotteryNum,jdbcType=VARCHAR},#{item.lotteryCount,jdbcType=INTEGER},#{item.anniversaryLotteryNum,jdbcType=VARCHAR},
#{item.orderCreateTime,jdbcType=TIMESTAMP}, #{item.orderCreateTime,jdbcType=TIMESTAMP},
#{item.vipNum,jdbcType=VARCHAR},#{item.cusName,jdbcType=VARCHAR},#{item.cusPhone,jdbcType=VARCHAR}, #{item.vipNum,jdbcType=VARCHAR},#{item.cusName,jdbcType=VARCHAR},#{item.cusPhone,jdbcType=VARCHAR},
#{item.cusCard,jdbcType=VARCHAR},#{item.cusAddress,jdbcType=VARCHAR},#{itemLegionId,jdbcType=BIGINT},
#{item.cusCard,jdbcType=VARCHAR},#{item.cusAddress,jdbcType=VARCHAR},#{item.legionId,jdbcType=BIGINT},
#{item.legionName,jdbcType=VARCHAR},#{item.unionId,jdbcType=BIGINT},#{item.unionName,jdbcType=VARCHAR}, #{item.legionName,jdbcType=VARCHAR},#{item.unionId,jdbcType=BIGINT},#{item.unionName,jdbcType=VARCHAR},
#{item.grantId,jdbcType=BIGINT},#{item.grantUserName,jdbcType=VARCHAR},#{item.grantUserCard,jdbcType=VARCHAR}, #{item.grantId,jdbcType=BIGINT},#{item.grantUserName,jdbcType=VARCHAR},#{item.grantUserCard,jdbcType=VARCHAR},
#{item.grantBy,jdbcType=BIGINT},#{item.grantByName,jdbcType=VARCHAR},#{item.grantTime,jdbcType=TIMESTAMP},#{item.grantRemark,jdbcType=VARCHAR}, #{item.grantBy,jdbcType=BIGINT},#{item.grantByName,jdbcType=VARCHAR},#{item.grantTime,jdbcType=TIMESTAMP},#{item.grantRemark,jdbcType=VARCHAR},


+ 2
- 2
mallinkService/src/main/resources/mapper/WxVtwoActivityGrantOrderMapper.xml Переглянути файл

@@ -69,12 +69,12 @@
insert into wx_vtwo_activity_grant_order insert into wx_vtwo_activity_grant_order
(id, (id,
grant_id,activity_id,order_id, grant_id,activity_id,order_id,
is_amount, status)
is_amount)
values values
<foreach collection="grantOrderList" item="item" index="index" separator=","> <foreach collection="grantOrderList" item="item" index="index" separator=",">
(#{item.id,jdbcType=BIGINT}, (#{item.id,jdbcType=BIGINT},
#{item.grantId,jdbcType=BIGINT},#{item.activityId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT}, #{item.grantId,jdbcType=BIGINT},#{item.activityId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT},
#{item.isAmount,jdbcType=SMALLINT},#{item.status,jdbcType=SMALLINT})
#{item.isAmount,jdbcType=SMALLINT})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

Завантаження…
Відмінити
Зберегти