wangning 7 years ago
commit 7652436c54

@ -241,7 +241,7 @@ public interface ClientManager {
void setCustomerSurchargeRate(String clientMoniker, BigDecimal customer_surcharge_rate);
void setOrderExpiryConfig(String clientMoniker, String order_expiry_config);
void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig);
void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception;

@ -1673,18 +1673,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void setOrderExpiryConfig(String clientMoniker, String order_expiry_config) {
public void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject update = new JSONObject();
update.put("client_id", client.getIntValue("client_id"));
if (order_expiry_config != null) {
OrderExpiryRuleResolver.resolveExpiryTime("order_expiry_config", new Date());
if (orderExpiryConfig != null) {
OrderExpiryRuleResolver.resolveExpiryTime(orderExpiryConfig, new Date());
update.put("order_expiry_config", orderExpiryConfig);
clientMapper.update(update);
}
update.put("order_expiry_config", order_expiry_config == "" ? null : order_expiry_config);
clientMapper.update(update);
}
@Override

@ -0,0 +1,5 @@
/**
* file upload
* Created by yixian on 2016-07-04.
*/
package au.com.royalpay.payment.manage.support.attachment;

@ -0,0 +1,49 @@
package au.com.royalpay.payment.manage.support.attachment.web;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
*
* Created by yixian on 2016-05-05.
*/
@RestController
@RequestMapping("/attachment")
public class AttachmentController {
@Resource
private AttachmentClient attachmentClient;
@RequestMapping(value = "/files", method = RequestMethod.POST)
@RequirePartner
@RequireManager
public JSONObject uploadImage(@RequestParam MultipartFile file) throws IOException {
return attachmentClient.uploadFile(file,false);
}
@RequestMapping(value = "/secret_files", method = RequestMethod.POST)
@RequirePartner
@RequireManager
public JSONObject uploadFile(@RequestParam MultipartFile file) throws IOException {
return attachmentClient.uploadFile(file,true);
}
@RequestMapping(value = "/files/{fileId}", method = RequestMethod.GET)
public void getFileUrl(@PathVariable String fileId, HttpServletResponse response) throws IOException {
String url = attachmentClient.getFileUrl(fileId);
response.sendRedirect(url);
}
@RequestMapping(value = "/files/{fileId}/thumbnail",method = RequestMethod.GET)
public void getThumbnail(@PathVariable String fileId, HttpServletResponse response) throws IOException {
JSONObject thumbnail = attachmentClient.getThumbnail(fileId, 320);
response.sendRedirect(thumbnail.getString("url"));
}
}

@ -0,0 +1,21 @@
package au.com.royalpay.payment.manage.support.ueditor.core;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.multipart.MultipartFile;
/**
* Created by yixian on 2016-10-11.
*/
public interface UEditorApi {
JSONObject getAllConfigs();
JSONObject uploadImage(MultipartFile file);
JSONObject uploadFile(MultipartFile file);
JSONObject uploadScrawl(String base64String);
JSONObject listImages(int start);
JSONObject listFiles(int start);
}

@ -0,0 +1,134 @@
package au.com.royalpay.payment.manage.support.ueditor.core.impls;
import au.com.royalpay.payment.manage.support.ueditor.core.UEditorApi;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by yixian on 2016-10-11.
*/
@Service
public class UEditorApiImpl implements UEditorApi {
@Resource
private AttachmentClient attachmentClient;
private final int maxUploadSize = 5_000_000;
@Override
public JSONObject getAllConfigs() {
List<String> imageTypes = Arrays.asList(".png", ".jpg", ".jpeg", ".gif");
List<String> zipTypes = Arrays.asList(".zip", ".rar", ".gz", ".tar", ".7z");
List<String> documentTypes = Arrays.asList(".pdf", ".doc", ".docx", ".xls", ".xlsx");
JSONObject config = new JSONObject();
//图片上传
config.put("imageActionName", "uploadimage");
config.put("imageFieldName", "file");
config.put("imageMaxSize", maxUploadSize);
config.put("imageAllowFiles", imageTypes);
config.put("imageCompressEnable", true);
config.put("imageCompressBorder", 1600);
config.put("imageInsertAlign", "none");
config.put("imageUrlPrefix", "");
//涂鸦
config.put("scrawlActionName", "uploadscrawl");
config.put("scrawlFieldname", "file");
config.put("scrawlMaxSize", maxUploadSize);
config.put("scrawlUrlPrefix", "");
config.put("scrawlInsertAlign", "none");
//上传文件
config.put("fileActionName", "uploadfile");
config.put("fileFieldName", "file");
config.put("fileUrlPrefix", "");
config.put("fileMaxSize", maxUploadSize);
List<String> allTypes = new ArrayList<>();
allTypes.addAll(imageTypes);
allTypes.addAll(zipTypes);
allTypes.addAll(documentTypes);
config.put("fileAllowFiles", allTypes);
config.put("imageManagerActionName", "listimage");
config.put("imageManagerListSize", 20);
config.put("imageManagerUrlPrefix", "");
config.put("imageManagerInsertAlign", "none");
config.put("imageManagerAllowFiles", imageTypes);
config.put("fileManagerActionName", "listfile");
config.put("fileManagerUrlPrefix", "");
config.put("fileManagerListSize", 20);
config.put("fileManagerAllowFiles", allTypes);
return config;
}
@Override
public JSONObject uploadImage(MultipartFile file) {
return upload(file);
}
private JSONObject upload(MultipartFile file) {
try {
JSONObject uploadResult = attachmentClient.uploadFile(file, false);
return buildResult(uploadResult);
} catch (IOException e) {
throw new ServerErrorException(e);
}
}
private JSONObject buildResult(JSONObject uploadResult) {
JSONObject res = new JSONObject();
res.put("state", "SUCCESS");
res.put("size", uploadResult.getLongValue("length"));
res.put("name", uploadResult.getString("original_filename"));
res.put("original", uploadResult.getString("original_filename"));
res.put("url", uploadResult.getString("url"));
res.put("type", "." + uploadResult.getString("filetype"));
return res;
}
@Override
public JSONObject uploadFile(MultipartFile file) {
return upload(file);
}
@Override
public JSONObject uploadScrawl(String base64String) {
byte[] bytes = Base64.decodeBase64(base64String);
InputStream ins = new ByteArrayInputStream(bytes);
JSONObject uploadResult = attachmentClient.uploadFile(ins, "scrawl.jpg", false);
return buildResult(uploadResult);
}
@Override
public JSONObject listImages(int start) {
return emptyResult(start);
}
@Override
public JSONObject listFiles(int start) {
return emptyResult(start);
}
private JSONObject emptyResult(int start) {
JSONObject res = new JSONObject();
res.put("state","SUCCESS");
res.put("start",start);
res.put("total",0);
res.put("list",new ArrayList<JSONObject>());
//{url:...,mtime:seconds stamp}
return res;
}
}

@ -0,0 +1,51 @@
package au.com.royalpay.payment.manage.support.ueditor.web;
import au.com.royalpay.payment.manage.support.ueditor.core.UEditorApi;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
* Created by yixian on 2016-10-11.
*/
@RestController
@RequestMapping("/api/ueditor_api")
public class UEditorApiController {
@Resource
private UEditorApi uEditorApi;
@RequestMapping(method = RequestMethod.GET, params = "action=config")
public JSONObject getActionConfig() {
return uEditorApi.getAllConfigs();
}
@RequestMapping(method = RequestMethod.POST, params = "action=uploadimage")
public JSONObject uploadImage(@RequestParam MultipartFile file) {
return uEditorApi.uploadImage(file);
}
@RequestMapping(method = RequestMethod.POST, params = "action=uploadfile")
public JSONObject uploadFile(@RequestParam MultipartFile file) {
return uEditorApi.uploadFile(file);
}
@RequestMapping(method = RequestMethod.POST, params = "action=uploadscrawl")
public JSONObject uploadScrawl(@RequestParam String file) {
return uEditorApi.uploadScrawl(file);
}
@RequestMapping(method = RequestMethod.POST, params = "action=listimage")
public JSONObject listImages(@RequestParam(defaultValue = "0") int start) {
return uEditorApi.listImages(start);
}
@RequestMapping(method = RequestMethod.POST, params = "action=listfile")
public JSONObject listFiles(@RequestParam(defaultValue = "0") int start) {
return uEditorApi.listFiles(start);
}
}

@ -10,17 +10,23 @@ body {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
div, span, p, ul, li ,button,img{
div, span, p, ul, li {
box-sizing: border-box;
}
.weui_grid {
padding: 7px;
height: 49px;
.ff.key {
position: relative;
}
.ff {
font-size: 24px;
font-size: 26px;
color: #333333;
}
.ff img {
margin: 10px auto;
display: block;
width: 34px;
}
div.wait {
@ -43,13 +49,13 @@ div.wait {
color: #aaaaaa;
text-align: center;
margin-top: 10px;
margin-bottom: 10px;
}
.rmbcurrency {
font-size: 18px;
color: #777777;
color: #888888;
vertical-align: text-bottom;
margin-left: 10px;
line-height: 38px;
}
@ -60,10 +66,20 @@ div.wait {
.rmbvalue {
font-size: 24px;
color: #777777;
color: #888888;
vertical-align: text-bottom;
float: right;
padding-right: 10px;
}
.rmbvalue:before {
content: '≈¥';
font-size: 16px;
}
.paydetail {
float: right;
margin-top: 5px;
margin-left: 5px;
}
.static .rmbvalue {
@ -71,10 +87,11 @@ div.wait {
}
.currency {
font-size: 33px;
color: #3cc51f;
font-size: 40px;
color: #000;
line-height: 66px;
vertical-align: text-bottom;
padding-left: 10px;
margin-right: 10px;
}
.static .currency {
@ -83,12 +100,11 @@ div.wait {
}
.value {
font-size: 32px;
color: #3cc51f;
font-size: 40px;
line-height: 66px;
color: #000;
margin-left: -5px;
text-align: right;
vertical-align: text-bottom;
float: right;
padding-right: 10px;
}
@ -127,6 +143,7 @@ input.value:focus {
.row {
width: 100%;
padding: 0 20px;
}
.hidden {
@ -173,7 +190,7 @@ input.value:focus {
width: 100%;
}
.logo-box .banner{
.logo-box .banner {
width: 100%;
display: block;
}
@ -182,28 +199,24 @@ input.value:focus {
margin: auto;
display: block;
margin-top: 20px;
max-height: 150px;
max-height: 60px;
max-width: 80%;
}
.logo-small {
max-height: 100px;
.logo-box {
margin-bottom: 280px;
}
.paynow {
height: 55px;
line-height: 55px;
padding: 0px;
top: 6px;
font-size: 25px;
margin-left: 5px;
margin-right: 5px;
border-radius: 0;
margin-top: 0 !important;
.logo-small {
max-height: 100px;
}
.currencyrow {
box-sizing: border-box;
margin-top: 20px;
text-align: left;
margin-bottom: 20px;
background: #fff;
}
.currencyrow:after {
@ -214,18 +227,28 @@ input.value:focus {
.currencyrow > * {
display: inline-block;
float: left;
vertical-align: bottom;
margin-bottom: 0;
width: 50%;
box-sizing: border-box;
}
.currencyrow > .remark-btn {
float: right;
display: block;
width: 30px;
height: 30px;
margin-top: 17px;
background: url(../../../images/remark_btn.png) no-repeat;
background-size: cover;
}
.remark-input {
width: 100%;
font-size: 26px;
border-radius: 0;
outline: none;
background: #FFFFFF;
border: 1px solid #E9E9E9;
}
.remark-box {
@ -252,95 +275,216 @@ input.value:focus {
.coupons {
width: 100%;
margin-top: -1px;
background: #fff;
max-height: 350px;
overflow: auto;
padding: 0 10px;
border-radius: 0 0 6px 6px;
}
.coupons > li {
display: block;
width: 100%;
border-bottom: 1px dashed #aaa;
padding: 5px;
position: relative;
float: none;
color: #888888;
border-radius: 6px;
padding: 10px;
margin: 15px 0;
background: #fff;
box-shadow: 0 0 10px #aaa;
}
.coupons > li:after {
content: '';
clear: both;
display: block
}
.coupons > li:last-child {
border: none;
border-radius: 0 15px 15px 0;
}
.coupons > li:before {
content: '惠';
color: #fff;
background: #f00;
margin: 5px;
text-align: center;
width: 20px;
height: 20px;
box-sizing: border-box;
font-size: 0.6em;
font-weight: bold;
left: -5px;
position: absolute;
.coupons > li .coupon-content {
position: relative;
width: 100%;
border-radius: 4px;
border: 1px dashed #aaa;
padding: 10px 15px;
}
.coupons .title, .coupons .desc, .coupons label {
display: block;
margin-left: 20px;
}
.coupons .coupon-content {
display: block;
float: left;
}
.coupons .title {
font-weight: bold;
font-size: 1em;
color: #000000;
position: relative;
}
.coupon-background-image {
width: 100%;
}
.coupon-logo {
height: 25px;
padding-right: 5px;
position: relative;
top: 6px;
}
.coupon-image {
width: 100%;
position: relative;
display: block;
}
.coupon-box-title .coupon-image {
margin: 0;
}
.coupons .use-check {
position: absolute;
right: 25px;
top: 14px;
width: 25px;
background-repeat: no-repeat;
height: 25px;
background-size: contain;
display: block;
top: 0;
background-size: cover;
width: 34px;
height: 34px;
right: 0;
}
.coupons .use-check.checked {
background-image: url(/static/images/checkbox-checked.png);
background-image: url(/static/images/coupon_checked@3x.png);
}
.coupons .use-check.unchecked {
background-image: url(/static/images/checkbox-unchecked.png);
background-image: url(/static/images/coupon_unchecked@2x.png);
}
.coupons .use-check.disabled{
background-image: url(/static/images/checkbox-disabled.png)!important;
.coupons .use-check.disabled {
background-image: url(/static/images/coupon_disabled@2x.png) !important;
}
.coupons .desc {
font-size: 0.8em;
font-size: 13px;
color: #323200;
margin-top: 5px;
letter-spacing: 0px;
position: relative;
line-height: 18px;
}
.weui-wepay-logos {
background: transparent;
}
.row.weui_grids:before, .row.weui_grids .weui_grid:before, .row.weui_grids .weui_grid:after {
display: none;
}
.goodpay {
height: 55px;
line-height: 55px;
padding: 0px;
top: 6px;
font-size: 25px;
border-radius: 0;
margin-top: 0 !important;
.keyboard-grids {
padding: 0;
margin-top: 10px;
background: #fff;
position: fixed;
bottom: 0;
}
.weui_cell:before{
left:0;
.keyboard-grids:after {
display: block;
content: '';
clear: both;
}
.keyboard-grids .key {
float: left;
position: relative;
width: 25%;
text-align: center;
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
margin-right: -1px;
margin-bottom: -1px;
height: 60px;
line-height: 60px;
}
.keyboard-grids .key.del > img {
height: 24px;
display: block;
position: relative;
margin: 19px auto;
}
.keyboard-grids .key.paynow {
height: 180px;
float: right;
background: #09bb07;
color: #fff;
}
.keyboard-grids .key.paynow.alipay {
background: #108ee9;
}
.alipay {
color: #108ee9;
}
.wechat {
color: #09bb07;
}
.keyboard-grids .key.paynow > .label {
display: block;
position: absolute;
width: 100%;
text-align: center;
top: 50%;
transform: translateY(-50%);
}
.keyboard-grids .key.zero-btn {
width: 50%;
}
.pay-brands {
text-align: center;
line-height: 20px;
font-size: 24px;
position: fixed;
width: 100%;
padding-top: 5px;
padding-bottom: 10px;
bottom: 240px;
color: #dddddd;
background: #fbf9fe;
}
.pay-brands img {
height: 18px;
}
.pay-brands img.wechat-logo {
height: 14px;
}
.weui_dialog_bd .final {
font-weight: bold;
}
#coupon-box-toggle {
padding: 0 20px;
margin-bottom: 10px;
margin-top: 10px;
text-align: right;
color: #30af69;
font-size: 12px;
cursor: pointer;
}
@ -356,7 +500,7 @@ input.value:focus {
display: none;
}
.coupons-container.show{
.coupons-container.show {
display: block;
}
@ -376,35 +520,66 @@ input.value:focus {
left: 50%;
top: 50%;
width: 95%;
background: #fff;
padding: 10px;
transform: translate(-50%, -50%);
}
.coupons-container .coupon-box-title{
.coupons-container .coupon-box-title {
width: 100%;
display: block;
background: #fff;
padding: 0 10px 5px;
font-size: 14px;
border-bottom: 1px solid #d0d0d0;
position: relative;
}
.coupons-container .coupon-box-title:after{
.coupons-container .coupon-box-title:after {
content: '';
display: block;
clear: both;
}
.coupons-container .coupon-box-title>.title{
float: left;
.coupon-close-image {
width: 30px;
}
.coupons-container .coupon-box-title > .title {
display: block;
color: #0BB20C;
text-align: center;
font-size: 18px;
color: #FFFFFF;
position: absolute;
width: 100%;
bottom: 34%;
}
.coupons-container .coupon-box-title>#close-coupon-box{
.coupons-container .coupon-box-title > #close-coupon-box {
color: #700;
float: right;
position: absolute;
display: block;
cursor: pointer;
top: -40px;
right: 0;
}
textarea::-webkit-input-placeholder {
font-size: 14px;
color: #AAAAAA;
letter-spacing: 0px;
}
textarea {
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
-webkit-appearance: none;
resize: none;
}
input {
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
-webkit-appearance: none;
resize: none;
}
.weui_dialog_ft:after {
border-top: 0;
}
.weui_dialog {
border-radius: 5px;
}
Loading…
Cancel
Save