From f48ccb53255f0572b327c324da4e138b4d890666 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Mon, 12 Mar 2018 14:51:46 +0800 Subject: [PATCH 1/2] add contract analysis webview --- .../mappers/system/ClientsContractMapper.java | 4 ++ .../system/core/ClientContractService.java | 3 + .../core/impl/ClientContractServiceImpl.java | 5 ++ .../manage/system/web/contractController.java | 26 +++++++ src/main/ui/manage.html | 6 ++ src/main/ui/static/sys/contract.js | 23 ++++++ .../static/sys/templates/contract_sign.html | 70 +++++++++++++++++++ 7 files changed, 137 insertions(+) create mode 100644 src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java create mode 100644 src/main/ui/static/sys/contract.js create mode 100644 src/main/ui/static/sys/templates/contract_sign.html diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.java index 043079965..17c9620d1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientsContractMapper.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.mappers.system; +import java.sql.SQLType; import java.util.List; import org.apache.ibatis.annotations.Param; @@ -23,4 +24,7 @@ public interface ClientsContractMapper { JSONObject findByClientId(@Param("client_id") int clientId); + @AutoSql(type = SqlType.SELECT) + List list(); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java b/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java index 9f57b23ea..902ef5e0f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java @@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.system.core; import com.alibaba.fastjson.JSONObject; +import java.util.List; + public interface ClientContractService { JSONObject getOrGenerateSourceAgreement(int client_id,String channel); @@ -12,4 +14,5 @@ public interface ClientContractService { JSONObject getClientContractExpire(int client_id); + List list(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java index 20d66a08d..ded7830fc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java @@ -186,4 +186,9 @@ public class ClientContractServiceImpl implements ClientContractService { return result; } + + @Override + public List list() { + return clientsContractMapper.list(); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java b/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java new file mode 100644 index 000000000..2d688dfe8 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java @@ -0,0 +1,26 @@ +package au.com.royalpay.payment.manage.system.web; + +import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; +import au.com.royalpay.payment.manage.system.core.ClientContractService; + +import com.alibaba.fastjson.JSONObject; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import javax.annotation.Resource; + +@RestController +@RequestMapping(value = "/manage/contract") +public class contractController { + @Resource + private ClientContractService clientContractService; + + @ManagerMapping(value = "/list",method = RequestMethod.GET) + public List list(){ + return clientContractService.list(); + } +} diff --git a/src/main/ui/manage.html b/src/main/ui/manage.html index ab8e0d12a..eb9f00859 100644 --- a/src/main/ui/manage.html +++ b/src/main/ui/manage.html @@ -328,6 +328,12 @@ margin-bottom: 10%;"/> 周末费率减半活动 +
  • + + 合同签约情况 + +
  • +
  • diff --git a/src/main/ui/static/sys/contract.js b/src/main/ui/static/sys/contract.js new file mode 100644 index 000000000..2ce9fba49 --- /dev/null +++ b/src/main/ui/static/sys/contract.js @@ -0,0 +1,23 @@ +/** + * Created by yishuqian on 01/06/2017. + */ +define(['angular'], function (angular) { + 'use strict'; + var app = angular.module('contractApp', ['ui.router']); + app.config(['$stateProvider', function ($stateProvider) { + $stateProvider.state('contract', { + url: '/contract', + templateUrl: '/static/sys/templates/contract_sign.html', + controller: 'contractAnalysisCtrl' + }) + }]); + app.controller('contractAnalysisCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) { + $scope.getContractAnalysis = function () { + $http.get('/manage/contract/list').then(function (resp) { + $scope.contract_analysis = resp.data; + }); + }; + $scope.getContractAnalysis(); + }]); + return app; +}); \ No newline at end of file diff --git a/src/main/ui/static/sys/templates/contract_sign.html b/src/main/ui/static/sys/templates/contract_sign.html new file mode 100644 index 000000000..ca4349457 --- /dev/null +++ b/src/main/ui/static/sys/templates/contract_sign.html @@ -0,0 +1,70 @@ + + + \ No newline at end of file From 69104c110c172b0b034171e4af516ac872db84f4 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 21 Mar 2018 15:20:05 +0800 Subject: [PATCH 2/2] update --- src/db/modify.sql | 4 +++- .../manage/system/core/impl/ClientContractServiceImpl.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index c9c30fa27..b859ad9a8 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -254,4 +254,6 @@ sign_channel varchar(10) not null , sign_account_id varchar(50) DEFAULT null, signatory varchar(20) DEFAULT null, PRIMARY key (`id`) -); \ No newline at end of file +); + +alter table sys_clients_contract add column confirm_time datetime DEFAULT null comment '合同确认时间'; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java index ded7830fc..b1aa97092 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java @@ -102,14 +102,15 @@ public class ClientContractServiceImpl implements ClientContractService { if(contract.getBoolean("has_sign")){ return; } + Date now = new Date(); JSONObject account = clientAccountMapper.findById(account_id); contract.put("has_sign", 1); contract.put("sign_account_id",account_id); contract.put("sign_channel",channel); + contract.put("confirm_time",now); contract.put("signatory",account.getString("display_name")); clientsContractMapper.update(contract); - Date now = new Date(); List rateInfo = clientRateMapper.minExpiryTime(client_id, null); if(expire){ rateInfo.forEach((p)->{