All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.mingsoft.pay.action.PayLogAction Maven / Gradle / Ivy

There is a newer version: 2.2.5
Show newest version
/**
 * Copyright (c) 2012-present 铭软科技(mingsoft.net)
 * 本软件及相关文档文件(以下简称“软件”)的版权归 铭软科技 所有
 * 遵循 铭软科技《服务协议》中的《保密条款》
 */

package net.mingsoft.pay.action;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.BaseEntity;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.annotation.LogAnn;
import net.mingsoft.basic.bean.EUListBean;
import net.mingsoft.basic.constant.e.BusinessTypeEnum;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.pay.bean.PayLogBean;
import net.mingsoft.pay.biz.IPayLogBiz;
import net.mingsoft.pay.entity.PayLogEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 交易记录管理控制层
 * @author 铭飞团队
 * @version
 * 版本号:100
* 创建日期:2018-2-9 13:32:03
* 历史修订:
*/ @Api(tags = {"后端-支付模块接口"}) @Controller("managerPayLogAction") @RequestMapping("/${ms.manager.path}/mpay/payLog") public class PayLogAction extends net.mingsoft.pay.action.BaseAction{ /** * 注入交易记录业务层 */ @Autowired private IPayLogBiz logBiz; /** * 返回主界面index */ @ApiIgnore @GetMapping("/index") public String index(HttpServletResponse response,HttpServletRequest request){ request.setAttribute("peopleId", BasicUtil.getString("peopleId")); return "/pay/log/index"; } /** * 查询交易记录列表 * @param log 交易记录实体 * log参数包含字段信息参考:
* id 自增长ID
* peopleId 用户id
* orderNo 订单id
* appId 应用ID
* logTitle 交易标题
* logBalance 用户当前余额
* logMoney 用户交易额
* logRemainBalance 用户交易后剩余余额
* logDate 交易时间
* logType 交易类型,1=支出,2=收入
* logPayType 支付类型
* createBy 创建人编号
* createDate 创建时间
* updateBy 更新人员编号
* updateDate 更新时间
* del 删除标记
*
返回

*
[
* {
* id: 自增长ID
* peopleId: 用户id
* orderNo: 订单id
* appId: 应用ID
* logTitle: 交易标题
* logBalance: 用户当前余额
* logMoney: 用户交易额
* logRemainBalance: 用户交易后剩余余额
* logDate: 交易时间
* logType: 交易类型,1=支出,2=收入
* logPayType: 支付类型
* createBy: 创建人编号
* createDate: 创建时间
* updateBy: 更新人员编号
* updateDate: 更新时间
* del: 删除标记
* }
* ]

*/ @ApiOperation(value="支付交易日志列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "peopleId", value = "用户编号", required =false,paramType="query"), @ApiImplicitParam(name = "orderNo", value = "订单编号", required = false,paramType="query"), @ApiImplicitParam(name = "appId", value = "应用编号", required = false,paramType="query"), @ApiImplicitParam(name = "logTitle", value = "交易标题", required = false,paramType="query"), @ApiImplicitParam(name = "logStatus", value = "交易状态:1=待付款,2=未付款,5=交易关闭", required = false,paramType="query"), @ApiImplicitParam(name = "logTransactionId", value = "交易流水号,第三方平台返回", required =false,paramType="query"), @ApiImplicitParam(name = "logBalance", value = "用户当前余额", required = false,paramType="query"), @ApiImplicitParam(name = "logMoney", value = "用户交易额", required = false,paramType="query"), @ApiImplicitParam(name = "logRemainBalance", value = "用户交易后剩余余额", required = false,paramType="query"), @ApiImplicitParam(name = "logDate", value = "交易时间", required = false,paramType="query"), @ApiImplicitParam(name = "logType", value = "交易类型,1=支出,2=收入", required =false,paramType="query"), @ApiImplicitParam(name = "logPayType", value = "支付类型", required =false,paramType="query"), @ApiImplicitParam(name = "createBy", value = "创建人编号", required = false,paramType="query"), @ApiImplicitParam(name = "createDate", value = "创建时间", required = false,paramType="query"), @ApiImplicitParam(name = "updateBy", value = "更新人员编号", required = false,paramType="query"), @ApiImplicitParam(name = "updateDate", value = "更新时间", required = false,paramType="query"), }) @GetMapping("/list") @ResponseBody public ResultData list(@ModelAttribute @ApiIgnore PayLogEntity log, HttpServletResponse response, HttpServletRequest request, ModelMap model, BindingResult result) { BasicUtil.startPage(); List logList = logBiz.queryForPayLogBean(log); return ResultData.build().success(new EUListBean(logList,(int)BasicUtil.endPage(logList).getTotal())); } /** * 返回编辑界面log_form */ @ApiIgnore @ApiOperation(value="编辑界面") @ApiImplicitParam(name = "id", value = "日志编号", required =true,paramType="query") @GetMapping("/form") public String form(@ModelAttribute @ApiIgnore PayLogEntity log,HttpServletResponse response,HttpServletRequest request,ModelMap model){ if(log.getId()!=null){ BaseEntity logEntity = logBiz.getEntity(Integer.parseInt(log.getId())); model.addAttribute("logEntity",logEntity); } return "/pay/log/form"; } /** * 获取交易记录 * @param log 交易记录实体 * log参数包含字段信息参考:
* id 自增长ID
* peopleId 用户id
* orderNo 订单id
* appId 应用ID
* logTitle 交易标题
* logBalance 用户当前余额
* logMoney 用户交易额
* logRemainBalance 用户交易后剩余余额
* logDate 交易时间
* logType 交易类型,1=支出,2=收入
* logPayType 支付类型
* createBy 创建人编号
* createDate 创建时间
* updateBy 更新人员编号
* updateDate 更新时间
* del 删除标记
*
返回

*
{
* id: 自增长ID
* peopleId: 用户id
* orderNo: 订单id
* appId: 应用ID
* logTitle: 交易标题
* logBalance: 用户当前余额
* logMoney: 用户交易额
* logRemainBalance: 用户交易后剩余余额
* logDate: 交易时间
* logType: 交易类型,1=支出,2=收入
* logPayType: 支付类型
* createBy: 创建人编号
* createDate: 创建时间
* updateBy: 更新人员编号
* updateDate: 更新时间
* del: 删除标记
* }

*/ @ApiOperation(value="支付日志详情") @ApiImplicitParam(name = "id", value = "日志编号", required =true,paramType="query") @GetMapping("/get") @ResponseBody public ResultData get(@ModelAttribute @ApiIgnore PayLogEntity log,HttpServletResponse response, HttpServletRequest request,ModelMap model){ if(log.getId()!=null) { return ResultData.build().error(getResString("err.error", this.getResString("id"))); } PayLogEntity _log = (PayLogEntity)logBiz.getEntity(Integer.parseInt(log.getId())); return ResultData.build().success(_log); } /** * @param log 交易记录实体 * log参数包含字段信息参考:
* id:多个id直接用逗号隔开,例如id=1,2,3,4 * 批量删除交易记录 *
返回

*
{code:"错误编码",
* result:"true|false",
* resultMsg:"错误信息"
* }
*/ @ApiOperation(value="支付日志删除") @LogAnn(title = "支付日志删除",businessType= BusinessTypeEnum.DELETE) @PostMapping("/delete") @ResponseBody @RequiresPermissions("ms:payLog:del") public ResultData delete(@RequestBody List logs,HttpServletResponse response, HttpServletRequest request) { int[] ids = new int[logs.size()]; for(int i = 0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy