向上取整,改成四舍五入
This commit is contained in:
parent
478a08160e
commit
999d7daa89
|
@ -608,5 +608,18 @@ public class Orders implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String zxsc;
|
||||
|
||||
/**
|
||||
* 经纪人分佣
|
||||
*/
|
||||
private BigDecimal jjrMoney;
|
||||
/**
|
||||
* 经纪人ID
|
||||
*/
|
||||
private Long jjrUserId;
|
||||
/**
|
||||
* 经纪人姓名
|
||||
*/
|
||||
private String jjrUserName;
|
||||
|
||||
public Orders() {}
|
||||
}
|
||||
|
|
|
@ -73,14 +73,14 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
//当期收益
|
||||
// String earnings = ordersDao.earnings(artificerId, endDate, startDate);
|
||||
BigDecimal earnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endDate, startDate);
|
||||
earnings = earnings.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
earnings = earnings.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
orders.setEarnings(earnings.toString());
|
||||
|
||||
//当日收益
|
||||
String todayEndIncome = DateUtil.formatDateTime(DateUtil.endOfDay(new Date()));
|
||||
// String dailyEarnings = ordersDao.earnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date())));
|
||||
BigDecimal dailyEarnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, todayEndIncome, String.valueOf(DateUtil.beginOfDay(new Date())));
|
||||
dailyEarnings = dailyEarnings.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
dailyEarnings = dailyEarnings.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
orders.setDailyEarnings(dailyEarnings.toString());
|
||||
|
||||
//当月收益
|
||||
|
@ -89,7 +89,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
String endFundDataformat = DateUtil.formatDateTime(DateUtil.endOfMonth(new Date()));
|
||||
// String currentMonthsIncome = ordersDao.earnings(artificerId, endFundDataformat, startFundDataformat);
|
||||
BigDecimal currentMonthsIncome = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endFundDataformat, startFundDataformat);
|
||||
currentMonthsIncome = currentMonthsIncome.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
currentMonthsIncome = currentMonthsIncome.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
orders.setCurrentMonthsIncome(currentMonthsIncome.toString());
|
||||
|
||||
//当期结束日
|
||||
|
@ -130,13 +130,13 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
//充值率
|
||||
BigDecimal divide1 = null;
|
||||
if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) {
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setCurrentPeriodAddBellsSum(clockRate.toString());
|
||||
|
||||
//当前周期充值率(本周期内充值订单数/本单数)
|
||||
String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endDate, startDate,1);
|
||||
BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setCurrentPeriodRechargeSum(divide1.toString());
|
||||
} else {
|
||||
clockRate = new BigDecimal("0");
|
||||
|
@ -295,7 +295,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
|
||||
//当前一周期业绩
|
||||
BigDecimal currentPerformance = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, date, cycleTime);
|
||||
currentPerformance = currentPerformance.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
currentPerformance = currentPerformance.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
//当前一周期储值积分数
|
||||
String storedValueIntegral = ordersDao.selectOrdersStoredValueIntegral(artificerId, date, cycleTime);
|
||||
|
@ -320,11 +320,11 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
//充值率
|
||||
BigDecimal divide1 = null;
|
||||
if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) {
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
//当前周期充值率(本周期内充值订单数/本单数)
|
||||
String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime,1);
|
||||
BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
} else {
|
||||
clockRate = new BigDecimal("0");
|
||||
divide1 = new BigDecimal("0");
|
||||
|
@ -405,7 +405,7 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
|
||||
//当前一周期业绩
|
||||
BigDecimal currentPerformance = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, date, cycleTime);
|
||||
currentPerformance = currentPerformance.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
currentPerformance = currentPerformance.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
//当前一周期储值积分数
|
||||
String storedValueIntegral = ordersDao.selectOrdersStoredValueIntegral(artificerId, date, cycleTime);
|
||||
|
@ -430,11 +430,11 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
//充值率
|
||||
BigDecimal divide1 = null;
|
||||
if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) {
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
//当前周期充值率(本周期内充值订单数/本单数)
|
||||
String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, date, cycleTime,1);
|
||||
BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
} else {
|
||||
clockRate = new BigDecimal("0");
|
||||
divide1 = new BigDecimal("0");
|
||||
|
|
|
@ -714,7 +714,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
// ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime);
|
||||
ordersIPage = ordersDao.selectDividedIntoDetails(pages, userId,startTime,endTime,null);
|
||||
BigDecimal yeji = ordersDao.selectOrdersArtificerIntegralEarnings(userId, endTime, startTime);
|
||||
yeji = yeji.setScale(0,BigDecimal.ROUND_DOWN);
|
||||
yeji = yeji.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
earnings = yeji.toString();
|
||||
}else if(orderType == 2){//2加钟
|
||||
//查询列表
|
||||
|
@ -724,7 +724,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
String jzl = ordersDao.selectOrdersArtificerIntegraladdNum(userId, endTime, startTime);
|
||||
//加钟数
|
||||
BigDecimal num = new BigDecimal(jzl);
|
||||
BigDecimal clockRate = num.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal clockRate = num.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
clockRate = clockRate.multiply(cy100);
|
||||
earnings = clockRate.intValue()+"%";
|
||||
System.out.println(currentPeriodOrdersSumBig+"=========="+num+"---"+clockRate);
|
||||
|
@ -733,7 +733,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
//当前周期充值率(本周期内充值订单数/本单数)
|
||||
String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(userId, endTime, startTime,1);
|
||||
BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
||||
BigDecimal divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
|
||||
divide1 = divide1.multiply(cy100);
|
||||
earnings = divide1.intValue()+"%";
|
||||
System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -590,7 +590,7 @@ public class AliPayController {
|
|||
if ("是".equals(taxi)) {
|
||||
//计算技师应该收取的出租车费用
|
||||
artificerTaxiPrice = taxiMoney.multiply(artificer.getRate());
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//计算出租车扣款
|
||||
BigDecimal pingTaxiMoney = taxiMoney.subtract(artificerTaxiPrice);
|
||||
//赋值技师出租收款
|
||||
|
@ -613,15 +613,15 @@ public class AliPayController {
|
|||
}
|
||||
//计算用户收益 !计算前先减去通行费用再计算技师抽成
|
||||
artificerPrice = subtract.multiply(artificer.getRate());
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//储值扣费
|
||||
valueStorageDeduction = artificerPrice.multiply(storageRate);//技师提成中扣除金额
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(0, BigDecimal.ROUND_UP);
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setValueStorageDeduction(valueStorageDeduction);
|
||||
|
||||
//用户收益不含交通费
|
||||
artificerPrice = artificerPrice.multiply(rate);
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
// BigDecimal projectBenefits = orders.getProjectBenefits().multiply(rate);
|
||||
// projectBenefits = projectBenefits.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
@ -629,15 +629,24 @@ public class AliPayController {
|
|||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -648,7 +657,7 @@ public class AliPayController {
|
|||
orders.setShopUserId(consortiaUser.getUserId());
|
||||
orders.setShopUserName(consortiaUser.getUserName());
|
||||
shopMoney = artificerPrice.multiply(consortia.getRate());
|
||||
shopMoney = shopMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
shopMoney = shopMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -660,10 +669,11 @@ public class AliPayController {
|
|||
orders.setOneUserId(oneUser.getUserId());
|
||||
orders.setOneUserName(oneUser.getUserName());
|
||||
oneUserMoney = artificerPrice.multiply(oneUser.getUserRate());
|
||||
oneUserMoney = oneUserMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
oneUserMoney = oneUserMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
|
@ -678,7 +688,8 @@ public class AliPayController {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -760,7 +771,8 @@ public class AliPayController {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
@ -1536,15 +1548,24 @@ public class AliPayController {
|
|||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -1560,8 +1581,20 @@ public class AliPayController {
|
|||
}
|
||||
}
|
||||
orders.setShopMoney(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||
UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||
BigDecimal oneUserMoney = BigDecimal.ZERO;
|
||||
if (oneUser != null && oneUser.getIsAgency() != null && oneUser.getIsAgency() == 1) {
|
||||
orders.setOneUserId(oneUser.getUserId());
|
||||
orders.setOneUserName(oneUser.getUserName());
|
||||
oneUserMoney = artificerPrice.multiply(oneUser.getUserRate());
|
||||
oneUserMoney = oneUserMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
}else{
|
||||
//用户收益加上通行费用
|
||||
|
@ -1574,18 +1607,8 @@ public class AliPayController {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
|
||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||
UserEntity oneUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||
BigDecimal oneUserMoney = BigDecimal.ZERO;
|
||||
if (oneUser != null && oneUser.getIsAgency() != null && oneUser.getIsAgency() == 1) {
|
||||
orders.setOneUserId(oneUser.getUserId());
|
||||
orders.setOneUserName(oneUser.getUserName());
|
||||
oneUserMoney = pingMoney.multiply(oneUser.getUserRate());
|
||||
oneUserMoney = oneUserMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -1625,7 +1648,8 @@ public class AliPayController {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
@ -1920,7 +1944,7 @@ public class AliPayController {
|
|||
if ("是".equals(taxi)) {
|
||||
//计算技师应该收取的出租车费用
|
||||
artificerTaxiPrice = taxiMoney.multiply(artificer.getRate());
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//计算出租车扣款
|
||||
BigDecimal pingTaxiMoney = taxiMoney.subtract(artificerTaxiPrice);
|
||||
//赋值技师出租收款
|
||||
|
@ -1943,15 +1967,15 @@ public class AliPayController {
|
|||
}
|
||||
//计算用户收益 !计算前先减去通行费用再计算技师抽成
|
||||
artificerPrice = subtract.multiply(artificer.getRate());
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//储值扣费
|
||||
valueStorageDeduction = artificerPrice.multiply(storageRate);//技师提成中扣除金额
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(0, BigDecimal.ROUND_UP);
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setValueStorageDeduction(valueStorageDeduction);
|
||||
|
||||
//用户收益不含交通费
|
||||
artificerPrice = artificerPrice.multiply(rate);
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
// BigDecimal projectBenefits = orders.getProjectBenefits().multiply(rate);
|
||||
// projectBenefits = projectBenefits.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
@ -1959,15 +1983,24 @@ public class AliPayController {
|
|||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -1978,7 +2011,7 @@ public class AliPayController {
|
|||
orders.setShopUserId(consortiaUser.getUserId());
|
||||
orders.setShopUserName(consortiaUser.getUserName());
|
||||
shopMoney = artificerPrice.multiply(consortia.getRate());
|
||||
shopMoney = shopMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
shopMoney = shopMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1990,10 +2023,11 @@ public class AliPayController {
|
|||
orders.setOneUserId(oneUser.getUserId());
|
||||
orders.setOneUserName(oneUser.getUserName());
|
||||
oneUserMoney = artificerPrice.multiply(oneUser.getUserRate());
|
||||
oneUserMoney = oneUserMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
oneUserMoney = oneUserMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
|
@ -2008,7 +2042,8 @@ public class AliPayController {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -2090,7 +2125,8 @@ public class AliPayController {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
|
|
@ -798,7 +798,7 @@ public class WxServiceImpl implements WxService {
|
|||
if ("是".equals(taxi)) {
|
||||
//计算技师应该收取的出租车费用
|
||||
artificerTaxiPrice = taxiMoney.multiply(artificer.getRate());
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//计算出租车扣款
|
||||
BigDecimal pingTaxiMoney = taxiMoney.subtract(artificerTaxiPrice);
|
||||
//赋值技师出租收款
|
||||
|
@ -821,28 +821,37 @@ public class WxServiceImpl implements WxService {
|
|||
}
|
||||
//计算用户收益 !计算前先减去通行费用再计算技师抽成
|
||||
artificerPrice = subtract.multiply(artificer.getRate());
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//储值扣费
|
||||
valueStorageDeduction = artificerPrice.multiply(storageRate);//技师提成中扣除金额
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(0, BigDecimal.ROUND_UP);
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setValueStorageDeduction(valueStorageDeduction);
|
||||
|
||||
//用户收益不含交通费
|
||||
artificerPrice = artificerPrice.multiply(rate);
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -853,7 +862,7 @@ public class WxServiceImpl implements WxService {
|
|||
orders.setShopUserId(consortiaUser.getUserId());
|
||||
orders.setShopUserName(consortiaUser.getUserName());
|
||||
shopMoney = artificerPrice.multiply(consortia.getRate());
|
||||
shopMoney = shopMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
shopMoney = shopMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -868,7 +877,8 @@ public class WxServiceImpl implements WxService {
|
|||
oneUserMoney = oneUserMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
|
@ -883,7 +893,8 @@ public class WxServiceImpl implements WxService {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -923,7 +934,8 @@ public class WxServiceImpl implements WxService {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
@ -1392,7 +1404,7 @@ public class WxServiceImpl implements WxService {
|
|||
if ("是".equals(taxi)) {
|
||||
//计算技师应该收取的出租车费用
|
||||
artificerTaxiPrice = taxiMoney.multiply(artificer.getRate());
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//计算出租车扣款
|
||||
BigDecimal pingTaxiMoney = taxiMoney.subtract(artificerTaxiPrice);
|
||||
//赋值技师出租收款
|
||||
|
@ -1415,15 +1427,15 @@ public class WxServiceImpl implements WxService {
|
|||
}
|
||||
//计算用户收益 !计算前先减去通行费用再计算技师抽成
|
||||
artificerPrice = subtract.multiply(artificer.getRate());
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//储值扣费
|
||||
valueStorageDeduction = artificerPrice.multiply(storageRate);//技师提成中扣除金额
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(0, BigDecimal.ROUND_UP);
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setValueStorageDeduction(valueStorageDeduction);
|
||||
|
||||
//用户收益不含交通费
|
||||
artificerPrice = artificerPrice.multiply(rate);
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
// BigDecimal projectBenefits = orders.getProjectBenefits().multiply(rate);
|
||||
// projectBenefits = projectBenefits.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
@ -1431,15 +1443,24 @@ public class WxServiceImpl implements WxService {
|
|||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -1465,7 +1486,8 @@ public class WxServiceImpl implements WxService {
|
|||
oneUserMoney = oneUserMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
|
@ -1480,7 +1502,8 @@ public class WxServiceImpl implements WxService {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -1556,7 +1579,8 @@ public class WxServiceImpl implements WxService {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
@ -2148,7 +2172,7 @@ public class WxServiceImpl implements WxService {
|
|||
if ("是".equals(taxi)) {
|
||||
//计算技师应该收取的出租车费用
|
||||
artificerTaxiPrice = taxiMoney.multiply(artificer.getRate());
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerTaxiPrice = artificerTaxiPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//计算出租车扣款
|
||||
BigDecimal pingTaxiMoney = taxiMoney.subtract(artificerTaxiPrice);
|
||||
//赋值技师出租收款
|
||||
|
@ -2171,15 +2195,15 @@ public class WxServiceImpl implements WxService {
|
|||
}
|
||||
//计算用户收益 !计算前先减去通行费用再计算技师抽成
|
||||
artificerPrice = subtract.multiply(artificer.getRate());
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//储值扣费
|
||||
valueStorageDeduction = artificerPrice.multiply(storageRate);//技师提成中扣除金额
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(0, BigDecimal.ROUND_UP);
|
||||
valueStorageDeduction = valueStorageDeduction.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
orders.setValueStorageDeduction(valueStorageDeduction);
|
||||
|
||||
//用户收益不含交通费
|
||||
artificerPrice = artificerPrice.multiply(rate);
|
||||
artificerPrice = artificerPrice.setScale(0, BigDecimal.ROUND_UP);
|
||||
artificerPrice = artificerPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
// BigDecimal projectBenefits = orders.getProjectBenefits().multiply(rate);
|
||||
// projectBenefits = projectBenefits.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
@ -2187,15 +2211,24 @@ public class WxServiceImpl implements WxService {
|
|||
orders.setProjectBenefits(artificerPrice);
|
||||
|
||||
UserEntity artificerUser = userService.selectUserById(artificer.getUserId());
|
||||
UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// UserEntity oneArtificerUser = userService.queryByInvitationCode(artificerUser.getInviterCode());
|
||||
// BigDecimal oneArtificerMoney = BigDecimal.ZERO;
|
||||
// if (oneArtificerUser != null && oneArtificerUser.getIsAgency() != null && oneArtificerUser.getIsAgency() == 1) {
|
||||
// orders.setOneArtificerUserId(oneArtificerUser.getUserId());
|
||||
// orders.setOneArtificerUserName(oneArtificerUser.getUserName());
|
||||
// oneArtificerMoney = artificerPrice.multiply(oneArtificerUser.getShopRate());
|
||||
// oneArtificerMoney = oneArtificerMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
// }
|
||||
// orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
UserEntity jjrUser = userService.queryByInvitationCode(artificerUser.getBlJjrCode());
|
||||
BigDecimal jjrMoney = BigDecimal.ZERO;
|
||||
if (jjrUser != null) {
|
||||
orders.setJjrUserId(jjrUser.getUserId());
|
||||
orders.setJjrUserName(jjrUser.getUserName());
|
||||
jjrMoney = jjrMoney.multiply(jjrUser.getBlJjrRate());
|
||||
jjrMoney = jjrMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneArtificerMoney(oneArtificerMoney);
|
||||
orders.setJjrMoney(jjrMoney);
|
||||
BigDecimal shopMoney = BigDecimal.ZERO;
|
||||
if (artificerUser.getConsortiaId() != null) {
|
||||
Consortia consortia = consortiaService.getById(artificerUser.getConsortiaId());
|
||||
|
@ -2221,7 +2254,8 @@ public class WxServiceImpl implements WxService {
|
|||
oneUserMoney = oneUserMoney.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
orders.setOneUserMoney(oneUserMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
// artificerPrice = artificerPrice.subtract(oneArtificerMoney);
|
||||
artificerPrice = artificerPrice.subtract(jjrMoney);
|
||||
artificerPrice = artificerPrice.subtract(shopMoney);
|
||||
artificerPrice = artificerPrice.subtract(oneUserMoney);
|
||||
if(orders.getIsSupplement()!=null && orders.getIsSupplement().equals(2)){
|
||||
|
@ -2236,7 +2270,8 @@ public class WxServiceImpl implements WxService {
|
|||
BigDecimal pingMoney = orders.getPayMoney();
|
||||
pingMoney = pingMoney.subtract(artificerPrice);
|
||||
pingMoney = pingMoney.subtract(shopMoney);
|
||||
pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
// pingMoney = pingMoney.subtract(oneArtificerMoney);
|
||||
pingMoney = pingMoney.subtract(jjrMoney);
|
||||
pingMoney = pingMoney.subtract(oneUserMoney);
|
||||
orders.setPingMoney(pingMoney);
|
||||
|
||||
|
@ -2312,7 +2347,8 @@ public class WxServiceImpl implements WxService {
|
|||
orders1.setSumMoney(orders1.getSumMoney().add(orders.getPayMoney()));
|
||||
orders1.setSumArtificerMoney(orders1.getSumArtificerMoney().add(orders.getArtificerMoney()));
|
||||
|
||||
orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
// orders1.setOneArtificerMoney(orders1.getOneArtificerMoney().add(orders.getOneArtificerMoney()));
|
||||
orders1.setJjrMoney(orders1.getJjrMoney().add(orders.getJjrMoney()));
|
||||
orders1.setShopMoney(orders1.getShopMoney().add(orders.getShopMoney()));
|
||||
orders1.setOneUserMoney(orders1.getOneUserMoney().add(orders.getOneUserMoney()));
|
||||
orders1.setPingMoney(orders1.getPingMoney().add(orders.getPingMoney()));
|
||||
|
|
|
@ -277,25 +277,25 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
|
|||
//固定的
|
||||
//正常出行
|
||||
usualTravelMoney = conf.getFixedPrice();
|
||||
usualTravelMoney = usualTravelMoney.setScale(0,BigDecimal.ROUND_UP);
|
||||
usualTravelMoney = usualTravelMoney.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
vo.setUsualTravelMoney(usualTravelMoney);
|
||||
//夜间出行
|
||||
if(TravelEnum.TimeIntervalType.NIGHT.getValue().equals(timeIntervalType)) {
|
||||
//夜间
|
||||
nightTravelMoney = conf.getNightTravelExpenses();
|
||||
}
|
||||
nightTravelMoney = nightTravelMoney.setScale(0,BigDecimal.ROUND_UP);
|
||||
nightTravelMoney = nightTravelMoney.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
vo.setNightTravelMoney(nightTravelMoney);
|
||||
//最终价格
|
||||
BigDecimal fixedPrice = usualTravelMoney.add(nightTravelMoney);
|
||||
fixedPrice = fixedPrice.setScale(0,BigDecimal.ROUND_UP);
|
||||
fixedPrice = fixedPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
vo.setTravelPrice(fixedPrice.toString());
|
||||
}else if(TravelEnum.PricingType.TRENDS.getValue().equals(pricingType)){
|
||||
//动态的
|
||||
if(TravelEnum.TimeIntervalType.NIGHT.getValue().equals(timeIntervalType)) {
|
||||
//夜间
|
||||
nightTravelMoney = conf.getNightTravelExpenses();
|
||||
nightTravelMoney = nightTravelMoney.setScale(0,BigDecimal.ROUND_UP);
|
||||
nightTravelMoney = nightTravelMoney.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
//起步公里数
|
||||
BigDecimal startKilometers = conf.getFreeKilometers();
|
||||
|
@ -313,22 +313,22 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
|
|||
vo.setUsualTravelMoney(BigDecimal.ZERO);
|
||||
vo.setNightTravelMoney(nightTravelMoney);
|
||||
travelPrice = nightTravelMoney;
|
||||
travelPrice = travelPrice.setScale(0,BigDecimal.ROUND_UP);
|
||||
travelPrice = travelPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
vo.setTravelPrice(travelPrice.toString());
|
||||
}else{
|
||||
BigDecimal kilometers = kilometerNum.subtract(freeKilometers);
|
||||
//公里数>免费公里数:公里数-免费公里数<起步公里数时,车费=夜间出行费+起步价
|
||||
if(kilometers.compareTo(startKilometers)<0){
|
||||
startingPrice = startingPrice.setScale(0,BigDecimal.ROUND_UP);
|
||||
startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}else{
|
||||
//公里数>免费公里数:公里数-免费公里数>起步公里数时,车费=夜间出行费+起步价+(公里数-免费公里数-起步公里数)*每公里价格
|
||||
startingPrice = startingPrice.add(kilometers.subtract(startKilometers).multiply(pricePerKilometer));
|
||||
startingPrice = startingPrice.setScale(0,BigDecimal.ROUND_UP);
|
||||
startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
vo.setUsualTravelMoney(startingPrice);
|
||||
vo.setNightTravelMoney(nightTravelMoney);
|
||||
travelPrice = nightTravelMoney.add(startingPrice);
|
||||
travelPrice = travelPrice.setScale(0,BigDecimal.ROUND_UP);
|
||||
travelPrice = travelPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
vo.setTravelPrice(travelPrice.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue