瀏覽代碼

系统设置-支付接口设置

WIN-B904R0U0NNS\Administrator 2 年之前
父節點
當前提交
e267f207eb

+ 227 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusPayInterfaceConfigController.java

@@ -0,0 +1,227 @@
+package org.jeecg.modules.business.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TokenUtils;
+import org.jeecg.common.util.oConvertUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.business.entity.BusParamXcxRoom;
+import org.jeecg.modules.business.entity.BusPayInterfaceConfig;
+import org.jeecg.modules.business.entity.BusWaiter;
+import org.jeecg.modules.business.service.IBusPayInterfaceConfigService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 支付接口配置
+ * @Author: jeecg-boot
+ * @Date:   2023-03-11
+ * @Version: V1.0
+ */
+@Api(tags="支付接口配置")
+@RestController
+@RequestMapping("/business/busPayInterfaceConfig")
+@Slf4j
+public class BusPayInterfaceConfigController extends JeecgController<BusPayInterfaceConfig, IBusPayInterfaceConfigService> {
+	@Autowired
+	private IBusPayInterfaceConfigService busPayInterfaceConfigService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param busPayInterfaceConfig
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "支付接口配置-分页列表查询")
+	@ApiOperation(value="支付接口配置-分页列表查询", notes="支付接口配置-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BusPayInterfaceConfig>> queryPageList(BusPayInterfaceConfig busPayInterfaceConfig,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<BusPayInterfaceConfig> queryWrapper = QueryGenerator.initQueryWrapper(busPayInterfaceConfig, req.getParameterMap());
+		Page<BusPayInterfaceConfig> page = new Page<BusPayInterfaceConfig>(pageNo, pageSize);
+		IPage<BusPayInterfaceConfig> pageList = busPayInterfaceConfigService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	 /**
+	  * 通过hotelId查询
+	  *
+	  * @param hotelId
+	  * @return
+	  */
+	 //@AutoLog(value = "支付接口配置-通过hotelId查询")
+	 @ApiOperation(value="支付接口配置-通过hotelId查询", notes="支付接口配置-通过hotelId查询")
+	 @GetMapping(value = "/queryByHotelId")
+	 public Result<BusPayInterfaceConfig> queryByHotelId(@RequestParam(name="hotelId",required=true) String hotelId) {
+		 QueryWrapper<BusPayInterfaceConfig> queryWrapper = new QueryWrapper<BusPayInterfaceConfig>();
+		 queryWrapper.eq("hotel_id", hotelId);
+		 BusPayInterfaceConfig resultModel = busPayInterfaceConfigService.getOne(queryWrapper);
+		 if(resultModel==null) {
+			 return Result.error("");
+		 }
+		 return Result.OK(resultModel);
+	 }
+
+	/**
+	 *   添加
+	 *
+	 * @param busPayInterfaceConfig
+	 * @return
+	 */
+	@AutoLog(value = "支付接口配置-添加")
+	@ApiOperation(value="支付接口配置-添加", notes="支付接口配置-添加")
+	//@RequiresPermissions("business:bus_pay_interface_config_info:add")
+	@PostMapping(value = "/add")
+	public Result<BusPayInterfaceConfig> add(@RequestBody BusPayInterfaceConfig busPayInterfaceConfig) {
+		busPayInterfaceConfig.setDelFlag(CommonConstant.DEL_FLAG_0);
+		if(busPayInterfaceConfig.getTenantId() == null || busPayInterfaceConfig.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busPayInterfaceConfig.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		busPayInterfaceConfigService.save(busPayInterfaceConfig);
+		return Result.OK(busPayInterfaceConfig);
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param busPayInterfaceConfig
+	 * @return
+	 */
+	@AutoLog(value = "支付接口配置-编辑")
+	@ApiOperation(value="支付接口配置-编辑", notes="支付接口配置-编辑")
+	//@RequiresPermissions("business:bus_pay_interface_config_info:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<BusPayInterfaceConfig> edit(@RequestBody BusPayInterfaceConfig busPayInterfaceConfig) {
+		if(busPayInterfaceConfig.getTenantId() == null || busPayInterfaceConfig.getTenantId().equals("")){
+			LoginUser user = TokenUtils.getAuthUser();
+			if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+				busPayInterfaceConfig.setTenantId(user.getRelTenantIds());
+			} else {
+				throw new JeecgBootException("当前登录人租户信息错误");
+			}
+		}
+		BusPayInterfaceConfig editModel = busPayInterfaceConfigService.getById(busPayInterfaceConfig.getId());
+		editModel.setPayTypeId(busPayInterfaceConfig.getPayTypeId());
+		editModel.setStatus(busPayInterfaceConfig.getStatus());
+		editModel.setMerchantNo(busPayInterfaceConfig.getMerchantNo());
+		editModel.setTerminalNo(busPayInterfaceConfig.getTerminalNo());
+		editModel.setToken(busPayInterfaceConfig.getToken());
+		busPayInterfaceConfigService.updateById(editModel);
+//		busPayInterfaceConfigService.updateById(busPayInterfaceConfig);
+		return Result.OK(editModel);
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "支付接口配置-通过id删除")
+	@ApiOperation(value="支付接口配置-通过id删除", notes="支付接口配置-通过id删除")
+	//@RequiresPermissions("business:bus_pay_interface_config_info:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		busPayInterfaceConfigService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "支付接口配置-批量删除")
+	@ApiOperation(value="支付接口配置-批量删除", notes="支付接口配置-批量删除")
+	//@RequiresPermissions("business:bus_pay_interface_config_info:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.busPayInterfaceConfigService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "支付接口配置-通过id查询")
+	@ApiOperation(value="支付接口配置-通过id查询", notes="支付接口配置-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BusPayInterfaceConfig> queryById(@RequestParam(name="id",required=true) String id) {
+		BusPayInterfaceConfig busPayInterfaceConfig = busPayInterfaceConfigService.getById(id);
+		if(busPayInterfaceConfig==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(busPayInterfaceConfig);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param busPayInterfaceConfig
+    */
+    //@RequiresPermissions("business:bus_pay_interface_config_info:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BusPayInterfaceConfig busPayInterfaceConfig) {
+        return super.exportXls(request, busPayInterfaceConfig, BusPayInterfaceConfig.class, "支付接口配置");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("business:bus_pay_interface_config_info:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BusPayInterfaceConfig.class);
+    }
+
+}

+ 42 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusRoomPayTypeController.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
 import org.jeecg.modules.business.entity.BusHotel;
+import org.jeecg.modules.business.entity.BusParamXcxRoom;
 import org.jeecg.modules.business.entity.BusRoomPayType;
 import org.jeecg.modules.business.entity.BusSalesPerson;
 import org.jeecg.modules.business.service.IBusHotelService;
@@ -88,6 +89,47 @@ public class BusRoomPayTypeController extends JeecgController<BusRoomPayType, IB
 		return Result.OK(pageList);
 	}
 
+	 /**
+	  * 列表查询
+	  *
+	  * @param busRoomPayType
+	  * @param req
+	  * @return
+	  */
+	 //@AutoLog(value = "支付方式-列表查询")
+	 @ApiOperation(value="支付方式-列表查询", notes="支付方式-列表查询")
+	 @GetMapping(value = "/queryList")
+	 public Result<List<BusRoomPayType>> queryList(BusRoomPayType busRoomPayType, HttpServletRequest req) {
+		 QueryWrapper<BusRoomPayType> queryWrapper = QueryGenerator.initQueryWrapper(busRoomPayType, req.getParameterMap());
+		 LoginUser user = TokenUtils.getAuthUser();
+		 if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
+			 queryWrapper.eq("tenant_id",user.getRelTenantIds());
+		 }
+		 queryWrapper.eq("status",1);
+		 queryWrapper.eq("del_flag",0);
+		 List<BusRoomPayType> list = busRoomPayTypeService.list(queryWrapper);
+		 return Result.OK(list);
+	 }
+
+	 /**
+	  * 通过hotelId查询
+	  *
+	  * @param hotelId
+	  * @return
+	  */
+	 //@AutoLog(value = "支付方式-通过hotelId查询")
+	 @ApiOperation(value="支付方式-通过hotelId查询", notes="支付方式-通过hotelId查询")
+	 @GetMapping(value = "/queryByHotelId")
+	 public Result<BusRoomPayType> queryByHotelId(@RequestParam(name="hotelId",required=true) String hotelId) {
+		 QueryWrapper<BusRoomPayType> queryWrapper = new QueryWrapper<BusRoomPayType>();
+		 queryWrapper.eq("hotel_id", hotelId);
+		 BusRoomPayType resultModel = busRoomPayTypeService.getOne(queryWrapper);
+		 if(resultModel==null) {
+			 return Result.error("");
+		 }
+		 return Result.OK(resultModel);
+	 }
+
 	/**
 	 *   添加
 	 *

+ 88 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusPayInterfaceConfig.java

@@ -0,0 +1,88 @@
+package org.jeecg.modules.business.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 支付接口配置
+ * @Author: jeecg-boot
+ * @Date:   2023-03-11
+ * @Version: V1.0
+ */
+@Data
+@TableName("bus_pay_interface_config_info")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="bus_pay_interface_config_info对象", description="支付接口配置")
+public class BusPayInterfaceConfig implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**关联支付方式*/
+	@Excel(name = "关联支付方式", width = 15)
+    @ApiModelProperty(value = "关联支付方式")
+    private String payTypeId;
+	/**商户号*/
+	@Excel(name = "商户号", width = 15)
+    @ApiModelProperty(value = "商户号")
+    private String merchantNo;
+	/**终端号*/
+	@Excel(name = "终端号", width = 15)
+    @ApiModelProperty(value = "终端号")
+    private String terminalNo;
+	/**TOKEN令牌*/
+	@Excel(name = "TOKEN令牌", width = 15)
+    @ApiModelProperty(value = "TOKEN令牌")
+    private String token;
+	/**状态(0-关闭;1-启用)*/
+	@Excel(name = "状态(0-关闭;1-启用)", width = 15)
+    @ApiModelProperty(value = "状态(0-关闭;1-启用)")
+    private Integer status;
+	/**删除状态(0-正常,1-已删除)*/
+	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
+    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusPayInterfaceConfigMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.business.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusPayInterfaceConfig;
+
+/**
+ * @Description: 支付接口配置
+ * @Author: jeecg-boot
+ * @Date:   2023-03-11
+ * @Version: V1.0
+ */
+public interface BusPayInterfaceConfigMapper extends BaseMapper<BusPayInterfaceConfig> {
+
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusPayInterfaceConfigMapper.xml

@@ -0,0 +1,5 @@
+<?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.jeecg.modules.demo.business.mapper.BusPayInterfaceConfigMapper">
+
+</mapper>

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusPayInterfaceConfigService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.business.entity.BusPayInterfaceConfig;
+
+/**
+ * @Description: 支付接口配置
+ * @Author: jeecg-boot
+ * @Date:   2023-03-11
+ * @Version: V1.0
+ */
+public interface IBusPayInterfaceConfigService extends IService<BusPayInterfaceConfig> {
+
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusPayInterfaceConfigServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.business.service.impl;
+
+import org.jeecg.modules.business.entity.BusPayInterfaceConfig;
+import org.jeecg.modules.business.mapper.BusPayInterfaceConfigMapper;
+import org.jeecg.modules.business.service.IBusPayInterfaceConfigService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 支付接口配置
+ * @Author: jeecg-boot
+ * @Date:   2023-03-11
+ * @Version: V1.0
+ */
+@Service
+public class BusPayInterfaceConfigServiceImpl extends ServiceImpl<BusPayInterfaceConfigMapper, BusPayInterfaceConfig> implements IBusPayInterfaceConfigService {
+
+}