Przeglądaj źródła

Merge remote-tracking branch 'origin/dev' into dev

lianghanqiang 4 lat temu
rodzic
commit
c4188e0381
44 zmienionych plików z 1120 dodań i 369 usunięć
  1. 2 2
      ldt-core/src/main/java/org/springblade/common/enums/FrozenType.java
  2. 1 1
      ldt-core/src/main/java/org/springblade/common/enums/GoodsConstant.java
  3. 30 20
      ldt-core/src/main/java/org/springblade/common/utils/OtpUtils.java
  4. 3 1
      ldt-core/src/main/java/org/springblade/gateway/client_gateway/controller/ClientMemberController.java
  5. 20 19
      ldt-core/src/main/java/org/springblade/gateway/client_gateway/controller/ClientTradeController.java
  6. 3 5
      ldt-core/src/main/java/org/springblade/gateway/common_gateway/controller/AppNoticeManagementController.java
  7. 21 0
      ldt-core/src/main/java/org/springblade/gateway/goods_gatway/controller/AppGoodsBillsController.java
  8. 4 1
      ldt-core/src/main/java/org/springblade/gateway/mall_gateway/wrapper/AppMallWrapper.java
  9. 19 15
      ldt-core/src/main/java/org/springblade/gateway/shop_gateway/controller/AppShopController.java
  10. 8 0
      ldt-core/src/main/java/org/springblade/gateway/shop_gateway/service/IAppShopService.java
  11. 43 11
      ldt-core/src/main/java/org/springblade/gateway/shop_gateway/service/impl/AppShopServiceImpl.java
  12. 67 54
      ldt-core/src/main/java/org/springblade/gateway/web_gateway/controller/PressureTestController.java
  13. 86 24
      ldt-core/src/main/java/org/springblade/ldt/bills/controller/FrozenRecController.java
  14. 5 1
      ldt-core/src/main/java/org/springblade/ldt/bills/entity/FrozenRec.java
  15. 1 1
      ldt-core/src/main/java/org/springblade/ldt/bills/service/IFrozenRecService.java
  16. 6 2
      ldt-core/src/main/java/org/springblade/ldt/bills/service/impl/FrozenRecServiceImpl.java
  17. 5 0
      ldt-core/src/main/java/org/springblade/ldt/bills/vo/GoodsBillsVO.java
  18. 24 5
      ldt-core/src/main/java/org/springblade/ldt/bills/wrapper/GoodsBillsWrapper.java
  19. 137 0
      ldt-core/src/main/java/org/springblade/ldt/notice/controller/NoticeManagementContentController.java
  20. 8 7
      ldt-core/src/main/java/org/springblade/ldt/notice/controller/NoticeManagementController.java
  21. 34 0
      ldt-core/src/main/java/org/springblade/ldt/notice/dto/NoticeManagementContentDTO.java
  22. 1 1
      ldt-core/src/main/java/org/springblade/ldt/notice/dto/NoticeManagementDTO.java
  23. 26 45
      ldt-core/src/main/java/org/springblade/ldt/notice/entity/NoticeManagement.java
  24. 70 0
      ldt-core/src/main/java/org/springblade/ldt/notice/entity/NoticeManagementContent.java
  25. 44 0
      ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementContentMapper.java
  26. 27 0
      ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementContentMapper.xml
  27. 3 4
      ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementMapper.xml
  28. 51 0
      ldt-core/src/main/java/org/springblade/ldt/notice/service/INoticeManagementContentService.java
  29. 0 11
      ldt-core/src/main/java/org/springblade/ldt/notice/service/INoticeManagementService.java
  30. 126 0
      ldt-core/src/main/java/org/springblade/ldt/notice/service/impl/NoticeManagementContentServiceImpl.java
  31. 0 75
      ldt-core/src/main/java/org/springblade/ldt/notice/service/impl/NoticeManagementServiceImpl.java
  32. 39 0
      ldt-core/src/main/java/org/springblade/ldt/notice/vo/NoticeManagementContentVO.java
  33. 2 1
      ldt-core/src/main/java/org/springblade/ldt/notice/vo/NoticeManagementVO.java
  34. 50 0
      ldt-core/src/main/java/org/springblade/ldt/notice/wrapper/NoticeManagementContentWrapper.java
  35. 22 1
      ldt-core/src/main/java/org/springblade/ldt/notice/wrapper/NoticeManagementWrapper.java
  36. 40 39
      ldt-core/src/main/java/org/springblade/payment/handle/Trade.java
  37. 3 1
      ldt-core/src/main/java/org/springblade/payment/handle/handler/BalanceHandle.java
  38. 14 8
      ldt-core/src/main/java/org/springblade/payment/handle/handler/CancelTradeHandle.java
  39. 3 1
      ldt-core/src/main/java/org/springblade/payment/handle/handler/ChannelPointHandle.java
  40. 13 0
      ldt-core/src/main/java/org/springblade/payment/handle/handler/DataHandle.java
  41. 25 0
      ldt-core/src/main/resources/application-prod.yml
  42. 29 10
      ldt-core/src/main/resources/application-test.yml
  43. 3 1
      ldt-core/src/main/resources/application.yml
  44. 2 2
      ldt-core/src/main/resources/log/logback-test.xml

+ 2 - 2
ldt-core/src/main/java/org/springblade/common/enums/FrozenType.java

@@ -15,8 +15,8 @@ import lombok.Getter;
 @AllArgsConstructor
 @Getter
 public enum FrozenType {
-	POINT("POINT", "积分"),
-	BALANCE("BALANCE", "余额"),
+	POINT("POINT", "渠道积分"),
+	BALANCE("BALANCE", "普通积分"),
 	;
 
 	@EnumValue

+ 1 - 1
ldt-core/src/main/java/org/springblade/common/enums/GoodsConstant.java

@@ -13,7 +13,7 @@ public interface GoodsConstant {
 	 */
 	@Getter
 	enum GOODS_STATUS{
-		制作中,已完成
+		取消付款,制作中,已完成
 	}
 
 	@Getter

+ 30 - 20
ldt-core/src/main/java/org/springblade/common/utils/OtpUtils.java

@@ -9,6 +9,7 @@ import javax.crypto.spec.SecretKeySpec;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.math.BigInteger;
 import java.security.GeneralSecurityException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -16,18 +17,26 @@ import java.util.Objects;
 
 /**
  * @author: lianghanqiang
- * @description:	TOP 一次性加密口令
+ * @description: TOP 一次性加密口令
  * @since: 8/2/21 -- 10:48 AM
  */
 public class OtpUtils {
-//	649957
+	//	649957
 	public static void main(String[] args) {
-		System.out.println(generateMyTOTP("1430417679637835778"));
+		Date date = new Date();
+		System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS").format(date));
+		System.out.println(date.getTime());
+		System.out.println(generateMyTOTP("1430417679637835778", date.getTime()));
+		System.out.println("----------------------------------------");
+		date.setTime(date.getTime() + 60 * 1000);
+		System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS").format(date));
+		System.out.println(date.getTime());
+		System.out.println(generateMyTOTP("1430417679637835778", date.getTime()));
 	}
 
 	/**
-	 * 	id变形常量
-	 * */
+	 * id变形常量
+	 */
 	private static final Long TRANSFORM_PARAMS = 95963L;
 
 	/**
@@ -76,15 +85,14 @@ public class OtpUtils {
 	 * @param id
 	 * @return String
 	 */
-	public static String generateMyTOTP(String id) {
-		Assert.notBlank(id,()-> new ServiceException(ResCode.ID_NOT_NULL));
-		long now = new Date().getTime();
+	public static String generateMyTOTP(String id, long now) {
+		Assert.notBlank(id, () -> new ServiceException(ResCode.ID_NOT_NULL));
+		//long now = new Date().getTime();
 		String time = Long.toHexString(timeFactor(now)).toUpperCase();
 		return generateTOTP(id + SECRET_KEY, time);
 	}
 
 
-
 	/**
 	 * 获取动态因子
 	 *
@@ -163,21 +171,23 @@ public class OtpUtils {
 
 
 	/**
-	 * 	校验口令
-	 * */
-	public static boolean validate(String id,String code) {
-		String s = generateMyTOTP(id);
-		return Objects.equals(s,code);
+	 * 校验口令
+	 */
+	public static boolean validate(String id, String code) {
+		Date date = new Date();
+		String current = generateMyTOTP(id, date.getTime());
+		String before = generateMyTOTP(id, date.getTime() + 60 * 1000);
+		return Objects.equals(current, code) || Objects.equals(before, code);
 	}
 
 
 	/**
-	 * 	根据code获取用户Id
-	 * */
-	public static Map<String,String> decodeParams(String code) {
-		return new HashMap<String,String>(){{
-			put(PARAMS_ID,code.substring(0,19));
-			put(PARAMS_SECRET,code.substring(code.length()-6));
+	 * 根据code获取用户Id
+	 */
+	public static Map<String, String> decodeParams(String code) {
+		return new HashMap<String, String>() {{
+			put(PARAMS_ID, code.substring(0, 19));
+			put(PARAMS_SECRET, code.substring(code.length() - 6));
 		}};
 	}
 

+ 3 - 1
ldt-core/src/main/java/org/springblade/gateway/client_gateway/controller/ClientMemberController.java

@@ -9,6 +9,7 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
 import org.springblade.ldt.notice.service.INoticeManagementService;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
 import org.springblade.ldt.notice.wrapper.NoticeManagementWrapper;
@@ -28,13 +29,14 @@ import org.springframework.web.bind.annotation.RestController;
 public class ClientMemberController {
 
 	private INoticeManagementService noticeManagementService;
+	private INoticeManagementContentService noticeManagementContentService;
 
 	@GetMapping("getNotices")
 	@ApiOperation(value = "根据会员用户id获取相关公告通知")
 	public R<IPage<NoticeManagementVO>> submitAudit(Long id, Query query) {
 		IPage<NoticeManagement> pages = noticeManagementService.page(Condition.getPage(query),
 			Wrappers.<NoticeManagement>lambdaQuery().eq(NoticeManagement::getReceiverId, id).orderByAsc(NoticeManagement::getIsRead));
-		return R.data(NoticeManagementWrapper.build().pageVO(pages));
+		return R.data(NoticeManagementWrapper.build(noticeManagementContentService).pageVO(pages));
 	}
 
 }

+ 20 - 19
ldt-core/src/main/java/org/springblade/gateway/client_gateway/controller/ClientTradeController.java

@@ -47,23 +47,23 @@ public class ClientTradeController {
 	@ApiOperation("用户扫商家二维码下单")
 	@PostMapping("/scanPay")
 	public R scanPay(@RequestBody ClientTradeDto clientTradeDto) {
-
-		LoginUser loginUser = loginUserService.getById(clientTradeDto.getUserId());
-		Assert.notNull(loginUser, () -> {
-			throw new ServiceException(ResCode.USER_NOT_FOUNT);
-		});
-
-		//处理订单
-		Order order = Order.builder()
-			.appId(clientTradeDto.getAppId())
-			.billsTitle(clientTradeDto.getBillsTitle())
-			.loginUser(loginUser)
-			.money(clientTradeDto.getMoney())
-			.expireTime(clientTradeDto.getExpireTime())
-			.secret(clientTradeDto.getSecret())
-			.shopId(clientTradeDto.getShopId())
-			.openId(loginUser.getOpenid())
-			.build();
+		synchronized (clientTradeDto.getUserId().toString().intern()) {
+			LoginUser loginUser = loginUserService.getById(clientTradeDto.getUserId());
+			Assert.notNull(loginUser, () -> {
+				throw new ServiceException(ResCode.USER_NOT_FOUNT);
+			});
+
+			//处理订单
+			Order order = Order.builder()
+				.appId(clientTradeDto.getAppId())
+				.billsTitle(clientTradeDto.getBillsTitle())
+				.loginUser(loginUser)
+				.money(clientTradeDto.getMoney())
+				.expireTime(clientTradeDto.getExpireTime())
+				.secret(clientTradeDto.getSecret())
+				.shopId(clientTradeDto.getShopId())
+				.openId(loginUser.getOpenid())
+				.build();
 
 		/*SuccessParams successParams = null;
 
@@ -73,8 +73,9 @@ public class ClientTradeController {
 			e.printStackTrace();
 			throw new TradeException(ResCode.TRADE_ERROR, successParams);
 		}*/
-		SuccessParams successParams = trade.tradeForScanPay(order, clientTradeDto.getChannelId());
-		return R.data(successParams);
+			SuccessParams successParams = trade.tradeForScanPay(order, clientTradeDto.getChannelId());
+			return R.data(successParams);
+		}
 	}
 
 	@ApiOperation("取消支付交易")

+ 3 - 5
ldt-core/src/main/java/org/springblade/gateway/common_gateway/controller/AppNoticeManagementController.java

@@ -21,21 +21,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
 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.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
 import org.springblade.ldt.notice.service.INoticeManagementService;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
 import org.springblade.ldt.notice.wrapper.NoticeManagementWrapper;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -52,6 +50,7 @@ import java.util.stream.Collectors;
 public class AppNoticeManagementController extends BladeController {
 
 	private final INoticeManagementService noticeService;
+	private INoticeManagementContentService noticeManagementContentService;
 
 	/**
 	 * 未读消息id列表
@@ -63,7 +62,6 @@ public class AppNoticeManagementController extends BladeController {
 		List<NoticeManagement> list = noticeService.list(Condition.getQueryWrapper(new NoticeManagement()).lambda()
 			.eq(NoticeManagement::getReceiverId, notice.getReceiverId())
 			.eq(NoticeManagement::getIsRead, false)
-			.eq(notice.getSenderType()!=null,NoticeManagement::getSenderType,notice.getSenderType())
 			.select(NoticeManagement::getId));
 		if (CollUtil.isNotEmpty(list)) {
 			List<Long> ids = list.stream().map(NoticeManagement::getId).collect(Collectors.toList());
@@ -90,6 +88,6 @@ public class AppNoticeManagementController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入notice")
 	public R<IPage<NoticeManagementVO>> list(NoticeManagement notice, Query query) {
 		IPage<NoticeManagement> pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice).lambda().orderByDesc(NoticeManagement::getCreateTime));
-		return R.data(NoticeManagementWrapper.build().pageVO(pages));
+		return R.data(NoticeManagementWrapper.build(noticeManagementContentService).pageVO(pages));
 	}
 }

+ 21 - 0
ldt-core/src/main/java/org/springblade/gateway/goods_gatway/controller/AppGoodsBillsController.java

@@ -24,6 +24,8 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.common.enums.AppConstant;
+import org.springblade.common.enums.GoodsConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -90,6 +92,25 @@ public class AppGoodsBillsController extends BladeController {
 		}
 		IPage<GoodsBills> pages = appGoodsBillsService.page(Condition.getPage(query), Condition.getQueryWrapper(goodsBills).lambda()
 			.like(StrUtil.isNotEmpty(formatTime),GoodsBills::getCreateTime,formatTime).orderByDesc(GoodsBills::getCreateTime));
+		return R.data(GoodsBillsWrapper.build(shopService).pageVO(pages));
+	}
+
+	/**
+	 * 商户的订单中心
+	 * @param goodsBills
+	 * @param query
+	 * @return
+	 */
+	@GetMapping("/listShop")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入goodsBills")
+	public R<IPage<GoodsBillsVO>> listShop(GoodsBills goodsBills, Query query, String goodsStatus ,String orderDate) {
+		//只查询出付款成功的订单
+		IPage<GoodsBills> pages = appGoodsBillsService.page(Condition.getPage(query), Condition.getQueryWrapper(goodsBills).lambda()
+			.eq(GoodsBills::getPayStatus, AppConstant.BillPayStatus.付款成功.name())
+			.eq(StrUtil.isNotBlank(goodsStatus), GoodsBills::getOrderStatus, goodsStatus)
+			.like(orderDate != null, GoodsBills::getCreateTime, orderDate)
+			.orderByDesc(GoodsBills::getCreateTime));
 		return R.data(GoodsBillsWrapper.build().pageVO(pages));
 	}
 

+ 4 - 1
ldt-core/src/main/java/org/springblade/gateway/mall_gateway/wrapper/AppMallWrapper.java

@@ -19,6 +19,7 @@ package org.springblade.gateway.mall_gateway.wrapper;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.flow.activity.entity.ActivityEnum;
 import org.springblade.gateway.mall_gateway.entity.vo.AppMallVO;
 import org.springblade.ldt.activity.entity.Activity;
 import org.springblade.ldt.activity.service.IActivityService;
@@ -50,7 +51,9 @@ public class AppMallWrapper extends BaseEntityWrapper<Mall, AppMallVO>  {
 		AppMallVO appMallVO = Objects.requireNonNull(BeanUtil.copy(mall, AppMallVO.class));
 
 		if (appMallVO!=null) {
-			int count = activityService.count(Condition.getQueryWrapper(new Activity()).lambda().eq(Activity::getMallId, appMallVO.getId()));
+			int count = activityService.count(Condition.getQueryWrapper(new Activity()).lambda()
+				.eq(Activity::getMallId, appMallVO.getId())
+				.eq(Activity::getAuditStatus, ActivityEnum.PASS.name()));
 			appMallVO.setActivityNums(count);
 		}
 

+ 19 - 15
ldt-core/src/main/java/org/springblade/gateway/shop_gateway/controller/AppShopController.java

@@ -5,13 +5,11 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.common.enums.AppConstant;
-import org.springblade.common.enums.SenderType;
 import org.springblade.common.enums.WithdrawType;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -26,7 +24,12 @@ import org.springblade.ldt.bills.entity.Bills;
 import org.springblade.ldt.bills.entity.WithdrawRec;
 import org.springblade.ldt.bills.service.IBillsService;
 import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
 import org.springblade.ldt.notice.service.INoticeManagementService;
+import org.springblade.ldt.notice.vo.NoticeManagementVO;
+import org.springblade.ldt.notice.wrapper.NoticeManagementContentWrapper;
+import org.springblade.ldt.notice.wrapper.NoticeManagementWrapper;
 import org.springblade.ldt.shop.entity.Shop;
 import org.springblade.ldt.shop.service.IShopService;
 import org.springblade.ldt.shop.vo.ShopVO;
@@ -53,7 +56,7 @@ public class AppShopController {
 	private IMemberService memberService;
 	private IShopService shopService;
 	private IBillsService billsService;
-	private INoticeManagementService noticeManagementService;
+	private INoticeManagementContentService noticeManagementContentService;
 
 	/**
 	 * 分页
@@ -313,18 +316,19 @@ public class AppShopController {
 
 	@PostMapping("submitNotice")
 	@ApiOperation(value = "商户创建公告信息")
-	public R submitAudit(@RequestBody NoticeManagement notice) {
-		List<Member> members = memberService.list(Wrappers.<Member>lambdaQuery().eq(Member::getShopId, notice.getSenderId()));
-		List<NoticeManagement> notices = new ArrayList<>();
-		members.forEach(member -> {
-			notice.setReceiver(member.getNickName());
-			notice.setReceiverId(member.getUserId());
-			notice.setIsRead(false);
-			notice.setSenderType(SenderType.SHOP);
-			notices.add(notice);
-		});
-		noticeManagementService.saveBatch(notices);
-		return R.success("提交成功");
+	public R submitAudit(@RequestBody NoticeManagementContent noticeContent) {
+		return R.status(appShopService.submitNotice(noticeContent));
+	}
+	/**
+	 * 获取发布的公告列表
+	 */
+	@GetMapping("/getPublishNoticeList")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "获取发布的公告列表", notes = "传入notice")
+	public R getPublishNoticeList(NoticeManagementContent noticeManagementContent, Query query) {
+		IPage<NoticeManagementContent> pages = noticeManagementContentService.page(Condition.getPage(query), Condition.getQueryWrapper(noticeManagementContent).lambda()
+			.orderByDesc(NoticeManagementContent::getCreateTime));
+		return R.data(NoticeManagementContentWrapper.build().pageVO(pages));
 	}
 
 }

+ 8 - 0
ldt-core/src/main/java/org/springblade/gateway/shop_gateway/service/IAppShopService.java

@@ -21,6 +21,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.gateway.shop_gateway.entity.dto.ShopAuditDto;
 import org.springblade.gateway.shop_gateway.entity.vo.BalanceAccountInfoVO;
 import org.springblade.ldt.bills.entity.WithdrawRec;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
 import org.springblade.ldt.shop.entity.Shop;
 
 /**
@@ -74,4 +75,11 @@ public interface IAppShopService extends IService<Shop> {
 	 * @Date 2021/10/22 9:22
 	 */
 	Long userPointWithdraw(WithdrawRec withdrawRec);
+
+	/**
+	 * 商户发布公告
+	 * @param noticeContent
+	 * @return
+	 */
+    Boolean submitNotice(NoticeManagementContent noticeContent);
 }

+ 43 - 11
ldt-core/src/main/java/org/springblade/gateway/shop_gateway/service/impl/AppShopServiceImpl.java

@@ -23,10 +23,7 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springblade.common.cache.PlatformCache;
 import org.springblade.common.config.entity.PlatformConfig;
-import org.springblade.common.enums.AppConstant;
-import org.springblade.common.enums.TransferStatus;
-import org.springblade.common.enums.WithdrawStatus;
-import org.springblade.common.enums.WithdrawType;
+import org.springblade.common.enums.*;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.api.R;
@@ -44,12 +41,18 @@ import org.springblade.ldt.bills.service.ITransferRecService;
 import org.springblade.ldt.bills.service.IWithdrawRecService;
 import org.springblade.ldt.mall.entity.Mall;
 import org.springblade.ldt.mall.service.IMallService;
+import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
+import org.springblade.ldt.notice.service.INoticeManagementService;
 import org.springblade.ldt.shop.entity.Audit;
 import org.springblade.ldt.shop.entity.Shop;
 import org.springblade.ldt.shop.mapper.ShopMapper;
 import org.springblade.ldt.shop.service.IAuditService;
 import org.springblade.ldt.user.entity.LoginUser;
+import org.springblade.ldt.user.entity.Member;
 import org.springblade.ldt.user.service.ILoginUserService;
+import org.springblade.ldt.user.service.IMemberService;
 import org.springblade.wx.config.ConfigForClient;
 import org.springblade.wx.config.ConfigForMall;
 import org.springblade.wx.config.ConfigForOfficial;
@@ -65,10 +68,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 
 import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
 
 /**
  * 服务实现类
@@ -94,6 +94,9 @@ public class AppShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements
 	private ITransferRecService transferRecService;
 	private YeepaySaasService yeepaySaasService;
 	private IAccountService accountService;
+	private IMemberService memberService;
+	private INoticeManagementContentService noticeContentService;
+	private INoticeManagementService noticeManagementService;
 
 
 	@Override
@@ -227,15 +230,44 @@ public class AppShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements
 		transferRec.setPrice(actualPrice);
 		transferRec.setActualPrice(actualPrice);
 		transferRec.setFeeChargeSide(YeepayApiConstant.feeChargeSide.INSIDE);
-		transferRec.setPlatformFee(BigDecimal.ZERO);//转账平台暂时不收取手续费
-		transferRec.setWithdrawId(withdrawId);//提现记录id
+		//转账平台暂时不收取手续费
+		transferRec.setPlatformFee(BigDecimal.ZERO);
+		//提现记录id
+		transferRec.setWithdrawId(withdrawId);
 		transferRec.setTenantId(withdrawRec.getTenantId());
 		transferRecService.saveOrUpdate(transferRec);
 
 		return transferRec.getId();
 	}
 
-	/**
+    @Override
+	@Transactional
+    public Boolean submitNotice(NoticeManagementContent noticeContent) {
+		Long id = noticeContent.getId();
+		//保存通知内容
+		noticeContent.setSenderType(SenderType.SHOP);
+		boolean flag = noticeContentService.saveOrUpdate(noticeContent);
+		if (!Objects.isNull(id)) {
+			//如果是修改内容,noticeManagement表不用修改
+			return flag;
+		}
+		List<Member> members = memberService.list(Condition.getQueryWrapper(new Member()).lambda()
+			.eq(Member::getShopId, noticeContent.getSenderId()));
+		List<NoticeManagement> notices = new ArrayList<>();
+
+		members.forEach(member -> {
+			NoticeManagement noticeNew = new NoticeManagement();
+			noticeNew.setContentId(noticeContent.getId());
+			noticeNew.setReceiverType(ReceiverType.CONSUMER);
+			noticeNew.setReceiver(member.getNickName());
+			noticeNew.setReceiverId(member.getUserId());
+			noticeNew.setIsRead(false);
+			notices.add(noticeNew);
+		});
+		return noticeManagementService.saveBatch(notices);
+    }
+
+    /**
 	 * 提现处理国信手续费
 	 *
 	 * @param amount 提现金额

+ 67 - 54
ldt-core/src/main/java/org/springblade/gateway/web_gateway/controller/PressureTestController.java

@@ -32,6 +32,7 @@ import org.springblade.wx.constant.MiniProgramType;
 import org.springblade.wx.service.WeChatService;
 import org.springblade.yeePay.common.YeePayConst;
 import org.springblade.yeePay.common.YeepayApiConstant;
+import org.springblade.yeePay.service.YeePayService;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -39,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
@@ -62,6 +64,7 @@ public class PressureTestController {
 	private Trade trade;
 	private ConfigForShop configForShop;
 	private WeChatService weChatService;
+	private YeePayService yeePayService;
 
 	@PostMapping("/userBalanceWithdraw")
 	@ApiOperation(value = "用户余额提现(结算)")
@@ -132,61 +135,64 @@ public class PressureTestController {
 		clientTradeDto.setMoney(BigDecimal.ONE);
 		clientTradeDto.setOpenId("ocWnO5eEuHMhl7RV_ebnp_Ff9A0M");
 		clientTradeDto.setShopId(1440871712886366210L);*/
-		LoginUser loginUser = loginUserService.getById(clientTradeDto.getUserId());
-		Assert.notNull(loginUser, () -> {
-			throw new ServiceException(ResCode.USER_NOT_FOUNT);
-		});
-
-		//处理订单
-		Order order = Order.builder()
-			.appId(clientTradeDto.getAppId())
-			.billsTitle(clientTradeDto.getBillsTitle())
-			.loginUser(loginUser)
-			.money(clientTradeDto.getMoney())
-			.expireTime(clientTradeDto.getExpireTime())
-			.secret(clientTradeDto.getSecret())
-			.shopId(clientTradeDto.getShopId())
-			.openId(loginUser.getOpenid())
-			.build();
 
-		SuccessParams successParams = trade.tradeForScanPay(order, clientTradeDto.getChannelId());
-
-		String res = "{\"channelOrderId\":\"4200001127202110301273440365\"," +
-			"\"orderId\":\"" + successParams.getBills().getId() + "\"," +
-			"\"bankOrderId\":\"5062869652211030\"," +
-			"\"paySuccessDate\":\"" + LocalDateTime.now() + "\"," +
-			"\"channel\":\"WECHAT\"," +
-			"\"payWay\":\"MINI_PROGRAM\"," +
-			"\"uniqueOrderNo\":\"1013202110300000002776327287\"," +
-			"\"orderAmount\":\"" + clientTradeDto.getMoney() + "\"," +
-			"\"payAmount\":\"" + clientTradeDto.getMoney() + "\"," +
-			"\"payerInfo\":\"{\\\"bankCardNo\\\":\\\"\\\"," +
-			"\\\"bankId\\\":\\\"CFT\\\"," +
-			"\\\"cardType\\\":\\\"CFT\\\"," +
-			"\\\"mobilePhoneNo\\\":\\\"\\\"," +
-			"\\\"userID\\\":\\\"" + clientTradeDto.getOpenId() + "\\\"}\"," +
-			"\"realPayAmount\":\"" + clientTradeDto.getMoney() + "\"," +
-			"\"parentMerchantNo\":\"10086160165\"," +
-			"\"merchantNo\":\"10086184256\"," +
-			"\"status\":\"SUCCESS\"}";
-		successParams.setRes(JSONObject.parseObject(res));
-		eventPublisher.publishEvent(new UserPayEvent(successParams));
-
-		res = "{\"feeMerchantNo\":\"10086184256\"," +
-			"\"orderAmount\":\"" + clientTradeDto.getMoney() + "\"," +
-			"\"csSuccessDate\":\"" + LocalDateTime.now() + "\"," +
-			"\"orderId\":\"" + successParams.getBills().getId() + "\"," +
-			"\"merchantFee\":\"" + BigDecimal.valueOf(0.01) + "\"," +
-			"\"customerFee\":\"\"," +
-			"\"parentMerchantNo\":\"10086160165\"," +
-			"\"uniqueOrderNo\":\"1013202110300000002776396034\"," +
-			"\"feeType\":\"REAL_TIME\"," +
-			"\"ypSettleAmount\":\"" + clientTradeDto.getMoney().subtract(BigDecimal.valueOf(0.01)) + "\"," +
-			"\"merchantNo\":\"10086184256\"," +
-			"\"status\":\"SUCCESS\"}";
-		successParams.setRes(JSONObject.parseObject(res));
-		eventPublisher.publishEvent(new UserPayCsEvent(successParams));
-		return R.data(successParams);
+		synchronized (clientTradeDto.getUserId().toString().intern()) {
+			LoginUser loginUser = loginUserService.getById(clientTradeDto.getUserId());
+			Assert.notNull(loginUser, () -> {
+				throw new ServiceException(ResCode.USER_NOT_FOUNT);
+			});
+
+			//处理订单
+			Order order = Order.builder()
+				.appId(clientTradeDto.getAppId())
+				.billsTitle(clientTradeDto.getBillsTitle())
+				.loginUser(loginUser)
+				.money(clientTradeDto.getMoney())
+				.expireTime(clientTradeDto.getExpireTime())
+				.secret(clientTradeDto.getSecret())
+				.shopId(clientTradeDto.getShopId())
+				.openId(loginUser.getOpenid())
+				.build();
+
+			SuccessParams successParams = trade.tradeForScanPay(order, clientTradeDto.getChannelId());
+
+			String res = "{\"channelOrderId\":\"4200001127202110301273440365\"," +
+				"\"orderId\":\"" + successParams.getBills().getId() + "\"," +
+				"\"bankOrderId\":\"5062869652211030\"," +
+				"\"paySuccessDate\":\"" + LocalDateTime.now() + "\"," +
+				"\"channel\":\"WECHAT\"," +
+				"\"payWay\":\"MINI_PROGRAM\"," +
+				"\"uniqueOrderNo\":\"1013202110300000002776327287\"," +
+				"\"orderAmount\":\"" + clientTradeDto.getMoney() + "\"," +
+				"\"payAmount\":\"" + clientTradeDto.getMoney() + "\"," +
+				"\"payerInfo\":\"{\\\"bankCardNo\\\":\\\"\\\"," +
+				"\\\"bankId\\\":\\\"CFT\\\"," +
+				"\\\"cardType\\\":\\\"CFT\\\"," +
+				"\\\"mobilePhoneNo\\\":\\\"\\\"," +
+				"\\\"userID\\\":\\\"" + clientTradeDto.getOpenId() + "\\\"}\"," +
+				"\"realPayAmount\":\"" + clientTradeDto.getMoney() + "\"," +
+				"\"parentMerchantNo\":\"10086160165\"," +
+				"\"merchantNo\":\"10086184256\"," +
+				"\"status\":\"SUCCESS\"}";
+			successParams.setRes(JSONObject.parseObject(res));
+			eventPublisher.publishEvent(new UserPayEvent(successParams));
+
+			res = "{\"feeMerchantNo\":\"10086184256\"," +
+				"\"orderAmount\":\"" + clientTradeDto.getMoney() + "\"," +
+				"\"csSuccessDate\":\"" + LocalDateTime.now() + "\"," +
+				"\"orderId\":\"" + successParams.getBills().getId() + "\"," +
+				"\"merchantFee\":\"" + BigDecimal.valueOf(0.01) + "\"," +
+				"\"customerFee\":\"\"," +
+				"\"parentMerchantNo\":\"10086160165\"," +
+				"\"uniqueOrderNo\":\"1013202110300000002776396034\"," +
+				"\"feeType\":\"REAL_TIME\"," +
+				"\"ypSettleAmount\":\"" + clientTradeDto.getMoney().subtract(BigDecimal.valueOf(0.01)) + "\"," +
+				"\"merchantNo\":\"10086184256\"," +
+				"\"status\":\"SUCCESS\"}";
+			successParams.setRes(JSONObject.parseObject(res));
+			eventPublisher.publishEvent(new UserPayCsEvent(successParams));
+			return R.data(successParams);
+		}
 	}
 
 	@PostMapping("/sendWXMessage")
@@ -198,4 +204,11 @@ public class PressureTestController {
 		weChatService.sendTemplateMessage(openId, MessageTemplate.PAYMENT_NOTICE, content, configForShop.getPaymentPage(), MiniProgramType.SHOP);
 	}
 
+	@PostMapping("/deCodeNotifyData")
+	@ApiModelProperty("回调消息解密")
+	public R deCodeNotifyData(HttpServletRequest request) {
+		JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
+		return R.data(jsonObject.toJSONString());
+	}
+
 }

+ 86 - 24
ldt-core/src/main/java/org/springblade/ldt/bills/controller/FrozenRecController.java

@@ -16,32 +16,44 @@
  */
 package org.springblade.ldt.bills.controller;
 
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 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 lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springblade.common.aop.core.TenantAop;
+import org.springblade.common.constant.Salesman;
+import org.springblade.common.utils.ExcelWriteUtil;
+import org.springblade.core.boot.ctrl.BladeController;
 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.service.IFrozenRecService;
 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;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.Date;
+import java.util.Map;
 
 /**
- *  控制器
+ * 控制器
  *
  * @author BladeX
  * @since 2021-10-30
  */
+@Slf4j
 @RestController
 @AllArgsConstructor
 @RequestMapping("ldt_bills/frozenrec")
@@ -62,19 +74,19 @@ public class FrozenRecController extends BladeController {
 	}
 
 	/**
-	 * 分页 
+	 * 分页
 	 */
-	@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("/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)
@@ -85,7 +97,7 @@ public class FrozenRecController extends BladeController {
 	}
 
 	/**
-	 * 新增 
+	 * 新增
 	 */
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
@@ -95,7 +107,7 @@ public class FrozenRecController extends BladeController {
 	}
 
 	/**
-	 * 修改 
+	 * 修改
 	 */
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
@@ -105,7 +117,7 @@ public class FrozenRecController extends BladeController {
 	}
 
 	/**
-	 * 新增或修改 
+	 * 新增或修改
 	 */
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
@@ -114,9 +126,9 @@ public class FrozenRecController extends BladeController {
 		return R.status(frozenRecService.saveOrUpdate(frozenRec));
 	}
 
-	
+
 	/**
-	 * 删除 
+	 * 删除
 	 */
 	@PostMapping("/remove")
 	@ApiOperationSupport(order = 7)
@@ -125,5 +137,55 @@ public class FrozenRecController extends BladeController {
 		return R.status(frozenRecService.deleteLogic(Func.toLongList(ids)));
 	}
 
-	
+	/**
+	 * 分页 冻结记录
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入frozenRec")
+	public R<IPage<FrozenRecVO>> list(FrozenRec frozenRec, Query query, Date createTimeStart, Date createTimeEnd, String key) {
+		QueryWrapper<FrozenRec> queryWrapper = Condition.getQueryWrapper(frozenRec);
+		//添加创建时间条件
+		if (createTimeStart != null && createTimeEnd != null) {
+			queryWrapper.lambda().between(FrozenRec::getCreateTime, createTimeStart, createTimeEnd);
+		}
+		//添加关键字key查询条件
+		if (StringUtils.isNotBlank(key)) {
+			queryWrapper.lambda().and(wq -> {
+				wq.eq(FrozenRec::getId, key);
+			});
+		}
+		//循环查询
+		return R.data(FrozenRecWrapper.build().pageVO(frozenRecService.page(Condition.getPage(query), queryWrapper)));
+	}
+
+	/**
+	 * 生成列表
+	 */
+	@PostMapping("/generateList")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "生成列表", notes = "传入frozenRec")
+	@TenantAop(salesman = Salesman.roleName)
+	public void generateList(FrozenRec frozenRec, Query query, Date createTimeStart, Date createTimeEnd,
+							 String key,
+							 @RequestParam String keyValue,
+							 HttpServletResponse response) {
+		try {
+			R<IPage<FrozenRecVO>> page = this.list(frozenRec, query, createTimeStart, createTimeEnd, key);
+			//判断是否为空
+			if (ObjectUtils.isNotEmpty(page) && ObjectUtils.isNotEmpty(page.getData()) && ObjectUtils.isNotEmpty(page.getData().getRecords())) {
+				//键值对
+				Map<String, String> titleMap = JSONObject.parseObject(keyValue, Map.class);
+				if (ObjectUtils.isNotEmpty(titleMap)) {
+					//写入到Excel
+					ExcelWriteUtil.writeToResponse(response, DateUtil.now(), "冻结记录表", titleMap, page.getData().getRecords(), FrozenRecVO.class);
+					return;
+				}
+			}
+		} catch (Exception e) {
+			log.error(e.getMessage());
+		}
+	}
+
+
 }

+ 5 - 1
ldt-core/src/main/java/org/springblade/ldt/bills/entity/FrozenRec.java

@@ -66,11 +66,15 @@ public class FrozenRec extends BaseEntity {
 	 */
 	@ApiModelProperty(value = "冻结用户id")
 	private Long userId;
-
 	/**
 	 * 冻结状态
 	 */
 	@ApiModelProperty(value = "冻结状态")
 	private FrozenSatus frozenSatus;
+	/**
+	 * 冻结用户名
+	 */
+	@ApiModelProperty(value = "冻结用户名")
+	private String userName;
 
 }

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

@@ -44,5 +44,5 @@ public interface IFrozenRecService extends BaseService<FrozenRec> {
 	 */
 	IPage<FrozenRecVO> selectFrozenRecPage(IPage<FrozenRecVO> page, FrozenRecVO frozenRec);
 
-	boolean addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, FrozenType type, UserChannelPoint channelPoint);
+	FrozenRec addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, FrozenType type, UserChannelPoint channelPoint);
 }

+ 6 - 2
ldt-core/src/main/java/org/springblade/ldt/bills/service/impl/FrozenRecServiceImpl.java

@@ -27,6 +27,7 @@ import org.springblade.ldt.bills.service.IFrozenRecService;
 import org.springblade.ldt.bills.vo.FrozenRecVO;
 import org.springblade.ldt.user.entity.LoginUser;
 import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.payment.handle.handler.DataHandle;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -41,17 +42,20 @@ import java.util.Objects;
 @Service
 public class FrozenRecServiceImpl extends BaseServiceImpl<FrozenRecMapper, FrozenRec> implements IFrozenRecService {
 
+	private DataHandle dataHandle;
+
 	@Override
 	public IPage<FrozenRecVO> selectFrozenRecPage(IPage<FrozenRecVO> page, FrozenRecVO frozenRec) {
 		return page.setRecords(baseMapper.selectFrozenRecPage(page, frozenRec));
 	}
 
 	@Override
-	public boolean addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, FrozenType type, UserChannelPoint userChannelPoint) {
+	public FrozenRec addFrozenRec(BigDecimal handlePrice, Bills bills, LoginUser user, FrozenType type, UserChannelPoint userChannelPoint) {
 
 		FrozenRec frozenRec = new FrozenRec();
 		frozenRec.setFrozenNum(handlePrice);
 		frozenRec.setUserId(user.getId());
+		frozenRec.setUserName(user.getNickName());
 		frozenRec.setTradeNo(bills.getId());
 		frozenRec.setFrozenType(type);
 		frozenRec.setStatus(1);
@@ -68,7 +72,7 @@ public class FrozenRecServiceImpl extends BaseServiceImpl<FrozenRecMapper, Froze
 			user.setFrozenBalance(user.getFrozenBalance().add(handlePrice));
 		}
 
-		return this.saveOrUpdate(frozenRec);
+		return frozenRec;
 	}
 
 }

+ 5 - 0
ldt-core/src/main/java/org/springblade/ldt/bills/vo/GoodsBillsVO.java

@@ -40,4 +40,9 @@ public class GoodsBillsVO extends GoodsBills {
 	@ApiModelProperty(value = "付款人")
 	private String payer;
 
+
+	private String shopName;
+
+	private String shopPic;
+
 }

+ 24 - 5
ldt-core/src/main/java/org/springblade/ldt/bills/wrapper/GoodsBillsWrapper.java

@@ -20,7 +20,11 @@ import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.ldt.bills.entity.GoodsBills;
 import org.springblade.ldt.bills.vo.GoodsBillsVO;
+import org.springblade.ldt.shop.entity.Shop;
+import org.springblade.ldt.shop.service.IShopService;
+
 import java.util.Objects;
+import java.util.Optional;
 
 /**
  * 订单包装类,返回视图层所需的字段
@@ -30,19 +34,34 @@ import java.util.Objects;
  */
 public class GoodsBillsWrapper extends BaseEntityWrapper<GoodsBills, GoodsBillsVO>  {
 
+	private IShopService shopService;
+
+	public GoodsBillsWrapper(IShopService shopService) {
+		this.shopService = shopService;
+	}
+
+	public GoodsBillsWrapper() {
+	}
+
 	public static GoodsBillsWrapper build() {
 		return new GoodsBillsWrapper();
  	}
 
+	public static GoodsBillsWrapper build(IShopService shopService) {
+		return new GoodsBillsWrapper(shopService);
+	}
+
 	@Override
 	public GoodsBillsVO entityVO(GoodsBills goodsBills) {
 		GoodsBillsVO goodsBillsVO = Objects.requireNonNull(BeanUtil.copy(goodsBills, GoodsBillsVO.class));
 
-		//User createUser = UserCache.getUser(goodsBills.getCreateUser());
-		//User updateUser = UserCache.getUser(goodsBills.getUpdateUser());
-		//goodsBillsVO.setCreateUserName(createUser.getName());
-		//goodsBillsVO.setUpdateUserName(updateUser.getName());
-
+		if (shopService != null) {
+			Shop shop = shopService.getById(goodsBillsVO.getReceiveId());
+			String shopName= Optional.ofNullable(shop).map(Shop::getName).orElse("");
+			String shopPic= Optional.ofNullable(shop).map(Shop::getShopPic).orElse("");
+			goodsBillsVO.setShopName(shopName);
+			goodsBillsVO.setShopPic(shopPic);
+		}
 		return goodsBillsVO;
 	}
 

+ 137 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/controller/NoticeManagementContentController.java

@@ -0,0 +1,137 @@
+/*
+ *      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.notice.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
+import org.springblade.ldt.notice.vo.NoticeManagementContentVO;
+import org.springblade.ldt.notice.wrapper.NoticeManagementContentWrapper;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("ldt_notice/noticecontent")
+@Api(value = "", tags = "接口")
+public class NoticeManagementContentController extends BladeController {
+
+	private final INoticeManagementContentService noticeContentService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入noticeContent")
+	public R<NoticeManagementContentVO> detail(NoticeManagementContent noticeContent) {
+		NoticeManagementContent detail = noticeContentService.getOne(Condition.getQueryWrapper(noticeContent));
+		return R.data(NoticeManagementContentWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入noticeContent")
+	public R<IPage<NoticeManagementContentVO>> list(NoticeManagementContent noticeContent, Query query) {
+		IPage<NoticeManagementContent> pages = noticeContentService.page(Condition.getPage(query), Condition.getQueryWrapper(noticeContent));
+		return R.data(NoticeManagementContentWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入noticeContent")
+	public R<IPage<NoticeManagementContentVO>> page(NoticeManagementContentVO noticeContent, Query query) {
+		IPage<NoticeManagementContentVO> pages = noticeContentService.selectNoticeContentPage(Condition.getPage(query), noticeContent);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入noticeContent")
+	public R save(@Valid @RequestBody NoticeManagementContent noticeContent) {
+		return R.status(noticeContentService.save(noticeContent));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入noticeContent")
+	public R update(@Valid @RequestBody NoticeManagementContent noticeContent) {
+		return R.status(noticeContentService.updateById(noticeContent));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入noticeContent")
+	public R submit(@Valid @RequestBody NoticeManagementContent noticeContent) {
+		return R.status(noticeContentService.saveOrUpdate(noticeContent));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(noticeContentService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 新增通知内容并选择发布
+	 */
+	@PostMapping("/submitAndPush")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入noticeContent")
+	public R submitAndPush(@Valid @RequestBody NoticeManagementContentVO noticeContent, BladeUser bladeUser) {
+		return noticeContentService.submitAndPush(noticeContent, bladeUser);
+	}
+
+}

+ 8 - 7
ldt-core/src/main/java/org/springblade/ldt/notice/controller/NoticeManagementController.java

@@ -25,10 +25,10 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
 import org.springblade.ldt.notice.service.INoticeManagementService;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
 import org.springblade.ldt.notice.wrapper.NoticeManagementWrapper;
@@ -49,6 +49,7 @@ import javax.validation.Valid;
 public class NoticeManagementController extends BladeController {
 
 	private final INoticeManagementService noticeService;
+	private final INoticeManagementContentService noticeManagementContentService;
 
 	/**
 	 * 详情
@@ -58,7 +59,7 @@ public class NoticeManagementController extends BladeController {
 	@ApiOperation(value = "详情", notes = "传入notice")
 	public R<NoticeManagementVO> detail(NoticeManagement notice) {
 		NoticeManagement detail = noticeService.getOne(Condition.getQueryWrapper(notice));
-		return R.data(NoticeManagementWrapper.build().entityVO(detail));
+		return R.data(NoticeManagementWrapper.build(noticeManagementContentService).entityVO(detail));
 	}
 
 	/**
@@ -70,7 +71,7 @@ public class NoticeManagementController extends BladeController {
 	public R<IPage<NoticeManagementVO>> list(NoticeManagement notice, Query query) {
 		IPage<NoticeManagement> pages = noticeService.page(Condition.getPage(query),
 			Condition.getQueryWrapper(notice).lambda().orderByAsc(NoticeManagement::getIsRead));
-		return R.data(NoticeManagementWrapper.build().pageVO(pages));
+		return R.data(NoticeManagementWrapper.build(noticeManagementContentService).pageVO(pages));
 	}
 
 
@@ -91,8 +92,8 @@ public class NoticeManagementController extends BladeController {
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入notice")
-	public R save(@Valid @RequestBody NoticeManagementVO notice, BladeUser bladeUser) {
-		return noticeService.saveNotice(notice, bladeUser);
+	public R save(@Valid @RequestBody NoticeManagementVO notice) {
+		return R.status(noticeService.save(notice));
 	}
 
 	/**
@@ -111,8 +112,8 @@ public class NoticeManagementController extends BladeController {
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入notice")
-	public R submit(@Valid @RequestBody NoticeManagementVO notice, BladeUser bladeUser) {
-		return noticeService.saveNotice(notice, bladeUser);
+	public R submit(@Valid @RequestBody NoticeManagementVO notice) {
+		return R.status(noticeService.saveOrUpdate(notice));
 	}
 
 

+ 34 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/dto/NoticeManagementContentDTO.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.notice.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NoticeManagementContentDTO extends NoticeManagementContent {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 1
ldt-core/src/main/java/org/springblade/ldt/notice/dto/NoticeManagementDTO.java

@@ -16,9 +16,9 @@
  */
 package org.springblade.ldt.notice.dto;
 
-import org.springblade.ldt.notice.entity.NoticeManagement;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springblade.ldt.notice.entity.NoticeManagement;
 
 /**
  * 通知表数据传输对象实体类

+ 26 - 45
ldt-core/src/main/java/org/springblade/ldt/notice/entity/NoticeManagement.java

@@ -17,19 +17,19 @@
 package org.springblade.ldt.notice.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import org.springblade.common.enums.ReceiverType;
+import org.springblade.core.mp.base.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springblade.common.enums.ReceiverType;
-import org.springblade.common.enums.SenderType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.springblade.core.tenant.mp.TenantEntity;
 
 /**
  * 通知表实体类
  *
  * @author BladeX
- * @since 2021-11-03
+ * @since 2021-11-09
  */
 @Data
 @TableName("ldt_notice")
@@ -40,49 +40,30 @@ public class NoticeManagement extends TenantEntity {
 	private static final long serialVersionUID = 1L;
 
 	/**
-	 * 标题
-	 */
-	@ApiModelProperty(value = "标题,必填", required = true)
-	private String title;
+	* 接收人Id
+	*/
+		@ApiModelProperty(value = "接收人Id")
+		private Long receiverId;
 	/**
-	 * 内容
-	 */
-	@ApiModelProperty(value = "内容,必填", required = true)
-	private String content;
+	* 内容id
+	*/
+		@ApiModelProperty(value = "内容id")
+		private Long contentId;
 	/**
-	 * 发送人Id
-	 */
-	@ApiModelProperty(value = "发送人Id,必填", required = true)
-	private Long senderId;
+	* 接收人昵称
+	*/
+		@ApiModelProperty(value = "接收人昵称")
+		private String receiver;
 	/**
-	 * 发送人昵称
-	 */
-	@ApiModelProperty(value = "发送人昵称,必填", required = true)
-	private String sender;
+	* 是否已读(0:未读  1:已读)
+	*/
+		@ApiModelProperty(value = "是否已读(0:未读  1:已读)")
+		private Boolean isRead;
 	/**
-	 * 接收人Id
-	 */
-	@ApiModelProperty(value = "接收人Id")
-	private Long receiverId;
-	/**
-	 * 接收人昵称
-	 */
-	@ApiModelProperty(value = "接收人昵称")
-	private String receiver;
-	/**
-	 * 是否已读(0:未读  1:已读)
-	 */
-	@ApiModelProperty(value = "是否已读(0:未读  1:已读")
-	private Boolean isRead;
-	/**
-	 * 发送人类型(商户,平台)
-	 */
-	@ApiModelProperty(value = "发送人类型(商户,平台,商家)", required = true)
-	private SenderType senderType;
-	/**
-	 * 接收人类型(平台用户,商场,商户,会员,C端用户)
-	 */
-	@ApiModelProperty(value = "接收人类型(平台用户,商场,商户,会员,C端用户)", required = true)
-	private ReceiverType receiverType;
+	* 接收人类型(平台用户,商场,商户,会员,C端用户)
+	*/
+		@ApiModelProperty(value = "接收人类型(平台用户,商场,商户,会员,C端用户)")
+		private ReceiverType receiverType;
+
 
 }

+ 70 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/entity/NoticeManagementContent.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.notice.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.common.enums.ReceiverType;
+import org.springblade.common.enums.SenderType;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+@Data
+@TableName("ldt_notice_content")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "NoticeContent对象", description = "NoticeContent对象")
+public class NoticeManagementContent extends TenantEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 标题
+	 */
+	@ApiModelProperty(value = "标题")
+	private String title;
+	/**
+	 * 内容
+	 */
+	@ApiModelProperty(value = "内容")
+	private String content;
+	/**
+	 * 发送人Id
+	 */
+	@ApiModelProperty(value = "发送人Id")
+	private Long senderId;
+	/**
+	 * 发送人昵称
+	 */
+	@ApiModelProperty(value = "发送人昵称")
+	private String sender;
+	/**
+	 * 发送人类型(商户,平台,商家)
+	 */
+	@ApiModelProperty(value = "发送人类型(商户,平台,商家)")
+	private SenderType senderType;
+
+}

+ 44 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementContentMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      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.notice.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.vo.NoticeManagementContentVO;
+
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+public interface NoticeManagementContentMapper extends BaseMapper<NoticeManagementContent> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param noticeContent
+	 * @return
+	 */
+	List<NoticeManagementContentVO> selectNoticeContentPage(IPage page, NoticeManagementContentVO noticeContent);
+
+}

+ 27 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementContentMapper.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.notice.mapper.NoticeManagementContentMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="noticeContentResultMap" type="org.springblade.ldt.notice.entity.NoticeManagementContent">
+        <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="title" property="title"/>
+        <result column="content" property="content"/>
+        <result column="sender_id" property="senderId"/>
+        <result column="sender" property="sender"/>
+        <result column="sender_type" property="senderType"/>
+    </resultMap>
+
+
+    <select id="selectNoticeContentPage" resultMap="noticeContentResultMap">
+        select * from ldt_notice_content where is_deleted = 0
+    </select>
+
+</mapper>

+ 3 - 4
ldt-core/src/main/java/org/springblade/ldt/notice/mapper/NoticeManagementMapper.xml

@@ -12,12 +12,11 @@
         <result column="update_time" property="updateTime"/>
         <result column="status" property="status"/>
         <result column="is_deleted" property="isDeleted"/>
-        <result column="title" property="title"/>
-        <result column="content" property="content"/>
-        <result column="sender" property="sender"/>
+        <result column="receiver_id" property="receiverId"/>
+        <result column="content_id" property="contentId"/>
         <result column="receiver" property="receiver"/>
         <result column="is_read" property="isRead"/>
-        <result column="sender_type" property="senderType"/>
+        <result column="receiver_type" property="receiverType"/>
     </resultMap>
 
 

+ 51 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/service/INoticeManagementContentService.java

@@ -0,0 +1,51 @@
+/*
+ *      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.notice.service;
+
+
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.vo.NoticeManagementContentVO;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+public interface INoticeManagementContentService extends BaseService<NoticeManagementContent> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param noticeContent
+	 * @return
+	 */
+	IPage<NoticeManagementContentVO> selectNoticeContentPage(IPage<NoticeManagementContentVO> page, NoticeManagementContentVO noticeContent);
+
+	/**
+	 * 新增通知内容并选择发布
+	 * @param noticeContent 信息内容
+	 * @param bladeUser 当前用户信息
+	 * @return 状态
+	 */
+    R submitAndPush(NoticeManagementContentVO noticeContent, BladeUser bladeUser);
+}

+ 0 - 11
ldt-core/src/main/java/org/springblade/ldt/notice/service/INoticeManagementService.java

@@ -18,8 +18,6 @@ package org.springblade.ldt.notice.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
-import org.springblade.core.secure.BladeUser;
-import org.springblade.core.tool.api.R;
 import org.springblade.ldt.notice.entity.NoticeManagement;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
 
@@ -40,13 +38,4 @@ public interface INoticeManagementService extends BaseService<NoticeManagement>
 	 */
 	IPage<NoticeManagementVO> selectNoticePage(IPage<NoticeManagementVO> page, NoticeManagementVO notice);
 
-	/**
-	 * @param notice : 通知信息
-	 * @param bladeUser
-	 * @Return R
-	 * @Author July
-	 * @Description 发布通知消息
-	 * @Date 2021/11/4 17:29
-	 */
-	R saveNotice(NoticeManagementVO notice, BladeUser bladeUser);
 }

+ 126 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/service/impl/NoticeManagementContentServiceImpl.java

@@ -0,0 +1,126 @@
+/*
+ *      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.notice.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.common.enums.ReceiverType;
+import org.springblade.common.enums.SenderType;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.ldt.mall.entity.Mall;
+import org.springblade.ldt.mall.service.IMallService;
+import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.mapper.NoticeManagementContentMapper;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
+import org.springblade.ldt.notice.service.INoticeManagementService;
+import org.springblade.ldt.notice.vo.NoticeManagementContentVO;
+import org.springblade.ldt.shop.entity.Shop;
+import org.springblade.ldt.shop.service.IShopService;
+import org.springblade.ldt.user.entity.LoginUser;
+import org.springblade.ldt.user.entity.Member;
+import org.springblade.ldt.user.service.ILoginUserService;
+import org.springblade.ldt.user.service.IMemberService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+@Service
+@AllArgsConstructor
+public class NoticeManagementContentServiceImpl extends BaseServiceImpl<NoticeManagementContentMapper, NoticeManagementContent> implements INoticeManagementContentService {
+
+	@Override
+	public IPage<NoticeManagementContentVO> selectNoticeContentPage(IPage<NoticeManagementContentVO> page, NoticeManagementContentVO noticeContent) {
+		return page.setRecords(baseMapper.selectNoticeContentPage(page, noticeContent));
+	}
+
+	private IMallService mallService;
+	private IShopService shopService;
+	private IMemberService memberService;
+	private ILoginUserService loginUserService;
+	private INoticeManagementService noticeService;
+
+	@Override
+	@Transactional
+	public R submitAndPush(NoticeManagementContentVO notice, BladeUser bladeUser) {
+		Mall mall = null;
+		if (notice.getSenderType().equals(SenderType.MALL)) {
+			mall = mallService.getOne(Wrappers.<Mall>lambdaQuery().eq(Mall::getTenantId, bladeUser.getTenantId()));
+		}
+		Map<ReceiverType, Map<Long, String>> receiver = new HashMap<>();
+		for (ReceiverType receiverType : notice.getReceiverTypes()) {
+			if (receiverType.equals(ReceiverType.MALL)) {//平台可发
+				List<Mall> malls = mallService.list();
+				receiver.put(ReceiverType.MALL, malls.stream().collect(Collectors.toMap(Mall::getId, Mall::getMallName)));
+			}
+			if (receiverType.equals(ReceiverType.SHOP)) {//平台,商场可发
+				List<Shop> shops = shopService.list(Wrappers.<Shop>lambdaQuery()
+					.eq(notice.getSenderType().equals(SenderType.MALL) && mall != null, Shop::getMallId, mall.getId()));
+				receiver.put(ReceiverType.SHOP, shops.stream().collect(Collectors.toMap(Shop::getId, Shop::getName)));
+			}
+			if (receiverType.equals(ReceiverType.MEMBER)) {//商场可发
+				List<Member> members = memberService.list(Wrappers.<Member>lambdaQuery().eq(mall != null, Member::getMallId, mall.getId()));
+				receiver.put(ReceiverType.MEMBER, members.stream().collect(Collectors.toMap(Member::getId, Member::getNickName)));
+			}
+			if (receiverType.equals(ReceiverType.CONSUMER)) {//平台可发
+				List<LoginUser> loginUsers = loginUserService.list();
+				receiver.put(ReceiverType.CONSUMER, loginUsers.stream().collect(Collectors.toMap(LoginUser::getId, LoginUser::getNickName)));
+			}
+		}
+
+		//保存通知内容
+		if (notice.getSenderType().equals(SenderType.MALL)) {
+			notice.setSenderId(mall.getId());
+			notice.setSender(mall.getMallName());
+		} else {
+			notice.setSenderId(bladeUser.getUserId());
+			notice.setSender("[平台]");
+		}
+		saveOrUpdate(notice);
+
+		//发布给指定人
+		List<NoticeManagement> noticeManagements = new ArrayList<>();
+		for (Map.Entry<ReceiverType, Map<Long, String>> data : receiver.entrySet()) {
+			for (Map.Entry<Long, String> item : data.getValue().entrySet()) {
+				NoticeManagement noticeManagement = new NoticeManagement();
+				noticeManagement.setReceiver(item.getValue());
+				noticeManagement.setReceiverId(item.getKey());
+				noticeManagement.setReceiverType(data.getKey());
+				noticeManagement.setContentId(notice.getId());
+				noticeManagement.setIsRead(false);
+				noticeManagements.add(noticeManagement);
+			}
+		}
+		noticeService.saveBatch(noticeManagements);
+		return R.status(true);
+	}
+
+}

+ 0 - 75
ldt-core/src/main/java/org/springblade/ldt/notice/service/impl/NoticeManagementServiceImpl.java

@@ -17,34 +17,13 @@
 package org.springblade.ldt.notice.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
-import org.springblade.common.enums.ReceiverType;
-import org.springblade.common.enums.SenderType;
 import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.secure.BladeUser;
-import org.springblade.core.tool.api.R;
-import org.springblade.ldt.mall.entity.Mall;
-import org.springblade.ldt.mall.service.IMallService;
 import org.springblade.ldt.notice.entity.NoticeManagement;
 import org.springblade.ldt.notice.mapper.NoticeManagementMapper;
 import org.springblade.ldt.notice.service.INoticeManagementService;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
-import org.springblade.ldt.shop.entity.Shop;
-import org.springblade.ldt.shop.service.IShopService;
-import org.springblade.ldt.user.entity.LoginUser;
-import org.springblade.ldt.user.entity.Member;
-import org.springblade.ldt.user.service.ILoginUserService;
-import org.springblade.ldt.user.service.IMemberService;
-import org.springblade.modules.system.service.IUserService;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * 通知表 服务实现类
@@ -61,58 +40,4 @@ public class NoticeManagementServiceImpl extends BaseServiceImpl<NoticeManagemen
 		return page.setRecords(baseMapper.selectNoticePage(page, notice));
 	}
 
-	private IMallService mallService;
-	private IShopService shopService;
-	private IMemberService memberService;
-	private IUserService userService;
-	private ILoginUserService loginUserService;
-
-	@Override
-	@Transactional
-	public R saveNotice(NoticeManagementVO notice, BladeUser bladeUser) {
-		Mall mall = null;
-		if (notice.getSenderType().equals(SenderType.MALL)) {
-			mall = mallService.getOne(Wrappers.<Mall>lambdaQuery().eq(Mall::getTenantId, bladeUser.getTenantId()));
-		}
-		Map<ReceiverType, Map<Long, String>> receiver = new HashMap<>();
-		for (ReceiverType receiverType : notice.getReceiverTypes()) {
-			if (receiverType.equals(ReceiverType.MALL)) {//平台可发
-				List<Mall> malls = mallService.list();
-				receiver.put(ReceiverType.MALL, malls.stream().collect(Collectors.toMap(Mall::getId, Mall::getMallName)));
-			}
-			if (receiverType.equals(ReceiverType.SHOP)) {//平台,商场可发
-				List<Shop> shops = shopService.list(Wrappers.<Shop>lambdaQuery()
-					.eq(notice.getSenderType().equals(SenderType.MALL) && mall != null, Shop::getMallId, mall.getId()));
-				receiver.put(ReceiverType.SHOP, shops.stream().collect(Collectors.toMap(Shop::getId, Shop::getName)));
-			}
-			if (receiverType.equals(ReceiverType.MEMBER)) {//商场可发
-				List<Member> members = memberService.list(Wrappers.<Member>lambdaQuery().eq(mall != null, Member::getMallId, mall.getId()));
-				receiver.put(ReceiverType.MEMBER, members.stream().collect(Collectors.toMap(Member::getId, Member::getNickName)));
-			}
-			if (receiverType.equals(ReceiverType.CONSUMER)) {//平台可发
-				List<LoginUser> loginUsers = loginUserService.list();
-				receiver.put(ReceiverType.CONSUMER, loginUsers.stream().collect(Collectors.toMap(LoginUser::getId, LoginUser::getNickName)));
-			}
-		}
-
-		List<NoticeManagement> notices = new ArrayList<>();
-		for (Map.Entry<ReceiverType, Map<Long, String>> data : receiver.entrySet()) {
-			for (Map.Entry<Long, String> item : data.getValue().entrySet()) {
-				notice.setReceiver(item.getValue());
-				notice.setReceiverId(item.getKey());
-				notice.setReceiverType(data.getKey());
-				notice.setIsRead(false);
-				if (notice.getSenderType().equals(SenderType.MALL)) {
-					notice.setSenderId(mall.getId());
-					notice.setSender(mall.getMallName());
-				} else {
-					notice.setSenderId(bladeUser.getUserId());
-					notice.setSender("[平台]");
-				}
-				notices.add(notice);
-			}
-		}
-		return R.data(saveBatch(notices));
-	}
-
 }

+ 39 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/vo/NoticeManagementContentVO.java

@@ -0,0 +1,39 @@
+/*
+ *      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.notice.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import org.springblade.common.enums.ReceiverType;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "NoticeContentVO对象", description = "NoticeContentVO对象")
+public class NoticeManagementContentVO extends NoticeManagementContent {
+	private static final long serialVersionUID = 1L;
+
+	private ReceiverType[] receiverTypes;
+}

+ 2 - 1
ldt-core/src/main/java/org/springblade/ldt/notice/vo/NoticeManagementVO.java

@@ -21,6 +21,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.common.enums.ReceiverType;
 import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
 
 /**
  * 通知表视图实体类
@@ -34,6 +35,6 @@ import org.springblade.ldt.notice.entity.NoticeManagement;
 public class NoticeManagementVO extends NoticeManagement {
 	private static final long serialVersionUID = 1L;
 
-	private ReceiverType[] receiverTypes;
+	private NoticeManagementContent noticeManagementContent;
 
 }

+ 50 - 0
ldt-core/src/main/java/org/springblade/ldt/notice/wrapper/NoticeManagementContentWrapper.java

@@ -0,0 +1,50 @@
+/*
+ *      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.notice.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.vo.NoticeManagementContentVO;
+
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-09
+ */
+public class NoticeManagementContentWrapper extends BaseEntityWrapper<NoticeManagementContent, NoticeManagementContentVO>  {
+
+	public static NoticeManagementContentWrapper build() {
+		return new NoticeManagementContentWrapper();
+ 	}
+
+	@Override
+	public NoticeManagementContentVO entityVO(NoticeManagementContent noticeContent) {
+		NoticeManagementContentVO noticeContentVO = Objects.requireNonNull(BeanUtil.copy(noticeContent, NoticeManagementContentVO.class));
+
+		//User createUser = UserCache.getUser(noticeContent.getCreateUser());
+		//User updateUser = UserCache.getUser(noticeContent.getUpdateUser());
+		//noticeContentVO.setCreateUserName(createUser.getName());
+		//noticeContentVO.setUpdateUserName(updateUser.getName());
+
+		return noticeContentVO;
+	}
+
+}

+ 22 - 1
ldt-core/src/main/java/org/springblade/ldt/notice/wrapper/NoticeManagementWrapper.java

@@ -19,6 +19,8 @@ package org.springblade.ldt.notice.wrapper;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.ldt.notice.entity.NoticeManagement;
+import org.springblade.ldt.notice.entity.NoticeManagementContent;
+import org.springblade.ldt.notice.service.INoticeManagementContentService;
 import org.springblade.ldt.notice.vo.NoticeManagementVO;
 import java.util.Objects;
 
@@ -30,14 +32,33 @@ import java.util.Objects;
  */
 public class NoticeManagementWrapper extends BaseEntityWrapper<NoticeManagement, NoticeManagementVO>  {
 
+	private INoticeManagementContentService noticeManagementContentService;
+
+
+	public NoticeManagementWrapper() {
+	}
+
+	public NoticeManagementWrapper(INoticeManagementContentService noticeManagementContentService) {
+		this.noticeManagementContentService = noticeManagementContentService;
+	}
+
+	public static NoticeManagementWrapper build(INoticeManagementContentService noticeManagementContentService) {
+		return new NoticeManagementWrapper(noticeManagementContentService);
+ 	}
+
 	public static NoticeManagementWrapper build() {
 		return new NoticeManagementWrapper();
- 	}
+	}
 
 	@Override
 	public NoticeManagementVO entityVO(NoticeManagement notice) {
 		NoticeManagementVO noticeVO = Objects.requireNonNull(BeanUtil.copy(notice, NoticeManagementVO.class));
 
+		if (noticeManagementContentService != null) {
+			NoticeManagementContent content = noticeManagementContentService.getById(notice.getContentId());
+			noticeVO.setNoticeManagementContent(content);
+		}
+
 		//User createUser = UserCache.getUser(notice.getCreateUser());
 		//User updateUser = UserCache.getUser(notice.getUpdateUser());
 		//noticeVO.setCreateUserName(createUser.getName());

+ 40 - 39
ldt-core/src/main/java/org/springblade/payment/handle/Trade.java

@@ -2,6 +2,7 @@ package org.springblade.payment.handle;
 
 import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springblade.common.cache.PaymentCache;
 import org.springblade.common.enums.AppConstant;
@@ -35,6 +36,7 @@ import java.util.List;
  */
 @Component
 @AllArgsConstructor
+@Slf4j
 public class Trade {
 
 	private IBillsService billsService;
@@ -126,52 +128,51 @@ public class Trade {
 			String tenantId = appShopService.getTenantId(order.getShopId());
 			Bills bills = initBill(order, channelId, tenantId);
 
-			synchronized (order.getLoginUser().getId().toString().intern()) {
-				//支付参数
-				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();
+			//支付参数
+			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 TradeException(ResCode.TRADE_ERROR, res.getSuccessParams());
-					});
-					remain = res.getRemain();
-					successParams = res.getSuccessParams();
+			//处理各个节点
+			for (BaseHandle node : chain) {
+				HandleData res = node.handle(remain, order, successParams);
+				Assert.isTrue(res.isSuccess(), () -> {
+					throw new TradeException(ResCode.TRADE_ERROR, res.getSuccessParams());
+				});
+				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());
+					dataHandle.publishEvent(new UserPayCsEvent(successParams));
+					break;
 				}
+			}
 
-				//新建事务,保存订单信息,
-				SuccessParams finalSuccessParams = successParams;
-				Assert.isTrue(dataHandle.saveOrUpdateEntity(billsService, successParams.getBills()), () -> {
-					throw new TradeException(ResCode.TRADE_ERROR, finalSuccessParams);
-				});
-				PaymentCache.putSuccessParams(Convert.toStr(successParams.getBills().getId()), successParams);
+			//新建事务,保存订单信息,
+			SuccessParams finalSuccessParams = successParams;
+			Assert.isTrue(dataHandle.saveOrUpdateEntity(billsService, successParams.getBills()), () -> {
+				throw new TradeException(ResCode.TRADE_ERROR, finalSuccessParams);
+			});
+			PaymentCache.putSuccessParams(Convert.toStr(successParams.getBills().getId()), successParams);
 
-				//判断是否是待付款
-				if(StringUtils.equals(successParams.getStatus(),AppConstant.BillPayStatus.待付款.name())){
-					//发送消息队列
-					orderSend.sendOrderMessage(successParams);
-				}
-				return successParams;
+			//判断是否是待付款
+			if (StringUtils.equals(successParams.getStatus(), AppConstant.BillPayStatus.待付款.name())) {
+				//发送消息队列
+				orderSend.sendOrderMessage(successParams);
 			}
+			return successParams;
 		} catch (Exception e) {
+			e.printStackTrace();
 			throw new TradeException(ResCode.TRADE_ERROR, successParams);
 		}
 

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

@@ -7,6 +7,7 @@ import org.springblade.common.enums.OrderType;
 import org.springblade.common.enums.ResCode;
 import org.springblade.common.utils.TradeException;
 import org.springblade.ldt.bills.entity.BalanceBills;
+import org.springblade.ldt.bills.entity.FrozenRec;
 import org.springblade.ldt.bills.service.IBalanceBillsService;
 import org.springblade.ldt.bills.service.IFrozenRecService;
 import org.springblade.ldt.user.entity.LoginUser;
@@ -69,7 +70,8 @@ public class BalanceHandle implements BaseHandle {
 			handlePrice = myBalance;
 		}
 
-		Assert.isTrue(frozenRecService.addFrozenRec(handlePrice, successParams.getBills(), user, FrozenType.BALANCE, null), () -> {
+		FrozenRec frozenRec = frozenRecService.addFrozenRec(handlePrice, successParams.getBills(), user, FrozenType.BALANCE, null);
+		Assert.isTrue(dataHandle.saveOrUpdateEntity(frozenRecService, frozenRec), () -> {
 			throw new TradeException(ResCode.TRADE_ERROR, successParams);
 		});
 		BalanceBills balanceBills = buildBills(order, user, handlePrice, successParams, BigDecimal.ZERO);

+ 14 - 8
ldt-core/src/main/java/org/springblade/payment/handle/handler/CancelTradeHandle.java

@@ -6,15 +6,12 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.springblade.common.enums.AppConstant;
 import org.springblade.common.enums.FrozenSatus;
 import org.springblade.common.enums.FrozenType;
+import org.springblade.common.enums.GoodsConstant;
 import org.springblade.core.log.exception.ServiceException;
-import org.springblade.ldt.bills.entity.BalanceBills;
-import org.springblade.ldt.bills.entity.Bills;
-import org.springblade.ldt.bills.entity.FrozenRec;
-import org.springblade.ldt.bills.entity.PointBills;
-import org.springblade.ldt.bills.service.IBalanceBillsService;
-import org.springblade.ldt.bills.service.IBillsService;
-import org.springblade.ldt.bills.service.IFrozenRecService;
-import org.springblade.ldt.bills.service.IPointBillsService;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.ldt.bills.entity.*;
+import org.springblade.ldt.bills.service.*;
 import org.springblade.ldt.user.entity.LoginUser;
 import org.springblade.ldt.user.entity.UserChannelPoint;
 import org.springblade.ldt.user.service.ILoginUserService;
@@ -41,6 +38,7 @@ public class CancelTradeHandle {
 	private IBalanceBillsService balanceBillsService;
 	private IFrozenRecService frozenRecService;
 	private IUserChannelPointService userChannelPointService;
+	private IGoodsBillsService goodsBillsService;
 
 	public void handle(SuccessParams successParams) throws ServiceException {
 		Bills bills = successParams.getBills();
@@ -84,5 +82,13 @@ public class CancelTradeHandle {
 			balanceBills.setPayStatus(AppConstant.BillPayStatus.取消付款.name());
 			balanceBillsService.saveOrUpdate(balanceBills);
 		}
+
+		//取消商品订单
+		GoodsBills goodsBills = goodsBillsService.getOne(Condition.getQueryWrapper(new GoodsBills()).lambda().eq(GoodsBills::getBillsId, bills.getId()));
+		if (ObjectUtil.isNotEmpty(goodsBills)) {
+			goodsBills.setPayStatus(AppConstant.BillPayStatus.取消付款.name());
+			goodsBills.setOrderStatus(GoodsConstant.GOODS_STATUS.取消付款.name());
+			goodsBillsService.updateById(goodsBills);
+		}
 	}
 }

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

@@ -7,6 +7,7 @@ import org.springblade.common.enums.FrozenType;
 import org.springblade.common.enums.OrderType;
 import org.springblade.common.enums.ResCode;
 import org.springblade.common.utils.TradeException;
+import org.springblade.ldt.bills.entity.FrozenRec;
 import org.springblade.ldt.bills.entity.PointBills;
 import org.springblade.ldt.bills.service.IFrozenRecService;
 import org.springblade.ldt.bills.service.IPointBillsService;
@@ -77,7 +78,8 @@ public class ChannelPointHandle implements BaseHandle {
 			throw new TradeException(ResCode.TRADE_ERROR, successParams);
 		});
 
-		Assert.isTrue(frozenRecService.addFrozenRec(handlePrice, successParams.getBills(), user, FrozenType.POINT, channelPoint), () -> {
+		FrozenRec frozenRec = frozenRecService.addFrozenRec(handlePrice, successParams.getBills(), user, FrozenType.POINT, channelPoint);
+		Assert.isTrue(dataHandle.saveOrUpdateEntity(frozenRecService, frozenRec), () -> {
 			throw new TradeException(ResCode.TRADE_ERROR, successParams);
 		});
 		Assert.isTrue(dataHandle.saveOrUpdateEntity(loginUserService, user), () -> {

+ 13 - 0
ldt-core/src/main/java/org/springblade/payment/handle/handler/DataHandle.java

@@ -5,6 +5,12 @@ import org.springblade.ldt.bills.entity.Bills;
 import org.springblade.ldt.bills.service.IBillsService;
 import org.springblade.ldt.user.entity.LoginUser;
 import org.springblade.ldt.user.service.ILoginUserService;
+import org.springblade.payment.entity.SuccessParams;
+import org.springblade.payment.event.UserPayCsEvent;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationEventPublisher;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -19,6 +25,9 @@ import java.util.Objects;
 @Component
 public class DataHandle {
 
+	@Autowired
+	private ApplicationEventPublisher applicationEventPublisher;
+
 	@Transactional(propagation = Propagation.REQUIRES_NEW)
 	public <T> boolean saveOrUpdateEntity(BaseService<T> service,T t) {
 		if(Objects.isNull(t)){
@@ -27,4 +36,8 @@ public class DataHandle {
 		return service.saveOrUpdate(t);
 	}
 
+	@Transactional(propagation = Propagation.NOT_SUPPORTED)
+	public void publishEvent(ApplicationEvent applicationEvent){
+		applicationEventPublisher.publishEvent(applicationEvent);
+	}
 }

+ 25 - 0
ldt-core/src/main/resources/application-prod.yml

@@ -1,5 +1,30 @@
 #数据源配置
 spring:
+  rabbitmq:
+    host: 139.159.240.119
+    port: 5672
+    virtual-host: ldt
+    connection-timeout: 15000
+    # 发送确认
+    publisher-confirm-type: simple
+    # 路由失败回调
+    publisher-returns: true
+    template:
+      # 必须设置成true 消息路由失败通知监听者,而不是将消息丢弃
+      mandatory: true
+    listener:
+      simple:
+        # 每次从RabbitMQ获取的消息数量
+        prefetch: 1
+        default-requeue-rejected: false
+        # 每个队列启动的消费者数量
+        concurrency: 1
+        # 每个队列最大的消费者数量
+        max-concurrency: 1
+        # 手动签收ACK
+        acknowledge-mode: manual
+    username: admin
+    password: admin
   redis:
     ##redis 单机环境配置
     ##将docker脚本部署的redis服务映射为宿主机ip

+ 29 - 10
ldt-core/src/main/resources/application-test.yml

@@ -1,18 +1,37 @@
 #数据源配置
 spring:
-  rebbitmq:
-    host: 127.0.0.1
+  rabbitmq:
+    host: 139.159.240.119
     port: 5672
-    username: liuxing
-    password: liuxing
     virtual-host: ldt
+    connection-timeout: 15000
+    # 发送确认
+    publisher-confirm-type: simple
+    # 路由失败回调
+    publisher-returns: true
+    template:
+      # 必须设置成true 消息路由失败通知监听者,而不是将消息丢弃
+      mandatory: true
+    listener:
+      simple:
+        # 每次从RabbitMQ获取的消息数量
+        prefetch: 1
+        default-requeue-rejected: false
+        # 每个队列启动的消费者数量
+        concurrency: 1
+        # 每个队列最大的消费者数量
+        max-concurrency: 1
+        # 手动签收ACK
+        acknowledge-mode: manual
+    username: admin
+    password: admin
   redis:
     ##redis 单机环境配置
     ##将docker脚本部署的redis服务映射为宿主机ip
     ##生产环境推荐使用阿里云高可用redis服务并设置密码
-    host: 127.0.0.1
-    port: 6379
-    password:
+    host: 139.159.240.119
+    port: 7379
+    password: Guoxin-redis
     database: 0
     ssl: false
     ##redis 集群环境配置
@@ -20,9 +39,9 @@ spring:
     #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
     #  commandTimeout: 5000
   datasource:
-    url: jdbc:mysql://127.0.0.1:3306/gx-ldt-0823?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://192.168.0.191:3306/ldt-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
     username: root
-    password: 123456
+    password: Gmtdb__b2b888
 
 #第三方登陆
 social:
@@ -42,7 +61,7 @@ blade:
     enabled: false
     ##将docker脚本部署的redis服务映射为宿主机ip
     ##生产环境推荐使用阿里云高可用redis服务并设置密码
-    address: redis://127.0.0.1:6379
+    address: redis://139.159.240.119:6379
     password:
   #本地文件上传
   file:

+ 3 - 1
ldt-core/src/main/resources/application.yml

@@ -24,7 +24,7 @@ spring:
       #validation-query: select 1 from dual
       validation-query-timeout: 2000
       initial-size: 5
-      max-active: 20
+      max-active: 500
       min-idle: 5
       max-wait: 60000
       test-on-borrow: false
@@ -262,5 +262,7 @@ crypto:
     - /payment/csurl/
     - /withdraw/callback/
     - /withdraw/csurl/
+    - /pressure_test/scanPay
+    - /pressure_test/deCodeNotifyData
 
 

+ 2 - 2
ldt-core/src/main/resources/log/logback-test.xml

@@ -25,7 +25,7 @@
     <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件输出的文件名 -->
-            <FileNamePattern>/home/ldt/server/log/info-%d{yyyy-MM-dd}.log</FileNamePattern>
+            <FileNamePattern>/home/application/ldt/log/info-%d{yyyy-MM-dd}.log</FileNamePattern>
         </rollingPolicy>
         <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
             <pattern>%n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n</pattern>
@@ -42,7 +42,7 @@
     <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件输出的文件名 -->
-            <FileNamePattern>/home/ldt/server/log/error-%d{yyyy-MM-dd}.log</FileNamePattern>
+            <FileNamePattern>/home/application/ldt/log/error-%d{yyyy-MM-dd}.log</FileNamePattern>
         </rollingPolicy>
         <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
             <pattern>%n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n</pattern>