parent
1e4bc50ed8
commit
6643157050
@ -0,0 +1,63 @@
|
|||||||
|
package com.smart.module.pay.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.smart.common.model.PageBean;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付配置
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "app_pay_config") // 指定数据库表名
|
||||||
|
public class AppPayConfig extends PageBean implements Serializable {
|
||||||
|
|
||||||
|
// 实体类属性与数据库表字段一一对应
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id", nullable = false, length = 20) // 使用@Column注解指定对应的数据库字段名
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停车场
|
||||||
|
*/
|
||||||
|
@Column(name = "car_park_id")
|
||||||
|
private Long carParkId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户号
|
||||||
|
*/
|
||||||
|
@Column(name = "mch_id ", length = 500)
|
||||||
|
private String mchId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 秘钥
|
||||||
|
*/
|
||||||
|
@Column(name = "secret_key", length = 500)
|
||||||
|
private String secretKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "gmt_create")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Timestamp gmtCreate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Column(name = "gmt_modified")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Timestamp gmtModified;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户id
|
||||||
|
*/
|
||||||
|
@Column(name = "user_id_create")
|
||||||
|
private Long userIdCreate;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.smart.module.pay.repository;
|
||||||
|
|
||||||
|
import com.smart.module.pay.entity.AppPayConfig;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付配置数据访问层接口
|
||||||
|
*/
|
||||||
|
@Repository//提供了基本的CRUD
|
||||||
|
public interface PayConfigRepository extends JpaRepository<AppPayConfig, Long> {
|
||||||
|
|
||||||
|
AppPayConfig findByCarParkId(Long carParkId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.smart.module.pay.service;
|
||||||
|
|
||||||
|
import com.smart.common.model.Result;
|
||||||
|
import com.smart.module.pay.entity.AppPayConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付配置
|
||||||
|
*/
|
||||||
|
public interface PayConfigService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存支付配置
|
||||||
|
* @param entity 支付配置实体对象
|
||||||
|
* @return 保存结果
|
||||||
|
*/
|
||||||
|
Result save(AppPayConfig entity);
|
||||||
|
|
||||||
|
}
|
@ -1,82 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
||||||
<head th:replace="common/head :: head(links)"/>
|
|
||||||
<body>
|
|
||||||
<div class="ok-body" id="app" v-cloak>
|
|
||||||
<template>
|
|
||||||
<i-form label-colon ref="checkForm" :model="entity" :rules="ruleValidate" :label-width="140">
|
|
||||||
<form-item prop="mchId" label="支付申请">
|
|
||||||
https://dwz.cn/mPQmSPss
|
|
||||||
</form-item>
|
|
||||||
|
|
||||||
<form-item prop="mchId" label="商户号">
|
|
||||||
<i-input maxlength="20" v-model="entity.mchId" placeholder="请输入商户号"></i-input>
|
|
||||||
</form-item>
|
|
||||||
|
|
||||||
<form-item prop="secretKey" label="秘钥">
|
|
||||||
<i-input v-model="entity.secretKey" placeholder="请输秘钥"></i-input>
|
|
||||||
</form-item>
|
|
||||||
</i-form>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div th:replace="common/foot :: foot(script)"></div>
|
|
||||||
<script th:inline="none">
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#app',
|
|
||||||
data:{
|
|
||||||
entity:{
|
|
||||||
|
|
||||||
},
|
|
||||||
ruleValidate : {
|
|
||||||
mchId: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
secretKey: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
okUtils:null,
|
|
||||||
okLayer:null
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
load : function(){
|
|
||||||
layui.use(["okUtils", "okLayer"], function () {
|
|
||||||
vm.okUtils = layui.okUtils;
|
|
||||||
vm.okLayer = layui.okLayer;
|
|
||||||
if(vm.entity.carParkId!=undefined){
|
|
||||||
vm.okUtils.ajaxCloud({
|
|
||||||
url:"/pay/config/getByCarParkId",
|
|
||||||
param : {carParkId:vm.entity.carParkId},
|
|
||||||
close : false,
|
|
||||||
success : function(result) {
|
|
||||||
if(result.msg!=null){
|
|
||||||
vm.entity = result.msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
acceptClick : function(dialog){
|
|
||||||
vm.$refs.checkForm.validate(function(valid){
|
|
||||||
if (valid) {
|
|
||||||
vm.okUtils.ajaxCloud({
|
|
||||||
url:"/pay/config/save",
|
|
||||||
param : vm.entity,
|
|
||||||
json:true,
|
|
||||||
success : function(result) {
|
|
||||||
vm.okLayer.msg.greenTick(result.msg)
|
|
||||||
dialog.load();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
created: function() {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in new issue