fix: 修复bug
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
index 048cbb1..b310480 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
@@ -2,6 +2,7 @@
import javax.persistence.*;
import javax.validation.constraints.NotNull;
+import java.io.Serializable;
/**
* Created by shuwei on 2019/4/9.
@@ -9,7 +10,7 @@
@Entity
@Table(name = "TB_PAYTYPE_CONFIG")
@IdClass(TPaytypeConfigPK.class)
-public class TPaytypeConfig {
+public class TPaytypeConfig implements Serializable {
@Id
@Column(name = "PAYTYPE", nullable = false, length = 20)
private String paytype;
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TBusinesspara.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TBusinesspara.java
index 9b38245..a1e1209 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TBusinesspara.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/domain/TBusinesspara.java
@@ -43,4 +43,12 @@
public void setParaval(String paraval) {
this.paraval = paraval;
}
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java b/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
index f7f69bb..b85095a 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
@@ -160,7 +160,7 @@
public String shopConfigView(Model model) {
// model.addAttribute("paytypelist", shopDataService.getConsumePaytypes());
model.addAttribute(Dictionary.PAY_TYPE,
- dictionaryProxy.<TSourceType>getDictionaryObject(Dictionary.SOURCE_TYPE));
+ dictionaryProxy.<TSourceType>getDictionaryAsList(Dictionary.SOURCE_TYPE));
return "system/shop/config";
}
@@ -195,7 +195,7 @@
@RequestParam("state") String state, @RequestParam("optype") String optype) {
if (StringUtil.isEmpty(shopaccno) || StringUtil.isEmpty(paytype)
|| (!ConstantUtil.ENABLE_NO.equals(state) && !ConstantUtil.ENABLE_YES.equals(state))
- || (!"consume".equals(optype) && !"anonymous".equals(optype) && !"refund".equals(optype))) {
+ || (!"consume".equals(optype) && !"anonymous".equals(optype) && !"reverse".equals(optype))) {
return JsonResult.error("参数传递错误");
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/OperatorServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/OperatorServiceImpl.java
index 73ce52b..0842e66 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/OperatorServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/OperatorServiceImpl.java
@@ -81,11 +81,13 @@
operator.setTenantId(TenantContext.getTenantSchema());
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
operator.setOperpwd(encoder.encode(WebConstant.OPERPWD_DEFAULT));
+ operator.setTenantId(TenantContext.getTenantSchema());
operator = operatorDao.save(operator);
for (String role : roleids) {
TOperRole operRole = new TOperRole();
operRole.setOperid(operator.getOperid());
operRole.setRoleId(role);
+ operRole.setTenantId(operator.getTenantId());
operRoleDao.save(operRole);
}
} else {
@@ -107,6 +109,7 @@
TOperRole operRole = new TOperRole();
operRole.setOperid(op.getOperid());
operRole.setRoleId(role);
+ operRole.setTenantId(op.getTenantId());
operRoleDao.save(operRole);
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
index 4fe84f7..a40d97d 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
@@ -10,6 +10,7 @@
import com.supwisdom.dlpay.framework.domain.TApiClient;
import com.supwisdom.dlpay.framework.domain.TBusinesspara;
import com.supwisdom.dlpay.framework.domain.TSyspara;
+import com.supwisdom.dlpay.framework.tenant.TenantContext;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.system.service.ParamService;
@@ -24,6 +25,7 @@
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
+import sun.net.TelnetInputStream;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
@@ -110,6 +112,7 @@
@Override
public boolean saveOrUpdateBusinesspara(TBusinesspara businesspara) {
if (null != businesspara) {
+ businesspara.setTenantId(TenantContext.getTenantSchema());
businessparaDao.save(businesspara);
return true;
}
@@ -207,7 +210,7 @@
}
@Override
- @Cacheable(cacheNames = "source_type_config_cache", key = "#p0")
+ @CacheEvict(cacheNames = "source_type_config_cache", key = "#p0")
public boolean saveSourceTypeConfig(String paytype, Map<String, String> param) throws WebCheckException {
TSourceType tPaytype = getSourceType(paytype);
if (null == tPaytype) throw new WebCheckException("支付能力[" + paytype + "]不存在");
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/RoleServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/RoleServiceImpl.java
index 66acac4..88178c8 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/RoleServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/RoleServiceImpl.java
@@ -136,11 +136,13 @@
TPermission permission = new TPermission();
permission.setResid(Integer.valueOf(id));
permission.setRoleId(roleId);
+ permission.setTenantId(TenantContext.getTenantSchema());
permissionDao.save(permission);
} else {
TRoleFunction roleFunction = new TRoleFunction();
roleFunction.setFunctionId(Integer.valueOf(func));
roleFunction.setRoleId(roleId);
+ roleFunction.setTenantId(TenantContext.getTenantSchema());
roleFunctionDao.save(roleFunction);
}
}
diff --git a/src/main/resources/templates/system/dtl/shopdtl.html b/src/main/resources/templates/system/dtl/shopdtl.html
index 536b7d9..92e7f60 100644
--- a/src/main/resources/templates/system/dtl/shopdtl.html
+++ b/src/main/resources/templates/system/dtl/shopdtl.html
@@ -12,7 +12,8 @@
<div class="layui-inline">
<label class="layui-form-label">记账日期</label>
<div class="layui-input-inline" style="width: 120px;">
- <input type="text" name="startAccdate" id="shopdtl-search-startAccdate" placeholder="开始日期"
+ <input type="text" name="startAccdate" id="shopdtl-search-startAccdate"
+ placeholder="开始日期"
autocomplete="off" class="layui-input"/>
</div>
<div class="layui-form-mid">-</div>
@@ -36,7 +37,7 @@
<div class="layui-input-block">
<select name="sourcetype" id="shopdtl-search-sourcetype" class="layui-select">
<option value=""> 全部</option>
- <option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
+ <option th:each="pt:${paytypeList}" th:value="${pt.sourceType}"
th:text="${pt.paydesc}"></option>
</select> 
</div>
@@ -47,7 +48,7 @@
<div class="layui-input-block">
<select name="transStatus" id="shopdtl-search-transStatus" class="layui-select">
<option value=""> 全部</option>
- <option th:each="st:${dtlstatuslist}" th:value="${st.dictval}"
+ <option th:each="st:${dtlStatusList}" th:value="${st.dictval}"
th:text="${st.dictcaption}"></option>
</select> 
</div>
@@ -58,12 +59,14 @@
<div class="layui-inline">
<label class="layui-form-label">交易日期</label>
<div class="layui-input-inline" style="width: 120px;">
- <input type="text" name="startTransdate" id="shopdtl-search-startTransdate" placeholder="开始日期"
+ <input type="text" name="startTransdate" id="shopdtl-search-startTransdate"
+ placeholder="开始日期"
autocomplete="off" class="layui-input"/>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline" style="width: 120px;">
- <input type="text" name="endTransdate" id="shopdtl-search-endTransdate" placeholder="结束日期"
+ <input type="text" name="endTransdate" id="shopdtl-search-endTransdate"
+ placeholder="结束日期"
autocomplete="off" class="layui-input"/>
</div>
</div>
@@ -71,7 +74,8 @@
<div class="layui-inline">
<label class="layui-form-label">选择商户</label>
<div class="layui-input-block">
- <input type="text" name="shopaccno" id="shopdtl-search-shopaccno" placeholder="选择商户" lay-filter="shopdtl-search-shopaccno-filter"
+ <input type="text" name="shopaccno" id="shopdtl-search-shopaccno" placeholder="选择商户"
+ lay-filter="shopdtl-search-shopaccno-filter"
autocomplete="off" class="layui-input"/>
</div>
</div>
@@ -92,7 +96,7 @@
<div class="layui-input-block">
<select name="transcode" id="shopdtl-search-transcode" class="layui-select">
<option value=""> 全部</option>
- <option th:each="tc:${transcodelist}" th:value="${tc.transcode}"
+ <option th:each="tc:${transcodeList}" th:value="${tc.transcode}"
th:text="${tc.transname}"></option>
</select>
</div>
@@ -155,8 +159,8 @@
click: function (d) {
var treeNode = d.current;
console.log(treeNode);
- if(undefined == treeNode.accno || null == treeNode.accno){
- layer.msg("请选择结算商户", {icon: 2, time:1500});
+ if (undefined == treeNode.accno || null == treeNode.accno) {
+ layer.msg("请选择结算商户", {icon: 2, time: 1500});
$("#shopdtl-search-shopaccno").val("");
treeSelect.revokeNode('shopdtl-search-shopaccno-filter');
return false;
@@ -216,25 +220,33 @@
{field: 'shopname', title: '商户名称', align: 'center', width: 250},
{field: 'amount', title: '交易金额', align: 'center', width: 120, sort: true},
{
- field: 'transStatus', title: '状态', align: 'center', width: 90, templet: function (item) {
- if (item.transStatus == 'init') {
+ field: 'transStatus',
+ title: '状态',
+ align: 'center',
+ width: 90,
+ templet: function (item) {
+ if (item.status === 'init') {
return '<span class="layui-badge layui-bg-gray">初始化</span>';
- } else if (item.transStatus == 'success') {
+ } else if (item.status === 'success') {
return '<span class="layui-badge layui-bg-green">成功</span>';
- } else if (item.transStatus == 'fail') {
+ } else if (item.status === 'fail') {
return '<span class="layui-badge">失败</span>';
- } else if (item.transStatus == 'wip') {
+ } else if (item.status === 'wip') {
return '<span class="layui-badge layui-bg-orange">待支付</span>';
} else {
- return item.transStatus;
+ return item.status;
}
}
},
{
- field: 'tradeflag', title: '类型', align: 'center', width: 60, templet: function (item) {
- if (item.tradeflag == 'in') {
+ field: 'tradeflag',
+ title: '类型',
+ align: 'center',
+ width: 60,
+ templet: function (item) {
+ if (item.tradeflag === 'in') {
return '<span style="color: green;">收入</span>';
- } else if (item.tradeflag == 'out') {
+ } else if (item.tradeflag === 'out') {
return '<span style="color: red;">支出</span>';
} else {
return item.tradeflag;
@@ -250,12 +262,16 @@
width: 130,
sort: true,
templet: function (item) {
- return getTempDictValue('allSourcetypeList', item.sourceType);
+ return getTempDictValue('sourcetypeList', item.sourceType);
}
},
{
- field: 'reverseFlag', title: '冲正状态', align: 'center', width: 100, templet: function (item) {
- return getTempDictValue('allReverseflagList', item.reverseFlag);
+ field: 'reverseFlag',
+ title: '冲正状态',
+ align: 'center',
+ width: 100,
+ templet: function (item) {
+ return getTempDictValue('reverseFlagList', item.reverseFlag);
}
},
{field: 'oppositeAccName', title: '交易对象', align: 'center', width: 150},
diff --git a/src/main/resources/templates/system/shop/config.html b/src/main/resources/templates/system/shop/config.html
index 38f6b8a..b80ec4f 100644
--- a/src/main/resources/templates/system/shop/config.html
+++ b/src/main/resources/templates/system/shop/config.html
@@ -93,13 +93,12 @@
$.fn.zTree.init($("#shopacctree"), menuSetting, nodes);
}
admin.dgo('[[@{/shop/shopacctree}]]', {}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
initTree(data.data);
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2, time: 2000});
}
@@ -118,7 +117,7 @@
});
function ondblclick(event, treeId, treeNode) {
- if (treeNode.shoptype != 1 || ""==treeNode.shopaccno) {
+ if (treeNode.shoptype !== 1 || ""===treeNode.shopaccno) {
layer.msg("请选择结算商户查询", {icon: 2, time: 1000});
return;
}
@@ -162,7 +161,7 @@
sort: true
},
{align: 'center', title: '操作', width: 90, fixed: 'right', templet: function (item) {
- if (item.paytype != 'balance') {
+ if (item.paytype !== 'balance') {
return '<a class="layui-btn layui-btn-xs" lay-event="config">配置</a>';
}
return '<span style="font-size: 12px;color: #D3D4D3;">无配置</span>';
@@ -182,14 +181,13 @@
state: obj.elem.checked ? 'yes' : 'no',
_csrf: token
}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1, time:1000});
table.reload('shopPaytypeTable');
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2});
$(obj.elem).prop('checked', !obj.elem.checked);
@@ -220,13 +218,12 @@
optype: optype,
_csrf: token
}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1, time: 1000});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2});
$(obj.elem).prop('checked', !obj.elem.checked);
@@ -242,12 +239,12 @@
$('#btn-add-shoppaytype').click(function () {
var ztree = $.fn.zTree.getZTreeObj("shopacctree");
var shopNodes = ztree.getSelectedNodes();
- if (undefined == shopNodes || null == shopNodes || shopNodes.length < 1) {
+ if (undefined === shopNodes || null == shopNodes || shopNodes.length < 1) {
layer.msg("请先选中左侧的一个结算商户", {icon: 2, time: 1000});
return;
}
var shopNode = shopNodes[0]; //选中商户
- if(shopNode.shoptype!=1 || ""==shopNode.shopaccno){
+ if(shopNode.shoptype!==1 || ""===shopNode.shopaccno){
layer.msg("请选择结算商户!", {icon: 2, time: 1000});
return;
}
@@ -270,7 +267,7 @@
//监听单元格
table.on('tool(shopPaytypeTable-filter)', function (obj) {
var data = obj.data;
- if ('config' == obj.event) {
+ if ('config' === obj.event) {
admin.popupCenter({
title: "配置参数【" + data.shopname + "_" + data.paydesc + "】",
path: '[[@{/shop/load4paytypepara}]]?shopaccno=' + data.shopaccno + '&paytype=' + data.paytype,
diff --git a/src/main/resources/templates/system/user/index.html b/src/main/resources/templates/system/user/index.html
index c035a36..dc009c7 100644
--- a/src/main/resources/templates/system/user/index.html
+++ b/src/main/resources/templates/system/user/index.html
@@ -32,21 +32,21 @@
[
{field: 'name', title: '名称', width: 80,fixed: 'left', sort: true},
{field: 'sex', title: '性别',fixed: 'left', width: 80, templet: function (item) {
- if (item.sex == 'male') {
+ if (item.sex === 'male') {
return '男'
- } else if (item.sex == 'female') {
+ } else if (item.sex === 'female') {
return '女'
} else {
return '男'
}
}
},
- {field: 'transStatus', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
- if (item.transStatus == 'normal') {
+ {field: 'status', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
+ if (item.status === 'normal') {
return '<span class="layui-badge layui-bg-green">正常</span>'
- } else if (item.transStatus == 'closed') {
+ } else if (item.status === 'closed') {
return '<span class="layui-badge">注销</span>'
- } else if (item.transStatus == 'locked') {
+ } else if (item.status === 'locked') {
return '<span class="layui-badge layui-bg-orange">锁定</span>'
} else {
return '异常'
@@ -54,15 +54,15 @@
}
},
{field: 'idtype', align: 'center',width: 100, title: '证件类型', fixed: 'left', templet: function (item) {
- if (item.idtype == '1') {
+ if (item.idtype === '1') {
return '身份证'
- } else if (item.idtype == '2') {
+ } else if (item.idtype === '2') {
return '护照'
- } else if (item.idtype == '3') {
+ } else if (item.idtype === '3') {
return '驾照'
- } else if (item.idtype == '4') {
+ } else if (item.idtype === '4') {
return '港澳通行证'
- } else if (item.idtype == '5') {
+ } else if (item.idtype === '5') {
return '学工号'
} else {
return '其他'
@@ -128,9 +128,9 @@
}, function (data) {
console.log(data.code);
layer.closeAll('loading');
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
@@ -142,7 +142,7 @@
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
- if(ret.transStatus==403){
+ if(ret.transStatus===403){
layer.msg('没有权限', {icon: 2});
}else{
layer.msg('请求失败了,请稍后再试', {icon: 2});