wwl 3 лет назад
Родитель
Сommit
0ad6db18f1

+ 4 - 4
twzd-service/src/main/java/com/miaxis/extension/domain/WxExtensionIncome.java

@@ -44,12 +44,12 @@ public class WxExtensionIncome extends BaseBusinessEntity {
     private String hierarchy;
 
     @TableField("percentage")
-    @ApiModelProperty(value = "分成百分比")
-    private BigDecimal percentage;
+    @ApiModelProperty(value = "分成百分比(%)")
+    private Integer percentage;
 
     @TableField("profit_price")
-    @ApiModelProperty(value = "收益金额-----根据层级分成百分比计算")
-    private BigDecimal profitPrice;
+    @ApiModelProperty(value = "收益金额(分)-----根据层级分成百分比计算")
+    private Integer profitPrice;
 
     @TableField("extract_status")
     @ApiModelProperty(value = "提现状态  0:未提现(默认)、1:已提现")

+ 1 - 1
twzd-service/src/main/java/com/miaxis/extension/service/IWxExtensionIncomeService.java

@@ -31,6 +31,6 @@ public interface IWxExtensionIncomeService extends IService<WxExtensionIncome> {
      * @param sourcePrice 订单金额
      * @return
      */
-    Response addExtensionIncomeBySourceId(Long sourceId, String sourceOpenid, BigDecimal sourcePrice);
+    Response addExtensionIncomeBySourceId(Long sourceId, String sourceOpenid, Integer sourcePrice);
 
 }

+ 5 - 7
twzd-service/src/main/java/com/miaxis/extension/service/impl/WxExtensionIncomeServiceImpl.java

@@ -58,7 +58,7 @@ public class WxExtensionIncomeServiceImpl extends ServiceImpl<WxExtensionIncomeM
      * @return
      */
     @Override
-    public Response addExtensionIncomeBySourceId(Long sourceId, String sourceOpenid, BigDecimal sourcePrice) {
+    public Response addExtensionIncomeBySourceId(Long sourceId, String sourceOpenid, Integer sourcePrice) {
 
         //查找一二级绑定关系
         WxSpreadRelation oneRelation = wxSpreadRelationService.getOne(new QueryWrapper<WxSpreadRelation>().eq("openid", sourceOpenid));
@@ -75,27 +75,25 @@ public class WxExtensionIncomeServiceImpl extends ServiceImpl<WxExtensionIncomeM
         List<WxExtensionIncome> extensionIncomes = new ArrayList<>();
         dictDatas.forEach(d -> {
             if ("一级".equals(d.getDictLabel())){
-                BigDecimal decimal = BigDecimal.valueOf(Double.parseDouble(d.getDictValue()));//百分比
                 WxExtensionIncome income = new WxExtensionIncome();
                 income.setSourceId(sourceId);
                 income.setBeneficiaryOpenid(oneRelation.getParentOpenid());
                 income.setSourceOpenid(sourceOpenid);
                 income.setHierarchy("1");
-                income.setPercentage(decimal);
-                income.setProfitPrice(sourcePrice.multiply(decimal));
+                income.setPercentage(Integer.parseInt(d.getDictValue()));
+                income.setProfitPrice((sourcePrice*Integer.parseInt(d.getDictValue()))/100);
                 extensionIncomes.add(income);
             }
 
             if (twoRelation != null){
                 if ("二级".equals(d.getDictLabel())){
-                    BigDecimal decimal = BigDecimal.valueOf(Double.parseDouble(d.getDictValue()));//百分比
                     WxExtensionIncome income = new WxExtensionIncome();
                     income.setSourceId(sourceId);
                     income.setBeneficiaryOpenid(twoRelation.getParentOpenid());
                     income.setSourceOpenid(sourceOpenid);
                     income.setHierarchy("2");
-                    income.setPercentage(decimal);
-                    income.setProfitPrice(sourcePrice.multiply(decimal));
+                    income.setPercentage(Integer.parseInt(d.getDictValue()));
+                    income.setProfitPrice((sourcePrice*Integer.parseInt(d.getDictValue()))/100);
                     extensionIncomes.add(income);
                 }
             }