Explorar el Código

微信认证更新

lianghanqiang hace 4 años
padre
commit
ea2b2b2a86

+ 7 - 0
ldt-core/pom.xml

@@ -275,6 +275,13 @@
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.csp</groupId>
+            <artifactId>sentinel-core</artifactId>
+            <version>1.8.2</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 3 - 3
ldt-core/src/main/java/org/springblade/flow/shop/task/QueryAuthStatus.java

@@ -161,9 +161,9 @@ public class QueryAuthStatus {
 		try {
 
 			//短信通知
-			String phone = item.getShop().getPersonTel();
-			SmsData smsData = new SmsData(new HashMap(4){{ put("",configForShop.getAppName());}});
-			SmsUtil.getBuilder().template(SmsCodeEnum.NOTIFY_SIGN.name()).sendSingle(smsData,phone);
+//			String phone = item.getShop().getPersonTel();
+//			SmsData smsData = new SmsData(new HashMap(4){{ put("",configForShop.getAppName());}});
+//			SmsUtil.getBuilder().template(SmsCodeEnum.NOTIFY_SIGN.name()).sendSingle(smsData,phone);
 
 			//微信模板消息
 			String openId = item.getShop().getOpenId();

+ 129 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/controller/FrozenRecController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.vo.FrozenRecVO;
+import org.springblade.ldt.bills.wrapper.FrozenRecWrapper;
+import org.springblade.ldt.bills.service.IFrozenRecService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("ldt_bills/frozenrec")
+@Api(value = "", tags = "接口")
+public class FrozenRecController extends BladeController {
+
+	private final IFrozenRecService frozenRecService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入frozenRec")
+	public R<FrozenRecVO> detail(FrozenRec frozenRec) {
+		FrozenRec detail = frozenRecService.getOne(Condition.getQueryWrapper(frozenRec));
+		return R.data(FrozenRecWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入frozenRec")
+	public R<IPage<FrozenRecVO>> list(FrozenRec frozenRec, Query query) {
+		IPage<FrozenRec> pages = frozenRecService.page(Condition.getPage(query), Condition.getQueryWrapper(frozenRec));
+		return R.data(FrozenRecWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入frozenRec")
+	public R<IPage<FrozenRecVO>> page(FrozenRecVO frozenRec, Query query) {
+		IPage<FrozenRecVO> pages = frozenRecService.selectFrozenRecPage(Condition.getPage(query), frozenRec);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入frozenRec")
+	public R save(@Valid @RequestBody FrozenRec frozenRec) {
+		return R.status(frozenRecService.save(frozenRec));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入frozenRec")
+	public R update(@Valid @RequestBody FrozenRec frozenRec) {
+		return R.status(frozenRecService.updateById(frozenRec));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入frozenRec")
+	public R submit(@Valid @RequestBody FrozenRec frozenRec) {
+		return R.status(frozenRecService.saveOrUpdate(frozenRec));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(frozenRecService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/dto/FrozenRecDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.dto;
+
+import org.springblade.ldt.bills.entity.FrozenRec;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FrozenRecDTO extends FrozenRec {
+	private static final long serialVersionUID = 1L;
+
+}

+ 68 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/entity/FrozenRec.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+@Data
+@TableName("ldt_frozen_rec")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FrozenRec对象", description = "FrozenRec对象")
+public class FrozenRec extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 冻结账户类型
+	*/
+		@ApiModelProperty(value = "冻结账户类型")
+		private String frozenType;
+	/**
+	* 冻结金额
+	*/
+		@ApiModelProperty(value = "冻结金额")
+		private BigDecimal frozenNum;
+	/**
+	* 冻结前金额
+	*/
+		@ApiModelProperty(value = "冻结前金额")
+		private BigDecimal beforeNum;
+	/**
+	* 订单号
+	*/
+		@ApiModelProperty(value = "订单号")
+		private Long tradeNo;
+	/**
+	* 冻结用户id
+	*/
+		@ApiModelProperty(value = "冻结用户id")
+		private Long userId;
+
+
+}

+ 42 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/mapper/FrozenRecMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.mapper;
+
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.vo.FrozenRecVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+public interface FrozenRecMapper extends BaseMapper<FrozenRec> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param frozenRec
+	 * @return
+	 */
+	List<FrozenRecVO> selectFrozenRecPage(IPage page, FrozenRecVO frozenRec);
+
+}

+ 27 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/mapper/FrozenRecMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.ldt.bills.mapper.FrozenRecMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="frozenRecResultMap" type="org.springblade.ldt.bills.entity.FrozenRec">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="frozen_type" property="frozenType"/>
+        <result column="frozen_num" property="frozenNum"/>
+        <result column="before_num" property="beforeNum"/>
+        <result column="trade_no" property="tradeNo"/>
+        <result column="user_id" property="userId"/>
+    </resultMap>
+
+
+    <select id="selectFrozenRecPage" resultMap="frozenRecResultMap">
+        select * from ldt_frozen_rec where is_deleted = 0
+    </select>
+
+</mapper>

+ 47 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/service/IFrozenRecService.java

@@ -0,0 +1,47 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.service;
+
+import org.springblade.ldt.bills.entity.Bills;
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.vo.FrozenRecVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ldt.user.entity.LoginUser;
+import org.springblade.ldt.user.entity.UserChannelPoint;
+
+import java.math.BigDecimal;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+public interface IFrozenRecService extends BaseService<FrozenRec> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param frozenRec
+	 * @return
+	 */
+	IPage<FrozenRecVO> selectFrozenRecPage(IPage<FrozenRecVO> page, FrozenRecVO frozenRec);
+
+	void addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, String type, UserChannelPoint channelPoint);
+}

+ 70 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/service/impl/FrozenRecServiceImpl.java

@@ -0,0 +1,70 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.service.impl;
+
+import org.springblade.ldt.bills.entity.Bills;
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.vo.FrozenRecVO;
+import org.springblade.ldt.bills.mapper.FrozenRecMapper;
+import org.springblade.ldt.bills.service.IFrozenRecService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.ldt.user.entity.LoginUser;
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.math.BigDecimal;
+import java.util.Objects;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+@Service
+public class FrozenRecServiceImpl extends BaseServiceImpl<FrozenRecMapper, FrozenRec> implements IFrozenRecService {
+
+	@Override
+	public IPage<FrozenRecVO> selectFrozenRecPage(IPage<FrozenRecVO> page, FrozenRecVO frozenRec) {
+		return page.setRecords(baseMapper.selectFrozenRecPage(page, frozenRec));
+	}
+
+	@Override
+	public void addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, String type,UserChannelPoint userChannelPoint) {
+
+			if(Objects.equals(type,"point")){
+				user.setBalance(user.getChannelPoint().subtract(handlePrice));
+				user.setFrozenBalance(user.getFrozenPoint().add(handlePrice));
+				userChannelPoint.setAvailable(userChannelPoint.getAvailable().subtract(handlePrice));
+			}
+			if(Objects.equals(type,"balance")){
+				user.setBalance(user.getBalance().subtract(handlePrice));
+				user.setFrozenBalance(user.getFrozenBalance().add(handlePrice));
+			}
+
+			FrozenRec frozenRec = new FrozenRec();
+			frozenRec.setBeforeNum(user.getBalance());
+			frozenRec.setFrozenNum(handlePrice);
+			frozenRec.setUserId(user.getId());
+			frozenRec.setTradeNo(bills.getId());
+			frozenRec.setFrozenType(type);
+			frozenRec.setStatus(1);
+			this.saveOrUpdate(frozenRec);
+	}
+
+}

+ 36 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/vo/FrozenRecVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.vo;
+
+import org.springblade.ldt.bills.entity.FrozenRec;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FrozenRecVO对象", description = "FrozenRecVO对象")
+public class FrozenRecVO extends FrozenRec {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/wrapper/FrozenRecWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ldt.bills.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.vo.FrozenRecVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-10-30
+ */
+public class FrozenRecWrapper extends BaseEntityWrapper<FrozenRec, FrozenRecVO>  {
+
+	public static FrozenRecWrapper build() {
+		return new FrozenRecWrapper();
+ 	}
+
+	@Override
+	public FrozenRecVO entityVO(FrozenRec frozenRec) {
+		FrozenRecVO frozenRecVO = Objects.requireNonNull(BeanUtil.copy(frozenRec, FrozenRecVO.class));
+
+		//User createUser = UserCache.getUser(frozenRec.getCreateUser());
+		//User updateUser = UserCache.getUser(frozenRec.getUpdateUser());
+		//frozenRecVO.setCreateUserName(createUser.getName());
+		//frozenRecVO.setUpdateUserName(updateUser.getName());
+
+		return frozenRecVO;
+	}
+
+}

+ 10 - 1
ldt-core/src/main/java/org/springblade/ldt/user/entity/LoginUser.java

@@ -100,6 +100,15 @@ public class LoginUser extends TenantEntity {
 	*/
 		@ApiModelProperty(value = "总余额【代理商】")
 		private BigDecimal totalBalance;
-
+	/**
+	 * 当前冻结渠道积分
+	 */
+	@ApiModelProperty(value = "当前冻结渠道积分")
+	private BigDecimal frozenPoint;
+	/**
+	 * 当前冻结普通积分
+	 */
+	@ApiModelProperty(value = "当前冻结普通积分")
+	private BigDecimal frozenBalance;
 
 }

+ 30 - 29
ldt-core/src/main/java/org/springblade/payment/handle/Trade.java

@@ -98,7 +98,6 @@ public class Trade {
 //		PaymentCache.putSuccessParams(Convert.toStr(successParams.getBills().getId()),successParams);
 //	 	return true;
 //	}
-
 	@Transactional
 	public SuccessParams tradeForScanPay(Order order, long channelId) throws Exception {
 		/**
@@ -121,38 +120,40 @@ public class Trade {
 		String tenantId = appShopService.getTenantId(order.getShopId());
 		Bills bills = initBill(order,channelId,tenantId);
 
-		//支付参数
-		SuccessParams successParams  = SuccessParams.builder()
-			.orderType(OrderType.USER_PAY.name())
-			.status(AppConstant.BillPayStatus.待付款.name())
-			.userId(order.getLoginUser().getId())
-			.totalPrice(order.getMoney())
-			.bills(bills)
-			.shopId(order.getShopId())
-			.tenantId(tenantId)
-			.channelId(channelId)
-			.build();
+		synchronized (order.getLoginUser().getId()){
+			//支付参数
+			SuccessParams successParams  = SuccessParams.builder()
+				.orderType(OrderType.USER_PAY.name())
+				.status(AppConstant.BillPayStatus.待付款.name())
+				.userId(order.getLoginUser().getId())
+				.totalPrice(order.getMoney())
+				.bills(bills)
+				.shopId(order.getShopId())
+				.tenantId(tenantId)
+				.channelId(channelId)
+				.build();
 
-		//处理各个节点
-		for (BaseHandle node: chain) {
-			HandleData res = node.handle(remain, order,successParams);
-			Assert.isTrue(res.isSuccess(),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
-			remain = res.getRemain();
-			successParams = res.getSuccessParams();
+			//处理各个节点
+			for (BaseHandle node: chain) {
+				HandleData res = node.handle(remain, order,successParams);
+				Assert.isTrue(res.isSuccess(),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
+				remain = res.getRemain();
+				successParams = res.getSuccessParams();
 
-			if(remain.compareTo(BigDecimal.ZERO)==0){
-				successParams.setStatus(AppConstant.BillPayStatus.付款成功.name());
-				bills.setPayStatus(AppConstant.BillPayStatus.付款成功.name());
-				dataHandle.saveOrUpdateEntity(billsService,successParams.getBills());
-				applicationEventPublisher.publishEvent(new UserPayCsEvent(successParams));
-				break;
+				if(remain.compareTo(BigDecimal.ZERO)==0){
+					successParams.setStatus(AppConstant.BillPayStatus.付款成功.name());
+					bills.setPayStatus(AppConstant.BillPayStatus.付款成功.name());
+					dataHandle.saveOrUpdateEntity(billsService,successParams.getBills());
+					applicationEventPublisher.publishEvent(new UserPayCsEvent(successParams));
+					break;
+				}
 			}
-		}
 
-		//新建事务,保存订单信息,
-		Assert.isTrue(dataHandle.saveOrUpdateEntity(billsService,successParams.getBills()),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
-		PaymentCache.putSuccessParams(Convert.toStr(successParams.getBills().getId()),successParams);
-		return successParams;
+			//新建事务,保存订单信息,
+			Assert.isTrue(dataHandle.saveOrUpdateEntity(billsService,successParams.getBills()),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
+			PaymentCache.putSuccessParams(Convert.toStr(successParams.getBills().getId()),successParams);
+			return successParams;
+		}
 
 	}
 

+ 5 - 5
ldt-core/src/main/java/org/springblade/payment/handle/handler/BalanceHandle.java

@@ -1,13 +1,11 @@
 package org.springblade.payment.handle.handler;
 
 import lombok.AllArgsConstructor;
-import org.springblade.common.cache.PlatformCache;
 import org.springblade.common.enums.AppConstant;
 import org.springblade.common.enums.OrderType;
-import org.springblade.common.enums.PaymentScene;
 import org.springblade.common.enums.ResCode;
 import org.springblade.core.log.exception.ServiceException;
-import org.springblade.ldt.bills.service.IBillsService;
+import org.springblade.ldt.bills.service.IFrozenRecService;
 import org.springblade.payment.handle.entity.HandleData;
 import org.springblade.payment.handle.entity.Order;
 import org.springblade.ldt.bills.entity.BalanceBills;
@@ -15,8 +13,6 @@ import org.springblade.ldt.bills.service.IBalanceBillsService;
 import org.springblade.ldt.user.entity.LoginUser;
 import org.springblade.payment.entity.SuccessParams;
 import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 
 import java.math.BigDecimal;
@@ -32,6 +28,7 @@ import java.math.RoundingMode;
 public class  BalanceHandle implements BaseHandle {
 	private IBalanceBillsService balanceBillsService;
 	private DataHandle dataHandle;
+	private IFrozenRecService frozenRecService;
 	/**
 	 * 	用户的余额扣除,余额足够抵消交易金额,剩余支付金额remain为0,交易结束
 	 * 	不足抵消,remain将会流转到下一个节点处理
@@ -67,6 +64,7 @@ public class  BalanceHandle implements BaseHandle {
 			handlePrice = myBalance;
 		}
 
+//		frozenRecService.addFrozenRec(handlePrice,successParams.getBills(),user,"balance", null);
 		BalanceBills balanceBills = buildBills(order, user, handlePrice,successParams,BigDecimal.ZERO);
 		Assert.isTrue(dataHandle.saveOrUpdateEntity(balanceBillsService,balanceBills),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
 
@@ -76,6 +74,8 @@ public class  BalanceHandle implements BaseHandle {
 	}
 
 
+
+
 	/**
 	 * 商户积分--构建账单
 	 * */

+ 6 - 1
ldt-core/src/main/java/org/springblade/payment/handle/handler/ChannelPointHandle.java

@@ -6,6 +6,9 @@ import org.springblade.common.enums.AppConstant;
 import org.springblade.common.enums.OrderType;
 import org.springblade.common.enums.ResCode;
 import org.springblade.core.log.exception.ServiceException;
+import org.springblade.ldt.bills.entity.Bills;
+import org.springblade.ldt.bills.entity.FrozenRec;
+import org.springblade.ldt.bills.service.IFrozenRecService;
 import org.springblade.ldt.user.entity.UserChannelPoint;
 import org.springblade.ldt.user.service.IUserChannelPointService;
 import org.springblade.payment.handle.entity.HandleData;
@@ -36,6 +39,7 @@ public class ChannelPointHandle implements BaseHandle  {
 	private IPointBillsService pointBillsService;
 	private IUserChannelPointService userChannelPointService;
 	private DataHandle dataHandle;
+	private IFrozenRecService frozenRecService;
 
 
 
@@ -73,7 +77,7 @@ public class ChannelPointHandle implements BaseHandle  {
 		}
 		PointBills pointBills = buildBillRecord(order, user, handlePrice,channelPoint,successParams,BigDecimal.ZERO);
 		Assert.isTrue(dataHandle.saveOrUpdateEntity(pointBillsService,pointBills),()->{throw new ServiceException(ResCode.TRADE_ERROR);});
-
+//		frozenRecService.addFrozenRec(handlePrice,successParams.getBills(),user,"point",channelPoint);
 		successParams.setPointBillsId(pointBills.getId());
 		successParams.getBills().setPointNum(handlePrice);
 
@@ -81,6 +85,7 @@ public class ChannelPointHandle implements BaseHandle  {
 	}
 
 
+
 	/**
 	 * 	构建渠道积分账单
 	 *

+ 8 - 7
ldt-core/src/main/java/org/springblade/yeePay/controller/YeepayController.java

@@ -1,18 +1,14 @@
 package org.springblade.yeePay.controller;
 
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.yeepay.yop.sdk.service.common.response.YopResponse;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.core.log.annotation.ApiLog;
 import org.springblade.core.log.logger.BladeLogger;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.SpringUtil;
-import org.springblade.wx.constant.WeChatApi;
-import org.springblade.wx.utils.UrlTransform;
 import org.springblade.yeePay.common.YeePayConst;
 import org.springblade.yeePay.entity.ConfigAppDto;
 import org.springblade.yeePay.entity.InitOrderDto;
@@ -20,13 +16,12 @@ import org.springblade.yeePay.entity.saas.*;
 import org.springblade.yeePay.entity.saas.account.*;
 import org.springblade.yeePay.entity.saas.changeservice.ProductFeeModifyDto;
 import org.springblade.yeePay.entity.saas.changeservice.ProductFeeQueryDto;
+import org.springblade.yeePay.entity.saas.receipt.BillTradeDayDownloadDto;
 import org.springblade.yeePay.entity.saas.settlement.SettleBalanceQueryDto;
 import org.springblade.yeePay.entity.saas.settlement.SettleSelfSettleApplyDto;
 import org.springblade.yeePay.entity.saas.trade.TradeOrderQueryDto;
 import org.springblade.yeePay.service.YeepayCommonService;
 import org.springblade.yeePay.service.YeepaySaasService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -184,6 +179,12 @@ public class YeepayController {
 		return JSON.parseObject(yeepaySaasService.tradeOrderQuery(orderQueryDto).getStringResult());
 	}
 
+	@GetMapping("/bill/tradedaydownload")
+	@ApiOperation("对账")
+	public YopResponse tradedaydownload(BillTradeDayDownloadDto billTradeDayDownloadDto){
+		return yeepaySaasService.billTradeDayDownload(billTradeDayDownloadDto);
+	}
+
 	@GetMapping("/test")
 	@ApiOperation("测试")
 	@ApiLog