Просмотр исходного кода

平台预授权表代码生成、修改场次排序等

VEAR 2 лет назад
Родитель
Сommit
5d987a0821

+ 0 - 2
src/main/java/org/springblade/modules/api/controller/AliPay01Controller.java

@@ -13,7 +13,6 @@ import com.alipay.api.response.*;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.ijpay.core.kit.PayKit;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -40,7 +39,6 @@ import org.springblade.modules.finance.service.IOrderGrantService;
 import org.springblade.modules.finance.service.IOrderService;
 import org.springblade.modules.shopping.entity.Consign;
 import org.springblade.modules.shopping.service.IConsignService;
-import org.springblade.modules.shopping.wrapper.ConsignWrapper;
 import org.springblade.modules.system.entity.User;
 import org.springblade.modules.system.entity.UserApp;
 import org.springblade.modules.system.service.IUserService;

+ 2 - 1
src/main/java/org/springblade/modules/api/task/ConsignSchedulingTask.java

@@ -199,7 +199,8 @@ public class ConsignSchedulingTask implements SchedulingConfigurer {
 			sign.setPremiumPrice(consignPrice);
 			sign.setCreateTime(DateUtil.date());
 			sign.setConsignConfigId(configNowId);
-			item.setConsignState(3);//把来源为后台的原数据更新为已完成
+			sign.setConsignState(1); //变为1
+			item.setConsignState(3); //把来源为后台的原数据更新为已完成
 			batchList.add(sign);
 		}
 		boolean updateFlg = consignService.updateBatchById(list);

+ 126 - 0
src/main/java/org/springblade/modules/finance/controller/PlatformAuthorizationController.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.modules.finance.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.finance.entity.PlatformAuthorization;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.finance.vo.PlatformAuthorizationVO;
+import org.springblade.modules.finance.service.IPlatformAuthorizationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-04-09
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("finance/platformauthorization")
+@Api(value = "平台授权表", tags = "接口")
+public class PlatformAuthorizationController extends BladeController {
+
+	private final IPlatformAuthorizationService platformAuthorizationService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入platformAuthorization")
+	public R<PlatformAuthorization> detail(PlatformAuthorization platformAuthorization) {
+		PlatformAuthorization detail = platformAuthorizationService.getOne(Condition.getQueryWrapper(platformAuthorization));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入platformAuthorization")
+	public R<IPage<PlatformAuthorization>> list(PlatformAuthorization platformAuthorization, Query query) {
+		IPage<PlatformAuthorization> pages = platformAuthorizationService.page(Condition.getPage(query), Condition.getQueryWrapper(platformAuthorization));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入platformAuthorization")
+	public R<IPage<PlatformAuthorizationVO>> page(PlatformAuthorizationVO platformAuthorization, Query query) {
+		IPage<PlatformAuthorizationVO> pages = platformAuthorizationService.selectPlatformAuthorizationPage(Condition.getPage(query), platformAuthorization);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入platformAuthorization")
+	public R save(@Valid @RequestBody PlatformAuthorization platformAuthorization) {
+		return R.status(platformAuthorizationService.save(platformAuthorization));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入platformAuthorization")
+	public R update(@Valid @RequestBody PlatformAuthorization platformAuthorization) {
+		return R.status(platformAuthorizationService.updateById(platformAuthorization));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入platformAuthorization")
+	public R submit(@Valid @RequestBody PlatformAuthorization platformAuthorization) {
+		return R.status(platformAuthorizationService.saveOrUpdate(platformAuthorization));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(platformAuthorizationService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

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

+ 15 - 3
src/main/java/org/springblade/modules/finance/mapper/PlatformAuthorizationMapper.java

@@ -16,15 +16,27 @@
  */
 package org.springblade.modules.finance.mapper;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.springblade.modules.finance.entity.PlatformAuthorization;
+import org.springblade.modules.finance.vo.PlatformAuthorizationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
 
 /**
- * 订单预授权表 Mapper 接口
+ *  Mapper 接口
  *
  * @author BladeX
- * @since 2022-03-27
+ * @since 2022-04-09
  */
 public interface PlatformAuthorizationMapper extends BaseMapper<PlatformAuthorization> {
 
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param platformAuthorization
+	 * @return
+	 */
+	List<PlatformAuthorizationVO> selectPlatformAuthorizationPage(IPage page, PlatformAuthorizationVO platformAuthorization);
+
 }

+ 25 - 0
src/main/java/org/springblade/modules/finance/mapper/PlatformAuthorizationMapper.xml

@@ -0,0 +1,25 @@
+<?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.modules.finance.mapper.PlatformAuthorizationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="platformAuthorizationResultMap" type="org.springblade.modules.finance.entity.PlatformAuthorization">
+        <id column="id" property="id"/>
+        <result column="order_no" property="orderNo"/>
+        <result column="total_num" property="totalNum"/>
+        <result column="consign_config_id" property="consignConfigId"/>
+        <result column="auth_no" property="authNo"/>
+        <result column="auth_num" property="authNum"/>
+        <result column="auth_price" property="authPrice"/>
+        <result column="state" property="state"/>
+        <result column="end_time" property="endTime"/>
+        <result column="create_time" property="createTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+
+    <select id="selectPlatformAuthorizationPage" resultMap="platformAuthorizationResultMap">
+        select * from t_platform_authorization where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/modules/finance/service/IPlatformAuthorizationService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.modules.finance.service;
+
+import org.springblade.modules.finance.entity.PlatformAuthorization;
+import org.springblade.modules.finance.vo.PlatformAuthorizationVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-04-09
+ */
+public interface IPlatformAuthorizationService extends IService<PlatformAuthorization> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param platformAuthorization
+	 * @return
+	 */
+	IPage<PlatformAuthorizationVO> selectPlatformAuthorizationPage(IPage<PlatformAuthorizationVO> page, PlatformAuthorizationVO platformAuthorization);
+
+}

+ 41 - 0
src/main/java/org/springblade/modules/finance/service/impl/PlatformAuthorizationServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.modules.finance.service.impl;
+
+import org.springblade.modules.finance.entity.PlatformAuthorization;
+import org.springblade.modules.finance.vo.PlatformAuthorizationVO;
+import org.springblade.modules.finance.mapper.PlatformAuthorizationMapper;
+import org.springblade.modules.finance.service.IPlatformAuthorizationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-04-09
+ */
+@Service
+public class PlatformAuthorizationServiceImpl extends ServiceImpl<PlatformAuthorizationMapper, PlatformAuthorization> implements IPlatformAuthorizationService {
+
+	@Override
+	public IPage<PlatformAuthorizationVO> selectPlatformAuthorizationPage(IPage<PlatformAuthorizationVO> page, PlatformAuthorizationVO platformAuthorization) {
+		return page.setRecords(baseMapper.selectPlatformAuthorizationPage(page, platformAuthorization));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/modules/finance/vo/PlatformAuthorizationVO.java

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

+ 3 - 1
src/main/java/org/springblade/modules/shopping/controller/ConsignConfigController.java

@@ -76,7 +76,9 @@ public class ConsignConfigController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入consignConfig")
 	public R<IPage<ConsignConfigVO>> list(ConsignConfig consignConfig, Query query) {
-		IPage<ConsignConfig> pages = consignConfigService.page(Condition.getPage(query), Condition.getQueryWrapper(consignConfig));
+		IPage<ConsignConfig> pages = consignConfigService.page(Condition.getPage(query),
+			Condition.getQueryWrapper(consignConfig)
+				.orderByDesc("is_enabled","is_now", "start_time"));
 		return R.data(ConsignConfigWrapper.build().pageVO(pages));
 	}
 

+ 1 - 0
src/main/java/org/springblade/modules/shopping/service/impl/ConsignConfigServiceImpl.java

@@ -57,6 +57,7 @@ public class ConsignConfigServiceImpl extends ServiceImpl<ConsignConfigMapper, C
 		if (list == null || list.size() == 0){
 			list = baseMapper.selectList(Wrappers.<ConsignConfig>lambdaQuery()
 				.eq(ConsignConfig::getIsEnabled, 2)
+				.eq(ConsignConfig::getIsNow, 2)
 				.orderByAsc(ConsignConfig::getStartTime));
 			bladeRedis.setEx(CacheBizConstant.CACHE_CONSIGN_CONFIG, list, CacheBizConstant.CACHE_TIME);
 		}

+ 2 - 0
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java

@@ -251,6 +251,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 				detail.set("isCard", query.getIdCard());
 				detail.set("negativeUrl", query.getNegativeUrl());
 				detail.set("positiveUrl", query.getPositiveUrl());
+				//是否用于预收款付款、特殊账号
+				detail.set("enableAuth", query.getEnableAuth());
 			}
 		} else {
 			UserOther userOther = new UserOther();

+ 10 - 0
src/main/java/sql/platformauthorization.menu.mysql

@@ -0,0 +1,10 @@
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1512797837204467718', 1123598815738675201, 'platformauthorization', '平台授权表', 'menu', '/platform/platformauthorization', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1512797837204467719', '1512797837204467718', 'platformauthorization_add', '新增', 'add', '/platform/platformauthorization/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1512797837204467720', '1512797837204467718', 'platformauthorization_edit', '修改', 'edit', '/platform/platformauthorization/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1512797837204467721', '1512797837204467718', 'platformauthorization_delete', '删除', 'delete', '/api/platform/platformauthorization/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1512797837204467722', '1512797837204467718', 'platformauthorization_view', '查看', 'view', '/platform/platformauthorization/view', 'file-text', 4, 2, 2, 1, NULL, 0);

+ 1 - 0
src/main/resources/application.yml

@@ -192,6 +192,7 @@ blade:
       - /v1/aliPay/sdk/auth_notify_url # 预授权拦截
       - /v1/aliPay/sdk/trade_notify_url # 支付回调
       - /v1/aliPay/sdk/order_notify_url # 支付回调
+      - /v1/aliPay/sdk/platform_authorization_notify_url
       - /v1/versionUpgrade
     #授权认证配置
     auth: