Commit 7bf8deab authored by shiyu's avatar shiyu

开通藏家权限,加上默认佣金比例15%

parent bdfd2819
......@@ -39,8 +39,6 @@ public class SysUserBillServiceImpl implements SysUserBillService {
@Autowired
DistributorProfitDao distributorProfitDao;
@Override
public Result finishCalculate(DistributionOrder distributionOrder) throws Exception{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
......
......@@ -7,6 +7,7 @@ import com.wwdz.ch.db.mapper.CollectorWhiteListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.Date;
@Repository
......@@ -34,6 +35,7 @@ public class CollectorWhiteListDaoImpl implements CollectorWhiteListDao {
if (count > 0) {
collectorWhiteListMapper.updateByExampleSelective(collectorWhiteList, example);
} else {
collectorWhiteList.setChannelCostRebate(new BigDecimal("15"));
collectorWhiteListMapper.insert(collectorWhiteList);
}
}
......
......@@ -42,8 +42,8 @@ public class UserBillDaoImpl implements UserBillDao {
public List<UserBill> findList(UserBillRequestDto dto) {
UserBillExample example = new UserBillExample();
UserBillExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getAccountPeriod(), criteria::andAccountPeriodEqualTo);
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo);
example.setOrderByClause(" update_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
......@@ -68,6 +68,11 @@ public class UserBillDaoImpl implements UserBillDao {
@Override
public boolean update(String billId, int state) {
return false;
UserBillExample example = new UserBillExample();
UserBillExample.Criteria criteria = example.createCriteria();
criteria.andBillIdEqualTo(billId);
UserBill userBill = new UserBill();
userBill.setState(state);
return userBillMapper.updateByExampleSelective(userBill, example) > 0;
}
}
......@@ -281,14 +281,14 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
DistributorProfit distributorProfit = new DistributorProfit();
//平台服务费,默认15%
CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(auctionConfig.getCreatorId());
/* CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(auctionConfig.getCreatorId());
double channelCostRebate = 0.15;
if (collectorWhiteList != null) {
BigDecimal channelCost = collectorWhiteList.getChannelCostRebate();
channelCost = PriceUtil.convertToDivide(channelCost);
channelCostRebate = channelCost.doubleValue();
}
logger.info("藏家id:{} 生成新拍卖订单,平台服务费比例:{}", auctionConfig.getCreatorId(), channelCostRebate);
logger.info("藏家id:{} 生成新拍卖订单,平台服务费比例:{}", auctionConfig.getCreatorId(), channelCostRebate);*/
SupplierItem supplierItem = supplierItemDao.findById(dto.getItemId());
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
......@@ -445,7 +445,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//平台服务费,默认15%
CollectorWhiteList collectorWhiteList = collectorWhiteListDao.findById(supplierItem.getCreatorId());
double channelCostRebate = 0.15;
if (collectorWhiteList != null) {
if (collectorWhiteList != null && collectorWhiteList.getChannelCostRebate() != null) {
BigDecimal channelCost = collectorWhiteList.getChannelCostRebate();
channelCost = PriceUtil.convertToDivide(channelCost);
channelCostRebate = channelCost.doubleValue();
......
......@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@Service
......
......@@ -10,15 +10,12 @@ import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.UserBill;
import com.wwdz.ch.wx.service.distribution.UserBillService;
import com.xxdxxs.utils.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.TimeUnit;
......@@ -96,7 +93,7 @@ public class UserBillServiceImpl implements UserBillService {
long newIntroduceWaitEntryAmount = userBill.getIntroduceWaitEntryAmount() + introduceCost;
updateBill.setIntroduceWaitEntryAmount(newIntroduceWaitEntryAmount);
}
userBillDao.update(updateBill);
userBillDao.updateByPrimaryKey(updateBill);
}
return Result.success();
} catch (Exception e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment