余额相关改动,创客改动,订单相关
This commit is contained in:
@@ -557,7 +557,7 @@ public class MerchantOrderController {
|
||||
merchantOrder.setTransDt(new Date());
|
||||
merchantOrder.setCreateDt(new Date());
|
||||
merchantOrder.setStatus("1");
|
||||
merchantOrder.setEnterFee(merchantOrder.getConsumeFee());
|
||||
merchantOrder.setEnterFee(merchantOrder.getConsumeFee()-(merchantOrder.getConsumeFee()*0.0038));
|
||||
merchantOrder.setAisleSwitch("0");
|
||||
merchantOrder.setRate(new BigDecimal("38.00"));
|
||||
merchantOrder.setSettlementType(1);
|
||||
@@ -577,6 +577,15 @@ public class MerchantOrderController {
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Double a = 1000.00D;
|
||||
Double s = 0.0038;
|
||||
double v = a * s;
|
||||
System.out.println("利率"+v);
|
||||
double v1 = a - (a * s);
|
||||
System.out.println("剩余"+v1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 主扫会员支付
|
||||
* @param memberScanPayDTO
|
||||
@@ -1445,8 +1454,8 @@ public class MerchantOrderController {
|
||||
}
|
||||
|
||||
@GetMapping("/couponList")
|
||||
public Result<List<Map<String, Object>>> getCouponListByOrderNumber(String orderNumber) {
|
||||
List<Map<String, Object>> couponList = merchantOrderService.getCouponList(orderNumber);
|
||||
public Result<List<Map<String, Object>>> getCouponListByOrderNumber(String orderNumber,Long id) {
|
||||
List<Map<String, Object>> couponList = merchantOrderService.getCouponList(orderNumber,id);
|
||||
return ResultGenerator.genSuccessResult(couponList);
|
||||
}
|
||||
|
||||
|
||||
@@ -528,13 +528,13 @@ public class UserAppController {
|
||||
examineMoney = BigDecimal.ZERO;
|
||||
}else {
|
||||
// 累计总分润
|
||||
totalAccumulateShareMoney = userAccountByUserId.getBalance();
|
||||
totalAccumulateShareMoney = userAccountByUserId.getBalance().add(userAccountByUserId.getOutBalance());
|
||||
|
||||
//今日分润总额
|
||||
totalShareMoneyToday = userAccountFlowMapper.selectSumByUserId(userId, DateUtils.getDayBegin(), DateUtils.getDayEnd());
|
||||
|
||||
// 可提现分润
|
||||
allowCashMoney = userAccountByUserId.getBalance();
|
||||
allowCashMoney = userAccountByUserId.getBalance().subtract(userAccountByUserId.getFreezeBalance());
|
||||
|
||||
//审核中的提现金额
|
||||
examineMoney = userAccountByUserId.getFreezeBalance();
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
<!--然后定义logger,只有定义了logger并引入的appender,appender才会生效-->
|
||||
<loggers>
|
||||
<!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
|
||||
<logger name="cn.pluss.platform.mapper" level="DEBUG"></logger>
|
||||
<logger name="cn.pluss.platform.ryx" level="DEBUG"></logger>
|
||||
<logger name="cn.pluss.platform.ys" level="DEBUG"></logger>
|
||||
<logger name="cn.pluss.platform.mapper" level="WARN"></logger>
|
||||
<logger name="cn.pluss.platform.ryx" level="WARN"></logger>
|
||||
<logger name="cn.pluss.platform.ys" level="WARN"></logger>
|
||||
<logger name="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" level="INFO"></logger>
|
||||
|
||||
<root level="DEBUG">
|
||||
<root level="WARN">
|
||||
<appender-ref ref="Console"/>
|
||||
<appender-ref ref="RollingFileInfo"/>
|
||||
<appender-ref ref="RollingFileWarn"/>
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface MerchantOrderVOMapper extends BaseMapper<MerchantOrderVO> {
|
||||
* @param orderNumber 订单号
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getOnlineCouponList(@Param("orderNumber") String orderNumber);
|
||||
List<Map<String, Object>> getOnlineCouponList(@Param("orderNumber") String orderNumber,@Param("id")Long id);
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,5 +29,5 @@ public interface MerchantOrderVOMapper extends BaseMapper<MerchantOrderVO> {
|
||||
* @param orderNumber 订单号
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getOfflineCouponList(@Param("orderNumber") String orderNumber);
|
||||
List<Map<String, Object>> getOfflineCouponList(@Param("orderNumber") String orderNumber,@Param("id")Long id);
|
||||
}
|
||||
@@ -13,10 +13,10 @@ import java.math.BigDecimal;
|
||||
public interface UserAccountMapper extends BaseMapper<UserAccount> {
|
||||
|
||||
|
||||
@Select(value = "select user_id AS userId,freeze_balance AS freezeBalance,balance,out_balance AS out_balance,create_time AS createTime,update_time AS updateTime from tb_pluss_user_account where user_id=#{userId}")
|
||||
@Select(value = "select user_id AS userId,freeze_balance AS freezeBalance,balance,out_balance AS outBalance,create_time AS createTime,update_time AS updateTime from tb_pluss_user_account where user_id=#{userId}")
|
||||
UserAccount selectUserByUserId(@Param("userId")Integer userId,Integer t);
|
||||
|
||||
@Select(value = "select user_id AS userId,freeze_balance AS freezeBalance,balance,out_balance AS out_balance,create_time AS createTime,update_time AS updateTime from tb_pluss_user_account where user_id=#{userId} for update")
|
||||
@Select(value = "select user_id AS userId,freeze_balance AS freezeBalance,balance,out_balance AS outBalance,create_time AS createTime,update_time AS updateTime from tb_pluss_user_account where user_id=#{userId} for update")
|
||||
UserAccount selectUserByUserId(@Param("userId")Integer userId);
|
||||
|
||||
@Update(value = "update tb_pluss_user_account set freeze_balance=freeze_balance+#{amount} where user_id=#{userId}")
|
||||
|
||||
@@ -18,14 +18,18 @@ public interface UserMakerFlowMapper extends BaseMapper<UserMakerFlow> {
|
||||
"\tmf.biz_code AS bizCode,\n" +
|
||||
"\tmf.biz_name AS bizName,\n" +
|
||||
"\tbi.alias AS userName,\n" +
|
||||
"\tmf.amount,\n" +
|
||||
"\tmf.amount AS lowerAmount,\n" +
|
||||
"\tmf.create_time AS createTime,\n" +
|
||||
"\tmo.consumeFee AS lowerAmount \n" +
|
||||
"\tmo.consumeFee AS amount \n" +
|
||||
"FROM\n" +
|
||||
"\t`tb_pluss_user_maker_flow` mf\n" +
|
||||
"\tLEFT JOIN tb_pluss_merchant_base_info bi ON mf.user_id = bi.userId\n" +
|
||||
"\tLEFT JOIN tb_pluss_merchant_order mo ON mf.orderNumber = mo.orderNumber \n" +
|
||||
"\tWHERE mf.user_id = #{userId}\n" +
|
||||
"\torder by id desc limit #{pageSize} offset #{offset}")
|
||||
"WHERE\n" +
|
||||
"\tmf.user_id = #{userId} \n" +
|
||||
"\tAND mo.`status` = 1\n" +
|
||||
"ORDER BY\n" +
|
||||
"\tid DESC \n" +
|
||||
"\tLIMIT #{pageSize} OFFSET #{offset}")
|
||||
List<UserMakerQuotaVO> selectByUserId(@Param("userId") Long userId, @Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
public interface UserMakerQuotaMapper extends BaseMapper<UserMakerQuota> {
|
||||
BigDecimal sumQuota(@Param("userId") Long userId);
|
||||
@Update(value = "update tb_pluss_user_maker_quota set amount=#{amount} where userId=#{userId}")
|
||||
@Update(value = "update tb_pluss_user_maker_quota set amount=amount+#{amount} where userId=#{userId}")
|
||||
Integer updateMakerFreeze(@Param("userId") Integer userId, @Param("amount") BigDecimal amount);
|
||||
|
||||
@Select(value ="SELECT * FROM tb_pluss_user_maker_quota WHERE userId = #{userId}")
|
||||
UserMakerQuota selectByUserId(@Param("userId") Long userId);
|
||||
@Select(value ="SELECT * FROM tb_pluss_user_maker_quota WHERE userId = #{userId}")
|
||||
UserMakerQuota selectByUserId(@Param("userId") Integer userId);
|
||||
// @Select(value ="SELECT * FROM tb_pluss_user_maker_quota WHERE userId = #{userId}")
|
||||
// UserMakerQuota selectByUserId(@Param("userId") Integer userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,13 @@
|
||||
SELECT
|
||||
*
|
||||
FROM tb_pluss_merchant_order
|
||||
WHERE
|
||||
<where>
|
||||
orderNumber = #{orderNumber}
|
||||
<if test="id!= null">
|
||||
AND id=#{id}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- <select id="getOfflineCouponList" resultType="java.util.Map">-->
|
||||
@@ -30,7 +35,11 @@
|
||||
SELECT
|
||||
*
|
||||
FROM tb_pluss_merchant_order
|
||||
WHERE
|
||||
<where>
|
||||
orderNumber = #{orderNumber}
|
||||
<if test="id!= null">
|
||||
AND id=#{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -19,9 +19,7 @@ import java.util.Date;
|
||||
public class UserAccount implements Serializable {
|
||||
|
||||
|
||||
|
||||
@TableField("user_id")
|
||||
@TableId(value = "user_id", type = IdType.AUTO)
|
||||
@TableId(type = IdType.NONE,value = "user_id")
|
||||
private Integer userId;
|
||||
@TableField("freeze_balance")
|
||||
private BigDecimal freezeBalance;
|
||||
|
||||
@@ -29,6 +29,8 @@ public class UserMakerFlow implements Serializable {
|
||||
private String bizCode;
|
||||
@TableField("biz_name")
|
||||
private String bizName;
|
||||
@TableField("orderNumber")
|
||||
private String orderNumber;
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
@TableField("balance")
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Date;
|
||||
// " ) t")
|
||||
@TableName("(\n" +
|
||||
" SELECT t1.*, t2.updateTime refundTime FROM tb_pluss_merchant_order t1\n" +
|
||||
" LEFT JOIN tb_pluss_merchant_order t2 ON t1.orderNumber = t2.orderNumber AND t1.status = 1 AND t2.status = 2\n" +
|
||||
" LEFT JOIN tb_pluss_merchant_order t2 ON t1.orderNumber = t2.orderNumber AND t1.status = 1 AND t2.status = 2 AND t2.status = 6\n" +
|
||||
" ) t")
|
||||
@Accessors(chain = true)
|
||||
public class MerchantOrderVO extends MerchantOrder {
|
||||
|
||||
@@ -75,14 +75,15 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
BigDecimal profit = consumeFee.multiply(new BigDecimal("0.5")).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
String s = String.valueOf(userParent.getUserId());
|
||||
Integer integer = Integer.valueOf(s);
|
||||
this.modMakerFunds(integer,"SD","免费额度",profit,"");
|
||||
//给自己计算
|
||||
if ("1".equals(userInfo.getIsExtend())){
|
||||
profit(userInfo,consumeFee);
|
||||
}
|
||||
this.modMakerFunds(integer,"SD","免费额度",profit,"",order.getOrderNumber());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//给自己计算
|
||||
assert userInfo != null;
|
||||
if ("1".equals(userInfo.getIsExtend())){
|
||||
profit(userInfo,consumeFee,order);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
BigDecimal profit = consumeFee.multiply(new BigDecimal("0.0038")).setScale(2, RoundingMode.DOWN);
|
||||
String s = String.valueOf(userInfo.getUserId());
|
||||
Integer integer = Integer.valueOf(s);
|
||||
this.modMakerFunds(integer,"SD","免费额度",profit,"");
|
||||
this.modMakerFunds(integer,"SD","免费额度",profit,"",order.getOrderNumber());
|
||||
}
|
||||
if (userInfo != null) {
|
||||
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
||||
@@ -131,8 +132,8 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
}
|
||||
//增加提现金额
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void profit(UserPromotion userInfo,BigDecimal consumeFee){
|
||||
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId());
|
||||
public void profit(UserPromotion userInfo,BigDecimal consumeFee,MerchantOrder order){
|
||||
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
||||
if (userMakerQuota != null) {
|
||||
BigDecimal sumbigDecimal = userMakerQuota.getAmount();
|
||||
if (sumbigDecimal != null && sumbigDecimal.compareTo(consumeFee) >= 0) {
|
||||
@@ -140,10 +141,11 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
sumbigDecimal = sumbigDecimal.subtract(consumeFee);
|
||||
String s = String.valueOf(userInfo.getUserId());
|
||||
Integer integer = Integer.valueOf(s);
|
||||
BigDecimal bigDecimal = new BigDecimal(order.getConsumeFee().toString());
|
||||
//提现金额
|
||||
userAccountService.modFunds(integer, "LD", "免提现额度", profit, "");
|
||||
//额度改变
|
||||
modMakerFunds(integer, "LD", "收款消耗", sumbigDecimal, "");
|
||||
modMakerFunds(integer, "LD", "收款消耗", bigDecimal, "",order.getOrderNumber());
|
||||
} else {
|
||||
BigDecimal profit = sumbigDecimal.multiply(new BigDecimal("0.0038")).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
String s = String.valueOf(userInfo.getUserId());
|
||||
@@ -151,7 +153,7 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
//提现金额
|
||||
userAccountService.modFunds(integer, "LD", "收款消耗", profit, "");
|
||||
//额度改变
|
||||
modMakerFunds(integer, "LD", "收款消耗", BigDecimal.ZERO, "");
|
||||
modMakerFunds(integer, "LD", "收款消耗", BigDecimal.ZERO, "",order.getOrderNumber());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +168,7 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
* @param remark
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.MANDATORY)
|
||||
public void modMakerFunds(Integer userId, String bizCode, String bizName, BigDecimal difference, String remark) {
|
||||
public void modMakerFunds(Integer userId, String bizCode, String bizName, BigDecimal difference, String remark,String orderNumber) {
|
||||
Assert.notNull(userId, "NOt Null");
|
||||
Assert.notNull(bizCode, "Not Null");
|
||||
Assert.notNull(bizName, "Not Null");
|
||||
@@ -179,6 +181,9 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
if(N.gt(difference,BigDecimal.ZERO)){
|
||||
difference=difference.abs();
|
||||
}
|
||||
if ("LD".equals(bizCode)){
|
||||
difference = difference.negate();
|
||||
}
|
||||
|
||||
userMakerQuotaMapper.updateMakerFreeze(userId,difference);
|
||||
|
||||
@@ -189,6 +194,7 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
flow.setAmount(difference.abs());
|
||||
flow.setBalance(userMakerQuota.getAmount());
|
||||
flow.setCreateTime(new Date());
|
||||
flow.setOrderNumber(orderNumber);
|
||||
userMakerFlowMapper.insert(flow);
|
||||
}
|
||||
private UserMakerQuota initUserMaker(Integer userId){
|
||||
|
||||
@@ -4,14 +4,17 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.pluss.platform.app.MainPageService;
|
||||
import cn.pluss.platform.entity.MerchantOrderStatistics;
|
||||
import cn.pluss.platform.entity.UserAccount;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.entity.UserPromotion;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.MerchantProfitMapper;
|
||||
import cn.pluss.platform.mapper.UserAccountFlowMapper;
|
||||
import cn.pluss.platform.mapper.UserAppMapper;
|
||||
import cn.pluss.platform.mapper.UserPromotionMapper;
|
||||
import cn.pluss.platform.merchantOrder.MerchantOrderStatisticsService;
|
||||
import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import cn.pluss.platform.userAccount.UserAccountService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.N;
|
||||
@@ -52,6 +55,10 @@ public class PromoterMainPageServiceImpl implements MainPageService {
|
||||
private UserPromotionMapper userPromotionMapper;
|
||||
@Resource
|
||||
private UserAppMapper userAppMapper;
|
||||
@Resource
|
||||
private UserAccountFlowMapper userAccountFlowMapper;
|
||||
@Resource
|
||||
private UserAccountService userAccountService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSpreadData(String userId) {
|
||||
@@ -71,7 +78,7 @@ public class PromoterMainPageServiceImpl implements MainPageService {
|
||||
queryUserApp = queryUserAppList2.get(0);
|
||||
}
|
||||
|
||||
Double promoteFee;
|
||||
BigDecimal promoteFee;
|
||||
Double todayProfit;
|
||||
Integer totalOrderCount;
|
||||
|
||||
@@ -80,9 +87,11 @@ public class PromoterMainPageServiceImpl implements MainPageService {
|
||||
queryMap.put("userId", userId);
|
||||
queryMap.put("status", 1);
|
||||
// 累计总收益
|
||||
promoteFee = merchantProfitService.queryMerchantProfitSumPrice(queryMap);
|
||||
if (promoteFee == null) {
|
||||
promoteFee = 0d;
|
||||
UserAccount userAccountByUserId = userAccountService.getUserAccountByUserId(Integer.valueOf(userId));
|
||||
if(ObjectUtil.isEmpty(userAccountByUserId)){
|
||||
promoteFee=BigDecimal.ZERO;
|
||||
}else {
|
||||
promoteFee = userAccountByUserId.getBalance().add(userAccountByUserId.getOutBalance());
|
||||
}
|
||||
|
||||
//今日收款笔数
|
||||
@@ -90,8 +99,9 @@ public class PromoterMainPageServiceImpl implements MainPageService {
|
||||
queryMap.put("retype", "1");
|
||||
totalOrderCount = merchantProfitMapper.queryMerchantProfitPageCountV2(userId);
|
||||
todayProfit = merchantProfitService.queryMerchantProfitSumPrice(queryMap);
|
||||
|
||||
//今日收益
|
||||
BigDecimal todaySum = merchantProfitMapper.getTodaySum(userId);
|
||||
BigDecimal todaySum = userAccountFlowMapper.selectSumByUserId(Long.valueOf(userId), DateUtils.getDayBegin(), DateUtils.getDayEnd());;
|
||||
|
||||
//今日新增商户数
|
||||
Integer newMerchantCount = userAppMapper.selectUserAppWithChannelStatusCountV2(userId, DateUtils.getDayBegin(), DateUtils.getDayEnd());
|
||||
|
||||
@@ -324,7 +324,7 @@ public interface MerchantOrderService extends IService<MerchantOrder> {
|
||||
*/
|
||||
void readCSV(String path);
|
||||
|
||||
List<Map<String, Object>> getCouponList(String orderNumber);
|
||||
List<Map<String, Object>> getCouponList(String orderNumber,Long id);
|
||||
|
||||
|
||||
Result updateOrderStatus(JSONObject result,MerchantOrder order);
|
||||
|
||||
@@ -292,7 +292,6 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
||||
// 添加分页条件后获取订单列表
|
||||
LambdaQueryWrapper<MerchantOrderVO> pageQuery = queryWrapper.clone();
|
||||
pageQuery.orderByDesc(MerchantOrder::getCreateDt);
|
||||
|
||||
Page<MerchantOrderVO> page = new Page<>(merchantOrder.getPage(), merchantOrder.getSize());
|
||||
IPage<MerchantOrderVO> pageMerchantOrder = merchantOrderVOMapper.selectPage(page, pageQuery);
|
||||
|
||||
@@ -310,6 +309,11 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
||||
MerchantOrder.updateOrderTypeDesc(item);
|
||||
|
||||
MerchantOrderVO.setD0Fee(item);
|
||||
if (Objects.equals(item.getStatus(), "6")){
|
||||
BigDecimal refundAmt = item.getRefundAmt();
|
||||
Double doubleValue = refundAmt.doubleValue();
|
||||
item.setConsumeFee(doubleValue);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
@@ -339,7 +343,7 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
||||
queryWrapper.eq(merchantOrder.getSettlementType() != null, MerchantOrder::getSettlementType, merchantOrder.getSettlementType());
|
||||
|
||||
if (StringUtils.isEmpty(merchantOrder.getStatus())) {
|
||||
queryWrapper.in(MerchantOrder::getStatus, "1", "2");
|
||||
queryWrapper.in(MerchantOrder::getStatus, "1", "2","6");
|
||||
} else {
|
||||
queryWrapper.in(MerchantOrder::getStatus, merchantOrder.getStatus());
|
||||
}
|
||||
@@ -2075,17 +2079,33 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getCouponList(String orderNumber) {
|
||||
public List<Map<String, Object>> getCouponList(String orderNumber,Long id) {
|
||||
MerchantOrder merchantOrder = new MerchantOrder().setOrderNumber(orderNumber);
|
||||
if (id != null){
|
||||
merchantOrder.setId(id);
|
||||
}
|
||||
MerchantOrder one = getOne(new QueryWrapper<>(merchantOrder));
|
||||
if (one == null) {
|
||||
throw new MsgException("订单不存在");
|
||||
}
|
||||
|
||||
if ("10".equals(one.getOrderType())) {
|
||||
return merchantOrderVOMapper.getOnlineCouponList(orderNumber);
|
||||
List<Map<String, Object>> onlineCouponList = merchantOrderVOMapper.getOnlineCouponList(orderNumber,id);
|
||||
for (Map<String, Object> item : onlineCouponList) {
|
||||
if ("6".equals(item.get("status"))){
|
||||
item.put("consumeFee",item.get("refundAmt"));
|
||||
}
|
||||
}
|
||||
return onlineCouponList;
|
||||
|
||||
} else {
|
||||
return merchantOrderVOMapper.getOfflineCouponList(orderNumber);
|
||||
List<Map<String, Object>> offlineCouponList = merchantOrderVOMapper.getOfflineCouponList(orderNumber,id);
|
||||
for (Map<String, Object> item : offlineCouponList) {
|
||||
if ("6".equals(item.get("status"))){
|
||||
item.put("consumeFee",item.get("refundAmt"));
|
||||
}
|
||||
}
|
||||
return offlineCouponList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
||||
@Override
|
||||
public Map<String, Object> teamList(String typeCode, Long userId,Integer page,Integer size,
|
||||
String name) {
|
||||
Integer pagerSize = size;
|
||||
Integer offset = (page - 1) * size;
|
||||
switch (typeCode){
|
||||
case "AG":
|
||||
typeCode = "FB";
|
||||
@@ -135,8 +137,19 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
||||
// PageInfo<MerchantProfitVO> teamList= merchantProfitMapper.getTeamList(typeCode, userId, page,size,name);
|
||||
|
||||
Integer countChild = merchantProfitMapper.getCountChild(userId, typeCode);
|
||||
Integer pagerSize = size;
|
||||
Integer offset = (page - 1) * size;
|
||||
UserPromotion userPromotion = userPromotionMapper.selectByPrimaryKey(userId);
|
||||
if (Objects.equals(userPromotion.getIsExtend(), "1")){
|
||||
List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId, name, pagerSize, offset);
|
||||
for (MerchantProfitVO values : teamList) {
|
||||
values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
|
||||
DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth()));
|
||||
values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
|
||||
}
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("total", countChild);
|
||||
hashMap.put("teamList", teamList);
|
||||
return hashMap;
|
||||
}
|
||||
//商户列表
|
||||
if ("MC".equals(typeCode)) {
|
||||
List<MerchantProfitVO> teamList = merchantProfitMapper.getMerchantTeamList(typeCode, userId, name, pagerSize, offset);
|
||||
@@ -302,6 +315,7 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
||||
try {
|
||||
batchInsert(profitList);
|
||||
//更新账户余额
|
||||
|
||||
userAccountService.updateBatchById(userAccounts);
|
||||
//添加账户流水
|
||||
userAccountFlowService.saveBatch(userAccountFlows);
|
||||
|
||||
@@ -233,6 +233,8 @@ public class SxfMerchantAuditServiceImpl extends BaseMerchantAuditService {
|
||||
reqData.putAll(getMerchantAuditInfo(userId, merchantBaseInfo, mcs));
|
||||
reqData.put("callbackUrl", ParametersUtil.domain + "/api/auditCallback/sxf");
|
||||
|
||||
|
||||
|
||||
log.info("{}随行付进件参数{}", userId, JSON.toJSONString(reqData));
|
||||
// step 2、调取通用请求
|
||||
JSONObject resultMap = sxfService.requestApi(targetUrl, reqData);
|
||||
|
||||
Reference in New Issue
Block a user