From: Tang Cheng Date: Tue, 2 Jul 2019 10:57:28 +0000 (+0800) Subject: fix: 修复bug X-Git-Tag: 1.0.0^2~122 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=47b55f0bc86095a65bd7a884388841a4e62edbac;p=epayment%2Ffood_payapi.git 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 048cbb14..b3104809 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 @@ package com.supwisdom.dlpay.api.domain; import javax.persistence.*; import javax.validation.constraints.NotNull; +import java.io.Serializable; /** * Created by shuwei on 2019/4/9. @@ -9,7 +10,7 @@ import javax.validation.constraints.NotNull; @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 9b382456..a1e1209c 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 class TBusinesspara { 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 f7f69bbb..b85095ad 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 class ShopController { public String shopConfigView(Model model) { // model.addAttribute("paytypelist", shopDataService.getConsumePaytypes()); model.addAttribute(Dictionary.PAY_TYPE, - dictionaryProxy.getDictionaryObject(Dictionary.SOURCE_TYPE)); + dictionaryProxy.getDictionaryAsList(Dictionary.SOURCE_TYPE)); return "system/shop/config"; } @@ -195,7 +195,7 @@ public class ShopController { @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 73ce52b6..0842e665 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 @@ public class OperatorServiceImpl implements OperatorService { 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 @@ public class OperatorServiceImpl implements OperatorService { 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 4fe84f72..a40d97d5 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.dao.SysparaDao; 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.Pageable; 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 @@ public class ParamServiceImpl implements ParamService { @Override public boolean saveOrUpdateBusinesspara(TBusinesspara businesspara) { if (null != businesspara) { + businesspara.setTenantId(TenantContext.getTenantSchema()); businessparaDao.save(businesspara); return true; } @@ -207,7 +210,7 @@ public class ParamServiceImpl implements ParamService { } @Override - @Cacheable(cacheNames = "source_type_config_cache", key = "#p0") + @CacheEvict(cacheNames = "source_type_config_cache", key = "#p0") public boolean saveSourceTypeConfig(String paytype, Map 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 66acac45..88178c8a 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 @@ public class RoleServiceImpl implements RoleService { 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 536b7d9c..92e7f600 100644 --- a/src/main/resources/templates/system/dtl/shopdtl.html +++ b/src/main/resources/templates/system/dtl/shopdtl.html @@ -12,7 +12,8 @@
-
-
@@ -36,7 +37,7 @@
@@ -47,7 +48,7 @@
@@ -58,12 +59,14 @@
-
-
-
@@ -71,7 +74,8 @@
-
@@ -92,7 +96,7 @@
@@ -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 '初始化'; - } else if (item.transStatus == 'success') { + } else if (item.status === 'success') { return '成功'; - } else if (item.transStatus == 'fail') { + } else if (item.status === 'fail') { return '失败'; - } else if (item.transStatus == 'wip') { + } else if (item.status === 'wip') { return '待支付'; } 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 '收入'; - } else if (item.tradeflag == 'out') { + } else if (item.tradeflag === 'out') { return '支出'; } 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 38f6b8ac..b80ec4fd 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 '配置'; } return '无配置'; @@ -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 c035a36d..dc009c7f 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 '正常' - } else if (item.transStatus == 'closed') { + } else if (item.status === 'closed') { return '注销' - } else if (item.transStatus == 'locked') { + } else if (item.status === 'locked') { return '锁定' } 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});