|
@@ -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);
|
|
|
}
|
|
|
}
|