From 04208acf61f99ef8daf205feb114d68445d974fd Mon Sep 17 00:00:00 2001 From: "java_cuibaocheng@163.com" Date: Mon, 18 Mar 2024 14:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 86 +- .../api/account/AccountController.java | 54 +- .../accountbank/AccountBankController.java | 111 + .../api/agreement/AgreementController.java | 121 + .../systemuser/SystemUserApiontroller.java | 13 +- .../api/wg/WangeGengInvoiceController.java | 81 + .../accountbank/AccountBankAppController.java | 121 + .../api/agreement/AgreementAppController.java | 121 + .../account/AccountResourceController.java | 15 +- .../AccountBankResourceController.java | 121 + .../AccountItemResourceController.java | 59 +- .../AccountRechargeResourceController.java | 6 +- .../AgreementResourceController.java | 121 + .../AccountBankRouteController.java | 42 + .../AccountRechargeRouteController.java | 1 + .../agreement/AgreementRouteController.java | 42 + .../systemuser/SystemUserRouteController.java | 5 +- .../route/wg/WgRouteController.java | 55 + .../dao/accountbank/IAccountBankDao.java | 123 + .../operator/dao/agreement/IAgreementDao.java | 121 + .../pojo/bos/accountbank/AccountBankBO.java | 123 + .../pojo/bos/agreement/AgreementBO.java | 114 + .../pojo/dtos/accountbank/AccountBankDTO.java | 139 + .../AccountRechargePayResultDTO.java | 10 + .../AccountWithdrawalDTO.java | 2 +- .../pojo/dtos/agreement/AgreementDTO.java | 129 + .../pojo/pos/accountbank/AccountBankPO.java | 123 + .../pojo/pos/agreement/AgreementPO.java | 114 + .../pojo/vos/accountbank/AccountBankVO.java | 86 + .../vos/accountitem/AccountItemOrderVO.java | 11 + .../accountrecharge/AccountRechargeVO.java | 10 + .../AccountWithdrawalVO.java | 2 +- .../pojo/vos/agreement/AgreementVO.java | 72 + .../operator/service/UserRegisterService.java | 6 +- .../accountbank/IAccountBankService.java | 189 + .../impl/AccountBankServiceImpl.java | 188 + .../impl/AccountRechargeServiceImpl.java | 42 +- .../service/agreement/IAgreementService.java | 189 + .../agreement/impl/AgreementServiceImpl.java | 176 + .../remote/IRemoteWangGengInvoiceApi.java | 77 + .../remote/IRemoteWangGengInvoiceService.java | 45 + .../operator/service/remote/InvoiceDTO.java | 210 + .../service/remote/InvoiceExamineVO.java | 61 + .../operator/service/remote/OrderDTO.java | 97 + .../RemoteWangGengInvoiceSerivceImpl.java | 66 + .../tenlion/operator/util/EncryptUtil.java | 23 +- .../tenlion/operator/util/pay/PayUtil.java | 80 +- .../util/socket/MessageWebSocketServer.java | 100 + .../operator/util/socket/SocketSession.java | 27 + .../operator/util/socket/WebSocketConfig.java | 19 + .../util/task/WxPayResultCheckTask.java | 16 +- src/main/resources/application-lanproxy.yml | 240 + src/main/resources/application-test.yml | 21 + .../accountbank/account-bank-mapper.xml | 374 + .../accountitem/account-item-mapper.xml | 2 +- .../account-recharge-mapper.xml | 4 +- .../mapper/agreement/agreement-mapper.xml | 344 + .../js/vendor/wangEditor/jquery-1.7.2.js | 9404 ++++++ .../js/vendor/wangEditor/v4/wangEditor.css | 27 + .../js/vendor/wangEditor/v4/wangEditor.min.js | 24129 ++++++++++++++++ .../wangEditor-fullscreen-plugin.js | 125 +- .../wangEditor-fullscreen-plugin4.js | 52 + .../js/vendor/wangEditor/wangEditor4.js | 16 + .../resources/templates/account/bank.html | 21 +- .../resources/templates/account/list.html | 9 +- .../resources/templates/accountbank/list.html | 278 + .../resources/templates/accountbank/save.html | 191 + .../templates/accountbank/update.html | 208 + .../templates/accountrecharge/pay.html | 56 +- .../accountrecharge/save-account.html | 6 +- .../templates/accountrecharge/update.html | 4 +- .../templates/accountwithdrawal/data.html | 2 +- .../accountwithdrawal/save-account.html | 2 +- .../templates/accountwithdrawal/save.html | 2 +- .../templates/accountwithdrawal/update.html | 4 +- .../templates/accountwithdrawal/upload.html | 2 +- .../resources/templates/agentcheck/audit.html | 75 +- .../templates/agentcheck/list-check.html | 86 +- .../resources/templates/agentcheck/list.html | 2 +- .../resources/templates/agentcheck/show.html | 145 +- .../resources/templates/agreement/list.html | 268 + .../resources/templates/agreement/save.html | 236 + .../resources/templates/agreement/update.html | 252 + .../resources/templates/systemuser/login.html | 61 +- .../resources/templates/wg/list-check.html | 322 + src/main/resources/templates/wg/list.html | 267 + src/main/resources/templates/wg/show.html | 363 + src/main/resources/templates/wg/update.html | 392 + .../templates/withdrawcheck/list-check.html | 103 +- .../templates/withdrawcheck/list.html | 24 +- .../templates/withdrawcheck/show.html | 265 +- .../templates/withdrawcheck/update.html | 8 +- .../templates/withdrawinvoice/list-check.html | 2 +- .../templates/withdrawinvoice/list.html | 2 +- .../templates/withdrawinvoice/show.html | 35 +- .../templates/withdrawinvoice/update.html | 13 +- 96 files changed, 42125 insertions(+), 284 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/operator/controller/api/accountbank/AccountBankController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/api/agreement/AgreementController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/api/wg/WangeGengInvoiceController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/app/api/accountbank/AccountBankAppController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/app/api/agreement/AgreementAppController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/resource/accountbank/AccountBankResourceController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/resource/agreement/AgreementResourceController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/route/accountbank/AccountBankRouteController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/route/agreement/AgreementRouteController.java create mode 100644 src/main/java/cn/com/tenlion/operator/controller/route/wg/WgRouteController.java create mode 100644 src/main/java/cn/com/tenlion/operator/dao/accountbank/IAccountBankDao.java create mode 100644 src/main/java/cn/com/tenlion/operator/dao/agreement/IAgreementDao.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/bos/accountbank/AccountBankBO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/bos/agreement/AgreementBO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/dtos/accountbank/AccountBankDTO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/dtos/agreement/AgreementDTO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/pos/accountbank/AccountBankPO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/pos/agreement/AgreementPO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/vos/accountbank/AccountBankVO.java create mode 100644 src/main/java/cn/com/tenlion/operator/pojo/vos/agreement/AgreementVO.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/accountbank/IAccountBankService.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/accountbank/impl/AccountBankServiceImpl.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/agreement/IAgreementService.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/agreement/impl/AgreementServiceImpl.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceApi.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceService.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/InvoiceDTO.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/InvoiceExamineVO.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/OrderDTO.java create mode 100644 src/main/java/cn/com/tenlion/operator/service/remote/impl/RemoteWangGengInvoiceSerivceImpl.java create mode 100644 src/main/java/cn/com/tenlion/operator/util/socket/MessageWebSocketServer.java create mode 100644 src/main/java/cn/com/tenlion/operator/util/socket/SocketSession.java create mode 100644 src/main/java/cn/com/tenlion/operator/util/socket/WebSocketConfig.java create mode 100644 src/main/resources/application-lanproxy.yml create mode 100644 src/main/resources/mybatis/mapper/accountbank/account-bank-mapper.xml create mode 100644 src/main/resources/mybatis/mapper/agreement/agreement-mapper.xml create mode 100644 src/main/resources/static/assets/js/vendor/wangEditor/jquery-1.7.2.js create mode 100644 src/main/resources/static/assets/js/vendor/wangEditor/v4/wangEditor.css create mode 100644 src/main/resources/static/assets/js/vendor/wangEditor/v4/wangEditor.min.js create mode 100644 src/main/resources/static/assets/js/vendor/wangEditor/wangEditor-fullscreen-plugin4.js create mode 100644 src/main/resources/static/assets/js/vendor/wangEditor/wangEditor4.js create mode 100644 src/main/resources/templates/accountbank/list.html create mode 100644 src/main/resources/templates/accountbank/save.html create mode 100644 src/main/resources/templates/accountbank/update.html create mode 100644 src/main/resources/templates/agreement/list.html create mode 100644 src/main/resources/templates/agreement/save.html create mode 100644 src/main/resources/templates/agreement/update.html create mode 100644 src/main/resources/templates/wg/list-check.html create mode 100644 src/main/resources/templates/wg/list.html create mode 100644 src/main/resources/templates/wg/show.html create mode 100644 src/main/resources/templates/wg/update.html diff --git a/pom.xml b/pom.xml index 7752883..6e2382e 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,11 @@ login-oauth2-server 1.0-SNAPSHOT + + ink.wgink + module-oauth2-client + 1.0-SNAPSHOT + ink.wgink login-app @@ -193,17 +198,12 @@ mongo-module-file 1.0-SNAPSHOT + ink.wgink module-file 1.0-SNAPSHOT - - groovy-all - org.codehaus.groovy - 3.0.9 - pom - org.apache.commons commons-compress @@ -214,43 +214,67 @@ - org.codehaus.gmavenplus - gmavenplus-plugin - 1.6.1 + + org.springframework.boot + spring-boot-maven-plugin - UTF-8 - - - ${project.basedir}/src/main/java/cn/com/tenlion/groovy - - **/*.groovy - - - - - - ${project.basedir}/src/main/test/cn/com/tenlion/groovy - - **/*.groovy - - - - + ZIP + + + non-exists + non-exists + + + + + + org.apache.maven.plugins + maven-dependency-plugin + copy-dependencies + package - addSources - addTestSources - compile - compileTests + copy-dependencies + + + target/lib + false + false + runtime + + + + org.apache.maven.plugins + maven-jar-plugin + + + **/*.properties + **/*.xml + **/*.yml + static/** + templates/** + mybatis/** + + + org.springframework.boot spring-boot-maven-plugin + + true + + + org.projectlombok + lombok + + + diff --git a/src/main/java/cn/com/tenlion/operator/controller/api/account/AccountController.java b/src/main/java/cn/com/tenlion/operator/controller/api/account/AccountController.java index 5976966..29ca2f4 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/api/account/AccountController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/api/account/AccountController.java @@ -1,8 +1,15 @@ package cn.com.tenlion.operator.controller.api.account; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.dtos.accountrecharge.AccountRechargeDTO; +import cn.com.tenlion.operator.pojo.dtos.accountrecharge.AccountRechargePayResultDTO; import cn.com.tenlion.operator.pojo.dtos.customorg.CustomOrgDTO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import cn.com.tenlion.operator.service.accountrecharge.IAccountRechargeService; import cn.com.tenlion.operator.util.UserUtil; import cn.com.tenlion.operator.util.pay.PayUtil; +import cn.com.tenlion.operator.util.socket.MessageWebSocketServer; +import com.alibaba.fastjson2.JSONObject; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.interfaces.consts.ISystemConstant; @@ -41,6 +48,35 @@ public class AccountController extends DefaultBaseController { @Autowired private IUserBaseService iUserBaseService; + @Autowired + private IAccountBankService iAccountBankService; + + @Autowired + private IAccountRechargeService iAccountRechargeService; + @Autowired + private cn.com.tenlion.operator.util.socket.MessageWebSocketServer MessageWebSocketServer; + + @ApiOperation(value = "微信支付成功后回调", notes = "支付成功后回调接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("pay/{rechargeId}") + public synchronized Object pay(@PathVariable("rechargeId") String rechargeId) { + AccountRechargeDTO dto = iAccountRechargeService.get(rechargeId); + // 成功 + if (dto.getThirdParty().equals("微信") && !dto.getReconciliationStatus().equals("1") && !dto.getRechargeCheck().equals("-1") && !dto.getRechargeCheck().equals("2")) { + AccountRechargePayResultDTO payResultDTO = PayUtil.queryOrder(rechargeId); + if (payResultDTO.getOrderStatus().equals("1") && payResultDTO.getMoney().equals(dto.getRechargeMoney())) { + iAccountRechargeService.saveConfirmOnline(dto.getAccountRechargeId(), payResultDTO.getOrderId(), payResultDTO.getOrderSuccessTime()); + // 发送socket + MessageWebSocketServer.sendAll(rechargeId, "success"); + } + } + JSONObject json = new JSONObject(); + json.put("code", "SUCCESS"); + json.put("message", null); + System.out.println(rechargeId); + return json; + } + @Autowired private UserUtil userUtil; @@ -50,11 +86,13 @@ public class AccountController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("system-bank") public Map systemBank() { - AccountDTO accountDTO = accountService.getByUserId(userUtil.getUserId(null)); + AccountBankDTO bankDTO = iAccountBankService.getOpen(); Map map = new HashMap<>(); - map.put("bankName", accountDTO.getBankName()); - map.put("bankAccountName", accountDTO.getBankAccountName()); - map.put("bankNumber", accountDTO.getBankNumber()); + map.put("bankName", bankDTO.getBankName()); + map.put("bankAccountName", bankDTO.getBankAccountName()); + map.put("bankNumber", bankDTO.getBankNumber()); + map.put("bankUnionpayNumber", bankDTO.getBankUnionpayNumber()); + map.put("bankRemark", bankDTO.getBankRemark()); return map; } @@ -83,14 +121,6 @@ public class AccountController extends DefaultBaseController { return accountService.getByUserId(userId); } - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("pay/{orderId}") - public SuccessResult pay(@PathVariable("orderId") String orderId) { - Map params = requestParams(); - System.out.println(params); - return new SuccessResult(); - } - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("nativePay") public SuccessResult nativePay() { diff --git a/src/main/java/cn/com/tenlion/operator/controller/api/accountbank/AccountBankController.java b/src/main/java/cn/com/tenlion/operator/controller/api/accountbank/AccountBankController.java new file mode 100644 index 0000000..8ae3702 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/api/accountbank/AccountBankController.java @@ -0,0 +1,111 @@ +package cn.com.tenlion.operator.controller.api.accountbank; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.vos.accountbank.AccountBankVO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AccountBankController + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "平台账户表接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/accountbank") +public class AccountBankController extends DefaultBaseController { + + @Autowired + private IAccountBankService accountBankService; + + @ApiOperation(value = "新增平台账户表", notes = "新增平台账户表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody AccountBankVO accountBankVO) { + accountBankService.save(accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台账户表", notes = "删除平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + accountBankService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台账户表", notes = "修改平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{accountBankId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("accountBankId") String accountBankId, @RequestBody AccountBankVO accountBankVO) { + accountBankService.update(accountBankId, accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台账户表详情", notes = "平台账户表详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{accountBankId}") + public AccountBankDTO get(@PathVariable("accountBankId") String accountBankId) { + return accountBankService.get(accountBankId); + } + + @ApiOperation(value = "平台账户表列表", notes = "平台账户表列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return accountBankService.list(params); + } + + @ApiOperation(value = "平台账户表分页列表", notes = "平台账户表分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return accountBankService.listPage(page); + } + + @ApiOperation(value = "平台账户表统计", notes = "平台账户表统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(accountBankService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/api/agreement/AgreementController.java b/src/main/java/cn/com/tenlion/operator/controller/api/agreement/AgreementController.java new file mode 100644 index 0000000..ed2ffdd --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/api/agreement/AgreementController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.controller.api.agreement; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import cn.com.tenlion.operator.pojo.vos.agreement.AgreementVO; +import cn.com.tenlion.operator.service.agreement.IAgreementService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AgreementController + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "平台协议管理接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/agreement") +public class AgreementController extends DefaultBaseController { + + @Autowired + private IAgreementService agreementService; + + @ApiOperation(value = "平台协议管理详情", notes = "平台协议管理详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("by-type/{type}") + public AgreementDTO getType(@PathVariable("type") String type) { + return agreementService.getByType(type); + } + + @ApiOperation(value = "新增平台协议管理", notes = "新增平台协议管理接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody AgreementVO agreementVO) { + agreementService.save(agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台协议管理", notes = "删除平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + agreementService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台协议管理", notes = "修改平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{agreementId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("agreementId") String agreementId, @RequestBody AgreementVO agreementVO) { + agreementService.update(agreementId, agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台协议管理详情", notes = "平台协议管理详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{agreementId}") + public AgreementDTO get(@PathVariable("agreementId") String agreementId) { + return agreementService.get(agreementId); + } + + @ApiOperation(value = "平台协议管理列表", notes = "平台协议管理列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return agreementService.list(params); + } + + @ApiOperation(value = "平台协议管理分页列表", notes = "平台协议管理分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return agreementService.listPage(page); + } + + @ApiOperation(value = "平台协议管理统计", notes = "平台协议管理统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(agreementService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/api/systemuser/SystemUserApiontroller.java b/src/main/java/cn/com/tenlion/operator/controller/api/systemuser/SystemUserApiontroller.java index 6531c0c..1b5b0e2 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/api/systemuser/SystemUserApiontroller.java +++ b/src/main/java/cn/com/tenlion/operator/controller/api/systemuser/SystemUserApiontroller.java @@ -12,6 +12,7 @@ import ink.wgink.interfaces.user.IUserBaseService; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.service.user.service.IUserService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -35,6 +36,16 @@ public class SystemUserApiontroller extends DefaultBaseController { @Autowired private IAccountService iAccountService; + @Autowired + private IUserService iUserService; + + @ApiOperation(value = "更改开放状态", notes = "更改开放状态") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("check-exists/{phone}") + public Boolean updateUserState(@PathVariable("phone") String phone) throws Exception { + return iUserService.getPOByUsername(phone) != null; + } + @ApiOperation(value = "更改开放状态", notes = "更改开放状态") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("updatestate/{userId}/{userState}") @@ -60,7 +71,7 @@ public class SystemUserApiontroller extends DefaultBaseController { if (userDTO.getAccountRole().equals("代理商")) { return new SuccessResultData<>(ProjectConfigUtil.getText("AgentServerUrl")); } - if (userDTO.getAccountRole().equals("个人") || userDTO.getAccountRole().equals("企业")) { + if (userDTO.getAccountRole().equals("普通用户")) { return new SuccessResultData<>(ProjectConfigUtil.getText("AiServerUrl")); } throw new SearchException("系统错误"); diff --git a/src/main/java/cn/com/tenlion/operator/controller/api/wg/WangeGengInvoiceController.java b/src/main/java/cn/com/tenlion/operator/controller/api/wg/WangeGengInvoiceController.java new file mode 100644 index 0000000..97ee083 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/api/wg/WangeGengInvoiceController.java @@ -0,0 +1,81 @@ +package cn.com.tenlion.operator.controller.api.wg; + +import cn.com.tenlion.operator.pojo.vos.agentscore.AgentScoreVO; +import cn.com.tenlion.operator.service.remote.IRemoteWangGengInvoiceService; +import cn.com.tenlion.operator.service.remote.InvoiceDTO; +import cn.com.tenlion.operator.service.remote.InvoiceExamineVO; +import cn.com.tenlion.operator.util.UserUtil; +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: WangeGengInvoiceController + * @Author: CodeFactory + * @Date: 2024-01-27 14:25:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "发票信息接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/wg-invoice") +public class WangeGengInvoiceController extends DefaultBaseController { + + @Autowired + private IRemoteWangGengInvoiceService remoteWangGengInvoiceSerivceImpl; + + @ApiOperation(value = "发票信息分页列表", notes = "发票信息分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return remoteWangGengInvoiceSerivceImpl.listPage(page, params.get("invoiceStatus") == null ? "" : params.get("invoiceStatus").toString()); + } + + @ApiOperation(value = "发票信息详情", notes = "发票信息详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "invoiceId", value = "发票信息ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{invoiceId}") + public InvoiceDTO get(@PathVariable("invoiceId") String invoiceId) { + return remoteWangGengInvoiceSerivceImpl.get(invoiceId); + } + + @Autowired + protected SecurityComponent securityComponent; + + @ApiOperation(value = "修改", notes = "修改接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "invoiceId", value = "发票信息ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{invoiceId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("invoiceId") String invoiceId, @RequestBody InvoiceExamineVO invoiceExamineVO) { + invoiceExamineVO.setUserId(securityComponent.getCurrentUser().getUserId()); + invoiceExamineVO.setUsername(securityComponent.getCurrentUser().getUserName()); + remoteWangGengInvoiceSerivceImpl.update(invoiceId, invoiceExamineVO); + return new SuccessResult(); + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/app/api/accountbank/AccountBankAppController.java b/src/main/java/cn/com/tenlion/operator/controller/app/api/accountbank/AccountBankAppController.java new file mode 100644 index 0000000..0a76c7b --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/app/api/accountbank/AccountBankAppController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.controller.app.api.accountbank; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.vos.accountbank.AccountBankVO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AccountBankAppController + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "平台账户表接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/accountbank") +public class AccountBankAppController extends DefaultBaseController { + + @Autowired + private IAccountBankService accountBankService; + + @ApiOperation(value = "新增平台账户表", notes = "新增平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestHeader("token") String token, @RequestBody AccountBankVO accountBankVO) { + accountBankService.save(token, accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台账户表(id列表)", notes = "删除平台账户表(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) { + accountBankService.remove(token, Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台账户表", notes = "修改平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateaccountbank/{accountBankId}") + @CheckRequestBodyAnnotation + public SuccessResult updateAccountBank(@RequestHeader("token") String token, @PathVariable("accountBankId") String accountBankId, @RequestBody AccountBankVO accountBankVO) { + accountBankService.update(token, accountBankId, accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台账户表详情(通过ID)", notes = "平台账户表详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{accountBankId}") + public AccountBankDTO get(@RequestHeader("token") String token, @PathVariable("accountBankId") String accountBankId) { + return accountBankService.get(accountBankId); + } + + @ApiOperation(value = "平台账户表列表", notes = "平台账户表列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list(@RequestHeader("token") String token) { + Map params = requestParams(); + return accountBankService.list(params); + } + + @ApiOperation(value = "平台账户表分页列表", notes = "平台账户表分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpageaccountbank") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return accountBankService.listPage(page); + } + + @ApiOperation(value = "平台账户表统计", notes = "平台账户表统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(accountBankService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/app/api/agreement/AgreementAppController.java b/src/main/java/cn/com/tenlion/operator/controller/app/api/agreement/AgreementAppController.java new file mode 100644 index 0000000..ee4a171 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/app/api/agreement/AgreementAppController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.controller.app.api.agreement; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import cn.com.tenlion.operator.pojo.vos.agreement.AgreementVO; +import cn.com.tenlion.operator.service.agreement.IAgreementService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AgreementAppController + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "平台协议管理接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/agreement") +public class AgreementAppController extends DefaultBaseController { + + @Autowired + private IAgreementService agreementService; + + @ApiOperation(value = "新增平台协议管理", notes = "新增平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestHeader("token") String token, @RequestBody AgreementVO agreementVO) { + agreementService.save(token, agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台协议管理(id列表)", notes = "删除平台协议管理(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) { + agreementService.remove(token, Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台协议管理", notes = "修改平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateagreement/{agreementId}") + @CheckRequestBodyAnnotation + public SuccessResult updateAgreement(@RequestHeader("token") String token, @PathVariable("agreementId") String agreementId, @RequestBody AgreementVO agreementVO) { + agreementService.update(token, agreementId, agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台协议管理详情(通过ID)", notes = "平台协议管理详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{agreementId}") + public AgreementDTO get(@RequestHeader("token") String token, @PathVariable("agreementId") String agreementId) { + return agreementService.get(agreementId); + } + + @ApiOperation(value = "平台协议管理列表", notes = "平台协议管理列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list(@RequestHeader("token") String token) { + Map params = requestParams(); + return agreementService.list(params); + } + + @ApiOperation(value = "平台协议管理分页列表", notes = "平台协议管理分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpageagreement") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return agreementService.listPage(page); + } + + @ApiOperation(value = "平台协议管理统计", notes = "平台协议管理统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(agreementService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/account/AccountResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/account/AccountResourceController.java index 56c5a8d..12a42f1 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/resource/account/AccountResourceController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/account/AccountResourceController.java @@ -1,7 +1,9 @@ package cn.com.tenlion.operator.controller.resource.account; import cn.com.tenlion.operator.pojo.bos.account.AccountBO; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemOrderVO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.interfaces.consts.ISystemConstant; @@ -37,6 +39,9 @@ public class AccountResourceController extends DefaultBaseController { @Autowired private IAccountService accountService; + @Autowired + private IAccountBankService iAccountBankService; + @ApiOperation(value = "客户账户详情", notes = "客户账户详情接口") @ApiImplicitParams({ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), @@ -55,11 +60,13 @@ public class AccountResourceController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("system-bank") public Map systemBank() { - AccountDTO accountDTO = accountService.getByUserId("1"); + AccountBankDTO bankDTO = iAccountBankService.getOpen(); Map map = new HashMap<>(); - map.put("bankName", accountDTO.getBankName()); - map.put("bankAccountName", accountDTO.getBankAccountName()); - map.put("bankNumber", accountDTO.getBankNumber()); + map.put("bankName", bankDTO.getBankName()); + map.put("bankAccountName", bankDTO.getBankAccountName()); + map.put("bankNumber", bankDTO.getBankNumber()); + map.put("bankUnionpayNumber", bankDTO.getBankUnionpayNumber()); + map.put("bankRemark", bankDTO.getBankRemark()); return map; } diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/accountbank/AccountBankResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/accountbank/AccountBankResourceController.java new file mode 100644 index 0000000..fbbb0a2 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/accountbank/AccountBankResourceController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.controller.resource.accountbank; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.vos.accountbank.AccountBankVO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AccountBankResourceController + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "平台账户表接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/accountbank") +public class AccountBankResourceController extends DefaultBaseController { + + @Autowired + private IAccountBankService accountBankService; + + @ApiOperation(value = "新增平台账户表", notes = "新增平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody AccountBankVO accountBankVO) { + accountBankService.save(accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台账户表(id列表)", notes = "删除平台账户表(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + accountBankService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台账户表", notes = "修改平台账户表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{accountBankId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("accountBankId") String accountBankId, @RequestBody AccountBankVO accountBankVO) { + accountBankService.update(accountBankId, accountBankVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台账户表详情", notes = "平台账户表详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "accountBankId", value = "平台账户表ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{accountBankId}") + public AccountBankDTO get(@PathVariable("accountBankId") String accountBankId) { + return accountBankService.get(accountBankId); + } + + @ApiOperation(value = "平台账户表列表", notes = "平台账户表列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return accountBankService.list(params); + } + + @ApiOperation(value = "平台账户表分页列表", notes = "平台账户表分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return accountBankService.listPage(page); + } + + @ApiOperation(value = "平台账户表统计", notes = "平台账户表统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(accountBankService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java index f053068..5824790 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/accountitem/AccountItemResourceController.java @@ -3,9 +3,12 @@ package cn.com.tenlion.operator.controller.resource.accountitem; import cn.com.tenlion.operator.pojo.bos.accountitem.AccountItemBO; import cn.com.tenlion.operator.pojo.dtos.agent.AgentDTO; import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemOrderVO; +import cn.com.tenlion.operator.util.EncryptUtil; +import com.alibaba.fastjson.JSONObject; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SaveException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.ErrorResult; @@ -19,7 +22,10 @@ import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -48,7 +54,22 @@ public class AccountItemResourceController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("pay-in-agent") @CheckRequestBodyAnnotation - public SuccessResult payInAgent(@RequestBody AccountItemOrderVO accountItemOrderVO) { + public SuccessResult payInAgent(@RequestBody AccountItemOrderVO accountItemOrderVO) throws Exception { + String code = EncryptUtil.decode(accountItemOrderVO.getCode()); + JSONObject jsonObject = JSONObject.parseObject(code); + String time = jsonObject.getString("time"); + Integer money = jsonObject.getInteger("money"); + String userId = jsonObject.getString("userId"); + String orderId = jsonObject.getString("orderId"); + Date dateTime = sdf.parse(time); + long diffInMillis = Math.abs(System.currentTimeMillis() - dateTime.getTime()); + int secondsDiff = (int)(diffInMillis / 1000); + if (secondsDiff > 30) { + throw new SaveException("鉴权失败"); + } + if (!money.equals(accountItemOrderVO.getAccountMoney()) || !userId.equals(accountItemOrderVO.getUserId()) || !orderId.equals(accountItemOrderVO.getOrderId())) { + throw new SaveException("鉴权失败"); + } AccountItemVO accountItemVO = new AccountItemVO(); accountItemVO.setMode(1); // 入账 accountItemVO.setType(5); // 收入类型 订单收入 @@ -68,7 +89,22 @@ public class AccountItemResourceController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("pay-in/{type}") @CheckRequestBodyAnnotation - public SuccessResult payIn(@PathVariable("type") String type, @RequestBody AccountItemOrderVO accountItemOrderVO) { + public SuccessResult payIn(@PathVariable("type") String type, @RequestBody AccountItemOrderVO accountItemOrderVO) throws Exception { + String code = EncryptUtil.decode(accountItemOrderVO.getCode()); + JSONObject jsonObject = JSONObject.parseObject(code); + String time = jsonObject.getString("time"); + Integer money = jsonObject.getInteger("money"); + String userId = jsonObject.getString("userId"); + String orderId = jsonObject.getString("orderId"); + Date dateTime = sdf.parse(time); + long diffInMillis = Math.abs(System.currentTimeMillis() - dateTime.getTime()); + int secondsDiff = (int)(diffInMillis / 1000); + if (secondsDiff > 30) { + throw new SaveException("鉴权失败"); + } + if (!money.equals(accountItemOrderVO.getAccountMoney()) || !userId.equals(accountItemOrderVO.getUserId()) || !orderId.equals(accountItemOrderVO.getOrderId())) { + throw new SaveException("鉴权失败"); + } AccountItemVO accountItemVO = new AccountItemVO(); accountItemVO.setMode(1); // 入账 accountItemVO.setType(accountItemOrderVO.getType() == 1 || accountItemOrderVO.getType() == 5 ? accountItemOrderVO.getType() : 5); // 收入类型 充值 | 订单收入 @@ -81,6 +117,8 @@ public class AccountItemResourceController extends DefaultBaseController { return new SuccessResult(); } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + @ApiOperation(value = "出账/订单", notes = "出账/订单接口") @ApiImplicitParams({ @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") @@ -88,7 +126,22 @@ public class AccountItemResourceController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("pay-out/{type}") @CheckRequestBodyAnnotation - public SuccessResult payOut(@PathVariable("type") String type, @RequestBody AccountItemOrderVO accountItemOrderVO) { + public SuccessResult payOut(@PathVariable("type") String type, @RequestBody AccountItemOrderVO accountItemOrderVO) throws Exception { + String code = EncryptUtil.decode(accountItemOrderVO.getCode()); + JSONObject jsonObject = JSONObject.parseObject(code); + String time = jsonObject.getString("time"); + Integer money = jsonObject.getInteger("money"); + String userId = jsonObject.getString("userId"); + String orderId = jsonObject.getString("orderId"); + Date dateTime = sdf.parse(time); + long diffInMillis = Math.abs(System.currentTimeMillis() - dateTime.getTime()); + int secondsDiff = (int)(diffInMillis / 1000); + if (secondsDiff > 30) { + throw new SaveException("鉴权失败"); + } + if (!money.equals(accountItemOrderVO.getAccountMoney()) || !userId.equals(accountItemOrderVO.getUserId()) || !orderId.equals(accountItemOrderVO.getOrderId())) { + throw new SaveException("鉴权失败"); + } AccountItemVO accountItemVO = new AccountItemVO(); accountItemVO.setMode(2); // 出账 accountItemVO.setType(accountItemOrderVO.getType() == 2 || accountItemOrderVO.getType() == 3 || accountItemOrderVO.getType() == 4 ? accountItemOrderVO.getType() : 2); // 支出类型 系统扣款 | 支出 | 提现 diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/accountrecharge/AccountRechargeResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/accountrecharge/AccountRechargeResourceController.java index bab4309..d477c4b 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/resource/accountrecharge/AccountRechargeResourceController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/accountrecharge/AccountRechargeResourceController.java @@ -74,10 +74,10 @@ public class AccountRechargeResourceController extends DefaultBaseController { @ApiOperation(value = "保存充值", notes = "保存充值接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PostMapping("save-account/{thirdParty}") + @PostMapping("save-account") @CheckRequestBodyAnnotation - public AccountRechargePayDTO saveAccount(@PathVariable("thirdParty") String thirdParty, @RequestBody AccountRechargeVO accountRechargeVO) { - AccountRechargePayDTO url = accountRechargeService.saveAccount(thirdParty, accountRechargeVO); + public AccountRechargePayDTO saveAccount(@RequestBody AccountRechargeVO accountRechargeVO) { + AccountRechargePayDTO url = accountRechargeService.saveAccount(accountRechargeVO.getThirdParty(), accountRechargeVO); return url; } diff --git a/src/main/java/cn/com/tenlion/operator/controller/resource/agreement/AgreementResourceController.java b/src/main/java/cn/com/tenlion/operator/controller/resource/agreement/AgreementResourceController.java new file mode 100644 index 0000000..9b23144 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/resource/agreement/AgreementResourceController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.controller.resource.agreement; + +import ink.wgink.annotation.CheckRequestBodyAnnotation; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultData; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import cn.com.tenlion.operator.pojo.vos.agreement.AgreementVO; +import cn.com.tenlion.operator.service.agreement.IAgreementService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AgreementResourceController + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "平台协议管理接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/agreement") +public class AgreementResourceController extends DefaultBaseController { + + @Autowired + private IAgreementService agreementService; + + @ApiOperation(value = "新增平台协议管理", notes = "新增平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody AgreementVO agreementVO) { + agreementService.save(agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "删除平台协议管理(id列表)", notes = "删除平台协议管理(id列表)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @DeleteMapping("remove/{ids}") + public SuccessResult remove(@PathVariable("ids") String ids) { + agreementService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改平台协议管理", notes = "修改平台协议管理接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{agreementId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("agreementId") String agreementId, @RequestBody AgreementVO agreementVO) { + agreementService.update(agreementId, agreementVO); + return new SuccessResult(); + } + + @ApiOperation(value = "平台协议管理详情", notes = "平台协议管理详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "agreementId", value = "平台协议管理ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{agreementId}") + public AgreementDTO get(@PathVariable("agreementId") String agreementId) { + return agreementService.get(agreementId); + } + + @ApiOperation(value = "平台协议管理列表", notes = "平台协议管理列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return agreementService.list(params); + } + + @ApiOperation(value = "平台协议管理分页列表", notes = "平台协议管理分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return agreementService.listPage(page); + } + + @ApiOperation(value = "平台协议管理统计", notes = "平台协议管理统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(agreementService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/route/accountbank/AccountBankRouteController.java b/src/main/java/cn/com/tenlion/operator/controller/route/accountbank/AccountBankRouteController.java new file mode 100644 index 0000000..8375f69 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/route/accountbank/AccountBankRouteController.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.operator.controller.route.accountbank; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AccountBankController + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "平台账户表路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/accountbank") +public class AccountBankRouteController extends DefaultBaseController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("accountbank/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("accountbank/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("accountbank/list"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/route/accountrecharge/AccountRechargeRouteController.java b/src/main/java/cn/com/tenlion/operator/controller/route/accountrecharge/AccountRechargeRouteController.java index 38593a3..c787430 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/route/accountrecharge/AccountRechargeRouteController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/route/accountrecharge/AccountRechargeRouteController.java @@ -83,6 +83,7 @@ public class AccountRechargeRouteController extends DefaultBaseController { public ModelAndView update(String accountRechargeId) { ModelAndView mv = new ModelAndView("accountrecharge/update"); mv.addObject("dto" , iAccountRechargeService.get(accountRechargeId)); + mv.addObject("AiServerUrl" , ProjectConfigUtil.getText("AiServerUrl")); return mv; } diff --git a/src/main/java/cn/com/tenlion/operator/controller/route/agreement/AgreementRouteController.java b/src/main/java/cn/com/tenlion/operator/controller/route/agreement/AgreementRouteController.java new file mode 100644 index 0000000..88463d7 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/route/agreement/AgreementRouteController.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.operator.controller.route.agreement; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import cn.com.tenlion.operator.service.agreement.IAgreementService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: AgreementController + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "平台协议管理路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/agreement") +public class AgreementRouteController extends DefaultBaseController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("agreement/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("agreement/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("agreement/list"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/controller/route/systemuser/SystemUserRouteController.java b/src/main/java/cn/com/tenlion/operator/controller/route/systemuser/SystemUserRouteController.java index ffb2c65..45c1e18 100644 --- a/src/main/java/cn/com/tenlion/operator/controller/route/systemuser/SystemUserRouteController.java +++ b/src/main/java/cn/com/tenlion/operator/controller/route/systemuser/SystemUserRouteController.java @@ -68,13 +68,14 @@ public class SystemUserRouteController extends DefaultBaseController { if (roleSimpleDTOList == null || roleSimpleDTOList.size() < 1) { throw new SaveException("角色不存在"); } - if(roleSimpleDTOList.get(0).getRoleName().contains("企业") || roleSimpleDTOList.get(0).getRoleName().contains("个人")) { + if(roleSimpleDTOList.get(0).getRoleName().contains("普通用户")) { return new ModelAndView(new RedirectView(ProjectConfigUtil.getText("AiServerUrl"))); }else if(roleSimpleDTOList.get(0).getRoleName().contains("代理商")) { return new ModelAndView(new RedirectView(ProjectConfigUtil.getText("AgentServerUrl"))); - }else{ + }else if(roleSimpleDTOList.get(0).getRoleName().contains("运营平台") || userInfoBO.getUserId().equals("1")){ return new ModelAndView("forward:/default-main"); } + return new ModelAndView("systemuser/login?error=无权限访问"); } @GetMapping("select") diff --git a/src/main/java/cn/com/tenlion/operator/controller/route/wg/WgRouteController.java b/src/main/java/cn/com/tenlion/operator/controller/route/wg/WgRouteController.java new file mode 100644 index 0000000..d5ec237 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/controller/route/wg/WgRouteController.java @@ -0,0 +1,55 @@ +package cn.com.tenlion.operator.controller.route.wg; + +import cn.com.tenlion.operator.util.UserUtil; +import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SaveException; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.interfaces.role.IRoleBaseService; +import ink.wgink.interfaces.user.IUserBaseService; +import ink.wgink.login.base.consts.IUserCenterConst; +import ink.wgink.login.base.service.IOAuthService; +import ink.wgink.login.base.service.login.ILoginFormService; +import ink.wgink.pojo.bos.UserInfoBO; +import ink.wgink.pojo.dtos.role.RoleSimpleDTO; +import ink.wgink.properties.ServerProperties; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.view.RedirectView; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "AI系统") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/wg") +public class WgRouteController extends DefaultBaseController { + + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("wg/list"); + } + + @GetMapping("list-check") + public ModelAndView listCheck() { + return new ModelAndView("wg/list-check"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("wg/update"); + } + + @GetMapping("show") + public ModelAndView show() { + return new ModelAndView("wg/show"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/dao/accountbank/IAccountBankDao.java b/src/main/java/cn/com/tenlion/operator/dao/accountbank/IAccountBankDao.java new file mode 100644 index 0000000..0e16fa6 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/dao/accountbank/IAccountBankDao.java @@ -0,0 +1,123 @@ +package cn.com.tenlion.operator.dao.accountbank; + +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import cn.com.tenlion.operator.pojo.bos.accountbank.AccountBankBO; +import cn.com.tenlion.operator.pojo.pos.accountbank.AccountBankPO; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IAccountBankDao + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Repository +public interface IAccountBankDao { + + /** + * 新增平台账户表 + * + * @param params + * @throws SaveException + */ + void save(Map params) throws SaveException; + + /** + * 删除平台账户表 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除平台账户表(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改平台账户表 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 平台账户表详情 + * + * @param params + * @return + * @throws SearchException + */ + AccountBankDTO get(Map params) throws SearchException; + + /** + * 平台账户表详情 + * + * @param params + * @return + * @throws SearchException + */ + AccountBankBO getBO(Map params) throws SearchException; + + /** + * 平台账户表详情 + * + * @param params + * @return + * @throws SearchException + */ + AccountBankPO getPO(Map params) throws SearchException; + + /** + * 平台账户表列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 平台账户表列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 平台账户表列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 平台账户表统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + + void updateSwitch(Map updateParam); + + AccountBankDTO getOpen(Map params); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/dao/agreement/IAgreementDao.java b/src/main/java/cn/com/tenlion/operator/dao/agreement/IAgreementDao.java new file mode 100644 index 0000000..0a8a519 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/dao/agreement/IAgreementDao.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.operator.dao.agreement; + +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import cn.com.tenlion.operator.pojo.bos.agreement.AgreementBO; +import cn.com.tenlion.operator.pojo.pos.agreement.AgreementPO; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IAgreementDao + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Repository +public interface IAgreementDao { + + /** + * 新增平台协议管理 + * + * @param params + * @throws SaveException + */ + void save(Map params) throws SaveException; + + /** + * 删除平台协议管理 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除平台协议管理(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改平台协议管理 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 平台协议管理详情 + * + * @param params + * @return + * @throws SearchException + */ + AgreementDTO get(Map params) throws SearchException; + + /** + * 平台协议管理详情 + * + * @param params + * @return + * @throws SearchException + */ + AgreementBO getBO(Map params) throws SearchException; + + /** + * 平台协议管理详情 + * + * @param params + * @return + * @throws SearchException + */ + AgreementPO getPO(Map params) throws SearchException; + + /** + * 平台协议管理列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 平台协议管理列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 平台协议管理列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 平台协议管理统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + + AgreementDTO getByType(String type); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/pojo/bos/accountbank/AccountBankBO.java b/src/main/java/cn/com/tenlion/operator/pojo/bos/accountbank/AccountBankBO.java new file mode 100644 index 0000000..028f7ec --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/bos/accountbank/AccountBankBO.java @@ -0,0 +1,123 @@ +package cn.com.tenlion.operator.pojo.bos.accountbank; + +/** + * + * @ClassName: AccountBankBO + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +public class AccountBankBO { + + private String accountBankId; + private String bankName; + private String bankNumber; + private String bankAccountName; + private String bankUnionpayNumber; + private String bankRemark; + private String bankSwitch; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getAccountBankId() { + return accountBankId == null ? "" : accountBankId.trim(); + } + + public void setAccountBankId(String accountBankId) { + this.accountBankId = accountBankId; + } + + public String getBankName() { + return bankName == null ? "" : bankName.trim(); + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNumber() { + return bankNumber == null ? "" : bankNumber.trim(); + } + + public void setBankNumber(String bankNumber) { + this.bankNumber = bankNumber; + } + + public String getBankAccountName() { + return bankAccountName == null ? "" : bankAccountName.trim(); + } + + public void setBankAccountName(String bankAccountName) { + this.bankAccountName = bankAccountName; + } + + public String getBankUnionpayNumber() { + return bankUnionpayNumber == null ? "" : bankUnionpayNumber.trim(); + } + + public void setBankUnionpayNumber(String bankUnionpayNumber) { + this.bankUnionpayNumber = bankUnionpayNumber; + } + + public String getBankRemark() { + return bankRemark == null ? "" : bankRemark.trim(); + } + + public void setBankRemark(String bankRemark) { + this.bankRemark = bankRemark; + } + + public String getBankSwitch() { + return bankSwitch == null ? "" : bankSwitch.trim(); + } + + public void setBankSwitch(String bankSwitch) { + this.bankSwitch = bankSwitch; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/bos/agreement/AgreementBO.java b/src/main/java/cn/com/tenlion/operator/pojo/bos/agreement/AgreementBO.java new file mode 100644 index 0000000..9f6d07f --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/bos/agreement/AgreementBO.java @@ -0,0 +1,114 @@ +package cn.com.tenlion.operator.pojo.bos.agreement; + +/** + * + * @ClassName: AgreementBO + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +public class AgreementBO { + + private String agreementId; + private String agreementTitle; + private String agreementType; + private String agreementContent; + private String agreementSwitch; + private Double agreementVersion; + private String gmtCreate; + private String creator; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getAgreementId() { + return agreementId == null ? "" : agreementId.trim(); + } + + public void setAgreementId(String agreementId) { + this.agreementId = agreementId; + } + + public String getAgreementTitle() { + return agreementTitle == null ? "" : agreementTitle.trim(); + } + + public void setAgreementTitle(String agreementTitle) { + this.agreementTitle = agreementTitle; + } + + public String getAgreementType() { + return agreementType == null ? "" : agreementType.trim(); + } + + public void setAgreementType(String agreementType) { + this.agreementType = agreementType; + } + + public String getAgreementContent() { + return agreementContent == null ? "" : agreementContent.trim(); + } + + public void setAgreementContent(String agreementContent) { + this.agreementContent = agreementContent; + } + + public String getAgreementSwitch() { + return agreementSwitch == null ? "" : agreementSwitch.trim(); + } + + public void setAgreementSwitch(String agreementSwitch) { + this.agreementSwitch = agreementSwitch; + } + + public Double getAgreementVersion() { + return agreementVersion == null ? 0D : agreementVersion; + } + + public void setAgreementVersion(Double agreementVersion) { + this.agreementVersion = agreementVersion; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountbank/AccountBankDTO.java b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountbank/AccountBankDTO.java new file mode 100644 index 0000000..08ddaa4 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountbank/AccountBankDTO.java @@ -0,0 +1,139 @@ +package cn.com.tenlion.operator.pojo.dtos.accountbank; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: AccountBankDTO + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@ApiModel +public class AccountBankDTO { + + @ApiModelProperty(name = "accountBankId", value = "平台收款号码") + private String accountBankId; + @ApiModelProperty(name = "bankName", value = "开户银行") + private String bankName; + @ApiModelProperty(name = "bankNumber", value = "银行账号") + private String bankNumber; + @ApiModelProperty(name = "bankAccountName", value = "公司名称") + private String bankAccountName; + @ApiModelProperty(name = "bankUnionpayNumber", value = "银行联行号") + private String bankUnionpayNumber; + @ApiModelProperty(name = "bankRemark", value = "备注") + private String bankRemark; + @ApiModelProperty(name = "bankSwitch", value = "开关") + private String bankSwitch; + @ApiModelProperty(name = "gmtCreate", value = "") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "") + private String creator; + @ApiModelProperty(name = "gmtModified", value = "") + private String gmtModified; + @ApiModelProperty(name = "modifier", value = "") + private String modifier; + @ApiModelProperty(name = "isDelete", value = "") + private Integer isDelete; + + public String getAccountBankId() { + return accountBankId == null ? "" : accountBankId.trim(); + } + + public void setAccountBankId(String accountBankId) { + this.accountBankId = accountBankId; + } + + public String getBankName() { + return bankName == null ? "" : bankName.trim(); + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNumber() { + return bankNumber == null ? "" : bankNumber.trim(); + } + + public void setBankNumber(String bankNumber) { + this.bankNumber = bankNumber; + } + + public String getBankAccountName() { + return bankAccountName == null ? "" : bankAccountName.trim(); + } + + public void setBankAccountName(String bankAccountName) { + this.bankAccountName = bankAccountName; + } + + public String getBankUnionpayNumber() { + return bankUnionpayNumber == null ? "" : bankUnionpayNumber.trim(); + } + + public void setBankUnionpayNumber(String bankUnionpayNumber) { + this.bankUnionpayNumber = bankUnionpayNumber; + } + + public String getBankRemark() { + return bankRemark == null ? "" : bankRemark.trim(); + } + + public void setBankRemark(String bankRemark) { + this.bankRemark = bankRemark; + } + + public String getBankSwitch() { + return bankSwitch == null ? "" : bankSwitch.trim(); + } + + public void setBankSwitch(String bankSwitch) { + this.bankSwitch = bankSwitch; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountrecharge/AccountRechargePayResultDTO.java b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountrecharge/AccountRechargePayResultDTO.java index e300b05..b26af5f 100644 --- a/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountrecharge/AccountRechargePayResultDTO.java +++ b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountrecharge/AccountRechargePayResultDTO.java @@ -23,6 +23,16 @@ public class AccountRechargePayResultDTO { private String orderSuccessTime; @ApiModelProperty(name = "orderMessage", value = "提示") private String orderMessage; + @ApiModelProperty(name = "money", value = "总金额") + private Integer money; + + public Integer getMoney() { + return money == null ? 0 : money; + } + + public void setMoney(Integer money) { + this.money = money; + } public String getOrderMessage() { return orderMessage == null ? "" : orderMessage.trim(); diff --git a/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountwithdrawal/AccountWithdrawalDTO.java b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountwithdrawal/AccountWithdrawalDTO.java index e1ddba5..2b031a0 100644 --- a/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountwithdrawal/AccountWithdrawalDTO.java +++ b/src/main/java/cn/com/tenlion/operator/pojo/dtos/accountwithdrawal/AccountWithdrawalDTO.java @@ -39,7 +39,7 @@ public class AccountWithdrawalDTO { private String withdrawTransferVoucher; @ApiModelProperty(name = "bankAccountName", value = "收款人银行卡户名") private String bankAccountName; - @ApiModelProperty(name = "bankNumber", value = "收款人银行卡号") + @ApiModelProperty(name = "bankNumber", value = "收款人银行账号") private String bankNumber; @ApiModelProperty(name = "bankName", value = "收款人银行卡开户行") private String bankName; diff --git a/src/main/java/cn/com/tenlion/operator/pojo/dtos/agreement/AgreementDTO.java b/src/main/java/cn/com/tenlion/operator/pojo/dtos/agreement/AgreementDTO.java new file mode 100644 index 0000000..081b3dd --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/dtos/agreement/AgreementDTO.java @@ -0,0 +1,129 @@ +package cn.com.tenlion.operator.pojo.dtos.agreement; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: AgreementDTO + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@ApiModel +public class AgreementDTO { + + @ApiModelProperty(name = "agreementId", value = "协议ID") + private String agreementId; + @ApiModelProperty(name = "agreementTitle", value = "协议标题") + private String agreementTitle; + @ApiModelProperty(name = "agreementType", value = "协议类型") + private String agreementType; + @ApiModelProperty(name = "agreementContent", value = "协议内容") + private String agreementContent; + @ApiModelProperty(name = "agreementSwitch", value = "协议开关") + private String agreementSwitch; + @ApiModelProperty(name = "agreementVersion", value = "协议版本") + private Double agreementVersion; + @ApiModelProperty(name = "gmtCreate", value = "") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "") + private String creator; + @ApiModelProperty(name = "modifier", value = "") + private String modifier; + @ApiModelProperty(name = "gmtModified", value = "") + private String gmtModified; + @ApiModelProperty(name = "isDelete", value = "") + private Integer isDelete; + + public String getAgreementId() { + return agreementId == null ? "" : agreementId.trim(); + } + + public void setAgreementId(String agreementId) { + this.agreementId = agreementId; + } + + public String getAgreementTitle() { + return agreementTitle == null ? "" : agreementTitle.trim(); + } + + public void setAgreementTitle(String agreementTitle) { + this.agreementTitle = agreementTitle; + } + + public String getAgreementType() { + return agreementType == null ? "" : agreementType.trim(); + } + + public void setAgreementType(String agreementType) { + this.agreementType = agreementType; + } + + public String getAgreementContent() { + return agreementContent == null ? "" : agreementContent.trim(); + } + + public void setAgreementContent(String agreementContent) { + this.agreementContent = agreementContent; + } + + public String getAgreementSwitch() { + return agreementSwitch == null ? "" : agreementSwitch.trim(); + } + + public void setAgreementSwitch(String agreementSwitch) { + this.agreementSwitch = agreementSwitch; + } + + public Double getAgreementVersion() { + return agreementVersion == null ? 0D : agreementVersion; + } + + public void setAgreementVersion(Double agreementVersion) { + this.agreementVersion = agreementVersion; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/pos/accountbank/AccountBankPO.java b/src/main/java/cn/com/tenlion/operator/pojo/pos/accountbank/AccountBankPO.java new file mode 100644 index 0000000..8d44449 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/pos/accountbank/AccountBankPO.java @@ -0,0 +1,123 @@ +package cn.com.tenlion.operator.pojo.pos.accountbank; + +/** + * + * @ClassName: AccountBankPO + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +public class AccountBankPO { + + private String accountBankId; + private String bankName; + private String bankNumber; + private String bankAccountName; + private String bankUnionpayNumber; + private String bankRemark; + private String bankSwitch; + private String gmtCreate; + private String creator; + private String gmtModified; + private String modifier; + private Integer isDelete; + + public String getAccountBankId() { + return accountBankId == null ? "" : accountBankId.trim(); + } + + public void setAccountBankId(String accountBankId) { + this.accountBankId = accountBankId; + } + + public String getBankName() { + return bankName == null ? "" : bankName.trim(); + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNumber() { + return bankNumber == null ? "" : bankNumber.trim(); + } + + public void setBankNumber(String bankNumber) { + this.bankNumber = bankNumber; + } + + public String getBankAccountName() { + return bankAccountName == null ? "" : bankAccountName.trim(); + } + + public void setBankAccountName(String bankAccountName) { + this.bankAccountName = bankAccountName; + } + + public String getBankUnionpayNumber() { + return bankUnionpayNumber == null ? "" : bankUnionpayNumber.trim(); + } + + public void setBankUnionpayNumber(String bankUnionpayNumber) { + this.bankUnionpayNumber = bankUnionpayNumber; + } + + public String getBankRemark() { + return bankRemark == null ? "" : bankRemark.trim(); + } + + public void setBankRemark(String bankRemark) { + this.bankRemark = bankRemark; + } + + public String getBankSwitch() { + return bankSwitch == null ? "" : bankSwitch.trim(); + } + + public void setBankSwitch(String bankSwitch) { + this.bankSwitch = bankSwitch; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/pos/agreement/AgreementPO.java b/src/main/java/cn/com/tenlion/operator/pojo/pos/agreement/AgreementPO.java new file mode 100644 index 0000000..516f835 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/pos/agreement/AgreementPO.java @@ -0,0 +1,114 @@ +package cn.com.tenlion.operator.pojo.pos.agreement; + +/** + * + * @ClassName: AgreementPO + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +public class AgreementPO { + + private String agreementId; + private String agreementTitle; + private String agreementType; + private String agreementContent; + private String agreementSwitch; + private Double agreementVersion; + private String gmtCreate; + private String creator; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getAgreementId() { + return agreementId == null ? "" : agreementId.trim(); + } + + public void setAgreementId(String agreementId) { + this.agreementId = agreementId; + } + + public String getAgreementTitle() { + return agreementTitle == null ? "" : agreementTitle.trim(); + } + + public void setAgreementTitle(String agreementTitle) { + this.agreementTitle = agreementTitle; + } + + public String getAgreementType() { + return agreementType == null ? "" : agreementType.trim(); + } + + public void setAgreementType(String agreementType) { + this.agreementType = agreementType; + } + + public String getAgreementContent() { + return agreementContent == null ? "" : agreementContent.trim(); + } + + public void setAgreementContent(String agreementContent) { + this.agreementContent = agreementContent; + } + + public String getAgreementSwitch() { + return agreementSwitch == null ? "" : agreementSwitch.trim(); + } + + public void setAgreementSwitch(String agreementSwitch) { + this.agreementSwitch = agreementSwitch; + } + + public Double getAgreementVersion() { + return agreementVersion == null ? 0D : agreementVersion; + } + + public void setAgreementVersion(Double agreementVersion) { + this.agreementVersion = agreementVersion; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountbank/AccountBankVO.java b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountbank/AccountBankVO.java new file mode 100644 index 0000000..6d90c78 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountbank/AccountBankVO.java @@ -0,0 +1,86 @@ +package cn.com.tenlion.operator.pojo.vos.accountbank; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import ink.wgink.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: AccountBankVO + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@ApiModel +public class AccountBankVO { + + @ApiModelProperty(name = "bankName", value = "开户银行") + @CheckEmptyAnnotation(name = "开户银行") + private String bankName; + @ApiModelProperty(name = "bankNumber", value = "银行账号") + @CheckEmptyAnnotation(name = "银行账号") + private String bankNumber; + @ApiModelProperty(name = "bankAccountName", value = "公司名称") + @CheckEmptyAnnotation(name = "公司名称") + private String bankAccountName; + @ApiModelProperty(name = "bankUnionpayNumber", value = "银行联行号") + @CheckEmptyAnnotation(name = "银行联行号") + private String bankUnionpayNumber; + @ApiModelProperty(name = "bankRemark", value = "备注") + private String bankRemark; + @ApiModelProperty(name = "bankSwitch", value = "开关") + @CheckEmptyAnnotation(name = "开关") + private String bankSwitch; + + public String getBankName() { + return bankName == null ? "" : bankName.trim(); + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getBankNumber() { + return bankNumber == null ? "" : bankNumber.trim(); + } + + public void setBankNumber(String bankNumber) { + this.bankNumber = bankNumber; + } + + public String getBankAccountName() { + return bankAccountName == null ? "" : bankAccountName.trim(); + } + + public void setBankAccountName(String bankAccountName) { + this.bankAccountName = bankAccountName; + } + + public String getBankUnionpayNumber() { + return bankUnionpayNumber == null ? "" : bankUnionpayNumber.trim(); + } + + public void setBankUnionpayNumber(String bankUnionpayNumber) { + this.bankUnionpayNumber = bankUnionpayNumber; + } + + public String getBankRemark() { + return bankRemark == null ? "" : bankRemark.trim(); + } + + public void setBankRemark(String bankRemark) { + this.bankRemark = bankRemark; + } + + public String getBankSwitch() { + return bankSwitch == null ? "" : bankSwitch.trim(); + } + + public void setBankSwitch(String bankSwitch) { + this.bankSwitch = bankSwitch; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountitem/AccountItemOrderVO.java b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountitem/AccountItemOrderVO.java index 3737211..213f361 100644 --- a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountitem/AccountItemOrderVO.java +++ b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountitem/AccountItemOrderVO.java @@ -24,6 +24,17 @@ public class AccountItemOrderVO { @ApiModelProperty(name = "orderId", value = "订单ID") @CheckEmptyAnnotation(name = "订单ID") private String orderId; + @ApiModelProperty(name = "code", value = "编码") + @CheckEmptyAnnotation(name = "编码") + private String code; + + public String getCode() { + return code == null ? "" : code.trim(); + } + + public void setCode(String code) { + this.code = code; + } public String getUserId() { return userId == null ? "" : userId.trim(); diff --git a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountrecharge/AccountRechargeVO.java b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountrecharge/AccountRechargeVO.java index 041a53c..7c562fc 100644 --- a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountrecharge/AccountRechargeVO.java +++ b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountrecharge/AccountRechargeVO.java @@ -16,6 +16,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel public class AccountRechargeVO { + @ApiModelProperty(name = "userId", value = "用户ID") + private String userId; @ApiModelProperty(name = "accountId", value = "关联的账户ID") private String accountId; @ApiModelProperty(name = "rechargeMoney", value = "充值金额") @@ -52,6 +54,14 @@ public class AccountRechargeVO { @ApiModelProperty(name = "selfData", value = "平台账户") private String selfData; + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + public String getOrgName() { return orgName == null ? "" : orgName.trim(); } diff --git a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountwithdrawal/AccountWithdrawalVO.java b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountwithdrawal/AccountWithdrawalVO.java index 2731117..f21b7de 100644 --- a/src/main/java/cn/com/tenlion/operator/pojo/vos/accountwithdrawal/AccountWithdrawalVO.java +++ b/src/main/java/cn/com/tenlion/operator/pojo/vos/accountwithdrawal/AccountWithdrawalVO.java @@ -40,7 +40,7 @@ public class AccountWithdrawalVO { @ApiModelProperty(name = "bankAccountName", value = "收款人银行卡户名") @CheckEmptyAnnotation(name = "收款人") private String bankAccountName; - @ApiModelProperty(name = "bankNumber", value = "收款人银行卡号") + @ApiModelProperty(name = "bankNumber", value = "收款人银行账号") @CheckEmptyAnnotation(name = "卡号") private String bankNumber; @ApiModelProperty(name = "bankName", value = "收款人银行卡开户行") diff --git a/src/main/java/cn/com/tenlion/operator/pojo/vos/agreement/AgreementVO.java b/src/main/java/cn/com/tenlion/operator/pojo/vos/agreement/AgreementVO.java new file mode 100644 index 0000000..0641fa5 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/pojo/vos/agreement/AgreementVO.java @@ -0,0 +1,72 @@ +package cn.com.tenlion.operator.pojo.vos.agreement; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import ink.wgink.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: AgreementVO + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@ApiModel +public class AgreementVO { + + @ApiModelProperty(name = "agreementTitle", value = "协议标题") + private String agreementTitle; + @ApiModelProperty(name = "agreementType", value = "协议类型") + private String agreementType; + @ApiModelProperty(name = "agreementContent", value = "协议内容") + private String agreementContent; + @ApiModelProperty(name = "agreementSwitch", value = "协议开关") + private String agreementSwitch; + @ApiModelProperty(name = "agreementVersion", value = "协议版本") + @CheckNumberAnnotation(name = "协议版本") + private Double agreementVersion; + + public String getAgreementTitle() { + return agreementTitle == null ? "" : agreementTitle.trim(); + } + + public void setAgreementTitle(String agreementTitle) { + this.agreementTitle = agreementTitle; + } + + public String getAgreementType() { + return agreementType == null ? "" : agreementType.trim(); + } + + public void setAgreementType(String agreementType) { + this.agreementType = agreementType; + } + + public String getAgreementContent() { + return agreementContent == null ? "" : agreementContent.trim(); + } + + public void setAgreementContent(String agreementContent) { + this.agreementContent = agreementContent; + } + + public String getAgreementSwitch() { + return agreementSwitch == null ? "" : agreementSwitch.trim(); + } + + public void setAgreementSwitch(String agreementSwitch) { + this.agreementSwitch = agreementSwitch; + } + + public Double getAgreementVersion() { + return agreementVersion == null ? 0D : agreementVersion; + } + + public void setAgreementVersion(Double agreementVersion) { + this.agreementVersion = agreementVersion; + } + + +} diff --git a/src/main/java/cn/com/tenlion/operator/service/UserRegisterService.java b/src/main/java/cn/com/tenlion/operator/service/UserRegisterService.java index fa1ef28..1320434 100644 --- a/src/main/java/cn/com/tenlion/operator/service/UserRegisterService.java +++ b/src/main/java/cn/com/tenlion/operator/service/UserRegisterService.java @@ -39,10 +39,8 @@ public class UserRegisterService implements IRegisterHandlerService, IRegisterWi if (roleDTO == null) { throw new SaveException("角色不存在"); } - String roleName = "个人"; - if(roleDTO.getRoleName().contains("企业")) { - roleName = "企业"; - }else if(roleDTO.getRoleName().contains("代理商")) { + String roleName = "普通用户"; + if(roleDTO.getRoleName().contains("代理商")) { roleName = "代理商"; } // 1.修改用户的角色 diff --git a/src/main/java/cn/com/tenlion/operator/service/accountbank/IAccountBankService.java b/src/main/java/cn/com/tenlion/operator/service/accountbank/IAccountBankService.java new file mode 100644 index 0000000..0973e8a --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/accountbank/IAccountBankService.java @@ -0,0 +1,189 @@ +package cn.com.tenlion.operator.service.accountbank; + +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.vos.accountbank.AccountBankVO; +import cn.com.tenlion.operator.pojo.bos.accountbank.AccountBankBO; +import cn.com.tenlion.operator.pojo.pos.accountbank.AccountBankPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IAccountBankService + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +public interface IAccountBankService { + + /** + * 新增平台账户表 + * + * @param accountBankVO + * @return + */ + void save(AccountBankVO accountBankVO); + + /** + * 新增平台账户表 + * + * @param token + * @param accountBankVO + * @return + */ + void save(String token, AccountBankVO accountBankVO); + + /** + * 新增平台账户表 + * + * @param accountBankVO + * @return accountBankId + */ + String saveReturnId(AccountBankVO accountBankVO); + + /** + * 新增平台账户表 + * + * @param token + * @param accountBankVO + * @return accountBankId + */ + String saveReturnId(String token, AccountBankVO accountBankVO); + + /** + * 删除平台账户表 + * + * @param ids id列表 + * @return + */ + void remove(List ids); + + + /** + * 删除平台账户表 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除平台账户表(物理删除) + * + * @param ids id列表 + */ + void delete(List ids); + + /** + * 修改平台账户表 + * + * @param accountBankId + * @param accountBankVO + * @return + */ + void update(String accountBankId, AccountBankVO accountBankVO); + + /** + * 修改平台账户表 + * + * @param token + * @param accountBankId + * @param accountBankVO + * @return + */ + void update(String token, String accountBankId, AccountBankVO accountBankVO); + + /** + * 平台账户表详情 + * + * @param params 参数Map + * @return + */ + AccountBankDTO get(Map params); + + /** + * 平台账户表详情 + * + * @param accountBankId + * @return + */ + AccountBankDTO get(String accountBankId); + + /** + * 平台账户表详情 + * + * @param params 参数Map + * @return + */ + AccountBankBO getBO(Map params); + + /** + * 平台账户表详情 + * + * @param accountBankId + * @return + */ + AccountBankBO getBO(String accountBankId); + + /** + * 平台账户表详情 + * + * @param params 参数Map + * @return + */ + AccountBankPO getPO(Map params); + + /** + * 平台账户表详情 + * + * @param accountBankId + * @return + */ + AccountBankPO getPO(String accountBankId); + + /** + * 平台账户表列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 平台账户表列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 平台账户表列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 平台账户表分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 平台账户表统计 + * + * @param params + * @return + */ + Integer count(Map params); + + AccountBankDTO getOpen(); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/service/accountbank/impl/AccountBankServiceImpl.java b/src/main/java/cn/com/tenlion/operator/service/accountbank/impl/AccountBankServiceImpl.java new file mode 100644 index 0000000..ca3e361 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/accountbank/impl/AccountBankServiceImpl.java @@ -0,0 +1,188 @@ +package cn.com.tenlion.operator.service.accountbank.impl; + +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import cn.com.tenlion.operator.dao.accountbank.IAccountBankDao; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; +import cn.com.tenlion.operator.pojo.vos.accountbank.AccountBankVO; +import cn.com.tenlion.operator.pojo.bos.accountbank.AccountBankBO; +import cn.com.tenlion.operator.pojo.pos.accountbank.AccountBankPO; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: AccountBankServiceImpl + * @Description: 平台账户表 + * @Author: CodeFactory + * @Date: 2024-03-05 09:30:50 + * @Version: 3.0 + **/ +@Service +public class AccountBankServiceImpl extends DefaultBaseService implements IAccountBankService { + + @Autowired + private IAccountBankDao accountBankDao; + + @Override + public void save(AccountBankVO accountBankVO) { + saveReturnId(accountBankVO); + } + + @Override + public void save(String token, AccountBankVO accountBankVO) { + saveReturnId(token, accountBankVO); + } + + @Override + public String saveReturnId(AccountBankVO accountBankVO) { + return saveReturnId(null, accountBankVO); + } + + @Override + public String saveReturnId(String token, AccountBankVO accountBankVO) { + String accountBankId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(accountBankVO); + params.put("accountBankId", accountBankId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + if (accountBankVO.getBankSwitch().equals("1")) { + Map updateParam = getHashMap(2); + updateParam.put("bankSwitch", "0"); + accountBankDao.updateSwitch(updateParam); + } + accountBankDao.save(params); + return accountBankId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("accountBankIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + accountBankDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("accountBankIds", ids); + accountBankDao.delete(params); + } + + @Override + public void update(String accountBankId, AccountBankVO accountBankVO) { + update(null, accountBankId, accountBankVO); + } + + @Override + public void update(String token, String accountBankId, AccountBankVO accountBankVO) { + Map params = HashMapUtil.beanToMap(accountBankVO); + params.put("accountBankId", accountBankId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + if (accountBankVO.getBankSwitch().equals("1")) { + Map updateParam = getHashMap(2); + updateParam.put("bankSwitch", "0"); + accountBankDao.updateSwitch(updateParam); + } + accountBankDao.update(params); + } + + @Override + public AccountBankDTO get(Map params) { + return accountBankDao.get(params); + } + + @Override + public AccountBankDTO get(String accountBankId) { + Map params = super.getHashMap(2); + params.put("accountBankId", accountBankId); + return get(params); + } + + @Override + public AccountBankBO getBO(Map params) { + return accountBankDao.getBO(params); + } + + @Override + public AccountBankBO getBO(String accountBankId) { + Map params = super.getHashMap(2); + params.put("accountBankId", accountBankId); + return getBO(params); + } + + @Override + public AccountBankPO getPO(Map params) { + return accountBankDao.getPO(params); + } + + @Override + public AccountBankPO getPO(String accountBankId) { + Map params = super.getHashMap(2); + params.put("accountBankId", accountBankId); + return getPO(params); + } + + @Override + public List list(Map params) { + return accountBankDao.list(params); + } + + @Override + public List listBO(Map params) { + return accountBankDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return accountBankDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List accountBankDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(accountBankDTOs); + return new SuccessResultList<>(accountBankDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = accountBankDao.count(params); + return count == null ? 0 : count; + } + + @Override + public AccountBankDTO getOpen() { + Map params = super.getHashMap(2); + AccountBankDTO open = accountBankDao.getOpen(params); + return open; + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/service/accountrecharge/impl/AccountRechargeServiceImpl.java b/src/main/java/cn/com/tenlion/operator/service/accountrecharge/impl/AccountRechargeServiceImpl.java index 37f5138..66bc5e9 100644 --- a/src/main/java/cn/com/tenlion/operator/service/accountrecharge/impl/AccountRechargeServiceImpl.java +++ b/src/main/java/cn/com/tenlion/operator/service/accountrecharge/impl/AccountRechargeServiceImpl.java @@ -1,12 +1,14 @@ package cn.com.tenlion.operator.service.accountrecharge.impl; import cn.com.tenlion.operator.pojo.dtos.account.AccountDTO; +import cn.com.tenlion.operator.pojo.dtos.accountbank.AccountBankDTO; import cn.com.tenlion.operator.pojo.dtos.accountrecharge.AccountRechargePayDTO; import cn.com.tenlion.operator.pojo.dtos.accountrecharge.AccountRechargePayResultDTO; -import cn.com.tenlion.operator.pojo.dtos.accountwithdrawal.AccountWithdrawalDTO; import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemVO; import cn.com.tenlion.operator.service.account.IAccountService; +import cn.com.tenlion.operator.service.accountbank.IAccountBankService; import cn.com.tenlion.operator.service.accountitem.IAccountItemService; +import cn.com.tenlion.operator.service.remote.IRemoteWangGengInvoiceService; import cn.com.tenlion.operator.util.UserUtil; import cn.com.tenlion.operator.util.pay.PayUtil; import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; @@ -16,8 +18,6 @@ import ink.wgink.exceptions.SearchException; import ink.wgink.interfaces.user.IUserBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.dtos.user.UserDTO; -import ink.wgink.pojo.result.SuccessResult; -import ink.wgink.pojo.result.SuccessResultData; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.date.DateUtil; import ink.wgink.util.map.HashMapUtil; @@ -32,6 +32,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -272,13 +273,14 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA @Override public AccountRechargePayDTO saveAccount(String thirdParty, AccountRechargeVO accountRechargeVO) { + String userId = StringUtils.isEmpty(accountRechargeVO.getUserId()) ? userUtil.getUserId(null) : accountRechargeVO.getUserId(); // 查看该用户今日的记录, 超过50条不能再创建 - Integer count = accountRechargeDao.getTodayByAccountId(userUtil.getUserId(null)); + Integer count = accountRechargeDao.getTodayByAccountId(userId); if (count > 50) { throw new SaveException("禁止操作"); } accountRechargeVO.setThirdParty(thirdParty); - accountRechargeVO.setAccountId(userUtil.getUserId(null)); + accountRechargeVO.setAccountId(userId); accountRechargeVO.setRechargeCheck("0"); accountRechargeVO.setReconciliationStatus("0"); Integer totalMoney = PayUtil.buiderMoney(accountRechargeVO.getRechargeMoney()); @@ -294,7 +296,7 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA params.put("accountRechargeId", accountRechargeId); params.put("rechargeFinalTime", DateUtil.getTime()); - String brcode = PayUtil.nativePay("AI平台充值", accountRechargeId, totalMoney); + String brcode = PayUtil.nativePay(ProjectConfigUtil.getText("RechargePayTitle"), accountRechargeId, totalMoney); payDTO.setAccountRechargeId(accountRechargeId); payDTO.setThirdParty(thirdParty); @@ -307,7 +309,12 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA payDTO.setAccountRechargeId(accountRechargeId); } - setSaveInfo(params); + String currentDate = DateUtil.getTime(); + params.put("creator", userId); + params.put("gmtCreate", currentDate); + params.put("modifier", userId); + params.put("gmtModified", currentDate); + params.put("isDelete", 0); accountRechargeDao.save(params); return payDTO; } @@ -328,6 +335,9 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA return list; } + @Autowired + private IAccountBankService iAccountBankService; + @Override public void updateOrgData(String accountRechargeId, AccountRechargeVO accountRechargeVO) { Map params = super.getHashMap(2); @@ -338,7 +348,7 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA throw new SaveException("公司名称不能为空"); } if (StringUtils.isEmpty(accountRechargeVO.getOrgNumber())) { - throw new SaveException("银行卡号不能为空"); + throw new SaveException("银行账号不能为空"); } if (StringUtils.isEmpty(accountRechargeVO.getRechargeFinalTime())) { throw new SaveException("打款时间不能为空"); @@ -352,10 +362,13 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA params.put("orgBank", accountRechargeVO.getOrgBank()); params.put("orgNumber", accountRechargeVO.getOrgNumber()); params.put("rechargeFinalTime", accountRechargeVO.getRechargeFinalTime()); - AccountDTO accountDTO = iAccountService.getByUserId("1"); - String selfData = "

公司名称 : " + accountDTO.getBankAccountName() + "

\n" + - "

开户银行 : " + accountDTO.getBankName() + "

\n" + - "

银行卡号 : " + accountDTO.getBankNumber() + "

"; + // AccountDTO accountDTO = iAccountService.getByUserId("1"); + AccountBankDTO bankDTO = iAccountBankService.getOpen(); + String selfData = "

公司名称 : " + bankDTO.getBankAccountName() + "

\n" + + "

开户银行 : " + bankDTO.getBankName() + "

\n" + + "

银行账号 : " + bankDTO.getBankNumber() + "

\n" + + "

银行联行号 : " + bankDTO.getBankUnionpayNumber() + "

\n" + + "

备注内容 : " + bankDTO.getBankRemark() + "

"; params.put("selfData", selfData); params.put("rechargeRemark", accountRechargeVO.getRechargeRemark()); accountRechargeDao.update(params); @@ -432,6 +445,9 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA } } + @Autowired + private IRemoteWangGengInvoiceService remoteWangGengInvoiceSerivceImpl; + @Override public synchronized void saveConfirmOnline(String id, String orderId, String successTime) { AccountRechargeDTO dto = get(id); @@ -446,6 +462,8 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA String accountItemId = iAccountItemService.saveReturnId(vo); // 2. 修改状态为2 updateCheck(dto.getAccountRechargeId(), "2", "线上充值", accountItemId, orderId, successTime); + // 3. 调用第三方接口, 告知充值到账 + // remoteWangGengInvoiceSerivceImpl.paySuccess(dto.getAccountId()); } } diff --git a/src/main/java/cn/com/tenlion/operator/service/agreement/IAgreementService.java b/src/main/java/cn/com/tenlion/operator/service/agreement/IAgreementService.java new file mode 100644 index 0000000..ff55da6 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/agreement/IAgreementService.java @@ -0,0 +1,189 @@ +package cn.com.tenlion.operator.service.agreement; + +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import cn.com.tenlion.operator.pojo.vos.agreement.AgreementVO; +import cn.com.tenlion.operator.pojo.bos.agreement.AgreementBO; +import cn.com.tenlion.operator.pojo.pos.agreement.AgreementPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IAgreementService + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +public interface IAgreementService { + + /** + * 新增平台协议管理 + * + * @param agreementVO + * @return + */ + void save(AgreementVO agreementVO); + + /** + * 新增平台协议管理 + * + * @param token + * @param agreementVO + * @return + */ + void save(String token, AgreementVO agreementVO); + + /** + * 新增平台协议管理 + * + * @param agreementVO + * @return agreementId + */ + String saveReturnId(AgreementVO agreementVO); + + /** + * 新增平台协议管理 + * + * @param token + * @param agreementVO + * @return agreementId + */ + String saveReturnId(String token, AgreementVO agreementVO); + + /** + * 删除平台协议管理 + * + * @param ids id列表 + * @return + */ + void remove(List ids); + + + /** + * 删除平台协议管理 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除平台协议管理(物理删除) + * + * @param ids id列表 + */ + void delete(List ids); + + /** + * 修改平台协议管理 + * + * @param agreementId + * @param agreementVO + * @return + */ + void update(String agreementId, AgreementVO agreementVO); + + /** + * 修改平台协议管理 + * + * @param token + * @param agreementId + * @param agreementVO + * @return + */ + void update(String token, String agreementId, AgreementVO agreementVO); + + /** + * 平台协议管理详情 + * + * @param params 参数Map + * @return + */ + AgreementDTO get(Map params); + + /** + * 平台协议管理详情 + * + * @param agreementId + * @return + */ + AgreementDTO get(String agreementId); + + /** + * 平台协议管理详情 + * + * @param params 参数Map + * @return + */ + AgreementBO getBO(Map params); + + /** + * 平台协议管理详情 + * + * @param agreementId + * @return + */ + AgreementBO getBO(String agreementId); + + /** + * 平台协议管理详情 + * + * @param params 参数Map + * @return + */ + AgreementPO getPO(Map params); + + /** + * 平台协议管理详情 + * + * @param agreementId + * @return + */ + AgreementPO getPO(String agreementId); + + /** + * 平台协议管理列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 平台协议管理列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 平台协议管理列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 平台协议管理分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 平台协议管理统计 + * + * @param params + * @return + */ + Integer count(Map params); + + AgreementDTO getByType(String type); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/service/agreement/impl/AgreementServiceImpl.java b/src/main/java/cn/com/tenlion/operator/service/agreement/impl/AgreementServiceImpl.java new file mode 100644 index 0000000..9387f68 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/agreement/impl/AgreementServiceImpl.java @@ -0,0 +1,176 @@ +package cn.com.tenlion.operator.service.agreement.impl; + +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import cn.com.tenlion.operator.dao.agreement.IAgreementDao; +import cn.com.tenlion.operator.pojo.dtos.agreement.AgreementDTO; +import cn.com.tenlion.operator.pojo.vos.agreement.AgreementVO; +import cn.com.tenlion.operator.pojo.bos.agreement.AgreementBO; +import cn.com.tenlion.operator.pojo.pos.agreement.AgreementPO; +import cn.com.tenlion.operator.service.agreement.IAgreementService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: AgreementServiceImpl + * @Description: 平台协议管理 + * @Author: CodeFactory + * @Date: 2024-03-05 09:32:44 + * @Version: 3.0 + **/ +@Service +public class AgreementServiceImpl extends DefaultBaseService implements IAgreementService { + + @Autowired + private IAgreementDao agreementDao; + + @Override + public void save(AgreementVO agreementVO) { + saveReturnId(agreementVO); + } + + @Override + public void save(String token, AgreementVO agreementVO) { + saveReturnId(token, agreementVO); + } + + @Override + public String saveReturnId(AgreementVO agreementVO) { + return saveReturnId(null, agreementVO); + } + + @Override + public String saveReturnId(String token, AgreementVO agreementVO) { + String agreementId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(agreementVO); + params.put("agreementId", agreementId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + agreementDao.save(params); + return agreementId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("agreementIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + agreementDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("agreementIds", ids); + agreementDao.delete(params); + } + + @Override + public void update(String agreementId, AgreementVO agreementVO) { + update(null, agreementId, agreementVO); + } + + @Override + public void update(String token, String agreementId, AgreementVO agreementVO) { + Map params = HashMapUtil.beanToMap(agreementVO); + params.put("agreementId", agreementId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + agreementDao.update(params); + } + + @Override + public AgreementDTO get(Map params) { + return agreementDao.get(params); + } + + @Override + public AgreementDTO get(String agreementId) { + Map params = super.getHashMap(2); + params.put("agreementId", agreementId); + return get(params); + } + + @Override + public AgreementBO getBO(Map params) { + return agreementDao.getBO(params); + } + + @Override + public AgreementBO getBO(String agreementId) { + Map params = super.getHashMap(2); + params.put("agreementId", agreementId); + return getBO(params); + } + + @Override + public AgreementPO getPO(Map params) { + return agreementDao.getPO(params); + } + + @Override + public AgreementPO getPO(String agreementId) { + Map params = super.getHashMap(2); + params.put("agreementId", agreementId); + return getPO(params); + } + + @Override + public List list(Map params) { + return agreementDao.list(params); + } + + @Override + public List listBO(Map params) { + return agreementDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return agreementDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List agreementDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(agreementDTOs); + return new SuccessResultList<>(agreementDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = agreementDao.count(params); + return count == null ? 0 : count; + } + + @Override + public AgreementDTO getByType(String type) { + return agreementDao.getByType(type); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceApi.java b/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceApi.java new file mode 100644 index 0000000..1fa4d47 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceApi.java @@ -0,0 +1,77 @@ +package cn.com.tenlion.operator.service.remote; + +import ink.wgink.annotation.rpc.rest.RemoteService; +import ink.wgink.annotation.rpc.rest.method.RemoteGetMethod; +import ink.wgink.annotation.rpc.rest.method.RemotePutMethod; +import ink.wgink.annotation.rpc.rest.params.RemoteJsonBodyParams; +import ink.wgink.annotation.rpc.rest.params.RemotePathParams; +import ink.wgink.annotation.rpc.rest.params.RemoteQueryParams; +import ink.wgink.annotation.rpc.rest.params.RemoteServerParams; +import ink.wgink.pojo.result.SuccessResultList; +import io.swagger.annotations.ApiImplicitParam; + +import java.util.List; + + +/** + * 外部接口API + */ +@RemoteService +public interface IRemoteWangGengInvoiceApi { + + /** + * @param serverPath 服务地址 + * @param accessToken accessToken + * @return + */ + @RemoteGetMethod("resource/invoice/listpage") + SuccessResultList> listPage( + @RemoteServerParams String serverPath, + @RemoteQueryParams("access_token") String accessToken, + @RemoteQueryParams("page") int page, + @RemoteQueryParams("rows") int rows, + @RemoteQueryParams("keywords") String keywords, + @RemoteQueryParams("startTime") String startTime, + @RemoteQueryParams("endTime") String endTime, + @RemoteQueryParams("invoiceStatus") String invoiceStatus + ); + + /** + * @param serverPath 服务地址 + * @param accessToken accessToken + * @return + */ + @RemoteGetMethod("resource/invoice/get/{invoiceId}") + InvoiceDTO get( + @RemoteServerParams String serverPath, + @RemoteQueryParams("access_token") String accessToken, + @RemotePathParams("invoiceId") String invoiceId + ); + + + /** + * @param serverPath 服务地址 + * @param accessToken accessToken + * @return + */ + @RemotePutMethod("resource/invoice/update-examine/{invoiceId}") + InvoiceDTO update( + @RemoteServerParams String serverPath, + @RemoteQueryParams("access_token") String accessToken, + @RemotePathParams("invoiceId") String invoiceId, + @RemoteJsonBodyParams() InvoiceExamineVO invoiceExamineVO + ); + + /** + * @param serverPath 服务地址 + * @param accessToken accessToken + * @return + */ + @RemoteGetMethod("resource/sse/amount-received/user-id/{userId}") + InvoiceDTO paySuccess( + @RemoteServerParams String serverPath, + @RemoteQueryParams("access_token") String accessToken, + @RemotePathParams("userId") String userId + ); + +} diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceService.java b/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceService.java new file mode 100644 index 0000000..819297d --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/IRemoteWangGengInvoiceService.java @@ -0,0 +1,45 @@ +package cn.com.tenlion.operator.service.remote; + +import ink.wgink.annotation.rpc.rest.RemoteService; +import ink.wgink.annotation.rpc.rest.method.RemoteGetMethod; +import ink.wgink.annotation.rpc.rest.params.RemotePathParams; +import ink.wgink.annotation.rpc.rest.params.RemoteQueryParams; +import ink.wgink.annotation.rpc.rest.params.RemoteServerParams; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; + +import java.util.List; + + +/** + * 外部接口API + */ +@RemoteService +public interface IRemoteWangGengInvoiceService { + + + /** + * 客户申请的发票列表 + * @param page + * @param invoiceStatus + * @return + */ + SuccessResultList> listPage(ListPage page, String invoiceStatus); + + /** + * 客户申请的发票详情 + * @param invoiceId + * @return + */ + InvoiceDTO get(String invoiceId); + + /** + * 修改 + * @param invoiceId + * @param invoiceExamineVO + */ + void update(String invoiceId, InvoiceExamineVO invoiceExamineVO); + + void paySuccess(String userId); + +} diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceDTO.java b/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceDTO.java new file mode 100644 index 0000000..1109d50 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceDTO.java @@ -0,0 +1,210 @@ +package cn.com.tenlion.operator.service.remote; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.print.attribute.standard.MediaSize; +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName: InvoiceDTO + * @Description: 发票管理 + * @Author: CodeFactory + * @Date: 2024-02-23 16:07:36 + * @Version: 3.0 + **/ +@ApiModel +public class InvoiceDTO { + + @ApiModelProperty(name = "invoiceId", value = "主键") + private String invoiceId; + @ApiModelProperty(name = "invoiceTitle", value = "名称") + private String invoiceTitle; + @ApiModelProperty(name = "invoiceNo", value = "纳税人识别号") + private String invoiceNo; + @ApiModelProperty(name = "invoiceAddress", value = "地址") + private String invoiceAddress; + @ApiModelProperty(name = "invoicePhone", value = "电话") + private String invoicePhone; + @ApiModelProperty(name = "invoiceBank", value = "开户行") + private String invoiceBank; + @ApiModelProperty(name = "invoiceAccount", value = "开户行账号") + private String invoiceAccount; + @ApiModelProperty(name = "invoiceAmount", value = "金额") + private Integer invoiceAmount; + @ApiModelProperty(name = "invoiceNote", value = "备注") + private String invoiceNote; + @ApiModelProperty(name = "invoiceStatus", value = "发票状态") + private String invoiceStatus; + @ApiModelProperty(name = "invoiceFiles", value = "发票文件") + private String invoiceFiles; + @ApiModelProperty(name = "invoiceFileList", value = "发票文件列表") + private List invoiceFileList; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "创建人") + private String creator; + @ApiModelProperty(name = "examineOpinion", value = "审核意见") + private String examineOpinion; + @ApiModelProperty(name = "examineUserId", value = "审核用户ID") + private String examineUserId; + @ApiModelProperty(name = "examineUserUsername", value = "审核用户名") + private String examineUserUsername; + @ApiModelProperty(name = "gmtExamine", value = "审核时间") + private String gmtExamine; + @ApiModelProperty(name = "orderIds", value = "订单列表") + private List orderIds; + + public String getInvoiceId() { + return invoiceId == null ? "" : invoiceId.trim(); + } + + public void setInvoiceId(String invoiceId) { + this.invoiceId = invoiceId; + } + + public String getInvoiceTitle() { + return invoiceTitle == null ? "" : invoiceTitle.trim(); + } + + public void setInvoiceTitle(String invoiceTitle) { + this.invoiceTitle = invoiceTitle; + } + + public String getInvoiceNo() { + return invoiceNo == null ? "" : invoiceNo.trim(); + } + + public void setInvoiceNo(String invoiceNo) { + this.invoiceNo = invoiceNo; + } + + public String getInvoiceAddress() { + return invoiceAddress == null ? "" : invoiceAddress.trim(); + } + + public void setInvoiceAddress(String invoiceAddress) { + this.invoiceAddress = invoiceAddress; + } + + public String getInvoicePhone() { + return invoicePhone == null ? "" : invoicePhone.trim(); + } + + public void setInvoicePhone(String invoicePhone) { + this.invoicePhone = invoicePhone; + } + + public String getInvoiceBank() { + return invoiceBank == null ? "" : invoiceBank.trim(); + } + + public void setInvoiceBank(String invoiceBank) { + this.invoiceBank = invoiceBank; + } + + public String getInvoiceAccount() { + return invoiceAccount == null ? "" : invoiceAccount.trim(); + } + + public void setInvoiceAccount(String invoiceAccount) { + this.invoiceAccount = invoiceAccount; + } + + public Integer getInvoiceAmount() { + return invoiceAmount == null ? 0 : invoiceAmount; + } + + public void setInvoiceAmount(Integer invoiceAmount) { + this.invoiceAmount = invoiceAmount; + } + + public String getInvoiceNote() { + return invoiceNote == null ? "" : invoiceNote.trim(); + } + + public void setInvoiceNote(String invoiceNote) { + this.invoiceNote = invoiceNote; + } + + public String getInvoiceStatus() { + return invoiceStatus == null ? "" : invoiceStatus.trim(); + } + + public void setInvoiceStatus(String invoiceStatus) { + this.invoiceStatus = invoiceStatus; + } + + public String getInvoiceFiles() { + return invoiceFiles == null ? "" : invoiceFiles.trim(); + } + + public void setInvoiceFiles(String invoiceFiles) { + this.invoiceFiles = invoiceFiles; + } + + public List getInvoiceFileList() { + return invoiceFileList == null ? new ArrayList<>() : invoiceFileList; + } + + public void setInvoiceFileList(List invoiceFileList) { + this.invoiceFileList = invoiceFileList; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getExamineOpinion() { + return examineOpinion; + } + + public void setExamineOpinion(String examineOpinion) { + this.examineOpinion = examineOpinion; + } + + public String getExamineUserId() { + return examineUserId; + } + + public void setExamineUserId(String examineUserId) { + this.examineUserId = examineUserId; + } + + public String getExamineUserUsername() { + return examineUserUsername; + } + + public void setExamineUserUsername(String examineUserUsername) { + this.examineUserUsername = examineUserUsername; + } + + public String getGmtExamine() { + return gmtExamine; + } + + public void setGmtExamine(String gmtExamine) { + this.gmtExamine = gmtExamine; + } + + public List getOrderIds() { + return orderIds; + } + + public void setOrderIds(List orderIds) { + this.orderIds = orderIds; + } +} diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceExamineVO.java b/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceExamineVO.java new file mode 100644 index 0000000..f0bc5d9 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/InvoiceExamineVO.java @@ -0,0 +1,61 @@ +package cn.com.tenlion.operator.service.remote; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel +public class InvoiceExamineVO { + + @ApiModelProperty(name = "status", value = "审核状态,COMPLETE:完成,FAILED:失败") + @CheckEmptyAnnotation(name = "审核状态", types = {"COMPLETE", "FAILED"}) + private String status; + @ApiModelProperty(name = "fileIds", value = "发票文件ID,多个逗号分隔,审核状态COMPLETE必填") + private String fileIds; + @ApiModelProperty(name = "opinion", value = "意见,审核状态FAILED必填") + private String opinion; + @ApiModelProperty(name = "userId", value = "审核人用户ID") + private String userId; + @ApiModelProperty(name = "username", value = "审核人用户名") + private String username; + + public String getStatus() { + return status == null ? "" : status.trim(); + } + + public void setStatus(String status) { + this.status = status; + } + + public String getFileIds() { + return fileIds == null ? "" : fileIds.trim(); + } + + public void setFileIds(String fileIds) { + this.fileIds = fileIds; + } + + public String getOpinion() { + return opinion == null ? "" : opinion.trim(); + } + + public void setOpinion(String opinion) { + this.opinion = opinion; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } +} diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/OrderDTO.java b/src/main/java/cn/com/tenlion/operator/service/remote/OrderDTO.java new file mode 100644 index 0000000..3842942 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/OrderDTO.java @@ -0,0 +1,97 @@ +package cn.com.tenlion.operator.service.remote; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: OrderDTO + * @Description: 用户订单 + * @Author: CodeFactory + * @Date: 2024-02-02 16:34:38 + * @Version: 3.0 + **/ +@ApiModel +public class OrderDTO { + + @ApiModelProperty(name = "orderId", value = "订单ID") + private String orderId; + @ApiModelProperty(name = "orderTime", value = "订单时间") + private Long orderTime; + @ApiModelProperty(name = "orderNo", value = "订单号") + private String orderNo; + @ApiModelProperty(name = "orderStatus", value = "订单状态") + private String orderStatus; + @ApiModelProperty(name = "totalAmount", value = "总金额") + private Integer totalAmount; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + @ApiModelProperty(name = "creator", value = "创建人") + private String creator; + @ApiModelProperty(name = "isInvoiced", value = "是否开票") + private Integer isInvoiced; + + public String getOrderId() { + return orderId == null ? "" : orderId.trim(); + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public Long getOrderTime() { + return orderTime == null ? 0L : orderTime; + } + + public void setOrderTime(Long orderTime) { + this.orderTime = orderTime; + } + + public String getOrderNo() { + return orderNo == null ? "" : orderNo.trim(); + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getOrderStatus() { + return orderStatus == null ? "" : orderStatus.trim(); + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public Integer getTotalAmount() { + return totalAmount == null ? 0 : totalAmount; + } + + public void setTotalAmount(Integer totalAmount) { + this.totalAmount = totalAmount; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreator() { + return creator == null ? "" : creator.trim(); + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public Integer getIsInvoiced() { + return isInvoiced; + } + + public void setIsInvoiced(Integer isInvoiced) { + this.isInvoiced = isInvoiced; + } +} diff --git a/src/main/java/cn/com/tenlion/operator/service/remote/impl/RemoteWangGengInvoiceSerivceImpl.java b/src/main/java/cn/com/tenlion/operator/service/remote/impl/RemoteWangGengInvoiceSerivceImpl.java new file mode 100644 index 0000000..8e1adc1 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/service/remote/impl/RemoteWangGengInvoiceSerivceImpl.java @@ -0,0 +1,66 @@ +package cn.com.tenlion.operator.service.remote.impl; + +import cn.com.tenlion.operator.service.remote.IRemoteWangGengInvoiceApi; +import cn.com.tenlion.operator.service.remote.IRemoteWangGengInvoiceService; +import cn.com.tenlion.operator.service.remote.InvoiceDTO; +import cn.com.tenlion.operator.service.remote.InvoiceExamineVO; +import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; +import ink.wgink.exceptions.SearchException; +import ink.wgink.module.oauth2.manager.OAuth2ClientTokenManager; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import java.util.List; + +/** + * 外部接口 + * @author : LY + * @date :2024-1-23 17:24 + * @description : + * @modyified By: + */ +@Service +public class RemoteWangGengInvoiceSerivceImpl implements IRemoteWangGengInvoiceService { + + @Autowired + private IRemoteWangGengInvoiceApi iRemoteWangGengInvoiceApi; + + /** + * 获取accesstoken + * @return + */ + private String getAccessToken(){ + String accessToken = OAuth2ClientTokenManager.getInstance().getToken().getAccessToken(); + if(StringUtils.isBlank(accessToken)){ + throw new SearchException("获取accesstoken失败"); + } + return accessToken; + } + + @Override + public SuccessResultList> listPage(ListPage page, String invoiceStatus) { + String keyword = page.getParams().get("keywords") == null ? "" : page.getParams().get("keywords").toString(); + String startTime = page.getParams().get("startTime") == null ? "" : page.getParams().get("startTime").toString(); + String endTime = page.getParams().get("endTime") == null ? "" : page.getParams().get("endTime").toString(); + return iRemoteWangGengInvoiceApi.listPage(ProjectConfigUtil.getText("AiServerUrl"), this.getAccessToken(), page.getPage(), page.getRows(), keyword, startTime, endTime, invoiceStatus); + } + + @Override + public InvoiceDTO get(String invoiceId) { + return iRemoteWangGengInvoiceApi.get(ProjectConfigUtil.getText("AiServerUrl"), this.getAccessToken(), invoiceId); + } + + @Override + public void update(String invoiceId, InvoiceExamineVO invoiceExamineVO) { + iRemoteWangGengInvoiceApi.update(ProjectConfigUtil.getText("AiServerUrl"), this.getAccessToken(), invoiceId, invoiceExamineVO); + } + + @Override + public void paySuccess(String userId) { + iRemoteWangGengInvoiceApi.paySuccess(ProjectConfigUtil.getText("AiServerUrl"), this.getAccessToken(), userId); + } + +} diff --git a/src/main/java/cn/com/tenlion/operator/util/EncryptUtil.java b/src/main/java/cn/com/tenlion/operator/util/EncryptUtil.java index 4a23d7b..278cec5 100644 --- a/src/main/java/cn/com/tenlion/operator/util/EncryptUtil.java +++ b/src/main/java/cn/com/tenlion/operator/util/EncryptUtil.java @@ -1,16 +1,15 @@ package cn.com.tenlion.operator.util; -import com.alibaba.fastjson2.JSONObject; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.alibaba.fastjson.JSONObject; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; - import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; import java.security.SecureRandom; +import java.text.SimpleDateFormat; +import java.util.Map; /** * DES加密解密工具类 @@ -26,6 +25,22 @@ public class EncryptUtil { private final static String CODE_TYPE = "UTF-8"; private final static String KEY = "TENLIONS"; + public static void main(String[] args) throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + JSONObject j = new JSONObject(); + j.put("time", "2019-01-01 02:15:10"); + j.put("money", 52.3); + j.put("userId", "2"); + j.put("orderId", "1"); + System.out.println(encode(j.toJSONString())); + + // 加密记录 + String id1 = EncryptUtil.encode("2a039dea-e2ca-4600-a8aa-6c15713c5974"); + String id2 = EncryptUtil.encode("2a039dea-e2ca-4600-a8aa-6c15713c5974" + "_0" ); + System.out.println(id1); + System.out.println(id2); + } + /** * DES加密 * @param datasource diff --git a/src/main/java/cn/com/tenlion/operator/util/pay/PayUtil.java b/src/main/java/cn/com/tenlion/operator/util/pay/PayUtil.java index aff1201..d4b104e 100644 --- a/src/main/java/cn/com/tenlion/operator/util/pay/PayUtil.java +++ b/src/main/java/cn/com/tenlion/operator/util/pay/PayUtil.java @@ -12,6 +12,7 @@ import com.google.zxing.client.j2se.MatrixToImageWriter; import com.wechat.pay.java.core.Config; import com.wechat.pay.java.core.RSAAutoCertificateConfig; import com.wechat.pay.java.service.payments.model.Transaction; +import com.wechat.pay.java.service.payments.model.TransactionAmount; import com.wechat.pay.java.service.payments.nativepay.NativePayService; import com.wechat.pay.java.service.payments.nativepay.model.*; import ink.wgink.common.base.DefaultBaseService; @@ -132,6 +133,8 @@ public class PayUtil { Transaction response = service.queryOrderByOutTradeNo(request); String order = response.getTransactionId(); // 第三方订单号 Transaction.TradeStateEnum status = response.getTradeState(); + TransactionAmount amount = response.getAmount(); + dto.setMoney(amount.getPayerTotal()); String time = response.getSuccessTime(); dto.setAccountRechargeId(rechargeOrderId); dto.setOrderSuccessTime(status.name().equals("SUCCESS") ? convertToFormattedString(time) : ""); @@ -143,10 +146,14 @@ public class PayUtil { return dto; } + /** + * 获取5分钟后超时时间 + * @return + */ public static String getTimeExpire() { // 当前时间 LocalDateTime now = LocalDateTime.now(); - // 15分钟前的时间 + // 5分钟前的时间 LocalDateTime fifteenMinutesAgo = now.plusMinutes(5); // 获取时区信息(以北京时间为例) ZoneId zoneId = ZoneId.of("Asia/Shanghai"); // 东八区时区 @@ -159,6 +166,11 @@ public class PayUtil { return formattedDateTime; } + /** + * 时间格式转换 + * @param inputDateTime + * @return + */ public static String convertToFormattedString(String inputDateTime) { // 将字符串解析为ZonedDateTime对象 ZonedDateTime zonedDateTime = ZonedDateTime.parse(inputDateTime); @@ -191,7 +203,7 @@ public class PayUtil { request.setMchid("1609461201"); request.setTimeExpire(getTimeExpire()); request.setDescription(title);// 商品描述 - request.setNotifyUrl("http://121.36.71.250:58085/operator/api/account/pay/" + orderId);// 支付成功的回调地址 + request.setNotifyUrl(ProjectConfigUtil.getText("WechatPayCallbackUrl") + "api/account/pay/" + orderId);// 支付成功的回调地址 request.setOutTradeNo(orderId); // 调用下单方法,得到应答 try { @@ -206,38 +218,38 @@ public class PayUtil { } } - /** - * 将BufferdImage转为base64图片 - * @param image - * @return - * @throws IOException - */ - public static String imageToBase64(BufferedImage image) throws IOException { - // 将BufferedImage转换为字节数组 - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ImageIO.write(image, "jpg", baos); // 或者使用 "png" 或 "bmp" 等其他图片格式 - byte[] imageBytes = baos.toByteArray(); - // 将字节数组转换为Base64编码的字符串 - String encodedImage = Base64.getEncoder().encodeToString(imageBytes); - return "data:image/jpeg;base64," + encodedImage; - } - - /** - * 生成二维码 - * @param text - * @param width - * @param height - * @return - * @throws WriterException - */ - public static BufferedImage generateQRCode(String text, int width, int height) throws WriterException { - QRCodeWriter qrCodeWriter = new QRCodeWriter(); - Map hints = new HashMap<>(); - hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 设置错误纠正级别为H - BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height, hints); - return MatrixToImageWriter.toBufferedImage(bitMatrix); - - } + /** + * 将BufferdImage转为base64图片 + * @param image + * @return + * @throws IOException + */ + public static String imageToBase64(BufferedImage image) throws IOException { + // 将BufferedImage转换为字节数组 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ImageIO.write(image, "jpg", baos); // 或者使用 "png" 或 "bmp" 等其他图片格式 + byte[] imageBytes = baos.toByteArray(); + // 将字节数组转换为Base64编码的字符串 + String encodedImage = Base64.getEncoder().encodeToString(imageBytes); + return "data:image/jpeg;base64," + encodedImage; + } + + /** + * 生成二维码 + * @param text + * @param width + * @param height + * @return + * @throws WriterException + */ + public static BufferedImage generateQRCode(String text, int width, int height) throws WriterException { + QRCodeWriter qrCodeWriter = new QRCodeWriter(); + Map hints = new HashMap<>(); + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 设置错误纠正级别为H + BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height, hints); + return MatrixToImageWriter.toBufferedImage(bitMatrix); + + } /** * 二维码设置自定义的边框 diff --git a/src/main/java/cn/com/tenlion/operator/util/socket/MessageWebSocketServer.java b/src/main/java/cn/com/tenlion/operator/util/socket/MessageWebSocketServer.java new file mode 100644 index 0000000..e138054 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/util/socket/MessageWebSocketServer.java @@ -0,0 +1,100 @@ +package cn.com.tenlion.operator.util.socket; + +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; +import javax.websocket.*; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author WebSocketServer + */ +@ServerEndpoint("/socket") +@Component +public class MessageWebSocketServer { + + private final static ConcurrentHashMap SESSIONS = new ConcurrentHashMap(); + + @OnOpen + public void onOpen(Session session) { + System.out.println("链接成功......"); + SocketSession socketSession = new SocketSession(); + socketSession.setSession(session); + SESSIONS.put(session.getId(), socketSession); + } + + /** + * 客户端关闭 + * @param session session + */ + @OnClose + public void onClose(Session session) { + System.out.println("链接关闭......" + session.toString()); + SESSIONS.remove(session.getId()); + } + + /** + * 发生错误 + * @param error + */ + @OnError + public void onError(Session session, Throwable error) { + System.out.println("链接出错,关闭链接......"); + SESSIONS.remove(session.getId()); + } + + + /** + * 收到客户端发来消息 + * @param message 消息对象 + */ + @OnMessage + public void onMessage(String message, Session session) { + JSONObject jsonObject = JSONObject.parseObject(message); + String type = jsonObject.getString("type"); + if (!StringUtils.isEmpty(type)) { + SocketSession socketSession = SESSIONS.get(session.getId()); + socketSession.setType(type); + } + System.out.println("服务端收到客户端发来的消息: " + message); + } + + /** + * 群发消息 + * @param message 消息内容 + */ + public synchronized void sendAll(String type, String message) { + for (Map.Entry sessionEntry : SESSIONS.entrySet()) { + synchronized(sessionEntry) { + SocketSession socketSession = sessionEntry.getValue(); + if(socketSession.getSession().isOpen() && socketSession.getType().equals(type)) { + try { + socketSession.getSession().getBasicRemote().sendText(message); + } catch (IOException e) { + } + } + } + } + } + + /** + * 群发消息 + */ + public synchronized Boolean exists(String type) { + Map map = new HashMap<>(); + for (Map.Entry sessionEntry : SESSIONS.entrySet()) { + synchronized(sessionEntry) { + SocketSession socketSession = sessionEntry.getValue(); + if(socketSession.getSession().isOpen() && socketSession.getType().equals(type)) { + return true; + } + } + } + return false; + } + +} diff --git a/src/main/java/cn/com/tenlion/operator/util/socket/SocketSession.java b/src/main/java/cn/com/tenlion/operator/util/socket/SocketSession.java new file mode 100644 index 0000000..1b1e028 --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/util/socket/SocketSession.java @@ -0,0 +1,27 @@ +package cn.com.tenlion.operator.util.socket; + + +import javax.websocket.Session; + +public class SocketSession { + + private Session session; + + private String type; + + public Session getSession() { + return session; + } + + public void setSession(Session session) { + this.session = session; + } + + public String getType() { + return type == null ? "" : type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/src/main/java/cn/com/tenlion/operator/util/socket/WebSocketConfig.java b/src/main/java/cn/com/tenlion/operator/util/socket/WebSocketConfig.java new file mode 100644 index 0000000..7b992ef --- /dev/null +++ b/src/main/java/cn/com/tenlion/operator/util/socket/WebSocketConfig.java @@ -0,0 +1,19 @@ +package cn.com.tenlion.operator.util.socket; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +/** + * 开启WebSocket支持 + * @author zhengkai.blog.csdn.net + */ +@Configuration +public class WebSocketConfig { + + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } + +} diff --git a/src/main/java/cn/com/tenlion/operator/util/task/WxPayResultCheckTask.java b/src/main/java/cn/com/tenlion/operator/util/task/WxPayResultCheckTask.java index 983d397..a347c21 100644 --- a/src/main/java/cn/com/tenlion/operator/util/task/WxPayResultCheckTask.java +++ b/src/main/java/cn/com/tenlion/operator/util/task/WxPayResultCheckTask.java @@ -25,16 +25,22 @@ public class WxPayResultCheckTask { } /** - * 2分钟执行一次 + * 2分钟执行一次 | 关闭超时未付款的 */ @Scheduled(fixedRate = 60*1000*2) public void close() { // 关闭10分钟之前(未到账)的订单 List list = iAccountRechargeStaticService.getNotCloseRechargeList("微信"); for(AccountRechargeDTO dto : list) { - PayUtil.closeOrder(dto.getAccountRechargeId()); - // 修改状态 - iAccountRechargeStaticService.updateClose(dto.getAccountRechargeId()); + AccountRechargePayResultDTO payResultDTO = PayUtil.queryOrder(dto.getAccountRechargeId()); + // 成功 + if (payResultDTO.getOrderStatus().equals("1") && payResultDTO.getMoney().equals(PayUtil.buiderMoney(dto.getRechargeMoney()))) { + iAccountRechargeStaticService.saveConfirmOnline(dto.getAccountRechargeId(), payResultDTO.getOrderId(), payResultDTO.getOrderSuccessTime()); + }else{ + PayUtil.closeOrder(dto.getAccountRechargeId()); + // 修改状态 + iAccountRechargeStaticService.updateClose(dto.getAccountRechargeId()); + } } } @@ -48,7 +54,7 @@ public class WxPayResultCheckTask { for(AccountRechargeDTO dto : list) { AccountRechargePayResultDTO payResultDTO = PayUtil.queryOrder(dto.getAccountRechargeId()); // 成功 - if (payResultDTO.getOrderStatus().equals("1")) { + if (payResultDTO.getOrderStatus().equals("1") && payResultDTO.getMoney().equals(dto.getRechargeMoney())) { iAccountRechargeStaticService.saveConfirmOnline(dto.getAccountRechargeId(), payResultDTO.getOrderId(), payResultDTO.getOrderSuccessTime()); } } diff --git a/src/main/resources/application-lanproxy.yml b/src/main/resources/application-lanproxy.yml new file mode 100644 index 0000000..7bbafc0 --- /dev/null +++ b/src/main/resources/application-lanproxy.yml @@ -0,0 +1,240 @@ +server: + port: 8091 + url: http://121.36.71.250:58085/operator/ + ip: 192.168.0.115 + system-title: 运营平台 + system-sub-title: 运营平台 + default-index-page: route/systemuser/index + servlet: + context-path: /operator + +access-control: + # 跳过权限 + role-permission: false + +spring: + login-url: /route/systemuser/login + login-failure: /route/systemuser/login?error + login-process: /userlogin + assets-matchers: /assets/** + thymeleaf: + prefix: classpath:/templates/ + suffix: .html + mode: HTML5 + encoding: UTF-8 + cache: false + main: + allow-bean-definition-overriding: true + servlet: + multipart: + max-file-size: 1GB + max-request-size: 1GB + datasource: + druid: + url: jdbc:mysql://192.168.0.151/db_system_operator?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true + db-type: mysql + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: root + initial-size: 2 + min-idle: 2 + max-active: 10 + # 配置获取连接等待超时的时间 + max-wait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + time-between-eviction-runs-millis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + min-evictable-idle-time-millis: 300000 + validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + max-pool-prepared-statement-per-connection-size: 10 + # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 + filter: + commons-log: + connection-logger-name: stat,wall,log4j + stat: + log-slow-sql: true + slow-sql-millis: 2000 + # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + # 合并多个DruidDataSource的监控数据 + use-global-data-source-stat: true + + # 流程引擎 + activiti: + # flase: 默认值。activiti在启动时,会对比数据库表中保存的版本,如果没有表或者版本不匹配,将抛出异常。 + # true: activiti会对数据库中所有表进行更新操作。如果表不存在,则自动创建。 + # create_drop: 在activiti启动时创建表,在关闭时删除表(必须手动关闭引擎,才能删除表)。 + # drop-create: 在activiti启动时删除原来的旧表,然后在创建新表(不需要手动关闭引擎) + database-schema-update: true + #检测历史表是否存在 + db-history-used: true + # 记录历史等级 可配置的历史级别有none, acitivity, audit, all + history-level: full + # 检查流程定义 + check-process-definitions: false + rest-api-enabled: true + rest-api-servlet-name: activiti-swagger-document + SpringProcessEngineConfiguration: + activityFontName: 宋体 + labelFontName: 宋体 + dataSource: datasource + data: + mongodb: + uri: mongodb://smartcity:smartcity@10.25.248.193:6011/smartcity + redis: + database: 6 + host: 192.168.0.156 + port: 6379 + password: 666 + timeout: 3000ms + jedis: + pool: + max-active: 8 + max-wait: 1ms + max-idle: 8 + min-idle: 0 + kafka-local: + topics: tableSync + bootstrap-servers: 192.168.0.156:9093 + #bootstrap-servers: 175.24.42.217:9096 + #bootstrap-servers: 49.233.36.36:58093 + producer: + # 写入失败时,重试次数。当leader节点失效,一个repli节点会替代成为leader节点,此时可能出现写入失败, + # 当retris为0时,produce不会重复。retirs重发,此时repli节点完全成为leader节点,不会产生消息丢失。 + retries: 0 + #procedure要求leader在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化,其值可以为如下: + #acks = 0 如果设置为零,则生产者将不会等待来自服务器的任何确认,该记录将立即添加到套接字缓冲区并视为已发送。在这种情况下,无法保证服务器已收到记录,并且重试配置将不会生效(因为客户端通常不会知道任何故障),为每条记录返回的偏移量始终设置为-1。 + #acks = 1 这意味着leader会将记录写入其本地日志,但无需等待所有副本服务器的完全确认即可做出回应,在这种情况下,如果leader在确认记录后立即失败,但在将数据复制到所有的副本服务器之前,则记录将会丢失。 + #acks = all 这意味着leader将等待完整的同步副本集以确认记录,这保证了只要至少一个同步副本服务器仍然存活,记录就不会丢失,这是最强有力的保证,这相当于acks = -1的设置。 + #可以设置的值为:all, -1, 0, 1 + acks: 1 + consumer: + group-id: SmartCity + # smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest + auto-offset-reset: earliest + # 设置自动提交offset + enable-auto-commit: true + # 如果'enable.auto.commit'为true,则消费者偏移自动提交给Kafka的频率(以毫秒为单位),默认值为5000。 + auto-commit-interval: 100 + max-poll-records: 5 + +mybatis: + config-location: classpath:mybatis/mybatis-config.xml + mapper-locations: classpath*:mybatis/mapper/**/*.xml + +logging: + level: + root: error + cn.com.tenlion: debug + ink.wgink: debug + org.springframework.web.client: debug + +swagger: + base-package-list: ink.wgink,cn.com.tenlion + +# 文件上传管理 +file: + # 文件的保存路径 + upload-path: D:/CF_work/ideaWorkSpace/uploadFiles/case + # 图片类型 + image-types: png,jpg,jpeg,gif,blob + # 视频类型 + video-types: mp4,rmvb + # 音频类型 + audio-types: mp3,wmv + # 文件类型 + file-types: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf + # 同时上传最大支持数 + max-file-count: 6 + # 图片输出压缩质量,大于0,默认0.4 + image-output-quality: 0.4 + # 媒体最大时长(单位:秒) + media-max-duration: + # 后台 + backend: + video: 100 + audio: 600 + # 微信 + wechat: + video: 100 + audio: 600 + # app + app: + video: 100 + audio: 600 + +# 安全 +security: + oauth2: + oauth-server: http://121.36.71.250:58085/operator + oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} + client: + client-id: 46c4715a2a504dd48398bda88b5c3a88 + client-secret: Rlc0WlBvWGRRZVlJbGdPb3BnMzZxVmU1ZFlOdVFLcHo1QnFCQ1UvVFAzSGxIdG9KZmEyTjJIRnI0dG1McEdEVA== + user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize + access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token + grant-type: authorization_code + resource: + jwt: + key-uri: ${security.oauth2.oauth-server}/oauth2_client/token_key + token-info-uri: ${security.oauth2.oauth-server}/oauth2_client/check_token + user-info-uri: ${security.oauth2.oauth-server}/user + authorization: + check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key +api-path: + user-center: http://121.36.71.250:58085/operator/ + +#api-path: +# user-center: http://192.168.0.155:7011/usercenter +# user-center-2: http://${server.ip}/usercenter +# +#security: +# oauth2: +# oauth-server: ${api-path.user-center} +# oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} +# client: +# client-id: f7f93ed52a844d4aaf40eb5af22b401b +# client-secret: U2Vkenl2MGg3cThhTlI3bGN6VXdyOExubFowTWhsVWJsbVBTTXovNmhZemxIdG9KZmEyTjJIRnI0dG1McEdEVA== +# user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize +# access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token +# grant-type: authorization_code +# resource: +# jwt: +# key-uri: ${security.oauth2.oauth-server}/oauth2_client/token_key +# token-info-uri: ${security.oauth2.oauth-server}/oauth2_client/check_token +# user-info-uri: ${security.oauth2.oauth-server}/user +# authorization: +# check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key +# +# +# 短信验证码服务 +sms: + active: true + type: default + default-sms: + account: xd001382 + password: xd001382136 + sign: 【AIXXX平台】 + template: + verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' + +wxpay: + # 商户号 + mchId: 1609461201 + # 商户API证书序列号 + mchSerialNo: 2F16A068181C2998F3EE5271416F720AF0146293 + # 商户私钥文件 + # 注意:apiclient_key地址 + privateKeyPath: D:\AH\apiclient_key.pem + # APIv3密钥 + apiV3Key: _TSKJ_0471_TSkj_0471_tsKJ_0471__ + # APPID 小程序id + appid: wxe17874894f7ff27b + # 微信服务器地址 + domain: https://api.mch.weixin.qq.com + # 接收结果通知地址 + notifyUrl: xxx \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index c089364..92bbf32 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -167,6 +167,27 @@ file: video: 100 audio: 600 +# 安全 +security: + oauth2: + oauth-server: http://192.168.0.115:8091/operator/ + oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} + client: + client-id: 46c4715a2a504dd48398bda88b5c3a88 + client-secret: Rlc0WlBvWGRRZVlJbGdPb3BnMzZxVmU1ZFlOdVFLcHo1QnFCQ1UvVFAzSGxIdG9KZmEyTjJIRnI0dG1McEdEVA== + user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize + access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token + grant-type: authorization_code + resource: + jwt: + key-uri: ${security.oauth2.oauth-server}/oauth2_client/token_key + token-info-uri: ${security.oauth2.oauth-server}/oauth2_client/check_token + user-info-uri: ${security.oauth2.oauth-server}/user + authorization: + check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key +api-path: + user-center: http://192.168.0.115:8091/operator/ + #api-path: # user-center: http://192.168.0.155:7011/usercenter # user-center-2: http://${server.ip}/usercenter diff --git a/src/main/resources/mybatis/mapper/accountbank/account-bank-mapper.xml b/src/main/resources/mybatis/mapper/accountbank/account-bank-mapper.xml new file mode 100644 index 0000000..599dfcb --- /dev/null +++ b/src/main/resources/mybatis/mapper/accountbank/account-bank-mapper.xml @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE + operator_account_bank + SET + bank_switch = #{bankSwitch} + WHERE + 1 = 1 + + AND account_bank_id = #{accountBankId} + + + + + + + + INSERT INTO operator_account_bank( + account_bank_id, + bank_name, + bank_number, + bank_account_name, + bank_unionpay_number, + bank_remark, + bank_switch, + gmt_create, + creator, + gmt_modified, + modifier, + is_delete + ) VALUES( + #{accountBankId}, + #{bankName}, + #{bankNumber}, + #{bankAccountName}, + #{bankUnionpayNumber}, + #{bankRemark}, + #{bankSwitch}, + #{gmtCreate}, + #{creator}, + #{gmtModified}, + #{modifier}, + #{isDelete} + ) + + + + + UPDATE + operator_account_bank + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + account_bank_id IN + + #{accountBankIds[${index}]} + + + + + + DELETE FROM + operator_account_bank + WHERE + account_bank_id IN + + #{accountBankIds[${index}]} + + + + + + UPDATE + operator_account_bank + SET + + bank_name = #{bankName}, + + + bank_number = #{bankNumber}, + + + bank_account_name = #{bankAccountName}, + + + bank_unionpay_number = #{bankUnionpayNumber}, + + + bank_remark = #{bankRemark}, + + + bank_switch = #{bankSwitch}, + + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + account_bank_id = account_bank_id + WHERE + account_bank_id = #{accountBankId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/accountitem/account-item-mapper.xml b/src/main/resources/mybatis/mapper/accountitem/account-item-mapper.xml index 0eec90b..bdc499a 100644 --- a/src/main/resources/mybatis/mapper/accountitem/account-item-mapper.xml +++ b/src/main/resources/mybatis/mapper/accountitem/account-item-mapper.xml @@ -244,7 +244,7 @@ WHERE t1.account_id = #{accountId} ORDER BY - t1.gmt_create DESC + t1.id DESC diff --git a/src/main/resources/mybatis/mapper/accountrecharge/account-recharge-mapper.xml b/src/main/resources/mybatis/mapper/accountrecharge/account-recharge-mapper.xml index 0944178..a87bf74 100644 --- a/src/main/resources/mybatis/mapper/accountrecharge/account-recharge-mapper.xml +++ b/src/main/resources/mybatis/mapper/accountrecharge/account-recharge-mapper.xml @@ -429,9 +429,9 @@ AND t1.reconciliation_status = '1' - + AND ( diff --git a/src/main/resources/mybatis/mapper/agreement/agreement-mapper.xml b/src/main/resources/mybatis/mapper/agreement/agreement-mapper.xml new file mode 100644 index 0000000..c3859ca --- /dev/null +++ b/src/main/resources/mybatis/mapper/agreement/agreement-mapper.xml @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO operator_agreement( + agreement_id, + agreement_title, + agreement_type, + agreement_content, + agreement_switch, + agreement_version, + gmt_create, + creator, + modifier, + gmt_modified, + is_delete + ) VALUES( + #{agreementId}, + #{agreementTitle}, + #{agreementType}, + #{agreementContent}, + #{agreementSwitch}, + #{agreementVersion}, + #{gmtCreate}, + #{creator}, + #{modifier}, + #{gmtModified}, + #{isDelete} + ) + + + + + UPDATE + operator_agreement + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + agreement_id IN + + #{agreementIds[${index}]} + + + + + + DELETE FROM + operator_agreement + WHERE + agreement_id IN + + #{agreementIds[${index}]} + + + + + + UPDATE + operator_agreement + SET + + agreement_title = #{agreementTitle}, + + + agreement_content = #{agreementContent}, + + + agreement_switch = #{agreementSwitch}, + + + agreement_version = #{agreementVersion}, + + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + agreement_id = agreement_id + WHERE + agreement_id = #{agreementId} + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/assets/js/vendor/wangEditor/jquery-1.7.2.js b/src/main/resources/static/assets/js/vendor/wangEditor/jquery-1.7.2.js new file mode 100644 index 0000000..0f257cb --- /dev/null +++ b/src/main/resources/static/assets/js/vendor/wangEditor/jquery-1.7.2.js @@ -0,0 +1,9404 @@ +/*! + * jQuery JavaScript Library v1.7.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Wed Mar 21 12:46:34 2012 -0700 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + rmsPrefix = /^-ms-/, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context ? context.ownerDocument || context : document ); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.7.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.add( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.fireWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).off( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery.Callbacks( "once memory" ); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + var xml, tmp; + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array, i ) { + var len; + + if ( array ) { + if ( indexOf ) { + return indexOf.call( array, elem, i ); + } + + len = array.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in array && array[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, pass ) { + var exec, + bulk = key == null, + i = 0, + length = elems.length; + + // Sets many values + if ( key && typeof key === "object" ) { + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); + } + chainable = 1; + + // Sets one value + } else if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = pass === undefined && jQuery.isFunction( value ); + + if ( bulk ) { + // Bulk operations only iterate when executing function values + if ( exec ) { + exec = fn; + fn = function( elem, key, value ) { + return exec.call( jQuery( elem ), value ); + }; + + // Otherwise they run against the entire set + } else { + fn.call( elems, value ); + fn = null; + } + } + + if ( fn ) { + for (; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + } + + chainable = 1; + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +return jQuery; + +})(); + + +// String to Object flags format cache +var flagsCache = {}; + +// Convert String-formatted flags into Object-formatted ones and store in cache +function createFlags( flags ) { + var object = flagsCache[ flags ] = {}, + i, length; + flags = flags.split( /\s+/ ); + for ( i = 0, length = flags.length; i < length; i++ ) { + object[ flags[i] ] = true; + } + return object; +} + +/* + * Create a callback list using the following parameters: + * + * flags: an optional list of space-separated flags that will change how + * the callback list behaves + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible flags: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( flags ) { + + // Convert flags from String-formatted to Object-formatted + // (we check in cache first) + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + + var // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = [], + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Add one or several callbacks to the list + add = function( args ) { + var i, + length, + elem, + type, + actual; + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + // Inspect recursively + add( elem ); + } else if ( type === "function" ) { + // Add if not in unique mode and callback is not in + if ( !flags.unique || !self.has( elem ) ) { + list.push( elem ); + } + } + } + }, + // Fire callbacks + fire = function( context, args ) { + args = args || []; + memory = !flags.memory || [ context, args ]; + fired = true; + firing = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { + memory = true; // Mark as halted + break; + } + } + firing = false; + if ( list ) { + if ( !flags.once ) { + if ( stack && stack.length ) { + memory = stack.shift(); + self.fireWith( memory[ 0 ], memory[ 1 ] ); + } + } else if ( memory === true ) { + self.disable(); + } else { + list = []; + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + var length = list.length; + add( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away, unless previous + // firing was halted (stopOnFalse) + } else if ( memory && memory !== true ) { + firingStart = length; + fire( memory[ 0 ], memory[ 1 ] ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + var args = arguments, + argIndex = 0, + argLength = args.length; + for ( ; argIndex < argLength ; argIndex++ ) { + for ( var i = 0; i < list.length; i++ ) { + if ( args[ argIndex ] === list[ i ] ) { + // Handle firingIndex and firingLength + if ( firing ) { + if ( i <= firingLength ) { + firingLength--; + if ( i <= firingIndex ) { + firingIndex--; + } + } + } + // Remove the element + list.splice( i--, 1 ); + // If we have some unicity property then + // we only need to do this once + if ( flags.unique ) { + break; + } + } + } + } + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + if ( list ) { + var i = 0, + length = list.length; + for ( ; i < length; i++ ) { + if ( fn === list[ i ] ) { + return true; + } + } + } + return false; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory || memory === true ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( stack ) { + if ( firing ) { + if ( !flags.once ) { + stack.push( [ context, args ] ); + } + } else if ( !( flags.once && memory ) ) { + fire( context, args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + + + +var // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + + Deferred: function( func ) { + var doneList = jQuery.Callbacks( "once memory" ), + failList = jQuery.Callbacks( "once memory" ), + progressList = jQuery.Callbacks( "memory" ), + state = "pending", + lists = { + resolve: doneList, + reject: failList, + notify: progressList + }, + promise = { + done: doneList.add, + fail: failList.add, + progress: progressList.add, + + state: function() { + return state; + }, + + // Deprecated + isResolved: doneList.fired, + isRejected: failList.fired, + + then: function( doneCallbacks, failCallbacks, progressCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); + return this; + }, + always: function() { + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; + }, + pipe: function( fnDone, fnFail, fnProgress ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ], + progress: [ fnProgress, "notify" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + obj = promise; + } else { + for ( var key in promise ) { + obj[ key ] = promise[ key ]; + } + } + return obj; + } + }, + deferred = promise.promise({}), + key; + + for ( key in lists ) { + deferred[ key ] = lists[ key ].fire; + deferred[ key + "With" ] = lists[ key ].fireWith; + } + + // Handle state + deferred.done( function() { + state = "resolved"; + }, failList.disable, progressList.lock ).fail( function() { + state = "rejected"; + }, doneList.disable, progressList.lock ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = sliceDeferred.call( arguments, 0 ), + i = 0, + length = args.length, + pValues = new Array( length ), + count = length, + pCount = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(), + promise = deferred.promise(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( deferred, args ); + } + }; + } + function progressFunc( i ) { + return function( value ) { + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + deferred.notifyWith( promise, pValues ); + }; + } + if ( length > 1 ) { + for ( ; i < length; i++ ) { + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return promise; + } +}); + + + + +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + fragment, + tds, + events, + eventName, + i, + isSupported, + div = document.createElement( "div" ), + documentElement = document.documentElement; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + pixelMargin: true + }; + + // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead + jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for ( i in { + submit: 1, + change: 1, + focusin: 1 + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + fragment.removeChild( div ); + + // Null elements to avoid leaks in IE + fragment = select = opt = div = input = null; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, outer, inner, table, td, offsetSupport, + marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, + paddingMarginBorderVisibility, paddingMarginBorder, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + conMarginTop = 1; + paddingMarginBorder = "padding:0;margin:0;border:"; + positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; + paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; + style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; + html = "
" + + "" + + "
"; + + container = document.createElement("div"); + container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "
t
"; + tds = div.getElementsByTagName( "td" ); + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( window.getComputedStyle ) { + div.innerHTML = ""; + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.style.width = "2px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.innerHTML = ""; + div.style.width = div.style.padding = "1px"; + div.style.border = 0; + div.style.overflow = "hidden"; + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = "block"; + div.style.overflow = "visible"; + div.innerHTML = "
"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + } + + div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; + div.innerHTML = html; + + outer = div.firstChild; + inner = outer.firstChild; + td = outer.nextSibling.firstChild.firstChild; + + offsetSupport = { + doesNotAddBorder: ( inner.offsetTop !== 5 ), + doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) + }; + + inner.style.position = "fixed"; + inner.style.top = "20px"; + + // safari subtracts parent border width here which is 5px + offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); + inner.style.position = inner.style.top = ""; + + outer.style.overflow = "hidden"; + outer.style.position = "relative"; + + offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); + offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); + + if ( window.getComputedStyle ) { + div.style.marginTop = "1%"; + support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; + } + + if ( typeof container.style.zoom !== "undefined" ) { + container.style.zoom = 1; + } + + body.removeChild( container ); + marginDiv = div = container = null; + + jQuery.extend( support, offsetSupport ); + }); + + return support; +})(); + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var privateCache, thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, + isEvents = name === "events"; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = ++jQuery.uuid; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + privateCache = thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Users should not attempt to inspect the internal events object using jQuery.data, + // it is undocumented and subject to change. But does anyone listen? No. + if ( isEvents && !thisCache[ name ] ) { + return privateCache.events; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + // Reference to internal data cache key + internalKey = jQuery.expando, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ internalKey ] : internalKey; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + // Ensure that `cache` is not a window object #10080 + if ( jQuery.support.deleteExpando || !cache.setInterval ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the cache and need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ internalKey ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + } else { + elem[ internalKey ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, part, attr, name, l, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attr = elem.attributes; + for ( l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split( ".", 2 ); + parts[1] = parts[1] ? "." + parts[1] : ""; + part = parts[1] + "!"; + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + data = this.triggerHandler( "getData" + part, [ parts[0] ] ); + + // Try to fetch any internally stored data first + if ( data === undefined && elem ) { + data = jQuery.data( elem, key ); + data = dataAttr( elem, key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } + + parts[1] = value; + this.each(function() { + var self = jQuery( this ); + + self.triggerHandler( "setData" + part, parts ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + part, parts ); + }); + }, null, value, arguments.length > 1, null, false ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + jQuery.isNumeric( data ) ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery._data( elem, deferDataKey ); + if ( defer && + ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && + ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery._data( elem, queueDataKey ) && + !jQuery._data( elem, markDataKey ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.fire(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = ( type || "fx" ) + "mark"; + jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); + if ( count ) { + jQuery._data( elem, key, count ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + var q; + if ( elem ) { + type = ( type || "fx" ) + "queue"; + q = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + hooks = {}; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + jQuery._data( elem, type + ".run", hooks ); + fn.call( elem, function() { + jQuery.dequeue( elem, type ); + }, hooks ); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue " + type + ".run", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + count++; + tmp.add( resolve ); + } + } + resolve(); + return defer.promise( object ); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + nodeHook, boolHook, fixSpecified; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classNames, i, l, elem, className, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + classNames = ( value || "" ).split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + className = (" " + elem.className + " ").replace( rclass, " " ); + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[ c ] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, l, isBool, + i = 0; + + if ( value && elem.nodeType === 1 ) { + attrNames = value.toLowerCase().split( rspace ); + l = attrNames.length; + + for ( ; i < l; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + isBool = rboolean.test( name ); + + // See #9699 for explanation of this approach (setting first, then removal) + // Do not do this for boolean attributes (see #10870) + if ( !isBool ) { + jQuery.attr( elem, name, "" ); + } + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( isBool && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) +jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true, + coords: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.nodeValue = value + "" ); + } + }; + + // Apply the nodeHook to tabindex + jQuery.attrHooks.tabindex.set = nodeHook.set; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = "" + value ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); + + + + +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, + rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, + quickParse = function( selector ) { + var quick = rquickIs.exec( selector ); + if ( quick ) { + // 0 1 2 3 + // [ _, tag, id, class ] + quick[1] = ( quick[1] || "" ).toLowerCase(); + quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); + } + return quick; + }, + quickIs = function( elem, m ) { + var attrs = elem.attributes || {}; + return ( + (!m[1] || elem.nodeName.toLowerCase() === m[1]) && + (!m[2] || (attrs.id || {}).value === m[2]) && + (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) + ); + }, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, quick, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + quick: selector && quickParse( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + t, tns, type, origType, namespaces, origCount, + j, events, special, handle, eventType, handleObj; + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, [ "events", "handle" ], true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var type = event.type || event, + namespaces = [], + cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + old = null; + for ( ; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old && old === elem.ownerDocument ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = [].slice.call( arguments, 0 ), + run_all = !event.exclusive && !event.namespace, + special = jQuery.event.special[ event.type ] || {}, + handlerQueue = [], + i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers that should run if there are delegated events + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !(event.button && event.type === "click") ) { + + // Pregenerate a single jQuery object for reuse with .is() + jqcur = jQuery(this); + jqcur.context = this.ownerDocument || this; + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + + // Don't process events on disabled elements (#6911, #8165) + if ( cur.disabled !== true ) { + selMatch = {}; + matches = []; + jqcur[0] = cur; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = ( + handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) + ); + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) + if ( event.metaKey === undefined ) { + event.metaKey = event.ctrlKey; + } + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady + }, + + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.defaultPrevented && src.defaultPrevented() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector, + ret; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !form._submit_attached ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + form._submit_attached = true; + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + jQuery.event.simulate( "change", this, event, true ); + } + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + elem._change_attached = true; + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { // && selector != null + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + var handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( var type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + expando = "sizcache" + (Math.random() + '').replace('.', ''), + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rReturn = /\r\n/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context, seed ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set, seed ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set, i, len, match, type, left; + + if ( !expr ) { + return []; + } + + for ( i = 0, len = Expr.order.length; i < len; i++ ) { + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + type, found, item, filter, left, + i, pass, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + filter = Expr.filter[ type ]; + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + pass = not ^ found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Utility function for retreiving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +var getText = Sizzle.getText = function( elem ) { + var i, node, + nodeType = elem.nodeType, + ret = ""; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent || innerText for elements + if ( typeof elem.textContent === 'string' ) { + return elem.textContent; + } else if ( typeof elem.innerText === 'string' ) { + // Replace IE's carriage returns + return elem.innerText.replace( rReturn, '' ); + } else { + // Traverse it's children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + } else { + + // If no nodeType, this is expected to be an array + for ( i = 0; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + if ( node.nodeType !== 8 ) { + ret += getText( node ); + } + } + } + return ret; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var first, last, + doneName, parent, cache, + count, diff, + type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + /* falls through */ + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + first = match[2]; + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + doneName = match[0]; + parent = elem.parentNode; + + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { + count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent[ expando ] = doneName; + } + + diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Sizzle.attr ? + Sizzle.attr( elem, name ) : + Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + !type && Sizzle.attr ? + result != null : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} +// Expose origPOS +// "global" as in regardless of relation to brackets/parens +Expr.match.globalPOS = origPOS; + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context, seed ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet, seed ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +Sizzle.selectors.attrMap = {}; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.globalPOS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + POS.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array (deprecated as of jQuery 1.7) + if ( jQuery.isArray( selectors ) ) { + var level = 1; + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( i = 0; i < selectors.length; i++ ) { + + if ( jQuery( cur ).is( selectors[ i ] ) ) { + ret.push({ selector: selectors[ i ], elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} + + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /]", "i"), + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /\/(java|ecma)script/i, + rcleanScript = /^\s*", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and -->
- +
- +
@@ -70,7 +73,7 @@ var viewerObj = {}; // 初始化 - function initBankNameSelect(selectValue) { + /* function initBankNameSelect(selectValue) { top.restAjax.get(top.restAjax.path('api/data/listbyparentid/e38e8c46-56f7-49d7-8f9c-a4c36f89d994', []), {}, null, function(code, data, args) { laytpl(document.getElementById('bankNameSelectTemplate').innerHTML).render(data, function(html) { document.getElementById('bankNameSelectTemplateBox').innerHTML = html; @@ -83,7 +86,7 @@ top.dialog.msg(data.msg); }); } - +*/ function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -101,7 +104,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/account/get-byuser/[[${userId}]]', []), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('api/account/get-byuser/1', []), {}, null, function(code, data) { var dataFormData = {}; for(var i in data) { dataFormData[i] = data[i] +''; @@ -109,7 +112,7 @@ dataFormData['accountMoneyDouble'] = data.accountMoneyDouble + "元"; form.val('dataForm', dataFormData); form.render(null, 'dataForm'); - initBankNameSelect(data.bankName); + // initBankNameSelect(data.bankName); accountId = data.accountId; }, function(code, data) { top.dialog.msg(data.msg); @@ -126,7 +129,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/account/update/{accountId}', [accountId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('api/account/update/1', []), formData.field, null, function(code, data) { window.location.reload(); }, function(code, data) { top.dialog.msg(data.msg); diff --git a/src/main/resources/templates/account/list.html b/src/main/resources/templates/account/list.html index 0845fd9..b293be1 100644 --- a/src/main/resources/templates/account/list.html +++ b/src/main/resources/templates/account/list.html @@ -26,6 +26,12 @@
+
+ +
@@ -164,7 +170,8 @@ where: { keywords: $('#keywords').val(), startTime: $('#startTime').val(), - endTime: $('#endTime').val() + endTime: $('#endTime').val(), + accountRole: $('#accountRole').val() }, page: { curr: currentPage diff --git a/src/main/resources/templates/accountbank/list.html b/src/main/resources/templates/accountbank/list.html new file mode 100644 index 0000000..2d6e45e --- /dev/null +++ b/src/main/resources/templates/accountbank/list.html @@ -0,0 +1,278 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/accountbank/save.html b/src/main/resources/templates/accountbank/save.html new file mode 100644 index 0000000..aee0ca3 --- /dev/null +++ b/src/main/resources/templates/accountbank/save.html @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/accountbank/update.html b/src/main/resources/templates/accountbank/update.html new file mode 100644 index 0000000..6634ac9 --- /dev/null +++ b/src/main/resources/templates/accountbank/update.html @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/accountrecharge/pay.html b/src/main/resources/templates/accountrecharge/pay.html index b56a35e..9fbe3c4 100644 --- a/src/main/resources/templates/accountrecharge/pay.html +++ b/src/main/resources/templates/accountrecharge/pay.html @@ -1,7 +1,7 @@ - + @@ -43,7 +43,7 @@
- + @@ -53,7 +53,7 @@
收款方信息

公司名称 :

开户银行 :

-

银行卡号 :

+

银行账号 :

付款方信息
@@ -74,9 +74,9 @@
- +
- +
@@ -181,6 +181,17 @@ }); } + document.getElementById('rechargeMoney').addEventListener('input',function(){ + // 使用jQuery选择器选择所有单选框 + $("input[name='thirdParty']").each(function() { + // 移除checked属性 + $(this).prop('checked', false); + form.render(); + }); + $("#onLinePay").hide(); + $("#orgPay").hide(); + }); + // 初始化文件列表 function initFileList(fileName, ids, callback) { var dataForm = {}; @@ -266,6 +277,10 @@ layer.msg("充值金额不能为空"); return false; } + if ($('#rechargeMoney').val() > 2000) { + layer.msg("单次充值最多2000"); + return false; + } restAjax.post(restAjax.path('[[${operatorServerUrl}]]api/accountrecharge/save-account/{thirdParty}', [data.value]), {rechargeMoney: $('#rechargeMoney').val()}, null, function(code, data) { $('#accountRechargeId').val(data.accountRechargeId); if(selectValue != '对公转账') { @@ -274,6 +289,7 @@ $("#orgPay").hide(); $("#onLinePay").show(); qrCodeTimeOut(); + socket.send('{"type":"' + data.accountRechargeId + '"}'); }else{ $("#onLinePay").hide(); $("#orgPay").show(); @@ -314,6 +330,36 @@ parent.layer.close(parent.layer.getFrameIndex(window.name)); } + var path = $("#ibase").attr("href"); + var location = window.location.href + ""; + var socketUrl = (location.substring(0, location.indexOf(path) + path.length)).replace("https://", "wss:///").replace("http://", "ws:///") + "socket"; + + var socket; + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else{ + console.log("您的浏览器支持WebSocket"); + //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 + socket = new WebSocket(socketUrl); + //打开事件 + socket.onopen = function() { + console.log("Socket 已打开"); + }; + //获得消息事件 + socket.onmessage = function(msg) { + console.log(msg); + if(msg.data == 'success') { + layer.alert("您已付款成功"); + } + }; + //关闭事件 + socket.onclose = function() { + }; + //发生了错误事件 + socket.onerror = function() { + } + } + // 提交表单 form.on('submit(submitForm)', function(formData) { if (formData.field["accountRechargeId"]) { diff --git a/src/main/resources/templates/accountrecharge/save-account.html b/src/main/resources/templates/accountrecharge/save-account.html index 3fcfa90..b0e51c9 100644 --- a/src/main/resources/templates/accountrecharge/save-account.html +++ b/src/main/resources/templates/accountrecharge/save-account.html @@ -55,7 +55,7 @@

公司名称 :

开户银行 :

-

银行卡号 :

+

银行账号 :

付款方信息

@@ -72,9 +72,9 @@
- +
- +
diff --git a/src/main/resources/templates/accountrecharge/update.html b/src/main/resources/templates/accountrecharge/update.html index 7728e2e..267a2e6 100644 --- a/src/main/resources/templates/accountrecharge/update.html +++ b/src/main/resources/templates/accountrecharge/update.html @@ -92,7 +92,7 @@
- +
@@ -119,7 +119,7 @@
- +
diff --git a/src/main/resources/templates/accountwithdrawal/data.html b/src/main/resources/templates/accountwithdrawal/data.html index 58f7c6e..199aadb 100644 --- a/src/main/resources/templates/accountwithdrawal/data.html +++ b/src/main/resources/templates/accountwithdrawal/data.html @@ -26,7 +26,7 @@
- +
diff --git a/src/main/resources/templates/accountwithdrawal/save-account.html b/src/main/resources/templates/accountwithdrawal/save-account.html index ba03eab..3cc6392 100644 --- a/src/main/resources/templates/accountwithdrawal/save-account.html +++ b/src/main/resources/templates/accountwithdrawal/save-account.html @@ -26,7 +26,7 @@
- +
diff --git a/src/main/resources/templates/accountwithdrawal/save.html b/src/main/resources/templates/accountwithdrawal/save.html index d3ad360..68ea339 100644 --- a/src/main/resources/templates/accountwithdrawal/save.html +++ b/src/main/resources/templates/accountwithdrawal/save.html @@ -39,7 +39,7 @@
- +
diff --git a/src/main/resources/templates/accountwithdrawal/update.html b/src/main/resources/templates/accountwithdrawal/update.html index b7363c8..45e2f63 100644 --- a/src/main/resources/templates/accountwithdrawal/update.html +++ b/src/main/resources/templates/accountwithdrawal/update.html @@ -89,9 +89,9 @@
- +
- +
diff --git a/src/main/resources/templates/accountwithdrawal/upload.html b/src/main/resources/templates/accountwithdrawal/upload.html index 2b4ee8a..c600025 100644 --- a/src/main/resources/templates/accountwithdrawal/upload.html +++ b/src/main/resources/templates/accountwithdrawal/upload.html @@ -32,7 +32,7 @@
- +
diff --git a/src/main/resources/templates/agentcheck/audit.html b/src/main/resources/templates/agentcheck/audit.html index da2cdd7..2b56428 100644 --- a/src/main/resources/templates/agentcheck/audit.html +++ b/src/main/resources/templates/agentcheck/audit.html @@ -29,9 +29,9 @@ .layui-input{ border-style: hidden; padding-left: 0px; + font-weight: bold; } - .layui-form-text .layui-form-label{ background-color: #FFFFFF !important; border:none !important; @@ -49,6 +49,10 @@ border-radius: 10px; padding: 10px; } + + .layui-form-pane .layui-form-label{ + text-align: left; + } @@ -70,17 +74,27 @@
- +
-
- -
- +
+
+ +
+ +
+
+
+
+ + +
@@ -120,15 +134,25 @@
-
-
- -
- -
-
+ + + + + + + + + + +
@@ -155,9 +179,9 @@
@@ -204,14 +228,6 @@
- - - - - - - -
@@ -231,6 +247,17 @@ var basicsId = top.restAjax.params(window.location.href).basicsId; + + $("#editBasicsIntro").click(function() { + var html = $("#basicsIntro").val(); + var layIndex = top.layer.open({//layui的弹出层直接把获取到的编辑器html内容放到里面就可以显示 + title: '代理商简介', + type: 1, + area: ['85%', '85%'], + content: html//通过编辑器的监听onchange事件把编辑器内容放到id为bBody的input里 + }); + }); + $(".layui-input").prop("readonly", true); $(".layui-textarea").prop("readonly", true); function closeBox() { diff --git a/src/main/resources/templates/agentcheck/list-check.html b/src/main/resources/templates/agentcheck/list-check.html index 054892a..f20280b 100644 --- a/src/main/resources/templates/agentcheck/list-check.html +++ b/src/main/resources/templates/agentcheck/list-check.html @@ -26,12 +26,29 @@
+
+ +
- +
@@ -63,14 +80,13 @@ width: admin.screen() > 1 ? '100%' : '', height: $win.height() - 90, limit: 20, + defaultToolbar: [], + toolbar: '#headerToolBar', limits: [20, 40, 60, 80, 100, 200], request: { pageName: 'page', limitName: 'rows' }, - where:{ - auditStatus: 'AWAIT' - }, cols: [ [ {type:'checkbox', fixed: 'left'}, @@ -117,7 +133,13 @@ if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return '待审核'; + if(rowData == 'AWAIT') { + return '待审核'; + }else if(rowData == 'YES') { + return '审核通过'; + }else if(rowData == 'NO') { + return '审核未通过'; + } } }, {field: 'gmtCreate', width: 180, title: '申请时间', align:'center', @@ -131,8 +153,12 @@ }, {field: 'cz', width: 180, title: '操作', align:'center', templet: function(row) { + var rowData1 = row['auditStatus']; + if(rowData1 != 'AWAIT') { + return "-"; + } var rowData = '
'; - rowData += ' '; + rowData += ' '; rowData += '
'; return rowData; } @@ -157,7 +183,8 @@ where: { keywords: $('#keywords').val(), startTime: $('#startTime').val(), - endTime: $('#endTime').val() + endTime: $('#endTime').val(), + auditStatus: $('#auditStatus').val() }, page: { curr: currentPage @@ -231,6 +258,51 @@ }); } }); + + // 事件 - 增删改 + table.on('toolbar(dataTable)', function(obj) { + var layEvent = obj.event; + var checkStatus = table.checkStatus('dataTable'); + var checkDatas = checkStatus.data; + if (layEvent === 'showEvent') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectEdit); + } else if(checkDatas.length > 1) { + top.dialog.msg(top.dataMessage.table.selectOneEdit); + } else { + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['100%', '100%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/agentcheck/show?basicsId={basicsId}', [checkDatas[0].basicsId]), + end: function() { + reloadTable(); + } + }); + } + } else if(layEvent === 'itemEvent') { + if(checkDatas.length === 0) { + top.dialog.msg(top.dataMessage.table.selectEdit); + } else if(checkDatas.length > 1) { + top.dialog.msg(top.dataMessage.table.selectOneEdit); + } else { + top.layer.open({ + type: 2, + title: false, + closeBtn: 1, + area: ['80%', '90%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/accountitem/list?accountId={accountId}', [checkDatas[0].creator]), + end: function() { + } + }); + } + } + }); }); diff --git a/src/main/resources/templates/agentcheck/list.html b/src/main/resources/templates/agentcheck/list.html index a366f19..7ae36de 100644 --- a/src/main/resources/templates/agentcheck/list.html +++ b/src/main/resources/templates/agentcheck/list.html @@ -34,7 +34,7 @@ diff --git a/src/main/resources/templates/agentcheck/show.html b/src/main/resources/templates/agentcheck/show.html index 3381ca3..ec83d4a 100644 --- a/src/main/resources/templates/agentcheck/show.html +++ b/src/main/resources/templates/agentcheck/show.html @@ -26,6 +26,7 @@ .layui-input{ border-style: hidden; padding-left: 0px; + font-weight: bold; } .layui-form-text .layui-form-label{ @@ -48,6 +49,9 @@ .layui-rate li i.layui-icon { font-size: 16px; } + .layui-form-pane .layui-form-label{ + text-align: left; + } @@ -60,7 +64,7 @@ 基本信息
-
+
@@ -75,10 +79,20 @@
-
- -
- +
+
+ +
+ +
+
+
+
+ + +
@@ -145,7 +159,7 @@
- +
@@ -153,7 +167,7 @@
- +
@@ -163,7 +177,7 @@
- +
@@ -171,22 +185,32 @@
- +
-
+ + +
@@ -209,15 +233,13 @@
-
-
-
@@ -227,7 +249,7 @@
@@ -241,27 +263,27 @@ 类型 - 代理价格 + 对外发布价格(单位:元) 平台佣金 - 对外发布价格 + 代理商收益 普通件 - + 20% - =代理商价格+代理商价格*0.2 + = 对外发布价格 - 对外发布价格 * 0.2 加急件 - + 20% - =代理商价格+代理商价格*0.2 + = 对外发布价格 - 对外发布价格 * 0.2 @@ -269,6 +291,39 @@
+
+
+ + 审核日志 + +
+
+
+
    +
  • + +
    +
    + {{ data.gmtCreate }} +
    +
    +

    + {{ data.creatorName }} - + 提交审核 + 审核通过 + 审核未通过 +

    +

    + {{ data.auditLogExplain }} +

    +
    + +
    +
  • +
+
+
+
@@ -278,6 +333,7 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/agreement/save.html b/src/main/resources/templates/agreement/save.html new file mode 100644 index 0000000..83bbdd7 --- /dev/null +++ b/src/main/resources/templates/agreement/save.html @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/agreement/update.html b/src/main/resources/templates/agreement/update.html new file mode 100644 index 0000000..551c6f6 --- /dev/null +++ b/src/main/resources/templates/agreement/update.html @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/systemuser/login.html b/src/main/resources/templates/systemuser/login.html index 7b1f666..eedd92b 100644 --- a/src/main/resources/templates/systemuser/login.html +++ b/src/main/resources/templates/systemuser/login.html @@ -158,7 +158,8 @@ } #loginBox .btnlist { - display: block; + display: flex; + flex-direction: row; /*display: none;*/ width: 330px; height: 50px; @@ -181,23 +182,47 @@ text-align: center; /* margin-right: 30px; */ border: none; - border-bottom: 5px solid #fda633; + /*border-bottom: 5px solid #fda633;*/ background-color: transparent; cursor: pointer; } + #loginBox #change span { + display: block; + width: 40px; + height: 5px; + margin-left: 15px; + background-color: #fda633; + } #loginBox .btnlist button { font-size: 18px; margin-right: 30px; border: none; /*border-bottom: 5px solid #fda633;*/ + margin-bottom: 5px; background-color: transparent; cursor: pointer; } + #loginBox .btnlist div { + display: flex; + flex-direction: column; + justify-content: flex-start; + } + #loginBox .btnlist div:first-child span { + display: block; + width: 40px; + height: 5px; + margin-left: 15px; + background-color: #fda633; + + } + #loginBox .btnlist div:last-child span { + display: none; + width: 40px; + height: 5px; + margin-left: 20px; + background-color: #fda633; - #loginBox .btnlist button:first-child { - font-weight: 700; - border-bottom: 5px solid #fda633; } .forget-username-password { position: absolute; @@ -368,7 +393,7 @@
- +
@@ -141,7 +141,7 @@
{{# } }} -
+
diff --git a/src/main/resources/templates/withdrawinvoice/list-check.html b/src/main/resources/templates/withdrawinvoice/list-check.html index cf13499..b1f5107 100644 --- a/src/main/resources/templates/withdrawinvoice/list-check.html +++ b/src/main/resources/templates/withdrawinvoice/list-check.html @@ -117,7 +117,7 @@ if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return rowData; + return "" + rowData + ""; } }, {field: 'gmtCreate', width: 180, title: '创建时间', align:'center', diff --git a/src/main/resources/templates/withdrawinvoice/list.html b/src/main/resources/templates/withdrawinvoice/list.html index 8e86a8c..bc0b866 100644 --- a/src/main/resources/templates/withdrawinvoice/list.html +++ b/src/main/resources/templates/withdrawinvoice/list.html @@ -117,7 +117,7 @@ if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; } - return rowData; + return "" + rowData + ""; } }, {field: 'gmtCreate', width: 180, title: '创建时间', align:'center', diff --git a/src/main/resources/templates/withdrawinvoice/show.html b/src/main/resources/templates/withdrawinvoice/show.html index 5b89f7b..c822478 100644 --- a/src/main/resources/templates/withdrawinvoice/show.html +++ b/src/main/resources/templates/withdrawinvoice/show.html @@ -36,7 +36,7 @@
- +
@@ -68,9 +68,9 @@
- +
- +
@@ -392,19 +392,22 @@ } form.val('dataForm', dataFormData); form.render(null, 'dataForm'); - top.restAjax.get(top.restAjax.path('[[${AgentServerUrl}]]api/withdrawinvoice/getRemitTicket/{withdrawId}', [data.withdrawId]), {}, null, function(code, data2) { - dataFormData.fileId = data2.invoiceFile; - form.val('dataForm', dataFormData); - form.render(null, 'dataForm'); - $("#basicsName").val(basicsName); - initFileIdUploadFile(); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); - }); + initFileIdUploadFile(); + if (data.remitInvoiceDTO != null) { + top.restAjax.get(top.restAjax.path('[[${AgentServerUrl}]]api/withdrawinvoice/getRemitTicket/{withdrawId}', [data.withdrawId]), {}, null, function(code, data2) { + dataFormData.fileId = data2.invoiceFile; + form.val('dataForm', dataFormData); + form.render(null, 'dataForm'); + $("#basicsName").val(basicsName); + initFileIdUploadFile(); + }, function(code, data) { + top.dialog.msg(data.msg); + }, function() { + loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3}); + }, function() { + top.dialog.close(loadLayerIndex); + }); + } }, function(code, data) { top.dialog.msg(data.msg); }, function() { diff --git a/src/main/resources/templates/withdrawinvoice/update.html b/src/main/resources/templates/withdrawinvoice/update.html index 0a48b6d..9501d6c 100644 --- a/src/main/resources/templates/withdrawinvoice/update.html +++ b/src/main/resources/templates/withdrawinvoice/update.html @@ -36,7 +36,7 @@
- +
@@ -68,9 +68,9 @@
- +
- +
@@ -387,12 +387,13 @@ for(var i in data) { dataFormData[i] = data[i] +''; } + console.log(data.withdrawTaxpayerDTO); dataFormData['taxpayerBank'] = data.withdrawTaxpayerDTO.taxpayerBank; - dataFormData['taxpayerName'] = data.withdrawTaxpayerDTO.taxpayerName; dataFormData['taxpayerAddress'] = data.withdrawTaxpayerDTO.taxpayerAddress; dataFormData['taxpayerPhone'] = data.withdrawTaxpayerDTO.taxpayerPhone; dataFormData['taxpayerAccount'] = data.withdrawTaxpayerDTO.taxpayerAccount; dataFormData['taxpayerNumber'] = data.withdrawTaxpayerDTO.taxpayerNumber; + dataFormData['taxpayerName'] = data.withdrawTaxpayerDTO.taxpayerName; form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initFileIdUploadFile(); @@ -401,7 +402,9 @@ data1.accountMoney = (data1.accountMoney / 100.00) + "元"; data1.withdawMoney = (data1.withdawMoney / 100.00) + "元"; for(var i in data1) { - dataFormData[i] = data1[i] +''; + if (i != 'taxpayerNumber' && i != 'taxpayerName') { + dataFormData[i] = data1[i] +''; + } } form.val('dataForm', dataFormData); form.render(null, 'dataForm');